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 QACCESSIBLEWIDGET_H |
5 | #define QACCESSIBLEWIDGET_H |
6 | |
7 | #include <QtWidgets/qtwidgetsglobal.h> |
8 | #include <QtGui/qaccessibleobject.h> |
9 | |
10 | QT_BEGIN_NAMESPACE |
11 | |
12 | |
13 | #if QT_CONFIG(accessibility) |
14 | |
15 | class QAccessibleWidgetPrivate; |
16 | |
17 | class Q_WIDGETS_EXPORT QAccessibleWidget : public QAccessibleObject, public QAccessibleActionInterface |
18 | { |
19 | public: |
20 | explicit QAccessibleWidget(QWidget *o, QAccessible::Role r = QAccessible::Client, const QString& name = QString()); |
21 | bool isValid() const override; |
22 | |
23 | QWindow *window() const override; |
24 | int childCount() const override; |
25 | int indexOfChild(const QAccessibleInterface *child) const override; |
26 | QList<QPair<QAccessibleInterface *, QAccessible::Relation>> |
27 | relations(QAccessible::Relation match = QAccessible::AllRelations) const override; |
28 | QAccessibleInterface *focusChild() const override; |
29 | |
30 | QRect rect() const override; |
31 | |
32 | QAccessibleInterface *parent() const override; |
33 | QAccessibleInterface *child(int index) const override; |
34 | |
35 | QString text(QAccessible::Text t) const override; |
36 | QAccessible::Role role() const override; |
37 | QAccessible::State state() const override; |
38 | |
39 | QColor foregroundColor() const override; |
40 | QColor backgroundColor() const override; |
41 | |
42 | void *interface_cast(QAccessible::InterfaceType t) override; |
43 | |
44 | // QAccessibleActionInterface |
45 | QStringList actionNames() const override; |
46 | void doAction(const QString &actionName) override; |
47 | QStringList keyBindingsForAction(const QString &actionName) const override; |
48 | protected: |
49 | ~QAccessibleWidget(); |
50 | QWidget *widget() const; |
51 | QObject *parentObject() const; |
52 | |
53 | void addControllingSignal(const QString &signal); |
54 | |
55 | private: |
56 | QAccessibleWidgetPrivate *d; |
57 | Q_DISABLE_COPY(QAccessibleWidget) |
58 | }; |
59 | |
60 | |
61 | #endif // QT_CONFIG(accessibility) |
62 | |
63 | QT_END_NAMESPACE |
64 | |
65 | #endif // QACCESSIBLEWIDGET_H |
66 |