xoreos  0.0.5
quickbar.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_INGAME_QUICKBAR_H
26 #define ENGINES_NWN_GUI_INGAME_QUICKBAR_H
27 
28 #include "src/common/types.h"
29 #include "src/common/scopedptr.h"
30 
31 #include "src/events/notifyable.h"
32 
34 
36 
38 
39 namespace Engines {
40 
41 namespace NWN {
42 
44 class QuickbarButton : public NWNWidget {
45 public:
46  QuickbarButton(::Engines::GUI &gui, size_t n);
48 
49  void show();
50  void hide();
51 
52  void setPosition(float x, float y, float z);
53 
54  float getWidth () const;
55  float getHeight() const;
56 
57  void setTag(const Common::UString &tag);
58 
59 private:
61 
62  size_t _buttonNumber;
63 };
64 
66 class Quickbar : public GUI, public Events::Notifyable {
67 public:
68  Quickbar();
69  ~Quickbar();
70 
71  float getWidth () const;
72  float getHeight() const;
73 
74 protected:
75  void callbackActive(Widget &widget);
76 
77 private:
78  float _slotWidth;
79  float _slotHeight;
80 
81  float _edgeHeight;
82 
83  void getSlotSize();
84 
85  void notifyResized(int oldWidth, int oldHeight, int newWidth, int newHeight);
86 };
87 
88 } // End of namespace NWN
89 
90 } // End of namespace Engines
91 
92 #endif // ENGINES_NWN_GUI_INGAME_QUICKBAR_H
float getHeight() const
Get the widget&#39;s height.
Definition: quickbar.cpp:94
A NWN widget.
A class holding an UTF-8 string.
Definition: ustring.h:48
float getWidth() const
Definition: quickbar.cpp:127
Base class for all widgets in NWN.
Definition: nwnwidget.h:45
The NWN ingame quickbar.
Definition: quickbar.h:66
void show()
Show the widget.
Definition: quickbar.cpp:75
A button within the NWN quickbar.
Definition: quickbar.h:44
void setTag(const Common::UString &tag)
Set the widget&#39;s tag.
Definition: quickbar.cpp:98
void hide()
Hide the widget.
Definition: quickbar.cpp:79
A simple scoped smart pointer template.
A GUI.
Definition: gui.h:43
Basic Aurora graphics types.
A NWN GUI.
Definition: gui.h:54
void callbackActive(Widget &widget)
Callback that&#39;s triggered when a widget was activated.
Definition: quickbar.cpp:135
Common::ScopedPtr< Graphics::Aurora::Model > _model
Definition: quickbar.h:60
Low-level type definitions to handle fixed width types portably.
A class that can be notified by the NotificationManager.
float getHeight() const
Definition: quickbar.cpp:131
float getWidth() const
Get the widget&#39;s width.
Definition: quickbar.cpp:90
A widget in a GUI.
Definition: widget.h:40
QuickbarButton(::Engines::GUI &gui, size_t n)
Definition: quickbar.cpp:43
void setPosition(float x, float y, float z)
Set the widget&#39;s position.
Definition: quickbar.cpp:83
A NWN GUI.
void notifyResized(int oldWidth, int oldHeight, int newWidth, int newHeight)
Definition: quickbar.cpp:145