| 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 class AXPlatformNode; | 18 class AXPlatformNode; |
| 18 | 19 |
| 19 // An object that wants to be accessible should derive from this class. | 20 // An object that wants to be accessible should derive from this class. |
| 20 // AXPlatformNode subclasses use this interface to query all of the information | 21 // AXPlatformNode subclasses use this interface to query all of the information |
| 21 // about the object in order to implement native accessibility APIs. | 22 // about the object in order to implement native accessibility APIs. |
| 22 // | 23 // |
| 23 // Note that AXPlatformNode has support for accessibility trees where some | 24 // Note that AXPlatformNode has support for accessibility trees where some |
| 24 // of the objects in the tree are not implemented using AXPlatformNode. | 25 // of the objects in the tree are not implemented using AXPlatformNode. |
| 25 // For example, you may have a native window with platform-native widgets | 26 // For example, you may have a native window with platform-native widgets |
| 26 // in it, but in that window you have custom controls that use AXPlatformNode | 27 // in it, but in that window you have custom controls that use AXPlatformNode |
| 27 // to provide accessibility. That's why GetParent, ChildAtIndex, HitTestSync, | 28 // to provide accessibility. That's why GetParent, ChildAtIndex, HitTestSync, |
| 28 // and GetFocus all return a gfx::NativeViewAccessible - so you can return a | 29 // and GetFocus all return a gfx::NativeViewAccessible - so you can return a |
| 29 // native accessible if necessary, and AXPlatformNode::GetNativeViewAccessible | 30 // native accessible if necessary, and AXPlatformNode::GetNativeViewAccessible |
| 30 // otherwise. | 31 // otherwise. |
| 31 class AX_EXPORT AXPlatformNodeDelegate { | 32 class AX_EXPORT AXPlatformNodeDelegate { |
| 32 public: | 33 public: |
| 33 // Get the accessibility data that should be exposed for this node. | 34 // Get the accessibility data that should be exposed for this node. |
| 34 // Virtually all of the information is obtained from this structure | 35 // Virtually all of the information is obtained from this structure |
| 35 // (role, state, name, cursor position, etc.) - the rest of this interface | 36 // (role, state, name, cursor position, etc.) - the rest of this interface |
| 36 // is mostly to implement support for walking the accessibility tree. | 37 // is mostly to implement support for walking the accessibility tree. |
| 37 virtual const AXNodeData& GetData() const = 0; | 38 virtual const AXNodeData& GetData() const = 0; |
| 38 | 39 |
| 40 // Get the accessibility tree data for this node. |
| 41 virtual const ui::AXTreeData& GetTreeData() const = 0; |
| 42 |
| 39 // Get the window the node is contained in. | 43 // Get the window the node is contained in. |
| 40 virtual gfx::NativeWindow GetTopLevelWidget() = 0; | 44 virtual gfx::NativeWindow GetTopLevelWidget() = 0; |
| 41 | 45 |
| 42 // Get the parent of the node, which may be an AXPlatformNode or it may | 46 // Get the parent of the node, which may be an AXPlatformNode or it may |
| 43 // be a native accessible object implemented by another class. | 47 // be a native accessible object implemented by another class. |
| 44 virtual gfx::NativeViewAccessible GetParent() = 0; | 48 virtual gfx::NativeViewAccessible GetParent() = 0; |
| 45 | 49 |
| 46 // Get the number of children of this node. | 50 // Get the number of children of this node. |
| 47 virtual int GetChildCount() = 0; | 51 virtual int GetChildCount() = 0; |
| 48 | 52 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // Accessibility objects can have the "hot tracked" state set when | 96 // Accessibility objects can have the "hot tracked" state set when |
| 93 // the mouse is hovering over them, but this makes tests flaky because | 97 // the mouse is hovering over them, but this makes tests flaky because |
| 94 // the test behaves differently when the mouse happens to be over an | 98 // the test behaves differently when the mouse happens to be over an |
| 95 // element. The default value should be falses if not in testing mode. | 99 // element. The default value should be falses if not in testing mode. |
| 96 virtual bool ShouldIgnoreHoveredStateForTesting() = 0; | 100 virtual bool ShouldIgnoreHoveredStateForTesting() = 0; |
| 97 }; | 101 }; |
| 98 | 102 |
| 99 } // namespace ui | 103 } // namespace ui |
| 100 | 104 |
| 101 #endif // UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_DELEGATE_H_ | 105 #endif // UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_DELEGATE_H_ |
| OLD | NEW |