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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
|
#include "qaccessiblewidget.h"
#include "qaccessiblemenu.h"
#include <qtoolbutton.h>
#include <qtoolbar.h>
#include <qvariant.h>
class AccessibleFactory : public QAccessibleFactoryInterface, public QLibraryInterface
{
public:
AccessibleFactory();
QRESULT queryInterface( const QUuid &, QUnknownInterface **iface );
Q_REFCOUNT
QStringList featureList() const;
QRESULT createAccessibleInterface( const QString &classname, QObject *object, QAccessibleInterface **iface );
bool init();
void cleanup();
bool canUnload() const;
};
AccessibleFactory::AccessibleFactory()
{
}
QRESULT AccessibleFactory::queryInterface( const QUuid &iid, QUnknownInterface **iface )
{
*iface = 0;
if ( iid == IID_QUnknown )
*iface = (QUnknownInterface*)(QFeatureListInterface*)(QAccessibleFactoryInterface*)this;
else if ( iid == IID_QFeatureList )
*iface = (QFeatureListInterface*)this;
else if ( iid == IID_QAccessibleFactory )
*iface = (QAccessibleFactoryInterface*)this;
else if ( iid == IID_QLibrary )
*iface = (QLibraryInterface*)this;
else
return QE_NOINTERFACE;
(*iface)->addRef();
return QS_OK;
}
QStringList AccessibleFactory::featureList() const
{
QStringList list;
list << "QLineEdit";
list << "QComboBox";
list << "QSpinBox";
list << "QSpinWidget";
list << "QDial";
list << "QScrollBar";
list << "QSlider";
list << "QToolButton";
list << "QCheckBox";
list << "QRadioButton";
list << "QButton";
list << "QViewportWidget";
list << "QClipperWidget";
list << "QTextEdit";
#ifndef QT_NO_ICONVIEW
list << "QIconView";
#endif
list << "QListView";
list << "QListBox";
list << "QTable";
list << "QDialog";
list << "QMessageBox";
list << "QMainWindow";
list << "QLabel";
list << "QGroupBox";
list << "QStatusBar";
list << "QProgressBar";
list << "QToolBar";
list << "QMenuBar";
list << "QPopupMenu";
list << "QHeader";
list << "QTabBar";
list << "QTitleBar";
list << "QWorkspaceChild";
list << "QSizeGrip";
list << "QSplitterHandle";
list << "QToolBarSeparator";
list << "QDockWindowHandle";
list << "QDockWindowResizeHandle";
list << "QTipLabel";
list << "QFrame";
list << "QWidgetStack";
list << "QWidget";
list << "QScrollView";
return list;
}
QRESULT AccessibleFactory::createAccessibleInterface( const QString &classname, QObject *object, QAccessibleInterface **iface )
{
*iface = 0;
if ( classname == "QLineEdit" ) {
*iface = new QAccessibleText( object, EditableText );
} else if ( classname == "QComboBox" ) {
*iface = new QAccessibleComboBox( object );
} else if ( classname == "QSpinBox" ) {
*iface = new QAccessibleRangeControl( object, SpinBox );
} else if ( classname == "QSpinWidget" ) {
*iface = new QAccessibleSpinWidget( object );
} else if ( classname == "QDial" ) {
*iface = new QAccessibleRangeControl( object, Dial );
} else if ( classname == "QScrollBar" ) {
*iface = new QAccessibleScrollBar( object );
} else if ( classname == "QSlider" ) {
*iface = new QAccessibleSlider( object );
} else if ( classname == "QToolButton" ) {
QToolButton *tb = (QToolButton*)object;
if ( !tb->popup() )
*iface = new QAccessibleButton( object, PushButton );
else if ( !tb->popupDelay() )
*iface = new QAccessibleButton( object, ButtonDropDown );
else
*iface = new QAccessibleButton( object, ButtonMenu );
} else if ( classname == "QCheckBox" ) {
*iface = new QAccessibleButton( object, CheckBox );
} else if ( classname == "QRadioButton" ) {
*iface = new QAccessibleButton( object, RadioButton );
} else if ( classname == "QButton" ) {
*iface = new QAccessibleButton( object, PushButton );
} else if ( classname == "QViewportWidget" ) {
*iface = new QAccessibleViewport( object, object->parent() );
} else if ( classname == "QClipperWidget" ) {
*iface = new QAccessibleViewport( object, object->parent()->parent() );
} else if ( classname == "QTextEdit" ) {
*iface = new QAccessibleTextEdit( object );
#ifndef QT_NO_ICONVIEW
} else if ( classname == "QIconView" ) {
*iface = new QAccessibleIconView( object );
#endif
} else if ( classname == "QListView" ) {
*iface = new QAccessibleListView( object );
} else if ( classname == "QListBox" ) {
*iface = new QAccessibleListBox( object );
} else if ( classname == "QTable" ) {
*iface = new QAccessibleScrollView( object, Table );
} else if ( classname == "QDialog" ) {
*iface = new QAccessibleWidget( object, Dialog );
} else if ( classname == "QMessageBox" ) {
*iface = new QAccessibleWidget( object, AlertMessage );
} else if ( classname == "QMainWindow" ) {
*iface = new QAccessibleWidget( object, Application );
} else if ( classname == "QLabel" || classname == "QLCDNumber" ) {
*iface = new QAccessibleDisplay( object, StaticText );
} else if ( classname == "QGroupBox" ) {
*iface = new QAccessibleDisplay( object, Grouping );
} else if ( classname == "QStatusBar" ) {
*iface = new QAccessibleWidget( object, StatusBar );
} else if ( classname == "QProgressBar" ) {
*iface = new QAccessibleRangeControl( object, ProgressBar );
} else if ( classname == "QToolBar" ) {
QToolBar *tb = (QToolBar*)object;
*iface = new QAccessibleWidget( object, ToolBar, tb->label() );
} else if ( classname == "QMenuBar" ) {
*iface = new QAccessibleMenuBar( object );
} else if ( classname == "QPopupMenu" ) {
*iface = new QAccessiblePopup( object );
} else if ( classname == "QHeader" ) {
*iface = new QAccessibleHeader( object );
} else if ( classname == "QTabBar" ) {
*iface = new QAccessibleTabBar( object );
} else if ( classname == "QTitleBar" ) {
*iface = new QAccessibleTitleBar( object );
} else if ( classname == "QWorkspaceChild" ) {
*iface = new QAccessibleWidget( object, Window );
} else if ( classname == "QSizeGrip" ) {
*iface = new QAccessibleWidget( object, Grip );
} else if ( classname == "QSplitterHandle" ) {
*iface = new QAccessibleWidget( object, Separator, QString::null,
QString::null, QString::null, QString::null,
QString::null, QString::null, QAccessible::Moveable );
} else if ( classname == "QToolBarSeparator" ) {
*iface = new QAccessibleWidget( object, QAccessible::Separator, QString::null,
QString::null, QString::null, QString::null,
QString::null, QString::null, QAccessible::Unavailable );
} else if ( classname == "QDockWindowHandle" ) {
*iface = new QAccessibleWidget( object, QAccessible::Grip, object->property( "caption" ).toString(),
QString::null, QString::null, QString::null,
QString::null, QString::null, QAccessible::Moveable );
} else if ( classname == "QDockWindowResizeHandle" ) {
*iface = new QAccessibleWidget( object, QAccessible::Separator, QString::null,
QString::null, QString::null, QString::null,
QString::null, QString::null, QAccessible::Moveable );
} else if ( classname == "QTipLabel" ) {
*iface = new QAccessibleWidget( object, ToolTip );
} else if ( classname == "QFrame" ) {
*iface = new QAccessibleWidget( object, Border );
} else if ( classname == "QWidgetStack" ) {
*iface = new QAccessibleWidgetStack( object );
} else if ( classname == "QWidget" ) {
*iface = new QAccessibleWidget( object );
} else if ( classname == "QScrollView" ) {
*iface = new QAccessibleScrollView( object, Client );
} else
return QE_NOINTERFACE;
(*iface)->addRef();
return QS_OK;
}
bool AccessibleFactory::init()
{
return TRUE;
}
void AccessibleFactory::cleanup()
{
}
bool AccessibleFactory::canUnload() const
{
return (QAccessibleWidget::objects == 0);
}
Q_EXPORT_COMPONENT()
{
Q_CREATE_INSTANCE( AccessibleFactory )
}
|