Kanzi Framework  3.9.0
Kanzi Engine API
kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass > Class Template Reference

Implementation of common functionality of ExclusiveActivityHost and DataDrivenExclusiveActivityHost classes. More...

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

Inheritance diagram for kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >:
[legend]

Public Member Functions

TDerivedClass * getThisObject ()
 Internal accessor for curiously recurring template pattern. More...
 
const TDerivedClass * getThisObject () const
 Internal accessor for curiously recurring template pattern. More...
 
void onFinishedExclusiveDeactivatingAnimationInternal (const ActivityConcept::ActivityBaseArguments &args)
 Message handler for FinishedExclusiveDeactivatingAnimationInternal message. More...
 
void onFinishedParallelActivatingAnimationInternal (const ActivityConcept::ActivityBaseArguments &args)
 Message handler for FinishedParallelActivatingAnimationInternal message. More...
 
void onFinishedParallelDeactivatingAnimationInternal (const ActivityConcept::ActivityBaseArguments &args)
 Message handler for FinishedParallelDeactivatingAnimationInternal message. More...
 
NodeSharedPtr onPrefabLoaded (PrefabTemplateSharedPtr prefabTemplate, string_view activityName) override
 ExclusiveActivityHostConcept::onPrefabLoaded implementation. More...
 
void setActivationModifier (string_view activityName, BindingTokenWeakPtr weakModifier) override
 ActivityHostConcept::setActivationModifier implementation. More...
 
- Public Member Functions inherited from kanzi::ActivityHostConceptImpl< TBaseClass, TDerivedClass >
void deserialize (string_view data) override
 ActivityElement::deserialize implementation. More...
 
TDerivedClass * getThisObject ()
 Internal accessor for curiously recurring template pattern. More...
 
const TDerivedClass * getThisObject () const
 Internal accessor for curiously recurring template pattern. More...
 
void notifyChildrenNodeTreeAvailable () override
 ActivityElement::notifyChildrenNodeTreeAvailable implementation. More...
 
string serialize () override
 ActivityElement::serialize implementation. More...
 
- Public Member Functions inherited from kanzi::ActivityElement
NodefindChildHost (string_view hostName)
 Finds a child Activity Host by name. More...
 
vector< string > getCommands () const
 Gets the list of commands handled by code behind of this activity element. More...
 
ActivityHistoryManagergetHistoryManager () const
 Gets the history manager of this activity element. More...
 
ActivityElementgetParentElement ()
 Gets the parent ActivityElement type node. More...
 
bool isLeafActivityNode () const
 Returns whether an ActivityElement has a child Activity Host. More...
 
const NoderestoreLastFocusedNode ()
 Restores the focus to a child node of this Activity node, if the Activity node: More...
 
void setCodeBehind (const Metaclass *metaclass)
 Instantiates and attaches a code behind object by specifying its metaclass. More...
 
void setCodeBehind (CodeBehindSharedPtr codeBehind)
 Attaches a code behind object. More...
 
void setLastFocusedNodePath ()
 Sets the last focused node path of this Activity node to the currently focused child node, if the Activity node: More...
 
virtual ~ActivityElement ()=default
 Destructor. More...
 
- Public Member Functions inherited from kanzi::ActivityHostConcept
virtual ~ActivityHostConcept ()=default
 Destructor. More...
 
- Public Member Functions inherited from kanzi::ExclusiveActivityHostConcept
virtual ~ExclusiveActivityHostConcept ()=default
 Destructor. More...
 

Protected Member Functions

void activate (const ActivityHostConcept::ActivityInfo &activity)
 Requests the ExclusiveActivityHost to activate an Activity node. More...
 
void activate (const ActivityHostConcept::ActivityInfo &activity, string_view activationPath)
 Requests the ExclusiveActivityHost to activate an Activity node, and to forward the activation path to activate the children of the Activity node, if the Activity node is already active or activating. More...
 
void deactivate ()
 Requests the ExclusiveActivityHost to deactivate the currently active Activity node. More...
 
 ExclusiveActivityHostBaseImpl (Domain *domain, string_view name)
 Constructor. More...
 
