summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorHarald Fernengel <harald.fernengel@nokia.com>2009-10-20 15:45:48 (GMT)
committerHarald Fernengel <harald.fernengel@nokia.com>2009-10-20 15:48:26 (GMT)
commit339b5b04a98ad3a5569180b0a1a000e82e985867 (patch)
tree824182963f5d27486726a6d2b8f47f7cd6ddaf45 /src/gui
parent77f2319ab80be40268da689d5bc4726257ddd7ab (diff)
downloadQt-339b5b04a98ad3a5569180b0a1a000e82e985867.zip
Qt-339b5b04a98ad3a5569180b0a1a000e82e985867.tar.gz
Qt-339b5b04a98ad3a5569180b0a1a000e82e985867.tar.bz2
Introduce the QAccessibleActionInterface
with a sample implementation for QAccessibleButton. Not implemented for all widgets yet (API is preliminary). Patch has been in the accessibility-fixes branch of qt-maemo for quite a while now without complains, thus no reviewer.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/accessible/qaccessible.h7
-rw-r--r--src/gui/accessible/qaccessible2.cpp12
-rw-r--r--src/gui/accessible/qaccessible2.h16
3 files changed, 34 insertions, 1 deletions
diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h
index 96fe91c..8f6d9d9 100644
--- a/src/gui/accessible/qaccessible.h
+++ b/src/gui/accessible/qaccessible.h
@@ -310,7 +310,8 @@ namespace QAccessible2
TextInterface,
EditableTextInterface,
ValueInterface,
- TableInterface
+ TableInterface,
+ ActionInterface
};
}
@@ -319,6 +320,7 @@ class QAccessibleTextInterface;
class QAccessibleEditableTextInterface;
class QAccessibleValueInterface;
class QAccessibleTableInterface;
+class QAccessibleActionInterface;
class Q_GUI_EXPORT QAccessibleInterface : public QAccessible
{
@@ -376,6 +378,9 @@ public:
inline QAccessibleTableInterface *tableInterface()
{ return reinterpret_cast<QAccessibleTableInterface *>(cast_helper(QAccessible2::TableInterface)); }
+ inline QAccessibleActionInterface *actionInterface()
+ { return reinterpret_cast<QAccessibleActionInterface *>(cast_helper(QAccessible2::ActionInterface)); }
+
private:
QAccessible2Interface *cast_helper(QAccessible2::InterfaceType);
};
diff --git a/src/gui/accessible/qaccessible2.cpp b/src/gui/accessible/qaccessible2.cpp
index f731962..0867368 100644
--- a/src/gui/accessible/qaccessible2.cpp
+++ b/src/gui/accessible/qaccessible2.cpp
@@ -108,6 +108,18 @@ QT_BEGIN_NAMESPACE
\link http://www.linux-foundation.org/en/Accessibility/IAccessible2 IAccessible2 Specification \endlink
*/
+/*!
+ \class QAccessibleActionInterface
+ \ingroup accessibility
+ \internal
+ \preliminary
+
+ \brief The QAccessibleActionInterface class implements support for
+ the IAccessibleAction interface.
+
+ \link http://www.linux-foundation.org/en/Accessibility/IAccessible2 IAccessible2 Specification \endlink
+*/
+
QAccessibleSimpleEditableTextInterface::QAccessibleSimpleEditableTextInterface(
QAccessibleInterface *accessibleInterface)
: iface(accessibleInterface)
diff --git a/src/gui/accessible/qaccessible2.h b/src/gui/accessible/qaccessible2.h
index 3281509..435c640 100644
--- a/src/gui/accessible/qaccessible2.h
+++ b/src/gui/accessible/qaccessible2.h
@@ -81,6 +81,7 @@ inline QAccessible2Interface *qAccessibleValueCastHelper() { return 0; }
inline QAccessible2Interface *qAccessibleTextCastHelper() { return 0; }
inline QAccessible2Interface *qAccessibleEditableTextCastHelper() { return 0; }
inline QAccessible2Interface *qAccessibleTableCastHelper() { return 0; }
+inline QAccessible2Interface *qAccessibleActionCastHelper() { return 0; }
#define Q_ACCESSIBLE_OBJECT \
public: \
@@ -95,6 +96,8 @@ inline QAccessible2Interface *qAccessibleTableCastHelper() { return 0; }
return qAccessibleValueCastHelper(); \
case QAccessible2::TableInterface: \
return qAccessibleTableCastHelper(); \
+ case QAccessible2::ActionInterface: \
+ return qAccessibleActionCastHelper(); \
} \
return 0; \
} \
@@ -208,6 +211,19 @@ public:
int *columnSpan, bool *isSelected) = 0;
};
+class Q_GUI_EXPORT QAccessibleActionInterface : public QAccessible2Interface
+{
+public:
+ inline QAccessible2Interface *qAccessibleActionCastHelper() { return this; }
+
+ virtual int actionCount() = 0;
+ virtual void doAction(int actionIndex) = 0;
+ virtual QString description(int actionIndex) = 0;
+ virtual QString name(int actionIndex) = 0;
+ virtual QString localizedName(int actionIndex) = 0;
+ virtual QStringList keyBindings(int actionIndex) = 0;
+};
+
#endif // QT_NO_ACCESSIBILITY
QT_END_NAMESPACE