35 isRadioButton (buttonToWrap) ? AccessibilityRole::radioButton : roleIn,
36 getAccessibilityActions (buttonToWrap),
37 getAccessibilityInterfaces (buttonToWrap)),
48 state = state.withCheckable();
51 state = state.withChecked();
78 explicit ButtonValueInterface (
Button& buttonToWrap)
79 : button (buttonToWrap)
83 bool isReadOnly()
const override {
return true; }
84 String getCurrentValueAsString()
const override {
return button.getToggleState() ?
"On" :
"Off"; }
85 void setValueAsString (
const String&)
override {}
94 static bool isRadioButton (
const Button& button)
noexcept
99 static AccessibilityActions getAccessibilityActions (Button& button)
102 [&button] { button.triggerClick(); });
104 if (button.isToggleable())
106 [&button] { button.setToggleState (! button.getToggleState(),
sendNotification); });
111 static Interfaces getAccessibilityInterfaces (Button& button)
113 if (button.isToggleable())
Base class for accessible Components.
virtual AccessibleState getCurrentState() const
Returns the current state of the UI element.
virtual String getTitle() const
The title of the UI element.
A value interface that represents a text value.
Represents the state of an accessible UI element.
@ sendNotification
Requests a notification message, either synchronous or not.
@ toggle
Represents a "toggle" action.
@ press
Represents a "press" action.
AccessibilityRole
The list of available roles for an AccessibilityHandler object.