string getActiveOrActivatingName () const
 Gets the currently active or activating Activity node. More...
 
vector< NodeWeakPtrgetActiveOrAttachedActivating () override
 ActivityHostConceptImpl::getActiveOrAttachedActivating implementation. More...
 
const vector< ExclusiveActivityHostConcept::ActivityInExclusiveHostInfo > & getActivitiesInfo () const override
 ExclusiveActivityHostConcept::getActivitiesInfo implementation. More...
 
optional< ActivityHostConcept::ActivityInfogetActivityInfo (string_view name) const override
 ActivityHostConceptImpl::getActivityInfo implementation. More...
 
vector< NodeWeakPtrgetAttachedActivityNodes () override
 ActivityHostConceptImpl::getAttachedActivityNodes implementation. More...
 
NodegetNode () override
 ExclusiveActivityHostConcept::getNode implementation. More...
 
const NodegetNode () const override
 ExclusiveActivityHostConcept::getNode implementation. More...
 
void initialize ()
 Initializes this exclusive activity host. More...
 
template<typename Iterator >
string nextToActivate (Iterator iterBegin, Iterator iterEnd, string_view current, bool looping) const
 Calculates which Activity node is going to be activated if the current active Activity node deactivates. More...
 
void onActivateActivityOverride (string_view activationPath) override
 ActivityHostConcept::onActivateActivityOverride implementation. More...
 
void onActivityActivated (NodeSharedPtr activity, string_view prefabPath) override
 ExclusiveActivityHostConcept::onActivityActivated implementation. More...
 
void onActivityDeactivated (NodeSharedPtr activity) override
 ExclusiveActivityHostConcept::onActivityDeactivated implementation. More...
 
void onAttachedOverride () override
 ActivityElement::onAttachedOverride implementation. More...
 
void onDetached () override
 Node::onDetached implementation. More...
 
void onNodePropertyChanged (AbstractPropertyType propertyType, PropertyNotificationReason reason) override
 Node::onNodePropertyChanged implementation. More...
 
virtual ~ExclusiveActivityHostBaseImpl ()=default
 Destructor. More...
 
- Protected Member Functions inherited from kanzi::ActivityHostConceptImpl< TBaseClass, TDerivedClass >
 ActivityHostConceptImpl (Domain *domain, string_view name)
 Constructor. More...
 
void initialize ()
 Initializes this Activity Host Concept. More...
 
void registerInParentActivityElement () final
 ActivityElement::registerInParentActivityElement implementation. More...
 
void unregisterInParentActivityElement () final
 ActivityElement::unregisterInParentActivityElement implementation. More...
 
virtual ~ActivityHostConceptImpl ()=default
 Destructor. More...
 
- Protected Member Functions inherited from kanzi::ActivityElementImpl< TBaseClass, TDerivedClass >
 ActivityElementImpl (Domain *domain, string_view name)
 Constructor. More...
 
TDerivedClass * getThisObject ()
 Internal accessor for curiously recurring template pattern. More...
 
const TDerivedClass * getThisObject () const
 Internal accessor for curiously recurring template pattern. More...
 
void initialize ()
 Initializes the activity element. More...
 
void onAttached () override
 Node::onAttached implementation. More...
 
void onDetached () override
 Node::onDetached implementation. More...
 
void onNodePropertyChanged (AbstractPropertyType propertyType, PropertyNotificationReason reason) override
 Node::onNodePropertyChanged implementation. More...
 
 ~ActivityElementImpl () override=default
 Destructor. More...
 
- Protected Member Functions inherited from kanzi::ActivityElement
optional< ActivityBrowserController::ActivityIDgetActivityID () const
 Gets the unique ID that is used by the implementation of the Activity Browser. More...
 
string getPathInParent ()
 Gets the activation path of this activity element relative to its parent. More...
 
void initialize ()
 Initializes the activity element. More...
 
bool isRootActivityElement () const
 Returns whether an ActivityElement is the root Activity Host node of the Screen node. More...
 
