OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef WEBKIT_TOOLS_TEST_SHELL_ACCESSIBILITY_UI_ELEMENT_H_ | |
6 #define WEBKIT_TOOLS_TEST_SHELL_ACCESSIBILITY_UI_ELEMENT_H_ | |
7 | |
8 #include "webkit/glue/cpp_bound_class.h" | |
9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec
t.h" | |
10 | |
11 class AccessibilityUIElement : public webkit_glue::CppBoundClass { | |
12 public: | |
13 class Factory { | |
14 public: | |
15 virtual ~Factory() { } | |
16 virtual AccessibilityUIElement* Create( | |
17 const WebKit::WebAccessibilityObject& object) = 0; | |
18 }; | |
19 | |
20 AccessibilityUIElement( | |
21 const WebKit::WebAccessibilityObject& accessibility_object, | |
22 Factory* factory); | |
23 virtual ~AccessibilityUIElement(); | |
24 | |
25 virtual AccessibilityUIElement* GetChildAtIndex(unsigned index); | |
26 virtual bool IsRoot() const; | |
27 | |
28 protected: | |
29 const WebKit::WebAccessibilityObject& accessibility_object() const { | |
30 return accessibility_object_; | |
31 } | |
32 Factory* factory() const { return factory_; } | |
33 | |
34 private: | |
35 // Bound methods and properties. | |
36 void AllAttributesCallback( | |
37 const webkit_glue::CppArgumentList& args, | |
38 webkit_glue::CppVariant* result); | |
39 void AttributesOfLinkedUIElementsCallback( | |
40 const webkit_glue::CppArgumentList& args, | |
41 webkit_glue::CppVariant* result); | |
42 void AttributesOfDocumentLinksCallback( | |
43 const webkit_glue::CppArgumentList& args, | |
44 webkit_glue::CppVariant* result); | |
45 void AttributesOfChildrenCallback( | |
46 const webkit_glue::CppArgumentList& args, | |
47 webkit_glue::CppVariant* result); | |
48 void ParametrizedAttributeNamesCallback( | |
49 const webkit_glue::CppArgumentList& args, | |
50 webkit_glue::CppVariant* result); | |
51 void LineForIndexCallback( | |
52 const webkit_glue::CppArgumentList& args, | |
53 webkit_glue::CppVariant* result); | |
54 void BoundsForRangeCallback( | |
55 const webkit_glue::CppArgumentList& args, | |
56 webkit_glue::CppVariant* result); | |
57 void StringForRangeCallback( | |
58 const webkit_glue::CppArgumentList& args, | |
59 webkit_glue::CppVariant* result); | |
60 void ChildAtIndexCallback( | |
61 const webkit_glue::CppArgumentList& args, | |
62 webkit_glue::CppVariant* result); | |
63 void ElementAtPointCallback( | |
64 const webkit_glue::CppArgumentList& args, | |
65 webkit_glue::CppVariant* result); | |
66 void AttributesOfColumnHeadersCallback( | |
67 const webkit_glue::CppArgumentList& args, | |
68 webkit_glue::CppVariant* result); | |
69 void AttributesOfRowHeadersCallback( | |
70 const webkit_glue::CppArgumentList& args, | |
71 webkit_glue::CppVariant* result); | |
72 void AttributesOfColumnsCallback( | |
73 const webkit_glue::CppArgumentList& args, | |
74 webkit_glue::CppVariant* result); | |
75 void AttributesOfRowsCallback( | |
76 const webkit_glue::CppArgumentList& args, | |
77 webkit_glue::CppVariant* result); | |
78 void AttributesOfVisibleCellsCallback( | |
79 const webkit_glue::CppArgumentList& args, | |
80 webkit_glue::CppVariant* result); | |
81 void AttributesOfHeaderCallback( | |
82 const webkit_glue::CppArgumentList& args, | |
83 webkit_glue::CppVariant* result); | |
84 void IndexInTableCallback( | |
85 const webkit_glue::CppArgumentList& args, | |
86 webkit_glue::CppVariant* result); | |
87 void RowIndexRangeCallback( | |
88 const webkit_glue::CppArgumentList& args, | |
89 webkit_glue::CppVariant* result); | |
90 void ColumnIndexRangeCallback( | |
91 const webkit_glue::CppArgumentList& args, | |
92 webkit_glue::CppVariant* result); | |
93 void CellForColumnAndRowCallback( | |
94 const webkit_glue::CppArgumentList& args, | |
95 webkit_glue::CppVariant* result); | |
96 void TitleUIElementCallback( | |
97 const webkit_glue::CppArgumentList& args, | |
98 webkit_glue::CppVariant* result); | |
99 void SetSelectedTextRangeCallback( | |
100 const webkit_glue::CppArgumentList& args, | |
101 webkit_glue::CppVariant* result); | |
102 void AttributeValueCallback( | |
103 const webkit_glue::CppArgumentList& args, | |
104 webkit_glue::CppVariant* result); | |
105 void IsAttributeSettableCallback( | |
106 const webkit_glue::CppArgumentList& args, | |
107 webkit_glue::CppVariant* result); | |
108 void IsActionSupportedCallback( | |
109 const webkit_glue::CppArgumentList& args, | |
110 webkit_glue::CppVariant* result); | |
111 void ParentElementCallback( | |
112 const webkit_glue::CppArgumentList& args, | |
113 webkit_glue::CppVariant* result); | |
114 void IncrementCallback( | |
115 const webkit_glue::CppArgumentList& args, | |
116 webkit_glue::CppVariant* result); | |
117 void DecrementCallback( | |
118 const webkit_glue::CppArgumentList& args, | |
119 webkit_glue::CppVariant* result); | |
120 void FallbackCallback( | |
121 const webkit_glue::CppArgumentList& args, | |
122 webkit_glue::CppVariant* result); | |
123 | |
124 void ChildrenCountGetterCallback(webkit_glue::CppVariant* result); | |
125 void DescriptionGetterCallback(webkit_glue::CppVariant* result); | |
126 void IsEnabledGetterCallback(webkit_glue::CppVariant* result); | |
127 void IsSelectedGetterCallback(webkit_glue::CppVariant* result); | |
128 void RoleGetterCallback(webkit_glue::CppVariant* result); | |
129 void TitleGetterCallback(webkit_glue::CppVariant* result); | |
130 | |
131 webkit_glue::CppVariant subrole_; | |
132 webkit_glue::CppVariant language_; | |
133 webkit_glue::CppVariant x_; | |
134 webkit_glue::CppVariant y_; | |
135 webkit_glue::CppVariant width_; | |
136 webkit_glue::CppVariant height_; | |
137 webkit_glue::CppVariant click_point_x_; | |
138 webkit_glue::CppVariant click_point_y_; | |
139 webkit_glue::CppVariant int_value_; | |
140 webkit_glue::CppVariant min_value_; | |
141 webkit_glue::CppVariant max_value_; | |
142 webkit_glue::CppVariant children_count_; | |
143 webkit_glue::CppVariant insertion_point_line_number_; | |
144 webkit_glue::CppVariant selected_text_range; | |
145 webkit_glue::CppVariant is_required_; | |
146 webkit_glue::CppVariant value_description_; | |
147 | |
148 WebKit::WebAccessibilityObject accessibility_object_; | |
149 Factory* factory_; | |
150 }; | |
151 | |
152 | |
153 class RootAccessibilityUIElement : public AccessibilityUIElement { | |
154 public: | |
155 RootAccessibilityUIElement( | |
156 const WebKit::WebAccessibilityObject& accessibility_object, | |
157 Factory* factory); | |
158 virtual ~RootAccessibilityUIElement(); | |
159 | |
160 virtual AccessibilityUIElement* GetChildAtIndex(unsigned index) OVERRIDE; | |
161 virtual bool IsRoot() const OVERRIDE; | |
162 }; | |
163 | |
164 | |
165 // Provides simple lifetime management of the AccessibilityUIElement instances: | |
166 // all AccessibilityUIElements ever created from the controller are stored in | |
167 // a list and cleared explicitly. | |
168 class AccessibilityUIElementList : public AccessibilityUIElement::Factory { | |
169 public: | |
170 AccessibilityUIElementList(); | |
171 virtual ~AccessibilityUIElementList(); | |
172 | |
173 void Clear(); | |
174 virtual AccessibilityUIElement* Create( | |
175 const WebKit::WebAccessibilityObject& object) OVERRIDE; | |
176 AccessibilityUIElement* CreateRoot( | |
177 const WebKit::WebAccessibilityObject& object); | |
178 | |
179 private: | |
180 typedef std::vector<AccessibilityUIElement*> ElementList; | |
181 ElementList elements_; | |
182 }; | |
183 | |
184 #endif // WEBKIT_TOOLS_TEST_SHELL_ACCESSIBILITY_UI_ELEMENT_H_ | |
OLD | NEW |