5#ifndef JPP_I_GUI_ENVIRONMENT_HPP_INCLUDED
6#define JPP_I_GUI_ENVIRONMENT_HPP_INCLUDED
8#include <jimcpp/core/engine/IReferenceCounted.hpp>
9#include <jimcpp/core/engine/IGUISkin.hpp>
10#include <jimcpp/core/engine/rect.hpp>
11#include <jimcpp/core/engine/EMessageBoxFlags.hpp>
12#include <jimcpp/core/engine/EFocusFlags.hpp>
13#include <jimcpp/core/engine/IEventReceiver.hpp>
14#include <jimcpp/core/engine/IXMLReader.hpp>
15#include <jimcpp/core/engine/IXMLWriter.hpp>
16#include <jimcpp/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 Jimcpp Engine.
Definition IReferenceCounted.hpp:46
SEvents hold information about an event. See jpp::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 IGUIProfiler * addProfilerDisplay(const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1)=0
Adds an element to display the information from the Jimcpp profiler.
virtual IGUISkin * getSkin() const =0
Returns pointer to the current gui skin.
virtual void registerGUIElementFactory(IGUIElementFactory *factoryToAdd)=0
Adds an element factory to the gui environment.
virtual IGUIImageList * createImageList(video::ITexture *texture, core::dimension2d< s32 > imageSize, bool useAlphaChannel)=0
Creates the image list from the given texture.
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 u32 getFocusBehavior() const =0
Get the way the gui does handle focus changes.
virtual IGUIElement * getFocus() const =0
Returns the element which holds the focus.
virtual IGUIElement * getHovered() const =0
Returns the element which was last under the mouse cursor.
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 void deserializeAttributes(io::IAttributes *in, io::SAttributeReadWriteOptions *options=0)=0
Reads attributes of the gui 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 bool saveGUI(const io::path &filename, IGUIElement *start=0)=0
Saves the current gui into a file.
virtual void drawAll(bool useScreenSize=true)=0
Draws all gui elements by traversing the GUI environment starting at the root node.
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 IGUITable * addTable(const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1, bool drawBackground=false)=0
Adds a table to the environment.
virtual bool setFocus(IGUIElement *element)=0
Sets the focus to an element.
virtual video::IVideoDriver * getVideoDriver() const =0
Returns the current video driver.
virtual IGUISkin * createSkin(EGUI_SKIN_TYPE type)=0
Creates a new GUI Skin based on a template.
virtual bool removeFocus(IGUIElement *element)=0
Removes the focus from an element.
virtual IGUIFont * addFont(const io::path &name, IGUIFont *font)=0
Adds an externally loaded font to the font list.
virtual IGUIComboBox * addComboBox(const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1)=0
Adds a combo box to the environment.
virtual IGUIScrollBar * addScrollBar(bool horizontal, const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1)=0
Adds a scrollbar.
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 IGUIElementFactory * getGUIElementFactory(u32 index) const =0
Get a gui element factory by index.
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 u32 getRegisteredGUIElementFactoryCount() const =0
Get amount of registered gui element factories.
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 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 void setSkin(IGUISkin *skin)=0
Sets a new GUI Skin.
virtual void addToDeletionQueue(IGUIElement *element)=0
Adds a IGUIElement to deletion queue.
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 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 setUserEventReceiver(IEventReceiver *evr)=0
This sets a new event receiver for gui events.
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 removeFont(IGUIFont *font)=0
remove loaded font
virtual IOSOperator * getOSOperator() const =0
returns a pointer to the OS operator
virtual IGUIElement * getRootGUIElement()=0
Returns the root gui element.
virtual IGUIColorSelectDialog * addColorSelectDialog(const wchar_t *title=0, bool modal=true, IGUIElement *parent=0, s32 id=-1)=0
Adds a color select dialog.
virtual IGUIFont * getFont(const io::path &filename)=0
Returns pointer to the font with the specified filename.
virtual IGUISpriteBank * addEmptySpriteBank(const io::path &name)=0
Adds an empty sprite bank to the manager.
virtual IGUIListBox * addListBox(const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1, bool drawBackground=false)=0
Adds a list box element.
virtual bool postEventFromUser(const SEvent &event)=0
Posts an input event to the environment.
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 void clear()=0
Removes all elements from the environment.
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 IGUIToolBar * addToolBar(IGUIElement *parent=0, s32 id=-1)=0
Adds a toolbar to the environment.
virtual IGUITab * addTab(const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1)=0
Adds tab to the environment.
virtual io::IFileSystem * getFileSystem() const =0
Returns the file system.
virtual IGUISpriteBank * getSpriteBank(const io::path &filename)=0
Returns pointer to the sprite bank which was added with addEmptySpriteBank.
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 IGUIElement * addModalScreen(IGUIElement *parent, int blinkMode=3)=0
Adds a modal screen.
virtual bool loadGUI(const io::path &filename, IGUIElement *parent=0)=0
Loads the gui. Note that the current gui is not cleared before.
virtual bool saveGUI(io::IWriteFile *file, IGUIElement *start=0)=0
Saves the current gui into a file.
virtual IGUIElement * addGUIElement(const c8 *elementName, IGUIElement *parent=0)=0
Adds a GUI element by its name.
virtual bool hasFocus(const IGUIElement *element, bool checkSubElements=false) const =0
Returns whether the element has focus.
virtual void readGUIElement(io::IXMLReader *reader, IGUIElement *element)=0
reads an element
virtual IGUIContextMenu * addMenu(IGUIElement *parent=0, s32 id=-1)=0
Adds a menu to the environment.
virtual IGUIElementFactory * getDefaultGUIElementFactory() const =0
Get the default element factory which can create all built-in elements.
virtual IGUIFont * getBuiltInFont() const =0
Returns the default built-in font.
virtual IGUIElement * getNextElement(bool reverse=false, bool group=false)=0
Find the next element which would be selected when pressing the tab-key.
virtual IGUIContextMenu * addContextMenu(const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1)=0
Adds a context 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 void serializeAttributes(io::IAttributes *out, io::SAttributeReadWriteOptions *options=0) const =0
Writes attributes of the gui environment.
virtual void setFocusBehavior(u32 flags)=0
Set the way the gui will handle automatic focus changes.
virtual void writeGUIElement(io::IXMLWriter *writer, IGUIElement *element)=0
writes an element
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
@ EMBF_OK
Flag for the OK button.
Definition EMessageBoxFlags.hpp:17
EGUI_SKIN_TYPE
Enumeration of available default skins.
Definition IGUISkin.hpp:31
As of Jimcpp 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