void onForceTrigger (const ActivityBrowserController::ForceTriggerMessageArguments &args)
 Message handler for ActivityBrowserController::ForceTriggerMessage. More...
 
void onNodeInfoTreeAvailable (const ActivityBrowserController::NodeInfoTreeAvailableArguments &)
 Message handler for ActivityBrowserController::NodeInfoTreeAvailableMessage. More...
 
void registerChildHost (string_view hostPath)
 Registers a child host in this activity element. More...
 
void setActivityID (optional< ActivityBrowserController::ActivityID > activityID)
 Sets the unique ID that is used by the implementation of the Activity Browser. More...
 
void unregisterChildHost (string_view hostName)
 Unregisters a child host from this activity element. More...
 
void updateActivityBrowserProperties ()
 Triggers the Activity Browser to update the properties of the Activity Element. More...
 
- Protected Member Functions inherited from kanzi::ExclusiveActivityHostConcept
virtual void onNavigateNextMessage (const ExclusiveActivityHostConcept::ImplicitActivityChangeRequestMessageArguments &args)=0
 Message handler for ExclusiveActivityHostConcept::NavigateNextMessage. More...
 
virtual void onNavigatePreviousMessage (const ExclusiveActivityHostConcept::ImplicitActivityChangeRequestMessageArguments &args)=0
 Message handler for ExclusiveActivityHostConcept::NavigatePreviousMessage. More...
 

Additional Inherited Members

- Public Types inherited from kanzi::ActivityHostConcept
enum  ActivationStatus { ActivationStatus::PreparingForActivation, ActivationStatus::ParallelAnimation, ActivationStatus::ExclusiveAnimation }
 Specifies possible stages for internal tracking of activation of an activity. More...
 
using ActivityInfoContainer = vector< ActivityInfo >
 
enum  DeactivationStatus { DeactivationStatus::ExclusiveAnimation, DeactivationStatus::ParallelAnimation, DeactivationStatus::WaitingForRelease }
 Specifies possible stages for internal tracking of deactivation of an activity. More...
 
enum  FocusLostFlag { FocusLostFlag::FocusLossObserved, FocusLostFlag::NoFocusLossObserved }
 An Activity Host uses this enum to keep track of whether it has lost focus during Activity switching. More...
 
- Static Public Member Functions inherited from kanzi::ActivityElement
static string getFirstElement (string_view activationSequence)
 Gets the first element of the activation sequence. More...
 
static string getRestToForward (string_view activationSequence)
 Gets the remainder of the activation sequence. More...
 
template<typename Type >
static bool isActivityElement (const Type &object)
 Checks if and object is an ActivityElement. More...
 
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 
- Static Public Member Functions inherited from kanzi::ActivityHostConcept
template<typename Type >
static bool isActivityHost (const Type &object)
 Determines if an object is an ActivityHost. More...
 
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 
- Static Public Member Functions inherited from kanzi::ExclusiveActivityHostConcept
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 Returns PropertyType editor info of exclusive activity concept. More...
 
- Static Public Attributes inherited from kanzi::ActivityElement
static PropertyType< bool > AttachedProperty
 
- Static Public Attributes inherited from kanzi::ActivityHostConcept
static MessageType< ActivationMessageArgumentsActivateActivityMessage
 You can send ActivateActivity to the host to activate an activity. More...
 
static MessageType< ActivationMessageArgumentsDeactivateActivityMessage
 You can send DeactivateActivity to the host to deactivate an activity. More...
 
static MessageType< RegisterActivityElementInternalMessageArgumentsRegisterHostInternalMessage
 Internal message sent by an activity host to its parent activity or activity host to register the host in the parent. More...
 
static MessageType< ActivityHostConceptInternalArgumentsRestoreFocusInternalMessage
 Internal message sent by an Activity Host to its ancestor parent Activity Hosts to trigger the focus resolving. More...
 
static MessageType< UnregisterActivityElementInternalMessageArgumentsUnregisterHostInternalMessage
 Internal message sent by an activity host to its parent activity or activity host to unregister the host from the parent. More...
 
