25 #ifndef ENGINES_AURORA_GUI_H 26 #define ENGINES_AURORA_GUI_H 31 #include <boost/noncopyable.hpp> 43 class GUI : boost::noncopyable {
118 void getPosition(
float &x,
float &y,
float &z)
const;
180 #endif // ENGINES_AURORA_GUI_H virtual void mouseUp()
The mouse state has changed.
Widget * getWidget(const Common::UString &tag, bool vital=false)
Return a widget in the GUI.
static const uint32 kReturnCodeAbort
void mouseMove(const Events::Event &event)
Mouse move event triggered.
uint32 _returnCode
The GUI's return code.
A class holding an UTF-8 string.
void setPosition(float x, float y, float z)
Set the GUI's position.
virtual void callbackActive(Widget &widget)
Callback that's triggered when a widget was activated.
Widget * getWidgetAt(float x, float y)
Return the widget at that position.
void removeFocus()
Forcefully remove the focus from the current widget.
virtual void callbackKeyInput(const Events::Key &key, const Events::EventType &type)
Callback that's triggered when a key is pressed or released.
static const uint32 kReturnCodeNone
void declareGroup(const std::list< Widget *> &group)
Put these widgets together into a group.
uint32 run(uint32 startCode=kStartCodeNone)
Run the GUI.
void checkWidgetActive(Widget *widget)
Check if a widget was activated.
WidgetMap _widgetMap
All widgets in the GUI, index by their tag.
void keyUp(const Events::Event &event)
Key up event triggeered.
virtual void show()
Show the GUI.
void mouseWheel(const Events::Event &event)
Mouse wheel event triggered.
void removeChild(GUI *gui)
Remove a child GUI object from this GUI.
virtual void callbackRun()
Callback that's triggered periodically in the run() method.
std::map< Common::UString, Widget * > WidgetMap
uint32 sub(GUI &gui, uint32 startCode=kStartCodeNone, bool showSelf=true, bool hideSelf=true)
Open up a sub GUI.
void keyDown(const Events::Event &event)
Key down event triggered.
uint32 _startCode
The GUI's start code.
virtual void abort()
Abort the currently running GUI.
std::list< GUI * > _childGUIs
float _x
The GUI X position.
void changedWidget(Widget *widget)
The current widget has changed.
void clearWidgets()
Clear all widgets.
void getPosition(float &x, float &y, float &z) const
Get the GUI's position.
WidgetList _widgets
All widgets in the GUI.
void updateMouse()
Force an update of the mouse position.
Widget * _currentWidget
The widget the mouse is currently on.
EventType
Custom event types.
static const uint32 kStartCodeNone
virtual void callbackTextInput(const Common::UString &text)
Callback that's triggered when a text input is received.
float _z
The GUI Z position.
void addEvent(const Events::Event &event)
Add a single event for consideration into the GUI event queue.
void addWidget(Widget *widget)
Add a widget.
GUI * _sub
The currently running sub GUI.
std::list< Widget * > WidgetList
virtual Common::UString getName() const
uint32 processEventQueue()
Process the current event queue.
bool empty()
Check if the gui is currently empty.
void textInput(const Events::Event &event)
Text input event received.
virtual void hide()
Hide the GUI.
bool hasWidget(const Common::UString &tag) const
Does this specific widget exist within the GUI?
float _y
The GUI Y position.
std::list< Events::Event > _eventQueue
The GUI event queue.
void removeWidget(Widget *widget)
Remove a widget.
void addChild(GUI *gui)
Add a child GUI object to this GUI.