| 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 AXNodeData; | 16 struct AXNodeData; |
| 16 class AXPlatformNode; | 17 class AXPlatformNode; |
| 17 | 18 |
| 18 // An object that wants to be accessible should derive from this class. | 19 // An object that wants to be accessible should derive from this class. |
| 19 // AXPlatformNode subclasses use this interface to query all of the information | 20 // AXPlatformNode subclasses use this interface to query all of the information |
| 20 // about the object in order to implement native accessibility APIs. | 21 // about the object in order to implement native accessibility APIs. |
| 21 // | 22 // |
| 22 // Note that AXPlatformNode has support for accessibility trees where some | 23 // Note that AXPlatformNode has support for accessibility trees where some |
| 23 // of the objects in the tree are not implemented using AXPlatformNode. | 24 // of the objects in the tree are not implemented using AXPlatformNode. |
| 24 // For example, you may have a native window with platform-native widgets | 25 // For example, you may have a native window with platform-native widgets |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // | 74 // |
| 74 | 75 |
| 75 // Return the platform-native GUI object that should be used as a target | 76 // Return the platform-native GUI object that should be used as a target |
| 76 // for accessibility events. | 77 // for accessibility events. |
| 77 virtual gfx::AcceleratedWidget GetTargetForNativeAccessibilityEvent() = 0; | 78 virtual gfx::AcceleratedWidget GetTargetForNativeAccessibilityEvent() = 0; |
| 78 | 79 |
| 79 // | 80 // |
| 80 // Actions. | 81 // Actions. |
| 81 // | 82 // |
| 82 | 83 |
| 84 // Calls one of the methods below to perform an accessibility action, |
| 85 // switching on the ui::AXAction provided in |data|. |
| 86 virtual bool AccessibilityPerformAction(const ui::AXActionData& data) = 0; |
| 87 |
| 83 // Perform the default action, e.g. click a button, follow a link, or | 88 // Perform the default action, e.g. click a button, follow a link, or |
| 84 // toggle a checkbox. | 89 // toggle a checkbox. |
| 85 virtual void DoDefaultAction() = 0; | 90 virtual void DoDefaultAction() = 0; |
| 86 | |
| 87 // Change the value of a control, such as the text content of a text field. | |
| 88 // If |clear_first| is true, this replaces all text with the |new_value|. | |
| 89 // Otherwise this inserts |new_value| at the cursor position, replacing any | |
| 90 // selected text. The cursor is placed at the end of |new_value|. | |
| 91 virtual bool SetStringValue(const base::string16& new_value, | |
| 92 bool clear_first) = 0; | |
| 93 | |
| 94 // Whether SetStringValue() is callable, i.e. if the string value is not read | |
| 95 // only and if the callback exists. | |
| 96 virtual bool CanSetStringValue() = 0; | |
| 97 | |
| 98 // Focus or unfocus a View, checking if the View is focusable first. | |
| 99 virtual bool SetFocused(bool focused) = 0; | |
| 100 }; | 91 }; |
| 101 | 92 |
| 102 } // namespace ui | 93 } // namespace ui |
| 103 | 94 |
| 104 #endif // UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_DELEGATE_H_ | 95 #endif // UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_DELEGATE_H_ |
| OLD | NEW |