- Static Public Attributes inherited from kanzi::ExclusiveActivityHostConcept
static MessageType< ImplicitActivityChangeRequestMessageArgumentsNavigateNextMessage
 In an Exclusive Activity Host requests the activation of the next Activity node in that Exclusive Activity Host node. More...
 
static MessageType< ImplicitActivityChangeRequestMessageArgumentsNavigatePreviousMessage
 In an Exclusive Activity Host requests the activation of the previous Activity node in that Exclusive Activity Host node. More...
 
static PropertyType< string > ExclusiveActivityHostContentProperty
 Describes the content of an Exclusive Activity Host node. More...
 
static PropertyType< string > ActiveActivityProperty
 The name of the child Activity node of an Exclusive Activity Host, that is either in ActivityConcept::Status::Active or in ActivityConcept::Status::Activating state. More...
 
static PropertyType< string > ActivationPathProperty
 The activation path containing the branch of the Activity tree that is requested to be activated. More...
 
- Protected Attributes inherited from kanzi::ActivityHostConceptImpl< TBaseClass, TDerivedClass >
FocusLostFlag m_focusLostDuringSwitching
 Indicates whether this Activity Host lost focus during Activity switching, resulting in the loss of the active focus. More...
 

Detailed Description

template<typename TBaseClass, typename TDerivedClass>
class kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >

Implementation of common functionality of ExclusiveActivityHost and DataDrivenExclusiveActivityHost classes.

This is a helper class for the Exclusive Activity Host type classes.

Since
Kanzi 3.9.0

Constructor & Destructor Documentation

◆ ExclusiveActivityHostBaseImpl()

template<typename TBaseClass , typename TDerivedClass >
kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >::ExclusiveActivityHostBaseImpl ( Domain domain,
string_view  name 
)
explicitprotected

Constructor.

Parameters
domainThe domain the new node belongs to.
nameThe name of the node.

◆ ~ExclusiveActivityHostBaseImpl()

template<typename TBaseClass, typename TDerivedClass>
virtual kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >::~ExclusiveActivityHostBaseImpl ( )
protectedvirtualdefault

Destructor.

Member Function Documentation

◆ getThisObject() [1/2]

template<typename TBaseClass , typename TDerivedClass >
TDerivedClass * kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >::getThisObject ( )

Internal accessor for curiously recurring template pattern.

◆ getThisObject() [2/2]

template<typename TBaseClass , typename TDerivedClass >
const TDerivedClass * kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >::getThisObject ( ) const

Internal accessor for curiously recurring template pattern.

◆ onFinishedParallelActivatingAnimationInternal()

template<typename TBaseClass , typename TDerivedClass >
void kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >::onFinishedParallelActivatingAnimationInternal ( const ActivityConcept::ActivityBaseArguments args)

Message handler for FinishedParallelActivatingAnimationInternal message.

Parameters
argsMessage arguments.

◆ onFinishedParallelDeactivatingAnimationInternal()

template<typename TBaseClass , typename TDerivedClass >
void kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >::onFinishedParallelDeactivatingAnimationInternal ( const ActivityConcept::ActivityBaseArguments args)

Message handler for FinishedParallelDeactivatingAnimationInternal message.

Parameters
argsMessage arguments.

◆ onFinishedExclusiveDeactivatingAnimationInternal()

template<typename TBaseClass , typename TDerivedClass >
void kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >::onFinishedExclusiveDeactivatingAnimationInternal ( const ActivityConcept::ActivityBaseArguments args)

Message handler for FinishedExclusiveDeactivatingAnimationInternal message.

Parameters
argsMessage arguments.

◆ setActivationModifier()

template<typename TBaseClass , typename TDerivedClass >
void kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >::setActivationModifier ( string_view  activityName,
BindingTokenWeakPtr  weakModifier 
)
overridevirtual

◆ onPrefabLoaded()

template<typename TBaseClass , typename TDerivedClass >
NodeSharedPtr kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >::onPrefabLoaded ( PrefabTemplateSharedPtr  prefabTemplate,
string_view  activityName 
)
overridevirtual

◆ initialize()

template<typename TBaseClass , typename TDerivedClass >
void kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >::initialize ( )
protected

