xoreos  0.0.5
quadwidget.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_WIDGETS_QUADWIDGET_H
26 #define ENGINES_NWN_GUI_WIDGETS_QUADWIDGET_H
27 
28 #include "src/common/scopedptr.h"
29 
31 
33 
34 namespace Common {
35  class UString;
36 }
37 
38 namespace Engines {
39 
40 namespace NWN {
41 
42 class GUI;
43 
49 class QuadWidget : public NWNWidget {
50 public:
51  QuadWidget(::Engines::GUI &gui, const Common::UString &tag,
52  const Common::UString &texture,
53  float x1 , float y1 , float x2 , float y2,
54  float tX1 = 0.0f, float tY1 = 0.0f, float tX2 = 1.0f, float tY2 = 1.0f);
55  ~QuadWidget();
56 
57  void show();
58  void hide();
59 
60  void setPosition(float x, float y, float z);
61  void setColor(float r, float g, float b, float a);
62  void setTexture(const Common::UString &texture);
63 
64  void setWidth (float w);
65  void setHeight(float h);
66 
67  float getWidth () const;
68  float getHeight() const;
69 
70 private:
71  float _width;
72  float _height;
73 
75 };
76 
77 } // End of namespace NWN
78 
79 } // End of namespace Engines
80 
81 #endif // ENGINES_NWN_GUI_WIDGETS_QUADWIDGET_H
A NWN widget.
Definition: 2dafile.h:39
A class holding an UTF-8 string.
Definition: ustring.h:48
float getWidth() const
Get the widget&#39;s width.
Definition: quadwidget.cpp:84
void setWidth(float w)
Definition: quadwidget.cpp:76
Common::ScopedPtr< Graphics::Aurora::GUIQuad > _quad
Definition: quadwidget.h:74
Base class for all widgets in NWN.
Definition: nwnwidget.h:45
QuadWidget(::Engines::GUI &gui, const Common::UString &tag, const Common::UString &texture, float x1, float y1, float x2, float y2, float tX1=0.0f, float tY1=0.0f, float tX2=1.0f, float tY2=1.0f)
Definition: quadwidget.cpp:36
A simple scoped smart pointer template.
A GUI.
Definition: gui.h:43
Basic Aurora graphics types.
float getHeight() const
Get the widget&#39;s height.
Definition: quadwidget.cpp:88
void show()
Show the widget.
Definition: quadwidget.cpp:53
void setHeight(float h)
Definition: quadwidget.cpp:80
void hide()
Hide the widget.
Definition: quadwidget.cpp:57
void setColor(float r, float g, float b, float a)
Definition: quadwidget.cpp:68
void setTexture(const Common::UString &texture)
Definition: quadwidget.cpp:72
A NWN quad widget.
Definition: quadwidget.h:49
void setPosition(float x, float y, float z)
Set the widget&#39;s position.
Definition: quadwidget.cpp:61