Kanzi 3.9.10
kanzi::ActivityElement Class Referenceabstract

ActivityElement is the base class for all Activity and Activity Host classes. More...

#include <kanzi/ui/node/concept/activity/activity_element.hpp>

Inheritance diagram for kanzi::ActivityElement:
[legend]

Public Member Functions

vector< NodeSharedPtr >::const_iterator beginChildHosts () const
 Returns the begin iterator to the registered child Activity Host.
 
virtual void deserialize (string_view data)
 Deserializes the activity element from a byte buffer.
 
vector< NodeSharedPtr >::const_iterator endChildHosts () const
 Returns the end iterator to the registered child Activity Host.
 
NodefindChildHost (string_view hostName)
 Finds a child Activity Host by name.
 
vector< string > getCommands () const
 Gets the list of commands handled by code behind of this activity element.
 
ActivityHistoryManagergetHistoryManager () const
 Gets the history manager of this activity element.
 
virtual const NodegetNode () const =0
 Gets the underlying Node object.
 
virtual NodegetNode ()=0
 Gets the underlying Node object.
 
ActivityElementgetParentElement ()
 Gets the parent ActivityElement type node.
 
bool isLeafActivityNode () const
 Returns whether an ActivityElement has a child Activity Host.
 
virtual string serialize ()
 Serializes the activity element to a byte buffer.
 
void setCodeBehind (CodeBehindSharedPtr codeBehind)
 Attaches a code behind object.
 
void setCodeBehind (const Metaclass *metaclass)
 Instantiates and attaches a code behind object by specifying its metaclass.
 
virtual ~ActivityElement ()=default
 Destructor.
 

Static Public Member Functions

static string getFirstElement (string_view activationSequence)
 Gets the first element of the activation sequence.
 
static string getRestToForward (string_view activationSequence)
 Gets the remainder of the activation sequence.
 
template<typename Type >
static bool isActivityElement (const Type &object)
 Returns whether an object is an ActivityElement.
 
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 

Static Public Attributes

Properties

Use this property to check whether an ActivityElement type node is attached or not.

The default value is false.

static PropertyType< boolAttachedProperty
 
static PropertyType< boolPreserveHistoryProperty
 Enables the preservation of Activity property values when that Activity becomes inactive.
 

Protected Member Functions

optional< ActivityBrowserController::ActivityIDgetActivityID () const
 Gets the unique ID that is used by the implementation of the Activity Browser.
 
string getPathInParent ()
 Gets the activation path of this activity element relative to its parent.
 
void initialize ()
 Initializes the activity element.
 
bool isRootActivityElement () const
 Returns whether an ActivityElement is the root Activity Host node of the Screen node.
 
virtual void notifyChildrenNodeTreeAvailable ()
 Notifies child activity elements that node info tree is available.
 
void onForceTrigger (const ActivityBrowserController::ForceTriggerMessageArguments &args)
 Message handler for ActivityBrowserController::ForceTriggerMessage.
 
void onNodeInfoTreeAvailable (const ActivityBrowserController::NodeInfoTreeAvailableArguments &)
 Message handler for ActivityBrowserController::NodeInfoTreeAvailableMessage.
 
void registerChildHost (string_view hostPath)
 Registers a child host in this activity element.
 
virtual void registerInParentActivityElement ()=0
 Derived classes implement this function to register themselves in the parent during the construction of the activity graph.
 
void setActivityID (optional< ActivityBrowserController::ActivityID > activityID)
 Sets the unique ID that is used by the implementation of the Activity Browser.
 
void unregisterChildHost (string_view hostName)
 Unregisters a child host from this activity element.
 
virtual void unregisterInParentActivityElement ()=0
 Derived classes implement this function to unregister themselves from the parent during the destruction of the activity graph.
 
void updateActivityBrowserProperties ()
 Triggers the Activity Browser to update the properties of the Activity Element.
 

Detailed Description

ActivityElement is the base class for all Activity and Activity Host classes.

ActivityElement provides the way to manipulate the activity graph in a uniform manner. ActivityElement provides this base functionality to all Activity and Activity Host classes:

  • Access the parent Activity Element.
  • Access the child Activity Host nodes.
  • Access the underlying Node object.
  • Code Behind.
  • Serialization and History Manager.

Constructor & Destructor Documentation

◆ ~ActivityElement()

virtual kanzi::ActivityElement::~ActivityElement ( )
virtualdefault

Destructor.

Member Function Documentation

◆ makeEditorInfo()

static PropertyTypeEditorInfoSharedPtr kanzi::ActivityElement::makeEditorInfo ( )
static

◆ getNode() [1/2]

virtual Node * kanzi::ActivityElement::getNode ( )
pure virtual

Gets the underlying Node object.

Returns
The underlying Node object pointer.

