ManaPlus
helpwindow.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2004-2009 The Mana World Development Team
4  * Copyright (C) 2009-2010 The Mana Developers
5  * Copyright (C) 2011-2019 The ManaPlus Developers
6  * Copyright (C) 2019-2021 Andrei Karas
7  *
8  * This file is part of The ManaPlus Client.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #ifndef GUI_WINDOWS_HELPWINDOW_H
25 #define GUI_WINDOWS_HELPWINDOW_H
26 
28 #include "gui/widgets/window.h"
29 
31 
32 #include "localconsts.h"
33 
34 class Button;
35 class ScrollArea;
36 class StaticBrowserBox;
37 
38 typedef std::set<std::string> HelpNames;
39 typedef HelpNames::const_iterator HelpNamesCIter;
40 typedef std::map<std::string, HelpNames> HelpTagsMap;
41 
45 class HelpWindow final : public Window,
46  public LinkHandler,
47  public ActionListener
48 {
49  public:
53  HelpWindow();
54 
56 
57 
60  void action(const ActionEvent &event) override final;
61 
65  void handleLink(const std::string &link,
66  MouseEvent *const event A_UNUSED) override final;
67 
71  void loadHelp(const std::string &helpFile);
72 
73  void loadHelpSimple(const std::string &helpFile);
74 
78  void search(const std::string &text);
79 
80  private:
81  void loadTags();
82 
83  void loadFile(std::string file);
84 
89 };
90 
91 extern HelpWindow *helpWindow;
92 
93 #endif // GUI_WINDOWS_HELPWINDOW_H
Definition: button.h:102
StaticBrowserBox * mBrowserBox
Definition: helpwindow.h:86
void search(const std::string &text)
Definition: helpwindow.cpp:187
void loadFile(std::string file)
Definition: helpwindow.cpp:150
void action(const ActionEvent &event)
Definition: helpwindow.cpp:105
Button * mDYKButton
Definition: helpwindow.h:85
ScrollArea * mScrollArea
Definition: helpwindow.h:87
void loadHelp(const std::string &helpFile)
Definition: helpwindow.cpp:126
void loadTags()
Definition: helpwindow.cpp:165
HelpTagsMap mTagFileMap
Definition: helpwindow.h:88
void handleLink(const std::string &link, MouseEvent *const event)
Definition: helpwindow.cpp:111
void loadHelpSimple(const std::string &helpFile)
Definition: helpwindow.cpp:139
Definition: window.h:102
std::map< std::string, HelpNames > HelpTagsMap
Definition: helpwindow.h:40
HelpWindow * helpWindow
Definition: helpwindow.cpp:54
std::set< std::string > HelpNames
Definition: helpwindow.h:36
HelpNames::const_iterator HelpNamesCIter
Definition: helpwindow.h:39
#define A_NONNULLPOINTER
Definition: localconsts.h:266
#define final
Definition: localconsts.h:46
#define A_DELETE_COPY(func)
Definition: localconsts.h:53
#define A_UNUSED
Definition: localconsts.h:160