OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 UI_ACCESSIBILITY_AX_NODE_DATA_H_ | 5 #ifndef UI_ACCESSIBILITY_AX_NODE_DATA_H_ |
6 #define UI_ACCESSIBILITY_AX_NODE_DATA_H_ | 6 #define UI_ACCESSIBILITY_AX_NODE_DATA_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 base::string16* value) const; | 79 base::string16* value) const; |
80 base::string16 GetString16Attribute( | 80 base::string16 GetString16Attribute( |
81 AXStringAttribute attribute) const; | 81 AXStringAttribute attribute) const; |
82 | 82 |
83 bool HasIntListAttribute(AXIntListAttribute attribute) const; | 83 bool HasIntListAttribute(AXIntListAttribute attribute) const; |
84 const std::vector<int32_t>& GetIntListAttribute( | 84 const std::vector<int32_t>& GetIntListAttribute( |
85 AXIntListAttribute attribute) const; | 85 AXIntListAttribute attribute) const; |
86 bool GetIntListAttribute(AXIntListAttribute attribute, | 86 bool GetIntListAttribute(AXIntListAttribute attribute, |
87 std::vector<int32_t>* value) const; | 87 std::vector<int32_t>* value) const; |
88 | 88 |
| 89 bool HasStringListAttribute(AXStringListAttribute attribute) const; |
| 90 const std::vector<std::string>& GetStringListAttribute( |
| 91 AXStringListAttribute attribute) const; |
| 92 bool GetStringListAttribute(AXStringListAttribute attribute, |
| 93 std::vector<std::string>* value) const; |
| 94 |
89 bool GetHtmlAttribute(const char* attr, base::string16* value) const; | 95 bool GetHtmlAttribute(const char* attr, base::string16* value) const; |
90 bool GetHtmlAttribute(const char* attr, std::string* value) const; | 96 bool GetHtmlAttribute(const char* attr, std::string* value) const; |
91 | 97 |
92 // Setting accessibility attributes. | 98 // Setting accessibility attributes. |
93 void AddStringAttribute(AXStringAttribute attribute, | 99 void AddStringAttribute(AXStringAttribute attribute, |
94 const std::string& value); | 100 const std::string& value); |
95 void AddIntAttribute(AXIntAttribute attribute, int value); | 101 void AddIntAttribute(AXIntAttribute attribute, int value); |
96 void AddFloatAttribute(AXFloatAttribute attribute, float value); | 102 void AddFloatAttribute(AXFloatAttribute attribute, float value); |
97 void AddBoolAttribute(AXBoolAttribute attribute, bool value); | 103 void AddBoolAttribute(AXBoolAttribute attribute, bool value); |
98 void AddIntListAttribute(AXIntListAttribute attribute, | 104 void AddIntListAttribute(AXIntListAttribute attribute, |
99 const std::vector<int32_t>& value); | 105 const std::vector<int32_t>& value); |
| 106 void AddStringListAttribute(AXStringListAttribute attribute, |
| 107 const std::vector<std::string>& value); |
100 | 108 |
101 // Convenience functions, mainly for writing unit tests. | 109 // Convenience functions, mainly for writing unit tests. |
102 // Equivalent to AddStringAttribute(ATTR_NAME, name). | 110 // Equivalent to AddStringAttribute(ATTR_NAME, name). |
103 void SetName(const std::string& name); | 111 void SetName(const std::string& name); |
104 void SetName(const base::string16& name); | 112 void SetName(const base::string16& name); |
105 // Equivalent to AddStringAttribute(ATTR_VALUE, value). | 113 // Equivalent to AddStringAttribute(ATTR_VALUE, value). |
106 void SetValue(const std::string& value); | 114 void SetValue(const std::string& value); |
107 void SetValue(const base::string16& value); | 115 void SetValue(const base::string16& value); |
108 | 116 |
109 // Returns true if the given enum bit is 1. | 117 // Returns true if the given enum bit is 1. |
(...skipping 12 matching lines...) Expand all Loading... |
122 int32_t id; | 130 int32_t id; |
123 AXRole role; | 131 AXRole role; |
124 uint32_t state; | 132 uint32_t state; |
125 uint32_t actions; | 133 uint32_t actions; |
126 std::vector<std::pair<AXStringAttribute, std::string>> string_attributes; | 134 std::vector<std::pair<AXStringAttribute, std::string>> string_attributes; |
127 std::vector<std::pair<AXIntAttribute, int32_t>> int_attributes; | 135 std::vector<std::pair<AXIntAttribute, int32_t>> int_attributes; |
128 std::vector<std::pair<AXFloatAttribute, float>> float_attributes; | 136 std::vector<std::pair<AXFloatAttribute, float>> float_attributes; |
129 std::vector<std::pair<AXBoolAttribute, bool>> bool_attributes; | 137 std::vector<std::pair<AXBoolAttribute, bool>> bool_attributes; |
130 std::vector<std::pair<AXIntListAttribute, std::vector<int32_t>>> | 138 std::vector<std::pair<AXIntListAttribute, std::vector<int32_t>>> |
131 intlist_attributes; | 139 intlist_attributes; |
| 140 std::vector<std::pair<AXStringListAttribute, std::vector<std::string>>> |
| 141 stringlist_attributes; |
132 base::StringPairs html_attributes; | 142 base::StringPairs html_attributes; |
133 std::vector<int32_t> child_ids; | 143 std::vector<int32_t> child_ids; |
134 | 144 |
135 // TODO(dmazzoni): replace the following three members with a single | 145 // TODO(dmazzoni): replace the following three members with a single |
136 // instance of AXRelativeBounds. | 146 // instance of AXRelativeBounds. |
137 | 147 |
138 // The id of an ancestor node in the same AXTree that this object's | 148 // The id of an ancestor node in the same AXTree that this object's |
139 // bounding box is relative to, or -1 if there's no offset container. | 149 // bounding box is relative to, or -1 if there's no offset container. |
140 int offset_container_id; | 150 int offset_container_id; |
141 | 151 |
142 // The relative bounding box of this node. | 152 // The relative bounding box of this node. |
143 gfx::RectF location; | 153 gfx::RectF location; |
144 | 154 |
145 // An additional transform to apply to position this object and its subtree. | 155 // An additional transform to apply to position this object and its subtree. |
146 // NOTE: this member is a std::unique_ptr because it's rare and gfx::Transform | 156 // NOTE: this member is a std::unique_ptr because it's rare and gfx::Transform |
147 // takes up a fair amount of space. The assignment operator and copy | 157 // takes up a fair amount of space. The assignment operator and copy |
148 // constructor both make a duplicate of the owned pointer, so it acts more | 158 // constructor both make a duplicate of the owned pointer, so it acts more |
149 // like a member than a pointer. | 159 // like a member than a pointer. |
150 std::unique_ptr<gfx::Transform> transform; | 160 std::unique_ptr<gfx::Transform> transform; |
151 }; | 161 }; |
152 | 162 |
153 } // namespace ui | 163 } // namespace ui |
154 | 164 |
155 #endif // UI_ACCESSIBILITY_AX_NODE_DATA_H_ | 165 #endif // UI_ACCESSIBILITY_AX_NODE_DATA_H_ |
OLD | NEW |