stk-code_catmod/src/guiengine/abstract_state_manager.hpp
auria fd5730a0da Better cursor show/hide management (esp. cursor will show in in-game dialogs)
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4565 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2010-01-30 19:53:06 +00:00

67 lines
1.3 KiB
C++

#ifndef HEADER_ABSTRACT_STATE_MANAGER_HPP
#define HEADER_ABSTRACT_STATE_MANAGER_HPP
#include <vector>
#include <string>
namespace GUIEngine
{
class Widget;
class Screen;
enum GameState
{
MENU,
GAME,
INGAME_MENU
};
/**
* Abstract base class you must override from to use the GUI engine
*/
class AbstractStateManager
{
protected:
/**
* Whether we are in game mode
*/
GameState m_game_mode;
/**
* This stack will contain menu names (e.g. main.stkgui), and/or 'race'.
*/
std::vector<std::string> m_menu_stack;
void pushMenu(std::string name);
void setGameState(GameState state);
public:
AbstractStateManager();
virtual ~AbstractStateManager() { }
void pushScreen(Screen* screen);
void replaceTopMostScreen(Screen* screen);
void popMenu();
void resetAndGoToScreen(Screen* screen);
void enterGameState();
GameState getGameState();
void reshowTopMostMenu();
/* ***********************************
* methods to override in children *
*********************************** */
/**
* callback called whenever escape was pressed (or any similar cancel operation)
*/
virtual void escapePressed() = 0;
};
}
#endif