1 | #ifndef QACCESSIBLEWIDGET_H
|
---|
2 | #define QACCESSIBLEWIDGET_H
|
---|
3 |
|
---|
4 | #include <qaccessible.h>
|
---|
5 |
|
---|
6 | class QButton;
|
---|
7 | class QScrollView;
|
---|
8 | class QHeader;
|
---|
9 | class QSpinWidget;
|
---|
10 | class QScrollBar;
|
---|
11 | class QSlider;
|
---|
12 | class QListBox;
|
---|
13 | class QListView;
|
---|
14 | class QTextEdit;
|
---|
15 | class QTabBar;
|
---|
16 | class QComboBox;
|
---|
17 | class QTitleBar;
|
---|
18 | class QWidgetStack;
|
---|
19 |
|
---|
20 | #ifndef QT_NO_ICONVIEW
|
---|
21 | class QIconView;
|
---|
22 | #endif
|
---|
23 |
|
---|
24 |
|
---|
25 | QString buddyString( QWidget * );
|
---|
26 | QString stripAmp( const QString& );
|
---|
27 | QString hotKey( const QString& );
|
---|
28 |
|
---|
29 | class QAccessibleWidget : public QAccessibleObject
|
---|
30 | {
|
---|
31 | public:
|
---|
32 | QAccessibleWidget( QObject *o, Role r = Client, QString name = QString::null,
|
---|
33 | QString description = QString::null, QString value = QString::null,
|
---|
34 | QString help = QString::null, QString defAction = QString::null,
|
---|
35 | QString accelerator = QString::null, State s = Normal );
|
---|
36 |
|
---|
37 | ~QAccessibleWidget();
|
---|
38 |
|
---|
39 | int controlAt( int x, int y ) const;
|
---|
40 | QRect rect( int control ) const;
|
---|
41 | int navigate( NavDirection direction, int startControl ) const;
|
---|
42 | int childCount() const;
|
---|
43 | QRESULT queryChild( int control, QAccessibleInterface ** ) const;
|
---|
44 | QRESULT queryParent( QAccessibleInterface ** ) const;
|
---|
45 |
|
---|
46 | QString text( Text t, int control ) const;
|
---|
47 | void setText( Text t, int control, const QString &text );
|
---|
48 | Role role( int control ) const;
|
---|
49 | State state( int control ) const;
|
---|
50 |
|
---|
51 | bool doDefaultAction( int control );
|
---|
52 | bool setFocus( int control );
|
---|
53 | bool setSelected( int control, bool on, bool extend );
|
---|
54 | void clearSelection();
|
---|
55 | QMemArray<int> selection() const;
|
---|
56 |
|
---|
57 | static ulong objects;
|
---|
58 |
|
---|
59 | protected:
|
---|
60 | QWidget *widget() const;
|
---|
61 |
|
---|
62 | private:
|
---|
63 | Role role_;
|
---|
64 | State state_;
|
---|
65 | QString name_;
|
---|
66 | QString description_;
|
---|
67 | QString value_;
|
---|
68 | QString help_;
|
---|
69 | QString defAction_;
|
---|
70 | QString accelerator_;
|
---|
71 | };
|
---|
72 |
|
---|
73 | class QAccessibleWidgetStack : public QAccessibleWidget
|
---|
74 | {
|
---|
75 | public:
|
---|
76 | QAccessibleWidgetStack( QObject *o );
|
---|
77 |
|
---|
78 | int controlAt( int x, int y ) const;
|
---|
79 | QRESULT queryChild( int control, QAccessibleInterface ** ) const;
|
---|
80 |
|
---|
81 | protected:
|
---|
82 | QWidgetStack *widgetStack() const;
|
---|
83 | };
|
---|
84 |
|
---|
85 | class QAccessibleButton : public QAccessibleWidget
|
---|
86 | {
|
---|
87 | public:
|
---|
88 | QAccessibleButton( QObject *o, Role r, QString description = QString::null,
|
---|
89 | QString help = QString::null );
|
---|
90 |
|
---|
91 | QString text( Text t, int control ) const;
|
---|
92 | State state( int control ) const;
|
---|
93 |
|
---|
94 | bool doDefaultAction( int control );
|
---|
95 |
|
---|
96 | protected:
|
---|
97 | QButton *button() const;
|
---|
98 | };
|
---|
99 |
|
---|
100 | class QAccessibleRangeControl : public QAccessibleWidget
|
---|
101 | {
|
---|
102 | public:
|
---|
103 | QAccessibleRangeControl( QObject *o, Role role, QString name = QString::null,
|
---|
104 | QString description = QString::null, QString help = QString::null,
|
---|
105 | QString defAction = QString::null, QString accelerator = QString::null );
|
---|
106 |
|
---|
107 | QString text( Text t, int control ) const;
|
---|
108 | };
|
---|
109 |
|
---|
110 | class QAccessibleSpinWidget : public QAccessibleRangeControl
|
---|
111 | {
|
---|
112 | public:
|
---|
113 | QAccessibleSpinWidget( QObject *o );
|
---|
114 |
|
---|
115 | int controlAt( int x, int y ) const;
|
---|
116 | QRect rect( int control ) const;
|
---|
117 | int navigate( NavDirection direction, int startControl ) const;
|
---|
118 | int childCount() const;
|
---|
119 | QRESULT queryChild( int control, QAccessibleInterface ** ) const;
|
---|
120 |
|
---|
121 | QString text( Text t, int control ) const;
|
---|
122 | Role role( int control ) const;
|
---|
123 | State state( int control ) const;
|
---|
124 |
|
---|
125 | bool doDefaultAction( int control );
|
---|
126 | };
|
---|
127 |
|
---|
128 | class QAccessibleScrollBar : public QAccessibleRangeControl
|
---|
129 | {
|
---|
130 | public:
|
---|
131 | QAccessibleScrollBar( QObject *o, QString name = QString::null,
|
---|
132 | QString description = QString::null, QString help = QString::null,
|
---|
133 | QString defAction = QString::null, QString accelerator = QString::null );
|
---|
134 |
|
---|
135 | int controlAt( int x, int y ) const;
|
---|
136 | QRect rect( int control ) const;
|
---|
137 | int navigate( NavDirection direction, int startControl ) const;
|
---|
138 | int childCount() const;
|
---|
139 | QRESULT queryChild( int control, QAccessibleInterface ** ) const;
|
---|
140 |
|
---|
141 | QString text( Text t, int control ) const;
|
---|
142 | Role role( int control ) const;
|
---|
143 |
|
---|
144 | bool doDefaultAction( int control );
|
---|
145 |
|
---|
146 | protected:
|
---|
147 | QScrollBar *scrollBar() const;
|
---|
148 | };
|
---|
149 |
|
---|
150 | class QAccessibleSlider : public QAccessibleRangeControl
|
---|
151 | {
|
---|
152 | public:
|
---|
153 | QAccessibleSlider( QObject *o, QString name = QString::null,
|
---|
154 | QString description = QString::null, QString help = QString::null,
|
---|
155 | QString defAction = QString::null, QString accelerator = QString::null );
|
---|
156 |
|
---|
157 | int controlAt( int x, int y ) const;
|
---|
158 | QRect rect( int control ) const;
|
---|
159 | int navigate( NavDirection direction, int startControl ) const;
|
---|
160 | int childCount() const;
|
---|
161 | QRESULT queryChild( int control, QAccessibleInterface ** ) const;
|
---|
162 |
|
---|
163 | QString text( Text t, int control ) const;
|
---|
164 | Role role( int control ) const;
|
---|
165 |
|
---|
166 | bool doDefaultAction( int control );
|
---|
167 |
|
---|
168 | protected:
|
---|
169 | QSlider *slider() const;
|
---|
170 | };
|
---|
171 |
|
---|
172 | class QAccessibleText : public QAccessibleWidget
|
---|
173 | {
|
---|
174 | public:
|
---|
175 | QAccessibleText( QObject *o, Role role, QString name = QString::null,
|
---|
176 | QString description = QString::null, QString help = QString::null,
|
---|
177 | QString defAction = QString::null, QString accelerator = QString::null );
|
---|
178 |
|
---|
179 | QString text( Text t, int control ) const;
|
---|
180 | State state( int control ) const;
|
---|
181 | void setText(Text t, int control, const QString &text);
|
---|
182 | };
|
---|
183 |
|
---|
184 | class QAccessibleDisplay : public QAccessibleWidget
|
---|
185 | {
|
---|
186 | public:
|
---|
187 | QAccessibleDisplay( QObject *o, Role role, QString description = QString::null,
|
---|
188 | QString value = QString::null, QString help = QString::null,
|
---|
189 | QString defAction = QString::null, QString accelerator = QString::null );
|
---|
190 |
|
---|
191 | QString text( Text t, int control ) const;
|
---|
192 | Role role( int control ) const;
|
---|
193 | };
|
---|
194 |
|
---|
195 | class QAccessibleHeader : public QAccessibleWidget
|
---|
196 | {
|
---|
197 | public:
|
---|
198 | QAccessibleHeader( QObject *o, QString description = QString::null,
|
---|
199 | QString value = QString::null, QString help = QString::null,
|
---|
200 | QString defAction = QString::null, QString accelerator = QString::null );
|
---|
201 |
|
---|
202 | int controlAt( int x, int y ) const;
|
---|
203 | QRect rect( int control ) const;
|
---|
204 | int navigate( NavDirection direction, int startControl ) const;
|
---|
205 | int childCount() const;
|
---|
206 | QRESULT queryChild( int control, QAccessibleInterface ** ) const;
|
---|
207 |
|
---|
208 | QString text( Text t, int control ) const;
|
---|
209 |
|
---|
210 | Role role( int control ) const;
|
---|
211 | State state( int control ) const;
|
---|
212 |
|
---|
213 | protected:
|
---|
214 | QHeader *header() const;
|
---|
215 | };
|
---|
216 |
|
---|
217 | class QAccessibleTabBar : public QAccessibleWidget
|
---|
218 | {
|
---|
219 | public:
|
---|
220 | QAccessibleTabBar( QObject *o, QString description = QString::null,
|
---|
221 | QString value = QString::null, QString help = QString::null,
|
---|
222 | QString defAction = QString::null, QString accelerator = QString::null );
|
---|
223 |
|
---|
224 | int controlAt( int x, int y ) const;
|
---|
225 | QRect rect( int control ) const;
|
---|
226 | int navigate( NavDirection direction, int startControl ) const;
|
---|
227 | int childCount() const;
|
---|
228 | QRESULT queryChild( int control, QAccessibleInterface ** ) const;
|
---|
229 |
|
---|
230 | QString text( Text t, int control ) const;
|
---|
231 |
|
---|
232 | Role role( int control ) const;
|
---|
233 | State state( int control ) const;
|
---|
234 |
|
---|
235 | bool doDefaultAction( int control );
|
---|
236 | bool setSelected( int control, bool on, bool extend );
|
---|
237 | void clearSelection();
|
---|
238 | QMemArray<int> selection() const;
|
---|
239 |
|
---|
240 | protected:
|
---|
241 | QTabBar *tabBar() const;
|
---|
242 | };
|
---|
243 |
|
---|
244 | class QAccessibleComboBox : public QAccessibleWidget
|
---|
245 | {
|
---|
246 | public:
|
---|
247 | QAccessibleComboBox( QObject *o );
|
---|
248 |
|
---|
249 | int controlAt( int x, int y ) const;
|
---|
250 | QRect rect( int control ) const;
|
---|
251 | int navigate( NavDirection direction, int startControl ) const;
|
---|
252 | int childCount() const;
|
---|
253 | QRESULT queryChild( int control, QAccessibleInterface ** ) const;
|
---|
254 |
|
---|
255 | QString text( Text t, int control ) const;
|
---|
256 |
|
---|
257 | Role role( int control ) const;
|
---|
258 | State state( int control ) const;
|
---|
259 |
|
---|
260 | bool doDefaultAction( int control );
|
---|
261 |
|
---|
262 | protected:
|
---|
263 | QComboBox *comboBox() const;
|
---|
264 | };
|
---|
265 |
|
---|
266 | class QAccessibleTitleBar : public QAccessibleWidget
|
---|
267 | {
|
---|
268 | public:
|
---|
269 | QAccessibleTitleBar( QObject *o );
|
---|
270 |
|
---|
271 | int controlAt( int x, int y ) const;
|
---|
272 | QRect rect( int control ) const;
|
---|
273 | int navigate( NavDirection direction, int startControl ) const;
|
---|
274 | int childCount() const;
|
---|
275 | QRESULT queryChild( int control, QAccessibleInterface ** ) const;
|
---|
276 |
|
---|
277 | QString text( Text t, int control ) const;
|
---|
278 | Role role( int control ) const;
|
---|
279 | State state( int control ) const;
|
---|
280 |
|
---|
281 | bool doDefaultAction( int control );
|
---|
282 |
|
---|
283 | protected:
|
---|
284 | QTitleBar *titleBar() const;
|
---|
285 | };
|
---|
286 |
|
---|
287 | class QAccessibleScrollView : public QAccessibleWidget
|
---|
288 | {
|
---|
289 | public:
|
---|
290 | QAccessibleScrollView( QObject *o, Role role, QString name = QString::null,
|
---|
291 | QString description = QString::null, QString value = QString::null,
|
---|
292 | QString help = QString::null, QString defAction = QString::null,
|
---|
293 | QString accelerator = QString::null );
|
---|
294 |
|
---|
295 | QString text( Text t, int control ) const;
|
---|
296 |
|
---|
297 | virtual int itemAt( int x, int y ) const;
|
---|
298 | virtual QRect itemRect( int item ) const;
|
---|
299 | virtual int itemCount() const;
|
---|
300 | };
|
---|
301 |
|
---|
302 | class QAccessibleViewport : public QAccessibleWidget
|
---|
303 | {
|
---|
304 | public:
|
---|
305 | QAccessibleViewport( QObject *o, QObject *sv );
|
---|
306 |
|
---|
307 | int controlAt( int x, int y ) const;
|
---|
308 | QRect rect( int control ) const;
|
---|
309 | int navigate( NavDirection direction, int startControl ) const;
|
---|
310 | int childCount() const;
|
---|
311 |
|
---|
312 | QString text( Text t, int control ) const;
|
---|
313 | Role role( int control ) const;
|
---|
314 | State state( int control ) const;
|
---|
315 |
|
---|
316 | bool doDefaultAction( int control );
|
---|
317 | bool setFocus( int control );
|
---|
318 | bool setSelected( int control, bool on, bool extend );
|
---|
319 | void clearSelection();
|
---|
320 | QMemArray<int> selection() const;
|
---|
321 |
|
---|
322 | protected:
|
---|
323 | QAccessibleScrollView *scrollView() const;
|
---|
324 | QScrollView *scrollview;
|
---|
325 | };
|
---|
326 |
|
---|
327 | class QAccessibleListBox : public QAccessibleScrollView
|
---|
328 | {
|
---|
329 | public:
|
---|
330 | QAccessibleListBox( QObject *o );
|
---|
331 |
|
---|
332 | int itemAt( int x, int y ) const;
|
---|
333 | QRect itemRect( int item ) const;
|
---|
334 | int itemCount() const;
|
---|
335 |
|
---|
336 | QString text( Text t, int control ) const;
|
---|
337 | Role role( int control ) const;
|
---|
338 | State state( int control ) const;
|
---|
339 |
|
---|
340 | bool setFocus( int control );
|
---|
341 | bool setSelected( int control, bool on, bool extend );
|
---|
342 | void clearSelection();
|
---|
343 | QMemArray<int> selection() const;
|
---|
344 |
|
---|
345 | protected:
|
---|
346 | QListBox *listBox() const;
|
---|
347 | };
|
---|
348 |
|
---|
349 | class QAccessibleListView : public QAccessibleScrollView
|
---|
350 | {
|
---|
351 | public:
|
---|
352 | QAccessibleListView( QObject *o );
|
---|
353 |
|
---|
354 | int itemAt( int x, int y ) const;
|
---|
355 | QRect itemRect( int item ) const;
|
---|
356 | int itemCount() const;
|
---|
357 |
|
---|
358 | QString text( Text t, int control ) const;
|
---|
359 | Role role( int control ) const;
|
---|
360 | State state( int control ) const;
|
---|
361 |
|
---|
362 | bool setFocus( int control );
|
---|
363 | bool setSelected( int control, bool on, bool extend );
|
---|
364 | void clearSelection();
|
---|
365 | QMemArray<int> selection() const;
|
---|
366 |
|
---|
367 | protected:
|
---|
368 | QListView *listView() const;
|
---|
369 | };
|
---|
370 |
|
---|
371 | #ifndef QT_NO_ICONVIEW
|
---|
372 | class QAccessibleIconView : public QAccessibleScrollView
|
---|
373 | {
|
---|
374 | public:
|
---|
375 | QAccessibleIconView( QObject *o );
|
---|
376 |
|
---|
377 | int itemAt( int x, int y ) const;
|
---|
378 | QRect itemRect( int item ) const;
|
---|
379 | int itemCount() const;
|
---|
380 |
|
---|
381 | QString text( Text t, int control ) const;
|
---|
382 | Role role( int control ) const;
|
---|
383 | State state( int control ) const;
|
---|
384 |
|
---|
385 | bool setFocus( int control );
|
---|
386 | bool setSelected( int control, bool on, bool extend );
|
---|
387 | void clearSelection();
|
---|
388 | QMemArray<int> selection() const;
|
---|
389 |
|
---|
390 | protected:
|
---|
391 | QIconView *iconView() const;
|
---|
392 | };
|
---|
393 | #endif
|
---|
394 |
|
---|
395 | class QAccessibleTextEdit : public QAccessibleScrollView
|
---|
396 | {
|
---|
397 | public:
|
---|
398 | QAccessibleTextEdit( QObject *o );
|
---|
399 |
|
---|
400 | int itemAt( int x, int y ) const;
|
---|
401 | QRect itemRect( int item ) const;
|
---|
402 | int itemCount() const;
|
---|
403 |
|
---|
404 | QString text( Text t, int control ) const;
|
---|
405 | void setText(Text t, int control, const QString &text);
|
---|
406 | Role role( int control ) const;
|
---|
407 |
|
---|
408 | protected:
|
---|
409 | QTextEdit *textEdit() const;
|
---|
410 | };
|
---|
411 |
|
---|
412 | #endif // Q_ACESSIBLEWIDGET_H
|
---|