OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
windowmanager.hpp
Go to the documentation of this file.
1 #ifndef GAME_MWBASE_WINDOWMANAGER_H
2 #define GAME_MWBASE_WINDOWMANAGER_H
3 
4 #include <stdint.h>
5 #include <string>
6 #include <vector>
7 #include <map>
8 #include <set>
9 
10 #include "../mwgui/mode.hpp"
11 
12 namespace Loading
13 {
14  class Listener;
15 }
16 
17 namespace Translation
18 {
19  class Storage;
20 }
21 
22 namespace MyGUI
23 {
24  class Gui;
25  class Widget;
26  class UString;
27 }
28 
29 namespace ESM
30 {
31  struct Class;
32  class ESMReader;
33  class ESMWriter;
34  struct CellId;
35 }
36 
37 namespace MWMechanics
38 {
39  class AttributeValue;
40  template<typename T>
41  class DynamicStat;
42  class SkillValue;
43 }
44 
45 namespace MWWorld
46 {
47  class CellStore;
48  class Ptr;
49 }
50 
51 namespace MWGui
52 {
53  class Layout;
54 
55  class Console;
56  class SpellWindow;
57  class TradeWindow;
58  class TravelWindow;
59  class SpellBuyingWindow;
60  class ConfirmationDialog;
61  class CountDialog;
62  class ScrollWindow;
63  class BookWindow;
64  class InventoryWindow;
65  class ContainerWindow;
66  class DialogueWindow;
67  class WindowModal;
68  class JailScreen;
69 
74  };
75 }
76 
77 namespace SFO
78 {
79  class CursorManager;
80 }
81 
82 namespace MWBase
83 {
86  {
89 
92 
93  public:
94 
95  typedef std::vector<int> SkillList;
96 
98 
99  virtual ~WindowManager() {}
100 
106  virtual void update() = 0;
107 
110  virtual void playVideo(const std::string& name, bool allowSkipping) = 0;
111 
112  virtual void setNewGame(bool newgame) = 0;
113 
114  virtual void pushGuiMode (MWGui::GuiMode mode) = 0;
115  virtual void popGuiMode() = 0;
116 
117  virtual void removeGuiMode (MWGui::GuiMode mode) = 0;
119 
120  virtual void goToJail(int days) = 0;
121 
122  virtual void updatePlayer() = 0;
123 
124  virtual MWGui::GuiMode getMode() const = 0;
125  virtual bool containsMode(MWGui::GuiMode) const = 0;
126 
127  virtual bool isGuiMode() const = 0;
128 
129  virtual bool isConsoleMode() const = 0;
130 
131  virtual void toggleVisible (MWGui::GuiWindow wnd) = 0;
132 
133  virtual void forceHide(MWGui::GuiWindow wnd) = 0;
134  virtual void unsetForceHide(MWGui::GuiWindow wnd) = 0;
135 
137  virtual void disallowAll() = 0;
138 
140  virtual void allow (MWGui::GuiWindow wnd) = 0;
141 
142  virtual bool isAllowed (MWGui::GuiWindow wnd) const = 0;
143 
147  virtual MWGui::CountDialog* getCountDialog() = 0;
149  virtual MWGui::TradeWindow* getTradeWindow() = 0;
150 
152  virtual void useItem(const MWWorld::Ptr& item) = 0;
153 
154  virtual void updateSpellWindow() = 0;
155 
156  virtual void setConsoleSelectedObject(const MWWorld::Ptr& object) = 0;
157 
159  virtual void setValue (const std::string& id, const MWMechanics::AttributeValue& value) = 0;
160  virtual void setValue (int parSkill, const MWMechanics::SkillValue& value) = 0;
161  virtual void setValue (const std::string& id, const MWMechanics::DynamicStat<float>& value) = 0;
162  virtual void setValue (const std::string& id, const std::string& value) = 0;
163  virtual void setValue (const std::string& id, int value) = 0;
164 
168  virtual void setDrowningTimeLeft (float time, float maxTime) = 0;
169 
170  virtual void setPlayerClass (const ESM::Class &class_) = 0;
172 
173  virtual void configureSkills (const SkillList& major, const SkillList& minor) = 0;
175 
176  virtual void updateSkillArea() = 0;
178 
179  virtual void changeCell(const MWWorld::CellStore* cell) = 0;
181 
182  virtual void setFocusObject(const MWWorld::Ptr& focus) = 0;
183  virtual void setFocusObjectScreenCoords(float min_x, float min_y, float max_x, float max_y) = 0;
184 
185  virtual void setCursorVisible(bool visible) = 0;
186  virtual void getMousePosition(int &x, int &y) = 0;
187  virtual void getMousePosition(float &x, float &y) = 0;
188  virtual void setDragDrop(bool dragDrop) = 0;
189  virtual bool getWorldMouseOver() = 0;
190 
191  virtual bool toggleFogOfWar() = 0;
192 
193  virtual bool toggleFullHelp() = 0;
195 
196  virtual bool getFullHelp() const = 0;
197 
198  virtual void setActiveMap(int x, int y, bool interior) = 0;
200 
202  virtual void setDrowningBarVisibility(bool visible) = 0;
203 
205  virtual void setHMSVisibility(bool visible) = 0;
206 
208  virtual void setMinimapVisibility(bool visible) = 0;
209  virtual void setWeaponVisibility(bool visible) = 0;
210  virtual void setSpellVisibility(bool visible) = 0;
211  virtual void setSneakVisibility(bool visible) = 0;
212 
213  virtual void activateQuickKey (int index) = 0;
214 
215  virtual std::string getSelectedSpell() = 0;
216  virtual void setSelectedSpell(const std::string& spellId, int successChancePercent) = 0;
217  virtual void setSelectedEnchantItem(const MWWorld::Ptr& item) = 0;
218  virtual void setSelectedWeapon(const MWWorld::Ptr& item) = 0;
219  virtual void unsetSelectedSpell() = 0;
220  virtual void unsetSelectedWeapon() = 0;
221 
222  virtual void showCrosshair(bool show) = 0;
223  virtual bool getSubtitlesEnabled() = 0;
224  virtual bool toggleGui() = 0;
225 
226  virtual void disallowMouse() = 0;
227  virtual void allowMouse() = 0;
228  virtual void notifyInputActionBound() = 0;
229 
230  virtual void addVisitedLocation(const std::string& name, int x, int y) = 0;
231 
233  virtual void removeDialog(MWGui::Layout* dialog) = 0;
234 
236 
237  virtual void exitCurrentGuiMode() = 0;
238 
239  virtual void messageBox (const std::string& message, enum MWGui::ShowInDialogueMode showInDialogueMode = MWGui::ShowInDialogueMode_IfPossible) = 0;
240  virtual void staticMessageBox(const std::string& message) = 0;
241  virtual void removeStaticMessageBox() = 0;
242  virtual void interactiveMessageBox (const std::string& message,
243  const std::vector<std::string>& buttons = std::vector<std::string>(), bool block=false) = 0;
244 
246  virtual int readPressedButton() = 0;
247 
248  virtual void onFrame (float frameDuration) = 0;
249 
251  virtual std::map<int, MWMechanics::SkillValue > getPlayerSkillValues() = 0;
252  virtual std::map<int, MWMechanics::AttributeValue > getPlayerAttributeValues() = 0;
253  virtual SkillList getPlayerMinorSkills() = 0;
254  virtual SkillList getPlayerMajorSkills() = 0;
255 
263  virtual std::string getGameSettingString(const std::string &id, const std::string &default_) = 0;
264 
265  virtual void processChangedSettings(const std::set< std::pair<std::string, std::string> >& changed) = 0;
266 
267  virtual void windowResized(int x, int y) = 0;
268 
269  virtual void executeInConsole (const std::string& path) = 0;
270 
271  virtual void enableRest() = 0;
272  virtual bool getRestEnabled() = 0;
273  virtual bool getJournalAllowed() = 0;
274 
275  virtual bool getPlayerSleeping() = 0;
276  virtual void wakeUpPlayer() = 0;
277 
278  virtual void showCompanionWindow(MWWorld::Ptr actor) = 0;
279  virtual void startSpellMaking(MWWorld::Ptr actor) = 0;
280  virtual void startEnchanting(MWWorld::Ptr actor) = 0;
281  virtual void startRecharge(MWWorld::Ptr soulgem) = 0;
282  virtual void startSelfEnchanting(MWWorld::Ptr soulgem) = 0;
283  virtual void startTraining(MWWorld::Ptr actor) = 0;
284  virtual void startRepair(MWWorld::Ptr actor) = 0;
285  virtual void startRepairItem(MWWorld::Ptr item) = 0;
286  virtual void startTravel(const MWWorld::Ptr& actor) = 0;
287  virtual void startSpellBuying(const MWWorld::Ptr& actor) = 0;
288  virtual void startTrade(const MWWorld::Ptr& actor) = 0;
289  virtual void openContainer(const MWWorld::Ptr& container, bool loot) = 0;
290  virtual void showBook(const MWWorld::Ptr& item, bool showTakeButton) = 0;
291  virtual void showScroll(const MWWorld::Ptr& item, bool showTakeButton) = 0;
292 
293  virtual void showSoulgemDialog (MWWorld::Ptr item) = 0;
294 
295  virtual void changePointer (const std::string& name) = 0;
296 
297  virtual void setEnemy (const MWWorld::Ptr& enemy) = 0;
298 
299  virtual const Translation::Storage& getTranslationDataStorage() const = 0;
300 
302  virtual void setKeyFocusWidget (MyGUI::Widget* widget) = 0;
303 
304  virtual Loading::Listener* getLoadingScreen() = 0;
305 
307  virtual bool getCursorVisible() = 0;
308 
310  virtual void clear() = 0;
311 
312  virtual void write (ESM::ESMWriter& writer, Loading::Listener& progress) = 0;
313  virtual void readRecord (ESM::ESMReader& reader, uint32_t type) = 0;
314  virtual int countSavedGameRecords() const = 0;
315 
317  virtual bool isSavingAllowed() const = 0;
318 
320  virtual void exitCurrentModal() = 0;
321 
323 
324  virtual void addCurrentModal(MWGui::WindowModal* input) = 0;
325 
327 
329  virtual void removeCurrentModal(MWGui::WindowModal* input) = 0;
330 
331  virtual void pinWindow (MWGui::GuiWindow window) = 0;
332 
334  virtual void fadeScreenIn(const float time, bool clearQueue=true) = 0;
336  virtual void fadeScreenOut(const float time, bool clearQueue=true) = 0;
338  virtual void fadeScreenTo(const int percent, const float time, bool clearQueue=true) = 0;
340  virtual void setBlindness(const int percent) = 0;
341 
342  virtual void activateHitOverlay(bool interrupt=true) = 0;
343  virtual void setWerewolfOverlay(bool set) = 0;
344 
345  virtual void toggleDebugWindow() = 0;
346 
348  virtual void cycleSpell(bool next) = 0;
350  virtual void cycleWeapon(bool next) = 0;
351 
352  // In WindowManager for now since there isn't a VFS singleton
353  virtual std::string correctIconPath(const std::string& path) = 0;
354  virtual std::string correctBookartPath(const std::string& path, int width, int height) = 0;
355  virtual std::string correctTexturePath(const std::string& path) = 0;
356  virtual bool textureExists(const std::string& path) = 0;
357 
358  virtual void removeCell(MWWorld::CellStore* cell) = 0;
359  virtual void writeFog(MWWorld::CellStore* cell) = 0;
360  };
361 }
362 
363 #endif
Definition: tradewindow.hpp:25
virtual void setConsoleSelectedObject(const MWWorld::Ptr &object)=0
virtual bool toggleFogOfWar()=0
WindowManager()
Definition: windowmanager.hpp:97
Definition: inventorywindow.hpp:37
virtual void showCompanionWindow(MWWorld::Ptr actor)=0
virtual bool textureExists(const std::string &path)=0
void message(CodeContainer &code, Literals &literals, const std::string &message, int buttons)
Definition: generator.cpp:537
Definition: stat.hpp:108
Definition: confirmationdialog.hpp:8
virtual void setFocusObject(const MWWorld::Ptr &focus)=0
virtual void unsetForceHide(MWGui::GuiWindow wnd)=0
virtual void startTrade(const MWWorld::Ptr &actor)=0
virtual void addCurrentModal(MWGui::WindowModal *input)=0
Sets the current Modal.
virtual void showBook(const MWWorld::Ptr &item, bool showTakeButton)=0
virtual void setSpellVisibility(bool visible)=0
virtual bool getSubtitlesEnabled()=0
Definition: countdialog.hpp:13
virtual bool isGuiMode() const =0
Definition: esmreader.hpp:21
virtual void startRecharge(MWWorld::Ptr soulgem)=0
virtual void updatePlayer()=0
virtual void setSelectedWeapon(const MWWorld::Ptr &item)=0
virtual void setSneakVisibility(bool visible)=0
virtual void setDrowningTimeLeft(float time, float maxTime)=0
virtual void unsetSelectedWeapon()=0
virtual bool toggleGui()=0
virtual Loading::Listener * getLoadingScreen()=0
virtual void onFrame(float frameDuration)=0
virtual void useItem(const MWWorld::Ptr &item)=0
Make the player use an item, while updating GUI state accordingly.
virtual void updateSkillArea()=0
update display of skills, factions, birth sign, reputation and bounty
virtual void updateSpellWindow()=0
virtual std::string correctBookartPath(const std::string &path, int width, int height)=0
virtual ~WindowManager()
Definition: windowmanager.hpp:99
virtual void interactiveMessageBox(const std::string &message, const std::vector< std::string > &buttons=std::vector< std::string >(), bool block=false)=0
virtual bool getPlayerSleeping()=0
virtual void exitCurrentGuiMode()=0
Gracefully attempts to exit the topmost GUI mode.
virtual void disallowMouse()=0
virtual void unsetSelectedSpell()=0
Definition: translation.hpp:9
virtual MWGui::CountDialog * getCountDialog()=0
virtual void staticMessageBox(const std::string &message)=0
virtual std::map< int, MWMechanics::SkillValue > getPlayerSkillValues()=0
Definition: windowmanager.hpp:71
virtual void setActiveMap(int x, int y, bool interior)=0
set the indices of the map texture that should be used
virtual std::string getSelectedSpell()=0
Definition: loadinglistener.hpp:8
virtual void fadeScreenTo(const int percent, const float time, bool clearQueue=true)=0
Fade the screen to a specified percentage of black, over time seconds.
virtual void addVisitedLocation(const std::string &name, int x, int y)=0
virtual std::string correctTexturePath(const std::string &path)=0
virtual void setHMSVisibility(bool visible)=0
sets the visibility of the hud health/magicka/stamina bars
virtual void fadeScreenOut(const float time, bool clearQueue=true)=0
Fade the screen out to black, over time seconds.
virtual void toggleDebugWindow()=0
virtual void showSoulgemDialog(MWWorld::Ptr item)=0
virtual void showCrosshair(bool show)=0
Definition: dialogue.hpp:97
virtual bool isConsoleMode() const =0
virtual bool getCursorVisible()=0
Should the cursor be visible?
virtual const Translation::Storage & getTranslationDataStorage() const =0
virtual void exitCurrentModal()=0
Send exit command to active Modal window.
virtual void forceHide(MWGui::GuiWindow wnd)=0
virtual void setValue(const std::string &id, const MWMechanics::AttributeValue &value)=0
Set value for the given ID.
virtual void removeStaticMessageBox()=0
virtual void cycleWeapon(bool next)=0
Cycle to next or previous weapon.
virtual std::map< int, MWMechanics::AttributeValue > getPlayerAttributeValues()=0
Definition: esmwriter.hpp:17
virtual void removeCell(MWWorld::CellStore *cell)=0
virtual void popGuiMode()=0
virtual SkillList getPlayerMinorSkills()=0
virtual MWGui::InventoryWindow * getInventoryWindow()=0
virtual int readPressedButton()=0
returns the index of the pressed button or -1 if no button was pressed (->MessageBoxmanager->Interact...
virtual void startRepairItem(MWWorld::Ptr item)=0
virtual void startEnchanting(MWWorld::Ptr actor)=0
virtual void windowResized(int x, int y)=0
virtual void startSpellBuying(const MWWorld::Ptr &actor)=0
virtual void pinWindow(MWGui::GuiWindow window)=0
virtual bool getRestEnabled()=0
virtual void showScroll(const MWWorld::Ptr &item, bool showTakeButton)=0
virtual void messageBox(const std::string &message, enum MWGui::ShowInDialogueMode showInDialogueMode=MWGui::ShowInDialogueMode_IfPossible)=0
Interface for widnow manager (implemented in MWGui)
Definition: windowmanager.hpp:85
GuiWindow
Definition: mode.hpp:55
virtual void allow(MWGui::GuiWindow wnd)=0
Allow one or more windows.
virtual bool getWorldMouseOver()=0
virtual void enableRest()=0
virtual void setSelectedSpell(const std::string &spellId, int successChancePercent)=0
virtual void goToJail(int days)=0
WindowManager & operator=(const WindowManager &)
not implemented
virtual void changeCell(const MWWorld::CellStore *cell)=0
change the active cell
virtual void executeInConsole(const std::string &path)=0
virtual void startSpellMaking(MWWorld::Ptr actor)=0
virtual void notifyInputActionBound()=0
Definition: windowmanager.hpp:72
virtual void configureSkills(const SkillList &major, const SkillList &minor)=0
configure skill groups, each set contains the skill ID for that group.
Mutable state of a cell.
Definition: cellstore.hpp:53
virtual bool isSavingAllowed() const =0
Does the current stack of GUI-windows permit saving?
ShowInDialogueMode
Definition: windowmanager.hpp:70
virtual void startTraining(MWWorld::Ptr actor)=0
virtual void processChangedSettings(const std::set< std::pair< std::string, std::string > > &changed)=0
virtual void clear()=0
Clear all savegame-specific data.
virtual void toggleVisible(MWGui::GuiWindow wnd)=0
Definition: windowmanager.hpp:41
virtual void setKeyFocusWidget(MyGUI::Widget *widget)=0
Warning: do not use MyGUI::InputManager::setKeyFocusWidget directly. Instead use this.
virtual void setWeaponVisibility(bool visible)=0
virtual void pushGuiMode(MWGui::GuiMode mode)=0
virtual void update()=0
virtual void startRepair(MWWorld::Ptr actor)=0
virtual void write(ESM::ESMWriter &writer, Loading::Listener &progress)=0
virtual void setDrowningBarVisibility(bool visible)=0
sets the visibility of the drowning bar
virtual void setBlindness(const int percent)=0
Darken the screen to a specified percentage.
virtual MWGui::TradeWindow * getTradeWindow()=0
virtual void setSelectedEnchantItem(const MWWorld::Ptr &item)=0
virtual void startTravel(const MWWorld::Ptr &actor)=0
virtual bool toggleFullHelp()=0
show extra info in item tooltips (owner, script)
virtual void getMousePosition(int &x, int &y)=0
virtual void setMinimapVisibility(bool visible)=0
sets the visibility of the hud minimap
virtual void fadeScreenIn(const float time, bool clearQueue=true)=0
Fade the screen in, over time seconds.
virtual void setPlayerClass(const ESM::Class &class_)=0
set current class of player
virtual void setCursorVisible(bool visible)=0
virtual bool isAllowed(MWGui::GuiWindow wnd) const =0
Definition: layout.hpp:13
virtual void removeCurrentModal(MWGui::WindowModal *input)=0
Removes the top Modal.
virtual void playVideo(const std::string &name, bool allowSkipping)=0
virtual void removeDialog(MWGui::Layout *dialog)=0
Hides dialog and schedules dialog to be deleted.
virtual MWGui::ConfirmationDialog * getConfirmationDialog()=0
GuiMode
Definition: mode.hpp:6
virtual void activateHitOverlay(bool interrupt=true)=0
Definition: windowmanager.hpp:73
virtual void readRecord(ESM::ESMReader &reader, uint32_t type)=0
virtual void setFocusObjectScreenCoords(float min_x, float min_y, float max_x, float max_y)=0
virtual bool getJournalAllowed()=0
Definition: loadclas.hpp:18
virtual void disallowAll()=0
Disallow all inventory mode windows.
Definition: stat.hpp:137
virtual void removeGuiMode(MWGui::GuiMode mode)=0
can be anywhere in the stack
virtual void setNewGame(bool newgame)=0
virtual void setWerewolfOverlay(bool set)=0
virtual void cycleSpell(bool next)=0
Cycle to next or previous spell.
virtual MWGui::GuiMode getMode() const =0
std::vector< int > SkillList
Definition: windowmanager.hpp:95
virtual MWGui::DialogueWindow * getDialogueWindow()=0
virtual SkillList getPlayerMajorSkills()=0
virtual int countSavedGameRecords() const =0
virtual void writeFog(MWWorld::CellStore *cell)=0
virtual std::string getGameSettingString(const std::string &id, const std::string &default_)=0
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
virtual void setEnemy(const MWWorld::Ptr &enemy)=0
virtual void changePointer(const std::string &name)=0
virtual bool containsMode(MWGui::GuiMode) const =0
virtual void setDragDrop(bool dragDrop)=0
virtual void wakeUpPlayer()=0
virtual void allowMouse()=0
virtual void startSelfEnchanting(MWWorld::Ptr soulgem)=0
virtual void activateQuickKey(int index)=0
Definition: windowbase.hpp:41
virtual bool getFullHelp() const =0
virtual void openContainer(const MWWorld::Ptr &container, bool loot)=0
const char * name
Definition: crashcatcher.cpp:59
virtual std::string correctIconPath(const std::string &path)=0