OpenMW
apps/openmw/mwbase/windowmanager.hpp
Go to the documentation of this file.
00001 #ifndef GAME_MWBASE_WINDOWMANAGER_H
00002 #define GAME_MWBASE_WINDOWMANAGER_H
00003 
00004 #include <string>
00005 #include <vector>
00006 #include <map>
00007 
00008 #include <components/settings/settings.hpp>
00009 
00010 #include <components/translation/translation.hpp>
00011 
00012 #include <components/loadinglistener/loadinglistener.hpp>
00013 
00014 #include "../mwmechanics/stat.hpp"
00015 
00016 #include "../mwgui/mode.hpp"
00017 
00018 namespace MyGUI
00019 {
00020     class Gui;
00021     class Widget;
00022     class UString;
00023 }
00024 
00025 namespace OEngine
00026 {
00027     namespace GUI
00028     {
00029         class Layout;
00030     }
00031 }
00032 
00033 namespace ESM
00034 {
00035     struct Class;
00036 }
00037 
00038 namespace MWWorld
00039 {
00040     class CellStore;
00041     class Ptr;
00042 }
00043 
00044 namespace MWGui
00045 {
00046     class Console;
00047     class SpellWindow;
00048     class TradeWindow;
00049     class TravelWindow;
00050     class SpellBuyingWindow;
00051     class ConfirmationDialog;
00052     class CountDialog;
00053     class ScrollWindow;
00054     class BookWindow;
00055     class InventoryWindow;
00056     class ContainerWindow;
00057     class DialogueWindow;
00058 }
00059 
00060 namespace SFO
00061 {
00062     class CursorManager;
00063 }
00064 
00065 namespace MWBase
00066 {
00068     class WindowManager
00069     {
00070             WindowManager (const WindowManager&);
00072 
00073             WindowManager& operator= (const WindowManager&);
00075 
00076         public:
00077 
00078             typedef std::vector<int> SkillList;
00079 
00080             WindowManager() {}
00081 
00082             virtual ~WindowManager() {}
00083 
00089             virtual void update() = 0;
00090 
00091             virtual void setNewGame(bool newgame) = 0;
00092 
00093             virtual void pushGuiMode (MWGui::GuiMode mode) = 0;
00094             virtual void popGuiMode() = 0;
00095 
00096             virtual void removeGuiMode (MWGui::GuiMode mode) = 0;
00098 
00099             virtual void updatePlayer() = 0;
00100 
00101             virtual MWGui::GuiMode getMode() const = 0;
00102             virtual bool containsMode(MWGui::GuiMode) const = 0;
00103 
00104             virtual bool isGuiMode() const = 0;
00105 
00106             virtual bool isConsoleMode() const = 0;
00107 
00108             virtual void toggleVisible (MWGui::GuiWindow wnd) = 0;
00109 
00110             virtual void forceHide(MWGui::GuiWindow wnd) = 0;
00111             virtual void unsetForceHide(MWGui::GuiWindow wnd) = 0;
00112 
00114             virtual void disallowAll() = 0;
00115 
00117             virtual void allow (MWGui::GuiWindow wnd) = 0;
00118 
00119             virtual bool isAllowed (MWGui::GuiWindow wnd) const = 0;
00120 
00122             virtual MWGui::DialogueWindow* getDialogueWindow() = 0;
00123             virtual MWGui::ContainerWindow* getContainerWindow() = 0;
00124             virtual MWGui::InventoryWindow* getInventoryWindow() = 0;
00125             virtual MWGui::BookWindow* getBookWindow() = 0;
00126             virtual MWGui::ScrollWindow* getScrollWindow() = 0;
00127             virtual MWGui::CountDialog* getCountDialog() = 0;
00128             virtual MWGui::ConfirmationDialog* getConfirmationDialog() = 0;
00129             virtual MWGui::TradeWindow* getTradeWindow() = 0;
00130             virtual MWGui::SpellBuyingWindow* getSpellBuyingWindow() = 0;
00131             virtual MWGui::TravelWindow* getTravelWindow() = 0;
00132             virtual MWGui::SpellWindow* getSpellWindow() = 0;
00133             virtual MWGui::Console* getConsole() = 0;
00134 
00135             virtual MyGUI::Gui* getGui() const = 0;
00136 
00137             virtual void wmUpdateFps(float fps, unsigned int triangleCount, unsigned int batchCount) = 0;
00138 
00140             virtual void setValue (const std::string& id, const MWMechanics::Stat<int>& value) = 0;
00141             virtual void setValue (int parSkill, const MWMechanics::Stat<float>& value) = 0;
00142             virtual void setValue (const std::string& id, const MWMechanics::DynamicStat<float>& value) = 0;
00143             virtual void setValue (const std::string& id, const std::string& value) = 0;
00144             virtual void setValue (const std::string& id, int value) = 0;
00145 
00148             virtual void setDrowningTimeLeft (float time) =0;
00149 
00150             virtual void setPlayerClass (const ESM::Class &class_) = 0;
00152 
00153             virtual void configureSkills (const SkillList& major, const SkillList& minor) = 0;
00155 
00156             virtual void setReputation (int reputation) = 0;
00158 
00159             virtual void setBounty (int bounty) = 0;
00161 
00162             virtual void updateSkillArea() = 0;
00164 
00165             virtual void changeCell(MWWorld::CellStore* cell) = 0;
00167 
00168             virtual void setPlayerPos(const float x, const float y) = 0;
00170 
00171             virtual void setPlayerDir(const float x, const float y) = 0;
00173 
00174             virtual void setFocusObject(const MWWorld::Ptr& focus) = 0;
00175             virtual void setFocusObjectScreenCoords(float min_x, float min_y, float max_x, float max_y) = 0;
00176 
00177             virtual void setCursorVisible(bool visible) = 0;
00178             virtual void getMousePosition(int &x, int &y) = 0;
00179             virtual void getMousePosition(float &x, float &y) = 0;
00180             virtual void setDragDrop(bool dragDrop) = 0;
00181             virtual bool getWorldMouseOver() = 0;
00182 
00183             virtual void toggleFogOfWar() = 0;
00184 
00185             virtual void toggleFullHelp() = 0;
00187 
00188             virtual bool getFullHelp() const = 0;
00189 
00190             virtual void setInteriorMapTexture(const int x, const int y) = 0;
00192 
00194             virtual void setDrowningBarVisibility(bool visible) = 0;
00195 
00197             virtual void setHMSVisibility(bool visible) = 0;
00198 
00200             virtual void setMinimapVisibility(bool visible) = 0;
00201             virtual void setWeaponVisibility(bool visible) = 0;
00202             virtual void setSpellVisibility(bool visible) = 0;
00203             virtual void setSneakVisibility(bool visible) = 0;
00204 
00205             virtual void activateQuickKey  (int index) = 0;
00206 
00207             virtual std::string getSelectedSpell() = 0;
00208             virtual void setSelectedSpell(const std::string& spellId, int successChancePercent) = 0;
00209             virtual void setSelectedEnchantItem(const MWWorld::Ptr& item) = 0;
00210             virtual void setSelectedWeapon(const MWWorld::Ptr& item) = 0;
00211             virtual void unsetSelectedSpell() = 0;
00212             virtual void unsetSelectedWeapon() = 0;
00213 
00214             virtual void showCrosshair(bool show) = 0;
00215             virtual bool getSubtitlesEnabled() = 0;
00216             virtual void toggleHud() = 0;
00217 
00218             virtual void disallowMouse() = 0;
00219             virtual void allowMouse() = 0;
00220             virtual void notifyInputActionBound() = 0;
00221 
00222             virtual void addVisitedLocation(const std::string& name, int x, int y) = 0;
00223 
00224             virtual void removeDialog(OEngine::GUI::Layout* dialog) = 0;
00226 
00227             virtual void messageBox (const std::string& message, const std::vector<std::string>& buttons = std::vector<std::string>(), bool showInDialogueModeOnly = false) = 0;
00228             virtual void staticMessageBox(const std::string& message) = 0;
00229             virtual void removeStaticMessageBox() = 0;
00230 
00231             virtual void enterPressed () = 0;
00232             virtual void activateKeyPressed () = 0;
00233             virtual int readPressedButton() = 0;
00235 
00236             virtual void onFrame (float frameDuration) = 0;
00237 
00239             virtual std::map<int, MWMechanics::Stat<float> > getPlayerSkillValues() = 0;
00240             virtual std::map<int, MWMechanics::Stat<int> > getPlayerAttributeValues() = 0;
00241             virtual SkillList getPlayerMinorSkills() = 0;
00242             virtual SkillList getPlayerMajorSkills() = 0;
00243 
00251             virtual std::string getGameSettingString(const std::string &id, const std::string &default_) = 0;
00252 
00253             virtual void processChangedSettings(const Settings::CategorySettingVector& changed) = 0;
00254 
00255             virtual void windowResized(int x, int y) = 0;
00256 
00257             virtual void executeInConsole (const std::string& path) = 0;
00258 
00259             virtual void enableRest() = 0;
00260             virtual bool getRestEnabled() = 0;
00261             virtual bool getJournalAllowed() = 0; 
00262 
00263             virtual bool getPlayerSleeping() = 0;
00264             virtual void wakeUpPlayer() = 0;
00265 
00266             virtual void showCompanionWindow(MWWorld::Ptr actor) = 0;
00267             virtual void startSpellMaking(MWWorld::Ptr actor) = 0;
00268             virtual void startEnchanting(MWWorld::Ptr actor) = 0;
00269             virtual void startRecharge(MWWorld::Ptr soulgem) = 0;
00270             virtual void startSelfEnchanting(MWWorld::Ptr soulgem) = 0;
00271             virtual void startTraining(MWWorld::Ptr actor) = 0;
00272             virtual void startRepair(MWWorld::Ptr actor) = 0;
00273             virtual void startRepairItem(MWWorld::Ptr item) = 0;
00274 
00275             virtual void showSoulgemDialog (MWWorld::Ptr item) = 0;
00276 
00277             virtual void frameStarted(float dt) = 0;
00278 
00279             virtual void changePointer (const std::string& name) = 0;
00280 
00281             virtual void setEnemy (const MWWorld::Ptr& enemy) = 0;
00282 
00283             virtual const Translation::Storage& getTranslationDataStorage() const = 0;
00284 
00285             virtual void setKeyFocusWidget (MyGUI::Widget* widget) = 0;
00286 
00287             virtual Loading::Listener* getLoadingScreen() = 0;
00288 
00290             virtual bool getCursorVisible() = 0;
00291     };
00292 }
00293 
00294 #endif