xoreos  0.0.5
newpremium.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef ENGINES_NWN_GUI_MAIN_NEWPREMIUM_H
26 #define ENGINES_NWN_GUI_MAIN_NEWPREMIUM_H
27 
28 #include <vector>
29 
30 #include "src/common/scopedptr.h"
31 #include "src/common/ustring.h"
32 
34 
36 
38 
39 namespace Engines {
40 
41 namespace NWN {
42 
43 class Module;
44 
46 public:
48  const Common::UString &text, float spacing = 0.0f);
50 
51  void show();
52  void hide();
53 
54  void setPosition(float x, float y, float z);
55 
56  float getWidth () const;
57  float getHeight() const;
58 
59  void setTag(const Common::UString &tag);
60 
61 protected:
62  bool activate();
63  bool deactivate();
64 
65 private:
68 
69  float _spacing;
70 };
71 
73 class NewPremiumMenu : public GUI {
74 public:
75  NewPremiumMenu(Module &module, GUI &charType, ::Engines::Console *console = 0);
77 
78  void show();
79 
80 protected:
81  void fixWidgetType(const Common::UString &tag, WidgetType &type);
82  void initWidget(Widget &widget);
83 
84  void callbackActive(Widget &widget);
85 
86 private:
88 
89  std::vector<Common::UString> _modules;
90 
92 
94 
95  void initModuleList();
96  void selectedModule();
97  void loadModule();
98 };
99 
100 } // End of namespace NWN
101 
102 } // End of namespace Engines
103 
104 #endif // ENGINES_NWN_GUI_MAIN_NEWPREMIUM_H
void setPosition(float x, float y, float z)
Set the widget&#39;s position.
Definition: newpremium.cpp:79
A class holding an UTF-8 string.
Definition: ustring.h:48
float getWidth() const
Get the widget&#39;s width.
Definition: newpremium.cpp:91
void show()
Show the widget.
Definition: newpremium.cpp:69
void fixWidgetType(const Common::UString &tag, WidgetType &type)
Definition: newpremium.cpp:140
void initWidget(Widget &widget)
Definition: newpremium.cpp:147
An item widget within a NWN listbox widget.
Definition: listbox.h:51
A simple scoped smart pointer template.
A NWN listbox widget.
Common::UString getSelectedModule()
Definition: newpremium.cpp:197
A GUI.
Definition: gui.h:43
void show()
Show the GUI.
Definition: newpremium.cpp:133
Basic Aurora graphics types.
A NWN GUI.
Definition: gui.h:54
Common::ScopedPtr< Graphics::Aurora::Model > _button
Definition: newpremium.h:66
NewPremiumMenu(Module &module, GUI &charType, ::Engines::Console *console=0)
Definition: newpremium.cpp:124
Common::ScopedPtr< Graphics::Aurora::Text > _text
Definition: newpremium.h:67
Unicode string handling.
std::vector< Common::UString > _modules
Definition: newpremium.h:89
float getHeight() const
Get the widget&#39;s height.
Definition: newpremium.cpp:95
A widget in a GUI.
Definition: widget.h:40
void callbackActive(Widget &widget)
Callback that&#39;s triggered when a widget was activated.
Definition: newpremium.cpp:176
void setTag(const Common::UString &tag)
Set the widget&#39;s tag.
Definition: newpremium.cpp:99
void hide()
Hide the widget.
Definition: newpremium.cpp:74
WidgetListItemPremium(::Engines::GUI &gui, const Common::UString &font, const Common::UString &text, float spacing=0.0f)
Definition: newpremium.cpp:50
The NWN new premium module menu.
Definition: newpremium.h:73
A NWN GUI.