5#ifndef NIRT_I_GUI_ENVIRONMENT_HPP_INCLUDED
6#define NIRT_I_GUI_ENVIRONMENT_HPP_INCLUDED
8#include <nirtcpp/core/engine/IReferenceCounted.hpp>
9#include <nirtcpp/core/engine/IGUISkin.hpp>
10#include <nirtcpp/core/engine/rect.hpp>
11#include <nirtcpp/core/engine/EMessageBoxFlags.hpp>
12#include <nirtcpp/core/engine/EFocusFlags.hpp>
13#include <nirtcpp/core/engine/IEventReceiver.hpp>
14#include <nirtcpp/core/engine/IXMLReader.hpp>
15#include <nirtcpp/core/engine/IXMLWriter.hpp>
16#include <nirtcpp/core/engine/path.hpp>
48class IGUIFileOpenDialog;
49class IGUIColorSelectDialog;
63class IGUIElementFactory;
79 virtual void drawAll(
bool useScreenSize=
true) = 0;
179 bool useAlphaChannel ) = 0;
238 IGUIElement* parent=0,
s32 id=-1,
const wchar_t* text=0,
const wchar_t* tooltiptext = 0) = 0;
314 bool useAlphaChannel=
true,
IGUIElement* parent=0,
s32 id=-1,
const wchar_t* text=0) = 0;
328 IGUIElement* parent=0,
s32 id=-1,
const wchar_t* text=0,
bool useAlphaChannel=
true) = 0;
365 bool scrollBarVertical =
true,
bool scrollBarHorizontal =
false) = 0;
394 bool restoreCWD=
false, io::path::char_type* startDir=0) = 0;
422 bool border=
false,
bool wordWrap=
true,
IGUIElement* parent=0,
s32 id=-1,
423 bool fillBackground =
false) = 0;
482 bool border=
true,
s32 id=-1) = 0;
Interface of an object which can receive events.
Definition IEventReceiver.hpp:484
The Operating system operator provides operation system specific methods and information.
Definition IOSOperator.hpp:16
Base class of most objects of the Nirtcpp Engine.
Definition IReferenceCounted.hpp:46
SEvents hold information about an event. See nirt::IEventReceiver for details on event handling.
Definition IEventReceiver.hpp:282
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.hpp:22
GUI Check box interface.
Definition IGUICheckBox.hpp:20
Standard color chooser dialog.
Definition IGUIColorSelectDialog.hpp:17
Combobox widget.
Definition IGUIComboBox.hpp:20
Single line edit box for editing simple text.
Definition IGUIEditBox.hpp:24
Interface making it possible to dynamically create GUI elements.
Definition IGUIElementFactory.hpp:27
Base class of all GUI elements.
Definition IGUIElement.hpp:24
GUI Environment. Used as factory and manager of all other GUI elements.
Definition IGUIEnvironment.hpp:73
virtual bool removeFocus(IGUIElement *element)=0
Removes the focus from an element.
virtual IGUIMeshViewer * addMeshViewer(const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1, const wchar_t *text=0)=0
Adds a mesh viewer. Not 100% implemented yet.
virtual IGUIColorSelectDialog * addColorSelectDialog(const wchar_t *title=0, bool modal=true, IGUIElement *parent=0, s32 id=-1)=0
Adds a color select dialog.
virtual void setFocusBehavior(u32 flags)=0
Set the way the gui will handle automatic focus changes.
virtual IGUIImage * addImage(video::ITexture *image, core::position2d< s32 > pos, bool useAlphaChannel=true, IGUIElement *parent=0, s32 id=-1, const wchar_t *text=0)=0
Adds an image element.
virtual void removeFont(IGUIFont *font)=0
remove loaded font
virtual bool postEventFromUser(const SEvent &event)=0
Posts an input event to the environment.
virtual void addToDeletionQueue(IGUIElement *element)=0
Adds a IGUIElement to deletion queue.
virtual video::IVideoDriver * getVideoDriver() const =0
Returns the current video driver.
virtual IGUISkin * getSkin() const =0
Returns pointer to the current gui skin.
virtual u32 getFocusBehavior() const =0
Get the way the gui does handle focus changes.
virtual IGUIButton * addButton(const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1, const wchar_t *text=0, const wchar_t *tooltiptext=0)=0
Adds a button element.
virtual bool setFocus(IGUIElement *element)=0
Sets the focus to an element.
virtual io::IFileSystem * getFileSystem() const =0
Returns the file system.
virtual IGUITab * addTab(const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1)=0
Adds tab to the environment.
virtual u32 getRegisteredGUIElementFactoryCount() const =0
Get amount of registered gui element factories.
virtual IGUICheckBox * addCheckBox(bool checked, const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1, const wchar_t *text=0)=0
Adds a checkbox element.
virtual IGUIFont * addFont(const io::path &name, IGUIFont *font)=0
Adds an externally loaded font to the font list.
virtual IGUIFileOpenDialog * addFileOpenDialog(const wchar_t *title=0, bool modal=true, IGUIElement *parent=0, s32 id=-1, bool restoreCWD=false, io::path::char_type *startDir=0)=0
Adds a file open dialog.
virtual void drawAll(bool useScreenSize=true)=0
Draws all gui elements by traversing the GUI environment starting at the root node.
virtual IGUIFont * getBuiltInFont() const =0
Returns the default built-in font.
virtual void writeGUIElement(io::IXMLWriter *writer, IGUIElement *element)=0
writes an element
virtual IGUIEditBox * addEditBox(const wchar_t *text, const core::rect< s32 > &rectangle, bool border=true, IGUIElement *parent=0, s32 id=-1)=0
Adds an edit box.
virtual void clear()=0
Removes all elements from the environment.
virtual IGUITreeView * addTreeView(const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1, bool drawBackground=false, bool scrollBarVertical=true, bool scrollBarHorizontal=false)=0
Adds a tree view element.
virtual void registerGUIElementFactory(IGUIElementFactory *factoryToAdd)=0
Adds an element factory to the gui environment.
virtual void setUserEventReceiver(IEventReceiver *evr)=0
This sets a new event receiver for gui events.
virtual IGUITable * addTable(const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1, bool drawBackground=false)=0
Adds a table to the environment.
virtual IGUIElement * addModalScreen(IGUIElement *parent, int blinkMode=3)=0
Adds a modal screen.
virtual IGUIScrollBar * addScrollBar(bool horizontal, const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1)=0
Adds a scrollbar.
virtual IGUISkin * createSkin(EGUI_SKIN_TYPE type)=0
Creates a new GUI Skin based on a template.
virtual bool hasFocus(const IGUIElement *element, bool checkSubElements=false) const =0
Returns whether the element has focus.
virtual void deserializeAttributes(io::IAttributes *in, io::SAttributeReadWriteOptions *options=0)=0
Reads attributes of the gui environment.
virtual IGUIElementFactory * getGUIElementFactory(u32 index) const =0
Get a gui element factory by index.
virtual IGUIElement * getHovered() const =0
Returns the element which was last under the mouse cursor.
virtual IGUITabControl * addTabControl(const core::rect< s32 > &rectangle, IGUIElement *parent=0, bool fillbackground=false, bool border=true, s32 id=-1)=0
Adds a tab control to the environment.
virtual void setSkin(IGUISkin *skin)=0
Sets a new GUI Skin.
virtual IGUIElementFactory * getDefaultGUIElementFactory() const =0
Get the default element factory which can create all built-in elements.
virtual void readGUIElement(io::IXMLReader *reader, IGUIElement *element)=0
reads an element
virtual IGUIContextMenu * addContextMenu(const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1)=0
Adds a context menu to the environment.
virtual IGUIImage * addImage(const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1, const wchar_t *text=0, bool useAlphaChannel=true)=0
Adds an image element.
virtual IGUIElement * getRootGUIElement()=0
Returns the root gui element.
virtual IGUIElement * getFocus() const =0
Returns the element which holds the focus.
virtual IGUIToolBar * addToolBar(IGUIElement *parent=0, s32 id=-1)=0
Adds a toolbar to the environment.
virtual IGUISpriteBank * addEmptySpriteBank(const io::path &name)=0
Adds an empty sprite bank to the manager.
virtual IOSOperator * getOSOperator() const =0
returns a pointer to the OS operator
virtual bool saveGUI(const io::path &filename, IGUIElement *start=0)=0
Saves the current gui into a file.
virtual IGUIElement * getNextElement(bool reverse=false, bool group=false)=0
Find the next element which would be selected when pressing the tab-key.
virtual IGUIElement * addGUIElement(const c8 *elementName, IGUIElement *parent=0)=0
Adds a GUI element by its name.
virtual IGUIWindow * addWindow(const core::rect< s32 > &rectangle, bool modal=false, const wchar_t *text=0, IGUIElement *parent=0, s32 id=-1)=0
Adds an empty window element.
virtual IGUISpinBox * addSpinBox(const wchar_t *text, const core::rect< s32 > &rectangle, bool border=true, IGUIElement *parent=0, s32 id=-1)=0
Adds a spin box.
virtual IGUIListBox * addListBox(const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1, bool drawBackground=false)=0
Adds a list box element.
virtual IGUIImageList * createImageList(video::ITexture *texture, core::dimension2d< s32 > imageSize, bool useAlphaChannel)=0
Creates the image list from the given texture.
virtual void serializeAttributes(io::IAttributes *out, io::SAttributeReadWriteOptions *options=0) const =0
Writes attributes of the gui environment.
virtual IGUIStaticText * addStaticText(const wchar_t *text, const core::rect< s32 > &rectangle, bool border=false, bool wordWrap=true, IGUIElement *parent=0, s32 id=-1, bool fillBackground=false)=0
Adds a static text.
virtual IGUISpriteBank * getSpriteBank(const io::path &filename)=0
Returns pointer to the sprite bank which was added with addEmptySpriteBank.
virtual IGUIComboBox * addComboBox(const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1)=0
Adds a combo box to the environment.
virtual IGUIFont * getFont(const io::path &filename)=0
Returns pointer to the font with the specified filename.
virtual IGUIInOutFader * addInOutFader(const core::rect< s32 > *rectangle=0, IGUIElement *parent=0, s32 id=-1)=0
Adds an element for fading in or out.
virtual IGUIWindow * addMessageBox(const wchar_t *caption, const wchar_t *text=0, bool modal=true, s32 flags=EMBF_OK, IGUIElement *parent=0, s32 id=-1, video::ITexture *image=0)=0
Adds a message box.
virtual bool loadGUI(const io::path &filename, IGUIElement *parent=0)=0
Loads the gui. Note that the current gui is not cleared before.
virtual IGUIContextMenu * addMenu(IGUIElement *parent=0, s32 id=-1)=0
Adds a menu to the environment.
virtual bool loadGUI(io::IReadFile *file, IGUIElement *parent=0)=0
Loads the gui. Note that the current gui is not cleared before.
virtual IGUIProfiler * addProfilerDisplay(const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1)=0
Adds an element to display the information from the Nirtcpp profiler.
virtual bool saveGUI(io::IWriteFile *file, IGUIElement *start=0)=0
Saves the current gui into a file.
Standard file chooser dialog.
Definition IGUIFileOpenDialog.hpp:25
Font interface.
Definition IGUIFont.hpp:40
Font interface.
Definition IGUIImageList.hpp:18
GUI element displaying an image.
Definition IGUIImage.hpp:20
Element for fading out or in.
Definition IGUIInOutFader.hpp:28
Default list box GUI element.
Definition IGUIListBox.hpp:40
3d mesh viewing GUI element.
Definition IGUIMeshViewer.hpp:28
Element to display profiler information.
Definition IGUIProfiler.hpp:20
A skin modifies the look of the GUI elements.
Definition IGUISkin.hpp:385
Single line edit box + spin buttons.
Definition IGUISpinBox.hpp:36
Sprite bank interface.
Definition IGUISpriteBank.hpp:71
Multi or single line text label.
Definition IGUIStaticText.hpp:19
A standard tab control.
Definition IGUITabControl.hpp:23
A tab-page, onto which other gui elements could be added.
Definition IGUITabControl.hpp:125
Default list box GUI element.
Definition IGUITable.hpp:90
Default tree view GUI element.
Definition IGUITreeView.hpp:227
Default moveable window GUI element with border, caption and close icons.
Definition IGUIWindow.hpp:22
Provides a generic interface for attributes and their values and the possibility to serialize them.
Definition IAttributes.hpp:42
The FileSystem manages files and archives and provides access to them.
Definition IFileSystem.hpp:33
Interface providing easy read access to a XML file.
Definition irrXML.hpp:277
Interface providing methods for making it easier to write XML files.
Definition irrXML.hpp:377
Interface providing read access to a file.
Definition IReadFile.hpp:19
Interface providing write access to a file.
Definition IWriteFile.hpp:18
class holding data describing options
Definition IAttributeExchangingObject.hpp:35
Interface of a Video Driver dependent Texture.
Definition ITexture.hpp:186
Interface to driver which is able to perform 2d and 3d graphics functions.
Definition IVideoDriver.hpp:152
EGUI_SKIN_TYPE
Enumeration of available default skins.
Definition IGUISkin.hpp:31
@ EMBF_OK
Flag for the OK button.
Definition EMessageBoxFlags.hpp:17
As of Nirtcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11
signed int s32
32 bit signed variable.
Definition irrTypes.hpp:72
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.hpp:64
char c8
8 bit character variable.
Definition irrTypes.hpp:37