| 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" |
| 10 #include "ui/gfx/geometry/vector2d.h" |
| 11 #include "ui/gfx/native_widget_types.h" |
| 9 | 12 |
| 10 namespace ui { | 13 namespace ui { |
| 11 | 14 |
| 12 struct AXNodeData; | 15 struct AXNodeData; |
| 16 class AXPlatformNode; |
| 13 | 17 |
| 14 class AX_EXPORT AXPlatformNodeDelegate { | 18 class AX_EXPORT AXPlatformNodeDelegate { |
| 15 public: | 19 public: |
| 16 // Get the accessibility data that should be exposed for this node. | 20 // Get the accessibility data that should be exposed for this node. |
| 17 virtual AXNodeData* GetData() = 0; | 21 virtual AXNodeData* GetData() = 0; |
| 18 | 22 |
| 23 // Get the parent of the node unless it's the root, then it returns NULL. |
| 24 virtual gfx::NativeViewAccessible GetParent() = 0; |
| 25 |
| 19 // Get the number of children of this node. | 26 // Get the number of children of this node. |
| 20 virtual int GetChildCount() = 0; | 27 virtual int GetChildCount() = 0; |
| 21 | 28 |
| 22 // Get the child of a node from [0...GetChildCount() - 1] | 29 // Get the child of a node from [0...GetChildCount() - 1] |
| 23 virtual AXPlatformNode* ChildAtIndex(int index) = 0; | 30 virtual gfx::NativeViewAccessible ChildAtIndex(int index) = 0; |
| 24 | |
| 25 // Get the parent of the node unless it's the root, then it returns NULL. | |
| 26 virtual AXPlatformNode* GetParent() = 0; | |
| 27 | |
| 28 // Get the root of this tree of AXPlatformNode objects. The root's parent | |
| 29 // can be retrieved using GetParentOfRoot(). | |
| 30 virtual AXPlatformNode* GetRoot() = 0; | |
| 31 | |
| 32 // Get the node within this tree of AXPlatformNode objects that currently | |
| 33 // has focus. | |
| 34 virtual AXPlatformNode* GetFocus() = 0; | |
| 35 | |
| 36 // Get the index of this node in its parent. | |
| 37 virtual int GetIndexInParent() = 0; | |
| 38 | |
| 39 // Given x, y coordinates local to the root's coordinate space, return | |
| 40 // the deepest descendant node within those coordinates. | |
| 41 virtual AXPlatformNode* HitTest(int x, int y) = 0; | |
| 42 | |
| 43 // Get the parent of the root element. | |
| 44 virtual gfx::NativeViewAccessible GetParentOfRoot() = 0; | |
| 45 | |
| 46 // Get the accelerated widget that this accessibility tree is embedded in. | |
| 47 virtual gfx::AcceleratedWidget GetAcceleratedWidget() = 0; | |
| 48 | 31 |
| 49 // Get the offset to convert local coordinates to screen global coordinates. | 32 // Get the offset to convert local coordinates to screen global coordinates. |
| 50 virtual gfx::Vector2d GetGlobalCoordinateOffset() = 0; | 33 virtual gfx::Vector2d GetGlobalCoordinateOffset() = 0; |
| 51 | 34 |
| 52 // Get a negative number that can be used as an id for this node. | |
| 53 virtual int GetNegativeId() = 0; | |
| 54 | |
| 55 // Find a native object given its negative id. This may not be an object | |
| 56 // in this tree, so the return type is gfx::NativeViewAccessible. | |
| 57 virtual gfx::NativeViewAccessible GetFromNegativeId(int negative_id) = 0; | |
| 58 | |
| 59 // | |
| 60 // Actions. | |
| 61 // | |
| 62 | |
| 63 virtual void DoDefaultAction() = 0; | |
| 64 virtual void Focus() = 0; | |
| 65 | |
| 66 // | 35 // |
| 67 // Events. | 36 // Events. |
| 68 // | 37 // |
| 69 | |
| 70 virtual void NotifyAccessibilityEvent(ui::AXEvent event_type) = 0; | 38 virtual void NotifyAccessibilityEvent(ui::AXEvent event_type) = 0; |
| 71 | 39 |
| 72 }; | 40 }; |
| 73 | 41 |
| 74 } // namespace ui | 42 } // namespace ui |
| 75 | 43 |
| 76 #endif // UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_DELEGATE_H_ | 44 #endif // UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_DELEGATE_H_ |
| OLD | NEW |