| 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 <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 void AddStringAttribute(AXStringAttribute attribute, | 75 void AddStringAttribute(AXStringAttribute attribute, |
| 76 const std::string& value); | 76 const std::string& value); |
| 77 void AddIntAttribute(AXIntAttribute attribute, int value); | 77 void AddIntAttribute(AXIntAttribute attribute, int value); |
| 78 void AddFloatAttribute(AXFloatAttribute attribute, float value); | 78 void AddFloatAttribute(AXFloatAttribute attribute, float value); |
| 79 void AddBoolAttribute(AXBoolAttribute attribute, bool value); | 79 void AddBoolAttribute(AXBoolAttribute attribute, bool value); |
| 80 void AddIntListAttribute(AXIntListAttribute attribute, | 80 void AddIntListAttribute(AXIntListAttribute attribute, |
| 81 const std::vector<int32>& value); | 81 const std::vector<int32>& value); |
| 82 | 82 |
| 83 // Convenience functions, mainly for writing unit tests. | 83 // Convenience functions, mainly for writing unit tests. |
| 84 // Equivalent to AddStringAttribute(ATTR_NAME, name). | 84 // Equivalent to AddStringAttribute(ATTR_NAME, name). |
| 85 void SetName(std::string name); | 85 void SetName(const std::string& name); |
| 86 // Equivalent to AddStringAttribute(ATTR_VALUE, value). | 86 // Equivalent to AddStringAttribute(ATTR_VALUE, value). |
| 87 void SetValue(std::string value); | 87 void SetValue(const std::string& value); |
| 88 | 88 |
| 89 // Return a string representation of this data, for debugging. | 89 // Return a string representation of this data, for debugging. |
| 90 virtual std::string ToString() const; | 90 virtual std::string ToString() const; |
| 91 | 91 |
| 92 bool IsRoot() const; | 92 bool IsRoot() const; |
| 93 void SetRoot(); | 93 void SetRoot(); |
| 94 | 94 |
| 95 // This is a simple serializable struct. All member variables should be | 95 // This is a simple serializable struct. All member variables should be |
| 96 // public and copyable. | 96 // public and copyable. |
| 97 int32 id; | 97 int32 id; |
| 98 AXRole role; | 98 AXRole role; |
| 99 uint32 state; | 99 uint32 state; |
| 100 gfx::Rect location; | 100 gfx::Rect location; |
| 101 std::vector<std::pair<AXStringAttribute, std::string> > string_attributes; | 101 std::vector<std::pair<AXStringAttribute, std::string> > string_attributes; |
| 102 std::vector<std::pair<AXIntAttribute, int32> > int_attributes; | 102 std::vector<std::pair<AXIntAttribute, int32> > int_attributes; |
| 103 std::vector<std::pair<AXFloatAttribute, float> > float_attributes; | 103 std::vector<std::pair<AXFloatAttribute, float> > float_attributes; |
| 104 std::vector<std::pair<AXBoolAttribute, bool> > bool_attributes; | 104 std::vector<std::pair<AXBoolAttribute, bool> > bool_attributes; |
| 105 std::vector<std::pair<AXIntListAttribute, std::vector<int32> > > | 105 std::vector<std::pair<AXIntListAttribute, std::vector<int32> > > |
| 106 intlist_attributes; | 106 intlist_attributes; |
| 107 base::StringPairs html_attributes; | 107 base::StringPairs html_attributes; |
| 108 std::vector<int32> child_ids; | 108 std::vector<int32> child_ids; |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 } // namespace ui | 111 } // namespace ui |
| 112 | 112 |
| 113 #endif // UI_ACCESSIBILITY_AX_NODE_DATA_H_ | 113 #endif // UI_ACCESSIBILITY_AX_NODE_DATA_H_ |
| OLD | NEW |