Base class for Activity classes. More...
#include <kanzi/ui/node/concept/activity/activity_concept.hpp>
Classes | |
class | ActivityInternalMessageArguments |
Class for all the internal Activity messages that do not require any message arguments. More... | |
class | ActivityMessageArguments |
Message arguments that hold the name of the Activity included in the message. More... | |
class | StartActivationInternalMessageArguments |
Message arguments for the StartActivationInternalMessage. More... | |
class | StatusChangedInternalMessageArguments |
Message arguments for internal Activity messages related to Activity status changes. More... | |
class | StatusChangedMessageArguments |
Message arguments for the StatusChangedMessage. More... | |
Public Types | |
enum | Status { Status::Active, Status::Inactive, Status::Activating, Status::Deactivating } |
Defines possible states of an Activity. More... | |
Public Member Functions | |
void | cancelWaitBeforeFocus () |
Makes an Activity no longer wait for any pending activations. More... | |
virtual bool | collectActivatingDescendantActivities ()=0 |
Returns whether any Activities are activating in the descendant Activity Hosts whose parent Activity this Activity is. More... | |
virtual void | enableFocusGain (bool enable)=0 |
Enables an overlay scope Activity to gain focus automatically when activated. More... | |
virtual void | enableFocusRecovery (bool enable)=0 |
Enables Kanzi to automatically recover focus when an overlay scope Activity is deactivated. More... | |
virtual void | enableInput (bool enable)=0 |
Enables input handling for an Activity that is an overlay-type focus scope. More... | |
virtual Node * | getNode ()=0 |
Gets the underlying Node object. More... | |
virtual const Node * | getNode () const =0 |
Gets the underlying Node object. More... | |
virtual ActivityConcept * | getParentActivity ()=0 |
Returns the parent Activity. More... | |
optional< string > | getPathToActivity (ActivityConcept *activity) const |
Returns a path from this Activity to a given Activity, if that Activity is a descendant node of this Activity. More... | |
virtual bool | isAutoClosingBecauseFocusMove () const =0 |
Returns whether an Activity is deactivating because it is an auto-closing overlay scope and focus moves below it. More... | |
bool | isWaitingActivationsBeforeFocus () const |
Returns whether an Activity is waiting for its descendant Activities to activate before Kanzi applies the focus policy to the activated Activity. More... | |
bool | isWaitingForActivation (ActivityConcept *activity) const |
Returns whether an Activity is waiting for the activation of a given Activity. More... | |
virtual void | notifyPendingActivationBeforeFocusFinished (string_view activityName)=0 |
Notifies the Activity that a descendant Activity, for whose activation this Activity waited, finished activating. More... | |
virtual void | restoreLastFocusedNode ()=0 |
Restores the focus to a child node of this Activity, if this Activity: More... | |
virtual void | setLastFocusedNodePath ()=0 |
Sets the last focused node path of this Activity to the currently focused child node, if the Activity: More... | |
virtual void | tryRestoreLastFocusedPathCompletely (const Node *candidateChild)=0 |
Tries to recursively restore the last focused node path in this and each ancestor Activity. More... | |
virtual | ~ActivityConcept ()=default |
Destructor. More... | |
Static Public Member Functions | |
template<typename Type > | |
static bool | isActivity (const Type &object) |
Returns whether an object is an Activity. More... | |
static bool | isActivityMetaclass (const Metaclass *metaclass) |
Checks whether the given Metaclass is an ActivityConcept metaclass or contains it as a mixin metaclass. More... | |
static PropertyTypeEditorInfoSharedPtr | makeEditorInfo () |
Static Public Attributes | |
static NodeWeakPtr | s_activationTargetActivity |
The Activity that is the activation target. More... | |
Properties | |
static PropertyType< Status > | StatusProperty |
Specifies the status of this Activity. More... | |
static PropertyType< float > | DummyStateManagerProperty |
Lack of a queuing mechanism for incoming messages from an Activity Host can cause Kanzi to enter a recursive call in the setProperty(). More... | |
static PropertyType< bool > | ActivatedByActivationModifierProperty |
Specifies whether the activation of an Activity is requested by modifier bindings callbacks of an ApplyAction of a DataTrigger. More... | |
static PropertyType< bool > | SaveLastFocusedNodeProperty |
Indicates whether to serialize the last focused child node of a focus scope Activity and restore the focus on deserialization. More... | |
Messages | |
static MessageType< StatusChangedMessageArguments > | StatusChangedMessage |
Subscribe to this message to receive notifications when the ActivityConcept::Status of this Activity changes. More... | |
static MessageType< ActivityMessageArguments > | ActivityActivatingMessage |
Subscribe to this message to receive notifications when this Activity is in the activating state. More... | |
static MessageType< ActivityMessageArguments > | ActivityActivatedMessage |
Subscribe to this message to receive notifications when this Activity is activated. More... | |
static MessageType< ActivityMessageArguments > | ActivityDeactivatingMessage |
Subscribe to this message to receive notifications when this Activity is in the deactivating state. More... | |
static MessageType< ActivityMessageArguments > | ActivityDeactivatedMessage |
Subscribe to this message to receive notifications when this Activity is deactivated. More... | |
Internal Messages | |
static MessageType< StartActivationInternalMessageArguments > | StartActivationInternalMessage |
Internal message sent by an Activity Host to the Activity to initialize the resources of the Activity. More... | |
static MessageType< ActivityInternalMessageArguments > | StartDeactivationInternalMessage |
Internal message sent by an Activity Host to the Activity to deactivate the Activity. More... | |
static MessageType< StatusChangedInternalMessageArguments > | ReadyForActivationAnimationInternalMessage |
Internal message sent by the Activity to its parent Activity Host when the Activity has finished initializing its resources. More... | |
static MessageType< ActivityInternalMessageArguments > | StartParallelActivatingAnimationInternalMessage |
Internal message sent by an Activity Host to the Activity to start the parallel activation animation of the Activity. More... | |
static MessageType< StatusChangedInternalMessageArguments > | FinishedParallelActivatingAnimationInternalMessage |
Internal message sent by the Activity to its parent Activity Host when the Activity has finished the parallel activation animation of the Activity. More... | |
static MessageType< ActivityInternalMessageArguments > | StartExclusiveActivatingAnimationInternalMessage |
Internal message sent by an Activity Host to the Activity to start the exclusive activation animation of the Activity. More... | |
static MessageType< ActivityInternalMessageArguments > | StartExclusiveDeactivatingAnimationInternalMessage |
Internal message sent by an Activity Host to the Activity to start the exclusive deactivation animation of the Activity. More... | |
static MessageType< StatusChangedInternalMessageArguments > | FinishedExclusiveDeactivatingAnimationInternalMessage |
Internal message sent by the Activity to its parent Activity Host when the Activity has finished the exclusive deactivation animation of the Activity. More... | |
static MessageType< ActivityInternalMessageArguments > | StartParallelDeactivatingAnimationInternalMessage |
Internal message sent by an Activity Host to the Activity to start the parallel deactivation animation of the Activity. More... | |
static MessageType< StatusChangedInternalMessageArguments > | FinishedParallelDeactivatingAnimationInternalMessage |
Internal message sent by the Activity to its parent Activity Host when the Activity has finished the parallel deactivation animation of the Activity. More... | |
Protected Attributes | |
vector< string > | m_pendingActivationsBeforeFocus |
The paths of the activating Activities that this Activity is waiting to be activated. More... | |
Base class for Activity classes.
This class defines common types, properties, and messages for Activity classes.
|
strong |
Defines possible states of an Activity.
Activity Host nodes can activate and deactivate their child Activities. This enumeration defines the possible states of an Activity during the the process of activation and deactivation. You can use this functionality to react to changes in Activity status in your application code and in Kanzi Studio.
|
virtualdefault |
Destructor.
|
static |
|
pure virtual |
Gets the underlying Node object.
Implemented in kanzi::ActivityConceptImpl< TBaseClass, TDerivedClass >, kanzi::ActivityConceptImpl< ContentLayout2D, Activity2D >, and kanzi::ActivityConceptImpl< ContentLayout3D, Activity3D >.
|
pure virtual |
Gets the underlying Node object.
Implemented in kanzi::ActivityConceptImpl< TBaseClass, TDerivedClass >, kanzi::ActivityConceptImpl< ContentLayout2D, Activity2D >, and kanzi::ActivityConceptImpl< ContentLayout3D, Activity3D >.
|
pure virtual |
Restores the focus to a child node of this Activity, if this Activity:
If Kanzi successfully restores the focus, it clears the value of the Kanzi internal property FocusScopeCore::LastFocusedNodePathProperty.
Implemented in kanzi::ActivityConceptImpl< TBaseClass, TDerivedClass >, kanzi::ActivityConceptImpl< ContentLayout2D, Activity2D >, and kanzi::ActivityConceptImpl< ContentLayout3D, Activity3D >.
|
pure virtual |
Sets the last focused node path of this Activity to the currently focused child node, if the Activity:
Implemented in kanzi::ActivityConceptImpl< TBaseClass, TDerivedClass >, kanzi::ActivityConceptImpl< ContentLayout2D, Activity2D >, and kanzi::ActivityConceptImpl< ContentLayout3D, Activity3D >.
|
pure virtual |
Tries to recursively restore the last focused node path in this and each ancestor Activity.
candidateChild | The child Activity where the last focused node path of this Activity is pointing, in order for the restoring to succeed. |
Implemented in kanzi::ActivityConceptImpl< TBaseClass, TDerivedClass >, kanzi::ActivityConceptImpl< ContentLayout2D, Activity2D >, and kanzi::ActivityConceptImpl< ContentLayout3D, Activity3D >.
|
pure virtual |
Returns the parent Activity.
Implemented in kanzi::ActivityConceptImpl< TBaseClass, TDerivedClass >, kanzi::ActivityConceptImpl< ContentLayout2D, Activity2D >, and kanzi::ActivityConceptImpl< ContentLayout3D, Activity3D >.
|
pure virtual |
Returns whether any Activities are activating in the descendant Activity Hosts whose parent Activity this Activity is.
Implemented in kanzi::ActivityConceptImpl< TBaseClass, TDerivedClass >, kanzi::ActivityConceptImpl< ContentLayout2D, Activity2D >, and kanzi::ActivityConceptImpl< ContentLayout3D, Activity3D >.
|
pure virtual |
Notifies the Activity that a descendant Activity, for whose activation this Activity waited, finished activating.
activityName | Name of the Activity that activated. |
Implemented in kanzi::ActivityConceptImpl< TBaseClass, TDerivedClass >, kanzi::ActivityConceptImpl< ContentLayout2D, Activity2D >, and kanzi::ActivityConceptImpl< ContentLayout3D, Activity3D >.
optional<string> kanzi::ActivityConcept::getPathToActivity | ( | ActivityConcept * | activity | ) | const |
Returns a path from this Activity to a given Activity, if that Activity is a descendant node of this Activity.
bool kanzi::ActivityConcept::isWaitingForActivation | ( | ActivityConcept * | activity | ) | const |
Returns whether an Activity is waiting for the activation of a given Activity.
bool kanzi::ActivityConcept::isWaitingActivationsBeforeFocus | ( | ) | const |
Returns whether an Activity is waiting for its descendant Activities to activate before Kanzi applies the focus policy to the activated Activity.
void kanzi::ActivityConcept::cancelWaitBeforeFocus | ( | ) |
Makes an Activity no longer wait for any pending activations.
Call this function when the Activity is no longer the activation target or when the Activity is able to restore the last-focused node and no longer needs to wait for any other Activity to finish activation.
|
pure virtual |
Enables Kanzi to automatically recover focus when an overlay scope Activity is deactivated.
To make an Activity an overlay scope, set its FocusManager::FocusScopeTypeProperty to FocusScopeType::Modal, FocusScopeType::Modeless, FocusScopeType::AutoClosingModal, or FocusScopeType::AutoClosingModeless.
enable | To enable automatic focus recovery by setting focus to another overlay when an overlay Activity is deactivated, set to true. To disable automatic focus recovery when an overlay Activity is deactivated, set to false. |
Implemented in kanzi::ActivityConceptImpl< TBaseClass, TDerivedClass >, kanzi::ActivityConceptImpl< ContentLayout2D, Activity2D >, and kanzi::ActivityConceptImpl< ContentLayout3D, Activity3D >.
|
pure virtual |
Enables an overlay scope Activity to gain focus automatically when activated.
To make an Activity an overlay scope, set its FocusManager::FocusScopeTypeProperty to FocusScopeType::Modal, FocusScopeType::Modeless, FocusScopeType::AutoClosingModal, or FocusScopeType::AutoClosingModeless.
enable | To enable automatic focus gain when an overlay scope Activity is activated, set to true. To disable automatic focus gain when an overlay scope Activity is activated, set to false. |
Implemented in kanzi::ActivityConceptImpl< TBaseClass, TDerivedClass >, kanzi::ActivityConceptImpl< ContentLayout2D, Activity2D >, and kanzi::ActivityConceptImpl< ContentLayout3D, Activity3D >.
|
pure virtual |
Enables input handling for an Activity that is an overlay-type focus scope.
To make an Activity an overlay-type focus scope, set its FocusManager::FocusScopeTypeProperty to FocusScopeType::Modal, FocusScopeType::Modeless, FocusScopeType::AutoClosingModal, or FocusScopeType::AutoClosingModeless.
enable | To enable input handling, set to true. To disable input handling, set to false. |
Implemented in kanzi::ActivityConceptImpl< TBaseClass, TDerivedClass >, kanzi::ActivityConceptImpl< ContentLayout2D, Activity2D >, and kanzi::ActivityConceptImpl< ContentLayout3D, Activity3D >.
|
pure virtual |
Returns whether an Activity is deactivating because it is an auto-closing overlay scope and focus moves below it.
To make an Activity an auto-closing overlay scope, set its FocusManager::FocusScopeTypeProperty to FocusScopeType::AutoClosingModal or FocusScopeType::AutoClosingModeless.
Implemented in kanzi::ActivityConceptImpl< TBaseClass, TDerivedClass >, kanzi::ActivityConceptImpl< ContentLayout2D, Activity2D >, and kanzi::ActivityConceptImpl< ContentLayout3D, Activity3D >.
|
inlinestatic |
Returns whether an object is an Activity.
object | Object for which you want to check whether it is an Activity. |
|
inlinestatic |
Checks whether the given Metaclass is an ActivityConcept metaclass or contains it as a mixin metaclass.
metaclass | The metaclass to check. |
|
static |
Specifies the status of this Activity.
|
static |
Lack of a queuing mechanism for incoming messages from an Activity Host can cause Kanzi to enter a recursive call in the setProperty().
A temporary solution to this is the DummyStateManagerProperty that Kanzi sets in states with different values, and adds an any-to-any transition with the duration of 1 millisecond.
|
static |
Specifies whether the activation of an Activity is requested by modifier bindings callbacks of an ApplyAction of a DataTrigger.
Kanzi uses this property internally to disable serialization and deserialization of the activation status for such Activities.
|
static |
Indicates whether to serialize the last focused child node of a focus scope Activity and restore the focus on deserialization.
If an Activity is a focus scope, add and set this property to True when you want to save and restore the focus from a serialized Activity and its focus scope.
|
static |
Subscribe to this message to receive notifications when the ActivityConcept::Status of this Activity changes.
|
static |
Subscribe to this message to receive notifications when this Activity is in the activating state.
|
static |
Subscribe to this message to receive notifications when this Activity is activated.
|
static |
Subscribe to this message to receive notifications when this Activity is in the deactivating state.
|
static |
Subscribe to this message to receive notifications when this Activity is deactivated.
|
static |
Internal message sent by an Activity Host to the Activity to initialize the resources of the Activity.
|
static |
Internal message sent by an Activity Host to the Activity to deactivate the Activity.
|
static |
Internal message sent by the Activity to its parent Activity Host when the Activity has finished initializing its resources.
|
static |
Internal message sent by an Activity Host to the Activity to start the parallel activation animation of the Activity.
|
static |
Internal message sent by the Activity to its parent Activity Host when the Activity has finished the parallel activation animation of the Activity.
|
static |
Internal message sent by an Activity Host to the Activity to start the exclusive activation animation of the Activity.
|
static |
Internal message sent by an Activity Host to the Activity to start the exclusive deactivation animation of the Activity.
|
static |
Internal message sent by the Activity to its parent Activity Host when the Activity has finished the exclusive deactivation animation of the Activity.
|
static |
Internal message sent by an Activity Host to the Activity to start the parallel deactivation animation of the Activity.
|
static |
Internal message sent by the Activity to its parent Activity Host when the Activity has finished the parallel deactivation animation of the Activity.
|
static |
The Activity that is the activation target.
Kanzi waits for descendant Activities to activate until the last-focused node of the activating Activity tree finishes loading. After that Kanzi applies the focusing policy of the activation target. The activation target is the Activity that the application logic specifically requests to be activated. Any other Activities that Kanzi activates as a side effect are not activation target Activities and Kanzi does not consider their focusing policy this time.
|
protected |
The paths of the activating Activities that this Activity is waiting to be activated.