Guillaume 1.0.0
Guillaume.
|
Base class for all UI components. More...
#include <component.hpp>
Public Member Functions | |
Component (void) | |
Constructs a Component object. | |
Component (const Properties &properties) | |
Constructs a Component object with properties. | |
virtual | ~Component (void)=default |
Destroy the Component object. | |
ComponentID | getID (void) const |
Get the ID object. | |
virtual void | addChild (const std::shared_ptr< Component > &child) |
Add a child component. | |
virtual void | addPrimitive (const std::shared_ptr< Primitive > &primitive) |
Add a primitive for rendering. | |
virtual std::shared_ptr< Component > | render (void) |
Renders the component. | |
virtual void | onEvent (const Event &event) |
Handles events. | |
State & | getState (void) |
Gets the component's state. | |
const Properties & | getProperties (void) const |
Gets the component's properties. | |
const std::vector< std::shared_ptr< Component > > & | getChildren (void) const |
Gets the component's children. | |
std::shared_ptr< Component > | getParent (void) const |
Gets the component's parent. | |
const std::vector< std::shared_ptr< Primitive > > & | getPrimitives (void) const |
Gets the component's primitives. | |
Protected Member Functions | |
void | setParent (const std::shared_ptr< Component > &parent) |
Set the Parent object. | |
Protected Attributes | |
State | _state |
The component's state. | |
Properties | _properties |
The component's properties. | |
std::shared_ptr< Component > | _parent |
Pointer to the parent component. | |
std::vector< std::shared_ptr< Component > > | _children |
Vector of child components. | |
std::vector< std::shared_ptr< Primitive > > | _primitives |
Vector of primitives for rendering. | |
Base class for all UI components.
Manages local state and properties, defines rendering and event handling.
|
inline |
Constructs a Component object with properties.
properties | The properties for the component |
|
inlinevirtual |
Add a child component.
child | A shared pointer to the child component |
|
inlinevirtual |
Add a primitive for rendering.
primitive | A shared pointer to the primitive |
|
inline |
Gets the component's children.
|
inline |
Get the ID object.
|
inline |
Gets the component's parent.
|
inline |
Gets the component's primitives.
|
inline |
Gets the component's properties.
|
inline |
Gets the component's state.
|
inlinevirtual |
|
inlinevirtual |
|
inlineprotected |
Set the Parent object.
parent | A shared pointer to the parent component |