Initializes this exclusive activity host.

◆ onDetached()

template<typename TBaseClass , typename TDerivedClass >
void kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >::onDetached ( )
overrideprotected

◆ onNodePropertyChanged()

template<typename TBaseClass , typename TDerivedClass >
void kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >::onNodePropertyChanged ( AbstractPropertyType  propertyType,
PropertyNotificationReason  reason 
)
overrideprotected

◆ onAttachedOverride()

template<typename TBaseClass , typename TDerivedClass >
void kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >::onAttachedOverride ( )
overrideprotectedvirtual

◆ onActivateActivityOverride()

template<typename TBaseClass , typename TDerivedClass >
void kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >::onActivateActivityOverride ( string_view  activationPath)
overrideprotectedvirtual

◆ getActiveOrAttachedActivating()

template<typename TBaseClass , typename TDerivedClass >
vector< NodeWeakPtr > kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >::getActiveOrAttachedActivating ( )
overrideprotectedvirtual

◆ getAttachedActivityNodes()

template<typename TBaseClass , typename TDerivedClass >
vector< NodeWeakPtr > kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >::getAttachedActivityNodes ( )
overrideprotectedvirtual

◆ getNode() [1/2]

◆ getNode() [2/2]

◆ onActivityActivated()

template<typename TBaseClass , typename TDerivedClass >
void kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >::onActivityActivated ( NodeSharedPtr  activity,
string_view  prefabPath 
)
overrideprotectedvirtual

◆ onActivityDeactivated()

template<typename TBaseClass , typename TDerivedClass >
void kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >::onActivityDeactivated ( NodeSharedPtr  activity)
overrideprotectedvirtual

◆ getActivitiesInfo()

◆ getActivityInfo()

template<typename TBaseClass , typename TDerivedClass >
optional< ActivityHostConcept::ActivityInfo > kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >::getActivityInfo ( string_view  name) const
overrideprotectedvirtual

◆ activate() [1/2]

template<typename TBaseClass , typename TDerivedClass >
void kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >::activate ( const ActivityHostConcept::ActivityInfo activity)
protected

Requests the ExclusiveActivityHost to activate an Activity node.

Parameters
activityThe ActivityInfo object of the Activity node to activate.

◆ activate() [2/2]

template<typename TBaseClass , typename TDerivedClass >
void kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >::activate ( const ActivityHostConcept::ActivityInfo activity,
string_view  activationPath 
)
protected

Requests the ExclusiveActivityHost to activate an Activity node, and to forward the activation path to activate the children of the Activity node, if the Activity node is already active or activating.

Parameters
activityThe ActivityInfo object of the Activity node to activate.
activationPathActivation path to activate the children of the Activity node.

◆ deactivate()

template<typename TBaseClass , typename TDerivedClass >
void kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >::deactivate ( )
protected

Requests the ExclusiveActivityHost to deactivate the currently active Activity node.

◆ nextToActivate()

template<typename TBaseClass , typename TDerivedClass >
template<typename Iterator >
string kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >::nextToActivate ( Iterator  iterBegin,
Iterator  iterEnd,
string_view  current,
bool  looping 
) const
protected

Calculates which Activity node is going to be activated if the current active Activity node deactivates.

This method uses reverse iterator type as Iterator to get the previous Activity node.

Parameters
iterBeginIterator type pointing to the beginning of the list of the child Activity nodes.
iterEndIterator type pointing to the end of the list of the child Activity nodes.
currentNode to which the next activity is searched.
loopingWhen the function reaches the end of the list:
  • If looping is set to true, this method returns the iterBegin as the next element.
  • If looping is set to false, this method returns an empty string.
Returns
The name of the Activity node to activate when the current active Activity node deactivates. If Kanzi cannot activate any of the child Activity nodes, returns nullptr.

◆ getActiveOrActivatingName()

template<typename TBaseClass , typename TDerivedClass >
string kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass >::getActiveOrActivatingName ( ) const
protected

Gets the currently active or activating Activity node.

Returns
The name of the Activity node that is currently active or activating, empty string if no active or activating Activity node is found.

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