OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_COMMON_ACCESSIBILITY_NODE_DATA_H_ | 5 #ifndef CONTENT_COMMON_ACCESSIBILITY_NODE_DATA_H_ |
6 #define CONTENT_COMMON_ACCESSIBILITY_NODE_DATA_H_ | 6 #define CONTENT_COMMON_ACCESSIBILITY_NODE_DATA_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
81 | 81 |
82 // Tree control attributes. | 82 // Tree control attributes. |
83 ATTR_HIERARCHICAL_LEVEL, | 83 ATTR_HIERARCHICAL_LEVEL, |
84 | 84 |
85 // Relationships between this element and other elements. | 85 // Relationships between this element and other elements. |
86 ATTR_TITLE_UI_ELEMENT, | 86 ATTR_TITLE_UI_ELEMENT, |
87 | 87 |
88 // Color value for WebKit::WebAXRoleColorWell, each component is 0..255 | 88 // Color value for WebKit::WebAXRoleColorWell, each component is 0..255 |
89 ATTR_COLOR_VALUE_RED, | 89 ATTR_COLOR_VALUE_RED, |
90 ATTR_COLOR_VALUE_GREEN, | 90 ATTR_COLOR_VALUE_GREEN, |
91 ATTR_COLOR_VALUE_BLUE | 91 ATTR_COLOR_VALUE_BLUE, |
92 | |
93 // Inline text attributes. | |
94 ATTR_TEXT_DIRECTION | |
92 }; | 95 }; |
93 | 96 |
94 enum FloatAttribute { | 97 enum FloatAttribute { |
95 // Document attributes. | 98 // Document attributes. |
96 ATTR_DOC_LOADING_PROGRESS, | 99 ATTR_DOC_LOADING_PROGRESS, |
97 | 100 |
98 // Range attributes. | 101 // Range attributes. |
99 ATTR_VALUE_FOR_RANGE, | 102 ATTR_VALUE_FOR_RANGE, |
100 ATTR_MIN_VALUE_FOR_RANGE, | 103 ATTR_MIN_VALUE_FOR_RANGE, |
101 ATTR_MAX_VALUE_FOR_RANGE, | 104 ATTR_MAX_VALUE_FOR_RANGE, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
138 // Character indices where line breaks occur. | 141 // Character indices where line breaks occur. |
139 ATTR_LINE_BREAKS, | 142 ATTR_LINE_BREAKS, |
140 | 143 |
141 // For a table, the cell ids in row-major order, with duplicate entries | 144 // For a table, the cell ids in row-major order, with duplicate entries |
142 // when there's a rowspan or colspan, and with -1 for missing cells. | 145 // when there's a rowspan or colspan, and with -1 for missing cells. |
143 // There are always exactly rows * columns entries. | 146 // There are always exactly rows * columns entries. |
144 ATTR_CELL_IDS, | 147 ATTR_CELL_IDS, |
145 | 148 |
146 // For a table, the unique cell ids in row-major order of their first | 149 // For a table, the unique cell ids in row-major order of their first |
147 // occurrence. | 150 // occurrence. |
148 ATTR_UNIQUE_CELL_IDS | 151 ATTR_UNIQUE_CELL_IDS, |
152 | |
153 // For inline text. | |
154 ATTR_CHARACTER_OFFSETS, | |
155 | |
156 // For inline text. | |
David Tseng
2013/10/17 22:56:29
These attributes are not very obvious; perhaps add
dmazzoni
2013/10/21 17:26:57
Done.
| |
157 ATTR_WORD_STARTS, | |
158 ATTR_WORD_ENDS, | |
149 }; | 159 }; |
150 | 160 |
151 AccessibilityNodeData(); | 161 AccessibilityNodeData(); |
152 virtual ~AccessibilityNodeData(); | 162 virtual ~AccessibilityNodeData(); |
153 | 163 |
154 void AddStringAttribute(StringAttribute attribute, | 164 void AddStringAttribute(StringAttribute attribute, |
155 const std::string& value); | 165 const std::string& value); |
156 void AddIntAttribute(IntAttribute attribute, int value); | 166 void AddIntAttribute(IntAttribute attribute, int value); |
157 void AddFloatAttribute(FloatAttribute attribute, float value); | 167 void AddFloatAttribute(FloatAttribute attribute, float value); |
158 void AddBoolAttribute(BoolAttribute attribute, bool value); | 168 void AddBoolAttribute(BoolAttribute attribute, bool value); |
159 void AddIntListAttribute(IntListAttribute attribute, | 169 void AddIntListAttribute(IntListAttribute attribute, |
160 const std::vector<int32>& value); | 170 const std::vector<int32>& value); |
161 | 171 |
162 // Convenience function, mainly for writing unit tests. | 172 // Convenience functions, mainly for writing unit tests. |
163 // Equivalent to AddStringAttribute(ATTR_NAME, name). | 173 // Equivalent to AddStringAttribute(ATTR_NAME, name). |
164 void SetName(std::string name); | 174 void SetName(std::string name); |
175 // Equivalent to AddStringAttribute(ATTR_VALUE, value). | |
176 void SetValue(std::string value); | |
165 | 177 |
166 #ifndef NDEBUG | 178 #ifndef NDEBUG |
167 virtual std::string DebugString(bool recursive) const; | 179 virtual std::string DebugString(bool recursive) const; |
168 #endif | 180 #endif |
169 | 181 |
170 // This is a simple serializable struct. All member variables should be | 182 // This is a simple serializable struct. All member variables should be |
171 // public and copyable. | 183 // public and copyable. |
172 int32 id; | 184 int32 id; |
173 WebKit::WebAXRole role; | 185 WebKit::WebAXRole role; |
174 uint32 state; | 186 uint32 state; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
206 // build a tree of AccessibilityNodeDataTreeNode objects for easier | 218 // build a tree of AccessibilityNodeDataTreeNode objects for easier |
207 // testing and debugging, where each node contains its children. | 219 // testing and debugging, where each node contains its children. |
208 // The |dst| argument will become the root of the new tree. | 220 // The |dst| argument will become the root of the new tree. |
209 void MakeAccessibilityNodeDataTree( | 221 void MakeAccessibilityNodeDataTree( |
210 const std::vector<AccessibilityNodeData>& src, | 222 const std::vector<AccessibilityNodeData>& src, |
211 AccessibilityNodeDataTreeNode* dst); | 223 AccessibilityNodeDataTreeNode* dst); |
212 | 224 |
213 } // namespace content | 225 } // namespace content |
214 | 226 |
215 #endif // CONTENT_COMMON_ACCESSIBILITY_NODE_DATA_H_ | 227 #endif // CONTENT_COMMON_ACCESSIBILITY_NODE_DATA_H_ |
OLD | NEW |