28#include "guillaume/ecs/component.hpp"
127 const std::string &
getLabel(
void)
const;
143 const std::string &
getHint(
void)
const;
195 std::optional<CheckedState>
getChecked(
void)
const;
232 const std::optional<AccessibilityValue> &
getValue(
void)
const;
303 std::string _label {};
304 std::string _hint {};
306 bool _selected {
false };
307 std::optional<CheckedState> _checked {};
308 std::optional<bool> _expanded {};
309 std::optional<AccessibilityValue> _value {};
311 int _focusOrder { 0 };
312 bool _focusable {
true };
Accessibility & setLiveRegion(LiveRegion liveRegion)
Set how urgently a change of the entity is announced.
const std::string & getHint(void) const
Get the sentence describing what activating the entity does.
std::optional< CheckedState > getChecked(void) const
Get whether the entity is ticked.
std::optional< bool > getExpanded(void) const
Get whether the entity shows the content it controls (an open menu, an unfolded section).
AccessibilityRole getRole(void) const
Get what kind of control the entity is.
LiveRegion getLiveRegion(void) const
Get how urgently a change of the entity is announced.
Accessibility & setHint(const std::string &hint)
Set the sentence describing what activating the entity does, such as "Closes the dialog".
const std::string & getLabel(void) const
Get the name announced for the entity.
Accessibility & setExpanded(std::optional< bool > expanded)
Set whether the entity shows the content it controls.
Accessibility & setFocusOrder(int focusOrder)
Set the rank of the entity in the Tab traversal.
Accessibility(void)=default
Construct a description with no label, no role, no state, a focus order of 0 and the focusable flag s...
int getFocusOrder(void) const
Get the rank of the entity in the Tab traversal.
Accessibility & setFocusable(bool focusable)
Include the entity in the Tab traversal or leave it out.
Accessibility & setRole(AccessibilityRole role)
Set what kind of control the entity is.
bool isSelected(void) const
Check whether the entity is the selected one of its group (the active navigation destination,...
Accessibility & setSelected(bool selected)
Set whether the entity is the selected one of its group.
const std::optional< AccessibilityValue > & getValue(void) const
Get the position of the entity within its range.
bool isFocusable(void) const
Check whether the Tab traversal stops on the entity.
Accessibility & setLabel(const std::string &label)
Set the name announced for the entity, such as "Close".
Accessibility & setChecked(std::optional< CheckedState > checked)
Set whether the entity is ticked.
Accessibility & setValue(std::optional< AccessibilityValue > value)
Set the position of the entity within its range.
~Accessibility(void)=default
Default destructor.
State of a checkbox: checked state, variant, label, color overrides and the identifiers of its check ...
State of a dialog: a modal panel with an optional icon, a title, a message and a row of text buttons.
A picture drawn in the entity's rectangle: the texture to show, a fallback texture,...
State of a radio group: a column of radio buttons of which at most one is selected.
State of a search field: a leading icon, the query the user types (or a placeholder),...
Configuration of a switch: its variant, its thumb icon, its label and the identifiers of its thumb,...
The texts around the input of a text field, and its error state: placeholder, label,...
A run of text: its content, its font metrics and the position of the editing cursor.
Base class of every component: a piece of state attached to an entity, plus a "changed" flag.
State. Every class here is plain data attached to an entity.
AccessibilityRole
What an entity is for a screen reader or another assistive technology. The values mirror react-native...
@ ProgressBar
Determinate or indeterminate progress.
@ TabList
Group of navigation destinations.
@ Slider
Adjustable value.
@ Tab
Navigation destination.
@ None
No semantic role (decorative or container).
@ Alert
Live announcement (snackbar).
@ Header
Heading (app bar title, list subheader).
CheckedState
Checked state of a control that can be ticked (checkbox, radio button, switch).
@ Mixed
Indeterminate: neither checked nor unchecked.
LiveRegion
How urgently a change of the entity is announced to the user.
@ Assertive
Announced at once, interrupting the current speech.
@ None
Changes are not announced.
@ Polite
Announced once the current speech is over.
Position of a control within a range, such as a slider or a progress bar. Accessibility::setValue req...
float now
Current value, between min and max.
float max
Highest value the control can take.
float min
Lowest value the control can take.