summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-07-27 00:11:20 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-22 18:45:24 +0200
commit3abecf2ee9fc724af571f8c7da4302f7bee9eadb (patch)
tree2d727cd1d04e345a231ab4dcd99af1b9d2003b5b /src/plugins/platforms/android
parent59b6a67b94fab5aa36a01beb0d8665575b678f64 (diff)
Accessibility for Android
This enables both modes for TalkBack, explore-by-touch and the normal swiping mode. It is partially inspired by the BarGraphView example of the Google/Android Eyes-Free project. Note that for any accessibility to work you'll need a device with api level 16 at least. Using reflection we should be able to dynamically pick up the classes if we have the high enough api level. Change-Id: I11b93bead451483782a1711434d45c8f9a35996f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Diffstat (limited to 'src/plugins/platforms/android')
-rw-r--r--src/plugins/platforms/android/src/androidjniaccessibility.cpp260
-rw-r--r--src/plugins/platforms/android/src/androidjniaccessibility.h51
-rw-r--r--src/plugins/platforms/android/src/androidjnimain.cpp4
-rw-r--r--src/plugins/platforms/android/src/qandroidplatformaccessibility.cpp58
-rw-r--r--src/plugins/platforms/android/src/qandroidplatformaccessibility.h61
-rw-r--r--src/plugins/platforms/android/src/qandroidplatformintegration.cpp13
-rw-r--r--src/plugins/platforms/android/src/qandroidplatformintegration.h8
-rw-r--r--src/plugins/platforms/android/src/src.pri4
8 files changed, 458 insertions, 1 deletions
diff --git a/src/plugins/platforms/android/src/androidjniaccessibility.cpp b/src/plugins/platforms/android/src/androidjniaccessibility.cpp
new file mode 100644
index 0000000000..07f3371e72
--- /dev/null
+++ b/src/plugins/platforms/android/src/androidjniaccessibility.cpp
@@ -0,0 +1,260 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "androidjniaccessibility.h"
+#include "androidjnimain.h"
+#include "qandroidplatformintegration.h"
+#include "qpa/qplatformaccessibility.h"
+#include "qguiapplication.h"
+#include "qwindow.h"
+#include "qrect.h"
+#include "private/qaccessible2_p.h"
+
+#include "qdebug.h"
+
+static const char m_qtTag[] = "QtA11y";
+static const char m_classErrorMsg[] = "Can't find class \"%s\"";
+static const char m_methodErrorMsg[] = "Can't find method \"%s%s\"";
+
+namespace QtAndroidAccessibility
+{
+ static void setActive(JNIEnv */*env*/, jobject /*thiz*/, jboolean active)
+ {
+ QAndroidPlatformIntegration *platformIntegration = QtAndroid::androidPlatformIntegration();
+ if (platformIntegration)
+ platformIntegration->accessibility()->setActive(active);
+ else
+ __android_log_print(ANDROID_LOG_WARN, m_qtTag, "Could not activate platform accessibility.");
+ }
+
+ QAccessibleInterface *interfaceFromId(jint objectId)
+ {
+ QAccessibleInterface *iface = 0;
+ if (objectId == -1) {
+ QWindow *win = qApp->focusWindow();
+ if (win)
+ iface = win->accessibleRoot();
+ } else {
+ iface = QAccessible::accessibleInterface(objectId);
+ }
+ return iface;
+ }
+
+ static jintArray childIdListForAccessibleObject(JNIEnv *env, jobject /*thiz*/, jint objectId)
+ {
+ QAccessibleInterface *iface = interfaceFromId(objectId);
+ if (iface) {
+ jintArray jArray = env->NewIntArray(jsize(iface->childCount()));
+ for (int i = 0; i < iface->childCount(); ++i) {
+ QAccessibleInterface *child = iface->child(i);
+ if (child) {
+ QAccessible::Id ifaceId = QAccessible::uniqueId(child);
+ jint jid = ifaceId;
+ env->SetIntArrayRegion(jArray, i, 1, &jid);
+ }
+ }
+ return jArray;
+ }
+
+ return env->NewIntArray(jsize(0));
+ }
+
+ static jint parentId(JNIEnv */*env*/, jobject /*thiz*/, jint objectId)
+ {
+ QAccessibleInterface *iface = interfaceFromId(objectId);
+ if (iface) {
+ QAccessibleInterface *parent = iface->parent();
+ if (parent) {
+ if (parent->role() == QAccessible::Application)
+ return -1;
+ return QAccessible::uniqueId(parent);
+ }
+ }
+ return -1;
+ }
+
+ static jobject screenRect(JNIEnv *env, jobject /*thiz*/, jint objectId)
+ {
+ QRect rect;
+ QAccessibleInterface *iface = interfaceFromId(objectId);
+ if (iface && iface->isValid()) {
+ rect = iface->rect();
+ }
+
+ jclass rectClass = env->FindClass("android/graphics/Rect");
+ jmethodID ctor = env->GetMethodID(rectClass, "<init>", "(IIII)V");
+ jobject jrect = env->NewObject(rectClass, ctor, rect.left(), rect.top(), rect.right(), rect.bottom());
+ return jrect;
+ }
+
+ static jint hitTest(JNIEnv */*env*/, jobject /*thiz*/, jfloat x, jfloat y)
+ {
+ QAccessibleInterface *root = interfaceFromId(-1);
+ if (root) {
+ QAccessibleInterface *child = root->childAt((int)x, (int)y);
+ QAccessibleInterface *lastChild = 0;
+ while (child && (child != lastChild)) {
+ lastChild = child;
+ child = child->childAt((int)x, (int)y);
+ }
+ if (lastChild)
+ return QAccessible::uniqueId(lastChild);
+ }
+ return -1;
+ }
+
+ static jboolean clickAction(JNIEnv */*env*/, jobject /*thiz*/, jint objectId)
+ {
+// qDebug() << "A11Y: CLICK: " << objectId;
+ QAccessibleInterface *iface = interfaceFromId(objectId);
+ if (iface && iface->actionInterface()) {
+ if (iface->actionInterface()->actionNames().contains(QAccessibleActionInterface::pressAction()))
+ iface->actionInterface()->doAction(QAccessibleActionInterface::pressAction());
+ else
+ iface->actionInterface()->doAction(QAccessibleActionInterface::toggleAction());
+ }
+ return false;
+ }
+
+
+#define FIND_AND_CHECK_CLASS(CLASS_NAME) \
+clazz = env->FindClass(CLASS_NAME); \
+if (!clazz) { \
+ __android_log_print(ANDROID_LOG_FATAL, m_qtTag, m_classErrorMsg, CLASS_NAME); \
+ return JNI_FALSE; \
+}
+
+ //__android_log_print(ANDROID_LOG_FATAL, m_qtTag, m_methodErrorMsg, METHOD_NAME, METHOD_SIGNATURE);
+
+#define CALL_METHOD(OBJECT, METHOD_NAME, METHOD_SIGNATURE, VALUE) \
+{ \
+ jclass clazz = env->GetObjectClass(OBJECT); \
+ jmethodID method = env->GetMethodID(clazz, METHOD_NAME, METHOD_SIGNATURE); \
+ if (!method) { \
+ __android_log_print(ANDROID_LOG_WARN, m_qtTag, m_methodErrorMsg, METHOD_NAME, METHOD_SIGNATURE); \
+ return; \
+ } \
+ env->CallVoidMethod(OBJECT, method, VALUE); \
+}
+
+
+ static jstring descriptionForAccessibleObject(JNIEnv *env, jobject /*thiz*/, jint objectId)
+ {
+ QString desc;
+ QAccessibleInterface *iface = interfaceFromId(objectId);
+ if (iface && iface->isValid()) {
+ desc = iface->text(QAccessible::Name);
+ if (desc.isEmpty())
+ desc = iface->text(QAccessible::Description);
+
+ desc += QChar(' ') + QString::fromUtf8(qAccessibleRoleString(iface->role()));
+ }
+
+ jstring jdesc = env->NewString((jchar*) desc.constData(), (jsize) desc.size());
+ return jdesc;
+ }
+
+ static void populateNode(JNIEnv *env, jobject /*thiz*/, jint objectId, jobject node)
+ {
+ QAccessibleInterface *iface = interfaceFromId(objectId);
+ if (!iface || !iface->isValid()) {
+ __android_log_print(ANDROID_LOG_WARN, m_qtTag, "Accessibility: populateNode for Invalid ID");
+ return;
+ }
+ QAccessible::State state = iface->state();
+
+ QString desc = iface->text(QAccessible::Name);
+ if (desc.isEmpty())
+ desc = iface->text(QAccessible::Description);
+ if ((iface->role() != QAccessible::NoRole) &&
+ (iface->role() != QAccessible::Client) &&
+ (iface->role() != QAccessible::Pane)) {
+ desc += QChar(' ') + QString::fromUtf8(qAccessibleRoleString(iface->role()));
+ }
+
+ CALL_METHOD(node, "setEnabled", "(Z)V", !state.disabled)
+ //CALL_METHOD(node, "setFocusable", "(Z)V", state.focusable)
+ CALL_METHOD(node, "setFocusable", "(Z)V", true)
+ //CALL_METHOD(node, "setFocused", "(Z)V", state.focused)
+ CALL_METHOD(node, "setCheckable", "(Z)V", state.checkable)
+ CALL_METHOD(node, "setChecked", "(Z)V", state.checked)
+ CALL_METHOD(node, "setVisibleToUser", "(Z)V", !state.invisible)
+
+ if (iface->actionInterface()) {
+ QStringList actions = iface->actionInterface()->actionNames();
+ bool clickable = actions.contains(QAccessibleActionInterface::pressAction());
+ bool toggle = actions.contains(QAccessibleActionInterface::toggleAction());
+ if (clickable || toggle) {
+ CALL_METHOD(node, "setClickable", "(Z)V", clickable)
+ CALL_METHOD(node, "addAction", "(I)V", 16) // ACTION_CLICK defined in AccessibilityNodeInfo
+ }
+ }
+
+ jstring jdesc = env->NewString((jchar*) desc.constData(), (jsize) desc.size());
+ //CALL_METHOD(node, "setText", "(Ljava/lang/CharSequence;)V", jdesc)
+ CALL_METHOD(node, "setContentDescription", "(Ljava/lang/CharSequence;)V", jdesc)
+ }
+
+ static JNINativeMethod methods[] = {
+ {"setActive","(Z)V",(void*)setActive},
+ {"childIdListForAccessibleObject", "(I)[I", (jintArray)childIdListForAccessibleObject},
+ {"parentId", "(I)I", (void*)parentId},
+ {"descriptionForAccessibleObject", "(I)Ljava/lang/String;", (jstring)descriptionForAccessibleObject},
+ {"screenRect", "(I)Landroid/graphics/Rect;", (jobject)screenRect},
+ {"hitTest", "(FF)I", (void*)hitTest},
+ {"populateNode", "(ILandroid/view/accessibility/AccessibilityNodeInfo;)V", (void*)populateNode},
+ {"clickAction", "(I)Z", (void*)clickAction},
+ };
+
+ bool registerNatives(JNIEnv *env)
+ {
+ jclass clazz;
+ FIND_AND_CHECK_CLASS("org/qtproject/qt5/android/accessibility/QtNativeAccessibility");
+ jclass appClass = static_cast<jclass>(env->NewGlobalRef(clazz));
+
+ if (env->RegisterNatives(appClass, methods, sizeof(methods) / sizeof(methods[0])) < 0) {
+ __android_log_print(ANDROID_LOG_FATAL,"Qt", "RegisterNatives failed");
+ return false;
+ }
+
+ return true;
+ }
+}
diff --git a/src/plugins/platforms/android/src/androidjniaccessibility.h b/src/plugins/platforms/android/src/androidjniaccessibility.h
new file mode 100644
index 0000000000..e708138c33
--- /dev/null
+++ b/src/plugins/platforms/android/src/androidjniaccessibility.h
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef ANDROIDJNIACCESSIBILITY_H
+#define ANDROIDJNIACCESSIBILITY_H
+#include <jni.h>
+
+namespace QtAndroidAccessibility
+{
+ bool registerNatives(JNIEnv *env);
+}
+
+#endif // ANDROIDJNIINPUT_H
diff --git a/src/plugins/platforms/android/src/androidjnimain.cpp b/src/plugins/platforms/android/src/androidjnimain.cpp
index 162a8aa977..8282b3b558 100644
--- a/src/plugins/platforms/android/src/androidjnimain.cpp
+++ b/src/plugins/platforms/android/src/androidjnimain.cpp
@@ -55,6 +55,7 @@
#include <stdlib.h>
#include "androidjnimain.h"
+#include "androidjniaccessibility.h"
#include "androidjniinput.h"
#include "androidjniclipboard.h"
#include "androidjnimenu.h"
@@ -793,7 +794,8 @@ Q_DECL_EXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void */*reserved*/)
if (!registerNatives(env)
|| !QtAndroidInput::registerNatives(env)
|| !QtAndroidClipboard::registerNatives(env)
- || !QtAndroidMenu::registerNatives(env)) {
+ || !QtAndroidMenu::registerNatives(env)
+ || !QtAndroidAccessibility::registerNatives(env)) {
__android_log_print(ANDROID_LOG_FATAL, "Qt", "registerNatives failed");
return -1;
}
diff --git a/src/plugins/platforms/android/src/qandroidplatformaccessibility.cpp b/src/plugins/platforms/android/src/qandroidplatformaccessibility.cpp
new file mode 100644
index 0000000000..229368345b
--- /dev/null
+++ b/src/plugins/platforms/android/src/qandroidplatformaccessibility.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include "qandroidplatformaccessibility.h"
+
+QT_BEGIN_NAMESPACE
+
+QAndroidPlatformAccessibility::QAndroidPlatformAccessibility()
+{}
+
+QAndroidPlatformAccessibility::~QAndroidPlatformAccessibility()
+{}
+
+void QAndroidPlatformAccessibility::notifyAccessibilityUpdate(QAccessibleEvent */*event*/)
+{
+ // FIXME send events
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/android/src/qandroidplatformaccessibility.h b/src/plugins/platforms/android/src/qandroidplatformaccessibility.h
new file mode 100644
index 0000000000..1b87f11919
--- /dev/null
+++ b/src/plugins/platforms/android/src/qandroidplatformaccessibility.h
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#ifndef QANDROIDPLATFORMACCESSIBILITY_H
+#define QANDROIDPLATFORMACCESSIBILITY_H
+
+#include <qpa/qplatformaccessibility.h>
+
+QT_BEGIN_NAMESPACE
+
+class QAndroidPlatformAccessibility: public QPlatformAccessibility
+{
+public:
+ QAndroidPlatformAccessibility();
+ ~QAndroidPlatformAccessibility();
+
+ virtual void notifyAccessibilityUpdate(QAccessibleEvent *event);
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp
index 5ef0998a49..3e7b046edb 100644
--- a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp
+++ b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp
@@ -50,6 +50,7 @@
#include "qandroidplatformservices.h"
#include "qandroidplatformfontdatabase.h"
#include "qandroidplatformclipboard.h"
+#include "qandroidplatformaccessibility.h"
#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
#ifndef ANDROID_PLUGIN_OPENGL
@@ -87,6 +88,9 @@ void *QAndroidPlatformNativeInterface::nativeResourceForIntegration(const QByteA
QAndroidPlatformIntegration::QAndroidPlatformIntegration(const QStringList &paramList)
: m_touchDevice(0)
+#ifndef QT_NO_ACCESSIBILITY
+ , m_accessibility(0)
+#endif
{
Q_UNUSED(paramList);
@@ -259,6 +263,15 @@ void QAndroidPlatformIntegration::setDefaultDesktopSize(int gw, int gh)
m_defaultGeometryHeight = gh;
}
+#ifndef QT_NO_ACCESSIBILITY
+QPlatformAccessibility *QAndroidPlatformIntegration::accessibility() const
+{
+ if (!m_accessibility)
+ m_accessibility = new QAndroidPlatformAccessibility();
+ return m_accessibility;
+}
+#endif
+
#ifndef ANDROID_PLUGIN_OPENGL
void QAndroidPlatformIntegration::setDesktopSize(int width, int height)
diff --git a/src/plugins/platforms/android/src/qandroidplatformintegration.h b/src/plugins/platforms/android/src/qandroidplatformintegration.h
index 346d0c0953..83d7028665 100644
--- a/src/plugins/platforms/android/src/qandroidplatformintegration.h
+++ b/src/plugins/platforms/android/src/qandroidplatformintegration.h
@@ -61,6 +61,7 @@ QT_BEGIN_NAMESPACE
class QDesktopWidget;
class QAndroidPlatformServices;
class QAndroidSystemLocale;
+class QPlatformAccessibility;
#ifdef ANDROID_PLUGIN_OPENGL
class QAndroidOpenGLPlatformWindow;
@@ -113,6 +114,10 @@ public:
QPlatformNativeInterface *nativeInterface() const;
QPlatformServices *services() const;
+#ifndef QT_NO_ACCESSIBILITY
+ virtual QPlatformAccessibility *accessibility() const;
+#endif
+
QVariant styleHint(StyleHint hint) const;
QStringList themeNames() const;
@@ -156,6 +161,9 @@ private:
QAndroidPlatformServices *m_androidPlatformServices;
QPlatformClipboard *m_androidPlatformClipboard;
QAndroidSystemLocale *m_androidSystemLocale;
+#ifndef QT_NO_ACCESSIBILITY
+ mutable QPlatformAccessibility *m_accessibility;
+#endif
mutable QAndroidInputContext m_platformInputContext;
};
diff --git a/src/plugins/platforms/android/src/src.pri b/src/plugins/platforms/android/src/src.pri
index 0fd9ace1fc..6cc41c3e68 100644
--- a/src/plugins/platforms/android/src/src.pri
+++ b/src/plugins/platforms/android/src/src.pri
@@ -11,6 +11,7 @@ INCLUDEPATH += $$PWD/../../../../3rdparty/android/src
SOURCES += $$PWD/androidplatformplugin.cpp \
$$PWD/androidjnimain.cpp \
+ $$PWD/androidjniaccessibility.cpp \
$$PWD/androidjniinput.cpp \
$$PWD/androidjnimenu.cpp \
$$PWD/androidjniclipboard.cpp \
@@ -18,6 +19,7 @@ SOURCES += $$PWD/androidplatformplugin.cpp \
$$PWD/qandroidplatformservices.cpp \
$$PWD/qandroidassetsfileenginehandler.cpp \
$$PWD/qandroidinputcontext.cpp \
+ $$PWD/qandroidplatformaccessibility.cpp \
$$PWD/qandroidplatformfontdatabase.cpp \
$$PWD/qandroidplatformclipboard.cpp \
$$PWD/qandroidplatformtheme.cpp \
@@ -29,12 +31,14 @@ SOURCES += $$PWD/androidplatformplugin.cpp \
HEADERS += $$PWD/qandroidplatformintegration.h \
$$PWD/androidjnimain.h \
+ $$PWD/androidjniaccessibility.h \
$$PWD/androidjniinput.h \
$$PWD/androidjnimenu.h \
$$PWD/androidjniclipboard.h \
$$PWD/qandroidplatformservices.h \
$$PWD/qandroidassetsfileenginehandler.h \
$$PWD/qandroidinputcontext.h \
+ $$PWD/qandroidplatformaccessibility.h \
$$PWD/qandroidplatformfontdatabase.h \
$$PWD/qandroidplatformclipboard.h \
$$PWD/qandroidplatformtheme.h \