1 | // Copyright (C) 2016 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QACCESSIBLEOBJECT_H |
5 | #define QACCESSIBLEOBJECT_H |
6 | |
7 | #include <QtGui/qtguiglobal.h> |
8 | #include <QtGui/qaccessible.h> |
9 | |
10 | QT_BEGIN_NAMESPACE |
11 | |
12 | |
13 | #if QT_CONFIG(accessibility) |
14 | |
15 | class QAccessibleObjectPrivate; |
16 | class QObject; |
17 | |
18 | class Q_GUI_EXPORT QAccessibleObject : public QAccessibleInterface |
19 | { |
20 | public: |
21 | explicit QAccessibleObject(QObject *object); |
22 | |
23 | bool isValid() const override; |
24 | QObject *object() const override; |
25 | |
26 | // properties |
27 | QRect rect() const override; |
28 | void setText(QAccessible::Text t, const QString &text) override; |
29 | QAccessibleInterface *childAt(int x, int y) const override; |
30 | |
31 | protected: |
32 | ~QAccessibleObject(); |
33 | |
34 | private: |
35 | QAccessibleObjectPrivate *d; |
36 | Q_DISABLE_COPY(QAccessibleObject) |
37 | }; |
38 | |
39 | class Q_GUI_EXPORT QAccessibleApplication : public QAccessibleObject |
40 | { |
41 | public: |
42 | QAccessibleApplication(); |
43 | |
44 | QWindow *window() const override; |
45 | // relations |
46 | int childCount() const override; |
47 | int indexOfChild(const QAccessibleInterface*) const override; |
48 | QAccessibleInterface *focusChild() const override; |
49 | |
50 | // navigation |
51 | QAccessibleInterface *parent() const override; |
52 | QAccessibleInterface *child(int index) const override; |
53 | |
54 | // properties and state |
55 | QString text(QAccessible::Text t) const override; |
56 | QAccessible::Role role() const override; |
57 | QAccessible::State state() const override; |
58 | }; |
59 | |
60 | #endif // QT_CONFIG(accessibility) |
61 | |
62 | QT_END_NAMESPACE |
63 | |
64 | #endif // QACCESSIBLEOBJECT_H |
65 |