Implements the modal scopes. More...
#include <kanzi/core.ui/input/focus_scope.hpp>
Public Member Functions | |
void | addToStack () |
Adds the focus scope to the modal scope stack. More... | |
bool | bringScopeToFront () |
Brings a modal focus scope to the front of focus scopes. More... | |
FocusChainNode | getEffectiveFocus () const |
Returns the effective focus node of a modal scope. More... | |
Node2DSharedPtr | getHitTestRoot () |
Returns the node from where the hit test iteration is started. More... | |
Node2DSharedPtr | getKeyInputRoot () |
Returns the node to which the key input is propagated. More... | |
FocusScope * | getParent () const override |
Overrides FocusScope::getParent() by returning the parent focus scope that is a popup or modal focus scope. More... | |
FocusManager::FocusScopeType | getType () const override |
Returns the type of the focus scope. More... | |
bool | isForemostScope () const |
Checks whether the focus scope is the foremost scope of the modal scope stack. More... | |
bool | isNodeInScope (const Node &node) const override |
Checks whether a node is in this modal scope. More... | |
ModalScope (Node &root, FocusManager::ScopeStack &scopeStack) | |
Constructor. More... | |
void | removeFromStack (FocusManager::FocusReason reason) |
Removes the focus scope from the modal scope stack. More... | |
bool | sendScopeToBack (FocusManager::FocusReason reason) |
Sends a focus scope to the end of the focus scope stack with a given reason value. More... | |
void | setFocused (bool focused) override |
Overrides FocusFence::setFocused();. More... | |
FocusChainNode | tryMoveFocusAcrossNestedScopes (FocusManager::FocusChainDirection direction) |
Tries to set the focus to a node relative to the focused node of the popup-type focus scope passed as an argument, using the focus chain navigation. More... | |
FocusChainNode | trySetFocus (Node &node, FocusManager::FocusReason reason) |
Tries to set the focus to a node of the focus scope. More... | |
~ModalScope () override | |
Destructor. More... | |
Public Member Functions inherited from kanzi::FocusFence | |
FocusFence (Node &root) | |
Constructor. More... | |
Public Member Functions inherited from kanzi::FocusScope | |
bool | canFocusEnter () const |
Returns whether the focus can enter the focus scope. More... | |
bool | canFocusLeave () const |
Returns whether the focus can leave the focus scope. More... | |
bool | canGetLastFocused () const |
Returns whether the focus scope node can be the last-focused node of its owning focus scope. More... | |
FocusChainNode | getFocus () const |
Returns the focus node of a focus scope. More... | |
FocusChainSharedPtr | getFocusChainSnapshot () |
Returns a snapshot of the focus chain of a focus scope. More... | |
FocusNavigationManipulatorSharedPtr | getFocusNavigationManipulator () const |
Returns the focus navigation manipulator of a focus scope. More... | |
ModalScope * | getModalScope () const |
Returns the modal scope that owns the focus scope. More... | |
Node & | getRoot () const |
Returns the focus scope node. More... | |
bool | isAttached () const |
Returns whether a focus scope node is attached. More... | |
bool | isFocusChainEmpty () const |
Returns whether the focus chain of a focus scope is empty. More... | |
bool | isFocused () const |
Returns the focused state of the focus scope. More... | |
void | setFocusNavigationManipulator (FocusNavigationManipulatorSharedPtr newManipulator) |
Sets the focus navigation manipulator of the focus scope. More... | |
FocusChainNode | tryMoveFocusInScope (FocusManager::FocusChainDirection direction) |
Tries to set the focus to a node relative to the current focus node of the focus scope using the focus chain navigation. More... | |
FocusChainNode | tryRestoreScopeFocusedNode (FocusChainNode currentFocus, FocusManager::FocusReason reason, FocusManager::FocusChainDirection direction) |
Tries to restore the focus to the last-focused node of a focus scope. More... | |
Node::VisitorResult | visitFocusChain (FocusScopeVisitor &visitor) |
Visits the focus chain of the focus scope, and calls the visitor on each node. More... | |
Node::VisitorResult | visitFocusScope (FocusScopeVisitor &visitor) |
Visits the focusable nodes of the focus scope, including nested focus scope nodes. More... | |
virtual | ~FocusScope () |
Destructor. More... | |
FocusChainIndex | getLastFocused () const |
Returns the focus chain index of the last-focused node of a focus scope. More... | |
void | setLastFocused (const FocusChainIndex &lastFocus) |
Sets the focus chain index of the last-focused node of the focus scope. More... | |
void | clearLastFocused () |
Clears the focus chain index of the last-focused node of a focus scope. More... | |
FocusChainNode | getLastFocusedNode () const |
Returns the last-focused node of a focus scope. More... | |
FocusChainNode | setLastFocusedNode (const Node &lastFocused) |
Sets the last-focused node of a focus scope. More... | |
void | clearLastFocusedNode () |
Set the Node::FocusedProperty value to false, and clears the last-focused node of a focus scope. More... | |
Protected Member Functions | |
void | joinScope (FocusScope &target) override |
Overrides FocusScope::joinScope();. More... | |
void | notifyNodeAttached (Node &node) override |
Overrides FocusScope::notifyNodeAttached() for popups. More... | |
void | notifyNodeDetached (Node &node) override |
Overrides FocusScope::notifyNodeDetached() for popups. More... | |
void | notifyNodeVisibilityChanged (Node &node) override |
Overrides FocusScopeCore::notifyNodeVisibilityChanged(). More... | |
void | notifyScopeInFront (ModalScope *previous, FocusManager::FocusReason reason) |
Notifies that this scope is brought to the front of the scope stack. More... | |
void | notifyScopeSentToBack (ModalScope &next, FocusManager::FocusReason reason) |
Notifies that this scope is sent to the back of the scope stack. More... | |
void | notifyScopeTypeChange (FocusScope &oldScopeData) override |
Overrides FocusScope::notifyScopeTypeChange();. More... | |
EventQueue::ProcessingResult | processTouchPoint (const TouchPoint &point) override |
Overrides FocusScopeCore::processTouchPoint(). More... | |
void | splitScope (FocusScope *source, FocusChainNode targetLastFocusNode) override |
Overrides FocusScope::splitScope();. More... | |
Protected Member Functions inherited from kanzi::FocusFence | |
FocusFence (Node &root, ScopeFlag flags) | |
Constructor. More... | |
Protected Member Functions inherited from kanzi::FocusScope | |
void | focusNavigationHandler (FocusManager::MoveFocusMessageArguments &args) |
Navigates the focus in a scope. More... | |
FocusScope (Node &scopeNode, ScopeFlag flags) | |
Constructor. More... | |
void | invalidateFocusChain () override |
Overrides FocusScopeCore::invalidateFocusChain(). More... | |
void | joinScope (FocusScope &target) override |
Overrides FocusScopeCore::joinScope(). More... | |
void | notifyNodeAttached (Node &node) override |
Overrides FocusScopeCore::notifyNodeAttached(). More... | |
void | notifyNodeDetached (Node &node) override |
Overrides FocusScopeCore::notifyNodeDetached(). More... | |
void | notifyScopeTypeChange (FocusScope &oldScopeData) override |
Overrides FocusScopeCore::notifyScopeTypeChange(). More... | |
void | splitScope (FocusScope *target, FocusChainNode targetLastFocusedNode) override |
Overrides FocusScopeCore::splitScope(). More... | |
void | swapScopeData (FocusScope &other) |
Swaps the focus scope data of this scope with the focus scope data of the source scope. More... | |
Protected Attributes | |
Node::MessageSubscriptionToken | m_bringScopeToFrontMessageToken |
Message subscription token for FocusManager::BringScopeToFrontMessage. More... | |
Node2DWeakPtr | m_rootForKey |
The root node until which the key messages are bubbled. More... | |
Node2DWeakPtr | m_rootForTouch |
The root node where the touch hit testing is started for the modal scope. More... | |
FocusManager::ScopeStack & | m_scopeStack |
The focus scope stack. More... | |
Node::MessageSubscriptionToken | m_sendScopeToBackMessageToken |
Message subscription token for FocusManager::SendScopeToBaskMessage. More... | |
Protected Attributes inherited from kanzi::FocusScope | |
const ScopeFlag | m_scopeFlags |
The scope flags. More... | |
Additional Inherited Members | |
Public Types inherited from kanzi::FocusScope | |
using | FocusChainSharedPtr = shared_ptr< FocusChain > |
The focus chain pointer type. More... | |
Static Public Member Functions inherited from kanzi::FocusScope | |
static FocusScopePtr | create (FocusManager::FocusScopeType type, Node &rootNode, FocusManager::ScopeStack &scopeStack) |
Creates an instance of a focus scope type, with the rootNode as the focus scope node. More... | |
Protected Types inherited from kanzi::FocusScope | |
enum | ScopeFlag { ScopeFlag::EnterFocusWithNavigationAllowed, ScopeFlag::LeaveFocusWithNavigationAllowed, ScopeFlag::CanGetLastFocusedNode, ScopeFlag::DisableAll, ScopeFlag::EnableAll } |
Defines the scope flags. More... | |
Implements the modal scopes.
|
explicit |
Constructor.
|
override |
Destructor.
Node2DSharedPtr kanzi::ModalScope::getHitTestRoot | ( | ) |
Returns the node from where the hit test iteration is started.
Node2DSharedPtr kanzi::ModalScope::getKeyInputRoot | ( | ) |
Returns the node to which the key input is propagated.
|
overridevirtual |
Returns the type of the focus scope.
Reimplemented from kanzi::FocusFence.
Reimplemented in kanzi::PopupScope.
|
overridevirtual |
Overrides FocusScope::getParent() by returning the parent focus scope that is a popup or modal focus scope.
Reimplemented from kanzi::FocusScope.
|
override |
Overrides FocusFence::setFocused();.
bool kanzi::ModalScope::isForemostScope | ( | ) | const |
Checks whether the focus scope is the foremost scope of the modal scope stack.
bool kanzi::ModalScope::bringScopeToFront | ( | ) |
Brings a modal focus scope to the front of focus scopes.
Kanzi automatically deactivates the previous foremost focus scope.
bool kanzi::ModalScope::sendScopeToBack | ( | FocusManager::FocusReason | reason | ) |
Sends a focus scope to the end of the focus scope stack with a given reason value.
If the focus scope is the foremost focus scope, the second foremost focus scope becomes the foremost focus scope.
reason | The reason the scope is sent to back. |
void kanzi::ModalScope::addToStack | ( | ) |
Adds the focus scope to the modal scope stack.
void kanzi::ModalScope::removeFromStack | ( | FocusManager::FocusReason | reason | ) |
Removes the focus scope from the modal scope stack.
If the focus scope is the foremost focus scope, sends the scope to the back of the focus scope stack.
FocusChainNode kanzi::ModalScope::getEffectiveFocus | ( | ) | const |
Returns the effective focus node of a modal scope.
The effective focus node is the focus node of a scope that is visible.
FocusChainNode kanzi::ModalScope::trySetFocus | ( | Node & | node, |
FocusManager::FocusReason | reason | ||
) |
Tries to set the focus to a node of the focus scope.
node | The node to which you want to set the focus. |
reason | The reason you move the focus. If the reason is not known, use FocusManager::OtherFocusReason. |
FocusChainNode kanzi::ModalScope::tryMoveFocusAcrossNestedScopes | ( | FocusManager::FocusChainDirection | direction | ) |
Tries to set the focus to a node relative to the focused node of the popup-type focus scope passed as an argument, using the focus chain navigation.
The method takes the next focus candidate from the focus chain of the popup-type focus scope and its nested focus scopes in the given direction.
If the focus scope has no last-focused node set, the method sets the focus to:
The method fails if the popup-type focus scope has no focusable descendant node.
direction | The direction in which to query for the next focusable node. |
|
overridevirtual |
Checks whether a node is in this modal scope.
node | The node to check. |
Reimplemented from kanzi::FocusScope.
|
overrideprotected |
Overrides FocusScope::splitScope();.
|
overrideprotected |
Overrides FocusScope::joinScope();.
|
overrideprotected |
Overrides FocusScope::notifyScopeTypeChange();.
|
overrideprotected |
Overrides FocusScope::notifyNodeAttached() for popups.
|
overrideprotected |
Overrides FocusScope::notifyNodeDetached() for popups.
|
overrideprotected |
Overrides FocusScopeCore::notifyNodeVisibilityChanged().
|
overrideprotected |
Overrides FocusScopeCore::processTouchPoint().
|
protected |
Notifies that this scope is brought to the front of the scope stack.
previous | The previous foremost focus scope. If there is no previous foremost focus scope in Kanzi, pass nullptr. |
reason | The reason value the scope is brought to the front of the stack of scopes. |
|
protected |
Notifies that this scope is sent to the back of the scope stack.
next | The next focus scope to become the foremost focus scope. |
reason | The reason value the scope is sent back to the stack of scopes. |
|
protected |
The root node where the touch hit testing is started for the modal scope.
|
protected |
The root node until which the key messages are bubbled.
|
protected |
The focus scope stack.
|
protected |
Message subscription token for FocusManager::BringScopeToFrontMessage.
|
protected |
Message subscription token for FocusManager::SendScopeToBaskMessage.