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
180
181
182
183
184
|
// Copyright (c) 2012 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_TOOLS_TEST_SHELL_ACCESSIBILITY_UI_ELEMENT_H_
#define WEBKIT_TOOLS_TEST_SHELL_ACCESSIBILITY_UI_ELEMENT_H_
#include "webkit/glue/cpp_bound_class.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObject.h"
class AccessibilityUIElement : public webkit_glue::CppBoundClass {
public:
class Factory {
public:
virtual ~Factory() { }
virtual AccessibilityUIElement* Create(
const WebKit::WebAccessibilityObject& object) = 0;
};
AccessibilityUIElement(
const WebKit::WebAccessibilityObject& accessibility_object,
Factory* factory);
virtual ~AccessibilityUIElement();
virtual AccessibilityUIElement* GetChildAtIndex(unsigned index);
virtual bool IsRoot() const;
protected:
const WebKit::WebAccessibilityObject& accessibility_object() const {
return accessibility_object_;
}
Factory* factory() const { return factory_; }
private:
// Bound methods and properties.
void AllAttributesCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void AttributesOfLinkedUIElementsCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void AttributesOfDocumentLinksCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void AttributesOfChildrenCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void ParametrizedAttributeNamesCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void LineForIndexCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void BoundsForRangeCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void StringForRangeCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void ChildAtIndexCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void ElementAtPointCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void AttributesOfColumnHeadersCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void AttributesOfRowHeadersCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void AttributesOfColumnsCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void AttributesOfRowsCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void AttributesOfVisibleCellsCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void AttributesOfHeaderCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void IndexInTableCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void RowIndexRangeCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void ColumnIndexRangeCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void CellForColumnAndRowCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void TitleUIElementCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void SetSelectedTextRangeCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void AttributeValueCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void IsAttributeSettableCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void IsActionSupportedCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void ParentElementCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void IncrementCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void DecrementCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void FallbackCallback(
const webkit_glue::CppArgumentList& args,
webkit_glue::CppVariant* result);
void ChildrenCountGetterCallback(webkit_glue::CppVariant* result);
void DescriptionGetterCallback(webkit_glue::CppVariant* result);
void IsEnabledGetterCallback(webkit_glue::CppVariant* result);
void IsSelectedGetterCallback(webkit_glue::CppVariant* result);
void RoleGetterCallback(webkit_glue::CppVariant* result);
void TitleGetterCallback(webkit_glue::CppVariant* result);
webkit_glue::CppVariant subrole_;
webkit_glue::CppVariant language_;
webkit_glue::CppVariant x_;
webkit_glue::CppVariant y_;
webkit_glue::CppVariant width_;
webkit_glue::CppVariant height_;
webkit_glue::CppVariant click_point_x_;
webkit_glue::CppVariant click_point_y_;
webkit_glue::CppVariant int_value_;
webkit_glue::CppVariant min_value_;
webkit_glue::CppVariant max_value_;
webkit_glue::CppVariant children_count_;
webkit_glue::CppVariant insertion_point_line_number_;
webkit_glue::CppVariant selected_text_range;
webkit_glue::CppVariant is_required_;
webkit_glue::CppVariant value_description_;
WebKit::WebAccessibilityObject accessibility_object_;
Factory* factory_;
};
class RootAccessibilityUIElement : public AccessibilityUIElement {
public:
RootAccessibilityUIElement(
const WebKit::WebAccessibilityObject& accessibility_object,
Factory* factory);
virtual ~RootAccessibilityUIElement();
virtual AccessibilityUIElement* GetChildAtIndex(unsigned index) OVERRIDE;
virtual bool IsRoot() const OVERRIDE;
};
// Provides simple lifetime management of the AccessibilityUIElement instances:
// all AccessibilityUIElements ever created from the controller are stored in
// a list and cleared explicitly.
class AccessibilityUIElementList : public AccessibilityUIElement::Factory {
public:
AccessibilityUIElementList();
virtual ~AccessibilityUIElementList();
void Clear();
virtual AccessibilityUIElement* Create(
const WebKit::WebAccessibilityObject& object) OVERRIDE;
AccessibilityUIElement* CreateRoot(
const WebKit::WebAccessibilityObject& object);
private:
typedef std::vector<AccessibilityUIElement*> ElementList;
ElementList elements_;
};
#endif // WEBKIT_TOOLS_TEST_SHELL_ACCESSIBILITY_UI_ELEMENT_H_
|