diff options
Diffstat (limited to 'src/ochess.hpp')
| -rw-r--r-- | src/ochess.hpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/ochess.hpp b/src/ochess.hpp index 8366926..a8f96a0 100644 --- a/src/ochess.hpp +++ b/src/ochess.hpp @@ -41,17 +41,19 @@ class Game; class GameBase; /** - * @brief Attach informations to the application tabs + * @brief Used by each tab of the GUI to attach informations additional informations and features * */ class TabInfos { + /// @brief Keep track of the number of opened tabs static long tab_count; public: + /// @brief Which type of tab is it? typedef enum Type { GAME, BASE, ENGINE, NONE } Type; Type type; /// @brief Each tab has an associated unique id long id; - /// @brief Specify to which tab id this tab is linked (e.g: database to linked to game tab) + /// @brief Specify to which tab id this tab is linked (e.g: database to linked to on of its opened game tab) long linked_id; /// @brief Set to true if this tab is attach to another one (c.f linked_id) bool is_linked; @@ -60,8 +62,9 @@ public: TabInfos(Type type_) : type(type_), id(tab_count), is_linked(false), is_dirty(false) { tab_count++; } void Link(TabInfos *tab); virtual void Refresh(){}; - /// @brief Call when tab is linked to another one + /// @brief Callback that is called when the current tab is linked to another one virtual void OnLink(){}; + /// @brief Can be called to load preferences that have been modify in the application settings virtual void ApplyPreferences() {}; virtual std::shared_ptr<Game> GetGame() = 0; virtual std::shared_ptr<GameBase> GetBase() = 0; @@ -78,14 +81,19 @@ public: Openings Book; /// @brief Entry point of the application virtual bool OnInit(); + /// @brief Get a list of all the tabs opened in OChess std::vector<TabInfos *> ListTabInfos(); + /// @brief Trigger a wxWidget focus event on a specific tab void FocusOnTab(TabInfos *); + /// @brief Open a new game tab linked to @a tabsrc that uses game @a g void NewGame(TabInfos *tabsrc,std::shared_ptr<Game> g); + /// @brief Open a new game that uses game @a g void NewGame(std::shared_ptr<Game> g); + /// @brief Singleton to get the opening book (see Openings) Openings& GetBook(); }; wxDECLARE_APP(MyApp); -///@brief Abort ochess with a message +///@brief Abort OChess with a message void Abort(std::string msg); |
