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_H_ | 5 #ifndef UI_ACCESSIBILITY_AX_NODE_H_ |
6 #define UI_ACCESSIBILITY_AX_NODE_H_ | 6 #define UI_ACCESSIBILITY_AX_NODE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "ui/accessibility/ax_node_data.h" | 12 #include "ui/accessibility/ax_node_data.h" |
| 13 #include "ui/accessibility/ax_position.h" |
13 | 14 |
14 namespace gfx { | 15 namespace gfx { |
15 class Rect; | 16 class Rect; |
16 } | 17 } |
17 | 18 |
18 namespace ui { | 19 namespace ui { |
19 | 20 |
20 // One node in an AXTree. | 21 // One node in an AXTree. |
21 class AX_EXPORT AXNode { | 22 class AX_EXPORT AXNode { |
22 public: | 23 public: |
| 24 using AXPosition = AXNodePosition; |
| 25 |
23 // The constructor requires a parent, id, and index in parent, but | 26 // The constructor requires a parent, id, and index in parent, but |
24 // the data is not required. After initialization, only index_in_parent | 27 // the data is not required. After initialization, only index_in_parent |
25 // is allowed to change, the others are guaranteed to never change. | 28 // is allowed to change, the others are guaranteed to never change. |
26 AXNode(AXNode* parent, int32_t id, int32_t index_in_parent); | 29 AXNode(AXNode* parent, int32_t id, int32_t index_in_parent); |
27 virtual ~AXNode(); | 30 virtual ~AXNode(); |
28 | 31 |
29 // Accessors. | 32 // Accessors. |
30 int32_t id() const { return data_.id; } | 33 int32_t id() const { return data_.id; } |
31 AXNode* parent() const { return parent_; } | 34 AXNode* parent() const { return parent_; } |
32 int child_count() const { return static_cast<int>(children_.size()); } | 35 int child_count() const { return static_cast<int>(children_.size()); } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 private: | 75 private: |
73 int index_in_parent_; | 76 int index_in_parent_; |
74 AXNode* parent_; | 77 AXNode* parent_; |
75 std::vector<AXNode*> children_; | 78 std::vector<AXNode*> children_; |
76 AXNodeData data_; | 79 AXNodeData data_; |
77 }; | 80 }; |
78 | 81 |
79 } // namespace ui | 82 } // namespace ui |
80 | 83 |
81 #endif // UI_ACCESSIBILITY_AX_NODE_H_ | 84 #endif // UI_ACCESSIBILITY_AX_NODE_H_ |
OLD | NEW |