summaryrefslogtreecommitdiffstats
path: root/src/gui/accessible/qaccessible.h
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@nokia.com>2011-11-30 17:07:39 +0100
committerQt by Nokia <qt-info@nokia.com>2011-12-08 08:51:35 +0100
commit1e37a053ed6d52cd2ea662f84c97c718b38367c9 (patch)
treed44140459f45052a20e99ae279d39503359a4307 /src/gui/accessible/qaccessible.h
parent59fb0328392a5fc47e3a013403fe192c215d8aa7 (diff)
Create a class to contain accessibilty enums.
This is needed in order to expose the enums to qml. Do not inherit QAccessible. Change-Id: I220a0ea3add2d790e4fa6e93ce3deda762859e1a Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Diffstat (limited to 'src/gui/accessible/qaccessible.h')
-rw-r--r--src/gui/accessible/qaccessible.h45
1 files changed, 32 insertions, 13 deletions
diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h
index dca398a9f7..6ee1885a3d 100644
--- a/src/gui/accessible/qaccessible.h
+++ b/src/gui/accessible/qaccessible.h
@@ -62,9 +62,16 @@ QT_MODULE(Gui)
class QAccessibleInterface;
class QWindow;
+// We need to inherit QObject to expose the enums to QML.
class Q_GUI_EXPORT QAccessible
+#ifndef qdoc
+ :public QObject
+#endif
{
+ Q_OBJECT
+ Q_ENUMS(Role Event State)
public:
+
enum Event {
SoundPlayed = 0x0001,
Alert = 0x0002,
@@ -141,6 +148,7 @@ public:
AcceleratorChanged = 0x80C0
};
+
enum StateFlag {
Normal = 0x00000000,
Unavailable = 0x00000001,
@@ -152,11 +160,11 @@ public:
ReadOnly = 0x00000040,
HotTracked = 0x00000080,
DefaultButton = 0x00000100,
- // #### Qt5 Expandable
Expanded = 0x00000200,
Collapsed = 0x00000400,
Busy = 0x00000800,
// Floating = 0x00001000,
+ Expandable = 0x00001000,
Marqueed = 0x00002000,
Animated = 0x00004000,
Invisible = 0x00008000,
@@ -180,6 +188,7 @@ public:
};
Q_DECLARE_FLAGS(State, StateFlag)
+
enum Role {
NoRole = 0x00000000,
TitleBar = 0x00000001,
@@ -224,7 +233,10 @@ public:
Graphic = 0x00000028,
StaticText = 0x00000029,
EditableText = 0x0000002A, // Editable, selectable, etc.
- PushButton = 0x0000002B,
+ Button = 0x0000002B,
+#ifndef qdoc
+ PushButton = Button, // deprecated
+#endif
CheckBox = 0x0000002C,
RadioButton = 0x0000002D,
ComboBox = 0x0000002E,
@@ -321,6 +333,12 @@ public:
private:
static UpdateHandler updateHandler;
static RootObjectHandler rootObjectHandler;
+
+ /*! @internal
+ This class is purely a collection of enums and static functions,
+ it is not supposed to be instantiated.
+ */
+ QAccessible() {}
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QAccessible::State)
@@ -338,7 +356,7 @@ class QAccessibleImageInterface;
class QAccessibleTableInterface;
class QAccessibleTableCellInterface;
-class Q_GUI_EXPORT QAccessibleInterface : public QAccessible
+class Q_GUI_EXPORT QAccessibleInterface
{
public:
virtual ~QAccessibleInterface() {}
@@ -348,8 +366,8 @@ public:
virtual QWindow *window() const;
// relations
- virtual Relation relationTo(const QAccessibleInterface *other) const;
- virtual QVector<QPair<QAccessibleInterface*, Relation> > relations() const;
+ virtual QAccessible::Relation relationTo(const QAccessibleInterface *other) const;
+ virtual QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > relations() const;
virtual int childAt(int x, int y) const = 0;
@@ -358,22 +376,23 @@ public:
virtual QAccessibleInterface *child(int index) const = 0;
virtual int childCount() const = 0;
virtual int indexOfChild(const QAccessibleInterface *) const = 0;
- virtual int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const = 0;
+ virtual int navigate(QAccessible::RelationFlag relation, int index, QAccessibleInterface **iface) const = 0;
// properties and state
- virtual QString text(Text t) const = 0;
- virtual void setText(Text t, const QString &text) = 0;
+ virtual QString text(QAccessible::Text t) const = 0;
+ virtual void setText(QAccessible::Text t, const QString &text) = 0;
virtual QRect rect() const = 0;
- virtual Role role() const = 0;
- virtual State state() const = 0;
+ virtual QAccessible::Role role() const = 0;
+ virtual QAccessible::State state() const = 0;
+ // FIXME virtual QSet<QAccessible::State> states() const = 0;
virtual QColor foregroundColor() const;
virtual QColor backgroundColor() const;
- virtual QVariant invokeMethod(Method method, const QVariantList &params = QVariantList());
+ virtual QVariant invokeMethod(QAccessible::Method method, const QVariantList &params = QVariantList());
- inline QSet<Method> supportedMethods()
- { return qvariant_cast<QSet<Method> >(invokeMethod(ListSupportedMethods)); }
+ inline QSet<QAccessible::Method> supportedMethods()
+ { return qvariant_cast<QSet<QAccessible::Method> >(invokeMethod(QAccessible::ListSupportedMethods)); }
inline QAccessibleTextInterface *textInterface()
{ return reinterpret_cast<QAccessibleTextInterface *>(interface_cast(QAccessible::TextInterface)); }