ManaPlus
setupwindow.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_SETUPWINDOW_H
25 #define GUI_WINDOWS_SETUPWINDOW_H
26 
27 #include "gui/widgets/window.h"
28 
30 
31 class Button;
32 class Label;
33 class SetupTab;
34 class TabbedArea;
35 
42 class SetupWindow final : public Window,
43  public ActionListener
44 {
45  public:
46  SetupWindow();
47 
49 
50  ~SetupWindow() override final;
51 
52  void postInit() override final;
53 
54  void action(const ActionEvent &event) override final;
55 
56  void setInGame(const bool inGame);
57 
58  void externalUpdate();
59 
60  void externalUnload();
61 
62  void registerWindowForReset(Window *const window);
63 
64  void unregisterWindowForReset(const Window *const window);
65 
66  void hideWindows();
67 
69  { mWindowsToReset.clear(); }
70 
71  void doCancel();
72 
73  void activateTab(const std::string &name);
74 
75  void setVisible(Visible visible) override final;
76 
77  void widgetResized(const Event &event) override final;
78 
79  private:
80  void unloadAdditionalTabs();
81 
82  void unloadTab(SetupTab *const page);
83 
84  std::list<SetupTab*> mTabs;
85  std::list<Window*> mWindowsToReset;
86  STD_VECTOR<Button*> mButtons;
93 };
94 
95 extern SetupWindow* setupWindow;
96 
97 #endif // GUI_WINDOWS_SETUPWINDOW_H
Definition: button.h:102
Definition: event.h:79
Definition: label.h:91
void action(const ActionEvent &event)
void doCancel()
SetupTab * mQuickTab
Definition: setupwindow.h:88
TabbedArea * mPanel
Definition: setupwindow.h:90
void clearWindowsForReset()
Definition: setupwindow.h:68
void hideWindows()
int mButtonPadding
Definition: setupwindow.h:92
Label * mVersion
Definition: setupwindow.h:91
void unregisterWindowForReset(const Window *const window)
void unloadAdditionalTabs()
void setVisible(Visible visible)
void activateTab(const std::string &name)
Button * mResetWindows
Definition: setupwindow.h:89
void registerWindowForReset(Window *const window)
void widgetResized(const Event &event)
std::list< SetupTab * > mTabs
Definition: setupwindow.h:84
std::vector< Button * > mButtons
Definition: setupwindow.h:86
void postInit()
Definition: setupwindow.cpp:85
void externalUpdate()
void unloadTab(SetupTab *const page)
void setInGame(const bool inGame)
std::list< Window * > mWindowsToReset
Definition: setupwindow.h:85
SetupTab * mModsTab
Definition: setupwindow.h:87
void externalUnload()
Definition: window.h:102
#define A_NONNULLPOINTER
Definition: localconsts.h:266
#define final
Definition: localconsts.h:46
#define A_DELETE_COPY(func)
Definition: localconsts.h:53
SetupWindow * setupWindow
Definition: setupwindow.cpp:64
bool Visible
Definition: visible.h:30