[2] | 1 | /****************************************************************************
|
---|
| 2 | **
|
---|
| 3 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
---|
[561] | 4 | ** All rights reserved.
|
---|
| 5 | ** Contact: Nokia Corporation ([email protected])
|
---|
[2] | 6 | **
|
---|
| 7 | ** This file is part of the plugins of the Qt Toolkit.
|
---|
| 8 | **
|
---|
| 9 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
| 10 | ** Commercial Usage
|
---|
| 11 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
| 12 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
| 13 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
| 14 | ** a written agreement between you and Nokia.
|
---|
| 15 | **
|
---|
| 16 | ** GNU Lesser General Public License Usage
|
---|
| 17 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
| 18 | ** General Public License version 2.1 as published by the Free Software
|
---|
| 19 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
| 20 | ** packaging of this file. Please review the following information to
|
---|
| 21 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
| 22 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
| 23 | **
|
---|
[561] | 24 | ** In addition, as a special exception, Nokia gives you certain additional
|
---|
| 25 | ** rights. These rights are described in the Nokia Qt LGPL Exception
|
---|
| 26 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
---|
[2] | 27 | **
|
---|
| 28 | ** GNU General Public License Usage
|
---|
| 29 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
| 30 | ** General Public License version 3.0 as published by the Free Software
|
---|
| 31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
| 32 | ** packaging of this file. Please review the following information to
|
---|
| 33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
| 34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
| 35 | **
|
---|
[561] | 36 | ** If you have questions regarding the use of this file, please contact
|
---|
| 37 | ** Nokia at [email protected].
|
---|
[2] | 38 | ** $QT_END_LICENSE$
|
---|
| 39 | **
|
---|
| 40 | ****************************************************************************/
|
---|
| 41 |
|
---|
| 42 | #ifndef QACCESSIBLEWIDGETS_H
|
---|
| 43 | #define QACCESSIBLEWIDGETS_H
|
---|
| 44 |
|
---|
| 45 | #include <QtGui/qaccessible2.h>
|
---|
| 46 | #include <QtGui/qaccessiblewidget.h>
|
---|
| 47 |
|
---|
| 48 | #ifndef QT_NO_ACCESSIBILITY
|
---|
| 49 |
|
---|
| 50 | #include <QtCore/QPointer>
|
---|
| 51 |
|
---|
| 52 | QT_BEGIN_NAMESPACE
|
---|
| 53 |
|
---|
| 54 | class QTextEdit;
|
---|
| 55 | class QStackedWidget;
|
---|
| 56 | class QToolBox;
|
---|
| 57 | class QMdiArea;
|
---|
| 58 | class QMdiSubWindow;
|
---|
| 59 | class QWorkspace;
|
---|
| 60 | class QRubberBand;
|
---|
| 61 | class QTextBrowser;
|
---|
| 62 | class QCalendarWidget;
|
---|
| 63 | class QAbstractItemView;
|
---|
| 64 | class QDockWidget;
|
---|
| 65 | class QDockWidgetLayout;
|
---|
| 66 | class QMainWindow;
|
---|
| 67 |
|
---|
| 68 | #ifndef QT_NO_TEXTEDIT
|
---|
| 69 | class QAccessibleTextEdit : public QAccessibleWidgetEx, public QAccessibleTextInterface,
|
---|
| 70 | public QAccessibleEditableTextInterface
|
---|
| 71 | {
|
---|
| 72 | Q_ACCESSIBLE_OBJECT
|
---|
| 73 | public:
|
---|
| 74 | explicit QAccessibleTextEdit(QWidget *o);
|
---|
| 75 |
|
---|
| 76 | QString text(Text t, int child) const;
|
---|
| 77 | void setText(Text t, int control, const QString &text);
|
---|
| 78 | Role role(int child) const;
|
---|
| 79 |
|
---|
| 80 | QVariant invokeMethodEx(QAccessible::Method method, int child, const QVariantList ¶ms);
|
---|
| 81 |
|
---|
| 82 | QRect rect(int child) const;
|
---|
| 83 | int childAt(int x, int y) const;
|
---|
| 84 |
|
---|
| 85 | int childCount() const;
|
---|
| 86 |
|
---|
| 87 | // QAccessibleTextInterface
|
---|
| 88 | void addSelection(int startOffset, int endOffset);
|
---|
| 89 | QString attributes(int offset, int *startOffset, int *endOffset);
|
---|
| 90 | int cursorPosition();
|
---|
| 91 | QRect characterRect(int offset, QAccessible2::CoordinateType coordType);
|
---|
| 92 | int selectionCount();
|
---|
| 93 | int offsetAtPoint(const QPoint &point, QAccessible2::CoordinateType coordType);
|
---|
| 94 | void selection(int selectionIndex, int *startOffset, int *endOffset);
|
---|
| 95 | QString text(int startOffset, int endOffset);
|
---|
| 96 | QString textBeforeOffset (int offset, QAccessible2::BoundaryType boundaryType,
|
---|
| 97 | int *startOffset, int *endOffset);
|
---|
| 98 | QString textAfterOffset(int offset, QAccessible2::BoundaryType boundaryType,
|
---|
| 99 | int *startOffset, int *endOffset);
|
---|
| 100 | QString textAtOffset(int offset, QAccessible2::BoundaryType boundaryType,
|
---|
| 101 | int *startOffset, int *endOffset);
|
---|
| 102 | void removeSelection(int selectionIndex);
|
---|
| 103 | void setCursorPosition(int position);
|
---|
| 104 | void setSelection(int selectionIndex, int startOffset, int endOffset);
|
---|
| 105 | int characterCount();
|
---|
| 106 | void scrollToSubstring(int startIndex, int endIndex);
|
---|
| 107 |
|
---|
| 108 | // QAccessibleEditableTextInterface
|
---|
| 109 | void copyText(int startOffset, int endOffset);
|
---|
| 110 | void deleteText(int startOffset, int endOffset);
|
---|
| 111 | void insertText(int offset, const QString &text);
|
---|
| 112 | void cutText(int startOffset, int endOffset);
|
---|
| 113 | void pasteText(int offset);
|
---|
| 114 | void replaceText(int startOffset, int endOffset, const QString &text);
|
---|
| 115 | void setAttributes(int startOffset, int endOffset, const QString &attributes);
|
---|
| 116 |
|
---|
| 117 | protected:
|
---|
| 118 | QTextEdit *textEdit() const;
|
---|
| 119 |
|
---|
| 120 | private:
|
---|
| 121 | int childOffset;
|
---|
| 122 | };
|
---|
| 123 | #endif // QT_NO_TEXTEDIT
|
---|
| 124 |
|
---|
| 125 | class QAccessibleStackedWidget : public QAccessibleWidgetEx
|
---|
| 126 | {
|
---|
| 127 | Q_ACCESSIBLE_OBJECT
|
---|
| 128 | public:
|
---|
| 129 | explicit QAccessibleStackedWidget(QWidget *widget);
|
---|
| 130 |
|
---|
| 131 | QVariant invokeMethodEx(QAccessible::Method method, int child, const QVariantList ¶ms);
|
---|
| 132 | int childAt(int x, int y) const;
|
---|
| 133 | int childCount() const;
|
---|
| 134 | int indexOfChild(const QAccessibleInterface *child) const;
|
---|
| 135 | int navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const;
|
---|
| 136 |
|
---|
| 137 | protected:
|
---|
| 138 | QStackedWidget *stackedWidget() const;
|
---|
| 139 | };
|
---|
| 140 |
|
---|
| 141 | class QAccessibleToolBox : public QAccessibleWidgetEx
|
---|
| 142 | {
|
---|
| 143 | Q_ACCESSIBLE_OBJECT
|
---|
| 144 | public:
|
---|
| 145 | explicit QAccessibleToolBox(QWidget *widget);
|
---|
| 146 |
|
---|
| 147 | QString text(Text textType, int child) const;
|
---|
| 148 | void setText(Text textType, int child, const QString &text);
|
---|
| 149 | State state(int child) const;
|
---|
| 150 | QVariant invokeMethodEx(QAccessible::Method method, int child, const QVariantList ¶ms);
|
---|
| 151 | int childCount() const;
|
---|
| 152 | int indexOfChild(const QAccessibleInterface *child) const;
|
---|
| 153 | int navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const;
|
---|
| 154 |
|
---|
| 155 | protected:
|
---|
| 156 | QToolBox *toolBox() const;
|
---|
| 157 | };
|
---|
| 158 |
|
---|
| 159 | #ifndef QT_NO_MDIAREA
|
---|
| 160 | class QAccessibleMdiArea : public QAccessibleWidgetEx
|
---|
| 161 | {
|
---|
| 162 | public:
|
---|
| 163 | explicit QAccessibleMdiArea(QWidget *widget);
|
---|
| 164 |
|
---|
| 165 | State state(int child) const;
|
---|
| 166 | QVariant invokeMethodEx(QAccessible::Method method, int child, const QVariantList ¶ms);
|
---|
| 167 | int childCount() const;
|
---|
| 168 | int indexOfChild(const QAccessibleInterface *child) const;
|
---|
| 169 | int navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const;
|
---|
| 170 |
|
---|
| 171 | protected:
|
---|
| 172 | QMdiArea *mdiArea() const;
|
---|
| 173 | };
|
---|
| 174 |
|
---|
| 175 | class QAccessibleMdiSubWindow : public QAccessibleWidgetEx
|
---|
| 176 | {
|
---|
| 177 | public:
|
---|
| 178 | explicit QAccessibleMdiSubWindow(QWidget *widget);
|
---|
| 179 |
|
---|
| 180 | QString text(Text textType, int child) const;
|
---|
| 181 | void setText(Text textType, int child, const QString &text);
|
---|
| 182 | State state(int child) const;
|
---|
| 183 | QVariant invokeMethodEx(QAccessible::Method method, int child, const QVariantList ¶ms);
|
---|
| 184 | int childCount() const;
|
---|
| 185 | int indexOfChild(const QAccessibleInterface *child) const;
|
---|
| 186 | int navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const;
|
---|
| 187 | QRect rect(int child) const;
|
---|
| 188 | int childAt(int x, int y) const;
|
---|
| 189 |
|
---|
| 190 | protected:
|
---|
| 191 | QMdiSubWindow *mdiSubWindow() const;
|
---|
| 192 | };
|
---|
| 193 | #endif // QT_NO_MDIAREA
|
---|
| 194 |
|
---|
| 195 | #ifndef QT_NO_WORKSPACE
|
---|
| 196 | class QAccessibleWorkspace : public QAccessibleWidgetEx
|
---|
| 197 | {
|
---|
| 198 | public:
|
---|
| 199 | explicit QAccessibleWorkspace(QWidget *widget);
|
---|
| 200 |
|
---|
| 201 | State state(int child) const;
|
---|
| 202 | QVariant invokeMethodEx(QAccessible::Method method, int child, const QVariantList ¶ms);
|
---|
| 203 | int childCount() const;
|
---|
| 204 | int indexOfChild(const QAccessibleInterface *child) const;
|
---|
| 205 | int navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const;
|
---|
| 206 |
|
---|
| 207 | protected:
|
---|
| 208 | QWorkspace *workspace() const;
|
---|
| 209 | };
|
---|
| 210 | #endif
|
---|
| 211 |
|
---|
| 212 | class QAccessibleDialogButtonBox : public QAccessibleWidgetEx
|
---|
| 213 | {
|
---|
| 214 | public:
|
---|
| 215 | explicit QAccessibleDialogButtonBox(QWidget *widget);
|
---|
| 216 |
|
---|
| 217 | QVariant invokeMethodEx(QAccessible::Method method, int child, const QVariantList ¶ms);
|
---|
| 218 | };
|
---|
| 219 |
|
---|
| 220 | #ifndef QT_NO_TEXTBROWSER
|
---|
| 221 | class QAccessibleTextBrowser : public QAccessibleTextEdit
|
---|
| 222 | {
|
---|
| 223 | public:
|
---|
| 224 | explicit QAccessibleTextBrowser(QWidget *widget);
|
---|
| 225 |
|
---|
| 226 | Role role(int child) const;
|
---|
| 227 | };
|
---|
| 228 | #endif // QT_NO_TEXTBROWSER
|
---|
| 229 |
|
---|
| 230 | #ifndef QT_NO_CALENDARWIDGET
|
---|
| 231 | class QAccessibleCalendarWidget : public QAccessibleWidgetEx
|
---|
| 232 | {
|
---|
| 233 | public:
|
---|
| 234 | explicit QAccessibleCalendarWidget(QWidget *widget);
|
---|
| 235 |
|
---|
| 236 | QVariant invokeMethodEx(QAccessible::Method method, int child, const QVariantList ¶ms);
|
---|
| 237 | int childCount() const;
|
---|
| 238 | int indexOfChild(const QAccessibleInterface *child) const;
|
---|
| 239 | int navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const;
|
---|
| 240 | QRect rect(int child) const;
|
---|
| 241 | int childAt(int x, int y) const;
|
---|
| 242 |
|
---|
| 243 | protected:
|
---|
| 244 | QCalendarWidget *calendarWidget() const;
|
---|
| 245 |
|
---|
| 246 | private:
|
---|
| 247 | QAbstractItemView *calendarView() const;
|
---|
| 248 | QWidget *navigationBar() const;
|
---|
| 249 | };
|
---|
| 250 | #endif // QT_NO_CALENDARWIDGET
|
---|
| 251 |
|
---|
| 252 | #ifndef QT_NO_DOCKWIDGET
|
---|
| 253 | class QAccessibleDockWidget: public QAccessibleWidgetEx
|
---|
| 254 | {
|
---|
| 255 | public:
|
---|
| 256 | explicit QAccessibleDockWidget(QWidget *widget);
|
---|
| 257 | int navigate(RelationFlag relation, int entry, QAccessibleInterface **iface) const;
|
---|
| 258 | int indexOfChild(const QAccessibleInterface *child) const;
|
---|
| 259 | int childCount() const;
|
---|
| 260 | QRect rect (int child ) const;
|
---|
| 261 | Role role(int child) const;
|
---|
| 262 | State state(int child) const;
|
---|
| 263 | int childAt(int x, int y) const;
|
---|
| 264 |
|
---|
| 265 | QVariant invokeMethodEx(QAccessible::Method method, int child, const QVariantList ¶ms);
|
---|
| 266 | QDockWidget *dockWidget() const;
|
---|
| 267 | };
|
---|
| 268 |
|
---|
| 269 | class QAccessibleTitleBar : public QAccessibleInterface
|
---|
| 270 | {
|
---|
| 271 | public:
|
---|
| 272 | explicit QAccessibleTitleBar(QDockWidget *widget);
|
---|
| 273 | QString actionText(int action, Text t, int child) const;
|
---|
| 274 | bool doAction(int action, int child, const QVariantList& params = QVariantList());
|
---|
| 275 | int userActionCount ( int child) const;
|
---|
| 276 | int navigate(RelationFlag relation, int entry, QAccessibleInterface **iface) const;
|
---|
| 277 | int indexOfChild(const QAccessibleInterface *child) const;
|
---|
| 278 | int childCount() const;
|
---|
| 279 | Relation relationTo(int child, const QAccessibleInterface *other, int otherChild) const;
|
---|
| 280 | void setText(Text t, int child, const QString &text);
|
---|
| 281 | QString text(Text t, int child) const;
|
---|
| 282 | Role role(int child) const;
|
---|
| 283 | QRect rect (int child) const;
|
---|
| 284 | State state(int child) const;
|
---|
| 285 | int childAt(int x, int y) const;
|
---|
| 286 | QObject *object() const;
|
---|
| 287 | bool isValid() const;
|
---|
| 288 |
|
---|
| 289 |
|
---|
| 290 | QPointer<QDockWidget> m_dockWidget;
|
---|
| 291 |
|
---|
| 292 | QDockWidget *dockWidget() const;
|
---|
| 293 | QDockWidgetLayout *dockWidgetLayout() const;
|
---|
| 294 | };
|
---|
| 295 |
|
---|
| 296 | #endif // QT_NO_DOCKWIDGET
|
---|
| 297 |
|
---|
| 298 | #ifndef QT_NO_MAINWINDOW
|
---|
| 299 | class QAccessibleMainWindow : public QAccessibleWidgetEx
|
---|
| 300 | {
|
---|
| 301 | public:
|
---|
| 302 | explicit QAccessibleMainWindow(QWidget *widget);
|
---|
| 303 |
|
---|
| 304 | QVariant invokeMethodEx(QAccessible::Method method, int child, const QVariantList ¶ms);
|
---|
| 305 | int childCount() const;
|
---|
| 306 | int navigate(RelationFlag relation, int entry, QAccessibleInterface **iface) const;
|
---|
| 307 | int indexOfChild(const QAccessibleInterface *iface) const;
|
---|
| 308 | int childAt(int x, int y) const;
|
---|
| 309 | QMainWindow *mainWindow() const;
|
---|
| 310 |
|
---|
| 311 | };
|
---|
| 312 | #endif //QT_NO_MAINWINDOW
|
---|
| 313 |
|
---|
| 314 | #endif // QT_NO_ACCESSIBILITY
|
---|
| 315 |
|
---|
| 316 | QT_END_NAMESPACE
|
---|
| 317 |
|
---|
| 318 | #endif // QACESSIBLEWIDGETS_H
|
---|