Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QtAndroidAccessibility Namespace Reference

Classes

struct  NodeInfo
 

Functions

void createAccessibilityContextObject (QObject *parent)
 
template<typename Func , typename Ret >
void runInObjectContext (QObject *context, Func &&func, Ret *retVal)
 
void initialize ()
 
bool isActive ()
 
static void setActive (JNIEnv *, jobject, jboolean active)
 
QAccessibleInterface * interfaceFromId (jint objectId)
 
void notifyLocationChange (uint accessibilityObjectId)
 
static int parentId_helper (int objectId)
 
void notifyObjectHide (uint accessibilityObjectId)
 
void notifyObjectFocus (uint accessibilityObjectId)
 
static jstring jvalueForAccessibleObject (int objectId)
 
void notifyValueChanged (uint accessibilityObjectId)
 
void notifyScrolledEvent (uint accessiblityObjectId)
 
static QVarLengthArray< int, 8 > childIdListForAccessibleObject_helper (int objectId)
 
static jintArray childIdListForAccessibleObject (JNIEnv *env, jobject, jint objectId)
 
static jint parentId (JNIEnv *, jobject, jint objectId)
 
static QRect screenRect_helper (int objectId, bool clip=true)
 
static jobject screenRect (JNIEnv *env, jobject, jint objectId)
 
static int hitTest_helper (float x, float y)
 
static jint hitTest (JNIEnv *, jobject, jfloat x, jfloat y)
 
static void invokeActionOnInterfaceInMainThread (QAccessibleActionInterface *actionInterface, const QString &action)
 
static bool clickAction_helper (int objectId)
 
static jboolean clickAction (JNIEnv *, jobject, jint objectId)
 
static bool scroll_helper (int objectId, const QString &actionName)
 
static jboolean scrollForward (JNIEnv *, jobject, jint objectId)
 
static jboolean scrollBackward (JNIEnv *, jobject, jint objectId)
 
static QString textFromValue (QAccessibleInterface *iface)
 
static QString descriptionForInterface (QAccessibleInterface *iface)
 
static QString descriptionForAccessibleObject_helper (int objectId)
 
static jstring descriptionForAccessibleObject (JNIEnv *env, jobject, jint objectId)
 
static NodeInfo populateNode_helper (int objectId)
 
static jboolean populateNode (JNIEnv *env, jobject, jint objectId, jobject node)
 
bool registerNatives (JNIEnv *env)
 

Variables

static jmethodID m_addActionMethodID = 0
 
static jmethodID m_setCheckableMethodID = 0
 
static jmethodID m_setCheckedMethodID = 0
 
static jmethodID m_setClickableMethodID = 0
 
static jmethodID m_setContentDescriptionMethodID = 0
 
static jmethodID m_setEditableMethodID = 0
 
static jmethodID m_setEnabledMethodID = 0
 
static jmethodID m_setFocusableMethodID = 0
 
static jmethodID m_setFocusedMethodID = 0
 
static jmethodID m_setHeadingMethodID = 0
 
static jmethodID m_setScrollableMethodID = 0
 
static jmethodID m_setTextSelectionMethodID = 0
 
static jmethodID m_setVisibleToUserMethodID = 0
 
static bool m_accessibilityActivated = false
 
static QPointer< QObjectm_accessibilityContext = nullptr
 
static JNINativeMethod methods []
 

Function Documentation

◆ childIdListForAccessibleObject()

static jintArray QtAndroidAccessibility::childIdListForAccessibleObject ( JNIEnv *  env,
jobject  ,
jint  objectId 
)
static

Definition at line 165 of file androidjniaccessibility.cpp.

References childIdListForAccessibleObject_helper(), QVarLengthArray< T, Prealloc >::count(), QVarLengthArray< T, Prealloc >::data(), m_accessibilityContext, and runInObjectContext().

+ Here is the call graph for this function:

◆ childIdListForAccessibleObject_helper()

static QVarLengthArray< int, 8 > QtAndroidAccessibility::childIdListForAccessibleObject_helper ( int  objectId)
static

Definition at line 148 of file androidjniaccessibility.cpp.

References QVarLengthArray< T, Prealloc >::append(), child, i, interfaceFromId(), and QVarLengthArray< T, Prealloc >::reserve().

Referenced by childIdListForAccessibleObject(), scrollBackward(), and scrollForward().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clickAction()

static jboolean QtAndroidAccessibility::clickAction ( JNIEnv *  ,
jobject  ,
jint  objectId 
)
static

Definition at line 293 of file androidjniaccessibility.cpp.

References clickAction_helper(), m_accessibilityContext, and runInObjectContext().

+ Here is the call graph for this function:

◆ clickAction_helper()

static bool QtAndroidAccessibility::clickAction_helper ( int  objectId)
static

Definition at line 273 of file androidjniaccessibility.cpp.

