A simple wrapper for building a collection of supported accessibility actions and corresponding callbacks for a UI element.
Pass one of these when constructing an AccessibilityHandler to enable users to interact with a UI element via the supported actions.
Public Member Functions | |
| AccessibilityActions ()=default | |
| Constructor. | |
| AccessibilityActions & | addAction (AccessibilityActionType type, std::function< void()> actionCallback) |
| Adds an action. | |
| bool | contains (AccessibilityActionType type) const |
| Returns true if the specified action is supported. | |
| bool | invoke (AccessibilityActionType type) const |
| If an action has been registered for the provided action type, invokes the action and returns true. | |
|
default |
Constructor.
Creates a default AccessibilityActions object with no action callbacks.
Referenced by addAction().
|
inline |
Adds an action.
When the user performs this action with an accessibility client actionCallback will be called.
Returns a reference to itself so that several calls can be chained.
References AccessibilityActions().
|
inline |
Returns true if the specified action is supported.
|
inline |
If an action has been registered for the provided action type, invokes the action and returns true.
Otherwise, returns false.