diff options
author | Harald Fernengel <harald.fernengel@nokia.com> | 2009-10-20 15:45:48 (GMT) |
---|---|---|
committer | Harald Fernengel <harald.fernengel@nokia.com> | 2009-10-20 15:48:26 (GMT) |
commit | 339b5b04a98ad3a5569180b0a1a000e82e985867 (patch) | |
tree | 824182963f5d27486726a6d2b8f47f7cd6ddaf45 /src/plugins/accessible/widgets/simplewidgets.cpp | |
parent | 77f2319ab80be40268da689d5bc4726257ddd7ab (diff) | |
download | Qt-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/plugins/accessible/widgets/simplewidgets.cpp')
-rw-r--r-- | src/plugins/accessible/widgets/simplewidgets.cpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/plugins/accessible/widgets/simplewidgets.cpp b/src/plugins/accessible/widgets/simplewidgets.cpp index 89482bb..aa51759 100644 --- a/src/plugins/accessible/widgets/simplewidgets.cpp +++ b/src/plugins/accessible/widgets/simplewidgets.cpp @@ -209,6 +209,62 @@ QAccessible::State QAccessibleButton::state(int child) const return state; } +int QAccessibleButton::actionCount() +{ + return 1; +} + +void QAccessibleButton::doAction(int actionIndex) +{ + switch (actionIndex) { + case 0: + button()->click(); + break; + } +} + +QString QAccessibleButton::description(int actionIndex) +{ + switch (actionIndex) { + case 0: + return QLatin1String("Clicks the button."); + default: + return QString(); + } +} + +QString QAccessibleButton::name(int actionIndex) +{ + switch (actionIndex) { + case 0: + return QLatin1String("Press"); + default: + return QString(); + } +} + +QString QAccessibleButton::localizedName(int actionIndex) +{ + switch (actionIndex) { + case 0: + return tr("Press"); + default: + return QString(); + } +} + +QStringList QAccessibleButton::keyBindings(int actionIndex) +{ + switch (actionIndex) { +#ifdef QT_NO_SHORTCUT + case 0: + return button()->shortcut().toString(); +#endif + default: + return QStringList(); + } +} + #ifndef QT_NO_TOOLBUTTON /*! \class QAccessibleToolButton |