References interfaceFromId(), and invokeActionOnInterfaceInMainThread().

Referenced by clickAction().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createAccessibilityContextObject()

void QtAndroidAccessibility::createAccessibilityContextObject ( QObject parent)

Definition at line 55 of file androidjniaccessibility.cpp.

References QObject::deleteLater(), m_accessibilityContext, and parent.

Referenced by QAndroidPlatformAccessibility::setRootObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ descriptionForAccessibleObject()

static jstring QtAndroidAccessibility::descriptionForAccessibleObject ( JNIEnv *  env,
jobject  ,
jint  objectId 
)
static

Definition at line 458 of file androidjniaccessibility.cpp.

References desc, descriptionForAccessibleObject_helper(), m_accessibilityContext, and runInObjectContext().

+ Here is the call graph for this function:

◆ descriptionForAccessibleObject_helper()

static QString QtAndroidAccessibility::descriptionForAccessibleObject_helper ( int  objectId)
static

Definition at line 452 of file androidjniaccessibility.cpp.

References descriptionForInterface(), and interfaceFromId().

Referenced by descriptionForAccessibleObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ descriptionForInterface()

static QString QtAndroidAccessibility::descriptionForInterface ( QAccessibleInterface *  iface)
static

Definition at line 428 of file androidjniaccessibility.cpp.

References desc, QString::isEmpty(), QChar::Space, and textFromValue().

Referenced by descriptionForAccessibleObject_helper(), and populateNode_helper().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hitTest()

static jint QtAndroidAccessibility::hitTest ( JNIEnv *  ,
jobject  ,
jfloat  x,
jfloat  y 
)
static

Definition at line 252 of file androidjniaccessibility.cpp.

References hitTest_helper(), m_accessibilityContext, and runInObjectContext().

+ Here is the call graph for this function:

◆ hitTest_helper()

static int QtAndroidAccessibility::hitTest_helper ( float  x,
float  y 
)
static

Definition at line 234 of file androidjniaccessibility.cpp.

References child, QHighDpi::fromNativePixels(), interfaceFromId(), and pos.

Referenced by hitTest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initialize()

void QtAndroidAccessibility::initialize ( )

Definition at line 82 of file androidjniaccessibility.cpp.

References QtAndroid::applicationClass().

Referenced by QAndroidPlatformAccessibility::QAndroidPlatformAccessibility().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ interfaceFromId()

QAccessibleInterface * QtAndroidAccessibility::interfaceFromId ( jint  objectId)

Definition at line 104 of file androidjniaccessibility.cpp.

References qApp, and win.

Referenced by childIdListForAccessibleObject_helper(), clickAction_helper(), descriptionForAccessibleObject_helper(), hitTest_helper(), jvalueForAccessibleObject(), parentId_helper(), populateNode_helper(), screenRect_helper(), and scroll_helper().

+ Here is the caller graph for this function:

◆ invokeActionOnInterfaceInMainThread()

static void QtAndroidAccessibility::invokeActionOnInterfaceInMainThread ( QAccessibleActionInterface *  actionInterface,
const QString action 
)
static

Definition at line 263 of file androidjniaccessibility.cpp.

References QMetaObject::invokeMethod(), qApp, and Qt::QueuedConnection.

Referenced by clickAction_helper().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isActive()

bool QtAndroidAccessibility::isActive ( )

Definition at line 88 of file androidjniaccessibility.cpp.

References m_accessibilityActivated.

Referenced by QAndroidPlatformNativeInterface::customEvent().

+ Here is the caller graph for this function:

◆ jvalueForAccessibleObject()

static jstring QtAndroidAccessibility::jvalueForAccessibleObject ( int  objectId)
static

Definition at line 417 of file androidjniaccessibility.cpp.

References interfaceFromId(), m_qtTag, and textFromValue().

Referenced by notifyValueChanged().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ notifyLocationChange()

void QtAndroidAccessibility::notifyLocationChange ( uint  accessibilityObjectId)

Definition at line 117 of file androidjniaccessibility.cpp.

References QtAndroid::notifyAccessibilityLocationChange().

Referenced by QAndroidPlatformAccessibility::notifyAccessibilityUpdate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ notifyObjectFocus()

void QtAndroidAccessibility::notifyObjectFocus ( uint  accessibilityObjectId)

Definition at line 130 of file androidjniaccessibility.cpp.

References QtAndroid::notifyObjectFocus().

Referenced by QAndroidPlatformAccessibility::notifyAccessibilityUpdate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ notifyObjectHide()

void QtAndroidAccessibility::notifyObjectHide ( uint  accessibilityObjectId)

Definition at line 124 of file androidjniaccessibility.cpp.

References QtAndroid::notifyObjectHide(), and parentId_helper().

Referenced by QAndroidPlatformAccessibility::notifyAccessibilityUpdate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ notifyScrolledEvent()

