Kanzi Framework  3.9.0
Kanzi Engine API
kanzi::FocusScopeVisitor Class Referenceabstract

Focus scope visitor for UI scene traversal of focus scopes. More...

#include <kanzi/core.ui/input/focus_scope.hpp>

Inheritance diagram for kanzi::FocusScopeVisitor:
[legend]

Public Member Functions

virtual Node::VisitorResult operator() (const FocusChainNode &visitedElement)=0
 Overload of the parenthesis operator, returns the visit result of a visitedElement. More...
 
virtual ~FocusScopeVisitor ()=default
 Default destructor. More...
 

Detailed Description

Focus scope visitor for UI scene traversal of focus scopes.

To visit a focus scope using UI scene traversal:

To find the last-focused node in a focus scope using the UI scene traversal method:

auto scope = node->getFocusScopeInfo();
auto focusedElement = FocusChainNode();
auto visitor = [&focusedElement, &scope](auto& visitedElement)
{
if (visitedElement == scope->getLastFocused())
{
focusedElement = visitedElement;
// Stop the visiting, as the last-focused node is found.
}
};
auto wrapper = VisitorFunction(visitor);
scope->visitFocusChain(wrapper);

To visit a focus scope using the iterated traversal method, see FocusScope::FocusChain.

Since
Kanzi 3.9.0

Constructor & Destructor Documentation

◆ ~FocusScopeVisitor()

virtual kanzi::FocusScopeVisitor::~FocusScopeVisitor ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ operator()()

virtual Node::VisitorResult kanzi::FocusScopeVisitor::operator() ( const FocusChainNode visitedElement)
pure virtual

Overload of the parenthesis operator, returns the visit result of a visitedElement.

Parameters
visitedElementThe visited focus chain element.
Returns
The result of the visit.
See also
Node::VisitorResult

Implemented in kanzi::VisitorFunction.


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