Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
nirt::gui::IGUIElementFactory Class Referenceabstract

Interface making it possible to dynamically create GUI elements. More...

#include <nirtcpp/core/engine/IGUIElementFactory.hpp>

Inheritance diagram for nirt::gui::IGUIElementFactory:
Inheritance graph
Collaboration diagram for nirt::gui::IGUIElementFactory:
Collaboration graph

Public Member Functions

virtual IGUIElementaddGUIElement (EGUI_ELEMENT_TYPE type, IGUIElement *parent=0)=0
 adds an element to the gui environment based on its type id
 
virtual IGUIElementaddGUIElement (const c8 *typeName, IGUIElement *parent=0)=0
 adds a GUI element to the GUI Environment based on its type name
 
virtual s32 getCreatableGUIElementTypeCount () const =0
 Get amount of GUI element types this factory is able to create.
 
virtual EGUI_ELEMENT_TYPE getCreateableGUIElementType (s32 idx) const =0
 Get type of a creatable element type.
 
virtual const c8getCreateableGUIElementTypeName (s32 idx) const =0
 Get type name of a creatable GUI element type by index.
 
virtual const c8getCreateableGUIElementTypeName (EGUI_ELEMENT_TYPE type) const =0
 returns type name of a creatable GUI element
 
- Public Member Functions inherited from nirt::IReferenceCounted
 IReferenceCounted ()
 Constructor.
 
virtual ~IReferenceCounted ()
 Destructor.
 
void grab () const
 Grabs the object. Increments the reference counter by one.
 
bool drop () const
 Drops the object. Decrements the reference counter by one.
 
s32 getReferenceCount () const
 Get the reference count.
 
const c8getDebugName () const
 Returns the debug name of the object.
 

Additional Inherited Members

- Protected Member Functions inherited from nirt::IReferenceCounted
void setDebugName (const c8 *newName)
 Sets the debug name of the object.
 

Detailed Description

Interface making it possible to dynamically create GUI elements.

To be able to add custom elements to Nirtcpp and to make it possible for the scene manager to save and load them, simply implement this interface and register it in your gui environment via IGUIEnvironment::registerGUIElementFactory. Note: When implementing your own element factory, don't call IGUIEnvironment::grab() to increase the reference counter of the environment. This is not necessary because the it will grab() the factory anyway, and otherwise cyclic references will be created.

Member Function Documentation

◆ addGUIElement() [1/2]

virtual IGUIElement * nirt::gui::IGUIElementFactory::addGUIElement ( const c8 typeName,
IGUIElement parent = 0 
)
pure virtual

adds a GUI element to the GUI Environment based on its type name

Parameters
typeNameType name of the element to add.
parentParent scene node of the new element, can be null to add it to the root.
Returns
Pointer to the new element or null if not successful.

◆ addGUIElement() [2/2]

virtual IGUIElement * nirt::gui::IGUIElementFactory::addGUIElement ( EGUI_ELEMENT_TYPE  type,
IGUIElement parent = 0 
)
pure virtual

adds an element to the gui environment based on its type id

Parameters
typeType of the element to add.
parentParent scene node of the new element, can be null to add to the root.
Returns
Pointer to the new element or null if not successful.

◆ getCreateableGUIElementType()

virtual EGUI_ELEMENT_TYPE nirt::gui::IGUIElementFactory::getCreateableGUIElementType ( s32  idx) const
pure virtual

Get type of a creatable element type.

Parameters
idxIndex of the element type in this factory. Must be a value between 0 and getCreatableGUIElementTypeCount()

◆ getCreateableGUIElementTypeName() [1/2]

virtual const c8 * nirt::gui::IGUIElementFactory::getCreateableGUIElementTypeName ( EGUI_ELEMENT_TYPE  type) const
pure virtual

returns type name of a creatable GUI element

Parameters
typeType of GUI element.
Returns
Name of the type if this factory can create the type, otherwise 0.

◆ getCreateableGUIElementTypeName() [2/2]

virtual const c8 * nirt::gui::IGUIElementFactory::getCreateableGUIElementTypeName ( s32  idx) const
pure virtual

Get type name of a creatable GUI element type by index.

Parameters
idxIndex of the type in this factory. Must be a value between 0 and getCreatableGUIElementTypeCount()

The documentation for this class was generated from the following file:

Nirtcpp    @cppfx.xyz

Esvcpp    esv::print