1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // IPC messages for accessibility.
6 // Multiply-included message file, hence no include guard.
8 #include "base/basictypes.h"
9 #include "content/common/content_export.h"
10 #include "content/public/common/common_param_traits.h"
11 #include "ipc/ipc_message_macros.h"
12 #include "ipc/ipc_message_utils.h"
13 #include "ipc/ipc_param_traits.h"
14 #include "ipc/param_traits_macros.h"
15 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h"
16 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h"
17 #include "webkit/glue/webaccessibility.h"
19 #undef IPC_MESSAGE_EXPORT
20 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
22 #define IPC_MESSAGE_START AccessibilityMsgStart
24 #ifndef CONTENT_COMMON_ACCESSIBILITY_MESSAGES_H_
25 #define CONTENT_COMMON_ACCESSIBILITY_MESSAGES_H_
27 enum AccessibilityNotification
{
28 // The active descendant of a node has changed.
29 AccessibilityNotificationActiveDescendantChanged
,
32 AccessibilityNotificationAlert
,
34 // The node checked state has changed.
35 AccessibilityNotificationCheckStateChanged
,
37 // The node tree structure has changed.
38 AccessibilityNotificationChildrenChanged
,
40 // The node in focus has changed.
41 AccessibilityNotificationFocusChanged
,
43 // Page layout has completed.
44 AccessibilityNotificationLayoutComplete
,
46 // Content within a part of the page marked as a live region changed.
47 AccessibilityNotificationLiveRegionChanged
,
49 // The document node has loaded.
50 AccessibilityNotificationLoadComplete
,
52 // A menu list value changed.
53 AccessibilityNotificationMenuListValueChanged
,
55 // An object was shown.
56 AccessibilityNotificationObjectShow
,
58 // An object was hidden.
59 AccessibilityNotificationObjectHide
,
61 // The number of rows in a grid or tree control changed.
62 AccessibilityNotificationRowCountChanged
,
64 // A row in a grid or tree control was collapsed.
65 AccessibilityNotificationRowCollapsed
,
67 // A row in a grid or tree control was expanded.
68 AccessibilityNotificationRowExpanded
,
70 // The document was scrolled to an anchor node.
71 AccessibilityNotificationScrolledToAnchor
,
73 // One or more selected children of this node have changed.
74 AccessibilityNotificationSelectedChildrenChanged
,
76 // The text cursor or selection changed.
77 AccessibilityNotificationSelectedTextChanged
,
79 // Text was inserted in a node with text content.
80 AccessibilityNotificationTextInserted
,
82 // Text was removed in a node with text content.
83 AccessibilityNotificationTextRemoved
,
85 // The node value has changed.
86 AccessibilityNotificationValueChangedD
,
89 #endif // CONTENT_COMMON_ACCESSIBILITY_MESSAGES_H_
91 IPC_ENUM_TRAITS(AccessibilityNotification
)
93 IPC_ENUM_TRAITS(webkit_glue::WebAccessibility::BoolAttribute
)
94 IPC_ENUM_TRAITS(webkit_glue::WebAccessibility::FloatAttribute
)
95 IPC_ENUM_TRAITS(webkit_glue::WebAccessibility::IntAttribute
)
96 IPC_ENUM_TRAITS(webkit_glue::WebAccessibility::Role
)
97 IPC_ENUM_TRAITS(webkit_glue::WebAccessibility::State
)
98 IPC_ENUM_TRAITS(webkit_glue::WebAccessibility::StringAttribute
)
100 IPC_STRUCT_TRAITS_BEGIN(webkit_glue::WebAccessibility
)
101 IPC_STRUCT_TRAITS_MEMBER(id
)
102 IPC_STRUCT_TRAITS_MEMBER(name
)
103 IPC_STRUCT_TRAITS_MEMBER(value
)
104 IPC_STRUCT_TRAITS_MEMBER(role
)
105 IPC_STRUCT_TRAITS_MEMBER(state
)
106 IPC_STRUCT_TRAITS_MEMBER(location
)
107 IPC_STRUCT_TRAITS_MEMBER(string_attributes
)
108 IPC_STRUCT_TRAITS_MEMBER(int_attributes
)
109 IPC_STRUCT_TRAITS_MEMBER(float_attributes
)
110 IPC_STRUCT_TRAITS_MEMBER(bool_attributes
)
111 IPC_STRUCT_TRAITS_MEMBER(children
)
112 IPC_STRUCT_TRAITS_MEMBER(indirect_child_ids
)
113 IPC_STRUCT_TRAITS_MEMBER(html_attributes
)
114 IPC_STRUCT_TRAITS_MEMBER(line_breaks
)
115 IPC_STRUCT_TRAITS_MEMBER(cell_ids
)
116 IPC_STRUCT_TRAITS_MEMBER(unique_cell_ids
)
117 IPC_STRUCT_TRAITS_END()
119 IPC_STRUCT_BEGIN(AccessibilityHostMsg_NotificationParams
)
120 // Type of notification.
121 IPC_STRUCT_MEMBER(AccessibilityNotification
, notification_type
)
123 // ID of the node that the notification applies to.
124 IPC_STRUCT_MEMBER(int, id
)
126 // The accessibility node tree.
127 IPC_STRUCT_MEMBER(webkit_glue::WebAccessibility
, acc_tree
)
129 // Whether children are included in this tree, otherwise it's just an
130 // update to this one node and existing children are left in place.
131 IPC_STRUCT_MEMBER(bool, includes_children
)
134 // Messages sent from the browser to the renderer.
136 // Enable accessibility in the renderer process.
137 IPC_MESSAGE_ROUTED0(AccessibilityMsg_Enable
)
139 // Relay a request from assistive technology to set focus to a given node.
140 IPC_MESSAGE_ROUTED1(AccessibilityMsg_SetFocus
,
143 // Relay a request from assistive technology to perform the default action
145 IPC_MESSAGE_ROUTED1(AccessibilityMsg_DoDefaultAction
,
148 // Relay a request from assistive technology to make a given object
149 // visible by scrolling as many scrollable containers as possible.
150 // In addition, if it's not possible to make the entire object visible,
151 // scroll so that the |subfocus| rect is visible at least. The subfocus
152 // rect is in local coordinates of the object itself.
153 IPC_MESSAGE_ROUTED2(AccessibilityMsg_ScrollToMakeVisible
,
155 gfx::Rect
/* subfocus */)
157 // Relay a request from assistive technology to move a given object
158 // to a specific location, in the tab content area coordinate space, i.e.
159 // (0, 0) is the top-left corner of the tab contents.
160 IPC_MESSAGE_ROUTED2(AccessibilityMsg_ScrollToPoint
,
162 gfx::Point
/* new location */)
164 // Relay a request from assistive technology to set the cursor or
165 // selection within an editable text element.
166 IPC_MESSAGE_ROUTED3(AccessibilityMsg_SetTextSelection
,
168 int /* New start offset */,
169 int /* New end offset */)
171 // Tells the render view that a AccessibilityHostMsg_Notifications
172 // message was processed and it can send addition notifications.
173 IPC_MESSAGE_ROUTED0(AccessibilityMsg_Notifications_ACK
)
175 // Messages sent from the renderer to the browser.
177 // Sent to notify the browser about renderer accessibility notifications.
178 // The browser responds with a AccessibilityMsg_Notifications_ACK.
180 AccessibilityHostMsg_Notifications
,
181 std::vector
<AccessibilityHostMsg_NotificationParams
>)