Public Member Functions | List of all members
ComponentTraverser Class Referenceabstract

Base class for traversing components. More...

Inheritance diagram for ComponentTraverser:

Public Member Functions

virtual ~ComponentTraverser ()=default
 Destructor. More...
 
virtual ComponentgetDefaultComponent (Component *parentComponent)=0
 Returns the component that should be used as the traversal entry point within the given parent component. More...
 
virtual ComponentgetNextComponent (Component *current)=0
 Returns the component that comes after the specified one when moving "forwards". More...
 
virtual ComponentgetPreviousComponent (Component *current)=0
 Returns the component that comes after the specified one when moving "backwards". More...
 
virtual std::vector< Component * > getAllComponents (Component *parentComponent)=0
 Returns all of the traversable components within the given parent component in traversal order. More...
 

Detailed Description

Base class for traversing components.

If you need custom focus or keyboard focus traversal for a component you can create a subclass of ComponentTraverser and return it from Component::createFocusTraverser() or Component::createKeyboardFocusTraverser().

See also
Component::createFocusTraverser, Component::createKeyboardFocusTraverser

Constructor & Destructor Documentation

◆ ~ComponentTraverser()

virtual ComponentTraverser::~ComponentTraverser ( )
virtualdefault

Destructor.

Member Function Documentation

◆ getDefaultComponent()

virtual Component* ComponentTraverser::getDefaultComponent ( Component parentComponent)
pure virtual

Returns the component that should be used as the traversal entry point within the given parent component.

This must return nullptr if there is no default component.

Implemented in FocusTraverser, and KeyboardFocusTraverser.

◆ getNextComponent()

virtual Component* ComponentTraverser::getNextComponent ( Component current)
pure virtual

Returns the component that comes after the specified one when moving "forwards".

This must return nullptr if there is no next component.

Implemented in FocusTraverser, and KeyboardFocusTraverser.

◆ getPreviousComponent()

virtual Component* ComponentTraverser::getPreviousComponent ( Component current)
pure virtual

Returns the component that comes after the specified one when moving "backwards".

This must return nullptr if there is no previous component.

Implemented in FocusTraverser, and KeyboardFocusTraverser.

◆ getAllComponents()

virtual std::vector<Component*> ComponentTraverser::getAllComponents ( Component parentComponent)
pure virtual

Returns all of the traversable components within the given parent component in traversal order.

Implemented in FocusTraverser, and KeyboardFocusTraverser.


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