|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
What an entity means to a user who does not see it: its name, its role, its state and its place in the keyboard traversal. More...
#include <headers/guillaume/components/accessibility.hpp>


Public Member Functions | |
| Accessibility (void)=default | |
| Construct a description with no label, no role, no state, a focus order of 0 and the focusable flag set. | |
| ~Accessibility (void)=default | |
| Default destructor. | |
| const std::string & | getLabel (void) const |
| Get the name announced for the entity. | |
| Accessibility & | setLabel (const std::string &label) |
| Set the name announced for the entity, such as "Close". | |
| const std::string & | getHint (void) const |
| Get the sentence describing what activating the entity does. | |
| Accessibility & | setHint (const std::string &hint) |
| Set the sentence describing what activating the entity does, such as "Closes the dialog". | |
| AccessibilityRole | getRole (void) const |
| Get what kind of control the entity is. | |
| 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, a selected chip). | |
| Accessibility & | setSelected (bool selected) |
| Set whether the entity is the selected one of its group. | |
| std::optional< CheckedState > | getChecked (void) const |
| Get whether the entity is ticked. | |
| Accessibility & | setChecked (std::optional< CheckedState > checked) |
| Set 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). | |
| Accessibility & | setExpanded (std::optional< bool > expanded) |
| Set whether the entity shows the content it controls. | |
| const std::optional< AccessibilityValue > & | getValue (void) const |
| Get the position of the entity within its range. | |
| Accessibility & | setValue (std::optional< AccessibilityValue > value) |
| Set the position of the entity within its range. | |
| LiveRegion | getLiveRegion (void) const |
| Get how urgently a change of the entity is announced. | |
| Accessibility & | setLiveRegion (LiveRegion liveRegion) |
| Set how urgently a change of the entity is announced. | |
| int | getFocusOrder (void) const |
| Get the rank of the entity in the Tab traversal. | |
| Accessibility & | setFocusOrder (int focusOrder) |
| Set the rank of the entity in the Tab traversal. | |
| bool | isFocusable (void) const |
| Check whether the Tab traversal stops on the entity. | |
| Accessibility & | setFocusable (bool focusable) |
| Include the entity in the Tab traversal or leave it out. | |
| Public Member Functions inherited from guillaume::ecs::Component | |
| bool | hasChanged (void) const |
| Tell whether a value of the component changed since the flags were last reset (the end of the previous frame). | |
| void | setHasChanged (bool hasChanged) |
| Raise or lower the changed flag. | |
| Component (void)=default | |
| Create a component that is not marked as changed. | |
| virtual | ~Component (void)=default |
| Virtual destructor, so components can be destroyed through the base class. | |
What an entity means to a user who does not see it: its name, its role, its state and its place in the keyboard traversal.
Widget systems write it when they install a widget (role) and each time the widget changes (label, checked, selected, expanded); user code may set a label, a hint or a focus order. systems::Focus reads the focus order and the focusable flag to build the Tab traversal. The other fields describe the entity to an assistive technology.
The disabled state is not stored here: read it from StyleState.
Definition at line 109 of file accessibility.hpp.
| std::optional< CheckedState > guillaume::components::Accessibility::getChecked | ( | void | ) | const |
Get whether the entity is ticked.
Definition at line 85 of file accessibility.cpp.
| std::optional< bool > guillaume::components::Accessibility::getExpanded | ( | void | ) | const |
Get whether the entity shows the content it controls (an open menu, an unfolded section).
Definition at line 100 of file accessibility.cpp.
| int guillaume::components::Accessibility::getFocusOrder | ( | void | ) | const |
Get the rank of the entity in the Tab traversal.
systems::Focus visits the entities with a positive order first, by ascending order, then the entities with order 0, in the order the system updates them.
Definition at line 147 of file accessibility.cpp.
| const std::string & guillaume::components::Accessibility::getHint | ( | void | ) | const |
Get the sentence describing what activating the entity does.
Definition at line 43 of file accessibility.cpp.
| const std::string & guillaume::components::Accessibility::getLabel | ( | void | ) | const |
Get the name announced for the entity.
Definition at line 29 of file accessibility.cpp.
| LiveRegion guillaume::components::Accessibility::getLiveRegion | ( | void | ) | const |
Get how urgently a change of the entity is announced.
Definition at line 133 of file accessibility.cpp.
| AccessibilityRole guillaume::components::Accessibility::getRole | ( | void | ) | const |
Get what kind of control the entity is.
Definition at line 57 of file accessibility.cpp.
| const std::optional< AccessibilityValue > & guillaume::components::Accessibility::getValue | ( | void | ) | const |
Get the position of the entity within its range.
Definition at line 114 of file accessibility.cpp.
| bool guillaume::components::Accessibility::isFocusable | ( | void | ) | const |
Check whether the Tab traversal stops on the entity.
Definition at line 164 of file accessibility.cpp.
| bool guillaume::components::Accessibility::isSelected | ( | void | ) | const |
Check whether the entity is the selected one of its group (the active navigation destination, a selected chip).
Definition at line 71 of file accessibility.cpp.
| Accessibility & guillaume::components::Accessibility::setChecked | ( | std::optional< CheckedState > | checked | ) |
Set whether the entity is ticked.
Marks the component changed only when the state differs.
| checked | The checked state, or std::nullopt for an entity that cannot be ticked. |
Definition at line 91 of file accessibility.cpp.


