OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PLATFORM_AX_PLATFORM_NODE_DELEGATE_H_ | 5 #ifndef UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_DELEGATE_H_ |
6 #define UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_DELEGATE_H_ | 6 #define UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_DELEGATE_H_ |
7 | 7 |
8 #include "ui/accessibility/ax_enums.h" | 8 #include "ui/accessibility/ax_enums.h" |
9 #include "ui/accessibility/ax_export.h" | 9 #include "ui/accessibility/ax_export.h" |
10 #include "ui/gfx/geometry/vector2d.h" | 10 #include "ui/gfx/geometry/vector2d.h" |
11 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
12 | 12 |
13 namespace ui { | 13 namespace ui { |
14 | 14 |
15 struct AXActionData; | 15 struct AXActionData; |
16 struct AXNodeData; | 16 struct AXNodeData; |
17 struct AXTreeData; | 17 struct AXTreeData; |
18 class AXPlatformNode; | 18 class AXPlatformNode; |
| 19 class TextInputClient; |
19 | 20 |
20 // An object that wants to be accessible should derive from this class. | 21 // An object that wants to be accessible should derive from this class. |
21 // AXPlatformNode subclasses use this interface to query all of the information | 22 // AXPlatformNode subclasses use this interface to query all of the information |
22 // about the object in order to implement native accessibility APIs. | 23 // about the object in order to implement native accessibility APIs. |
23 // | 24 // |
24 // Note that AXPlatformNode has support for accessibility trees where some | 25 // Note that AXPlatformNode has support for accessibility trees where some |
25 // of the objects in the tree are not implemented using AXPlatformNode. | 26 // of the objects in the tree are not implemented using AXPlatformNode. |
26 // For example, you may have a native window with platform-native widgets | 27 // For example, you may have a native window with platform-native widgets |
27 // in it, but in that window you have custom controls that use AXPlatformNode | 28 // in it, but in that window you have custom controls that use AXPlatformNode |
28 // to provide accessibility. That's why GetParent, ChildAtIndex, HitTestSync, | 29 // to provide accessibility. That's why GetParent, ChildAtIndex, HitTestSync, |
(...skipping 20 matching lines...) Expand all Loading... |
49 | 50 |
50 // Get the number of children of this node. | 51 // Get the number of children of this node. |
51 virtual int GetChildCount() = 0; | 52 virtual int GetChildCount() = 0; |
52 | 53 |
53 // Get the child of a node given a 0-based index. | 54 // Get the child of a node given a 0-based index. |
54 virtual gfx::NativeViewAccessible ChildAtIndex(int index) = 0; | 55 virtual gfx::NativeViewAccessible ChildAtIndex(int index) = 0; |
55 | 56 |
56 // Get the bounds of this node in screen coordinates. | 57 // Get the bounds of this node in screen coordinates. |
57 virtual gfx::Rect GetScreenBoundsRect() const = 0; | 58 virtual gfx::Rect GetScreenBoundsRect() const = 0; |
58 | 59 |
| 60 // Get the TextInputClient, if there is one for this element. When available, |
| 61 // this can provide detailed properties for text in this node. |
| 62 virtual TextInputClient* GetTextInputClient() const = 0; |
| 63 |
59 // Do a *synchronous* hit test of the given location in global screen | 64 // Do a *synchronous* hit test of the given location in global screen |
60 // coordinates, and the node within this node's subtree (inclusive) that's | 65 // coordinates, and the node within this node's subtree (inclusive) that's |
61 // hit, if any. | 66 // hit, if any. |
62 // | 67 // |
63 // If the result is anything other than this object or NULL, it will be | 68 // If the result is anything other than this object or NULL, it will be |
64 // hit tested again recursively - that allows hit testing to work across | 69 // hit tested again recursively - that allows hit testing to work across |
65 // implementation classes. It's okay to take advantage of this and return | 70 // implementation classes. It's okay to take advantage of this and return |
66 // only an immediate child and not the deepest descendant. | 71 // only an immediate child and not the deepest descendant. |
67 // | 72 // |
68 // This function is mainly used by accessibility debugging software. | 73 // This function is mainly used by accessibility debugging software. |
(...skipping 17 matching lines...) Expand all Loading... |
86 // | 91 // |
87 | 92 |
88 // Perform an accessibility action, switching on the ui::AXAction | 93 // Perform an accessibility action, switching on the ui::AXAction |
89 // provided in |data|. | 94 // provided in |data|. |
90 virtual bool AccessibilityPerformAction(const ui::AXActionData& data) = 0; | 95 virtual bool AccessibilityPerformAction(const ui::AXActionData& data) = 0; |
91 }; | 96 }; |
92 | 97 |
93 } // namespace ui | 98 } // namespace ui |
94 | 99 |
95 #endif // UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_DELEGATE_H_ | 100 #endif // UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_DELEGATE_H_ |
OLD | NEW |