|
MT Showcase SDK
|
Interface for the basic building block of Showcase. More...
#include <Component.hpp>
Public Member Functions | |
| Component (CachedGraphPtr uiGraph=nullptr) | |
| Create a new component. More... | |
| void | setCachedGraph (CachedGraphPtr uiGraph) |
| Showcase nodes are stored in cached graphs. More... | |
| void | init (const GraphNode &confNode) |
| Initializes the component and links it to the given graph node. More... | |
| const QString & | name () const |
| Each component has a unique name that identifies it. More... | |
| void | setComponentName (const QString &name) |
| Set a new name for this coomponent. More... | |
| void | setSchema (const Schema &schema) |
| Schema holds the definition of the component. More... | |
| const Schema & | schema () const |
| Get the schema of this component. More... | |
| ComponentInstancePtr | createInstance () |
| A single component can have multiple instances, each instance behaves independently from one another, but is tied to the creator component. More... | |
| void | instanceDestroyed (ComponentInstanceKey key) |
| Component keeps track of its instances, and must be notified when an instance is destroyed. More... | |
| size_t | numInstances () const |
| Returns the current number of alive instances created from this component. More... | |
| CachedGraphPtr | cachedGraph () const |
| Returns the cached graph that this component is part of. More... | |
| CachedNodePtr | cachedNode () const |
| Returns the cached graph node that links to this component. More... | |
| const NodeId & | nodeId () const |
| Returns the node id of this component's cached node. More... | |
| const std::list < ComponentInstancePtr > & | instances () const |
| Returns all current instances of this component. More... | |
Protected Member Functions | |
| void | applyForInstances (std::function< void(ComponentInstancePtr)> &&f) |
| Calls f for each instance. | |
Interface for the basic building block of Showcase.
Component is a factory class, that creates instances of the actual classes providing UI-functionality
| Showcase::Component::Component | ( | CachedGraphPtr | uiGraph = nullptr | ) |
Create a new component.
| uiGraph | the cached graph for the component |
| CachedGraphPtr Showcase::Component::cachedGraph | ( | ) | const |
Returns the cached graph that this component is part of.
| CachedNodePtr Showcase::Component::cachedNode | ( | ) | const |
Returns the cached graph node that links to this component.
| ComponentInstancePtr Showcase::Component::createInstance | ( | ) |
A single component can have multiple instances, each instance behaves independently from one another, but is tied to the creator component.
Create a new instance of this component.
This is possible to be called even before initialization..
| void Showcase::Component::init | ( | const GraphNode & | confNode | ) |
Initializes the component and links it to the given graph node.
Need to be called right after the construction
| confNode | node in a graph that maps to this component |
Should we do anything with properties on construction?
There may be children hidden in properties, so setup onChildEvent before going through them
| void Showcase::Component::instanceDestroyed | ( | ComponentInstanceKey | key | ) |
Component keeps track of its instances, and must be notified when an instance is destroyed.
| key | of the destroyed instance |
In destruction this is already emptied
| const std::list< ComponentInstancePtr > & Showcase::Component::instances | ( | ) | const |
Returns all current instances of this component.
| const QString & Showcase::Component::name | ( | ) | const |
Each component has a unique name that identifies it.
| const NodeId & Showcase::Component::nodeId | ( | ) | const |
Returns the node id of this component's cached node.
| size_t Showcase::Component::numInstances | ( | ) | const |
Returns the current number of alive instances created from this component.
| const Schema & Showcase::Component::schema | ( | ) | const |
Get the schema of this component.
| void Showcase::Component::setCachedGraph | ( | CachedGraphPtr | uiGraph | ) |
Showcase nodes are stored in cached graphs.
Each component maps to a single graph node. Set the graph for this component
| uiGraph | new cached graph for the component |
Only meaningfuld before init & setConfigurationNode
| void Showcase::Component::setComponentName | ( | const QString & | name | ) |
Set a new name for this coomponent.
| name | new name for the component |