Qt 4.8
main.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the plugins of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include "qaccessiblecompat.h"
43 #include "q3simplewidgets.h"
44 #include "q3complexwidgets.h"
45 
46 #include <qaccessibleplugin.h>
47 #include <qplugin.h>
48 #include <qstringlist.h>
49 #include <q3toolbar.h>
50 
52 
54 {
55 public:
57 
58  QStringList keys() const;
59  QAccessibleInterface *create(const QString &classname, QObject *object);
60 };
61 
63 {
64 }
65 
67 {
68  QStringList list;
69  list << QLatin1String("Q3TextEdit");
70  list << QLatin1String("Q3IconView");
71  list << QLatin1String("Q3ListView");
72  list << QLatin1String("Q3WidgetStack");
73  list << QLatin1String("Q3GroupBox");
74  list << QLatin1String("Q3ToolBar");
75  list << QLatin1String("Q3ToolBarSeparator");
76  list << QLatin1String("Q3DockWindowHandle");
77  list << QLatin1String("Q3DockWindowResizeHandle");
78  list << QLatin1String("Q3MainWindow");
79  list << QLatin1String("Q3Header");
80  list << QLatin1String("Q3ListBox");
81  list << QLatin1String("Q3Table");
82  list << QLatin1String("Q3TitleBar");
83 
84  return list;
85 }
86 
88 {
89  QAccessibleInterface *iface = 0;
90  if (!object || !object->isWidgetType())
91  return iface;
92  QWidget *widget = static_cast<QWidget*>(object);
93 
94  if (classname == QLatin1String("Q3TextEdit")) {
95  iface = new Q3AccessibleTextEdit(widget);
96  } else if (classname == QLatin1String("Q3IconView")) {
97  iface = new QAccessibleIconView(widget);
98  } else if (classname == QLatin1String("Q3ListView")) {
99  iface = new QAccessibleListView(widget);
100  } else if (classname == QLatin1String("Q3WidgetStack")) {
101  iface = new QAccessibleWidgetStack(widget);
102  } else if (classname == QLatin1String("Q3ListBox")) {
103  iface = new QAccessibleListBox(widget);
104  } else if (classname == QLatin1String("Q3Table")) {
105  iface = new Q3AccessibleScrollView(widget, Table);
106  } else if (classname == QLatin1String("Q3GroupBox")) {
107  iface = new Q3AccessibleDisplay(widget, Grouping);
108  } else if (classname == QLatin1String("Q3ToolBar")) {
109  iface = new QAccessibleWidget(widget, ToolBar, static_cast<Q3ToolBar *>(widget)->label());
110  } else if (classname == QLatin1String("Q3MainWindow")) {
111  iface = new QAccessibleWidget(widget, Application);
112  } else if (classname == QLatin1String("Q3ToolBarSeparator")) {
113  iface = new QAccessibleWidget(widget, Separator);
114  } else if (classname == QLatin1String("Q3DockWindowHandle")) {
115  iface = new QAccessibleWidget(widget, Grip);
116  } else if (classname == QLatin1String("Q3DockWindowResizeHandle")) {
117  iface = new QAccessibleWidget(widget, Grip);
118  } else if (classname == QLatin1String("Q3Header")) {
119  iface = new Q3AccessibleHeader(widget);
120  } else if (classname == QLatin1String("Q3TitleBar")) {
121  iface = new Q3AccessibleTitleBar(widget);
122  }
123 
124  return iface;
125 }
126 
128 Q_EXPORT_PLUGIN2(qtaccessiblecompatwidgets, CompatAccessibleFactory)
129 
The Q3AccessibleTextEdit class implements the QAccessibleInterface for richtext editors.
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
QPointer< QWidget > widget
The QAccessibleIconView class implements the QAccessibleInterface for icon views. ...
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QAccessiblePlugin class provides an abstract base for accessibility plugins.
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
The QAccessibleWidgetStack class implements the QAccessibleInterface for widget stacks.
Q_EXPORT_PLUGIN2(qjpcodecs, JPTextCodecs)
Q_EXPORT_STATIC_PLUGIN(JPTextCodecs)
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
QAccessibleInterface * create(const QString &classname, QObject *object)
Creates and returns a QAccessibleInterface implementation for the class key and the object object...
Definition: main.cpp:87
The QAccessibleWidget class implements the QAccessibleInterface for QWidgets.
bool isWidgetType() const
Returns true if the object is a widget; otherwise returns false.
Definition: qobject.h:146
The QAccessibleListView class implements the QAccessibleInterface for list views. ...
The QAccessibleInterface class defines an interface that exposes information about accessible objects...
Definition: qaccessible.h:370
The QAccessibleListBox class implements the QAccessibleInterface for list boxes.
QStringList keys() const
Returns the list of keys this plugin supports.
Definition: main.cpp:66