#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 (StateObjectRuntime &stateObjectRuntime) |
Register state object runtime which should be notified when target is acquired or lost. More... | |
Object * | get () |
Gets acquired target. More... | |
void | sync () |
Refreshes target. More... | |
void | destroy () |
Destroys TargetObject. 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 | ( | StateObjectRuntime & | 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.
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.