xoreos  0.0.5
chardomain.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_CHARGEN_CHARDOMAIN_H
26 #define ENGINES_NWN_GUI_CHARGEN_CHARDOMAIN_H
27 
28 #include <vector>
29 
32 
33 namespace Engines {
34 
35 namespace NWN {
36 
37 class WidgetListBox;
38 
40 public:
41  WidgetListItemDomain(::Engines::GUI &gui, const Common::UString &title, const Common::UString &icon, const Common::UString &desc, uint8 domainId);
43 
44  void mouseUp(uint8 state, float x, float y);
45  void mouseDblClick(uint8 state, float x, float y);
46 
47  void subActive(Engines::Widget &widget);
48 
49 private:
53 
54  friend class CharDomain;
55 };
56 
57 class CharDomain : public CharGenBase {
58 public:
59  CharDomain(CharGenChoices &choices, ::Engines::Console *console = 0);
60  ~CharDomain();
61 
62  void reset();
63  void fixWidgetType(const Common::UString &tag, NWN::GUI::WidgetType &type);
64 
65  void moveDomain(WidgetListItemDomain *item);
66 
67 private:
68  void callbackActive(Widget &widget);
69  void createDomainList();
70  void updateChosenDomains();
71  void setRecommendedDomains();
72 
74  std::vector<WidgetListItemDomain *> _chosenDomains;
75 
76  friend class WidgetListItemDomain;
77 };
78 
79 } // End of namespace NWN
80 
81 } // End of namespace Engines
82 
83 #endif // ENGINES_NWN_GUI_CHARGEN_CHARDOMAIN_H
CharDomain(CharGenChoices &choices, ::Engines::Console *console=0)
Definition: chardomain.cpp:75
A class holding an UTF-8 string.
Definition: ustring.h:48
WidgetListItemDomain(::Engines::GUI &gui, const Common::UString &title, const Common::UString &icon, const Common::UString &desc, uint8 domainId)
Definition: chardomain.cpp:44
uint8_t uint8
Definition: types.h:200
std::vector< WidgetListItemDomain * > _chosenDomains
Definition: chardomain.h:74
WidgetListBox * _domainListBox
Definition: chardomain.h:73
void callbackActive(Widget &widget)
Callback that&#39;s triggered when a widget was activated.
Definition: chardomain.cpp:109
A GUI.
Definition: gui.h:43
void subActive(Engines::Widget &widget)
A sub-widget was activated.
Definition: chardomain.cpp:70
A NWN listbox widget.
Definition: listbox.h:116
void moveDomain(WidgetListItemDomain *item)
Definition: chardomain.cpp:151
Button items used in WidgetListBox.
The character generator base class.
A widget in a GUI.
Definition: widget.h:40
void mouseDblClick(uint8 state, float x, float y)
A mouse button was double-clicked on the widget.
Definition: chardomain.cpp:66
void fixWidgetType(const Common::UString &tag, NWN::GUI::WidgetType &type)
Definition: chardomain.cpp:104
void mouseUp(uint8 state, float x, float y)
A mouse button was released on the widget.
Definition: chardomain.cpp:56