| Accessibility & guillaume::components::Accessibility::setExpanded | ( | std::optional< bool > | expanded | ) |
Set whether the entity shows the content it controls.
Marks the component changed only when the state differs.
| expanded | True when expanded, false when collapsed, or std::nullopt for an entity that does not expand. |
Definition at line 105 of file accessibility.cpp.

| Accessibility & guillaume::components::Accessibility::setFocusable | ( | bool | focusable | ) |
Include the entity in the Tab traversal or leave it out.
An entity left out can still take the focus when it is clicked. Marks the component changed only when the flag differs.
| focusable | False to make Tab skip the entity. |
Definition at line 169 of file accessibility.cpp.


| Accessibility & guillaume::components::Accessibility::setFocusOrder | ( | int | focusOrder | ) |
Set the rank of the entity in the Tab traversal.
Marks the component changed only when the order differs.
| focusOrder | The rank: 1 is reached first; 0 removes the explicit rank. |
| std::invalid_argument | If focusOrder is negative. |
Definition at line 152 of file accessibility.cpp.

| Accessibility & guillaume::components::Accessibility::setHint | ( | const std::string & | hint | ) |
Set the sentence describing what activating the entity does, such as "Closes the dialog".
Marks the component changed only when the hint differs.
| hint | The sentence to announce after the label; empty for none. |
Definition at line 48 of file accessibility.cpp.


| Accessibility & guillaume::components::Accessibility::setLabel | ( | const std::string & | label | ) |
Set the name announced for the entity, such as "Close".
Marks the component changed only when the label differs.
| label | The name to announce; empty for none. |
Definition at line 34 of file accessibility.cpp.


| Accessibility & guillaume::components::Accessibility::setLiveRegion | ( | LiveRegion | liveRegion | ) |
Set how urgently a change of the entity is announced.
Marks the component changed only when the value differs.
| liveRegion | The politeness of the announcements. |
Definition at line 138 of file accessibility.cpp.


| Accessibility & guillaume::components::Accessibility::setRole | ( | AccessibilityRole | role | ) |
Set what kind of control the entity is.
Marks the component changed only when the role differs.
| role | The role to announce. |
Definition at line 62 of file accessibility.cpp.

| Accessibility & guillaume::components::Accessibility::setSelected | ( | bool | selected | ) |
Set whether the entity is the selected one of its group.
Marks the component changed only when the state differs.
| selected | True when the entity is selected. |
Definition at line 76 of file accessibility.cpp.


| Accessibility & guillaume::components::Accessibility::setValue | ( | std::optional< AccessibilityValue > | value | ) |
Set the position of the entity within its range.
Always marks the component changed.
| value | The range value, or std::nullopt to remove it. |
| std::invalid_argument | If min > max or now is outside [min, max]. The stored value is then left as it was. |
Definition at line 120 of file accessibility.cpp.