void QtAndroidAccessibility::notifyScrolledEvent ( uint  accessiblityObjectId)

Definition at line 143 of file androidjniaccessibility.cpp.

References QtAndroid::notifyScrolledEvent().

Referenced by QAndroidPlatformAccessibility::notifyAccessibilityUpdate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ notifyValueChanged()

void QtAndroidAccessibility::notifyValueChanged ( uint  accessibilityObjectId)

Definition at line 137 of file androidjniaccessibility.cpp.

References jvalueForAccessibleObject(), and QtAndroid::notifyValueChanged().

Referenced by QAndroidPlatformAccessibility::notifyAccessibilityUpdate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parentId()

static jint QtAndroidAccessibility::parentId ( JNIEnv *  ,
jobject  ,
jint  objectId 
)
static

Definition at line 194 of file androidjniaccessibility.cpp.

References m_accessibilityContext, parentId_helper(), and runInObjectContext().

+ Here is the call graph for this function:

◆ parentId_helper()

static int QtAndroidAccessibility::parentId_helper ( int  objectId)
static

Definition at line 180 of file androidjniaccessibility.cpp.

References interfaceFromId(), and parent.

Referenced by notifyObjectHide(), and parentId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateNode()

static jboolean QtAndroidAccessibility::populateNode ( JNIEnv *  env,
jobject  ,
jint  objectId,
jobject  node 
)
static

◆ populateNode_helper()

static NodeInfo QtAndroidAccessibility::populateNode_helper ( int  objectId)
static

Definition at line 482 of file androidjniaccessibility.cpp.

References descriptionForInterface(), QAccessibleBridgeUtils::effectiveActionNames(), info, and interfaceFromId().

Referenced by populateNode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registerNatives()

bool QtAndroidAccessibility::registerNatives ( JNIEnv *  env)

Definition at line 580 of file androidjniaccessibility.cpp.

References QtAndroidPrivate::androidSdkVersion(), FIND_AND_CHECK_CLASS, GET_AND_CHECK_STATIC_METHOD, m_addActionMethodID, m_setCheckableMethodID, m_setCheckedMethodID, m_setClickableMethodID, m_setContentDescriptionMethodID, m_setEditableMethodID, m_setEnabledMethodID, m_setFocusableMethodID, m_setFocusedMethodID, m_setHeadingMethodID, m_setScrollableMethodID, m_setTextSelectionMethodID, m_setVisibleToUserMethodID, and methods.

Referenced by JNI_OnLoad().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ runInObjectContext()

template<typename Func , typename Ret >
void QtAndroidAccessibility::runInObjectContext ( QObject context,
Func &&  func,
Ret *  retVal 
)

Definition at line 63 of file androidjniaccessibility.cpp.

References AndroidDeadlockProtector::acquire(), QGuiApplication::applicationState(), Qt::ApplicationSuspended, QtAndroid::blockEventLoopsWhenSuspended(), Qt::BlockingQueuedConnection, context, QMetaObject::invokeMethod(), and m_qtTag.

Referenced by childIdListForAccessibleObject(), clickAction(), descriptionForAccessibleObject(), hitTest(), parentId(), populateNode(), screenRect(), scrollBackward(), and scrollForward().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ screenRect()

static jobject QtAndroidAccessibility::screenRect ( JNIEnv *  env,
jobject  ,
jint  objectId 
)
static

Definition at line 220 of file androidjniaccessibility.cpp.

References m_accessibilityContext, rect, runInObjectContext(), and screenRect_helper().

+ Here is the call graph for this function:

◆ screenRect_helper()

static QRect QtAndroidAccessibility::screenRect_helper ( int  objectId,
bool  clip = true 
)
static

Definition at line 205 of file androidjniaccessibility.cpp.

References interfaceFromId(), rect, and QHighDpi::toNativePixels().

Referenced by screenRect(), scrollBackward(), and scrollForward().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ scroll_helper()

static bool QtAndroidAccessibility::scroll_helper ( int  objectId,
const QString actionName 
)
static

Definition at line 304 of file androidjniaccessibility.cpp.

References interfaceFromId(), and QAccessibleBridgeUtils::performEffectiveAction().

Referenced by scrollBackward(), and scrollForward().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ scrollBackward()

static jboolean QtAndroidAccessibility::scrollBackward ( JNIEnv *  ,
jobject  ,
jint  objectId 
)
static

Definition at line 333 of file androidjniaccessibility.cpp.

References childIdListForAccessibleObject_helper(), m_accessibilityContext, oldPosition, runInObjectContext(), screenRect_helper(), and scroll_helper().

+ Here is the call graph for this function:

◆ scrollForward()

static jboolean QtAndroidAccessibility::scrollForward ( JNIEnv *  ,
jobject  ,
jint  objectId 
)
static

