source: trunk/plugins/src/accessible/widgets/qaccessiblewidget.h

Last change on this file was 204, checked in by rudi, 14 years ago

Added plugin source code

File size: 11.6 KB
Line 
1#ifndef QACCESSIBLEWIDGET_H
2#define QACCESSIBLEWIDGET_H
3
4#include <qaccessible.h>
5
6class QButton;
7class QScrollView;
8class QHeader;
9class QSpinWidget;
10class QScrollBar;
11class QSlider;
12class QListBox;
13class QListView;
14class QTextEdit;
15class QTabBar;
16class QComboBox;
17class QTitleBar;
18class QWidgetStack;
19
20#ifndef QT_NO_ICONVIEW
21class QIconView;
22#endif
23
24
25QString buddyString( QWidget * );
26QString stripAmp( const QString& );
27QString hotKey( const QString& );
28
29class QAccessibleWidget : public QAccessibleObject
30{
31public:
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
59protected:
60 QWidget *widget() const;
61
62private:
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
73class QAccessibleWidgetStack : public QAccessibleWidget
74{
75public:
76 QAccessibleWidgetStack( QObject *o );
77
78 int controlAt( int x, int y ) const;
79 QRESULT queryChild( int control, QAccessibleInterface ** ) const;
80
81protected:
82 QWidgetStack *widgetStack() const;
83};
84
85class QAccessibleButton : public QAccessibleWidget
86{
87public:
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
96protected:
97 QButton *button() const;
98};
99
100class QAccessibleRangeControl : public QAccessibleWidget
101{
102public:
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
110class QAccessibleSpinWidget : public QAccessibleRangeControl
111{
112public:
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
128class QAccessibleScrollBar : public QAccessibleRangeControl
129{
130public:
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
146protected:
147 QScrollBar *scrollBar() const;
148};
149
150class QAccessibleSlider : public QAccessibleRangeControl
151{
152public:
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
168protected:
169 QSlider *slider() const;
170};
171
172class QAccessibleText : public QAccessibleWidget
173{
174public:
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
184class QAccessibleDisplay : public QAccessibleWidget
185{
186public:
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
195class QAccessibleHeader : public QAccessibleWidget
196{
197public:
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
213protected:
214 QHeader *header() const;
215};
216
217class QAccessibleTabBar : public QAccessibleWidget
218{
219public:
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
240protected:
241 QTabBar *tabBar() const;
242};
243
244class QAccessibleComboBox : public QAccessibleWidget
245{
246public:
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
262protected:
263 QComboBox *comboBox() const;
264};
265
266class QAccessibleTitleBar : public QAccessibleWidget
267{
268public:
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
283protected:
284 QTitleBar *titleBar() const;
285};
286
287class QAccessibleScrollView : public QAccessibleWidget
288{
289public:
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
302class QAccessibleViewport : public QAccessibleWidget
303{
304public:
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
322protected:
323 QAccessibleScrollView *scrollView() const;
324 QScrollView *scrollview;
325};
326
327class QAccessibleListBox : public QAccessibleScrollView
328{
329public:
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
345protected:
346 QListBox *listBox() const;
347};
348
349class QAccessibleListView : public QAccessibleScrollView
350{
351public:
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
367protected:
368 QListView *listView() const;
369};
370
371#ifndef QT_NO_ICONVIEW
372class QAccessibleIconView : public QAccessibleScrollView
373{
374public:
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
390protected:
391 QIconView *iconView() const;
392};
393#endif
394
395class QAccessibleTextEdit : public QAccessibleScrollView
396{
397public:
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
408protected:
409 QTextEdit *textEdit() const;
410};
411
412#endif // Q_ACESSIBLEWIDGET_H
Note: See TracBrowser for help on using the repository browser.