diff options
author | Frederik Gladhorn <frederik.gladhorn@nokia.com> | 2011-10-06 14:54:49 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-19 19:25:42 +0200 |
commit | 4dc25c1f2995a5e02da47f0f6f3522af9eb6f78c (patch) | |
tree | 86391ff6c57ed46295df684a4c87ba9db0b73263 /src/gui/accessible/qaccessibleobject.cpp | |
parent | 663cd1771883e1e7ac9c1a0dc8b797601b59ba17 (diff) |
Refactor QAccessibleActionInterface.
Some refinements done by Jan-Arve Sæther.
Change-Id: I99195b3c7273316cfa9c46e451924bbcfddd11a9
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
Diffstat (limited to 'src/gui/accessible/qaccessibleobject.cpp')
-rw-r--r-- | src/gui/accessible/qaccessibleobject.cpp | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/src/gui/accessible/qaccessibleobject.cpp b/src/gui/accessible/qaccessibleobject.cpp index f7d6c3c72b..da68579809 100644 --- a/src/gui/accessible/qaccessibleobject.cpp +++ b/src/gui/accessible/qaccessibleobject.cpp @@ -154,44 +154,6 @@ void QAccessibleObject::setText(Text, int, const QString &) { } -/*! \reimp */ -int QAccessibleObject::userActionCount(int) const -{ - return 0; -} - -/*! \reimp */ -bool QAccessibleObject::doAction(int, int, const QVariantList &) -{ - return false; -} - -static const char * const action_text[][5] = -{ - // Name, Description, Value, Help, Accelerator - { "Press", "", "", "", "Space" }, - { "SetFocus", "Passes focus to this widget", "", "", "" }, - { "Increase", "", "", "", "" }, - { "Decrease", "", "", "", "" }, - { "Accept", "", "", "", "" }, - { "Cancel", "", "", "", "" }, - { "Select", "", "", "", "" }, - { "ClearSelection", "", "", "", "" }, - { "RemoveSelection", "", "", "", "" }, - { "ExtendSelection", "", "", "", "" }, - { "AddToSelection", "", "", "", "" } -}; - -/*! \reimp */ -QString QAccessibleObject::actionText(int action, Text t, int child) const -{ - if (child || action > FirstStandardAction || action < LastStandardAction || t > Accelerator) - return QString(); - - return QString::fromLatin1(action_text[-(action - FirstStandardAction)][t]); -} - - /*! \class QAccessibleApplication \brief The QAccessibleApplication class implements the QAccessibleInterface for QApplication. @@ -353,45 +315,6 @@ QAccessible::State QAccessibleApplication::state(int) const return QGuiApplication::activeWindow() ? Focused : Normal; } -/*! \reimp */ -int QAccessibleApplication::userActionCount(int) const -{ - return 1; -} - -/*! \reimp */ -bool QAccessibleApplication::doAction(int action, int child, const QVariantList ¶m) -{ - //###Move to IA2 action interface at some point to get rid of the ambiguity. - /* //### what is action == 0 and action == 1 ????? - if (action == 0 || action == 1) { - QWindow *w = 0; - w = QGuiApplication::activeWindow(); - if (!w) - w = topLevelWindows().at(0); - if (!w) - return false; - w->requestActivateWindow(); - return true; - } - */ - return QAccessibleObject::doAction(action, child, param); -} - -/*! \reimp */ -QString QAccessibleApplication::actionText(int action, Text text, int child) const -{ - QString str; - if ((action == 0 || action == 1) && !child) switch (text) { - case Name: - return QGuiApplication::tr("Activate"); - case Description: - return QGuiApplication::tr("Activates the program's main window"); - default: - break; - } - return QAccessibleObject::actionText(action, text, child); -} QT_END_NAMESPACE |