Implemented in kanzi::ActivityConceptImpl< TBaseClass, TDerivedClass >, kanzi::ActivityConceptImpl< ContentLayout2D, Activity2D >, kanzi::ActivityConceptImpl< ContentLayout3D, Activity3D >, kanzi::ActivityElementImpl< TBaseClass, TDerivedClass >, kanzi::ActivityElementImpl< ContentLayout2D, Activity2D >, kanzi::ActivityElementImpl< ContentLayout2D, DataDrivenExclusiveActivityHost2D >, kanzi::ActivityElementImpl< ContentLayout2D, ExclusiveActivityHost2D >, kanzi::ActivityElementImpl< ContentLayout2D, ParallelActivityHost2D >, kanzi::ActivityElementImpl< ContentLayout3D, Activity3D >, kanzi::ActivityElementImpl< ContentLayout3D, DataDrivenExclusiveActivityHost3D >, kanzi::ActivityElementImpl< ContentLayout3D, ExclusiveActivityHost3D >, kanzi::ActivityElementImpl< ContentLayout3D, ParallelActivityHost3D >, kanzi::DataDrivenExclusiveActivityHostImpl< TBaseClass, TDerivedClass >, kanzi::DataDrivenExclusiveActivityHostImpl< ContentLayout2D, DataDrivenExclusiveActivityHost2D >, kanzi::DataDrivenExclusiveActivityHostImpl< ContentLayout3D, DataDrivenExclusiveActivityHost3D >, kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >, kanzi::ExclusiveActivityHostBaseImpl< ContentLayout2D, DataDrivenExclusiveActivityHost2D >, kanzi::ExclusiveActivityHostBaseImpl< ContentLayout2D, ExclusiveActivityHost2D >, kanzi::ExclusiveActivityHostBaseImpl< ContentLayout3D, DataDrivenExclusiveActivityHost3D >, kanzi::ExclusiveActivityHostBaseImpl< ContentLayout3D, ExclusiveActivityHost3D >, kanzi::ExclusiveActivityHostImpl< TBaseClass, TDerivedClass >, kanzi::ExclusiveActivityHostImpl< ContentLayout2D, ExclusiveActivityHost2D >, and kanzi::ExclusiveActivityHostImpl< ContentLayout3D, ExclusiveActivityHost3D >.

◆ getNode() [2/2]

virtual const Node * kanzi::ActivityElement::getNode ( ) const
pure virtual

Gets the underlying Node object.

Returns
The underlying Node object pointer.

Implemented in kanzi::ActivityConceptImpl< TBaseClass, TDerivedClass >, kanzi::ActivityConceptImpl< ContentLayout2D, Activity2D >, kanzi::ActivityConceptImpl< ContentLayout3D, Activity3D >, kanzi::ActivityElementImpl< TBaseClass, TDerivedClass >, kanzi::ActivityElementImpl< ContentLayout2D, Activity2D >, kanzi::ActivityElementImpl< ContentLayout2D, DataDrivenExclusiveActivityHost2D >, kanzi::ActivityElementImpl< ContentLayout2D, ExclusiveActivityHost2D >, kanzi::ActivityElementImpl< ContentLayout2D, ParallelActivityHost2D >, kanzi::ActivityElementImpl< ContentLayout3D, Activity3D >, kanzi::ActivityElementImpl< ContentLayout3D, DataDrivenExclusiveActivityHost3D >, kanzi::ActivityElementImpl< ContentLayout3D, ExclusiveActivityHost3D >, kanzi::ActivityElementImpl< ContentLayout3D, ParallelActivityHost3D >, kanzi::DataDrivenExclusiveActivityHostImpl< TBaseClass, TDerivedClass >, kanzi::DataDrivenExclusiveActivityHostImpl< ContentLayout2D, DataDrivenExclusiveActivityHost2D >, kanzi::DataDrivenExclusiveActivityHostImpl< ContentLayout3D, DataDrivenExclusiveActivityHost3D >, kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >, kanzi::ExclusiveActivityHostBaseImpl< ContentLayout2D, DataDrivenExclusiveActivityHost2D >, kanzi::ExclusiveActivityHostBaseImpl< ContentLayout2D, ExclusiveActivityHost2D >, kanzi::ExclusiveActivityHostBaseImpl< ContentLayout3D, DataDrivenExclusiveActivityHost3D >, kanzi::ExclusiveActivityHostBaseImpl< ContentLayout3D, ExclusiveActivityHost3D >, kanzi::ExclusiveActivityHostImpl< TBaseClass, TDerivedClass >, kanzi::ExclusiveActivityHostImpl< ContentLayout2D, ExclusiveActivityHost2D >, and kanzi::ExclusiveActivityHostImpl< ContentLayout3D, ExclusiveActivityHost3D >.

◆ serialize()

◆ deserialize()

◆ setCodeBehind() [1/2]

void kanzi::ActivityElement::setCodeBehind ( const Metaclass * metaclass)

Instantiates and attaches a code behind object by specifying its metaclass.

Parameters
metaclassThe metaclass of the code behind class you want to instantiate and attach.

◆ setCodeBehind() [2/2]

void kanzi::ActivityElement::setCodeBehind ( CodeBehindSharedPtr codeBehind)

Attaches a code behind object.

Parameters
codeBehindThe code behind object you want to attach.

◆ getCommands()

vector< string > kanzi::ActivityElement::getCommands ( ) const

