#include <kanzi/core.ui/state_manager/state_manager.hpp>
Public Member Functions | |
TargetObject (Node *rootNode, string_view objectPath) | |
Constructor. More... | |
~TargetObject () | |
Destructor. More... | |
void | registerStateObjectRuntime (StateObjectRuntimeSharedPtr stateObjectRuntime) |
Register state object runtime which should be notified when target is acquired or lost. More... | |
Object * | get () |
Gets acquired target. More... | |
Object * | getBaseObject () |
Gets acquired target. More... | |
void | sync () |
Refreshes target. More... | |
void | destroy () |
Destroys TargetObject. More... | |
bool | hasClonedTargetResource () const |
Tells if there is a cloned target resource. More... | |
TargetObject is responsible for keeping track of a target object (node or resource) to which state object runtimes apply their styles. TargetObject also notifies referencing state object runtimes when target becomes acquired or lost.
|
explicit |
Constructor.
rootNode | Root node for resolving target. |
objectPath | Path to target relative to root node. |
kanzi::StateManager::TargetObject::~TargetObject | ( | ) |
Destructor.
void kanzi::StateManager::TargetObject::registerStateObjectRuntime | ( | StateObjectRuntimeSharedPtr | stateObjectRuntime | ) |
Register state object runtime which should be notified when target is acquired or lost.
stateObjectRuntime | State object runtime which should be notified. |
Object* kanzi::StateManager::TargetObject::get | ( | ) |
Gets acquired target.
If target is not found, null pointer is returned. This always returns the cloned object if a clone has been made.
Object* kanzi::StateManager::TargetObject::getBaseObject | ( | ) |
Gets acquired target.
If target is not found, null pointer is returned. Gets the base object even if clone has been made.
void kanzi::StateManager::TargetObject::sync | ( | ) |
Refreshes target.
Currently TargetObject is not able to automatically detect when target is acquired, so this function should be manually called. Calling this function might trigger notification about acquiring the target.
void kanzi::StateManager::TargetObject::destroy | ( | ) |
Destroys TargetObject.
After TargetObject is destroyed, it does not track its target and get() function always returns null pointer.
|
inline |
Tells if there is a cloned target resource.