Definition at line 312 of file androidjniaccessibility.cpp.

References childIdListForAccessibleObject_helper(), m_accessibilityContext, oldPosition, runInObjectContext(), screenRect_helper(), and scroll_helper().

+ Here is the call graph for this function:

◆ setActive()

static void QtAndroidAccessibility::setActive ( JNIEnv *  ,
jobject  ,
jboolean  active 
)
static

Definition at line 93 of file androidjniaccessibility.cpp.

References QtAndroid::androidPlatformIntegration(), lock, m_accessibilityActivated, m_qtTag, and QtAndroid::platformInterfaceMutex().

+ Here is the call graph for this function:

◆ textFromValue()

static QString QtAndroidAccessibility::textFromValue ( QAccessibleInterface *  iface)
static

Definition at line 364 of file androidjniaccessibility.cpp.

References QString::number(), qAbs(), qFuzzyCompare(), qFuzzyIsNull(), QVariant::toDouble(), QVariant::toString(), and QVariant::typeId().

Referenced by descriptionForInterface(), and jvalueForAccessibleObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ m_accessibilityActivated

bool QtAndroidAccessibility::m_accessibilityActivated = false
static

Definition at line 44 of file androidjniaccessibility.cpp.

Referenced by isActive(), and setActive().

◆ m_accessibilityContext

◆ m_addActionMethodID

jmethodID QtAndroidAccessibility::m_addActionMethodID = 0
static

Definition at line 30 of file androidjniaccessibility.cpp.

Referenced by populateNode(), and registerNatives().

◆ m_setCheckableMethodID

jmethodID QtAndroidAccessibility::m_setCheckableMethodID = 0
static

Definition at line 31 of file androidjniaccessibility.cpp.

Referenced by populateNode(), and registerNatives().

◆ m_setCheckedMethodID

jmethodID QtAndroidAccessibility::m_setCheckedMethodID = 0
static

Definition at line 32 of file androidjniaccessibility.cpp.

Referenced by populateNode(), and registerNatives().

◆ m_setClickableMethodID

jmethodID QtAndroidAccessibility::m_setClickableMethodID = 0
static

Definition at line 33 of file androidjniaccessibility.cpp.

Referenced by populateNode(), and registerNatives().

◆ m_setContentDescriptionMethodID

jmethodID QtAndroidAccessibility::m_setContentDescriptionMethodID = 0
static

Definition at line 34 of file androidjniaccessibility.cpp.

Referenced by populateNode(), and registerNatives().

◆ m_setEditableMethodID

jmethodID QtAndroidAccessibility::m_setEditableMethodID = 0
static

Definition at line 35 of file androidjniaccessibility.cpp.

Referenced by populateNode(), and registerNatives().

◆ m_setEnabledMethodID

jmethodID QtAndroidAccessibility::m_setEnabledMethodID = 0
static

Definition at line 36 of file androidjniaccessibility.cpp.

Referenced by populateNode(), and registerNatives().

◆ m_setFocusableMethodID

jmethodID QtAndroidAccessibility::m_setFocusableMethodID = 0
static

Definition at line 37 of file androidjniaccessibility.cpp.

Referenced by populateNode(), and registerNatives().

◆ m_setFocusedMethodID

jmethodID QtAndroidAccessibility::m_setFocusedMethodID = 0
static

Definition at line 38 of file androidjniaccessibility.cpp.

Referenced by populateNode(), and registerNatives().

◆ m_setHeadingMethodID

jmethodID QtAndroidAccessibility::m_setHeadingMethodID = 0
static

Definition at line 39 of file androidjniaccessibility.cpp.

Referenced by populateNode(), and registerNatives().

◆ m_setScrollableMethodID

jmethodID QtAndroidAccessibility::m_setScrollableMethodID = 0
static

Definition at line 40 of file androidjniaccessibility.cpp.

Referenced by populateNode(), and registerNatives().

◆ m_setTextSelectionMethodID

jmethodID QtAndroidAccessibility::m_setTextSelectionMethodID = 0
static

Definition at line 41 of file androidjniaccessibility.cpp.

Referenced by populateNode(), and registerNatives().

◆ m_setVisibleToUserMethodID

jmethodID QtAndroidAccessibility::m_setVisibleToUserMethodID = 0
static

Definition at line 42 of file androidjniaccessibility.cpp.

Referenced by populateNode(), and registerNatives().

◆ methods

JNINativeMethod QtAndroidAccessibility::methods[]
static
Initial value:
= {
{"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;)Z", (void*)populateNode},
{"clickAction", "(I)Z", (void*)clickAction},
{"scrollForward", "(I)Z", (void*)scrollForward},
{"scrollBackward", "(I)Z", (void*)scrollBackward},
}

Definition at line 560 of file androidjniaccessibility.cpp.

Referenced by registerNatives().