10#include "qpa/qplatformaccessibility.h"
11#include <QtGui/private/qaccessiblebridgeutils_p.h>
15#include "QtGui/qaccessible.h"
16#include <QtCore/qmath.h>
17#include <QtCore/private/qjnihelpers_p.h>
18#include <QtCore/QJniObject>
19#include <QtGui/private/qhighdpiscaling_p.h>
21#include <QtCore/QObject>
22#include <QtCore/qpointer.h>
23#include <QtCore/qscopeguard.h>
24#include <QtCore/qvarlengtharray.h>
30using namespace Qt::StringLiterals;
68 if (m_accessibilityContext)
69 m_accessibilityContext->deleteLater();
70 m_accessibilityContext =
new QObject(parent);
73 template <
typename Func,
typename Ret>
77 __android_log_print(ANDROID_LOG_WARN, m_qtTag,
78 "Could not run accessibility call in object context, no valid surface.");
82 QtAndroidPrivate::AndroidDeadlockProtector protector(
83 u"QtAndroidAccessibility::runInObjectContext()"_s);
84 if (!protector.acquire()) {
85 __android_log_print(ANDROID_LOG_WARN, m_qtTag,
86 "Could not run accessibility call in object context, accessing "
87 "main thread could lead to deadlock");
91 if (!QtAndroid::blockEventLoopsWhenSuspended()
92 || QGuiApplication::applicationState() != Qt::ApplicationSuspended) {
93 QMetaObject::invokeMethod(context, func, Qt::BlockingQueuedConnection, retVal);
95 __android_log_print(ANDROID_LOG_WARN, m_qtTag,
96 "Could not run accessibility call in object context, event loop suspended.");
110 if (platformIntegration) {
111 platformIntegration->accessibility()->setActive(active);
113 __android_log_print(ANDROID_LOG_DEBUG, m_qtTag,
114 "Android platform integration is not ready, accessibility activation deferred.");
120 QAccessibleInterface *iface =
nullptr;
121 if (objectId == -1) {
122 QWindow *win =
qApp->focusWindow();
124 iface = win->accessibleRoot();
126 iface = QAccessible::accessibleInterface(objectId);
133 QtAndroid::notifyAccessibilityLocationChange(accessibilityObjectId);
140 const auto parentObjectId = parentId_helper(accessibilityObjectId);
141 QtAndroid::notifyObjectHide(accessibilityObjectId, parentObjectId);
146 const auto parentObjectId = parentId_helper(accessibilityObjectId);
147 QtAndroid::notifyObjectShow(parentObjectId);
152 QtAndroid::notifyObjectFocus(accessibilityObjectId);
159 jstring value = jvalueForAccessibleObject(accessibilityObjectId);
160 QtAndroid::notifyValueChanged(accessibilityObjectId, value);
168 QAccessibleInterface *iface = interfaceFromId(accessibilityObjectId);
169 if (iface && iface->isValid()) {
170 const QString value = descriptionForInterface(iface);
171 QtAndroid::notifyDescriptionOrNameChanged(accessibilityObjectId, value);
177 QtAndroid::notifyScrolledEvent(accessiblityObjectId);
182 QtAndroid::notifyAnnouncementEvent(accessibilityObjectId, message);
187 QAccessibleInterface *iface = interfaceFromId(objectId);
188 if (iface && iface->isValid()) {
189 const int childCount = iface->childCount();
190 QVarLengthArray<jint, 8> ifaceIdArray;
191 ifaceIdArray.reserve(childCount);
192 for (
int i = 0; i < childCount; ++i) {
193 QAccessibleInterface *child = iface->child(i);
194 if (child && child->isValid())
195 ifaceIdArray.append(QAccessible::uniqueId(child));
204 if (m_accessibilityContext) {
205 QVarLengthArray<jint, 8> ifaceIdArray;
206 runInObjectContext(m_accessibilityContext, [objectId]() {
207 return childIdListForAccessibleObject_helper(objectId);
209 jintArray jArray = env->NewIntArray(jsize(ifaceIdArray.count()));
210 env->SetIntArrayRegion(jArray, 0, ifaceIdArray.count(), ifaceIdArray.data());
214 return env->NewIntArray(jsize(0));
219 QAccessibleInterface *iface = interfaceFromId(objectId);
220 if (iface && iface->isValid()) {
221 QAccessibleInterface *parent = iface->parent();
222 if (parent && parent->isValid()) {
223 if (parent->role() == QAccessible::Application)
225 return QAccessible::uniqueId(parent);
234 if (m_accessibilityContext) {
235 runInObjectContext(m_accessibilityContext, [objectId]() {
236 return parentId_helper(objectId);
245 QAccessibleInterface *iface = interfaceFromId(objectId);
246 if (iface && iface->isValid()) {
247 rect = QHighDpi::toNativePixels(iface->rect(), iface->window());
250 if (clip && iface && iface->parent() && iface->parent()->isValid()) {
251 const auto parentRect = QHighDpi::toNativePixels(iface->parent()->rect(), iface->parent()->window());
252 rect = rect.intersected(parentRect);
260 if (m_accessibilityContext) {
261 runInObjectContext(m_accessibilityContext, [objectId]() {
262 return screenRect_helper(objectId);
265 jclass rectClass = env->FindClass(
"android/graphics/Rect");
266 jmethodID ctor = env->GetMethodID(rectClass,
"<init>",
"(IIII)V");
267 jobject jrect = env->NewObject(rectClass, ctor, rect.left(), rect.top(), rect.right(), rect.bottom());
273 QAccessibleInterface *root = interfaceFromId(-1);
274 if (root && root->isValid()) {
275 QPoint pos = QHighDpi::fromNativePixels(QPoint(
int(x),
int(y)), root->window());
277 QAccessibleInterface *child = root->childAt(pos.x(), pos.y());
278 QAccessibleInterface *lastChild =
nullptr;
279 while (child && (child != lastChild)) {
281 child = child->childAt(pos.x(), pos.y());
284 return QAccessible::uniqueId(lastChild);
292 if (m_accessibilityContext) {
293 runInObjectContext(m_accessibilityContext, [x, y]() {
294 return hitTest_helper(x, y);
301 const QString& action)
305 QMetaObject::invokeMethod(
qApp, [actionInterface, action]() {
306 actionInterface->doAction(action);
307 }, Qt::QueuedConnection);
312 QAccessibleInterface *iface = interfaceFromId(objectId);
313 if (!iface || !iface->isValid() || !iface->actionInterface())
316 const auto& actionNames = iface->actionInterface()->actionNames();
318 if (actionNames.contains(QAccessibleActionInterface::pressAction())) {
319 invokeActionOnInterfaceInMainThread(iface->actionInterface(),
320 QAccessibleActionInterface::pressAction());
321 }
else if (actionNames.contains(QAccessibleActionInterface::toggleAction())) {
322 invokeActionOnInterfaceInMainThread(iface->actionInterface(),
323 QAccessibleActionInterface::toggleAction());
332 QAccessibleInterface *iface = interfaceFromId(objectId);
333 if (!iface || !iface->isValid() || !iface->actionInterface())
336 const auto& actionNames = iface->actionInterface()->actionNames();
338 if (actionNames.contains(QAccessibleActionInterface::setFocusAction())) {
339 QAccessibleActionInterface *actionInterface = iface->actionInterface();
341 QMetaObject::invokeMethod(
qApp, [actionInterface]() {
342 auto *inputContext = QAndroidInputContext::androidInputContext();
344 inputContext->setAccessibilityFocusInProgress(
true);
345 const auto resetGuard = qScopeGuard([inputContext] {
347 inputContext->setAccessibilityFocusInProgress(
false);
349 actionInterface->doAction(QAccessibleActionInterface::setFocusAction());
350 }, Qt::QueuedConnection);
359 if (m_accessibilityContext) {
360 runInObjectContext(m_accessibilityContext, [objectId]() {
361 return clickAction_helper(objectId);
370 if (m_accessibilityContext) {
371 runInObjectContext(m_accessibilityContext, [objectId]() {
372 return focusAction_helper(objectId);
380 QAccessibleInterface *iface = interfaceFromId(objectId);
381 if (iface && iface->isValid())
382 return QAccessibleBridgeUtils::performEffectiveAction(iface, actionName);
390 const auto& ids = childIdListForAccessibleObject_helper(objectId);
394 const int firstChildId = ids.first();
395 const QRect oldPosition = screenRect_helper(firstChildId,
false);
397 if (m_accessibilityContext) {
398 runInObjectContext(m_accessibilityContext, [objectId]() {
399 return scroll_helper(objectId, QAccessibleActionInterface::increaseAction());
404 return result && oldPosition != screenRect_helper(firstChildId,
false);
411 const auto& ids = childIdListForAccessibleObject_helper(objectId);
415 const int firstChildId = ids.first();
416 const QRect oldPosition = screenRect_helper(firstChildId,
false);
418 if (m_accessibilityContext) {
419 runInObjectContext(m_accessibilityContext, [objectId]() {
420 return scroll_helper(objectId, QAccessibleActionInterface::decreaseAction());
425 return result && oldPosition != screenRect_helper(firstChildId,
false);
430 QAccessibleInterface *iface = interfaceFromId(objectId);
431 if (!iface || !iface->isValid() || !iface->actionInterface())
434 const auto actionNames = iface->actionInterface()->actionNames();
436 if (actionNames.contains(QAccessibleActionInterface::showOnScreenAction())) {
437 invokeActionOnInterfaceInMainThread(iface->actionInterface(), QAccessibleActionInterface::showOnScreenAction());
446 if (m_accessibilityContext) {
447 runInObjectContext(m_accessibilityContext, [objectId]() {
448 return showOnScreen_helper(objectId);
457 QAccessibleValueInterface *valueIface = iface->valueInterface();
459 const QVariant valueVar = valueIface->currentValue();
460 const auto type = valueVar.typeId();
461 if (type == QMetaType::Double || type == QMetaType::Float) {
467 const double val = valueVar.toDouble();
469 bool stepIsValid =
false;
470 const double step = qAbs(valueIface->minimumStepSize().toDouble(&stepIsValid));
471 if (!stepIsValid || qFuzzyIsNull(step)) {
473 valueStr = qFuzzyIsNull(val) ? u"0"_s : QString::number(val,
'f');
475 const int precision = [](
double s) {
477 while (s < 1. && !qFuzzyCompare(s, 1.)) {
484 const int stop = count + 3;
485 const auto fractional = [](
double v) {
487 std::modf(v + 0.5, &whole);
488 return qAbs(v - whole);
491 while (count < stop && !qFuzzyIsNull(s)) {
493 s = fractional(s * 10);
497 valueStr = qFuzzyIsNull(val / step) ? u"0"_s
498 : QString::number(val,
'f', precision);
501 valueStr = valueVar.toString();
509 QAccessibleInterface *iface = interfaceFromId(objectId);
510 const QString value = textFromValue(iface);
512 jstring jstr = env->NewString((jchar*)value.constData(), (jsize)value.size());
513 if (env.checkAndClearExceptions())
514 __android_log_print(ANDROID_LOG_WARN, m_qtTag,
"Failed to create jstring");
520 case QAccessible::Role::Button:
521 case QAccessible::Role::Link:
524 return QStringLiteral(
"android.widget.ToggleButton");
525 return QStringLiteral(
"android.widget.Button");
527 case QAccessible::Role::CheckBox:
530 return QStringLiteral(
"android.widget.CompoundButton");
531 case QAccessible::Role::Switch:
532 return QStringLiteral(
"android.widget.Switch");
533 case QAccessible::Role::Clock:
534 return QStringLiteral(
"android.widget.TextClock");
535 case QAccessible::Role::ComboBox:
536 return QStringLiteral(
"android.widget.Spinner");
537 case QAccessible::Role::Graphic:
539 return QStringLiteral(
"android.widget.ImageView");
540 case QAccessible::Role::Grouping:
541 return QStringLiteral(
"android.view.ViewGroup");
542 case QAccessible::Role::List:
545 return QStringLiteral(
"android.widget.AbsListView");
546 case QAccessible::Role::MenuItem:
547 return QStringLiteral(
"android.view.MenuItem");
548 case QAccessible::Role::PopupMenu:
549 return QStringLiteral(
"android.widget.PopupMenu");
550 case QAccessible::Role::Separator:
551 return QStringLiteral(
"android.widget.Space");
552 case QAccessible::Role::ToolBar:
553 return QStringLiteral(
"android.view.Toolbar");
554 case QAccessible::Role::Heading: [[fallthrough]];
555 case QAccessible::Role::StaticText:
557 return QStringLiteral(
"android.widget.TextView");
558 case QAccessible::Role::EditableText:
559 return QStringLiteral(
"android.widget.EditText");
560 case QAccessible::Role::RadioButton:
561 return QStringLiteral(
"android.widget.RadioButton");
562 case QAccessible::Role::ProgressBar:
563 return QStringLiteral(
"android.widget.ProgressBar");
564 case QAccessible::Role::SpinBox:
565 return QStringLiteral(
"android.widget.NumberPicker");
566 case QAccessible::Role::WebDocument:
567 return QStringLiteral(
"android.webkit.WebView");
568 case QAccessible::Role::Dialog:
569 return QStringLiteral(
"android.app.AlertDialog");
570 case QAccessible::Role::PageTab:
571 return QStringLiteral(
"android.app.ActionBar.Tab");
572 case QAccessible::Role::PageTabList:
573 return QStringLiteral(
"android.widget.TabWidget");
574 case QAccessible::Role::ScrollBar:
575 return QStringLiteral(
"android.widget.Scroller");
576 case QAccessible::Role::Slider:
577 return QStringLiteral(
"com.google.android.material.slider.Slider");
578 case QAccessible::Role::Table:
581 return QStringLiteral(
"android.widget.GridView");
582 case QAccessible::Role::Pane:
584 return QStringLiteral(
"android.view.ViewGroup");
585 case QAccessible::Role::AlertMessage:
586 case QAccessible::Role::Animation:
587 case QAccessible::Role::Application:
588 case QAccessible::Role::Assistant:
589 case QAccessible::Role::BlockQuote:
590 case QAccessible::Role::Border:
591 case QAccessible::Role::ButtonDropGrid:
592 case QAccessible::Role::ButtonDropDown:
593 case QAccessible::Role::ButtonMenu:
594 case QAccessible::Role::Canvas:
595 case QAccessible::Role::Caret:
596 case QAccessible::Role::Cell:
597 case QAccessible::Role::Chart:
598 case QAccessible::Role::Client:
599 case QAccessible::Role::ColorChooser:
600 case QAccessible::Role::Column:
601 case QAccessible::Role::ColumnHeader:
602 case QAccessible::Role::ComplementaryContent:
603 case QAccessible::Role::Cursor:
604 case QAccessible::Role::Desktop:
605 case QAccessible::Role::Dial:
606 case QAccessible::Role::Document:
607 case QAccessible::Role::Equation:
608 case QAccessible::Role::Footer:
609 case QAccessible::Role::Form:
610 case QAccessible::Role::Grip:
611 case QAccessible::Role::HelpBalloon:
612 case QAccessible::Role::HotkeyField:
613 case QAccessible::Role::Indicator:
614 case QAccessible::Role::LayeredPane:
615 case QAccessible::Role::ListItem:
616 case QAccessible::Role::MenuBar:
617 case QAccessible::Role::NoRole:
618 case QAccessible::Role::Note:
619 case QAccessible::Role::Notification:
620 case QAccessible::Role::Paragraph:
621 case QAccessible::Role::PropertyPage:
622 case QAccessible::Role::Row:
623 case QAccessible::Role::RowHeader:
624 case QAccessible::Role::Section:
625 case QAccessible::Role::Sound:
626 case QAccessible::Role::Splitter:
627 case QAccessible::Role::StatusBar:
628 case QAccessible::Role::Terminal:
629 case QAccessible::Role::TitleBar:
630 case QAccessible::Role::ToolTip:
631 case QAccessible::Role::Tree:
632 case QAccessible::Role::TreeItem:
633 case QAccessible::Role::UserRole:
634 case QAccessible::Role::Whitespace:
635 case QAccessible::Role::Window:
639 return QStringLiteral(
"android.view.TextView");
646 if (iface && iface->isValid()) {
647 bool hasValue =
false;
648 desc = iface->text(QAccessible::Name);
649 const QString descStr = iface->text(QAccessible::Description);
650 if (!descStr.isEmpty()) {
652 desc.append(QStringLiteral(
", "));
653 desc.append(descStr);
655 if (desc.isEmpty()) {
656 desc = iface->text(QAccessible::Value);
657 hasValue = !desc.isEmpty();
659 if (!hasValue && iface->valueInterface()) {
660 const QString valueStr = textFromValue(iface);
661 if (!valueStr.isEmpty()) {
663 desc.append(QChar(QChar::Space));
664 desc.append(valueStr);
673 QAccessibleInterface *iface = interfaceFromId(objectId);
674 return descriptionForInterface(iface);
680 if (m_accessibilityContext) {
681 runInObjectContext(m_accessibilityContext, [objectId]() {
682 return descriptionForAccessibleObject_helper(objectId);
685 return env->NewString((jchar*) desc.constData(), (jsize) desc.size());
690 QAccessibleInterface *iface = interfaceFromId(objectId);
691 if (!iface || !iface->isValid())
694 QAccessibleAttributesInterface *attributesIface = iface->attributesInterface();
695 if (!attributesIface || !attributesIface->attributeKeys().contains(QAccessible::Attribute::Locale))
698 return attributesIface->attributeValue(QAccessible::Attribute::Locale).toLocale().bcp47Name();
704 if (m_accessibilityContext) {
705 runInObjectContext(m_accessibilityContext, [objectId]() {
706 return languageTag_helper(objectId);
709 return env->NewString((jchar*)tag.constData(), (jsize)tag.size());
733 QAccessibleInterface *iface = interfaceFromId(objectId);
734 if (iface && iface->isValid()) {
736 info.state = iface->state();
737 info.role = iface->role();
738 info.actions = QAccessibleBridgeUtils::effectiveActionNames(iface);
739 info.description = descriptionForInterface(iface);
740 info.identifier = QAccessibleBridgeUtils::accessibleId(iface);
741 QAccessibleTextInterface *textIface = iface->textInterface();
742 if (textIface && (textIface->selectionCount() > 0)) {
746 QAccessibleValueInterface *valueInterface = iface->valueInterface();
747 if (valueInterface) {
749 info.minValue = valueInterface->minimumValue();
750 info.maxValue = valueInterface->maximumValue();
751 info.currentValue = valueInterface->currentValue();
752 info.valueStepSize = valueInterface->minimumStepSize();
761 if (m_accessibilityContext) {
762 runInObjectContext(m_accessibilityContext, [objectId]() {
763 return populateNode_helper(objectId);
767 __android_log_print(ANDROID_LOG_WARN, m_qtTag,
"Accessibility: populateNode for Invalid ID");
771 const QString role = classNameForRole(info.role, info.state);
772 jstring jrole = env->NewString((jchar*)role.constData(), (jsize)role.size());
773 env->CallVoidMethod(node, m_setClassNameMethodID, jrole);
775 const bool hasClickableAction =
776 (info.actions.contains(QAccessibleActionInterface::pressAction())
777 || info.actions.contains(QAccessibleActionInterface::toggleAction()))
778 && !(info.role == QAccessible::StaticText || info.role == QAccessible::Heading);
779 const bool hasIncreaseAction =
780 info.actions.contains(QAccessibleActionInterface::increaseAction());
781 const bool hasDecreaseAction =
782 info.actions.contains(QAccessibleActionInterface::decreaseAction());
785 env->CallVoidMethod(node, m_setTextSelectionMethodID, info
.selectionStart,
789 if (info
.hasValue && m_setRangeInfoMethodID) {
790 int valueType = info.currentValue.typeId();
793 case QMetaType::Float:
794 case QMetaType::Double:
802 float min = info.minValue.toFloat();
803 float max = info.maxValue.toFloat();
804 float current = info.currentValue.toFloat();
805 if (info.role == QAccessible::ProgressBar) {
807 current = 100 * (current - min) / (max - min);
812 QJniObject rangeInfo(
"android/view/accessibility/AccessibilityNodeInfo$RangeInfo",
813 "(IFFF)V", rangeType, min, max, current);
815 if (rangeInfo.isValid()) {
816 env->CallVoidMethod(node, m_setRangeInfoMethodID, rangeInfo.object());
820 env->CallVoidMethod(node, m_setCheckableMethodID, (
bool)info.state.checkable);
821 env->CallVoidMethod(node, m_setCheckedMethodID, (
bool)info.state.checked);
822 env->CallVoidMethod(node, m_setEditableMethodID, info.state.editable);
823 env->CallVoidMethod(node, m_setEnabledMethodID, !info.state.disabled);
824 env->CallVoidMethod(node, m_setFocusableMethodID, (
bool)info.state.focusable);
825 env->CallVoidMethod(node, m_setFocusedMethodID, (
bool)info.state.focused);
827 env->CallVoidMethod(node, m_setHeadingMethodID, info.role == QAccessible::Heading);
828 env->CallVoidMethod(node, m_setVisibleToUserMethodID, !info.state.invisible);
829 env->CallVoidMethod(node, m_setScrollableMethodID, hasIncreaseAction || hasDecreaseAction);
830 env->CallVoidMethod(node, m_setClickableMethodID, hasClickableAction || info.role == QAccessible::Link);
833 if (hasClickableAction)
834 env->CallVoidMethod(node, m_addActionMethodID, (
int)0x00000010);
837 if (hasIncreaseAction)
838 env->CallVoidMethod(node, m_addActionMethodID, (
int)0x00001000);
841 if (hasDecreaseAction)
842 env->CallVoidMethod(node, m_addActionMethodID, (
int)0x00002000);
845 jstring jdesc = env->NewString((jchar*)info.description.constData(),
846 (jsize)info.description.size());
848 env->CallVoidMethod(node, m_setContentDescriptionMethodID, jdesc);
850 QJniObject(node).callMethod<
void>(
"setViewIdResourceName", info.identifier);
858 {
"parentId",
"(I)I", (
void*)
parentId},
862 {
"hitTest",
"(FF)I", (
void*)
hitTest},
863 {
"populateNode",
"(ILandroid/view/accessibility/AccessibilityNodeInfo;)Z", (
void*)
populateNode},
871#define GET_AND_CHECK_STATIC_METHOD(VAR, CLASS, METHOD_NAME, METHOD_SIGNATURE)
872 VAR = env->GetMethodID(CLASS, METHOD_NAME, METHOD_SIGNATURE);
874 __android_log_print(ANDROID_LOG_FATAL, QtAndroid::qtTagText(), QtAndroid::methodErrorMsgFmt(), METHOD_NAME, METHOD_SIGNATURE);
878#define CHECK_AND_INIT_STATIC_FIELD(TYPE, VAR, CLASS, FIELD_NAME)
879 if (env.findStaticField<TYPE>(CLASS, FIELD_NAME) == nullptr) {
880 __android_log_print(ANDROID_LOG_FATAL, QtAndroid::qtTagText(),
881 QtAndroid::staticFieldErrorMsgFmt(), FIELD_NAME);
884 VAR = QJniObject::getStaticField<TYPE>(CLASS, FIELD_NAME);
888 if (!env.registerNativeMethods(
"org/qtproject/qt/android/QtNativeAccessibility",
890 __android_log_print(ANDROID_LOG_FATAL,
"Qt A11y",
"RegisterNatives failed");
894 jclass nodeInfoClass = env->FindClass(
"android/view/accessibility/AccessibilityNodeInfo");
900 GET_AND_CHECK_STATIC_METHOD(m_setContentDescriptionMethodID, nodeInfoClass,
"setContentDescription",
"(Ljava/lang/CharSequence;)V");
905 if (QtAndroidPrivate::androidSdkVersion() >= 28) {
912 m_setRangeInfoMethodID, nodeInfoClass,
"setRangeInfo",
913 "(Landroid/view/accessibility/AccessibilityNodeInfo$RangeInfo;)V");
915 jclass rangeInfoClass =
916 env->FindClass(
"android/view/accessibility/AccessibilityNodeInfo$RangeInfo");
920 if (QtAndroidPrivate::androidSdkVersion() >= 36) {
922 "RANGE_TYPE_INDETERMINATE");
static const char m_qtTag[]
#define GET_AND_CHECK_STATIC_METHOD(VAR, CLASS, METHOD_NAME, METHOD_SIGNATURE)
#define CHECK_AND_INIT_STATIC_FIELD(TYPE, VAR, CLASS, FIELD_NAME)
\inmodule QtCore\reentrant
static jmethodID m_setCheckableMethodID
static int RANGE_TYPE_FLOAT
static jboolean showOnScreen(JNIEnv *, jobject, jint objectId)
void notifyDescriptionOrNameChanged(uint accessibilityObjectId)
void notifyObjectShow(uint accessibilityObjectId)
static bool clickAction_helper(int objectId)
static const JNINativeMethod methods[]
void notifyLocationChange(uint accessibilityObjectId)
void runInObjectContext(QObject *context, Func &&func, Ret *retVal)
static jmethodID m_setFocusableMethodID
static jmethodID m_setFocusedMethodID
static int RANGE_TYPE_INDETERMINATE
static jmethodID m_setClassNameMethodID
static jmethodID m_setEditableMethodID
static jboolean scrollForward(JNIEnv *, jobject, jint objectId)
void notifyObjectFocus(uint accessibilityObjectId)
static jboolean scrollBackward(JNIEnv *, jobject, jint objectId)
static QString descriptionForInterface(QAccessibleInterface *iface)
static bool showOnScreen_helper(int objectId)
static int hitTest_helper(float x, float y)
static jmethodID m_setEnabledMethodID
static int RANGE_TYPE_PERCENT
static jstring descriptionForAccessibleObject(JNIEnv *env, jobject, jint objectId)
static bool scroll_helper(int objectId, const QString &actionName)
static QString classNameForRole(QAccessible::Role role, QAccessible::State state)
static jmethodID m_setContentDescriptionMethodID
static bool m_accessibilityActivated
static QString textFromValue(QAccessibleInterface *iface)
void createAccessibilityContextObject(QObject *parent)
static QVarLengthArray< int, 8 > childIdListForAccessibleObject_helper(int objectId)
static jmethodID m_setClickableMethodID
static NodeInfo populateNode_helper(int objectId)
void notifyObjectHide(uint accessibilityObjectId)
static jboolean focusAction(JNIEnv *, jobject, jint objectId)
static QString languageTag_helper(int objectId)
static jmethodID m_setVisibleToUserMethodID
static jmethodID m_setScrollableMethodID
static jint hitTest(JNIEnv *, jobject, jfloat x, jfloat y)
static jmethodID m_setRangeInfoMethodID
static jstring languageTag(JNIEnv *env, jobject, jint objectId)
static jmethodID m_addActionMethodID
static bool focusAction_helper(int objectId)
static jboolean clickAction(JNIEnv *, jobject, jint objectId)
static int RANGE_TYPE_INT
static jmethodID m_setCheckedMethodID
static jstring jvalueForAccessibleObject(int objectId)
static void setActive(JNIEnv *, jobject, jboolean active)
static void invokeActionOnInterfaceInMainThread(QAccessibleActionInterface *actionInterface, const QString &action)
static jmethodID m_setTextSelectionMethodID
bool registerNatives(QJniEnvironment &env)
QAccessibleInterface * interfaceFromId(jint objectId)
void notifyValueChanged(uint accessibilityObjectId)
void notifyAnnouncementEvent(uint accessibilityObjectId, const QString &message)
static int parentId_helper(int objectId)
static QRect screenRect_helper(int objectId, bool clip=true)
static jmethodID m_setHeadingMethodID
static QString descriptionForAccessibleObject_helper(int objectId)
static jint parentId(JNIEnv *, jobject, jint objectId)
static jobject screenRect(JNIEnv *env, jobject, jint objectId)
static jintArray childIdListForAccessibleObject(JNIEnv *env, jobject, jint objectId)
static jboolean populateNode(JNIEnv *env, jobject, jint objectId, jobject node)
void notifyScrolledEvent(uint accessiblityObjectId)
QBasicMutex * platformInterfaceMutex()
QAndroidPlatformIntegration * androidPlatformIntegration()