1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBKIT_GLUE_WEBACCESSIBILITY_H_
#define WEBKIT_GLUE_WEBACCESSIBILITY_H_
#include "base/string16.h"
namespace WebKit {
class WebAccessibilityCache;
}
namespace webkit_glue {
class WebAccessibility {
public:
// This defines an enumeration of IDs that can uniquely identify a call to a
// specific accessibility information function. Should match the support
// implemented in WebKit and GlueAccessibilityObject (functions marked with
// return value E_NOTIMPL in WebKit are also excluded).
enum Function {
FUNCTION_NONE = 0,
// Supported accessibility information retrieval functions.
FUNCTION_DODEFAULTACTION,
FUNCTION_HITTEST,
FUNCTION_LOCATION,
FUNCTION_NAVIGATE,
FUNCTION_GETCHILD,
FUNCTION_CHILDCOUNT,
FUNCTION_DEFAULTACTION,
FUNCTION_DESCRIPTION,
FUNCTION_GETFOCUSEDCHILD,
FUNCTION_HELPTEXT,
FUNCTION_KEYBOARDSHORTCUT,
FUNCTION_NAME,
FUNCTION_GETPARENT,
FUNCTION_ROLE,
FUNCTION_STATE,
FUNCTION_VALUE
// The deprecated put_accName and put_accValue (IAccessible) are not
// supported here, nor is accSelect, get_accHelpTopic and get_accSelection
// (matching WebKit's support for IAccessible).
};
// This defines an enumeration of navigation directions based on (but
// independent of) the MSAA Navigation Constants. However, to avoid the use of
// COM in our Glue layer, we use this as a substitute with a one-to-one
// conversion between Browser side (has COM) and Glue.
enum Direction {
DIRECTION_NONE = 0,
// Valid directions.
DIRECTION_UP,
DIRECTION_DOWN,
DIRECTION_LEFT,
DIRECTION_RIGHT,
DIRECTION_NEXT,
DIRECTION_PREVIOUS,
DIRECTION_FIRSTCHILD,
DIRECTION_LASTCHILD
};
// This defines an enumeration (in alphabetical order) of the supported
// accessibility roles in our Glue layer (used in
// GlueAccessibilityObject::Role). Any interface using roles must provide a
// conversion to its own roles (see e.g. BrowserAccessibility::get_accRole and
// BrowserAccessibility::MSAARole).
enum Role {
ROLE_APPLICATION,
ROLE_CELL,
ROLE_CHECKBUTTON,
ROLE_CLIENT,
ROLE_COLUMN,
ROLE_COLUMNHEADER,
ROLE_DOCUMENT,
ROLE_GRAPHIC,
ROLE_GROUPING,
ROLE_LINK,
ROLE_LIST,
ROLE_LISTBOX,
ROLE_LISTITEM,
ROLE_MENUBAR,
ROLE_MENUITEM,
ROLE_MENUPOPUP,
ROLE_OUTLINE,
ROLE_PAGETABLIST,
ROLE_PROGRESSBAR,
ROLE_PUSHBUTTON,
ROLE_RADIOBUTTON,
ROLE_ROW,
ROLE_ROWHEADER,
ROLE_SEPARATOR,
ROLE_SLIDER,
ROLE_STATICTEXT,
ROLE_STATUSBAR,
ROLE_TABLE,
ROLE_TEXT,
ROLE_TOOLBAR,
ROLE_TOOLTIP
};
// This defines an enumeration (in alphabetical order) of the supported
// accessibility states in our Glue layer (used in
// GlueAccessibilityObject::State). Any interface using states must provide a
// conversion to its own states (see e.g. BrowserAccessibility::get_accState
// and BrowserAccessibility::MSAAState).
enum State {
STATE_CHECKED,
STATE_FOCUSABLE,
STATE_FOCUSED,
STATE_HOTTRACKED,
STATE_INDETERMINATE,
STATE_LINKED,
STATE_MULTISELECTABLE,
STATE_OFFSCREEN,
STATE_PRESSED,
STATE_PROTECTED,
STATE_READONLY,
STATE_TRAVERSED,
STATE_UNAVAILABLE
};
// Parameters structure to hold a union of the possible accessibility function
// INPUT variables, with the unused fields always set to default value. Used
// in ViewMsg_GetAccessibilityInfo, as only parameter.
struct InParams {
// Identifier to uniquely distinguish which instance of accessibility
// information is being called upon on the renderer side.
int object_id;
// Identifier to resolve which accessibility information retrieval function
// is being called.
int function_id;
// Id of accessible child, whose information is being requested.
int child_id;
// LONG input parameters, used differently depending on the function called.
long input_long1;
long input_long2;
};
// Parameters structure to hold a union of the possible accessibility function
// OUTPUT variables, with the unused fields always set to default value. Used
// in ViewHostMsg_GetAccessibilityInfoResponse, as only parameter.
struct OutParams {
// Identifier to uniquely distinguish which instance of accessibility
// information is being called upon on the renderer side.
int object_id;
// LONG output parameters, used differently depending on the function
// called. [output_long1] can in some cases be set to -1 to indicate that
// the child object found by the called IAccessible function is not a simple
// object.
long output_long1;
long output_long2;
long output_long3;
long output_long4;
// String output parameter.
string16 output_string;
// Return code, either true (MSAA S_OK) or false (MSAA S_FALSE).
// Interface-specific error return codes (e.g. MSAA's E_POINTER,
// E_INVALIDARG, E_FAIL, E_NOTIMPL) must be handled on the browser side by
// input validation.
bool return_code;
};
static bool GetAccObjInfo(WebKit::WebAccessibilityCache* cache,
const InParams& in_params, OutParams* out_params);
};
} // namespace webkit_glue
#endif // WEBKIT_GLUE_WEBACCESSIBILITY_H_
|