Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qandroidplatformaccessibility.cpp
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
6
#
include
"qandroidplatformaccessibility.h"
7
#
include
"androidjniaccessibility.h"
8
9
QT_BEGIN_NAMESPACE
10
QAndroidPlatformAccessibility::QAndroidPlatformAccessibility()
11
{ }
12
13
QAndroidPlatformAccessibility::~QAndroidPlatformAccessibility()
14
{ }
15
16
void
QAndroidPlatformAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event)
17
{
18
if
(!isActive() || event ==
nullptr
|| !event->accessibleInterface())
19
return
;
20
21
// We do not need implementation of all events, as current statues are polled
22
// by QtAccessibilityDelegate.java on every accessibility interaction.
23
// Currently we only send notification about the element's position change,
24
// so that the element can be moved on the screen if it's focused.
25
26
if
(event->type() == QAccessible::LocationChanged) {
27
QtAndroidAccessibility
::
notifyLocationChange
(event->uniqueId());
28
}
else
if
(event->type() == QAccessible::ObjectHide) {
29
QtAndroidAccessibility
::
notifyObjectHide
(event->uniqueId());
30
}
else
if
(event->type() == QAccessible::ObjectShow) {
31
QtAndroidAccessibility
::
notifyObjectShow
(event->uniqueId());
32
}
else
if
(event->type() == QAccessible::Focus) {
33
QtAndroidAccessibility
::
notifyObjectFocus
(event->uniqueId());
34
}
else
if
(event->type() == QAccessible::ValueChanged) {
35
QtAndroidAccessibility
::
notifyValueChanged
(event->uniqueId());
36
}
else
if
(event->type() == QAccessible::ScrollingEnd
37
|| event->type() == QAccessible::ScrollingPositionChanged) {
38
QtAndroidAccessibility
::
notifyScrolledEvent
(event->uniqueId());
39
}
else
if
(event->type() == QAccessible::NameChanged
40
|| event->type() == QAccessible::DescriptionChanged) {
41
QtAndroidAccessibility
::
notifyDescriptionOrNameChanged
(event->uniqueId());
42
}
else
if
(event->type() == QAccessible::Announcement) {
43
auto
*announcementEvent =
static_cast
<QAccessibleAnnouncementEvent *>(event);
44
QtAndroidAccessibility
::notifyAnnouncementEvent(announcementEvent->uniqueId(),
45
announcementEvent->message());
46
}
else
if
(event->type() == QAccessible::ObjectDestroyed) {
47
QtAndroidAccessibility
::
notifyObjectDestroyed
(event->uniqueId());
48
}
else
if
(event->type() == QAccessible::ObjectCreated) {
49
QtAndroidAccessibility
::
notifyObjectCreated
(event->uniqueId());
50
}
51
// Text-change events are intentionally not forwarded from here: typed and
52
// programmatic edits are announced from the IME chokepoints in
53
// QAndroidInputContext, which also cover the input-method and key-event
54
// paths that emit no QAccessible event. Forwarding TextInserted/Removed/
55
// Updated here too would double-announce programmatic changes.
56
}
57
58
void
QAndroidPlatformAccessibility::setRootObject(QObject *obj)
59
{
60
QPlatformAccessibility::setRootObject(obj);
61
QtAndroidAccessibility
::
createAccessibilityContextObject
(
obj
)
;
62
}
63
64
QT_END_NAMESPACE
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QtAndroidAccessibility
Definition
androidjniaccessibility.cpp:35
QtAndroidAccessibility::notifyDescriptionOrNameChanged
void notifyDescriptionOrNameChanged(uint accessibilityObjectId)
Definition
androidjniaccessibility.cpp:215
QtAndroidAccessibility::notifyObjectShow
void notifyObjectShow(uint accessibilityObjectId)
Definition
androidjniaccessibility.cpp:181
QtAndroidAccessibility::notifyLocationChange
void notifyLocationChange(uint accessibilityObjectId)
Definition
androidjniaccessibility.cpp:166
QtAndroidAccessibility::notifyObjectFocus
void notifyObjectFocus(uint accessibilityObjectId)
Definition
androidjniaccessibility.cpp:193
QtAndroidAccessibility::notifyObjectDestroyed
void notifyObjectDestroyed(uint accessibilityObjectId)
Definition
androidjniaccessibility.cpp:198
QtAndroidAccessibility::createAccessibilityContextObject
void createAccessibilityContextObject(QObject *parent)
Definition
androidjniaccessibility.cpp:88
QtAndroidAccessibility::notifyObjectCreated
void notifyObjectCreated(uint accessibilityObjectId)
Definition
androidjniaccessibility.cpp:205
QtAndroidAccessibility::notifyObjectHide
void notifyObjectHide(uint accessibilityObjectId)
Definition
androidjniaccessibility.cpp:173
QtAndroidAccessibility::notifyValueChanged
void notifyValueChanged(uint accessibilityObjectId)
Definition
androidjniaccessibility.cpp:210
QtAndroidAccessibility::notifyScrolledEvent
void notifyScrolledEvent(uint accessiblityObjectId)
Definition
androidjniaccessibility.cpp:220
qtbase
src
plugins
platforms
android
qandroidplatformaccessibility.cpp
Generated on
for Qt by
1.18.0