You.i Engine
YiAccessibilityAttributes.h
Go to the documentation of this file.
1 #ifndef _YI_ACCESSIBILITY_ATTRIBUTES_H_
2 #define _YI_ACCESSIBILITY_ATTRIBUTES_H_
3 
4 #include "signal/YiSignal.h"
5 #include "utility/YiString.h"
6 
24 {
25 public:
29  enum class Accessible : uint8_t
30  {
31  Undefined,
32  Disabled,
33  Enabled
34  };
35 
39  enum class Role
40  {
41  None,
42 
43  Adjustable,
44  Alert,
45  Button,
46  CheckBox,
47  ComboBox,
48  Header,
49  Image,
50  ImageButton,
51  KeyboardKey,
52  Link,
53  Menu,
54  MenuBar,
55  MenuItem,
56  ProgressBar,
57  Radio,
58  RadioGroup,
59  ScrollBar,
60  Search,
61  SpinButton,
62  Summary,
63  Switch,
64  Tab,
65  TabList,
66  Text,
67  TextField,
68  Timer,
69  ToolBar,
70  };
71 
75  enum class State
76  {
77  None,
78 
79  Busy,
80  Disabled,
81  Checked,
82  Expanded,
83  Selected
84  };
85 
89  struct Action
90  {
93 
94  Action(){};
95 
96  Action(CYIString name, CYIString label)
97  : name(std::move(name))
98  , label(std::move(label))
99  {
100  }
101  };
102 
104 
110  const CYIString &GetLabel() const;
111 
118  void SetLabel(CYIString label);
119 
123  const CYIString &GetHint() const;
124 
130  void SetHint(CYIString hint);
131 
135  Role GetRole() const;
136 
140  CYIString GetRoleString() const;
141 
147  void SetRole(Role role);
148 
152  void ReplaceStates(std::map<State, bool> states);
153 
157  void SetState(State state, bool value);
158 
162  bool GetState(State state) const;
163 
168 
172  const std::vector<Action> &GetActions() const;
173 
179  void SetActions(std::vector<Action> actions);
180 
185 
190 
195 
200 
201 private:
202  Role m_role;
203  std::map<State, bool> m_states;
204  std::vector<Action> m_actions;
205 
206  CYIString m_label;
207  CYIString m_hint;
208 };
209 
210 #endif
CYIString name
Definition: YiAccessibilityAttributes.h:91
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:36
void SetHint(CYIString hint)
STL namespace.
Action()
Definition: YiAccessibilityAttributes.h:94
void ReplaceStates(std::map< State, bool > states)
void SetLabel(CYIString label)
constexpr std::enable_if< YiEnableBitmaskOperators< E >::enable, bool >::type None(E a)
Definition: YiEnumBitmaskOperators.h:136
CYISignal AccessibilityMagicTapRequested
Definition: YiAccessibilityAttributes.h:194
bool GetState(State state) const
CYIString ProduceStatesString() const
CYIString GetRoleString() const
State
The accessibility State type of the CYIAccessibilityAttributes class instance.
Definition: YiAccessibilityAttributes.h:75
void SetActions(std::vector< Action > actions)
Role
The accessibility Role type of the CYIAccessibilityAttributes class instance.
Definition: YiAccessibilityAttributes.h:39
CYISignal AccessibilityTapRequested
Definition: YiAccessibilityAttributes.h:199
const std::vector< Action > & GetActions() const
An accessibility attributes defines the accessibility related properties of the containing scene node...
Definition: YiAccessibilityAttributes.h:23
Accessible
The accessible type of the CYIAccessibilityAttributes class instance.
Definition: YiAccessibilityAttributes.h:29
const CYIString & GetLabel() const
CYISignal< CYIString > AccessibilityActionRequested
Definition: YiAccessibilityAttributes.h:184
const CYIString & GetHint() const
CYISignal AccessibilityEscapeRequested
Definition: YiAccessibilityAttributes.h:189
CYIString label
Definition: YiAccessibilityAttributes.h:92
The accessibility Action structure of the CYIAccessibilityAttributes class instance.
Definition: YiAccessibilityAttributes.h:89
Action(CYIString name, CYIString label)
Definition: YiAccessibilityAttributes.h:96
void SetState(State state, bool value)