Gets the list of commands handled by code behind of this activity element.

Returns
Returns the list of commands handled by code behind of this activity element.

◆ getHistoryManager()

ActivityHistoryManager * kanzi::ActivityElement::getHistoryManager ( ) const

Gets the history manager of this activity element.

Returns
The history manager.

◆ getParentElement()

ActivityElement * kanzi::ActivityElement::getParentElement ( )

Gets the parent ActivityElement type node.

Returns
The parent element or nullptr if this is the root element.

◆ findChildHost()

Node * kanzi::ActivityElement::findChildHost ( string_view hostName)

Finds a child Activity Host by name.

Parameters
hostNameThe name of the child Activity Host to find.
Returns
The pointer to the child Activity Host if found, nullptr otherwise.

◆ isLeafActivityNode()

bool kanzi::ActivityElement::isLeafActivityNode ( ) const

Returns whether an ActivityElement has a child Activity Host.

Returns
If this ActivityElement is a leaf Activity node, true, otherwise false.
Since
Kanzi 3.9.0

◆ isActivityElement()

template<typename Type >
bool kanzi::ActivityElement::isActivityElement ( const Type & object)
static

Returns whether an object is an ActivityElement.

Parameters
objectObject for which you want to check whether it is an ActivityElement.
Returns
If the object is an ActivityElement, returns true, otherwise false.

◆ getFirstElement()

static string kanzi::ActivityElement::getFirstElement ( string_view activationSequence)
static

Gets the first element of the activation sequence.

Parameters
activationSequenceActivation sequence to parse.
Returns
Returns the first element.

◆ getRestToForward()

static string kanzi::ActivityElement::getRestToForward ( string_view activationSequence)
static

Gets the remainder of the activation sequence.

Parameters
activationSequenceActivation sequence to parse.
Returns
Returns the remainder of the sequence.

◆ beginChildHosts()

vector< NodeSharedPtr >::const_iterator kanzi::ActivityElement::beginChildHosts ( ) const

Returns the begin iterator to the registered child Activity Host.

Returns
The begin iterator to the registered child Activity Host.
Since
Kanzi 3.9.4

◆ endChildHosts()

vector< NodeSharedPtr >::const_iterator kanzi::ActivityElement::endChildHosts ( ) const

Returns the end iterator to the registered child Activity Host.

Returns
The end iterator to the registered child Activity Host.
Since
Kanzi 3.9.4

◆ registerInParentActivityElement()

◆ unregisterInParentActivityElement()

◆ initialize()

void kanzi::ActivityElement::initialize ( )
protected

Initializes the activity element.

You must call this function in derived classes.

◆ registerChildHost()

void kanzi::ActivityElement::registerChildHost ( string_view hostPath)
protected

Registers a child host in this activity element.

Parameters
hostPathThe node tree path to the host to register.

◆ unregisterChildHost()

void kanzi::ActivityElement::unregisterChildHost ( string_view hostName)
protected

Unregisters a child host from this activity element.

Parameters
hostNameThe name of the host to unregister.

◆ notifyChildrenNodeTreeAvailable()

◆ getActivityID()

optional< ActivityBrowserController::ActivityID > kanzi::ActivityElement::getActivityID ( ) const
protected

Gets the unique ID that is used by the implementation of the Activity Browser.

◆ setActivityID()

void kanzi::ActivityElement::setActivityID ( optional< ActivityBrowserController::ActivityID > activityID)
protected

Sets the unique ID that is used by the implementation of the Activity Browser.

◆ getPathInParent()

string kanzi::ActivityElement::getPathInParent ( )
protected

Gets the activation path of this activity element relative to its parent.

◆ updateActivityBrowserProperties()

void kanzi::ActivityElement::updateActivityBrowserProperties ( )
protected

Triggers the Activity Browser to update the properties of the Activity Element.

◆ isRootActivityElement()

bool kanzi::ActivityElement::isRootActivityElement ( ) const
protected

Returns whether an ActivityElement is the root Activity Host node of the Screen node.

Returns
If this ActivityElement is the root Activity Host, true, otherwise false.
Since
Kanzi 3.9.0

◆ onNodeInfoTreeAvailable()

void kanzi::ActivityElement::onNodeInfoTreeAvailable ( const ActivityBrowserController::NodeInfoTreeAvailableArguments & )
protected

Message handler for ActivityBrowserController::NodeInfoTreeAvailableMessage.

Performs connection to the Activity Browser data model.

◆ onForceTrigger()

void kanzi::ActivityElement::onForceTrigger ( const ActivityBrowserController::ForceTriggerMessageArguments & args)
protected

Message handler for ActivityBrowserController::ForceTriggerMessage.

Forces a trigger to execute.

Member Data Documentation

◆ AttachedProperty

PropertyType<bool> kanzi::ActivityElement::AttachedProperty
static

◆ PreserveHistoryProperty

PropertyType<bool> kanzi::ActivityElement::PreserveHistoryProperty
static

Enables the preservation of Activity property values when that Activity becomes inactive.

The default value is true.

Since
Kanzi 3.9.8

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