summaryrefslogtreecommitdiffstats
path: root/src/gui/accessible
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/accessible')
-rw-r--r--src/gui/accessible/linux/atspiadaptor.cpp1379
-rw-r--r--src/gui/accessible/linux/atspiadaptor_p.h56
-rw-r--r--src/gui/accessible/linux/dbusconnection.cpp75
-rw-r--r--src/gui/accessible/linux/dbusconnection_p.h42
-rw-r--r--src/gui/accessible/linux/dbusxml/Socket.xml2
-rw-r--r--src/gui/accessible/linux/qspi_constant_mappings.cpp58
-rw-r--r--src/gui/accessible/linux/qspi_constant_mappings_p.h40
-rw-r--r--src/gui/accessible/linux/qspi_struct_marshallers.cpp62
-rw-r--r--src/gui/accessible/linux/qspi_struct_marshallers_p.h74
-rw-r--r--src/gui/accessible/linux/qspiaccessiblebridge.cpp66
-rw-r--r--src/gui/accessible/linux/qspiaccessiblebridge_p.h40
-rw-r--r--src/gui/accessible/linux/qspiapplicationadaptor.cpp77
-rw-r--r--src/gui/accessible/linux/qspiapplicationadaptor_p.h41
-rw-r--r--src/gui/accessible/linux/qspidbuscache.cpp50
-rw-r--r--src/gui/accessible/linux/qspidbuscache_p.h40
-rw-r--r--src/gui/accessible/qaccessible.cpp389
-rw-r--r--src/gui/accessible/qaccessible.h482
-rw-r--r--src/gui/accessible/qaccessible_base.h420
-rw-r--r--src/gui/accessible/qaccessiblebridge.cpp46
-rw-r--r--src/gui/accessible/qaccessiblebridge.h44
-rw-r--r--src/gui/accessible/qaccessiblebridgeutils.cpp40
-rw-r--r--src/gui/accessible/qaccessiblebridgeutils_p.h40
-rw-r--r--src/gui/accessible/qaccessiblecache.cpp58
-rw-r--r--src/gui/accessible/qaccessiblecache_mac.mm40
-rw-r--r--src/gui/accessible/qaccessiblecache_p.h44
-rw-r--r--src/gui/accessible/qaccessibleobject.cpp50
-rw-r--r--src/gui/accessible/qaccessibleobject.h44
-rw-r--r--src/gui/accessible/qaccessibleplugin.cpp53
-rw-r--r--src/gui/accessible/qaccessibleplugin.h44
-rw-r--r--src/gui/accessible/qplatformaccessibility.cpp52
-rw-r--r--src/gui/accessible/qplatformaccessibility.h44
-rw-r--r--src/gui/accessible/windows/apisupport/qwindowsuiawrapper.cpp125
-rw-r--r--src/gui/accessible/windows/apisupport/qwindowsuiawrapper_p.h103
-rw-r--r--src/gui/accessible/windows/apisupport/uiaattributeids_p.h99
-rw-r--r--src/gui/accessible/windows/apisupport/uiaclientinterfaces_p.h266
-rw-r--r--src/gui/accessible/windows/apisupport/uiacontroltypeids_p.h96
-rw-r--r--src/gui/accessible/windows/apisupport/uiaerrorids_p.h62
-rw-r--r--src/gui/accessible/windows/apisupport/uiaeventids_p.h90
-rw-r--r--src/gui/accessible/windows/apisupport/uiageneralids_p.h57
-rw-r--r--src/gui/accessible/windows/apisupport/uiapatternids_p.h89
-rw-r--r--src/gui/accessible/windows/apisupport/uiapropertyids_p.h224
-rw-r--r--src/gui/accessible/windows/apisupport/uiaserverinterfaces_p.h403
-rw-r--r--src/gui/accessible/windows/apisupport/uiatypes_p.h193
43 files changed, 1878 insertions, 3921 deletions
diff --git a/src/gui/accessible/linux/atspiadaptor.cpp b/src/gui/accessible/linux/atspiadaptor.cpp
index 2249e3c121..b3269a2a95 100644
--- a/src/gui/accessible/linux/atspiadaptor.cpp
+++ b/src/gui/accessible/linux/atspiadaptor.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "atspiadaptor_p.h"
#include "qspiaccessiblebridge_p.h"
@@ -47,10 +11,12 @@
#include <qclipboard.h>
#include <QtCore/qloggingcategory.h>
+#include <QtCore/qtversion.h>
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
#include "socket_interface.h"
#include "qspi_constant_mappings_p.h"
+#include <QtCore/private/qstringiterator_p.h>
#include <QtGui/private/qaccessiblebridgeutils_p.h>
#include "qspiapplicationadaptor_p.h"
@@ -64,8 +30,15 @@
It sends notifications coming from Qt via dbus and listens to incoming dbus requests.
*/
+// ATSPI_COORD_TYPE_PARENT was added in at-spi 2.30, define here for older versions
+#if ATSPI_COORD_TYPE_COUNT < 3
+#define ATSPI_COORD_TYPE_PARENT 2
+#endif
+
QT_BEGIN_NAMESPACE
+using namespace Qt::StringLiterals;
+
Q_LOGGING_CATEGORY(lcAccessibilityAtspi, "qt.accessibility.atspi")
Q_LOGGING_CATEGORY(lcAccessibilityAtspiCreation, "qt.accessibility.atspi.creation")
@@ -133,11 +106,11 @@ AtSpiAdaptor::AtSpiAdaptor(DBusConnection *connection, QObject *parent)
connect(m_applicationAdaptor, SIGNAL(windowActivated(QObject*,bool)), this, SLOT(windowActivated(QObject*,bool)));
updateEventListeners();
- bool success = m_dbus->connection().connect(QLatin1String("org.a11y.atspi.Registry"), QLatin1String("/org/a11y/atspi/registry"),
- QLatin1String("org.a11y.atspi.Registry"), QLatin1String("EventListenerRegistered"), this,
+ bool success = m_dbus->connection().connect("org.a11y.atspi.Registry"_L1, "/org/a11y/atspi/registry"_L1,
+ "org.a11y.atspi.Registry"_L1, "EventListenerRegistered"_L1, this,
SLOT(eventListenerRegistered(QString,QString)));
- success = success && m_dbus->connection().connect(QLatin1String("org.a11y.atspi.Registry"), QLatin1String("/org/a11y/atspi/registry"),
- QLatin1String("org.a11y.atspi.Registry"), QLatin1String("EventListenerDeregistered"), this,
+ success = success && m_dbus->connection().connect("org.a11y.atspi.Registry"_L1, "/org/a11y/atspi/registry"_L1,
+ "org.a11y.atspi.Registry"_L1, "EventListenerDeregistered"_L1, this,
SLOT(eventListenerDeregistered(QString,QString)));
}
@@ -150,7 +123,7 @@ AtSpiAdaptor::~AtSpiAdaptor()
*/
QString AtSpiAdaptor::introspect(const QString &path) const
{
- static const QLatin1String accessibleIntrospection(
+ static const QLatin1StringView accessibleIntrospection(
" <interface name=\"org.a11y.atspi.Accessible\">\n"
" <property access=\"read\" type=\"s\" name=\"Name\"/>\n"
" <property access=\"read\" type=\"s\" name=\"Description\"/>\n"
@@ -195,10 +168,13 @@ QString AtSpiAdaptor::introspect(const QString &path) const
" <arg direction=\"out\" type=\"(so)\"/>\n"
" <annotation value=\"QSpiObjectReference\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
" </method>\n"
+ " <method name=\"GetAccessibleId\">\n"
+ " <arg direction=\"out\" type=\"s\"/>\n"
+ " </method>\n"
" </interface>\n"
);
- static const QLatin1String actionIntrospection(
+ static const QLatin1StringView actionIntrospection(
" <interface name=\"org.a11y.atspi.Action\">\n"
" <property access=\"read\" type=\"i\" name=\"NActions\"/>\n"
" <method name=\"GetDescription\">\n"
@@ -224,7 +200,7 @@ QString AtSpiAdaptor::introspect(const QString &path) const
" </interface>\n"
);
- static const QLatin1String applicationIntrospection(
+ static const QLatin1StringView applicationIntrospection(
" <interface name=\"org.a11y.atspi.Application\">\n"
" <property access=\"read\" type=\"s\" name=\"ToolkitName\"/>\n"
" <property access=\"read\" type=\"s\" name=\"Version\"/>\n"
@@ -239,7 +215,7 @@ QString AtSpiAdaptor::introspect(const QString &path) const
" </interface>\n"
);
- static const QLatin1String componentIntrospection(
+ static const QLatin1StringView componentIntrospection(
" <interface name=\"org.a11y.atspi.Component\">\n"
" <method name=\"Contains\">\n"
" <arg direction=\"in\" type=\"i\" name=\"x\"/>\n"
@@ -302,7 +278,7 @@ QString AtSpiAdaptor::introspect(const QString &path) const
" </interface>\n"
);
- static const QLatin1String editableTextIntrospection(
+ static const QLatin1StringView editableTextIntrospection(
" <interface name=\"org.a11y.atspi.EditableText\">\n"
" <method name=\"SetTextContents\">\n"
" <arg direction=\"in\" type=\"s\" name=\"newContents\"/>\n"
@@ -335,7 +311,40 @@ QString AtSpiAdaptor::introspect(const QString &path) const
" </interface>\n"
);
- static const QLatin1String tableIntrospection(
+ static const QLatin1StringView selectionIntrospection(
+ " <interface name=\"org.a11y.atspi.Selection\">\n"
+ " <property name=\"NSelectedChildren\" type=\"i\" access=\"read\"/>\n"
+ " <method name=\"GetSelectedChild\">\n"
+ " <arg direction=\"in\" name=\"selectedChildIndex\" type=\"i\"/>\n"
+ " <arg direction=\"out\" type=\"(so)\"/>\n"
+ " <annotation name=\"org.qtproject.QtDBus.QtTypeName.Out0\" value=\"QSpiObjectReference\"/>\n"
+ " </method>\n"
+ " <method name=\"SelectChild\">\n"
+ " <arg direction=\"in\" name=\"childIndex\" type=\"i\"/>\n"
+ " <arg direction=\"out\" type=\"b\"/>\n"
+ " </method>\n"
+ " <method name=\"DeselectSelectedChild\">\n"
+ " <arg direction=\"in\" name=\"selectedChildIndex\" type=\"i\"/>\n"
+ " <arg direction=\"out\" type=\"b\"/>\n"
+ " </method>\n"
+ " <method name=\"IsChildSelected\">\n"
+ " <arg direction=\"in\" name=\"childIndex\" type=\"i\"/>\n"
+ " <arg direction=\"out\" type=\"b\"/>\n"
+ " </method>\n"
+ " <method name=\"SelectAll\">\n"
+ " <arg direction=\"out\" type=\"b\"/>\n"
+ " </method>\n"
+ " <method name=\"ClearSelection\">\n"
+ " <arg direction=\"out\" type=\"b\"/>\n"
+ " </method>\n"
+ " <method name=\"DeselectChild\">\n"
+ " <arg direction=\"in\" name=\"childIndex\" type=\"i\"/>\n"
+ " <arg direction=\"out\" type=\"b\"/>\n"
+ " </method>\n"
+ " </interface>\n"
+ );
+
+ static const QLatin1StringView tableIntrospection(
" <interface name=\"org.a11y.atspi.Table\">\n"
" <property access=\"read\" type=\"i\" name=\"NRows\"/>\n"
" <property access=\"read\" type=\"i\" name=\"NColumns\"/>\n"
@@ -443,10 +452,45 @@ QString AtSpiAdaptor::introspect(const QString &path) const
" </interface>\n"
);
- static const QLatin1String textIntrospection(
+ static const QLatin1StringView tableCellIntrospection(
+ " <interface name=\"org.a11y.atspi.TableCell\">\n"
+ " <property access=\"read\" name=\"ColumnSpan\" type=\"i\" />\n"
+ " <property access=\"read\" name=\"Position\" type=\"(ii)\">\n"
+ " <annotation name=\"org.qtproject.QtDBus.QtTypeName\" value=\"QPoint\"/>\n"
+ " </property>\n"
+ " <property access=\"read\" name=\"RowSpan\" type=\"i\" />\n"
+ " <property access=\"read\" name=\"Table\" type=\"(so)\" >\n"
+ " <annotation name=\"org.qtproject.QtDBus.QtTypeName\" value=\"QSpiObjectReference\"/>\n"
+ " </property>\n"
+ " <method name=\"GetRowColumnSpan\">\n"
+ " <arg direction=\"out\" type=\"b\" />\n"
+ " <arg direction=\"out\" name=\"row\" type=\"i\" />\n"
+ " <arg direction=\"out\" name=\"col\" type=\"i\" />\n"
+ " <arg direction=\"out\" name=\"row_extents\" type=\"i\" />\n"
+ " <arg direction=\"out\" name=\"col_extents\" type=\"i\" />\n"
+ " </method>\n"
+ " <method name=\"GetColumnHeaderCells\">\n"
+ " <arg direction=\"out\" type=\"a(so)\"/>\n"
+ " <annotation value=\"QSpiObjectReferenceArray\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
+ " </method>\n"
+ " <method name=\"GetRowHeaderCells\">\n"
+ " <arg direction=\"out\" type=\"a(so)\"/>\n"
+ " <annotation value=\"QSpiObjectReferenceArray\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
+ " </method>\n"
+ " </interface>\n"
+ );
+
+ static const QLatin1StringView textIntrospection(
" <interface name=\"org.a11y.atspi.Text\">\n"
" <property access=\"read\" type=\"i\" name=\"CharacterCount\"/>\n"
" <property access=\"read\" type=\"i\" name=\"CaretOffset\"/>\n"
+ " <method name=\"GetStringAtOffset\">\n"
+ " <arg direction=\"in\" name=\"offset\" type=\"i\"/>\n"
+ " <arg direction=\"in\" name=\"granularity\" type=\"u\"/>\n"
+ " <arg direction=\"out\" type=\"s\"/>\n"
+ " <arg direction=\"out\" name=\"startOffset\" type=\"i\"/>\n"
+ " <arg direction=\"out\" name=\"endOffset\" type=\"i\"/>\n"
+ " </method>\n"
" <method name=\"GetText\">\n"
" <arg direction=\"in\" type=\"i\" name=\"startOffset\"/>\n"
" <arg direction=\"in\" type=\"i\" name=\"endOffset\"/>\n"
@@ -485,9 +529,6 @@ QString AtSpiAdaptor::introspect(const QString &path) const
" <arg direction=\"in\" type=\"i\" name=\"offset\"/>\n"
" <arg direction=\"in\" type=\"s\" name=\"attributeName\"/>\n"
" <arg direction=\"out\" type=\"s\"/>\n"
- " <arg direction=\"out\" type=\"i\" name=\"startOffset\"/>\n"
- " <arg direction=\"out\" type=\"i\" name=\"endOffset\"/>\n"
- " <arg direction=\"out\" type=\"b\" name=\"defined\"/>\n"
" </method>\n"
" <method name=\"GetAttributes\">\n"
" <arg direction=\"in\" type=\"i\" name=\"offset\"/>\n"
@@ -516,6 +557,7 @@ QString AtSpiAdaptor::introspect(const QString &path) const
" </method>\n"
" <method name=\"GetNSelections\">\n"
" <arg direction=\"out\" type=\"i\"/>\n"
+ " </method>\n"
" <method name=\"GetSelection\">\n"
" <arg direction=\"in\" type=\"i\" name=\"selectionNum\"/>\n"
" <arg direction=\"out\" type=\"i\" name=\"startOffset\"/>\n"
@@ -568,10 +610,16 @@ QString AtSpiAdaptor::introspect(const QString &path) const
" <arg direction=\"out\" type=\"a{ss}\"/>\n"
" <annotation value=\"QSpiAttributeSet\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
" </method>\n"
+ " <method name=\"ScrollSubstringTo\">\n"
+ " <arg direction=\"in\" name=\"startOffset\" type=\"i\"/>\n"
+ " <arg direction=\"in\" name=\"endOffset\" type=\"i\"/>\n"
+ " <arg direction=\"in\" name=\"type\" type=\"u\"/>\n"
+ " <arg direction=\"out\" type=\"b\"/>\n"
+ " </method>\n"
" </interface>\n"
);
- static const QLatin1String valueIntrospection(
+ static const QLatin1StringView valueIntrospection(
" <interface name=\"org.a11y.atspi.Value\">\n"
" <property access=\"read\" type=\"d\" name=\"MinimumValue\"/>\n"
" <property access=\"read\" type=\"d\" name=\"MaximumValue\"/>\n"
@@ -585,7 +633,7 @@ QString AtSpiAdaptor::introspect(const QString &path) const
QAccessibleInterface * interface = interfaceFromPath(path);
if (!interface) {
- qCDebug(lcAccessibilityAtspi) << "WARNING Qt AtSpiAdaptor: Could not find accessible on path: " << path;
+ qCWarning(lcAccessibilityAtspi) << "Could not find accessible on path:" << path;
return QString();
}
@@ -594,19 +642,23 @@ QString AtSpiAdaptor::introspect(const QString &path) const
QString xml;
xml.append(accessibleIntrospection);
- if (interfaces.contains(QLatin1String(ATSPI_DBUS_INTERFACE_COMPONENT)))
+ if (interfaces.contains(ATSPI_DBUS_INTERFACE_COMPONENT ""_L1))
xml.append(componentIntrospection);
- if (interfaces.contains(QLatin1String(ATSPI_DBUS_INTERFACE_TEXT)))
+ if (interfaces.contains(ATSPI_DBUS_INTERFACE_TEXT ""_L1))
xml.append(textIntrospection);
- if (interfaces.contains(QLatin1String(ATSPI_DBUS_INTERFACE_EDITABLE_TEXT)))
+ if (interfaces.contains(ATSPI_DBUS_INTERFACE_EDITABLE_TEXT ""_L1))
xml.append(editableTextIntrospection);
- if (interfaces.contains(QLatin1String(ATSPI_DBUS_INTERFACE_ACTION)))
+ if (interfaces.contains(ATSPI_DBUS_INTERFACE_ACTION ""_L1))
xml.append(actionIntrospection);
- if (interfaces.contains(QLatin1String(ATSPI_DBUS_INTERFACE_TABLE)))
+ if (interfaces.contains(ATSPI_DBUS_INTERFACE_SELECTION ""_L1))
+ xml.append(selectionIntrospection);
+ if (interfaces.contains(ATSPI_DBUS_INTERFACE_TABLE ""_L1))
xml.append(tableIntrospection);
- if (interfaces.contains(QLatin1String(ATSPI_DBUS_INTERFACE_VALUE)))
+ if (interfaces.contains(ATSPI_DBUS_INTERFACE_TABLE_CELL ""_L1))
+ xml.append(tableCellIntrospection);
+ if (interfaces.contains(ATSPI_DBUS_INTERFACE_VALUE ""_L1))
xml.append(valueIntrospection);
- if (path == QLatin1String(QSPI_OBJECT_PATH_ROOT))
+ if (path == QSPI_OBJECT_PATH_ROOT ""_L1)
xml.append(applicationIntrospection);
return xml;
@@ -624,77 +676,77 @@ void AtSpiAdaptor::setBitFlag(const QString &flag)
} else { // Object:Foo:Bar
QString right = flag.mid(7);
if (false) {
- } else if (right.startsWith(QLatin1String("ActiveDescendantChanged"))) {
+ } else if (right.startsWith("ActiveDescendantChanged"_L1)) {
sendObject_active_descendant_changed = 1;
- } else if (right.startsWith(QLatin1String("AttributesChanged"))) {
+ } else if (right.startsWith("AttributesChanged"_L1)) {
sendObject_attributes_changed = 1;
- } else if (right.startsWith(QLatin1String("BoundsChanged"))) {
+ } else if (right.startsWith("BoundsChanged"_L1)) {
sendObject_bounds_changed = 1;
- } else if (right.startsWith(QLatin1String("ChildrenChanged"))) {
+ } else if (right.startsWith("ChildrenChanged"_L1)) {
sendObject_children_changed = 1;
- } else if (right.startsWith(QLatin1String("ColumnDeleted"))) {
+ } else if (right.startsWith("ColumnDeleted"_L1)) {
sendObject_column_deleted = 1;
- } else if (right.startsWith(QLatin1String("ColumnInserted"))) {
+ } else if (right.startsWith("ColumnInserted"_L1)) {
sendObject_column_inserted = 1;
- } else if (right.startsWith(QLatin1String("ColumnReordered"))) {
+ } else if (right.startsWith("ColumnReordered"_L1)) {
sendObject_column_reordered = 1;
- } else if (right.startsWith(QLatin1String("LinkSelected"))) {
+ } else if (right.startsWith("LinkSelected"_L1)) {
sendObject_link_selected = 1;
- } else if (right.startsWith(QLatin1String("ModelChanged"))) {
+ } else if (right.startsWith("ModelChanged"_L1)) {
sendObject_model_changed = 1;
- } else if (right.startsWith(QLatin1String("PropertyChange"))) {
- if (right == QLatin1String("PropertyChange:AccessibleDescription")) {
+ } else if (right.startsWith("PropertyChange"_L1)) {
+ if (right == "PropertyChange:AccessibleDescription"_L1) {
sendObject_property_change_accessible_description = 1;
- } else if (right == QLatin1String("PropertyChange:AccessibleName")) {
+ } else if (right == "PropertyChange:AccessibleName"_L1) {
sendObject_property_change_accessible_name = 1;
- } else if (right == QLatin1String("PropertyChange:AccessibleParent")) {
+ } else if (right == "PropertyChange:AccessibleParent"_L1) {
sendObject_property_change_accessible_parent = 1;
- } else if (right == QLatin1String("PropertyChange:AccessibleRole")) {
+ } else if (right == "PropertyChange:AccessibleRole"_L1) {
sendObject_property_change_accessible_role = 1;
- } else if (right == QLatin1String("PropertyChange:TableCaption")) {
+ } else if (right == "PropertyChange:TableCaption"_L1) {
sendObject_property_change_accessible_table_caption = 1;
- } else if (right == QLatin1String("PropertyChange:TableColumnDescription")) {
+ } else if (right == "PropertyChange:TableColumnDescription"_L1) {
sendObject_property_change_accessible_table_column_description = 1;
- } else if (right == QLatin1String("PropertyChange:TableColumnHeader")) {
+ } else if (right == "PropertyChange:TableColumnHeader"_L1) {
sendObject_property_change_accessible_table_column_header = 1;
- } else if (right == QLatin1String("PropertyChange:TableRowDescription")) {
+ } else if (right == "PropertyChange:TableRowDescription"_L1) {
sendObject_property_change_accessible_table_row_description = 1;
- } else if (right == QLatin1String("PropertyChange:TableRowHeader")) {
+ } else if (right == "PropertyChange:TableRowHeader"_L1) {
sendObject_property_change_accessible_table_row_header = 1;
- } else if (right == QLatin1String("PropertyChange:TableSummary")) {
+ } else if (right == "PropertyChange:TableSummary"_L1) {
sendObject_property_change_accessible_table_summary = 1;
- } else if (right == QLatin1String("PropertyChange:AccessibleValue")) {
+ } else if (right == "PropertyChange:AccessibleValue"_L1) {
sendObject_property_change_accessible_value = 1;
} else {
sendObject_property_change = 1;
}
- } else if (right.startsWith(QLatin1String("RowDeleted"))) {
+ } else if (right.startsWith("RowDeleted"_L1)) {
sendObject_row_deleted = 1;
- } else if (right.startsWith(QLatin1String("RowInserted"))) {
+ } else if (right.startsWith("RowInserted"_L1)) {
sendObject_row_inserted = 1;
- } else if (right.startsWith(QLatin1String("RowReordered"))) {
+ } else if (right.startsWith("RowReordered"_L1)) {
sendObject_row_reordered = 1;
- } else if (right.startsWith(QLatin1String("SelectionChanged"))) {
+ } else if (right.startsWith("SelectionChanged"_L1)) {
sendObject_selection_changed = 1;
- } else if (right.startsWith(QLatin1String("StateChanged"))) {
+ } else if (right.startsWith("StateChanged"_L1)) {
sendObject_state_changed = 1;
- } else if (right.startsWith(QLatin1String("TextAttributesChanged"))) {
+ } else if (right.startsWith("TextAttributesChanged"_L1)) {
sendObject_text_attributes_changed = 1;
- } else if (right.startsWith(QLatin1String("TextBoundsChanged"))) {
+ } else if (right.startsWith("TextBoundsChanged"_L1)) {
sendObject_text_bounds_changed = 1;
- } else if (right.startsWith(QLatin1String("TextCaretMoved"))) {
+ } else if (right.startsWith("TextCaretMoved"_L1)) {
sendObject_text_caret_moved = 1;
- } else if (right.startsWith(QLatin1String("TextChanged"))) {
+ } else if (right.startsWith("TextChanged"_L1)) {
sendObject_text_changed = 1;
- } else if (right.startsWith(QLatin1String("TextSelectionChanged"))) {
+ } else if (right.startsWith("TextSelectionChanged"_L1)) {
sendObject_text_selection_changed = 1;
- } else if (right.startsWith(QLatin1String("ValueChanged"))) {
+ } else if (right.startsWith("ValueChanged"_L1)) {
sendObject_value_changed = 1;
- } else if (right.startsWith(QLatin1String("VisibleDataChanged"))
- || right.startsWith(QLatin1String("VisibledataChanged"))) { // typo in libatspi
+ } else if (right.startsWith("VisibleDataChanged"_L1)
+ || right.startsWith("VisibledataChanged"_L1)) { // typo in libatspi
sendObject_visible_data_changed = 1;
} else {
- qCDebug(lcAccessibilityAtspi) << "WARNING: subscription string not handled:" << flag;
+ qCWarning(lcAccessibilityAtspi) << "Subscription string not handled:" << flag;
}
}
break;
@@ -705,42 +757,42 @@ void AtSpiAdaptor::setBitFlag(const QString &flag)
} else { // object:Foo:Bar
QString right = flag.mid(7);
if (false) {
- } else if (right.startsWith(QLatin1String("Activate"))) {
+ } else if (right.startsWith("Activate"_L1)) {
sendWindow_activate = 1;
- } else if (right.startsWith(QLatin1String("Close"))) {
+ } else if (right.startsWith("Close"_L1)) {
sendWindow_close= 1;
- } else if (right.startsWith(QLatin1String("Create"))) {
+ } else if (right.startsWith("Create"_L1)) {
sendWindow_create = 1;
- } else if (right.startsWith(QLatin1String("Deactivate"))) {
+ } else if (right.startsWith("Deactivate"_L1)) {
sendWindow_deactivate = 1;
- } else if (right.startsWith(QLatin1String("Lower"))) {
+ } else if (right.startsWith("Lower"_L1)) {
sendWindow_lower = 1;
- } else if (right.startsWith(QLatin1String("Maximize"))) {
+ } else if (right.startsWith("Maximize"_L1)) {
sendWindow_maximize = 1;
- } else if (right.startsWith(QLatin1String("Minimize"))) {
+ } else if (right.startsWith("Minimize"_L1)) {
sendWindow_minimize = 1;
- } else if (right.startsWith(QLatin1String("Move"))) {
+ } else if (right.startsWith("Move"_L1)) {
sendWindow_move = 1;
- } else if (right.startsWith(QLatin1String("Raise"))) {
+ } else if (right.startsWith("Raise"_L1)) {
sendWindow_raise = 1;
- } else if (right.startsWith(QLatin1String("Reparent"))) {
+ } else if (right.startsWith("Reparent"_L1)) {
sendWindow_reparent = 1;
- } else if (right.startsWith(QLatin1String("Resize"))) {
+ } else if (right.startsWith("Resize"_L1)) {
sendWindow_resize = 1;
- } else if (right.startsWith(QLatin1String("Restore"))) {
+ } else if (right.startsWith("Restore"_L1)) {
sendWindow_restore = 1;
- } else if (right.startsWith(QLatin1String("Restyle"))) {
+ } else if (right.startsWith("Restyle"_L1)) {
sendWindow_restyle = 1;
- } else if (right.startsWith(QLatin1String("Shade"))) {
+ } else if (right.startsWith("Shade"_L1)) {
sendWindow_shade = 1;
- } else if (right.startsWith(QLatin1String("Unshade"))) {
+ } else if (right.startsWith("Unshade"_L1)) {
sendWindow_unshade = 1;
- } else if (right.startsWith(QLatin1String("DesktopCreate"))) {
+ } else if (right.startsWith("DesktopCreate"_L1)) {
// ignore this one
- } else if (right.startsWith(QLatin1String("DesktopDestroy"))) {
+ } else if (right.startsWith("DesktopDestroy"_L1)) {
// ignore this one
} else {
- qCDebug(lcAccessibilityAtspi) << "WARNING: subscription string not handled:" << flag;
+ qCWarning(lcAccessibilityAtspi) << "Subscription string not handled:" << flag;
}
}
break;
@@ -759,7 +811,7 @@ void AtSpiAdaptor::setBitFlag(const QString &flag)
break;
}
default:
- qCDebug(lcAccessibilityAtspi) << "WARNING: subscription string not handled:" << flag;
+ qCWarning(lcAccessibilityAtspi) << "Subscription string not handled:" << flag;
}
}
@@ -768,9 +820,9 @@ void AtSpiAdaptor::setBitFlag(const QString &flag)
*/
void AtSpiAdaptor::updateEventListeners()
{
- QDBusMessage m = QDBusMessage::createMethodCall(QLatin1String("org.a11y.atspi.Registry"),
- QLatin1String("/org/a11y/atspi/registry"),
- QLatin1String("org.a11y.atspi.Registry"), QLatin1String("GetRegisteredEvents"));
+ QDBusMessage m = QDBusMessage::createMethodCall("org.a11y.atspi.Registry"_L1,
+ "/org/a11y/atspi/registry"_L1,
+ "org.a11y.atspi.Registry"_L1, "GetRegisteredEvents"_L1);
QDBusReply<QSpiEventListenerArray> listenersReply = m_dbus->connection().call(m);
if (listenersReply.isValid()) {
const QSpiEventListenerArray evList = listenersReply.value();
@@ -819,13 +871,12 @@ void AtSpiAdaptor::windowActivated(QObject* window, bool active)
QVariantList args = packDBusSignalArguments(QString(), 0, 0, QVariant::fromValue(data));
- QString status = active ? QLatin1String("Activate") : QLatin1String("Deactivate");
+ QString status = active ? "Activate"_L1 : "Deactivate"_L1;
QString path = pathForObject(window);
- sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_WINDOW), status, args);
+ sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_WINDOW ""_L1, status, args);
- QVariantList stateArgs = packDBusSignalArguments(QLatin1String("active"), active ? 1 : 0, 0, variantForPath(path));
- sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
- QLatin1String("StateChanged"), stateArgs);
+ QVariantList stateArgs = packDBusSignalArguments("active"_L1, active ? 1 : 0, 0, variantForPath(path));
+ sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1, "StateChanged"_L1, stateArgs);
}
QVariantList AtSpiAdaptor::packDBusSignalArguments(const QString &type, int data1, int data2, const QVariant &variantData) const
@@ -852,10 +903,10 @@ bool AtSpiAdaptor::sendDBusSignal(const QString &path, const QString &interface,
QAccessibleInterface *AtSpiAdaptor::interfaceFromPath(const QString& dbusPath) const
{
- if (dbusPath == QLatin1String(QSPI_OBJECT_PATH_ROOT))
+ if (dbusPath == QSPI_OBJECT_PATH_ROOT ""_L1)
return QAccessible::queryAccessibleInterface(qApp);
- QStringList parts = dbusPath.split(QLatin1Char('/'));
+ QStringList parts = dbusPath.split(u'/');
if (parts.size() != 6) {
qCDebug(lcAccessibilityAtspi) << "invalid path: " << dbusPath;
return nullptr;
@@ -875,8 +926,7 @@ void AtSpiAdaptor::notifyStateChange(QAccessibleInterface *interface, const QStr
{
QString path = pathForInterface(interface);
QVariantList stateArgs = packDBusSignalArguments(state, value, 0, variantForPath(path));
- sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
- QLatin1String("StateChanged"), stateArgs);
+ sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1, "StateChanged"_L1, stateArgs);
}
@@ -892,13 +942,13 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
break;
case QAccessible::ObjectShow: {
if (sendObject || sendObject_state_changed) {
- notifyStateChange(event->accessibleInterface(), QLatin1String("showing"), 1);
+ notifyStateChange(event->accessibleInterface(), "showing"_L1, 1);
}
break;
}
case QAccessible::ObjectHide: {
if (sendObject || sendObject_state_changed) {
- notifyStateChange(event->accessibleInterface(), QLatin1String("showing"), 0);
+ notifyStateChange(event->accessibleInterface(), "showing"_L1, 0);
}
break;
}
@@ -914,19 +964,37 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
}
case QAccessible::NameChanged: {
if (sendObject || sendObject_property_change || sendObject_property_change_accessible_name) {
- QString path = pathForInterface(event->accessibleInterface());
- QVariantList args = packDBusSignalArguments(QLatin1String("accessible-name"), 0, 0, variantForPath(path));
- sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
- QLatin1String("PropertyChange"), args);
+ QAccessibleInterface *iface = event->accessibleInterface();
+ if (!iface) {
+ qCDebug(lcAccessibilityAtspi,
+ "NameChanged event from invalid accessible.");
+ return;
+ }
+
+ QString path = pathForInterface(iface);
+ QVariantList args = packDBusSignalArguments(
+ "accessible-name"_L1, 0, 0,
+ QVariant::fromValue(QDBusVariant(iface->text(QAccessible::Name))));
+ sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1,
+ "PropertyChange"_L1, args);
}
break;
}
case QAccessible::DescriptionChanged: {
if (sendObject || sendObject_property_change || sendObject_property_change_accessible_description) {
- QString path = pathForInterface(event->accessibleInterface());
- QVariantList args = packDBusSignalArguments(QLatin1String("accessible-description"), 0, 0, variantForPath(path));
- sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
- QLatin1String("PropertyChange"), args);
+ QAccessibleInterface *iface = event->accessibleInterface();
+ if (!iface) {
+ qCDebug(lcAccessibilityAtspi,
+ "DescriptionChanged event from invalid accessible.");
+ return;
+ }
+
+ QString path = pathForInterface(iface);
+ QVariantList args = packDBusSignalArguments(
+ "accessible-description"_L1, 0, 0,
+ QVariant::fromValue(QDBusVariant(iface->text(QAccessible::Description))));
+ sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1,
+ "PropertyChange"_L1, args);
}
break;
}
@@ -941,7 +1009,7 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
if (sendObject || sendObject_text_changed) {
QAccessibleInterface * iface = event->accessibleInterface();
if (!iface || !iface->textInterface()) {
- qCDebug(lcAccessibilityAtspi) << "Received text event for invalid interface.";
+ qCWarning(lcAccessibilityAtspi) << "Received text event for invalid interface.";
return;
}
QString path = pathForInterface(iface);
@@ -973,16 +1041,16 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
if (!textRemoved.isEmpty()) {
data.setVariant(QVariant::fromValue(textRemoved));
- QVariantList args = packDBusSignalArguments(QLatin1String("delete"), changePosition, textRemoved.length(), QVariant::fromValue(data));
- sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
- QLatin1String("TextChanged"), args);
+ QVariantList args = packDBusSignalArguments("delete"_L1, changePosition, textRemoved.size(), QVariant::fromValue(data));
+ sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1,
+ "TextChanged"_L1, args);
}
if (!textInserted.isEmpty()) {
data.setVariant(QVariant::fromValue(textInserted));
- QVariantList args = packDBusSignalArguments(QLatin1String("insert"), changePosition, textInserted.length(), QVariant::fromValue(data));
- sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
- QLatin1String("TextChanged"), args);
+ QVariantList args = packDBusSignalArguments("insert"_L1, changePosition, textInserted.size(), QVariant::fromValue(data));
+ sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1,
+ "TextChanged"_L1, args);
}
// send a cursor update
@@ -990,8 +1058,8 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
// QDBusVariant cursorData;
// cursorData.setVariant(QVariant::fromValue(cursorPosition));
// QVariantList args = packDBusSignalArguments(QString(), cursorPosition, 0, QVariant::fromValue(cursorData));
-// sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
-// QLatin1String("TextCaretMoved"), args);
+// sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1,
+// "TextCaretMoved"_L1, args);
}
break;
}
@@ -1008,8 +1076,8 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
int pos = iface->textInterface()->cursorPosition();
cursorData.setVariant(QVariant::fromValue(pos));
QVariantList args = packDBusSignalArguments(QString(), pos, 0, QVariant::fromValue(cursorData));
- sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
- QLatin1String("TextCaretMoved"), args);
+ sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1,
+ "TextCaretMoved"_L1, args);
}
break;
}
@@ -1018,8 +1086,8 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
QAccessibleInterface * iface = event->accessibleInterface();
QString path = pathForInterface(iface);
QVariantList args = packDBusSignalArguments(QString(), 0, 0, QVariant::fromValue(QDBusVariant(QVariant(QString()))));
- sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
- QLatin1String("TextSelectionChanged"), args);
+ sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1,
+ "TextSelectionChanged"_L1, args);
}
break;
}
@@ -1032,19 +1100,21 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
}
if (iface->valueInterface()) {
QString path = pathForInterface(iface);
- QVariantList args = packDBusSignalArguments(QLatin1String("accessible-value"), 0, 0, variantForPath(path));
- sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
- QLatin1String("PropertyChange"), args);
+ QVariantList args = packDBusSignalArguments("accessible-value"_L1, 0, 0, variantForPath(path));
+ sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1,
+ "PropertyChange"_L1, args);
} else if (iface->role() == QAccessible::ComboBox) {
// Combo Box with AT-SPI likes to be special
// It requires a name-change to update caches and then selection-changed
QString path = pathForInterface(iface);
- QVariantList args1 = packDBusSignalArguments(QLatin1String("accessible-name"), 0, 0, variantForPath(path));
- sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
- QLatin1String("PropertyChange"), args1);
+ QVariantList args1 = packDBusSignalArguments(
+ "accessible-name"_L1, 0, 0,
+ QVariant::fromValue(QDBusVariant(iface->text(QAccessible::Name))));
+ sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1,
+ "PropertyChange"_L1, args1);
QVariantList args2 = packDBusSignalArguments(QString(), 0, 0, QVariant::fromValue(QDBusVariant(QVariant(0))));
- sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
- QLatin1String("SelectionChanged"), args2);
+ sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1,
+ "SelectionChanged"_L1, args2);
} else {
qCWarning(lcAccessibilityAtspi) << "ValueChanged event and no ValueInterface or ComboBox: " << iface;
}
@@ -1059,14 +1129,37 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
qCWarning(lcAccessibilityAtspi) << "Selection event from invalid accessible.";
return;
}
+ // send event for change of selected state for the interface itself
QString path = pathForInterface(iface);
int selected = iface->state().selected ? 1 : 0;
- QVariantList stateArgs = packDBusSignalArguments(QLatin1String("selected"), selected, 0, variantForPath(path));
- sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
- QLatin1String("StateChanged"), stateArgs);
+ QVariantList stateArgs = packDBusSignalArguments("selected"_L1, selected, 0, variantForPath(path));
+ sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1, "StateChanged"_L1, stateArgs);
+
+ // send SelectionChanged event for the parent
+ QAccessibleInterface* parent = iface->parent();
+ if (!parent) {
+ qCDebug(lcAccessibilityAtspi) << "No valid parent in selection event.";
+ return;
+ }
+
+ QString parentPath = pathForInterface(parent);
+ QVariantList args = packDBusSignalArguments(QString(), 0, 0, variantForPath(parentPath));
+ sendDBusSignal(parentPath, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
+ QLatin1String("SelectionChanged"), args);
break;
}
+ case QAccessible::SelectionWithin: {
+ QAccessibleInterface * iface = event->accessibleInterface();
+ if (!iface) {
+ qCWarning(lcAccessibilityAtspi) << "SelectionWithin event from invalid accessible.";
+ return;
+ }
+ QString path = pathForInterface(iface);
+ QVariantList args = packDBusSignalArguments(QString(), 0, 0, variantForPath(path));
+ sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT), QLatin1String("SelectionChanged"), args);
+ break;
+ }
case QAccessible::StateChanged: {
if (sendObject || sendObject_state_changed || sendWindow || sendWindow_activate) {
QAccessible::State stateChange = static_cast<QAccessibleStateChangeEvent*>(event)->changedStates();
@@ -1077,7 +1170,7 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
return;
}
int checked = iface->state().checked;
- notifyStateChange(iface, QLatin1String("checked"), checked);
+ notifyStateChange(iface, "checked"_L1, checked);
} else if (stateChange.active) {
QAccessibleInterface * iface = event->accessibleInterface();
if (!iface || !(iface->role() == QAccessible::Window && (sendWindow || sendWindow_activate)))
@@ -1087,26 +1180,91 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
QDBusVariant data;
data.setVariant(windowTitle);
QVariantList args = packDBusSignalArguments(QString(), 0, 0, QVariant::fromValue(data));
- QString status = isActive ? QLatin1String("Activate") : QLatin1String("Deactivate");
+ QString status = isActive ? "Activate"_L1 : "Deactivate"_L1;
QString path = pathForInterface(iface);
- sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_WINDOW), status, args);
- notifyStateChange(iface, QLatin1String("active"), isActive);
+ sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_WINDOW ""_L1, status, args);
+ notifyStateChange(iface, "active"_L1, isActive);
} else if (stateChange.disabled) {
QAccessibleInterface *iface = event->accessibleInterface();
QAccessible::State state = iface->state();
bool enabled = !state.disabled;
- notifyStateChange(iface, QLatin1String("enabled"), enabled);
- notifyStateChange(iface, QLatin1String("sensitive"), enabled);
+ notifyStateChange(iface, "enabled"_L1, enabled);
+ notifyStateChange(iface, "sensitive"_L1, enabled);
+ } else if (stateChange.focused) {
+ QAccessibleInterface *iface = event->accessibleInterface();
+ QAccessible::State state = iface->state();
+ bool focused = state.focused;
+ notifyStateChange(iface, "focused"_L1, focused);
}
}
break;
}
+ case QAccessible::TableModelChanged: {
+ QAccessibleInterface *interface = event->accessibleInterface();
+ if (!interface || !interface->isValid()) {
+ qCWarning(lcAccessibilityAtspi) << "TableModelChanged event from invalid accessible.";
+ return;
+ }
+
+ const QString path = pathForInterface(interface);
+ QAccessibleTableModelChangeEvent *tableModelEvent = static_cast<QAccessibleTableModelChangeEvent*>(event);
+ switch (tableModelEvent->modelChangeType()) {
+ case QAccessibleTableModelChangeEvent::ColumnsInserted: {
+ if (sendObject || sendObject_column_inserted) {
+ const int firstColumn = tableModelEvent->firstColumn();
+ const int insertedColumnCount = tableModelEvent->lastColumn() - firstColumn + 1;
+ QVariantList args = packDBusSignalArguments(QString(), firstColumn, insertedColumnCount, QVariant::fromValue(QDBusVariant(QVariant(QString()))));
+ sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1, "ColumnInserted"_L1, args);
+ }
+ break;
+ }
+ case QAccessibleTableModelChangeEvent::ColumnsRemoved: {
+ if (sendObject || sendObject_column_deleted) {
+ const int firstColumn = tableModelEvent->firstColumn();
+ const int removedColumnCount = tableModelEvent->lastColumn() - firstColumn + 1;
+ QVariantList args = packDBusSignalArguments(QString(), firstColumn, removedColumnCount, QVariant::fromValue(QDBusVariant(QVariant(QString()))));
+ sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1, "ColumnDeleted"_L1, args);
+ }
+ break;
+ }
+ case QAccessibleTableModelChangeEvent::RowsInserted: {
+ if (sendObject || sendObject_row_inserted) {
+ const int firstRow = tableModelEvent->firstRow();
+ const int insertedRowCount = tableModelEvent->lastRow() - firstRow + 1;
+ QVariantList args = packDBusSignalArguments(QString(), firstRow, insertedRowCount, QVariant::fromValue(QDBusVariant(QVariant(QString()))));
+ sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1, "RowInserted"_L1, args);
+ }
+ break;
+ }
+ case QAccessibleTableModelChangeEvent::RowsRemoved: {
+ if (sendObject || sendObject_row_deleted) {
+ const int firstRow = tableModelEvent->firstRow();
+ const int removedRowCount = tableModelEvent->lastRow() - firstRow + 1;
+ QVariantList args = packDBusSignalArguments(QString(), firstRow, removedRowCount, QVariant::fromValue(QDBusVariant(QVariant(QString()))));
+ sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1, "RowDeleted"_L1, args);
+ }
+ break;
+ }
+ case QAccessibleTableModelChangeEvent::ModelChangeType::ModelReset: {
+ if (sendObject || sendObject_model_changed) {
+ QVariantList args = packDBusSignalArguments(QString(), 0, 0, QVariant::fromValue(QDBusVariant(QVariant(QString()))));
+ sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1, "ModelChanged"_L1, args);
+ }
+ break;
+ }
+ case QAccessibleTableModelChangeEvent::DataChanged: {
+ if (sendObject || sendObject_visible_data_changed) {
+ QVariantList args = packDBusSignalArguments(QString(), 0, 0, QVariant::fromValue(QDBusVariant(QVariant(QString()))));
+ sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1, "VisibleDataChanged"_L1, args);
+ }
+ break;
+ }
+ }
+ break;
+ }
+
// For now we ignore these events
- case QAccessible::TableModelChanged:
- // For tables, setting manages_descendants should
- // indicate to the client that it cannot cache these
- // interfaces.
case QAccessible::ParentChanged:
case QAccessible::DialogStart:
case QAccessible::DialogEnd:
@@ -1151,7 +1309,6 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
case QAccessible::TextAttributeChanged:
case QAccessible::TextColumnChanged:
case QAccessible::VisibleDataChanged:
- case QAccessible::SelectionWithin:
case QAccessible::LocationChanged:
case QAccessible::HelpChanged:
case QAccessible::DefaultActionChanged:
@@ -1166,21 +1323,20 @@ void AtSpiAdaptor::sendFocusChanged(QAccessibleInterface *interface) const
static QString lastFocusPath;
// "remove" old focus
if (!lastFocusPath.isEmpty()) {
- QVariantList stateArgs = packDBusSignalArguments(QLatin1String("focused"), 0, 0, variantForPath(lastFocusPath));
- sendDBusSignal(lastFocusPath, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
- QLatin1String("StateChanged"), stateArgs);
+ QVariantList stateArgs = packDBusSignalArguments("focused"_L1, 0, 0, variantForPath(lastFocusPath));
+ sendDBusSignal(lastFocusPath, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1,
+ "StateChanged"_L1, stateArgs);
}
// send new focus
{
QString path = pathForInterface(interface);
- QVariantList stateArgs = packDBusSignalArguments(QLatin1String("focused"), 1, 0, variantForPath(path));
- sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
- QLatin1String("StateChanged"), stateArgs);
+ QVariantList stateArgs = packDBusSignalArguments("focused"_L1, 1, 0, variantForPath(path));
+ sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1,
+ "StateChanged"_L1, stateArgs);
QVariantList focusArgs = packDBusSignalArguments(QString(), 0, 0, variantForPath(path));
- sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_FOCUS),
- QLatin1String("Focus"), focusArgs);
+ sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_FOCUS ""_L1, "Focus"_L1, focusArgs);
lastFocusPath = path;
}
}
@@ -1191,16 +1347,13 @@ void AtSpiAdaptor::childrenChanged(QAccessibleInterface *interface) const
int childCount = interface->childCount();
for (int i = 0; i < interface->childCount(); ++i) {
QString childPath = pathForInterface(interface->child(i));
- QVariantList args = packDBusSignalArguments(QLatin1String("add"), childCount, 0, childPath);
- sendDBusSignal(parentPath, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT), QLatin1String("ChildrenChanged"), args);
+ QVariantList args = packDBusSignalArguments("add"_L1, childCount, 0, childPath);
+ sendDBusSignal(parentPath, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1, "ChildrenChanged"_L1, args);
}
}
void AtSpiAdaptor::notifyAboutCreation(QAccessibleInterface *interface) const
{
-// // say hello to d-bus
-// cache->emitAddAccessible(accessible->getCacheItem());
-
// notify about the new child of our parent
QAccessibleInterface * parent = interface->parent();
if (!parent) {
@@ -1210,8 +1363,8 @@ void AtSpiAdaptor::notifyAboutCreation(QAccessibleInterface *interface) const
QString path = pathForInterface(interface);
int childCount = parent->childCount();
QString parentPath = pathForInterface(parent);
- QVariantList args = packDBusSignalArguments(QLatin1String("add"), childCount, 0, variantForPath(path));
- sendDBusSignal(parentPath, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT), QLatin1String("ChildrenChanged"), args);
+ QVariantList args = packDBusSignalArguments("add"_L1, childCount, 0, variantForPath(path));
+ sendDBusSignal(parentPath, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1, "ChildrenChanged"_L1, args);
}
void AtSpiAdaptor::notifyAboutDestruction(QAccessibleInterface *interface) const
@@ -1236,8 +1389,8 @@ void AtSpiAdaptor::notifyAboutDestruction(QAccessibleInterface *interface) const
// }
QString parentPath = pathForInterface(parent);
- QVariantList args = packDBusSignalArguments(QLatin1String("remove"), childIndex, 0, variantForPath(path));
- sendDBusSignal(parentPath, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT), QLatin1String("ChildrenChanged"), args);
+ QVariantList args = packDBusSignalArguments("remove"_L1, childIndex, 0, variantForPath(path));
+ sendDBusSignal(parentPath, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1, "ChildrenChanged"_L1, args);
}
/*!
@@ -1249,11 +1402,11 @@ bool AtSpiAdaptor::handleMessage(const QDBusMessage &message, const QDBusConnect
// get accessible interface
QAccessibleInterface * accessible = interfaceFromPath(message.path());
if (!accessible) {
- qCDebug(lcAccessibilityAtspi) << "WARNING Qt AtSpiAdaptor: Could not find accessible on path: " << message.path();
+ qCWarning(lcAccessibilityAtspi) << "Could not find accessible on path:" << message.path();
return false;
}
if (!accessible->isValid()) {
- qCWarning(lcAccessibilityAtspi) << "WARNING Qt AtSpiAdaptor: Accessible invalid: " << accessible << message.path();
+ qCWarning(lcAccessibilityAtspi) << "Accessible invalid:" << accessible << message.path();
return false;
}
@@ -1262,35 +1415,39 @@ bool AtSpiAdaptor::handleMessage(const QDBusMessage &message, const QDBusConnect
// qCDebug(lcAccessibilityAtspi) << "AtSpiAdaptor::handleMessage: " << interface << function;
- if (function == QLatin1String("Introspect")) {
+ if (function == "Introspect"_L1) {
//introspect(message.path());
return false;
}
// handle properties like regular functions
- if (interface == QLatin1String("org.freedesktop.DBus.Properties")) {
+ if (interface == "org.freedesktop.DBus.Properties"_L1) {
interface = message.arguments().at(0).toString();
// Get/Set + Name
function = message.member() + message.arguments().at(1).toString();
}
// switch interface to call
- if (interface == QLatin1String(ATSPI_DBUS_INTERFACE_ACCESSIBLE))
+ if (interface == ATSPI_DBUS_INTERFACE_ACCESSIBLE ""_L1)
return accessibleInterface(accessible, function, message, connection);
- if (interface == QLatin1String(ATSPI_DBUS_INTERFACE_APPLICATION))
+ if (interface == ATSPI_DBUS_INTERFACE_APPLICATION ""_L1)
return applicationInterface(accessible, function, message, connection);
- if (interface == QLatin1String(ATSPI_DBUS_INTERFACE_COMPONENT))
+ if (interface == ATSPI_DBUS_INTERFACE_COMPONENT ""_L1)
return componentInterface(accessible, function, message, connection);
- if (interface == QLatin1String(ATSPI_DBUS_INTERFACE_ACTION))
+ if (interface == ATSPI_DBUS_INTERFACE_ACTION ""_L1)
return actionInterface(accessible, function, message, connection);
- if (interface == QLatin1String(ATSPI_DBUS_INTERFACE_TEXT))
+ if (interface == ATSPI_DBUS_INTERFACE_SELECTION ""_L1)
+ return selectionInterface(accessible, function, message, connection);
+ if (interface == ATSPI_DBUS_INTERFACE_TEXT ""_L1)
return textInterface(accessible, function, message, connection);
- if (interface == QLatin1String(ATSPI_DBUS_INTERFACE_EDITABLE_TEXT))
+ if (interface == ATSPI_DBUS_INTERFACE_EDITABLE_TEXT ""_L1)
return editableTextInterface(accessible, function, message, connection);
- if (interface == QLatin1String(ATSPI_DBUS_INTERFACE_VALUE))
+ if (interface == ATSPI_DBUS_INTERFACE_VALUE ""_L1)
return valueInterface(accessible, function, message, connection);
- if (interface == QLatin1String(ATSPI_DBUS_INTERFACE_TABLE))
+ if (interface == ATSPI_DBUS_INTERFACE_TABLE ""_L1)
return tableInterface(accessible, function, message, connection);
+ if (interface == ATSPI_DBUS_INTERFACE_TABLE_CELL ""_L1)
+ return tableCellInterface(accessible, function, message, connection);
qCDebug(lcAccessibilityAtspi) << "AtSpiAdaptor::handleMessage with unknown interface: " << message.path() << interface << function;
return false;
@@ -1299,35 +1456,35 @@ bool AtSpiAdaptor::handleMessage(const QDBusMessage &message, const QDBusConnect
// Application
bool AtSpiAdaptor::applicationInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection)
{
- if (message.path() != QLatin1String(ATSPI_DBUS_PATH_ROOT)) {
- qCDebug(lcAccessibilityAtspi) << "WARNING Qt AtSpiAdaptor: Could not find application interface for: " << message.path() << interface;
+ if (message.path() != ATSPI_DBUS_PATH_ROOT ""_L1) {
+ qCWarning(lcAccessibilityAtspi) << "Could not find application interface for:" << message.path() << interface;
return false;
}
- if (function == QLatin1String("SetId")) {
- Q_ASSERT(message.signature() == QLatin1String("ssv"));
+ if (function == "SetId"_L1) {
+ Q_ASSERT(message.signature() == "ssv"_L1);
QVariant value = qvariant_cast<QDBusVariant>(message.arguments().at(2)).variant();
m_applicationId = value.toInt();
return true;
}
- if (function == QLatin1String("GetId")) {
- Q_ASSERT(message.signature() == QLatin1String("ss"));
+ if (function == "GetId"_L1) {
+ Q_ASSERT(message.signature() == "ss"_L1);
QDBusMessage reply = message.createReply(QVariant::fromValue(QDBusVariant(m_applicationId)));
return connection.send(reply);
}
- if (function == QLatin1String("GetToolkitName")) {
- Q_ASSERT(message.signature() == QLatin1String("ss"));
- QDBusMessage reply = message.createReply(QVariant::fromValue(QDBusVariant(QLatin1String("Qt"))));
+ if (function == "GetToolkitName"_L1) {
+ Q_ASSERT(message.signature() == "ss"_L1);
+ QDBusMessage reply = message.createReply(QVariant::fromValue(QDBusVariant("Qt"_L1)));
return connection.send(reply);
}
- if (function == QLatin1String("GetVersion")) {
- Q_ASSERT(message.signature() == QLatin1String("ss"));
- QDBusMessage reply = message.createReply(QVariant::fromValue(QDBusVariant(QLatin1String(qVersion()))));
+ if (function == "GetVersion"_L1) {
+ Q_ASSERT(message.signature() == "ss"_L1);
+ QDBusMessage reply = message.createReply(QVariant::fromValue(QDBusVariant(QLatin1StringView(qVersion()))));
return connection.send(reply);
}
- if (function == QLatin1String("GetLocale")) {
- Q_ASSERT(message.signature() == QLatin1String("u"));
+ if (function == "GetLocale"_L1) {
+ Q_ASSERT(message.signature() == "u"_L1);
QDBusMessage reply = message.createReply(QVariant::fromValue(QLocale().name()));
return connection.send(reply);
}
@@ -1341,8 +1498,8 @@ bool AtSpiAdaptor::applicationInterface(QAccessibleInterface *interface, const Q
void AtSpiAdaptor::registerApplication()
{
OrgA11yAtspiSocketInterface *registry;
- registry = new OrgA11yAtspiSocketInterface(QLatin1String(QSPI_REGISTRY_NAME),
- QLatin1String(QSPI_OBJECT_PATH_ROOT), m_dbus->connection());
+ registry = new OrgA11yAtspiSocketInterface(QSPI_REGISTRY_NAME ""_L1,
+ QSPI_OBJECT_PATH_ROOT ""_L1, m_dbus->connection());
QDBusPendingReply<QSpiObjectReference> reply;
QSpiObjectReference ref = QSpiObjectReference(m_dbus->connection(), QDBusObjectPath(QSPI_OBJECT_PATH_ROOT));
@@ -1352,27 +1509,47 @@ void AtSpiAdaptor::registerApplication()
const QSpiObjectReference &socket = reply.value();
accessibilityRegistry = QSpiObjectReference(socket);
} else {
- qCDebug(lcAccessibilityAtspi) << "Error in contacting registry: "
+ qCWarning(lcAccessibilityAtspi) << "Error in contacting registry:"
<< reply.error().name()
<< reply.error().message();
}
delete registry;
}
+namespace {
+QString accessibleIdForAccessible(QAccessibleInterface *accessible)
+{
+ QString result;
+ while (accessible) {
+ if (!result.isEmpty())
+ result.prepend(u'.');
+ if (auto obj = accessible->object()) {
+ const QString name = obj->objectName();
+ if (!name.isEmpty())
+ result.prepend(name);
+ else
+ result.prepend(QString::fromUtf8(obj->metaObject()->className()));
+ }
+ accessible = accessible->parent();
+ }
+ return result;
+}
+} // namespace
+
// Accessible
bool AtSpiAdaptor::accessibleInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection)
{
- if (function == QLatin1String("GetRole")) {
+ if (function == "GetRole"_L1) {
sendReply(connection, message, (uint) getRole(interface));
- } else if (function == QLatin1String("GetName")) {
+ } else if (function == "GetName"_L1) {
sendReply(connection, message, QVariant::fromValue(QDBusVariant(interface->text(QAccessible::Name))));
- } else if (function == QLatin1String("GetRoleName")) {
+ } else if (function == "GetRoleName"_L1) {
sendReply(connection, message, QSpiAccessibleBridge::namesForRole(interface->role()).name());
- } else if (function == QLatin1String("GetLocalizedRoleName")) {
+ } else if (function == "GetLocalizedRoleName"_L1) {
sendReply(connection, message, QVariant::fromValue(QSpiAccessibleBridge::namesForRole(interface->role()).localizedName()));
- } else if (function == QLatin1String("GetChildCount")) {
+ } else if (function == "GetChildCount"_L1) {
sendReply(connection, message, QVariant::fromValue(QDBusVariant(interface->childCount())));
- } else if (function == QLatin1String("GetIndexInParent")) {
+ } else if (function == "GetIndexInParent"_L1) {
int childIndex = -1;
QAccessibleInterface * parent = interface->parent();
if (parent) {
@@ -1382,20 +1559,20 @@ bool AtSpiAdaptor::accessibleInterface(QAccessibleInterface *interface, const QS
}
}
sendReply(connection, message, childIndex);
- } else if (function == QLatin1String("GetParent")) {
+ } else if (function == "GetParent"_L1) {
QString path;
QAccessibleInterface * parent = interface->parent();
if (!parent) {
- path = QLatin1String(ATSPI_DBUS_PATH_NULL);
+ path = ATSPI_DBUS_PATH_NULL ""_L1;
} else if (parent->role() == QAccessible::Application) {
- path = QLatin1String(ATSPI_DBUS_PATH_ROOT);
+ path = ATSPI_DBUS_PATH_ROOT ""_L1;
} else {
path = pathForInterface(parent);
}
// Parent is a property, so it needs to be wrapped inside an extra variant.
sendReply(connection, message, QVariant::fromValue(
QDBusVariant(QVariant::fromValue(QSpiObjectReference(connection, QDBusObjectPath(path))))));
- } else if (function == QLatin1String("GetChildAtIndex")) {
+ } else if (function == "GetChildAtIndex"_L1) {
const int index = message.arguments().at(0).toInt();
if (index < 0) {
sendReply(connection, message, QVariant::fromValue(
@@ -1405,13 +1582,16 @@ bool AtSpiAdaptor::accessibleInterface(QAccessibleInterface *interface, const QS
sendReply(connection, message, QVariant::fromValue(
QSpiObjectReference(connection, QDBusObjectPath(pathForInterface(childInterface)))));
}
- } else if (function == QLatin1String("GetInterfaces")) {
+ } else if (function == "GetInterfaces"_L1) {
sendReply(connection, message, accessibleInterfaces(interface));
- } else if (function == QLatin1String("GetDescription")) {
+ } else if (function == "GetDescription"_L1) {
sendReply(connection, message, QVariant::fromValue(QDBusVariant(interface->text(QAccessible::Description))));
- } else if (function == QLatin1String("GetState")) {
+ } else if (function == "GetState"_L1) {
quint64 spiState = spiStatesFromQState(interface->state());
if (interface->tableInterface()) {
+ // For tables, setting manages_descendants should
+ // indicate to the client that it cannot cache these
+ // interfaces.
setSpiStateBit(&spiState, ATSPI_STATE_MANAGES_DESCENDANTS);
}
QAccessible::Role role = interface->role();
@@ -1425,14 +1605,14 @@ bool AtSpiAdaptor::accessibleInterface(QAccessibleInterface *interface, const QS
}
sendReply(connection, message,
QVariant::fromValue(spiStateSetFromSpiStates(spiState)));
- } else if (function == QLatin1String("GetAttributes")) {
+ } else if (function == "GetAttributes"_L1) {
sendReply(connection, message, QVariant::fromValue(QSpiAttributeSet()));
- } else if (function == QLatin1String("GetRelationSet")) {
+ } else if (function == "GetRelationSet"_L1) {
sendReply(connection, message, QVariant::fromValue(relationSet(interface, connection)));
- } else if (function == QLatin1String("GetApplication")) {
+ } else if (function == "GetApplication"_L1) {
sendReply(connection, message, QVariant::fromValue(
QSpiObjectReference(connection, QDBusObjectPath(QSPI_OBJECT_PATH_ROOT))));
- } else if (function == QLatin1String("GetChildren")) {
+ } else if (function == "GetChildren"_L1) {
QSpiObjectReferenceArray children;
const int numChildren = interface->childCount();
children.reserve(numChildren);
@@ -1442,8 +1622,11 @@ bool AtSpiAdaptor::accessibleInterface(QAccessibleInterface *interface, const QS
children << ref;
}
connection.send(message.createReply(QVariant::fromValue(children)));
+ } else if (function == "GetAccessibleId"_L1) {
+ sendReply(connection, message,
+ QVariant::fromValue(QDBusVariant(accessibleIdForAccessible(interface))));
} else {
- qCDebug(lcAccessibilityAtspi) << "WARNING: AtSpiAdaptor::accessibleInterface does not implement " << function << message.path();
+ qCWarning(lcAccessibilityAtspi) << "AtSpiAdaptor::accessibleInterface does not implement" << function << message.path();
return false;
}
return true;
@@ -1460,7 +1643,7 @@ QStringList AtSpiAdaptor::accessibleInterfaces(QAccessibleInterface *interface)
{
QStringList ifaces;
qCDebug(lcAccessibilityAtspiCreation) << "AtSpiAdaptor::accessibleInterfaces create: " << interface->object();
- ifaces << QLatin1String(ATSPI_DBUS_INTERFACE_ACCESSIBLE);
+ ifaces << u"" ATSPI_DBUS_INTERFACE_ACCESSIBLE ""_s;
if ( (!interface->rect().isEmpty()) ||
(interface->object() && interface->object()->isWidgetType()) ||
@@ -1470,27 +1653,33 @@ QStringList AtSpiAdaptor::accessibleInterfaces(QAccessibleInterface *interface)
(interface->role() == QAccessible::Row) ||
(interface->object() && interface->object()->inherits("QSGItem"))
) {
- ifaces << QLatin1String(ATSPI_DBUS_INTERFACE_COMPONENT);
+ ifaces << u"" ATSPI_DBUS_INTERFACE_COMPONENT ""_s;
} else {
qCDebug(lcAccessibilityAtspiCreation) << " IS NOT a component";
}
if (interface->role() == QAccessible::Application)
- ifaces << QLatin1String(ATSPI_DBUS_INTERFACE_APPLICATION);
+ ifaces << u"" ATSPI_DBUS_INTERFACE_APPLICATION ""_s;
if (interface->actionInterface() || interface->valueInterface())
- ifaces << QLatin1String(ATSPI_DBUS_INTERFACE_ACTION);
+ ifaces << u"" ATSPI_DBUS_INTERFACE_ACTION ""_s;
+
+ if (interface->selectionInterface())
+ ifaces << ATSPI_DBUS_INTERFACE_SELECTION ""_L1;
if (interface->textInterface())
- ifaces << QLatin1String(ATSPI_DBUS_INTERFACE_TEXT);
+ ifaces << u"" ATSPI_DBUS_INTERFACE_TEXT ""_s;
if (interface->editableTextInterface())
- ifaces << QLatin1String(ATSPI_DBUS_INTERFACE_EDITABLE_TEXT);
+ ifaces << u"" ATSPI_DBUS_INTERFACE_EDITABLE_TEXT ""_s;
if (interface->valueInterface())
- ifaces << QLatin1String(ATSPI_DBUS_INTERFACE_VALUE);
+ ifaces << u"" ATSPI_DBUS_INTERFACE_VALUE ""_s;
if (interface->tableInterface())
- ifaces << QLatin1String(ATSPI_DBUS_INTERFACE_TABLE);
+ ifaces << u"" ATSPI_DBUS_INTERFACE_TABLE ""_s;
+
+ if (interface->tableCellInterface())
+ ifaces << u"" ATSPI_DBUS_INTERFACE_TABLE_CELL ""_s;
return ifaces;
}
@@ -1527,7 +1716,7 @@ QString AtSpiAdaptor::pathForObject(QObject *object) const
Q_ASSERT(object);
if (inheritsQAction(object)) {
- qCDebug(lcAccessibilityAtspi) << "AtSpiAdaptor::pathForObject: warning: creating path with QAction as object.";
+ qCWarning(lcAccessibilityAtspi) << "AtSpiAdaptor::pathForObject: Creating path with QAction as object.";
}
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(object);
@@ -1537,21 +1726,21 @@ QString AtSpiAdaptor::pathForObject(QObject *object) const
QString AtSpiAdaptor::pathForInterface(QAccessibleInterface *interface) const
{
if (!interface || !interface->isValid())
- return QLatin1String(ATSPI_DBUS_PATH_NULL);
+ return u"" ATSPI_DBUS_PATH_NULL ""_s;
if (interface->role() == QAccessible::Application)
- return QLatin1String(QSPI_OBJECT_PATH_ROOT);
+ return u"" QSPI_OBJECT_PATH_ROOT ""_s;
QAccessible::Id id = QAccessible::uniqueId(interface);
Q_ASSERT((int)id < 0);
- return QLatin1String(QSPI_OBJECT_PATH_PREFIX) + QString::number(id);
+ return QSPI_OBJECT_PATH_PREFIX ""_L1 + QString::number(id);
}
bool AtSpiAdaptor::inheritsQAction(QObject *object)
{
const QMetaObject *mo = object->metaObject();
while (mo) {
- const QLatin1String cn(mo->className());
- if (cn == QLatin1String("QAction"))
+ const QLatin1StringView cn(mo->className());
+ if (cn == "QAction"_L1)
return true;
mo = mo->superClass();
}
@@ -1561,62 +1750,39 @@ bool AtSpiAdaptor::inheritsQAction(QObject *object)
// Component
static QAccessibleInterface * getWindow(QAccessibleInterface * interface)
{
- if (interface->role() == QAccessible::Window)
- return interface;
-
- QAccessibleInterface * parent = interface->parent();
- while (parent && parent->role() != QAccessible::Window)
- parent = parent->parent();
-
- return parent;
-}
-
-static QRect getRelativeRect(QAccessibleInterface *interface)
-{
- QAccessibleInterface * window;
- QRect wr, cr;
-
- cr = interface->rect();
-
- window = getWindow(interface);
- if (window) {
- wr = window->rect();
-
- cr.setX(cr.x() - wr.x());
- cr.setY(cr.x() - wr.y());
- }
- return cr;
+ // find top-level window in a11y hierarchy (either has a
+ // corresponding role or is a direct child of the application object)
+ QAccessibleInterface* app = QAccessible::queryAccessibleInterface(qApp);
+ while (interface && interface->role() != QAccessible::Dialog
+ && interface->role() != QAccessible::Window && interface->parent() != app)
+ interface = interface->parent();
+
+ return interface;
}
bool AtSpiAdaptor::componentInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection)
{
- if (function == QLatin1String("Contains")) {
+ if (function == "Contains"_L1) {
bool ret = false;
int x = message.arguments().at(0).toInt();
int y = message.arguments().at(1).toInt();
uint coordType = message.arguments().at(2).toUInt();
- if (coordType == ATSPI_COORD_TYPE_SCREEN)
- ret = interface->rect().contains(x, y);
- else
- ret = getRelativeRect(interface).contains(x, y);
+ if (!isValidCoordType(coordType))
+ return false;
+ ret = getExtents(interface, coordType).contains(x, y);
sendReply(connection, message, ret);
- } else if (function == QLatin1String("GetAccessibleAtPoint")) {
- int x = message.arguments().at(0).toInt();
- int y = message.arguments().at(1).toInt();
+ } else if (function == "GetAccessibleAtPoint"_L1) {
+ QPoint point(message.arguments().at(0).toInt(), message.arguments().at(1).toInt());
uint coordType = message.arguments().at(2).toUInt();
- if (coordType == ATSPI_COORD_TYPE_WINDOW) {
- QWindow * window = interface->window();
- if (window) {
- x += window->position().x();
- y += window->position().y();
- }
- }
+ if (!isValidCoordType(coordType))
+ return false;
+ QPoint screenPos = translateToScreenCoordinates(interface, point, coordType);
- QAccessibleInterface * childInterface(interface->childAt(x, y));
+ QAccessibleInterface * childInterface(interface->childAt(screenPos.x(), screenPos.y()));
QAccessibleInterface * iface = nullptr;
while (childInterface) {
iface = childInterface;
- childInterface = iface->childAt(x, y);
+ childInterface = iface->childAt(screenPos.x(), screenPos.y());
}
if (iface) {
QString path = pathForInterface(iface);
@@ -1626,31 +1792,31 @@ bool AtSpiAdaptor::componentInterface(QAccessibleInterface *interface, const QSt
sendReply(connection, message, QVariant::fromValue(
QSpiObjectReference(connection, QDBusObjectPath(ATSPI_DBUS_PATH_NULL))));
}
- } else if (function == QLatin1String("GetAlpha")) {
+ } else if (function == "GetAlpha"_L1) {
sendReply(connection, message, (double) 1.0);
- } else if (function == QLatin1String("GetExtents")) {
+ } else if (function == "GetExtents"_L1) {
uint coordType = message.arguments().at(0).toUInt();
+ if (!isValidCoordType(coordType))
+ return false;
sendReply(connection, message, QVariant::fromValue(getExtents(interface, coordType)));
- } else if (function == QLatin1String("GetLayer")) {
+ } else if (function == "GetLayer"_L1) {
sendReply(connection, message, QVariant::fromValue((uint)1));
- } else if (function == QLatin1String("GetMDIZOrder")) {
+ } else if (function == "GetMDIZOrder"_L1) {
sendReply(connection, message, QVariant::fromValue((short)0));
- } else if (function == QLatin1String("GetPosition")) {
+ } else if (function == "GetPosition"_L1) {
uint coordType = message.arguments().at(0).toUInt();
- QRect rect;
- if (coordType == ATSPI_COORD_TYPE_SCREEN)
- rect = interface->rect();
- else
- rect = getRelativeRect(interface);
+ if (!isValidCoordType(coordType))
+ return false;
+ QRect rect = getExtents(interface, coordType);
QVariantList pos;
pos << rect.x() << rect.y();
connection.send(message.createReply(pos));
- } else if (function == QLatin1String("GetSize")) {
+ } else if (function == "GetSize"_L1) {
QRect rect = interface->rect();
QVariantList size;
size << rect.width() << rect.height();
connection.send(message.createReply(size));
- } else if (function == QLatin1String("GrabFocus")) {
+ } else if (function == "GrabFocus"_L1) {
QAccessibleActionInterface *actionIface = interface->actionInterface();
if (actionIface && actionIface->actionNames().contains(QAccessibleActionInterface::setFocusAction())) {
actionIface->doAction(QAccessibleActionInterface::setFocusAction());
@@ -1658,7 +1824,7 @@ bool AtSpiAdaptor::componentInterface(QAccessibleInterface *interface, const QSt
} else {
sendReply(connection, message, false);
}
- } else if (function == QLatin1String("SetExtents")) {
+ } else if (function == "SetExtents"_L1) {
// int x = message.arguments().at(0).toInt();
// int y = message.arguments().at(1).toInt();
// int width = message.arguments().at(2).toInt();
@@ -1666,19 +1832,19 @@ bool AtSpiAdaptor::componentInterface(QAccessibleInterface *interface, const QSt
// uint coordinateType = message.arguments().at(4).toUInt();
qCDebug(lcAccessibilityAtspi) << "SetExtents is not implemented.";
sendReply(connection, message, false);
- } else if (function == QLatin1String("SetPosition")) {
+ } else if (function == "SetPosition"_L1) {
// int x = message.arguments().at(0).toInt();
// int y = message.arguments().at(1).toInt();
// uint coordinateType = message.arguments().at(2).toUInt();
qCDebug(lcAccessibilityAtspi) << "SetPosition is not implemented.";
sendReply(connection, message, false);
- } else if (function == QLatin1String("SetSize")) {
+ } else if (function == "SetSize"_L1) {
// int width = message.arguments().at(0).toInt();
// int height = message.arguments().at(1).toInt();
qCDebug(lcAccessibilityAtspi) << "SetSize is not implemented.";
sendReply(connection, message, false);
} else {
- qCDebug(lcAccessibilityAtspi) << "WARNING: AtSpiAdaptor::componentInterface does not implement " << function << message.path();
+ qCWarning(lcAccessibilityAtspi) << "AtSpiAdaptor::componentInterface does not implement" << function << message.path();
return false;
}
return true;
@@ -1686,35 +1852,35 @@ bool AtSpiAdaptor::componentInterface(QAccessibleInterface *interface, const QSt
QRect AtSpiAdaptor::getExtents(QAccessibleInterface *interface, uint coordType)
{
- return (coordType == ATSPI_COORD_TYPE_SCREEN) ? interface->rect() : getRelativeRect(interface);
+ return translateFromScreenCoordinates(interface, interface->rect(), coordType);
}
// Action interface
bool AtSpiAdaptor::actionInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection)
{
- if (function == QLatin1String("GetNActions")) {
- int count = QAccessibleBridgeUtils::effectiveActionNames(interface).count();
+ if (function == "GetNActions"_L1) {
+ int count = QAccessibleBridgeUtils::effectiveActionNames(interface).size();
sendReply(connection, message, QVariant::fromValue(QDBusVariant(QVariant::fromValue(count))));
- } else if (function == QLatin1String("DoAction")) {
+ } else if (function == "DoAction"_L1) {
int index = message.arguments().at(0).toInt();
const QStringList actionNames = QAccessibleBridgeUtils::effectiveActionNames(interface);
- if (index < 0 || index >= actionNames.count())
+ if (index < 0 || index >= actionNames.size())
return false;
const QString actionName = actionNames.at(index);
bool success = QAccessibleBridgeUtils::performEffectiveAction(interface, actionName);
sendReply(connection, message, success);
- } else if (function == QLatin1String("GetActions")) {
+ } else if (function == "GetActions"_L1) {
sendReply(connection, message, QVariant::fromValue(getActions(interface)));
- } else if (function == QLatin1String("GetName")) {
+ } else if (function == "GetName"_L1) {
int index = message.arguments().at(0).toInt();
const QStringList actionNames = QAccessibleBridgeUtils::effectiveActionNames(interface);
- if (index < 0 || index >= actionNames.count())
+ if (index < 0 || index >= actionNames.size())
return false;
sendReply(connection, message, actionNames.at(index));
- } else if (function == QLatin1String("GetDescription")) {
+ } else if (function == "GetDescription"_L1) {
int index = message.arguments().at(0).toInt();
const QStringList actionNames = QAccessibleBridgeUtils::effectiveActionNames(interface);
- if (index < 0 || index >= actionNames.count())
+ if (index < 0 || index >= actionNames.size())
return false;
QString description;
if (QAccessibleActionInterface *actionIface = interface->actionInterface())
@@ -1722,10 +1888,10 @@ bool AtSpiAdaptor::actionInterface(QAccessibleInterface *interface, const QStrin
else
description = qAccessibleLocalizedActionDescription(actionNames.at(index));
sendReply(connection, message, description);
- } else if (function == QLatin1String("GetKeyBinding")) {
+ } else if (function == "GetKeyBinding"_L1) {
int index = message.arguments().at(0).toInt();
const QStringList actionNames = QAccessibleBridgeUtils::effectiveActionNames(interface);
- if (index < 0 || index >= actionNames.count())
+ if (index < 0 || index >= actionNames.size())
return false;
QStringList keyBindings;
if (QAccessibleActionInterface *actionIface = interface->actionInterface())
@@ -1735,12 +1901,12 @@ bool AtSpiAdaptor::actionInterface(QAccessibleInterface *interface, const QStrin
if (!acc.isEmpty())
keyBindings.append(acc);
}
- if (keyBindings.length() > 0)
- sendReply(connection, message, keyBindings.join(QLatin1Char(';')));
+ if (keyBindings.size() > 0)
+ sendReply(connection, message, keyBindings.join(u';'));
else
sendReply(connection, message, QString());
} else {
- qCDebug(lcAccessibilityAtspi) << "WARNING: AtSpiAdaptor::actionInterface does not implement " << function << message.path();
+ qCWarning(lcAccessibilityAtspi) << "AtSpiAdaptor::actionInterface does not implement" << function << message.path();
return false;
}
return true;
@@ -1777,31 +1943,31 @@ bool AtSpiAdaptor::textInterface(QAccessibleInterface *interface, const QString
return false;
// properties
- if (function == QLatin1String("GetCaretOffset")) {
+ if (function == "GetCaretOffset"_L1) {
sendReply(connection, message, QVariant::fromValue(QDBusVariant(QVariant::fromValue(interface->textInterface()->cursorPosition()))));
- } else if (function == QLatin1String("GetCharacterCount")) {
+ } else if (function == "GetCharacterCount"_L1) {
sendReply(connection, message, QVariant::fromValue(QDBusVariant(QVariant::fromValue(interface->textInterface()->characterCount()))));
// functions
- } else if (function == QLatin1String("AddSelection")) {
+ } else if (function == "AddSelection"_L1) {
int startOffset = message.arguments().at(0).toInt();
int endOffset = message.arguments().at(1).toInt();
int lastSelection = interface->textInterface()->selectionCount();
interface->textInterface()->setSelection(lastSelection, startOffset, endOffset);
sendReply(connection, message, (interface->textInterface()->selectionCount() > lastSelection));
- } else if (function == QLatin1String("GetAttributeRun")) {
+ } else if (function == "GetAttributeRun"_L1) {
int offset = message.arguments().at(0).toInt();
bool includeDefaults = message.arguments().at(1).toBool();
Q_UNUSED(includeDefaults);
connection.send(message.createReply(getAttributes(interface, offset, includeDefaults)));
- } else if (function == QLatin1String("GetAttributeValue")) {
+ } else if (function == "GetAttributeValue"_L1) {
int offset = message.arguments().at(0).toInt();
QString attributeName = message.arguments().at(1).toString();
- connection.send(message.createReply(getAttributeValue(interface, offset, attributeName)));
- } else if (function == QLatin1String("GetAttributes")) {
+ connection.send(message.createReply(QVariant(getAttributeValue(interface, offset, attributeName))));
+ } else if (function == "GetAttributes"_L1) {
int offset = message.arguments().at(0).toInt();
connection.send(message.createReply(getAttributes(interface, offset, true)));
- } else if (function == QLatin1String("GetBoundedRanges")) {
+ } else if (function == "GetBoundedRanges"_L1) {
int x = message.arguments().at(0).toInt();
int y = message.arguments().at(1).toInt();
int width = message.arguments().at(2).toInt();
@@ -1818,39 +1984,43 @@ bool AtSpiAdaptor::textInterface(QAccessibleInterface *interface, const QString
Q_UNUSED(yClipType);
qCDebug(lcAccessibilityAtspi) << "Not implemented: QSpiAdaptor::GetBoundedRanges";
sendReply(connection, message, QVariant::fromValue(QSpiTextRangeList()));
- } else if (function == QLatin1String("GetCharacterAtOffset")) {
+ } else if (function == "GetCharacterAtOffset"_L1) {
int offset = message.arguments().at(0).toInt();
int start;
int end;
- QString result = interface->textInterface()->textAtOffset(offset, QAccessible::CharBoundary, &start, &end);
- sendReply(connection, message, (int) *(qPrintable (result)));
- } else if (function == QLatin1String("GetCharacterExtents")) {
+ const QString charString = interface->textInterface()
+ ->textAtOffset(offset, QAccessible::CharBoundary, &start, &end);
+ int codePoint = 0;
+ QStringIterator stringIt(charString);
+ if (stringIt.hasNext())
+ codePoint = static_cast<int>(stringIt.peekNext());
+ sendReply(connection, message, codePoint);
+ } else if (function == "GetCharacterExtents"_L1) {
int offset = message.arguments().at(0).toInt();
int coordType = message.arguments().at(1).toUInt();
connection.send(message.createReply(getCharacterExtents(interface, offset, coordType)));
- } else if (function == QLatin1String("GetDefaultAttributeSet") || function == QLatin1String("GetDefaultAttributes")) {
+ } else if (function == "GetDefaultAttributeSet"_L1 || function == "GetDefaultAttributes"_L1) {
// GetDefaultAttributes is deprecated in favour of GetDefaultAttributeSet.
// Empty set seems reasonable. There is no default attribute set.
sendReply(connection, message, QVariant::fromValue(QSpiAttributeSet()));
- } else if (function == QLatin1String("GetNSelections")) {
+ } else if (function == "GetNSelections"_L1) {
sendReply(connection, message, interface->textInterface()->selectionCount());
- } else if (function == QLatin1String("GetOffsetAtPoint")) {
+ } else if (function == "GetOffsetAtPoint"_L1) {
qCDebug(lcAccessibilityAtspi) << message.signature();
Q_ASSERT(!message.signature().isEmpty());
QPoint point(message.arguments().at(0).toInt(), message.arguments().at(1).toInt());
uint coordType = message.arguments().at(2).toUInt();
- if (coordType == ATSPI_COORD_TYPE_WINDOW) {
- QWindow *win = interface->window();
- point -= QPoint(win->x(), win->y());
- }
- int offset = interface->textInterface()->offsetAtPoint(point);
+ if (!isValidCoordType(coordType))
+ return false;
+ QPoint screenPos = translateToScreenCoordinates(interface, point, coordType);
+ int offset = interface->textInterface()->offsetAtPoint(screenPos);
sendReply(connection, message, offset);
- } else if (function == QLatin1String("GetRangeExtents")) {
+ } else if (function == "GetRangeExtents"_L1) {
int startOffset = message.arguments().at(0).toInt();
int endOffset = message.arguments().at(1).toInt();
uint coordType = message.arguments().at(2).toUInt();
connection.send(message.createReply(getRangeExtents(interface, startOffset, endOffset, coordType)));
- } else if (function == QLatin1String("GetSelection")) {
+ } else if (function == "GetSelection"_L1) {
int selectionNum = message.arguments().at(0).toInt();
int start, end;
interface->textInterface()->selection(selectionNum, &start, &end);
@@ -1859,58 +2029,75 @@ bool AtSpiAdaptor::textInterface(QAccessibleInterface *interface, const QString
QVariantList sel;
sel << start << end;
connection.send(message.createReply(sel));
- } else if (function == QLatin1String("GetText")) {
+ } else if (function == "GetStringAtOffset"_L1) {
+ int offset = message.arguments().at(0).toInt();
+ uint granularity = message.arguments().at(1).toUInt();
+ if (!isValidAtspiTextGranularity(granularity))
+ return false;
+ int startOffset, endOffset;
+ QString text = interface->textInterface()->textAtOffset(offset, qAccessibleBoundaryTypeFromAtspiTextGranularity(granularity), &startOffset, &endOffset);
+ QVariantList ret;
+ ret << text << startOffset << endOffset;
+ connection.send(message.createReply(ret));
+ } else if (function == "GetText"_L1) {
int startOffset = message.arguments().at(0).toInt();
int endOffset = message.arguments().at(1).toInt();
if (endOffset == -1) // AT-SPI uses -1 to signal all characters
endOffset = interface->textInterface()->characterCount();
sendReply(connection, message, interface->textInterface()->text(startOffset, endOffset));
- } else if (function == QLatin1String("GetTextAfterOffset")) {
+ } else if (function == "GetTextAfterOffset"_L1) {
int offset = message.arguments().at(0).toInt();
int type = message.arguments().at(1).toUInt();
int startOffset, endOffset;
- QString text = interface->textInterface()->textAfterOffset(offset, qAccessibleBoundaryType(type), &startOffset, &endOffset);
+ QString text = interface->textInterface()->textAfterOffset(offset, qAccessibleBoundaryTypeFromAtspiBoundaryType(type), &startOffset, &endOffset);
QVariantList ret;
ret << text << startOffset << endOffset;
connection.send(message.createReply(ret));
- } else if (function == QLatin1String("GetTextAtOffset")) {
+ } else if (function == "GetTextAtOffset"_L1) {
int offset = message.arguments().at(0).toInt();
int type = message.arguments().at(1).toUInt();
int startOffset, endOffset;
- QString text = interface->textInterface()->textAtOffset(offset, qAccessibleBoundaryType(type), &startOffset, &endOffset);
+ QString text = interface->textInterface()->textAtOffset(offset, qAccessibleBoundaryTypeFromAtspiBoundaryType(type), &startOffset, &endOffset);
QVariantList ret;
ret << text << startOffset << endOffset;
connection.send(message.createReply(ret));
- } else if (function == QLatin1String("GetTextBeforeOffset")) {
+ } else if (function == "GetTextBeforeOffset"_L1) {
int offset = message.arguments().at(0).toInt();
int type = message.arguments().at(1).toUInt();
int startOffset, endOffset;
- QString text = interface->textInterface()->textBeforeOffset(offset, qAccessibleBoundaryType(type), &startOffset, &endOffset);
+ QString text = interface->textInterface()->textBeforeOffset(offset, qAccessibleBoundaryTypeFromAtspiBoundaryType(type), &startOffset, &endOffset);
QVariantList ret;
ret << text << startOffset << endOffset;
connection.send(message.createReply(ret));
- } else if (function == QLatin1String("RemoveSelection")) {
+ } else if (function == "RemoveSelection"_L1) {
int selectionNum = message.arguments().at(0).toInt();
interface->textInterface()->removeSelection(selectionNum);
sendReply(connection, message, true);
- } else if (function == QLatin1String("SetCaretOffset")) {
+ } else if (function == "SetCaretOffset"_L1) {
int offset = message.arguments().at(0).toInt();
interface->textInterface()->setCursorPosition(offset);
sendReply(connection, message, true);
- } else if (function == QLatin1String("SetSelection")) {
+ } else if (function == "ScrollSubstringTo"_L1) {
+ int startOffset = message.arguments().at(0).toInt();
+ int endOffset = message.arguments().at(1).toInt();
+ // ignore third parameter (scroll type), since QAccessibleTextInterface::scrollToSubstring doesn't have that
+ qCInfo(lcAccessibilityAtspi) << "AtSpiAdaptor::ScrollSubstringTo doesn'take take scroll type into account.";
+ interface->textInterface()->scrollToSubstring(startOffset, endOffset);
+ sendReply(connection, message, true);
+ } else if (function == "SetSelection"_L1) {
int selectionNum = message.arguments().at(0).toInt();
int startOffset = message.arguments().at(1).toInt();
int endOffset = message.arguments().at(2).toInt();
interface->textInterface()->setSelection(selectionNum, startOffset, endOffset);
sendReply(connection, message, true);
} else {
- qCDebug(lcAccessibilityAtspi) << "WARNING: AtSpiAdaptor::textInterface does not implement " << function << message.path();
+ qCWarning(lcAccessibilityAtspi) << "AtSpiAdaptor::textInterface does not implement" << function << message.path();
return false;
}
return true;
}
-QAccessible::TextBoundaryType AtSpiAdaptor::qAccessibleBoundaryType(int atspiTextBoundaryType) const
+QAccessible::TextBoundaryType AtSpiAdaptor::qAccessibleBoundaryTypeFromAtspiBoundaryType(int atspiTextBoundaryType)
{
switch (atspiTextBoundaryType) {
case ATSPI_TEXT_BOUNDARY_CHAR:
@@ -1929,6 +2116,38 @@ QAccessible::TextBoundaryType AtSpiAdaptor::qAccessibleBoundaryType(int atspiTex
return QAccessible::CharBoundary;
}
+bool AtSpiAdaptor::isValidAtspiTextGranularity(uint atspiTextGranularity)
+{
+ if (atspiTextGranularity == ATSPI_TEXT_GRANULARITY_CHAR
+ || atspiTextGranularity == ATSPI_TEXT_GRANULARITY_WORD
+ || atspiTextGranularity == ATSPI_TEXT_GRANULARITY_SENTENCE
+ || atspiTextGranularity == ATSPI_TEXT_GRANULARITY_LINE
+ || atspiTextGranularity == ATSPI_TEXT_GRANULARITY_PARAGRAPH)
+ return true;
+
+ qCWarning(lcAccessibilityAtspi) << "Unknown value" << atspiTextGranularity << "for AT-SPI text granularity type";
+ return false;
+}
+
+QAccessible::TextBoundaryType AtSpiAdaptor::qAccessibleBoundaryTypeFromAtspiTextGranularity(uint atspiTextGranularity)
+{
+ Q_ASSERT(isValidAtspiTextGranularity(atspiTextGranularity));
+
+ switch (atspiTextGranularity) {
+ case ATSPI_TEXT_GRANULARITY_CHAR:
+ return QAccessible::CharBoundary;
+ case ATSPI_TEXT_GRANULARITY_WORD:
+ return QAccessible::WordBoundary;
+ case ATSPI_TEXT_GRANULARITY_SENTENCE:
+ return QAccessible::SentenceBoundary;
+ case ATSPI_TEXT_GRANULARITY_LINE:
+ return QAccessible::LineBoundary;
+ case ATSPI_TEXT_GRANULARITY_PARAGRAPH:
+ return QAccessible::ParagraphBoundary;
+ }
+ return QAccessible::CharBoundary;
+}
+
namespace
{
struct AtSpiAttribute {
@@ -1941,13 +2160,13 @@ namespace
QString atspiColor(const QString &ia2Color)
{
// "rgb(%u,%u,%u)" -> "%u,%u,%u"
- return ia2Color.mid(4, ia2Color.length() - (4+1));
+ return ia2Color.mid(4, ia2Color.size() - (4+1)).replace(u"\\,"_s, u","_s);
}
QString atspiSize(const QString &ia2Size)
{
// "%fpt" -> "%f"
- return ia2Size.left(ia2Size.length() - 2);
+ return ia2Size.left(ia2Size.size() - 2);
}
AtSpiAttribute atspiTextAttribute(const QString &ia2Name, const QString &ia2Value)
@@ -1955,88 +2174,86 @@ namespace
QString name = ia2Name;
QString value = ia2Value;
- // IAccessible2: http://www.linuxfoundation.org/collaborate/workgroups/accessibility/iaccessible2/textattributes
- // ATK attribute names: https://git.gnome.org/browse/orca/tree/src/orca/text_attribute_names.py
- // ATK attribute values: https://developer.gnome.org/atk/unstable/AtkText.html#AtkTextAttribute
+ // IAccessible2: https://wiki.linuxfoundation.org/accessibility/iaccessible2/textattributes
+ // ATK attribute names: https://gitlab.gnome.org/GNOME/orca/-/blob/master/src/orca/text_attribute_names.py
+ // ATK attribute values: https://gnome.pages.gitlab.gnome.org/atk/AtkText.html#AtkTextAttribute
// https://bugzilla.gnome.org/show_bug.cgi?id=744553 "ATK docs provide no guidance for allowed values of some text attributes"
// specifically for "weight", "invalid", "language" and value range for colors
- if (ia2Name == QLatin1String("background-color")) {
+ if (ia2Name == "background-color"_L1) {
name = QStringLiteral("bg-color");
value = atspiColor(value);
- } else if (ia2Name == QLatin1String("font-family")) {
+ } else if (ia2Name == "font-family"_L1) {
name = QStringLiteral("family-name");
- } else if (ia2Name == QLatin1String("color")) {
+ } else if (ia2Name == "color"_L1) {
name = QStringLiteral("fg-color");
value = atspiColor(value);
- } else if (ia2Name == QLatin1String("text-align")) {
+ } else if (ia2Name == "text-align"_L1) {
name = QStringLiteral("justification");
- if (value == QLatin1String("justify")) {
+ if (value == "justify"_L1) {
value = QStringLiteral("fill");
- } else {
- if (value != QLatin1String("left") &&
- value != QLatin1String("right") &&
- value != QLatin1String("center")
- ) {
- value = QString();
- qCDebug(lcAccessibilityAtspi) << "Unknown text-align attribute value \"" << value << "\" cannot be translated to AT-SPI.";
- }
+ } else if (value != "left"_L1 && value != "right"_L1 && value != "center"_L1) {
+ qCDebug(lcAccessibilityAtspi) << "Unknown text-align attribute value \""
+ << value << "\" cannot be translated to AT-SPI.";
+ value = QString();
}
- } else if (ia2Name == QLatin1String("font-size")) {
+ } else if (ia2Name == "font-size"_L1) {
name = QStringLiteral("size");
value = atspiSize(value);
- } else if (ia2Name == QLatin1String("font-style")) {
+ } else if (ia2Name == "font-style"_L1) {
name = QStringLiteral("style");
- if (value != QLatin1String("normal") &&
- value != QLatin1String("italic") &&
- value != QLatin1String("oblique")
- ) {
+ if (value != "normal"_L1 && value != "italic"_L1 && value != "oblique"_L1) {
+ qCDebug(lcAccessibilityAtspi) << "Unknown font-style attribute value \"" << value
+ << "\" cannot be translated to AT-SPI.";
value = QString();
- qCDebug(lcAccessibilityAtspi) << "Unknown font-style attribute value \"" << value << "\" cannot be translated to AT-SPI.";
}
- } else if (ia2Name == QLatin1String("text-underline-type")) {
+ } else if (ia2Name == "text-underline-type"_L1) {
name = QStringLiteral("underline");
- if (value != QLatin1String("none") &&
- value != QLatin1String("single") &&
- value != QLatin1String("double")
- ) {
+ if (value != "none"_L1 && value != "single"_L1 && value != "double"_L1) {
+ qCDebug(lcAccessibilityAtspi) << "Unknown text-underline-type attribute value \""
+ << value << "\" cannot be translated to AT-SPI.";
value = QString();
- qCDebug(lcAccessibilityAtspi) << "Unknown text-underline-type attribute value \"" << value << "\" cannot be translated to AT-SPI.";
}
- } else if (ia2Name == QLatin1String("font-weight")) {
+ } else if (ia2Name == "font-weight"_L1) {
name = QStringLiteral("weight");
- if (value == QLatin1String("normal"))
+ if (value == "normal"_L1)
// Orca seems to accept all IAccessible2 values except for "normal"
// (on which it produces traceback and fails to read any following text attributes),
// but that is the default value, so omit it anyway
value = QString();
- } else if (ia2Name == QLatin1String("text-position")) {
+ } else if (((ia2Name == "text-line-through-style"_L1 || ia2Name == "text-line-through-type"_L1) && (ia2Value != "none"_L1))
+ || (ia2Name == "text-line-through-text"_L1 && !ia2Value.isEmpty())) {
+ // if any of the above is set, set "strikethrough" to true, but don't explicitly set
+ // to false otherwise, since any of the others might still be set to indicate strikethrough
+ // and no strikethrough is assumed anyway when nothing is explicitly set
+ name = QStringLiteral("strikethrough");
+ value = QStringLiteral("true");
+ } else if (ia2Name == "text-position"_L1) {
name = QStringLiteral("vertical-align");
- if (value != QLatin1String("baseline") &&
- value != QLatin1String("super") &&
- value != QLatin1String("sub")
- ) {
+ if (value != "baseline"_L1 && value != "super"_L1 && value != "sub"_L1) {
+ qCDebug(lcAccessibilityAtspi) << "Unknown text-position attribute value \"" << value
+ << "\" cannot be translated to AT-SPI.";
value = QString();
- qCDebug(lcAccessibilityAtspi) << "Unknown text-position attribute value \"" << value << "\" cannot be translated to AT-SPI.";
}
- } else if (ia2Name == QLatin1String("writing-mode")) {
+ } else if (ia2Name == "writing-mode"_L1) {
name = QStringLiteral("direction");
- if (value == QLatin1String("lr"))
+ if (value == "lr"_L1)
value = QStringLiteral("ltr");
- else if (value == QLatin1String("rl"))
+ else if (value == "rl"_L1)
value = QStringLiteral("rtl");
- else if (value == QLatin1String("tb")) {
+ else if (value == "tb"_L1) {
// IAccessible2 docs refer to XSL, which specifies "tb" is shorthand for "tb-rl"; so at least give a hint about the horizontal direction (ATK does not support vertical direction in this attribute (yet))
value = QStringLiteral("rtl");
qCDebug(lcAccessibilityAtspi) << "writing-mode attribute value \"tb\" translated only w.r.t. horizontal direction; vertical direction ignored";
} else {
+ qCDebug(lcAccessibilityAtspi) << "Unknown writing-mode attribute value \"" << value
+ << "\" cannot be translated to AT-SPI.";
value = QString();
- qCDebug(lcAccessibilityAtspi) << "Unknown writing-mode attribute value \"" << value << "\" cannot be translated to AT-SPI.";
}
- } else if (ia2Name == QLatin1String("language")) {
+ } else if (ia2Name == "language"_L1) {
// OK - ATK has no docs on the format of the value, IAccessible2 has reasonable format - leave it at that now
- } else if (ia2Name == QLatin1String("invalid")) {
+ } else if (ia2Name == "invalid"_L1) {
// OK - ATK docs are vague but suggest they support the same range of values as IAccessible2
} else {
// attribute we know nothing about
@@ -2057,13 +2274,15 @@ QVariantList AtSpiAdaptor::getAttributes(QAccessibleInterface *interface, int of
int endOffset;
QString joined = interface->textInterface()->attributes(offset, &startOffset, &endOffset);
- const QStringList attributes = joined.split (QLatin1Char(';'), Qt::SkipEmptyParts, Qt::CaseSensitive);
+ const QStringList attributes = joined.split(u';', Qt::SkipEmptyParts, Qt::CaseSensitive);
for (const QString &attr : attributes) {
- QStringList items;
- items = attr.split(QLatin1Char(':'), Qt::SkipEmptyParts, Qt::CaseSensitive);
- AtSpiAttribute attribute = atspiTextAttribute(items[0], items[1]);
- if (!attribute.isNull())
- set[attribute.name] = attribute.value;
+ QStringList items = attr.split(u':', Qt::SkipEmptyParts, Qt::CaseSensitive);
+ if (items.count() == 2)
+ {
+ AtSpiAttribute attribute = atspiTextAttribute(items[0], items[1]);
+ if (!attribute.isNull())
+ set[attribute.name] = attribute.value;
+ }
}
QVariantList list;
@@ -2072,37 +2291,29 @@ QVariantList AtSpiAdaptor::getAttributes(QAccessibleInterface *interface, int of
return list;
}
-QVariantList AtSpiAdaptor::getAttributeValue(QAccessibleInterface *interface, int offset, const QString &attributeName) const
+QString AtSpiAdaptor::getAttributeValue(QAccessibleInterface *interface, int offset, const QString &attributeName) const
{
- QString mapped;
QString joined;
QSpiAttributeSet map;
int startOffset;
int endOffset;
joined = interface->textInterface()->attributes(offset, &startOffset, &endOffset);
- const QStringList attributes = joined.split (QLatin1Char(';'), Qt::SkipEmptyParts, Qt::CaseSensitive);
+ const QStringList attributes = joined.split (u';', Qt::SkipEmptyParts, Qt::CaseSensitive);
for (const QString& attr : attributes) {
QStringList items;
- items = attr.split(QLatin1Char(':'), Qt::SkipEmptyParts, Qt::CaseSensitive);
+ items = attr.split(u':', Qt::SkipEmptyParts, Qt::CaseSensitive);
AtSpiAttribute attribute = atspiTextAttribute(items[0], items[1]);
if (!attribute.isNull())
map[attribute.name] = attribute.value;
}
- mapped = map[attributeName];
- const bool defined = !mapped.isEmpty();
- QVariantList list;
- list << mapped << startOffset << endOffset << defined;
- return list;
+ return map[attributeName];
}
QList<QVariant> AtSpiAdaptor::getCharacterExtents(QAccessibleInterface *interface, int offset, uint coordType) const
{
QRect rect = interface->textInterface()->characterRect(offset);
-
- if (coordType == ATSPI_COORD_TYPE_WINDOW)
- rect = translateRectToWindowCoordinates(interface, rect);
-
+ rect = translateFromScreenCoordinates(interface, rect, coordType);
return QList<QVariant>() << rect.x() << rect.y() << rect.width() << rect.height();
}
@@ -2120,22 +2331,52 @@ QList<QVariant> AtSpiAdaptor::getRangeExtents(QAccessibleInterface *interface,
for (int i=startOffset + 1; i <= endOffset; i++)
rect = rect | textInterface->characterRect(i);
- // relative to window
- if (coordType == ATSPI_COORD_TYPE_WINDOW)
- rect = translateRectToWindowCoordinates(interface, rect);
-
+ rect = translateFromScreenCoordinates(interface, rect, coordType);
return QList<QVariant>() << rect.x() << rect.y() << rect.width() << rect.height();
}
-QRect AtSpiAdaptor::translateRectToWindowCoordinates(QAccessibleInterface *interface, const QRect &rect)
+bool AtSpiAdaptor::isValidCoordType(uint coordType)
{
- QAccessibleInterface * window = getWindow(interface);
- if (window)
- return rect.translated(-window->rect().x(), -window->rect().y());
+ if (coordType == ATSPI_COORD_TYPE_SCREEN || coordType == ATSPI_COORD_TYPE_WINDOW || coordType == ATSPI_COORD_TYPE_PARENT)
+ return true;
+
+ qCWarning(lcAccessibilityAtspi) << "Unknown value" << coordType << "for AT-SPI coord type";
+ return false;
+}
+
+QRect AtSpiAdaptor::translateFromScreenCoordinates(QAccessibleInterface *interface, const QRect &screenRect, uint targetCoordType)
+{
+ Q_ASSERT(isValidCoordType(targetCoordType));
+
+ QAccessibleInterface *upper = nullptr;
+ if (targetCoordType == ATSPI_COORD_TYPE_WINDOW)
+ upper = getWindow(interface);
+ else if (targetCoordType == ATSPI_COORD_TYPE_PARENT)
+ upper = interface->parent();
+
+ QRect rect = screenRect;
+ if (upper)
+ rect.translate(-upper->rect().x(), -upper->rect().y());
return rect;
}
+QPoint AtSpiAdaptor::translateToScreenCoordinates(QAccessibleInterface *interface, const QPoint &pos, uint fromCoordType)
+{
+ Q_ASSERT(isValidCoordType(fromCoordType));
+
+ QAccessibleInterface *upper = nullptr;
+ if (fromCoordType == ATSPI_COORD_TYPE_WINDOW)
+ upper = getWindow(interface);
+ else if (fromCoordType == ATSPI_COORD_TYPE_PARENT)
+ upper = interface->parent();
+
+ QPoint screenPos = pos;
+ if (upper)
+ screenPos += upper->rect().topLeft();
+
+ return screenPos;
+}
// Editable Text interface
static QString textForRange(QAccessibleInterface *accessible, int startOffset, int endOffset)
@@ -2147,7 +2388,7 @@ static QString textForRange(QAccessibleInterface *accessible, int startOffset, i
}
QString txt = accessible->text(QAccessible::Value);
if (endOffset == -1)
- endOffset = txt.length();
+ endOffset = txt.size();
return txt.mid(startOffset, endOffset - startOffset);
}
@@ -2155,7 +2396,7 @@ static void replaceTextFallback(QAccessibleInterface *accessible, long startOffs
{
QString t = textForRange(accessible, 0, -1);
if (endOffset == -1)
- endOffset = t.length();
+ endOffset = t.size();
if (endOffset - startOffset == 0)
t.insert(startOffset, txt);
else
@@ -2165,7 +2406,7 @@ static void replaceTextFallback(QAccessibleInterface *accessible, long startOffs
bool AtSpiAdaptor::editableTextInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection)
{
- if (function == QLatin1String("CopyText")) {
+ if (function == "CopyText"_L1) {
#ifndef QT_NO_CLIPBOARD
int startOffset = message.arguments().at(0).toInt();
int endOffset = message.arguments().at(1).toInt();
@@ -2173,7 +2414,7 @@ bool AtSpiAdaptor::editableTextInterface(QAccessibleInterface *interface, const
QGuiApplication::clipboard()->setText(t);
#endif
connection.send(message.createReply(true));
- } else if (function == QLatin1String("CutText")) {
+ } else if (function == "CutText"_L1) {
#ifndef QT_NO_CLIPBOARD
int startOffset = message.arguments().at(0).toInt();
int endOffset = message.arguments().at(1).toInt();
@@ -2185,7 +2426,7 @@ bool AtSpiAdaptor::editableTextInterface(QAccessibleInterface *interface, const
QGuiApplication::clipboard()->setText(t);
#endif
connection.send(message.createReply(true));
- } else if (function == QLatin1String("DeleteText")) {
+ } else if (function == "DeleteText"_L1) {
int startOffset = message.arguments().at(0).toInt();
int endOffset = message.arguments().at(1).toInt();
if (QAccessibleEditableTextInterface *editableTextIface = interface->editableTextInterface())
@@ -2193,7 +2434,7 @@ bool AtSpiAdaptor::editableTextInterface(QAccessibleInterface *interface, const
else
replaceTextFallback(interface, startOffset, endOffset, QString());
connection.send(message.createReply(true));
- } else if (function == QLatin1String("InsertText")) {
+ } else if (function == "InsertText"_L1) {
int position = message.arguments().at(0).toInt();
QString text = message.arguments().at(1).toString();
int length = message.arguments().at(2).toInt();
@@ -2203,7 +2444,7 @@ bool AtSpiAdaptor::editableTextInterface(QAccessibleInterface *interface, const
else
replaceTextFallback(interface, position, position, text);
connection.send(message.createReply(true));
- } else if (function == QLatin1String("PasteText")) {
+ } else if (function == "PasteText"_L1) {
#ifndef QT_NO_CLIPBOARD
int position = message.arguments().at(0).toInt();
const QString txt = QGuiApplication::clipboard()->text();
@@ -2213,17 +2454,17 @@ bool AtSpiAdaptor::editableTextInterface(QAccessibleInterface *interface, const
replaceTextFallback(interface, position, position, txt);
#endif
connection.send(message.createReply(true));
- } else if (function == QLatin1String("SetTextContents")) {
+ } else if (function == "SetTextContents"_L1) {
QString newContents = message.arguments().at(0).toString();
if (QAccessibleEditableTextInterface *editableTextIface = interface->editableTextInterface())
editableTextIface->replaceText(0, interface->textInterface()->characterCount(), newContents);
else
replaceTextFallback(interface, 0, -1, newContents);
connection.send(message.createReply(true));
- } else if (function == QLatin1String("")) {
+ } else if (function.isEmpty()) {
connection.send(message.createReply());
} else {
- qCDebug(lcAccessibilityAtspi) << "WARNING: AtSpiAdaptor::editableTextInterface does not implement " << function << message.path();
+ qCWarning(lcAccessibilityAtspi) << "AtSpiAdaptor::editableTextInterface does not implement" << function << message.path();
return false;
}
return true;
@@ -2236,29 +2477,29 @@ bool AtSpiAdaptor::valueInterface(QAccessibleInterface *interface, const QString
if (!valueIface)
return false;
- if (function == QLatin1String("SetCurrentValue")) {
+ if (function == "SetCurrentValue"_L1) {
QDBusVariant v = qvariant_cast<QDBusVariant>(message.arguments().at(2));
double value = v.variant().toDouble();
//Temporary fix
//See https://bugzilla.gnome.org/show_bug.cgi?id=652596
valueIface->setCurrentValue(value);
- connection.send(message.createReply()); // FIXME is the reply needed?
+ connection.send(message.createReply());
} else {
QVariant value;
- if (function == QLatin1String("GetCurrentValue"))
+ if (function == "GetCurrentValue"_L1)
value = valueIface->currentValue();
- else if (function == QLatin1String("GetMaximumValue"))
+ else if (function == "GetMaximumValue"_L1)
value = valueIface->maximumValue();
- else if (function == QLatin1String("GetMinimumIncrement"))
+ else if (function == "GetMinimumIncrement"_L1)
value = valueIface->minimumStepSize();
- else if (function == QLatin1String("GetMinimumValue"))
+ else if (function == "GetMinimumValue"_L1)
value = valueIface->minimumValue();
else {
- qCDebug(lcAccessibilityAtspi) << "WARNING: AtSpiAdaptor::valueInterface does not implement " << function << message.path();
+ qCWarning(lcAccessibilityAtspi) << "AtSpiAdaptor::valueInterface does not implement" << function << message.path();
return false;
}
if (!value.canConvert<double>()) {
- qCDebug(lcAccessibilityAtspi) << "AtSpiAdaptor::valueInterface: Could not convert to double: " << function;
+ qCWarning(lcAccessibilityAtspi) << "AtSpiAdaptor::valueInterface: Could not convert to double:" << function;
}
// explicitly convert to dbus-variant containing one double since atspi expects that
@@ -2269,49 +2510,104 @@ bool AtSpiAdaptor::valueInterface(QAccessibleInterface *interface, const QString
return true;
}
+// Selection interface
+bool AtSpiAdaptor::selectionInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection)
+{
+ QAccessibleSelectionInterface* selectionInterface = interface->selectionInterface();
+ if (!selectionInterface) {
+ qCWarning(lcAccessibilityAtspi) << "Could not find selection interface for: " << message.path() << interface;
+ return false;
+ }
+
+ if (function == "ClearSelection"_L1 ) {
+ connection.send(message.createReply(QVariant::fromValue((selectionInterface->clear()))));
+ } else if (function == "DeselectChild"_L1 ) {
+ int childIndex = message.arguments().at(0).toInt();
+ bool ret = false;
+ QAccessibleInterface *child = interface->child(childIndex);
+ if (child)
+ ret = selectionInterface->unselect(child);
+ connection.send(message.createReply(QVariant::fromValue(ret)));
+ } else if (function == "DeselectSelectedChild"_L1 ) {
+ int selectionIndex = message.arguments().at(0).toInt();
+ bool ret = false;
+ QAccessibleInterface *selectedChild = selectionInterface->selectedItem(selectionIndex);
+ if (selectedChild)
+ ret = selectionInterface->unselect(selectedChild);
+ connection.send(message.createReply(QVariant::fromValue(ret)));
+ } else if (function == "GetNSelectedChildren"_L1) {
+ connection.send(message.createReply(QVariant::fromValue(QDBusVariant(
+ QVariant::fromValue(selectionInterface->selectedItemCount())))));
+ } else if (function == "GetSelectedChild"_L1) {
+ int selectionIndex = message.arguments().at(0).toInt();
+ QSpiObjectReference ref(connection, QDBusObjectPath(pathForInterface(selectionInterface->selectedItem(selectionIndex))));
+ connection.send(message.createReply(QVariant::fromValue(ref)));
+ } else if (function == "IsChildSelected"_L1 ) {
+ int childIndex = message.arguments().at(0).toInt();
+ bool ret = false;
+ QAccessibleInterface *child = interface->child(childIndex);
+ if (child)
+ ret = selectionInterface->isSelected(child);
+ connection.send(message.createReply(QVariant::fromValue(ret)));
+ } else if (function == "SelectAll"_L1 ) {
+ connection.send(message.createReply(QVariant::fromValue(selectionInterface->selectAll())));
+ } else if (function == "SelectChild"_L1 ) {
+ int childIndex = message.arguments().at(0).toInt();
+ bool ret = false;
+ QAccessibleInterface *child = interface->child(childIndex);
+ if (child)
+ ret = selectionInterface->select(child);
+ connection.send(message.createReply(QVariant::fromValue(ret)));
+ } else {
+ qCWarning(lcAccessibilityAtspi) << "AtSpiAdaptor::selectionInterface does not implement " << function << message.path();
+ return false;
+ }
+
+ return true;
+}
+
+
// Table interface
bool AtSpiAdaptor::tableInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection)
{
if (!(interface->tableInterface() || interface->tableCellInterface())) {
- qCDebug(lcAccessibilityAtspi) << "WARNING Qt AtSpiAdaptor: Could not find table interface for: " << message.path() << interface;
+ qCWarning(lcAccessibilityAtspi) << "Qt AtSpiAdaptor: Could not find table interface for:" << message.path() << interface;
return false;
}
- if (0) {
- // properties
- } else if (function == QLatin1String("GetCaption")) {
+ if (function == "GetCaption"_L1) {
QAccessibleInterface * captionInterface= interface->tableInterface()->caption();
if (captionInterface) {
QSpiObjectReference ref = QSpiObjectReference(connection, QDBusObjectPath(pathForInterface(captionInterface)));
- sendReply(connection, message, QVariant::fromValue(ref));
+ sendReply(connection, message, QVariant::fromValue(QDBusVariant(QVariant::fromValue(ref))));
} else {
- sendReply(connection, message, QVariant::fromValue(
- QSpiObjectReference(connection, QDBusObjectPath(ATSPI_DBUS_PATH_NULL))));
+ sendReply(connection, message, QVariant::fromValue(QDBusVariant(QVariant::fromValue(
+ QSpiObjectReference(connection, QDBusObjectPath(ATSPI_DBUS_PATH_NULL))))));
}
- } else if (function == QLatin1String("GetNColumns")) {
+ } else if (function == "GetNColumns"_L1) {
connection.send(message.createReply(QVariant::fromValue(QDBusVariant(
QVariant::fromValue(interface->tableInterface()->columnCount())))));
- } else if (function == QLatin1String("GetNRows")) {
+ } else if (function == "GetNRows"_L1) {
connection.send(message.createReply(QVariant::fromValue(QDBusVariant(
QVariant::fromValue(interface->tableInterface()->rowCount())))));
- } else if (function == QLatin1String("GetNSelectedColumns")) {
+ } else if (function == "GetNSelectedColumns"_L1) {
connection.send(message.createReply(QVariant::fromValue(QDBusVariant(
QVariant::fromValue(interface->tableInterface()->selectedColumnCount())))));
- } else if (function == QLatin1String("GetNSelectedRows")) {
+ } else if (function == "GetNSelectedRows"_L1) {
connection.send(message.createReply(QVariant::fromValue(QDBusVariant(
QVariant::fromValue(interface->tableInterface()->selectedRowCount())))));
- } else if (function == QLatin1String("GetSummary")) {
+ } else if (function == "GetSummary"_L1) {
QAccessibleInterface *summary = interface->tableInterface() ? interface->tableInterface()->summary() : nullptr;
QSpiObjectReference ref(connection, QDBusObjectPath(pathForInterface(summary)));
connection.send(message.createReply(QVariant::fromValue(QDBusVariant(QVariant::fromValue(ref)))));
- } else if (function == QLatin1String("GetAccessibleAt")) {
+ } else if (function == "GetAccessibleAt"_L1) {
int row = message.arguments().at(0).toInt();
int column = message.arguments().at(1).toInt();
if ((row < 0) ||
(column < 0) ||
(row >= interface->tableInterface()->rowCount()) ||
(column >= interface->tableInterface()->columnCount())) {
- qCDebug(lcAccessibilityAtspi) << "WARNING: invalid index for tableInterface GetAccessibleAt (" << row << ", " << column << ')';
+ qCWarning(lcAccessibilityAtspi) << "Invalid index for tableInterface GetAccessibleAt (" << row << "," << column << ')';
return false;
}
@@ -2320,37 +2616,37 @@ bool AtSpiAdaptor::tableInterface(QAccessibleInterface *interface, const QString
if (cell) {
ref = QSpiObjectReference(connection, QDBusObjectPath(pathForInterface(cell)));
} else {
- qCDebug(lcAccessibilityAtspi) << "WARNING: no cell interface returned for " << interface->object() << row << column;
+ qCWarning(lcAccessibilityAtspi) << "No cell interface returned for" << interface->object() << row << column;
ref = QSpiObjectReference();
}
connection.send(message.createReply(QVariant::fromValue(ref)));
- } else if (function == QLatin1String("GetIndexAt")) {
+ } else if (function == "GetIndexAt"_L1) {
int row = message.arguments().at(0).toInt();
int column = message.arguments().at(1).toInt();
QAccessibleInterface *cell = interface->tableInterface()->cellAt(row, column);
if (!cell) {
- qCDebug(lcAccessibilityAtspi) << "WARNING: AtSpiAdaptor::GetIndexAt(" << row << ',' << column << ") did not find a cell. " << interface;
+ qCWarning(lcAccessibilityAtspi) << "AtSpiAdaptor::GetIndexAt(" << row << ',' << column << ") did not find a cell." << interface;
return false;
}
int index = interface->indexOfChild(cell);
qCDebug(lcAccessibilityAtspi) << "QSpiAdaptor::GetIndexAt row:" << row << " col:" << column << " logical index:" << index;
Q_ASSERT(index > 0);
connection.send(message.createReply(index));
- } else if ((function == QLatin1String("GetColumnAtIndex")) || (function == QLatin1String("GetRowAtIndex"))) {
+ } else if ((function == "GetColumnAtIndex"_L1) || (function == "GetRowAtIndex"_L1)) {
int index = message.arguments().at(0).toInt();
int ret = -1;
if (index >= 0) {
QAccessibleInterface * cell = interface->child(index);
if (cell) {
- if (function == QLatin1String("GetColumnAtIndex")) {
+ if (function == "GetColumnAtIndex"_L1) {
if (cell->role() == QAccessible::ColumnHeader) {
ret = index;
} else if (cell->role() == QAccessible::RowHeader) {
ret = -1;
} else {
if (!cell->tableCellInterface()) {
- qCDebug(lcAccessibilityAtspi) << "WARNING: AtSpiAdaptor::" << function << " No table cell interface: " << cell;
+ qCWarning(lcAccessibilityAtspi).nospace() << "AtSpiAdaptor::" << function << " No table cell interface: " << cell;
return false;
}
ret = cell->tableCellInterface()->columnIndex();
@@ -2362,29 +2658,29 @@ bool AtSpiAdaptor::tableInterface(QAccessibleInterface *interface, const QString
ret = index % interface->tableInterface()->columnCount();
} else {
if (!cell->tableCellInterface()) {
- qCDebug(lcAccessibilityAtspi) << "WARNING: AtSpiAdaptor::" << function << " No table cell interface: " << cell;
+ qCWarning(lcAccessibilityAtspi).nospace() << "AtSpiAdaptor::" << function << " No table cell interface: " << cell;
return false;
}
ret = cell->tableCellInterface()->rowIndex();
}
}
} else {
- qCDebug(lcAccessibilityAtspi) << "WARNING: AtSpiAdaptor::" << function << " No cell at index: " << index << interface;
+ qCWarning(lcAccessibilityAtspi).nospace() << "AtSpiAdaptor::" << function << " No cell at index: " << index << " " << interface;
return false;
}
}
connection.send(message.createReply(ret));
- } else if (function == QLatin1String("GetColumnDescription")) {
+ } else if (function == "GetColumnDescription"_L1) {
int column = message.arguments().at(0).toInt();
connection.send(message.createReply(interface->tableInterface()->columnDescription(column)));
- } else if (function == QLatin1String("GetRowDescription")) {
+ } else if (function == "GetRowDescription"_L1) {
int row = message.arguments().at(0).toInt();
connection.send(message.createReply(interface->tableInterface()->rowDescription(row)));
- } else if (function == QLatin1String("GetRowColumnExtentsAtIndex")) {
+ } else if (function == "GetRowColumnExtentsAtIndex"_L1) {
int index = message.arguments().at(0).toInt();
bool success = false;
@@ -2398,31 +2694,42 @@ bool AtSpiAdaptor::tableInterface(QAccessibleInterface *interface, const QString
if (cols > 0) {
row = index / cols;
col = index % cols;
- QAccessibleTableCellInterface *cell = interface->tableInterface()->cellAt(row, col)->tableCellInterface();
- if (cell) {
- row = cell->rowIndex();
- col = cell->columnIndex();
- rowExtents = cell->rowExtent();
- colExtents = cell->columnExtent();
- isSelected = cell->isSelected();
- success = true;
+ if (QAccessibleInterface *cell = interface->tableInterface()->cellAt(row, col)) {
+ if (QAccessibleTableCellInterface *cellIface = cell->tableCellInterface()) {
+ row = cellIface->rowIndex();
+ col = cellIface->columnIndex();
+ rowExtents = cellIface->rowExtent();
+ colExtents = cellIface->columnExtent();
+ isSelected = cellIface->isSelected();
+ success = true;
+ }
}
}
QVariantList list;
list << success << row << col << rowExtents << colExtents << isSelected;
connection.send(message.createReply(list));
- } else if (function == QLatin1String("GetColumnExtentAt")) {
+ } else if (function == "GetColumnExtentAt"_L1) {
int row = message.arguments().at(0).toInt();
int column = message.arguments().at(1).toInt();
- connection.send(message.createReply(interface->tableInterface()->cellAt(row, column)->tableCellInterface()->columnExtent()));
+ int columnExtent = 0;
+ if (QAccessibleInterface *cell = interface->tableInterface()->cellAt(row, column)) {
+ if (QAccessibleTableCellInterface *cellIface = cell->tableCellInterface())
+ columnExtent = cellIface->columnExtent();
+ }
+ connection.send(message.createReply(columnExtent));
- } else if (function == QLatin1String("GetRowExtentAt")) {
+ } else if (function == "GetRowExtentAt"_L1) {
int row = message.arguments().at(0).toInt();
int column = message.arguments().at(1).toInt();
- connection.send(message.createReply(interface->tableInterface()->cellAt(row, column)->tableCellInterface()->rowExtent()));
+ int rowExtent = 0;
+ if (QAccessibleInterface *cell = interface->tableInterface()->cellAt(row, column)) {
+ if (QAccessibleTableCellInterface *cellIface = cell->tableCellInterface())
+ rowExtent = cellIface->rowExtent();
+ }
+ connection.send(message.createReply(rowExtent));
- } else if (function == QLatin1String("GetColumnHeader")) {
+ } else if (function == "GetColumnHeader"_L1) {
int column = message.arguments().at(0).toInt();
QSpiObjectReference ref;
@@ -2435,51 +2742,115 @@ bool AtSpiAdaptor::tableInterface(QAccessibleInterface *interface, const QString
}
connection.send(message.createReply(QVariant::fromValue(ref)));
- } else if (function == QLatin1String("GetRowHeader")) {
+ } else if (function == "GetRowHeader"_L1) {
int row = message.arguments().at(0).toInt();
QSpiObjectReference ref;
- QAccessibleTableCellInterface *cell = interface->tableInterface()->cellAt(row, 0)->tableCellInterface();
- if (cell) {
- QList<QAccessibleInterface*> header = cell->rowHeaderCells();
+ QAccessibleInterface *cell = interface->tableInterface()->cellAt(row, 0);
+ if (cell && cell->tableCellInterface()) {
+ QList<QAccessibleInterface*> header = cell->tableCellInterface()->rowHeaderCells();
if (header.size() > 0) {
ref = QSpiObjectReference(connection, QDBusObjectPath(pathForInterface(header.takeAt(0))));
}
}
connection.send(message.createReply(QVariant::fromValue(ref)));
- } else if (function == QLatin1String("GetSelectedColumns")) {
+ } else if (function == "GetSelectedColumns"_L1) {
connection.send(message.createReply(QVariant::fromValue(interface->tableInterface()->selectedColumns())));
- } else if (function == QLatin1String("GetSelectedRows")) {
+ } else if (function == "GetSelectedRows"_L1) {
connection.send(message.createReply(QVariant::fromValue(interface->tableInterface()->selectedRows())));
- } else if (function == QLatin1String("IsColumnSelected")) {
+ } else if (function == "IsColumnSelected"_L1) {
int column = message.arguments().at(0).toInt();
connection.send(message.createReply(interface->tableInterface()->isColumnSelected(column)));
- } else if (function == QLatin1String("IsRowSelected")) {
+ } else if (function == "IsRowSelected"_L1) {
int row = message.arguments().at(0).toInt();
connection.send(message.createReply(interface->tableInterface()->isRowSelected(row)));
- } else if (function == QLatin1String("IsSelected")) {
+ } else if (function == "IsSelected"_L1) {
int row = message.arguments().at(0).toInt();
int column = message.arguments().at(1).toInt();
- QAccessibleTableCellInterface* cell = interface->tableInterface()->cellAt(row, column)->tableCellInterface();
- connection.send(message.createReply(cell->isSelected()));
- } else if (function == QLatin1String("AddColumnSelection")) {
+ bool selected = false;
+ if (QAccessibleInterface* cell = interface->tableInterface()->cellAt(row, column)) {
+ if (QAccessibleTableCellInterface *cellIface = cell->tableCellInterface())
+ selected = cellIface->isSelected();
+ }
+ connection.send(message.createReply(selected));
+ } else if (function == "AddColumnSelection"_L1) {
int column = message.arguments().at(0).toInt();
connection.send(message.createReply(interface->tableInterface()->selectColumn(column)));
- } else if (function == QLatin1String("AddRowSelection")) {
+ } else if (function == "AddRowSelection"_L1) {
int row = message.arguments().at(0).toInt();
connection.send(message.createReply(interface->tableInterface()->selectRow(row)));
- } else if (function == QLatin1String("RemoveColumnSelection")) {
+ } else if (function == "RemoveColumnSelection"_L1) {
int column = message.arguments().at(0).toInt();
connection.send(message.createReply(interface->tableInterface()->unselectColumn(column)));
- } else if (function == QLatin1String("RemoveRowSelection")) {
+ } else if (function == "RemoveRowSelection"_L1) {
int row = message.arguments().at(0).toInt();
connection.send(message.createReply(interface->tableInterface()->unselectRow(row)));
} else {
- qCDebug(lcAccessibilityAtspi) << "WARNING: AtSpiAdaptor::tableInterface does not implement " << function << message.path();
+ qCWarning(lcAccessibilityAtspi) << "AtSpiAdaptor::tableInterface does not implement" << function << message.path();
return false;
}
return true;
}
+// Table cell interface
+bool AtSpiAdaptor::tableCellInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection)
+{
+ QAccessibleTableCellInterface* cellInterface = interface->tableCellInterface();
+ if (!cellInterface) {
+ qCWarning(lcAccessibilityAtspi) << "Could not find table cell interface for: " << message.path() << interface;
+ return false;
+ }
+
+ if (function == "GetColumnHeaderCells"_L1) {
+ QSpiObjectReferenceArray headerCells;
+ const auto headerCellInterfaces = cellInterface->columnHeaderCells();
+ headerCells.reserve(headerCellInterfaces.size());
+ for (QAccessibleInterface *cell : headerCellInterfaces) {
+ const QString childPath = pathForInterface(cell);
+ const QSpiObjectReference ref(connection, QDBusObjectPath(childPath));
+ headerCells << ref;
+ }
+ connection.send(message.createReply(QVariant::fromValue(headerCells)));
+ } else if (function == "GetColumnSpan"_L1) {
+ connection.send(message.createReply(QVariant::fromValue(QDBusVariant(
+ QVariant::fromValue(cellInterface->columnExtent())))));
+ } else if (function == "GetPosition"_L1) {
+ const int row = cellInterface->rowIndex();
+ const int column = cellInterface->columnIndex();
+ connection.send(message.createReply(QVariant::fromValue(QDBusVariant(
+ QVariant::fromValue(QPoint(row, column))))));
+ } else if (function == "GetRowHeaderCells"_L1) {
+ QSpiObjectReferenceArray headerCells;
+ const auto headerCellInterfaces = cellInterface->rowHeaderCells();
+ headerCells.reserve(headerCellInterfaces.size());
+ for (QAccessibleInterface *cell : headerCellInterfaces) {
+ const QString childPath = pathForInterface(cell);
+ const QSpiObjectReference ref(connection, QDBusObjectPath(childPath));
+ headerCells << ref;
+ }
+ connection.send(message.createReply(QVariant::fromValue(headerCells)));
+ } else if (function == "GetRowSpan"_L1) {
+ connection.send(message.createReply(QVariant::fromValue(QDBusVariant(
+ QVariant::fromValue(cellInterface->rowExtent())))));
+ } else if (function == "GetRowColumnSpan"_L1) {
+ QVariantList list;
+ list << cellInterface->rowIndex() << cellInterface->columnIndex() << cellInterface->rowExtent() << cellInterface->columnExtent();
+ connection.send(message.createReply(list));
+ } else if (function == "GetTable"_L1) {
+ QSpiObjectReference ref;
+ QAccessibleInterface* table = cellInterface->table();
+ if (table && table->tableInterface())
+ ref = QSpiObjectReference(connection, QDBusObjectPath(pathForInterface(table)));
+ connection.send(message.createReply(QVariant::fromValue(QDBusVariant(QVariant::fromValue(ref)))));
+ } else {
+ qCWarning(lcAccessibilityAtspi) << "AtSpiAdaptor::tableCellInterface does not implement" << function << message.path();
+ return false;
+ }
+
+ return true;
+}
+
QT_END_NAMESPACE
-#endif //QT_NO_ACCESSIBILITY
+
+#include "moc_atspiadaptor_p.cpp"
+#endif // QT_CONFIG(accessibility)
diff --git a/src/gui/accessible/linux/atspiadaptor_p.h b/src/gui/accessible/linux/atspiadaptor_p.h
index b9f4011695..3a890f3d7d 100644
--- a/src/gui/accessible/linux/atspiadaptor_p.h
+++ b/src/gui/accessible/linux/atspiadaptor_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef ATSPIADAPTOR_H
@@ -55,7 +19,6 @@
#include <atspi/atspi-constants.h>
#include <QtGui/private/qtguiglobal_p.h>
-#include <QtCore/qsharedpointer.h>
#include <QtDBus/qdbusvirtualobject.h>
#include <QtGui/qaccessible.h>
@@ -67,7 +30,6 @@ QT_REQUIRE_CONFIG(accessibility);
QT_BEGIN_NAMESPACE
class QAccessibleInterface;
-class QSpiAccessibleInterface;
class QSpiApplicationAdaptor;
@@ -84,8 +46,6 @@ public:
bool handleMessage(const QDBusMessage &message, const QDBusConnection &connection) override;
void notify(QAccessibleEvent *event);
- void init();
- void checkInitializedAndEnabled();
public Q_SLOTS:
void eventListenerRegistered(const QString &bus, const QString &path);
void eventListenerDeregistered(const QString &bus, const QString &path);
@@ -113,7 +73,9 @@ private:
bool textInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection);
bool editableTextInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection);
bool valueInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection);
+ bool selectionInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection);
bool tableInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection);
+ bool tableCellInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection);
void sendReply(const QDBusConnection &connection, const QDBusMessage &message, const QVariant &argument) const;
@@ -130,17 +92,21 @@ private:
// component helper functions
static QRect getExtents(QAccessibleInterface *interface, uint coordType);
- static QRect translateRectToWindowCoordinates(QAccessibleInterface *interface, const QRect &rect);
+ static bool isValidCoordType(uint coordType);
+ static QRect translateFromScreenCoordinates(QAccessibleInterface *interface, const QRect &rect, uint targetCoordType);
+ static QPoint translateToScreenCoordinates(QAccessibleInterface *interface, const QPoint &pos, uint fromCoordType);
// action helper functions
QSpiActionArray getActions(QAccessibleInterface *interface) const;
// text helper functions
QVariantList getAttributes(QAccessibleInterface *, int offset, bool includeDefaults) const;
- QVariantList getAttributeValue(QAccessibleInterface *, int offset, const QString &attributeName) const;
+ QString getAttributeValue(QAccessibleInterface *, int offset, const QString &attributeName) const;
QList<QVariant> getCharacterExtents(QAccessibleInterface *, int offset, uint coordType) const;
QList<QVariant> getRangeExtents(QAccessibleInterface *, int startOffset, int endOffset, uint coordType) const;
- QAccessible::TextBoundaryType qAccessibleBoundaryType(int atspiTextBoundaryType) const;
+ static QAccessible::TextBoundaryType qAccessibleBoundaryTypeFromAtspiBoundaryType(int atspiTextBoundaryType);
+ static bool isValidAtspiTextGranularity(uint coordType);
+ static QAccessible::TextBoundaryType qAccessibleBoundaryTypeFromAtspiTextGranularity(uint atspiTextGranularity);
static bool inheritsQAction(QObject *object);
// private vars
diff --git a/src/gui/accessible/linux/dbusconnection.cpp b/src/gui/accessible/linux/dbusconnection.cpp
index 45ddc8e496..10bd10927e 100644
--- a/src/gui/accessible/linux/dbusconnection.cpp
+++ b/src/gui/accessible/linux/dbusconnection.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
@@ -53,11 +17,13 @@
QT_BEGIN_NAMESPACE
+using namespace Qt::StringLiterals;
+
/* note: do not change these to QStringLiteral;
we are unloaded before QtDBus is done using the strings.
*/
-#define A11Y_SERVICE QLatin1String("org.a11y.Bus")
-#define A11Y_PATH QLatin1String("/org/a11y/bus")
+#define A11Y_SERVICE "org.a11y.Bus"_L1
+#define A11Y_PATH "/org/a11y/bus"_L1
/*!
\class DBusConnection
@@ -69,6 +35,14 @@ QT_BEGIN_NAMESPACE
DBusConnection::DBusConnection(QObject *parent)
: QObject(parent), m_a11yConnection(QString()), m_enabled(false)
{
+ // If the bus is explicitly set via env var it overrides everything else.
+ QByteArray addressEnv = qgetenv("AT_SPI_BUS_ADDRESS");
+ if (!addressEnv.isEmpty()) {
+ m_enabled = true;
+ connectA11yBus(QString::fromLocal8Bit(addressEnv));
+ return;
+ }
+
// Start monitoring if "org.a11y.Bus" is registered as DBus service.
QDBusConnection c = QDBusConnection::sessionBus();
if (!c.isConnected()) {
@@ -82,11 +56,13 @@ DBusConnection::DBusConnection(QObject *parent)
if (c.interface()->isServiceRegistered(A11Y_SERVICE))
serviceRegistered();
- // In addition try if there is an xatom exposing the bus address, this allows applications run as root to work
- QString address = getAddressFromXCB();
- if (!address.isEmpty()) {
- m_enabled = true;
- connectA11yBus(address);
+ if (QGuiApplication::platformName().startsWith("xcb"_L1)) {
+ // In addition try if there is an xatom exposing the bus address, this allows applications run as root to work
+ QString address = getAddressFromXCB();
+ if (!address.isEmpty()) {
+ m_enabled = true;
+ connectA11yBus(address);
+ }
}
}
@@ -128,9 +104,8 @@ void DBusConnection::serviceRegistered()
emit enabledChanged(m_enabled);
} else {
QDBusConnection c = QDBusConnection::sessionBus();
- QDBusMessage m = QDBusMessage::createMethodCall(QLatin1String("org.a11y.Bus"),
- QLatin1String("/org/a11y/bus"),
- QLatin1String("org.a11y.Bus"), QLatin1String("GetAddress"));
+ QDBusMessage m = QDBusMessage::createMethodCall(A11Y_SERVICE, A11Y_PATH, A11Y_SERVICE,
+ "GetAddress"_L1);
c.callWithCallback(m, this, SLOT(connectA11yBus(QString)), SLOT(dbusError(QDBusError)));
}
}
@@ -149,7 +124,7 @@ void DBusConnection::connectA11yBus(const QString &address)
qWarning("Could not find Accessibility DBus address.");
return;
}
- m_a11yConnection = QDBusConnection(QDBusConnection::connectToBus(address, QLatin1String("a11y")));
+ m_a11yConnection = QDBusConnection(QDBusConnection::connectToBus(address, "a11y"_L1));
if (m_enabled)
emit enabledChanged(true);
@@ -170,3 +145,5 @@ QDBusConnection DBusConnection::connection() const
}
QT_END_NAMESPACE
+
+#include "moc_dbusconnection_p.cpp"
diff --git a/src/gui/accessible/linux/dbusconnection_p.h b/src/gui/accessible/linux/dbusconnection_p.h
index 826630fddc..8b231c5ad0 100644
--- a/src/gui/accessible/linux/dbusconnection_p.h
+++ b/src/gui/accessible/linux/dbusconnection_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef DBUSCONNECTION_H
@@ -52,9 +16,11 @@
// We mean it.
//
+#include <QtCore/QObject>
#include <QtCore/QString>
#include <QtDBus/QDBusConnection>
#include <QtDBus/QDBusVariant>
+#include <QtCore/private/qglobal_p.h>
Q_MOC_INCLUDE(<QtDBus/QDBusError>)
QT_BEGIN_NAMESPACE
diff --git a/src/gui/accessible/linux/dbusxml/Socket.xml b/src/gui/accessible/linux/dbusxml/Socket.xml
index 75ec99f994..f9ac76d2c8 100644
--- a/src/gui/accessible/linux/dbusxml/Socket.xml
+++ b/src/gui/accessible/linux/dbusxml/Socket.xml
@@ -17,7 +17,7 @@
<signal name="Available">
<arg direction="in" name="socket" type="(so)"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QSpiObjectReference"/>
- </method>
+ </signal>
</interface>
</node>
diff --git a/src/gui/accessible/linux/qspi_constant_mappings.cpp b/src/gui/accessible/linux/qspi_constant_mappings.cpp
index f428726138..e5b6e3f634 100644
--- a/src/gui/accessible/linux/qspi_constant_mappings.cpp
+++ b/src/gui/accessible/linux/qspi_constant_mappings.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qspi_constant_mappings_p.h"
@@ -51,7 +15,7 @@
// "ruler" "autocomplete" "edit bar" "embedded component" "entry" "caption"
// "heading" "page" "section" "redundant object" "form" "input method window" "menu"
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
QT_BEGIN_NAMESPACE
quint64 spiStatesFromQState(QAccessible::State state)
@@ -72,6 +36,8 @@ quint64 spiStatesFromQState(QAccessible::State state)
setSpiStateBit(&spiState, ATSPI_STATE_FOCUSED);
if (state.pressed)
setSpiStateBit(&spiState, ATSPI_STATE_PRESSED);
+ if (state.checkable)
+ setSpiStateBit(&spiState, ATSPI_STATE_CHECKABLE);
if (state.checked)
setSpiStateBit(&spiState, ATSPI_STATE_CHECKED);
if (state.checkStateMixed)
@@ -111,7 +77,8 @@ quint64 spiStatesFromQState(QAccessible::State state)
if (state.extSelectable)
setSpiStateBit(&spiState, ATSPI_STATE_SELECTABLE);
// if (state.Protected)
- // if (state.HasPopup)
+ if (state.hasPopup)
+ setSpiStateBit(&spiState, ATSPI_STATE_HAS_POPUP);
if (state.modal)
setSpiStateBit(&spiState, ATSPI_STATE_MODAL);
if (state.multiLine)
@@ -133,6 +100,7 @@ QSpiUIntList spiStateSetFromSpiStates(quint64 states)
AtspiRelationType qAccessibleRelationToAtSpiRelation(QAccessible::Relation relation)
{
+ // direction of the relation is "inversed" in Qt and AT-SPI
switch (relation) {
case QAccessible::Label:
return ATSPI_RELATION_LABELLED_BY;
@@ -142,6 +110,14 @@ AtspiRelationType qAccessibleRelationToAtSpiRelation(QAccessible::Relation relat
return ATSPI_RELATION_CONTROLLED_BY;
case QAccessible::Controlled:
return ATSPI_RELATION_CONTROLLER_FOR;
+ case QAccessible::DescriptionFor:
+ return ATSPI_RELATION_DESCRIBED_BY;
+ case QAccessible::Described:
+ return ATSPI_RELATION_DESCRIPTION_FOR;
+ case QAccessible::FlowsFrom:
+ return ATSPI_RELATION_FLOWS_TO;
+ case QAccessible::FlowsTo:
+ return ATSPI_RELATION_FLOWS_FROM;
default:
qWarning() << "Cannot return AT-SPI relation for:" << relation;
}
@@ -149,4 +125,4 @@ AtspiRelationType qAccessibleRelationToAtSpiRelation(QAccessible::Relation relat
}
QT_END_NAMESPACE
-#endif //QT_NO_ACCESSIBILITY
+#endif // QT_CONFIG(accessibility)
diff --git a/src/gui/accessible/linux/qspi_constant_mappings_p.h b/src/gui/accessible/linux/qspi_constant_mappings_p.h
index 17e36825f6..ea571181e6 100644
--- a/src/gui/accessible/linux/qspi_constant_mappings_p.h
+++ b/src/gui/accessible/linux/qspi_constant_mappings_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
//
// W A R N I N G
diff --git a/src/gui/accessible/linux/qspi_struct_marshallers.cpp b/src/gui/accessible/linux/qspi_struct_marshallers.cpp
index 1f49d8533f..032a9fe8b1 100644
--- a/src/gui/accessible/linux/qspi_struct_marshallers.cpp
+++ b/src/gui/accessible/linux/qspi_struct_marshallers.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qspi_struct_marshallers_p.h"
@@ -46,9 +10,27 @@
#include "qspiaccessiblebridge_p.h"
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
QT_BEGIN_NAMESPACE
+QT_IMPL_METATYPE_EXTERN(QSpiIntList)
+QT_IMPL_METATYPE_EXTERN(QSpiUIntList)
+QT_IMPL_METATYPE_EXTERN(QSpiObjectReference)
+QT_IMPL_METATYPE_EXTERN(QSpiObjectReferenceArray)
+QT_IMPL_METATYPE_EXTERN(QSpiAccessibleCacheItem)
+QT_IMPL_METATYPE_EXTERN(QSpiAccessibleCacheArray)
+QT_IMPL_METATYPE_EXTERN(QSpiAction)
+QT_IMPL_METATYPE_EXTERN(QSpiActionArray)
+QT_IMPL_METATYPE_EXTERN(QSpiEventListener)
+QT_IMPL_METATYPE_EXTERN(QSpiEventListenerArray)
+QT_IMPL_METATYPE_EXTERN(QSpiRelationArrayEntry)
+QT_IMPL_METATYPE_EXTERN(QSpiRelationArray)
+QT_IMPL_METATYPE_EXTERN(QSpiTextRange)
+QT_IMPL_METATYPE_EXTERN(QSpiTextRangeList)
+QT_IMPL_METATYPE_EXTERN(QSpiAttributeSet)
+QT_IMPL_METATYPE_EXTERN(QSpiAppUpdate)
+QT_IMPL_METATYPE_EXTERN(QSpiDeviceEvent)
+
QSpiObjectReference::QSpiObjectReference()
: path(QDBusObjectPath(ATSPI_DBUS_PATH_NULL))
{}
@@ -234,4 +216,4 @@ void qSpiInitializeStructTypes()
}
QT_END_NAMESPACE
-#endif //QT_NO_ACCESSIBILITY
+#endif // QT_CONFIG(accessibility)
diff --git a/src/gui/accessible/linux/qspi_struct_marshallers_p.h b/src/gui/accessible/linux/qspi_struct_marshallers_p.h
index c7a4a97176..4338b49dd2 100644
--- a/src/gui/accessible/linux/qspi_struct_marshallers_p.h
+++ b/src/gui/accessible/linux/qspi_struct_marshallers_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef Q_SPI_STRUCT_MARSHALLERS_H
@@ -176,23 +140,23 @@ void qSpiInitializeStructTypes();
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QSpiIntList)
-Q_DECLARE_METATYPE(QSpiUIntList)
-Q_DECLARE_METATYPE(QSpiObjectReference)
-Q_DECLARE_METATYPE(QSpiObjectReferenceArray)
-Q_DECLARE_METATYPE(QSpiAccessibleCacheItem)
-Q_DECLARE_METATYPE(QSpiAccessibleCacheArray)
-Q_DECLARE_METATYPE(QSpiAction)
-Q_DECLARE_METATYPE(QSpiActionArray)
-Q_DECLARE_METATYPE(QSpiEventListener)
-Q_DECLARE_METATYPE(QSpiEventListenerArray)
-Q_DECLARE_METATYPE(QSpiRelationArrayEntry)
-Q_DECLARE_METATYPE(QSpiRelationArray)
-Q_DECLARE_METATYPE(QSpiTextRange)
-Q_DECLARE_METATYPE(QSpiTextRangeList)
-Q_DECLARE_METATYPE(QSpiAttributeSet)
-Q_DECLARE_METATYPE(QSpiAppUpdate)
-Q_DECLARE_METATYPE(QSpiDeviceEvent)
+QT_DECL_METATYPE_EXTERN(QSpiIntList, /* not exported */)
+QT_DECL_METATYPE_EXTERN(QSpiUIntList, /* not exported */)
+QT_DECL_METATYPE_EXTERN(QSpiObjectReference, /* not exported */)
+QT_DECL_METATYPE_EXTERN(QSpiObjectReferenceArray, /* not exported */)
+QT_DECL_METATYPE_EXTERN(QSpiAccessibleCacheItem, /* not exported */)
+QT_DECL_METATYPE_EXTERN(QSpiAccessibleCacheArray, /* not exported */)
+QT_DECL_METATYPE_EXTERN(QSpiAction, /* not exported */)
+QT_DECL_METATYPE_EXTERN(QSpiActionArray, /* not exported */)
+QT_DECL_METATYPE_EXTERN(QSpiEventListener, /* not exported */)
+QT_DECL_METATYPE_EXTERN(QSpiEventListenerArray, /* not exported */)
+QT_DECL_METATYPE_EXTERN(QSpiRelationArrayEntry, /* not exported */)
+QT_DECL_METATYPE_EXTERN(QSpiRelationArray, /* not exported */)
+QT_DECL_METATYPE_EXTERN(QSpiTextRange, /* not exported */)
+QT_DECL_METATYPE_EXTERN(QSpiTextRangeList, /* not exported */)
+QT_DECL_METATYPE_EXTERN(QSpiAttributeSet, /* not exported */)
+QT_DECL_METATYPE_EXTERN(QSpiAppUpdate, /* not exported */)
+QT_DECL_METATYPE_EXTERN(QSpiDeviceEvent, /* not exported */)
// For qdbusxml2cpp-generated code
QT_USE_NAMESPACE
diff --git a/src/gui/accessible/linux/qspiaccessiblebridge.cpp b/src/gui/accessible/linux/qspiaccessiblebridge.cpp
index 9b9b7a46a5..de2e7d5fc0 100644
--- a/src/gui/accessible/linux/qspiaccessiblebridge.cpp
+++ b/src/gui/accessible/linux/qspiaccessiblebridge.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qspiaccessiblebridge_p.h"
@@ -52,11 +16,13 @@
#include "dbusconnection_p.h"
#include "qspi_struct_marshallers_p.h"
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
#include "deviceeventcontroller_adaptor.h"
QT_BEGIN_NAMESPACE
+using namespace Qt::StringLiterals;
+
/*!
\class QSpiAccessibleBridge
\internal
@@ -67,6 +33,14 @@ QSpiAccessibleBridge::QSpiAccessibleBridge()
{
dbusConnection = new DBusConnection();
connect(dbusConnection, SIGNAL(enabledChanged(bool)), this, SLOT(enabledChanged(bool)));
+ // Now that we have connected the signal, make sure we didn't miss a change,
+ // e.g. when running as root or when AT_SPI_BUS_ADDRESS is set by hand.
+ // But do that only on next loop, once dbus is really settled.
+ QTimer::singleShot(
+ 0, this, [this]{
+ if (dbusConnection->isEnabled() && dbusConnection->connection().isConnected())
+ enabledChanged(true);
+ });
}
void QSpiAccessibleBridge::enabledChanged(bool enabled)
@@ -95,10 +69,10 @@ void QSpiAccessibleBridge::updateStatus()
cache = new QSpiDBusCache(dbusConnection->connection(), this);
dec = new DeviceEventControllerAdaptor(this);
- dbusConnection->connection().registerObject(QLatin1String(ATSPI_DBUS_PATH_DEC), this, QDBusConnection::ExportAdaptors);
+ dbusConnection->connection().registerObject(ATSPI_DBUS_PATH_DEC ""_L1, this, QDBusConnection::ExportAdaptors);
dbusAdaptor = new AtSpiAdaptor(dbusConnection, this);
- dbusConnection->connection().registerVirtualObject(QLatin1String(QSPI_OBJECT_PATH_ACCESSIBLE), dbusAdaptor, QDBusConnection::SubPath);
+ dbusConnection->connection().registerVirtualObject(QSPI_OBJECT_PATH_ACCESSIBLE ""_L1, dbusAdaptor, QDBusConnection::SubPath);
dbusAdaptor->registerApplication();
}
}
@@ -231,7 +205,11 @@ static RoleMapping map[] = {
//: Role of an accessible object
{ QAccessible::ButtonDropDown, ATSPI_ROLE_PUSH_BUTTON, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "button with drop down") },
//: Role of an accessible object
+#if ATSPI_ROLE_COUNT > 130
+ { QAccessible::ButtonMenu, ATSPI_ROLE_PUSH_BUTTON_MENU, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "button menu") },
+#else
{ QAccessible::ButtonMenu, ATSPI_ROLE_PUSH_BUTTON, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "button menu") },
+#endif
//: Role of an accessible object - a button that expands a grid.
{ QAccessible::ButtonDropGrid, ATSPI_ROLE_PUSH_BUTTON, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "button with drop down grid") },
//: Role of an accessible object - blank space between other objects.
@@ -275,7 +253,7 @@ static RoleMapping map[] = {
void QSpiAccessibleBridge::initializeConstantMappings()
{
for (uint i = 0; i < sizeof(map) / sizeof(RoleMapping); ++i)
- m_spiRoleMapping.insert(map[i].role, RoleNames(map[i].spiRole, QLatin1String(map[i].name), tr(map[i].name)));
+ m_spiRoleMapping.insert(map[i].role, RoleNames(map[i].spiRole, QLatin1StringView(map[i].name), tr(map[i].name)));
// -1 because we have button duplicated, as PushButton and Button.
Q_ASSERT_X(m_spiRoleMapping.size() ==
@@ -300,4 +278,6 @@ RoleNames QSpiAccessibleBridge::namesForRole(QAccessible::Role role)
}
QT_END_NAMESPACE
-#endif //QT_NO_ACCESSIBILITY
+
+#include "moc_qspiaccessiblebridge_p.cpp"
+#endif // QT_CONFIG(accessibility)
diff --git a/src/gui/accessible/linux/qspiaccessiblebridge_p.h b/src/gui/accessible/linux/qspiaccessiblebridge_p.h
index ef3eff366d..5ad48c5cc4 100644
--- a/src/gui/accessible/linux/qspiaccessiblebridge_p.h
+++ b/src/gui/accessible/linux/qspiaccessiblebridge_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QSPIACCESSIBLEBRIDGE_H
diff --git a/src/gui/accessible/linux/qspiapplicationadaptor.cpp b/src/gui/accessible/linux/qspiapplicationadaptor.cpp
index 430dc13b00..37d7648984 100644
--- a/src/gui/accessible/linux/qspiapplicationadaptor.cpp
+++ b/src/gui/accessible/linux/qspiapplicationadaptor.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qspiapplicationadaptor_p.h"
@@ -44,14 +8,20 @@
#include <QtDBus/qdbuspendingreply.h>
#include <qdebug.h>
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
#include "deviceeventcontroller_adaptor.h"
#include "atspi/atspi-constants.h"
+#if __has_include(<xcb/xproto.h>)
+#include <xcb/xproto.h>
+#endif
+
//#define KEYBOARD_DEBUG
QT_BEGIN_NAMESPACE
+using namespace Qt::Literals::StringLiterals;
+
/*!
\class QSpiApplicationAdaptor
\internal
@@ -62,7 +32,7 @@ QT_BEGIN_NAMESPACE
*/
QSpiApplicationAdaptor::QSpiApplicationAdaptor(const QDBusConnection &connection, QObject *parent)
- : QObject(parent), dbusConnection(connection), inCapsLock(false)
+ : QObject(parent), dbusConnection(connection)
{
}
@@ -143,13 +113,9 @@ bool QSpiApplicationAdaptor::eventFilter(QObject *target, QEvent *event)
de.text = QStringLiteral("Escape");
else if (keyEvent->key() == Qt::Key_Space)
de.text = QStringLiteral("space");
- else if (keyEvent->key() == Qt::Key_CapsLock) {
+ else if (keyEvent->key() == Qt::Key_CapsLock)
de.text = QStringLiteral("Caps_Lock");
- if (event->type() == QEvent::KeyPress)
- inCapsLock = true;
- else
- inCapsLock = false;
- } else if (keyEvent->key() == Qt::Key_NumLock)
+ else if (keyEvent->key() == Qt::Key_NumLock)
de.text = QStringLiteral("Num_Lock");
else if (keyEvent->key() == Qt::Key_Insert)
de.text = QStringLiteral("Insert");
@@ -161,10 +127,15 @@ bool QSpiApplicationAdaptor::eventFilter(QObject *target, QEvent *event)
de.isText = !de.text.isEmpty();
de.modifiers = 0;
- if (!inCapsLock && keyEvent->modifiers() & Qt::ShiftModifier)
+ if ((keyEvent->modifiers() & Qt::ShiftModifier) && (keyEvent->key() != Qt::Key_Shift))
de.modifiers |= 1 << ATSPI_MODIFIER_SHIFT;
- if (inCapsLock && (keyEvent->key() != Qt::Key_CapsLock))
- de.modifiers |= 1 << ATSPI_MODIFIER_SHIFTLOCK;
+#ifdef XCB_MOD_MASK_LOCK
+ if (QGuiApplication::platformName().startsWith("xcb"_L1)) {
+ // TODO rather introduce Qt::CapslockModifier into KeyboardModifier
+ if (keyEvent->nativeModifiers() & XCB_MOD_MASK_LOCK )
+ de.modifiers |= 1 << ATSPI_MODIFIER_SHIFTLOCK;
+ }
+#endif
if ((keyEvent->modifiers() & Qt::ControlModifier) && (keyEvent->key() != Qt::Key_Control))
de.modifiers |= 1 << ATSPI_MODIFIER_CONTROL;
if ((keyEvent->modifiers() & Qt::AltModifier) && (keyEvent->key() != Qt::Key_Alt))
@@ -210,11 +181,11 @@ QKeyEvent* QSpiApplicationAdaptor::copyKeyEvent(QKeyEvent* old)
void QSpiApplicationAdaptor::notifyKeyboardListenerCallback(const QDBusMessage& message)
{
- if (!keyEvents.length()) {
+ if (!keyEvents.size()) {
qWarning("QSpiApplication::notifyKeyboardListenerCallback with no queued key called");
return;
}
- Q_ASSERT(message.arguments().length() == 1);
+ Q_ASSERT(message.arguments().size() == 1);
if (message.arguments().at(0).toBool() == true) {
QPair<QPointer<QObject>, QKeyEvent*> event = keyEvents.dequeue();
delete event.second;
@@ -237,4 +208,6 @@ void QSpiApplicationAdaptor::notifyKeyboardListenerError(const QDBusError& error
QT_END_NAMESPACE
-#endif //QT_NO_ACCESSIBILITY
+#include "moc_qspiapplicationadaptor_p.cpp"
+
+#endif // QT_CONFIG(accessibility)
diff --git a/src/gui/accessible/linux/qspiapplicationadaptor_p.h b/src/gui/accessible/linux/qspiapplicationadaptor_p.h
index ca206edcd4..b852951385 100644
--- a/src/gui/accessible/linux/qspiapplicationadaptor_p.h
+++ b/src/gui/accessible/linux/qspiapplicationadaptor_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef Q_SPI_APPLICATION_H
#define Q_SPI_APPLICATION_H
@@ -91,7 +55,6 @@ private:
QQueue<QPair<QPointer<QObject>, QKeyEvent*> > keyEvents;
QDBusConnection dbusConnection;
- bool inCapsLock;
};
QT_END_NAMESPACE
diff --git a/src/gui/accessible/linux/qspidbuscache.cpp b/src/gui/accessible/linux/qspidbuscache.cpp
index 189cd2adf8..fc5d87c319 100644
--- a/src/gui/accessible/linux/qspidbuscache.cpp
+++ b/src/gui/accessible/linux/qspidbuscache.cpp
@@ -1,53 +1,19 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qspidbuscache_p.h"
#include "qspiaccessiblebridge_p.h"
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
#include "cache_adaptor.h"
#define QSPI_OBJECT_PATH_CACHE "/org/a11y/atspi/cache"
QT_BEGIN_NAMESPACE
+using namespace Qt::StringLiterals;
+
/*!
\class QSpiDBusCache
\internal
@@ -69,7 +35,7 @@ QSpiDBusCache::QSpiDBusCache(QDBusConnection c, QObject* parent)
: QObject(parent)
{
new CacheAdaptor(this);
- c.registerObject(QLatin1String(QSPI_OBJECT_PATH_CACHE), this, QDBusConnection::ExportAdaptors);
+ c.registerObject(QSPI_OBJECT_PATH_CACHE ""_L1, this, QDBusConnection::ExportAdaptors);
}
void QSpiDBusCache::emitAddAccessible(const QSpiAccessibleCacheItem& item)
@@ -88,4 +54,6 @@ QSpiAccessibleCacheArray QSpiDBusCache::GetItems()
}
QT_END_NAMESPACE
-#endif //QT_NO_ACCESSIBILITY
+
+#include "moc_qspidbuscache_p.cpp"
+#endif // QT_CONFIG(accessibility)
diff --git a/src/gui/accessible/linux/qspidbuscache_p.h b/src/gui/accessible/linux/qspidbuscache_p.h
index 89bee59d3a..7a6e111f14 100644
--- a/src/gui/accessible/linux/qspidbuscache_p.h
+++ b/src/gui/accessible/linux/qspidbuscache_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef Q_SPI_CACHE_H
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index 1ba206e82a..46bca16dad 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qaccessible.h"
@@ -54,11 +18,14 @@
#include <QtCore/qdebug.h>
#include <QtCore/qloggingcategory.h>
#include <QtCore/qmetaobject.h>
+#include <QtCore/private/qmetaobject_p.h>
#include <QtCore/qhash.h>
#include <private/qfactoryloader_p.h>
QT_BEGIN_NAMESPACE
+using namespace Qt::StringLiterals;
+
Q_LOGGING_CATEGORY(lcAccessibilityCore, "qt.accessibility.core");
/*!
@@ -162,7 +129,6 @@ Q_LOGGING_CATEGORY(lcAccessibilityCore, "qt.accessibility.core");
\value hasPopup The object opens a popup.
\value hotTracked The object's appearance is sensitive to the mouse cursor position.
\value invalid The object is no longer valid (because it has been deleted).
- \value invalidEntry Input validation current input invalid.
\value invisible The object is not visible to the user.
\value linked The object is linked to another object, e.g. a hyperlink.
\value marqueed The object displays scrolling contents, e.g. a log view.
@@ -252,7 +218,7 @@ Q_LOGGING_CATEGORY(lcAccessibilityCore, "qt.accessibility.core");
\value ObjectHide An object is hidden; for example, with QWidget::hide().
Any children the object that is hidden has do not send
this event. It is not sent when an object is hidden as
- it is being obcured by others.
+ it is being obscured by others.
\value ObjectReorder A layout or item view has added, removed, or moved an
object (Qt does not use this event).
\value ObjectShow An object is displayed; for example, with
@@ -309,7 +275,7 @@ Q_LOGGING_CATEGORY(lcAccessibilityCore, "qt.accessibility.core");
\value AlertMessage An object that is used to alert the user.
\value Animation An object that displays an animation.
\value Application The application's main window.
- \value Assistant An object that provids interactive help.
+ \value Assistant An object that provides interactive help.
\value Border An object that represents a border.
\value ButtonDropDown A button that drops down a list of items.
\value ButtonDropGrid A button that drops down a grid.
@@ -388,14 +354,29 @@ Q_LOGGING_CATEGORY(lcAccessibilityCore, "qt.accessibility.core");
\enum QAccessible::RelationFlag
This enum type defines bit flags that can be combined to indicate
- the relationship between two accessible objects.
-
- \value Label The first object is the label of the second object.
- \value Labelled The first object is labelled by the second object.
- \value Controller The first object controls the second object.
- \value Controlled The first object is controlled by the second object.
- \value AllRelations Used as a mask to specify that we are interesting in information
- about all relations
+ the relationship between two accessible objects. It is used by
+ the relations() function, which returns a list of all the related
+ interfaces of the calling object, together with the relations
+ for each object.
+
+ Each entry in the list is a QPair where the \c second member stores
+ the relation type(s) between the \c returned object represented by the
+ \c first member and the \c origin (the caller) interface/object.
+
+ In the table below, the \c returned object refers to the object in
+ the returned list, and the \c origin object is the one represented
+ by the calling interface.
+
+ \value Label The \c returned object is the label for the \c origin object.
+ \value Labelled The \c returned object is labelled by the \c origin object.
+ \value Controller The \c returned object controls the \c origin object.
+ \value Controlled The \c returned object is controlled by the \c origin object.
+ \value [since 6.6] DescriptionFor The \c returned object provides a description for the \c origin object.
+ \value [since 6.6] Described The \c returned object is described by the \c origin object.
+ \value [since 6.6] FlowsFrom Content logically flows from the \c returned object to the \c origin object.
+ \value [since 6.6] FlowsTo Content logically flows to the \c returned object from the \c origin object.
+ \value AllRelations Used as a mask to specify that we are interesting in information
+ about all relations
Implementations of relations() return a combination of these flags.
Some values are mutually exclusive.
@@ -431,6 +412,43 @@ Q_LOGGING_CATEGORY(lcAccessibilityCore, "qt.accessibility.core");
\sa QAccessibleTextInterface
*/
+/*! \enum QAccessible::Attribute
+ This enum describes different types of attributes used by the
+ \l QAccessibleAttributesInterface.
+ \since 6.8
+
+ These attributes are comparable to the concept of properties/(object)
+ attributes found in ARIA, AT-SPI2, IAccessible, UIA and NSAccessibility
+ and are mapped to their platform counterpart where applicable.
+
+ Each attribute is handled as a key-value pair, with the values of this
+ enumeration being used as keys.
+
+ Attribute values are represented in a \l QVariant. The type of the value
+ stored in the \l QVariant is fixed and specified below for each of the
+ attribute types.
+
+ \value Custom value type: \a QHash<QString, QString>
+ The \a Custom attribute is special in that
+ it can effectively represent multiple attributes at
+ once, since it itself is a \l QHash used to represent
+ key-value pairs.
+ For platforms supporting custom key-value pairs for
+ attributes, those set in the \a Custom attribute
+ are bridged to the platform layer without applying any
+ translation to platform-specific attributes. In general,
+ the other, more strongly typed attributes should be used.
+ This attribute can e.g. be used for prototyping
+ before officially adding an official new enumeration value
+ for a specific feature.
+ \value Level value type: \a int
+ Defines the hierarchical level of an element within a structure,
+ e.g. the heading level of a heading. This attribute conceptually
+ matches the "aria-level" property in ARIA.
+
+ \sa QAccessibleAttributesInterface
+*/
+
/*!
\enum QAccessible::InterfaceType
@@ -449,11 +467,13 @@ Q_LOGGING_CATEGORY(lcAccessibilityCore, "qt.accessibility.core");
\value TableInterface For lists, tables and trees.
\value TableCellInterface For cells in a TableInterface object.
\value HyperlinkInterface For hyperlink nodes (usually embedded as children of text nodes)
+ \value [since 6.5] SelectionInterface For non-text objects that support selection of child objects.
+ \value [since 6.8] AttributesInterface For objects that support object-specific attributes.
- \sa QAccessibleInterface::interface_cast(), QAccessibleTextInterface, QAccessibleValueInterface, QAccessibleActionInterface, QAccessibleTableInterface, QAccessibleTableCellInterface
+ \sa QAccessibleInterface::interface_cast(), QAccessibleTextInterface, QAccessibleValueInterface, QAccessibleActionInterface, QAccessibleTableInterface, QAccessibleTableCellInterface, QAccessibleSelectionInterface, QAccessibleAttributesInterface
*/
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
/*!
Destroys the QAccessibleInterface.
@@ -470,8 +490,8 @@ QAccessibleInterface::~QAccessibleInterface()
/* accessible widgets plugin discovery stuff */
-Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
- (QAccessibleFactoryInterface_iid, QLatin1String("/accessible")))
+Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, acLoader,
+ (QAccessibleFactoryInterface_iid, "/accessible"_L1))
typedef QHash<QString, QAccessiblePlugin*> QAccessiblePluginsHash;
Q_GLOBAL_STATIC(QAccessiblePluginsHash, qAccessiblePlugins)
@@ -681,11 +701,30 @@ QAccessibleInterface *QAccessible::queryAccessibleInterface(QObject *object)
// Create a QAccessibleInterface for the object class. Start by the most
// derived class and walk up the class hierarchy.
const QMetaObject *mo = object->metaObject();
+ const auto *objectPriv = QObjectPrivate::get(object);
+ /*
+ We do not want to cache each and every QML metaobject (Button_QMLTYPE_124,
+ Button_QMLTYPE_125, etc.). Those dynamic metaobjects shouldn't have an
+ accessible interface in any case. Instead, we start the whole checking
+ with the first non-dynamic meta-object. To avoid potential regressions
+ in other areas of Qt that also use dynamic metaobjects, we only do this
+ for objects that are QML-related (approximated by checking whether they
+ have ddata set).
+ */
+ const bool qmlRelated = !objectPriv->isDeletingChildren &&
+ objectPriv->declarativeData;
+ while (qmlRelated && mo) {
+ auto mop = QMetaObjectPrivate::get(mo);
+ if (!mop || !(mop->flags & DynamicMetaObject))
+ break;
+
+ mo = mo->superClass();
+ };
while (mo) {
- const QString cn = QLatin1String(mo->className());
+ const QString cn = QLatin1StringView(mo->className());
// Check if the class has a InterfaceFactory installed.
- for (int i = qAccessibleFactories()->count(); i > 0; --i) {
+ for (int i = qAccessibleFactories()->size(); i > 0; --i) {
InterfaceFactory factory = qAccessibleFactories()->at(i - 1);
if (QAccessibleInterface *iface = factory(cn, object)) {
QAccessibleCache::instance()->insert(object, iface);
@@ -696,14 +735,15 @@ QAccessibleInterface *QAccessible::queryAccessibleInterface(QObject *object)
// Find a QAccessiblePlugin (factory) for the class name. If there's
// no entry in the cache try to create it using the plugin loader.
if (!qAccessiblePlugins()->contains(cn)) {
- const int index = loader()->indexOf(cn);
- if (index != -1) {
- QAccessiblePlugin *factory = qobject_cast<QAccessiblePlugin *>(loader()->instance(index));
- qAccessiblePlugins()->insert(cn, factory);
- }
+ QAccessiblePlugin *factory = nullptr; // 0 means "no plugin found". This is cached as well.
+ const int index = acLoader()->indexOf(cn);
+ if (index != -1)
+ factory = qobject_cast<QAccessiblePlugin *>(acLoader()->instance(index));
+ qAccessiblePlugins()->insert(cn, factory);
}
// At this point the cache should contain a valid factory pointer or 0:
+ Q_ASSERT(qAccessiblePlugins()->contains(cn));
QAccessiblePlugin *factory = qAccessiblePlugins()->value(cn);
if (factory) {
QAccessibleInterface *result = factory->create(cn, object);
@@ -801,7 +841,7 @@ bool QAccessible::isActive()
*/
void QAccessible::setActive(bool active)
{
- for (int i = 0; i < qAccessibleActivationObservers()->count() ;++i)
+ for (int i = 0; i < qAccessibleActivationObservers()->size() ;++i)
qAccessibleActivationObservers()->at(i)->accessibilityActiveChanged(active);
}
@@ -864,11 +904,11 @@ void QAccessible::updateAccessibility(QAccessibleEvent *event)
if (iface->tableInterface())
iface->tableInterface()->modelChange(static_cast<QAccessibleTableModelChangeEvent*>(event));
}
+ }
- if (updateHandler) {
- updateHandler(event);
- return;
- }
+ if (updateHandler) {
+ updateHandler(event);
+ return;
}
if (QPlatformAccessibility *pfAccessibility = platformAccessibility())
@@ -1114,7 +1154,7 @@ QAccessibleInterface *QAccessibleInterface::focusChild() const
If there are no children at this position this function returns \nullptr.
The returned accessible must be a child, but not necessarily a direct child.
- This function is only relyable for visible objects (invisible
+ This function is only reliable for visible objects (invisible
object might not be laid out correctly).
All visual objects provide this information.
@@ -1287,6 +1327,11 @@ QColor QAccessibleInterface::backgroundColor() const
*/
/*!
+ \fn QAccessibleSelectionInterface *QAccessibleInterface::selectionInterface()
+ \since 6.5
+*/
+
+/*!
\class QAccessibleEvent
\ingroup accessibility
\inmodule QtGui
@@ -1648,8 +1693,8 @@ QAccessibleTextRemoveEvent::~QAccessibleTextRemoveEvent()
/*!
\fn QAccessibleTextInsertEvent::QAccessibleTextInsertEvent(QAccessibleInterface *iface, int position, const QString &text)
- Constructs a new QAccessibleTextInsertEvent event for \a iface. The text has been inserted at
- \a position.
+ Constructs a new QAccessibleTextInsertEvent event for \a iface. The \a text has been inserted
+ at \a position.
*/
/*!
@@ -1842,16 +1887,16 @@ Q_GUI_EXPORT QDebug operator<<(QDebug d, const QAccessibleInterface *iface)
QStringList stateStrings;
QAccessible::State st = iface->state();
if (st.focusable)
- stateStrings << QLatin1String("focusable");
+ stateStrings << u"focusable"_s;
if (st.focused)
- stateStrings << QLatin1String("focused");
+ stateStrings << u"focused"_s;
if (st.selected)
- stateStrings << QLatin1String("selected");
+ stateStrings << u"selected"_s;
if (st.invisible)
- stateStrings << QLatin1String("invisible");
+ stateStrings << u"invisible"_s;
if (!stateStrings.isEmpty())
- d << stateStrings.join(QLatin1Char('|'));
+ d << stateStrings.join(u'|');
if (!st.invisible)
d << "rect=" << iface->rect();
@@ -2022,7 +2067,7 @@ static QString textLineBoundary(int beforeAtAfter, const QString &text, int offs
{
Q_ASSERT(beforeAtAfter >= -1 && beforeAtAfter <= 1);
Q_ASSERT(*startOffset == -1 && *endOffset == -1);
- int length = text.length();
+ int length = text.size();
Q_ASSERT(offset >= 0 && offset <= length);
// move offset into the right range (if asking for line before or after
@@ -2071,10 +2116,10 @@ QString QAccessibleTextInterface::textBeforeOffset(int offset, QAccessible::Text
const QString txt = text(0, characterCount());
if (offset == -1)
- offset = txt.length();
+ offset = txt.size();
*startOffset = *endOffset = -1;
- if (txt.isEmpty() || offset <= 0 || offset > txt.length())
+ if (txt.isEmpty() || offset <= 0 || offset > txt.size())
return QString();
// type initialized just to silence a compiler warning [-Werror=maybe-uninitialized]
@@ -2145,10 +2190,10 @@ QString QAccessibleTextInterface::textAfterOffset(int offset, QAccessible::TextB
const QString txt = text(0, characterCount());
if (offset == -1)
- offset = txt.length();
+ offset = txt.size();
*startOffset = *endOffset = -1;
- if (txt.isEmpty() || offset < 0 || offset >= txt.length())
+ if (txt.isEmpty() || offset < 0 || offset >= txt.size())
return QString();
// type initialized just to silence a compiler warning [-Werror=maybe-uninitialized]
@@ -2183,20 +2228,20 @@ QString QAccessibleTextInterface::textAfterOffset(int offset, QAccessible::TextB
int toNext = boundary.toNextBoundary();
if ((boundary.boundaryReasons() & (QTextBoundaryFinder::StartOfItem | QTextBoundaryFinder::EndOfItem)))
break;
- if (toNext < 0 || toNext >= txt.length())
+ if (toNext < 0 || toNext >= txt.size())
break; // not found, the boundary might not exist
}
- Q_ASSERT(boundary.position() <= txt.length());
+ Q_ASSERT(boundary.position() <= txt.size());
*startOffset = boundary.position();
while (true) {
int toNext = boundary.toNextBoundary();
if ((boundary.boundaryReasons() & (QTextBoundaryFinder::StartOfItem | QTextBoundaryFinder::EndOfItem)))
break;
- if (toNext < 0 || toNext >= txt.length())
+ if (toNext < 0 || toNext >= txt.size())
break; // not found, the boundary might not exist
}
- Q_ASSERT(boundary.position() <= txt.length());
+ Q_ASSERT(boundary.position() <= txt.size());
*endOffset = boundary.position();
if ((*startOffset == -1) || (*endOffset == -1) || (*startOffset == *endOffset)) {
@@ -2230,13 +2275,13 @@ QString QAccessibleTextInterface::textAtOffset(int offset, QAccessible::TextBoun
const QString txt = text(0, characterCount());
if (offset == -1)
- offset = txt.length();
+ offset = txt.size();
*startOffset = *endOffset = -1;
- if (txt.isEmpty() || offset < 0 || offset > txt.length())
+ if (txt.isEmpty() || offset < 0 || offset > txt.size())
return QString();
- if (offset == txt.length() && boundaryType == QAccessible::CharBoundary)
+ if (offset == txt.size() && boundaryType == QAccessible::CharBoundary)
return QString();
// type initialized just to silence a compiler warning [-Werror=maybe-uninitialized]
@@ -2257,7 +2302,7 @@ QString QAccessibleTextInterface::textAtOffset(int offset, QAccessible::TextBoun
return textLineBoundary(0, txt, offset, startOffset, endOffset);
case QAccessible::NoBoundary:
*startOffset = 0;
- *endOffset = txt.length();
+ *endOffset = txt.size();
return txt;
default:
Q_UNREACHABLE();
@@ -2275,11 +2320,11 @@ QString QAccessibleTextInterface::textAtOffset(int offset, QAccessible::TextBoun
Q_ASSERT(boundary.position() >= 0);
*startOffset = boundary.position();
- while (boundary.toNextBoundary() < txt.length()) {
+ while (boundary.toNextBoundary() < txt.size()) {
if ((boundary.boundaryReasons() & (QTextBoundaryFinder::StartOfItem | QTextBoundaryFinder::EndOfItem)))
break;
}
- Q_ASSERT(boundary.position() <= txt.length());
+ Q_ASSERT(boundary.position() <= txt.size());
*endOffset = boundary.position();
return txt.mid(*startOffset, *endOffset - *startOffset);
@@ -2417,8 +2462,8 @@ QAccessibleValueInterface::~QAccessibleValueInterface()
\fn QVariant QAccessibleValueInterface::minimumStepSize() const
Returns the minimum step size for the accessible.
- This is the smalles increment that makes sense when changing the value.
- When programatically changing the value it should always be a multiple
+ This is the smallest increment that makes sense when changing the value.
+ When programmatically changing the value it should always be a multiple
of the minimum step size.
Some tools use this value even when the setCurrentValue does not
@@ -2516,6 +2561,7 @@ QAccessibleTableCellInterface::~QAccessibleTableCellInterface()
/*!
\class QAccessibleTableInterface
+ \inmodule QtGui
\ingroup accessibility
\brief The QAccessibleTableInterface class implements support for
@@ -2601,7 +2647,7 @@ QAccessibleTableInterface::~QAccessibleTableInterface()
/*!
\fn virtual QList<int> QAccessibleTableInterface::selectedRows() const
- Returns the list of currently selected columns.
+ Returns the list of currently selected rows.
*/
/*!
@@ -2662,6 +2708,7 @@ QAccessibleTableInterface::~QAccessibleTableInterface()
/*!
\class QAccessibleActionInterface
+ \inmodule QtGui
\ingroup accessibility
\brief The QAccessibleActionInterface class implements support for
@@ -2686,7 +2733,7 @@ QAccessibleTableInterface::~QAccessibleTableInterface()
\row \li \l toggleAction() \li toggles the item (checkbox, radio button, switch, ...)
\row \li \l decreaseAction() \li decrease the value of the accessible (e.g. spinbox)
\row \li \l increaseAction() \li increase the value of the accessible (e.g. spinbox)
- \row \li \l pressAction() \li press or click or activate the accessible (should correspont to clicking the object with the mouse)
+ \row \li \l pressAction() \li press or click or activate the accessible (should correspond to clicking the object with the mouse)
\row \li \l setFocusAction() \li set the focus to this accessible
\row \li \l showMenuAction() \li show a context menu, corresponds to right-clicks
\endtable
@@ -2953,6 +3000,161 @@ QString QAccessibleActionInterface::nextPageAction()
return accessibleActionStrings()->nextPageAction;
}
+
+/*!
+ \since 6.5
+ \class QAccessibleSelectionInterface
+ \inmodule QtGui
+ \ingroup accessibility
+
+ \brief The QAccessibleSelectionInterface class implements support for
+ selection handling.
+
+ It provides methods for both, retrieving the current selection
+ as well as modifying the selection.
+
+ Only selections of direct children are supported.
+*/
+
+/*!
+
+ Destroys the QAccessibleSelectionInterface.
+*/
+QAccessibleSelectionInterface::~QAccessibleSelectionInterface()
+{
+}
+
+/*!
+ \fn virtual int QAccessibleSelectionInterface::selectedItemCount() const
+
+ Returns the total number of selected accessible items.
+*/
+
+/*!
+ \fn virtual QList<QAccessibleInterface *> QAccessibleSelectionInterface::selectedItems() const
+
+ Returns the list of selected accessible items.
+*/
+
+/*!
+ Returns the selected accessible item at index \a selectionIndex in the selection.
+
+ Note that the index refers to the n-th selected accessible item (i.e. the index in the current selection),
+ which generally differs from the index that would be passed to \l QAccessibleInterface::child()
+ in order to retrieve the same item.
+
+ The default implementation uses \a selectionIndex to retrieve the item from the list
+ of selected items retrieved by \l QAccessibleSelectionInterface::selectedItems().
+
+ In particular for implementations dealing with many selected items, reimplementing
+ this method in a more efficient way may be desirable for performance reasons.
+*/
+QAccessibleInterface* QAccessibleSelectionInterface::selectedItem(int selectionIndex) const
+{
+ QList<QAccessibleInterface*> items = selectedItems();
+ if (selectionIndex < 0 || selectionIndex > items.length() -1) {
+ qCWarning(lcAccessibilityCore) << "Selection index" << selectionIndex << "out of range.";
+ return nullptr;
+ }
+
+ return items.at(selectionIndex);
+}
+
+/*!
+ Returns whether \a childItem is part of the current selection.
+
+ The default implementation checks whether \a childItem is contained
+ in the list of items retrieved by \l QAccessibleSelectionInterface::selectedItems.
+*/
+bool QAccessibleSelectionInterface::isSelected(QAccessibleInterface *childItem) const
+{
+ return selectedItems().contains(childItem);
+}
+
+/*!
+ \fn virtual bool QAccessibleSelectionInterface::select(QAccessibleInterface *childItem)
+
+ Adds \a childItem to the selection.
+ Returns whether \a childItem has actually been added to the selection.
+
+ For implementations that only allow single selections,
+ this may replace the current selection.
+*/
+
+/*!
+ \fn virtual bool QAccessibleSelectionInterface::unselect(QAccessibleInterface *childItem)
+
+ Removes \a childItem from the selection.
+
+ Returns whether the accessible item has actually been removed from the selection.
+*/
+
+/*!
+ \fn virtual bool QAccessibleSelectionInterface::selectAll()
+
+ Selects all accessible child items.
+
+ Returns whether all accessible child items have actually been added to the selection.
+*/
+
+/*!
+ \fn virtual bool QAccessibleSelectionInterface::clear()
+
+ Unselects all accessible child items.
+
+ Returns whether all accessible child items have actually been removed from the selection,
+ i.e. whether the selection is empty after this method has been called.
+*/
+
+
+/*!
+ \since 6.8
+ \class QAccessibleAttributesInterface
+ \inmodule QtGui
+ \ingroup accessibility
+
+ \brief The QAccessibleAttributesInterface class implements support for
+ reporting attributes for an accessible object.
+
+ Attributes are key-value pairs. Values are stored in \l QVariant.
+
+ The \a QAccessible::Attributes enumeration describes the available keys and
+ documents which type to use for the value of each key.
+
+ While the text-specific attributes handled by \l QAccessibleTextInterface::attributes
+ are specific to objects implementing text and are specific to a specific text
+ position/offset, the attributes handled by the \l QAccessibleAttributesInterface
+ can be used for objects of any role and apply for the whole object.
+
+ Classes already implementing \l QAccessibleTextInterface for text-specific attrtibutes
+ may want to implement \l QAccessibleAttributesInterface in addition for object-specific
+ attributes.
+*/
+
+/*!
+
+ Destroys the QAccessibleAttributesInterface.
+*/
+QAccessibleAttributesInterface::~QAccessibleAttributesInterface()
+{
+}
+
+/*!
+ \fn QList<QAccessible::Attribute> QAccessibleAttributesInterface::attributeKeys() const
+
+ Returns the keys of all attributes the object supports. The \l QAccessible::Attribute
+ enumeration describes available keys.
+*/
+
+/*!
+ \fn QVariant QAccessibleAttributesInterface::attributeValue(QAccessible::Attribute key) const
+
+ Returns the value of the attribute \a key of this object.
+
+ If the specificed attribute is not set for this object, an invalid
+ \l QVariant is returned.
+*/
+
/*! \internal */
QString qAccessibleLocalizedActionDescription(const QString &actionName)
{
@@ -2997,7 +3199,8 @@ QAccessibleHyperlinkInterface::~QAccessibleHyperlinkInterface()
}
-#endif // QT_NO_ACCESSIBILITY
+#endif // QT_CONFIG(accessibility)
QT_END_NAMESPACE
+#include "moc_qaccessible_base.cpp"
diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h
index d7bb31706e..0a92e76c73 100644
--- a/src/gui/accessible/qaccessible.h
+++ b/src/gui/accessible/qaccessible.h
@@ -1,47 +1,18 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-#include <QtGui/qtguiglobal.h>
-#ifndef QT_NO_ACCESSIBILITY
+#if 0
+// keep existing syncqt header working after the move of the class
+// into qaccessible_base
+#pragma qt_class(QAccessible)
+#endif
+
#ifndef QACCESSIBLE_H
#define QACCESSIBLE_H
+#include <QtGui/qtguiglobal.h>
+
+#if QT_CONFIG(accessibility)
#include <QtCore/qcoreapplication.h>
#include <QtCore/qdebug.h>
@@ -53,8 +24,7 @@
#include <QtCore/qvariant.h>
#include <QtGui/qcolor.h>
#include <QtGui/qevent.h>
-
-#include <stdlib.h>
+#include <QtGui/qaccessible_base.h>
QT_BEGIN_NAMESPACE
@@ -63,387 +33,6 @@ class QAccessibleEvent;
class QWindow;
class QTextCursor;
-class Q_GUI_EXPORT QAccessible
-{
- Q_GADGET
-public:
-
- enum Event {
- SoundPlayed = 0x0001,
- Alert = 0x0002,
- ForegroundChanged = 0x0003,
- MenuStart = 0x0004,
- MenuEnd = 0x0005,
- PopupMenuStart = 0x0006,
- PopupMenuEnd = 0x0007,
- ContextHelpStart = 0x000C,
- ContextHelpEnd = 0x000D,
- DragDropStart = 0x000E,
- DragDropEnd = 0x000F,
- DialogStart = 0x0010,
- DialogEnd = 0x0011,
- ScrollingStart = 0x0012,
- ScrollingEnd = 0x0013,
-
- MenuCommand = 0x0018,
-
- // Values from IAccessible2
- ActionChanged = 0x0101,
- ActiveDescendantChanged = 0x0102,
- AttributeChanged = 0x0103,
- DocumentContentChanged = 0x0104,
- DocumentLoadComplete = 0x0105,
- DocumentLoadStopped = 0x0106,
- DocumentReload = 0x0107,
- HyperlinkEndIndexChanged = 0x0108,
- HyperlinkNumberOfAnchorsChanged = 0x0109,
- HyperlinkSelectedLinkChanged = 0x010A,
- HypertextLinkActivated = 0x010B,
- HypertextLinkSelected = 0x010C,
- HyperlinkStartIndexChanged = 0x010D,
- HypertextChanged = 0x010E,
- HypertextNLinksChanged = 0x010F,
- ObjectAttributeChanged = 0x0110,
- PageChanged = 0x0111,
- SectionChanged = 0x0112,
- TableCaptionChanged = 0x0113,
- TableColumnDescriptionChanged = 0x0114,
- TableColumnHeaderChanged = 0x0115,
- TableModelChanged = 0x0116,
- TableRowDescriptionChanged = 0x0117,
- TableRowHeaderChanged = 0x0118,
- TableSummaryChanged = 0x0119,
- TextAttributeChanged = 0x011A,
- TextCaretMoved = 0x011B,
- // TextChanged = 0x011C, is deprecated in IA2, use TextUpdated
- TextColumnChanged = 0x011D,
- TextInserted = 0x011E,
- TextRemoved = 0x011F,
- TextUpdated = 0x0120,
- TextSelectionChanged = 0x0121,
- VisibleDataChanged = 0x0122,
-
- ObjectCreated = 0x8000,
- ObjectDestroyed = 0x8001,
- ObjectShow = 0x8002,
- ObjectHide = 0x8003,
- ObjectReorder = 0x8004,
- Focus = 0x8005,
- Selection = 0x8006,
- SelectionAdd = 0x8007,
- SelectionRemove = 0x8008,
- SelectionWithin = 0x8009,
- StateChanged = 0x800A,
- LocationChanged = 0x800B,
- NameChanged = 0x800C,
- DescriptionChanged = 0x800D,
- ValueChanged = 0x800E,
- ParentChanged = 0x800F,
- HelpChanged = 0x80A0,
- DefaultActionChanged = 0x80B0,
- AcceleratorChanged = 0x80C0,
-
- InvalidEvent
- };
- Q_ENUM(Event)
-
- // 64 bit enums seem hard on some platforms (windows...)
- // which makes using a bit field a sensible alternative
- struct State {
- // http://msdn.microsoft.com/en-us/library/ms697270.aspx
- quint64 disabled : 1; // used to be Unavailable
- quint64 selected : 1;
- quint64 focusable : 1;
- quint64 focused : 1;
- quint64 pressed : 1;
- quint64 checkable : 1;
- quint64 checked : 1;
- quint64 checkStateMixed : 1; // used to be Mixed
- quint64 readOnly : 1;
- quint64 hotTracked : 1;
- quint64 defaultButton : 1;
- quint64 expanded : 1;
- quint64 collapsed : 1;
- quint64 busy : 1;
- quint64 expandable : 1;
- quint64 marqueed : 1;
- quint64 animated : 1;
- quint64 invisible : 1;
- quint64 offscreen : 1;
- quint64 sizeable : 1;
- quint64 movable : 1;
- quint64 selfVoicing : 1;
- quint64 selectable : 1;
- quint64 linked : 1;
- quint64 traversed : 1;
- quint64 multiSelectable : 1;
- quint64 extSelectable : 1;
- quint64 passwordEdit : 1; // used to be Protected
- quint64 hasPopup : 1;
- quint64 modal : 1;
-
- // IA2 - we chose to not add some IA2 states for now
- // Below the ones that seem helpful
- quint64 active : 1;
- quint64 invalid : 1; // = defunct
- quint64 editable : 1;
- quint64 multiLine : 1;
- quint64 selectableText : 1;
- quint64 supportsAutoCompletion : 1;
-
- quint64 searchEdit : 1;
-
- // quint64 horizontal : 1;
- // quint64 vertical : 1;
- // quint64 invalidEntry : 1;
- // quint64 managesDescendants : 1;
- // quint64 singleLine : 1; // we have multi line, this is redundant.
- // quint64 stale : 1;
- // quint64 transient : 1;
- // quint64 pinned : 1;
-
- // Apple - see http://mattgemmell.com/2010/12/19/accessibility-for-iphone-and-ipad-apps/
- // quint64 playsSound : 1;
- // quint64 summaryElement : 1;
- // quint64 updatesFrequently : 1;
- // quint64 adjustable : 1;
- // more and not included here: http://developer.apple.com/library/mac/#documentation/UserExperience/Reference/Accessibility_RoleAttribute_Ref/Attributes.html
-
- // MSAA
- // quint64 alertLow : 1;
- // quint64 alertMedium : 1;
- // quint64 alertHigh : 1;
-
- State() {
- memset(this, 0, sizeof(State));
- }
- friend inline bool operator==(const QAccessible::State &first, const QAccessible::State &second)
- {
- return memcmp(&first, &second, sizeof(QAccessible::State)) == 0;
- }
- };
-
-
-
-
-
- enum Role {
- NoRole = 0x00000000,
- TitleBar = 0x00000001,
- MenuBar = 0x00000002,
- ScrollBar = 0x00000003,
- Grip = 0x00000004,
- Sound = 0x00000005,
- Cursor = 0x00000006,
- Caret = 0x00000007,
- AlertMessage = 0x00000008,
- Window = 0x00000009,
- Client = 0x0000000A,
- PopupMenu = 0x0000000B,
- MenuItem = 0x0000000C,
- ToolTip = 0x0000000D,
- Application = 0x0000000E,
- Document = 0x0000000F,
- Pane = 0x00000010,
- Chart = 0x00000011,
- Dialog = 0x00000012,
- Border = 0x00000013,
- Grouping = 0x00000014,
- Separator = 0x00000015,
- ToolBar = 0x00000016,
- StatusBar = 0x00000017,
- Table = 0x00000018,
- ColumnHeader = 0x00000019,
- RowHeader = 0x0000001A,
- Column = 0x0000001B,
- Row = 0x0000001C,
- Cell = 0x0000001D,
- Link = 0x0000001E,
- HelpBalloon = 0x0000001F,
- Assistant = 0x00000020,
- List = 0x00000021,
- ListItem = 0x00000022,
- Tree = 0x00000023,
- TreeItem = 0x00000024,
- PageTab = 0x00000025,
- PropertyPage = 0x00000026,
- Indicator = 0x00000027,
- Graphic = 0x00000028,
- StaticText = 0x00000029,
- EditableText = 0x0000002A, // Editable, selectable, etc.
- Button = 0x0000002B,
-#ifndef Q_QDOC
- PushButton = Button, // deprecated
-#endif
- CheckBox = 0x0000002C,
- RadioButton = 0x0000002D,
- ComboBox = 0x0000002E,
- // DropList = 0x0000002F,
- ProgressBar = 0x00000030,
- Dial = 0x00000031,
- HotkeyField = 0x00000032,
- Slider = 0x00000033,
- SpinBox = 0x00000034,
- Canvas = 0x00000035, // MSAA: ROLE_SYSTEM_DIAGRAM - The object represents a graphical image that is used to diagram data.
- Animation = 0x00000036,
- Equation = 0x00000037,
- ButtonDropDown = 0x00000038, // The object represents a button that expands a grid.
- ButtonMenu = 0x00000039,
- ButtonDropGrid = 0x0000003A,
- Whitespace = 0x0000003B, // The object represents blank space between other objects.
- PageTabList = 0x0000003C,
- Clock = 0x0000003D,
- Splitter = 0x0000003E,
- // Reserved space in case MSAA roles needs to be added
-
- // Additional Qt roles where enum value does not map directly to MSAA:
- LayeredPane = 0x00000080,
- Terminal = 0x00000081,
- Desktop = 0x00000082,
- Paragraph = 0x00000083,
- WebDocument = 0x00000084,
- Section = 0x00000085,
- Notification = 0x00000086,
-
- // IAccessible2 roles
- // IA2_ROLE_CANVAS = 0x401, // An object that can be drawn into and to manage events from the objects drawn into it
- // IA2_ROLE_CAPTION = 0x402,
- // IA2_ROLE_CHECK_MENU_ITEM = 0x403,
- ColorChooser = 0x404,
- // IA2_ROLE_DATE_EDITOR = 0x405,
- // IA2_ROLE_DESKTOP_ICON = 0x406,
- // IA2_ROLE_DESKTOP_PANE = 0x407,
- // IA2_ROLE_DIRECTORY_PANE = 0x408,
- // IA2_ROLE_EDITBAR = 0x409,
- // IA2_ROLE_EMBEDDED_OBJECT = 0x40A,
- // IA2_ROLE_ENDNOTE = 0x40B,
- // IA2_ROLE_FILE_CHOOSER = 0x40C,
- // IA2_ROLE_FONT_CHOOSER = 0x40D,
- Footer = 0x40E,
- // IA2_ROLE_FOOTNOTE = 0x40F,
- Form = 0x410,
- // some platforms (windows and at-spi) use Frame for regular windows
- // because window was taken for tool/dock windows by MSAA
- // Frame = 0x411,
- // IA2_ROLE_GLASS_PANE = 0x412,
- // IA2_ROLE_HEADER = 0x413,
- Heading = 0x414,
- // IA2_ROLE_ICON = 0x415,
- // IA2_ROLE_IMAGE_MAP = 0x416,
- // IA2_ROLE_INPUT_METHOD_WINDOW = 0x417,
- // IA2_ROLE_INTERNAL_FRAME = 0x418,
- // IA2_ROLE_LABEL = 0x419,
- // IA2_ROLE_LAYERED_PANE = 0x41A,
- Note = 0x41B,
- // IA2_ROLE_OPTION_PANE = 0x41C,
- // IA2_ROLE_PAGE = 0x41D,
- // IA2_ROLE_PARAGRAPH = 0x42E,
- // IA2_ROLE_RADIO_MENU_ITEM = 0x41F,
- // IA2_ROLE_REDUNDANT_OBJECT = 0x420,
- // IA2_ROLE_ROOT_PANE = 0x421,
- // IA2_ROLE_RULER = 0x422,
- // IA2_ROLE_SCROLL_PANE = 0x423,
- // IA2_ROLE_SECTION = 0x424,
- // IA2_ROLE_SHAPE = 0x425,
- // IA2_ROLE_SPLIT_PANE = 0x426,
- // IA2_ROLE_TEAR_OFF_MENU = 0x427,
- // IA2_ROLE_TERMINAL = 0x428,
- // IA2_ROLE_TEXT_FRAME = 0x429,
- // IA2_ROLE_TOGGLE_BUTTON = 0x42A,
- // IA2_ROLE_VIEW_PORT = 0x42B,
- ComplementaryContent = 0x42C,
-
- UserRole = 0x0000ffff
- };
- Q_ENUM(Role)
-
- enum Text {
- Name = 0,
- Description,
- Value,
- Help,
- Accelerator,
- DebugDescription,
- UserText = 0x0000ffff
- };
-
- enum RelationFlag {
- Label = 0x00000001,
- Labelled = 0x00000002,
- Controller = 0x00000004,
- Controlled = 0x00000008,
- AllRelations = 0xffffffff
- };
- Q_DECLARE_FLAGS(Relation, RelationFlag)
-
- enum InterfaceType
- {
- TextInterface,
- EditableTextInterface,
- ValueInterface,
- ActionInterface,
- ImageInterface,
- TableInterface,
- TableCellInterface,
- HyperlinkInterface
- };
-
- enum TextBoundaryType {
- CharBoundary,
- WordBoundary,
- SentenceBoundary,
- ParagraphBoundary,
- LineBoundary,
- NoBoundary
- };
-
- typedef QAccessibleInterface*(*InterfaceFactory)(const QString &key, QObject*);
- typedef void(*UpdateHandler)(QAccessibleEvent *event);
- typedef void(*RootObjectHandler)(QObject*);
-
- typedef unsigned Id;
-
- static void installFactory(InterfaceFactory);
- static void removeFactory(InterfaceFactory);
- static UpdateHandler installUpdateHandler(UpdateHandler);
- static RootObjectHandler installRootObjectHandler(RootObjectHandler);
-
- class Q_GUI_EXPORT ActivationObserver
- {
- public:
- virtual ~ActivationObserver();
- virtual void accessibilityActiveChanged(bool active) = 0;
- };
- static void installActivationObserver(ActivationObserver *);
- static void removeActivationObserver(ActivationObserver *);
-
- static QAccessibleInterface *queryAccessibleInterface(QObject *);
- static Id uniqueId(QAccessibleInterface *iface);
- static QAccessibleInterface *accessibleInterface(Id uniqueId);
- static Id registerAccessibleInterface(QAccessibleInterface *iface);
- static void deleteAccessibleInterface(Id uniqueId);
-
- static void updateAccessibility(QAccessibleEvent *event);
-
- static bool isActive();
- static void setActive(bool active);
- static void setRootObject(QObject *object);
-
- static void cleanup();
-
- static QPair< int, int > qAccessibleTextBoundaryHelper(const QTextCursor &cursor, TextBoundaryType boundaryType);
-
-private:
- static UpdateHandler updateHandler;
- static RootObjectHandler rootObjectHandler;
-
- QAccessible() {}
-
- friend class QAccessibleCache;
-};
-
-Q_DECLARE_OPERATORS_FOR_FLAGS(QAccessible::Relation)
-
class QAccessible2Interface;
class QAccessibleTextInterface;
class QAccessibleEditableTextInterface;
@@ -453,6 +42,8 @@ class QAccessibleImageInterface;
class QAccessibleTableInterface;
class QAccessibleTableCellInterface;
class QAccessibleHyperlinkInterface;
+class QAccessibleSelectionInterface;
+class QAccessibleAttributesInterface;
class QAccessibleTableModelChangeEvent;
class Q_GUI_EXPORT QAccessibleInterface
@@ -513,6 +104,12 @@ public:
inline QAccessibleHyperlinkInterface *hyperlinkInterface()
{ return reinterpret_cast<QAccessibleHyperlinkInterface *>(interface_cast(QAccessible::HyperlinkInterface)); }
+ inline QAccessibleSelectionInterface *selectionInterface()
+ { return reinterpret_cast<QAccessibleSelectionInterface *>(interface_cast(QAccessible::SelectionInterface)); }
+
+ inline QAccessibleAttributesInterface *attributesInterface()
+ { return reinterpret_cast<QAccessibleAttributesInterface *>(interface_cast(QAccessible::AttributesInterface)); }
+
virtual void virtual_hook(int id, void *data);
virtual void *interface_cast(QAccessible::InterfaceType)
@@ -676,6 +273,30 @@ public:
virtual bool isValid() const = 0;
};
+class Q_GUI_EXPORT QAccessibleSelectionInterface
+{
+public:
+ virtual ~QAccessibleSelectionInterface();
+
+ virtual int selectedItemCount() const = 0;
+ virtual QList<QAccessibleInterface*> selectedItems() const = 0;
+ virtual QAccessibleInterface* selectedItem(int selectionIndex) const;
+ virtual bool isSelected(QAccessibleInterface *childItem) const;
+ virtual bool select(QAccessibleInterface *childItem) = 0;
+ virtual bool unselect(QAccessibleInterface *childItem) = 0;
+ virtual bool selectAll() = 0;
+ virtual bool clear() = 0;
+};
+
+class Q_GUI_EXPORT QAccessibleAttributesInterface
+{
+public:
+ virtual ~QAccessibleAttributesInterface();
+ virtual QList<QAccessible::Attribute> attributeKeys() const = 0;
+ virtual QVariant attributeValue(QAccessible::Attribute key) const = 0;
+};
+
+
class Q_GUI_EXPORT QAccessibleEvent
{
Q_DISABLE_COPY(QAccessibleEvent)
@@ -698,7 +319,7 @@ public:
}
inline QAccessibleEvent(QAccessibleInterface *iface, QAccessible::Event typ)
- : m_type(typ), m_object(nullptr)
+ : m_type(typ)
{
Q_ASSERT(iface);
Q_ASSERT(m_type != QAccessible::ValueChanged);
@@ -710,6 +331,7 @@ public:
Q_ASSERT(m_type != QAccessible::TextUpdated);
Q_ASSERT(m_type != QAccessible::TableModelChanged);
m_uniqueId = QAccessible::uniqueId(iface);
+ m_object = iface->object();
}
virtual ~QAccessibleEvent();
@@ -819,13 +441,13 @@ class Q_GUI_EXPORT QAccessibleTextInsertEvent : public QAccessibleTextCursorEven
{
public:
inline QAccessibleTextInsertEvent(QObject *obj, int position, const QString &text)
- : QAccessibleTextCursorEvent(obj, position + int(text.length()))
+ : QAccessibleTextCursorEvent(obj, position + int(text.size()))
, m_position(position), m_text(text)
{
m_type = QAccessible::TextInserted;
}
inline QAccessibleTextInsertEvent(QAccessibleInterface *iface, int position, const QString &text)
- : QAccessibleTextCursorEvent(iface, position + int(text.length()))
+ : QAccessibleTextCursorEvent(iface, position + int(text.size()))
, m_position(position), m_text(text)
{
m_type = QAccessible::TextInserted;
@@ -879,13 +501,13 @@ class Q_GUI_EXPORT QAccessibleTextUpdateEvent : public QAccessibleTextCursorEven
{
public:
inline QAccessibleTextUpdateEvent(QObject *obj, int position, const QString &oldText, const QString &text)
- : QAccessibleTextCursorEvent(obj, position + int(text.length()))
+ : QAccessibleTextCursorEvent(obj, position + int(text.size()))
, m_position(position), m_oldText(oldText), m_text(text)
{
m_type = QAccessible::TextUpdated;
}
inline QAccessibleTextUpdateEvent(QAccessibleInterface *iface, int position, const QString &oldText, const QString &text)
- : QAccessibleTextCursorEvent(iface, position + int(text.length()))
+ : QAccessibleTextCursorEvent(iface, position + int(text.size()))
, m_position(position), m_oldText(oldText), m_text(text)
{
m_type = QAccessible::TextUpdated;
@@ -983,7 +605,7 @@ protected:
int m_lastColumn;
};
-#ifndef Q_CLANG_QDOC
+#ifndef Q_QDOC
#define QAccessibleInterface_iid "org.qt-project.Qt.QAccessibleInterface"
Q_DECLARE_INTERFACE(QAccessibleInterface, QAccessibleInterface_iid)
#endif
@@ -999,5 +621,5 @@ Q_GUI_EXPORT QDebug operator<<(QDebug d, const QAccessibleEvent &ev);
QT_END_NAMESPACE
+#endif // QT_CONFIG(accessibility)
#endif // QACCESSIBLE_H
-#endif //!QT_NO_ACCESSIBILITY
diff --git a/src/gui/accessible/qaccessible_base.h b/src/gui/accessible/qaccessible_base.h
new file mode 100644
index 0000000000..2d2b1de316
--- /dev/null
+++ b/src/gui/accessible/qaccessible_base.h
@@ -0,0 +1,420 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QACCESSIBLE_BASE_H
+#define QACCESSIBLE_BASE_H
+
+#include <QtGui/qtguiglobal.h>
+#if QT_CONFIG(accessibility)
+
+#if 0
+// QAccessible class is handled in qaccessible.h
+#pragma qt_sync_stop_processing
+#endif
+
+#include <QtCore/qobjectdefs.h>
+
+#include <cstring> // memset, memcmp
+
+QT_BEGIN_NAMESPACE
+
+class QAccessibleInterface;
+class QAccessibleEvent;
+class QTextCursor;
+
+class Q_GUI_EXPORT QAccessible
+{
+ Q_GADGET
+public:
+
+ enum Event {
+ SoundPlayed = 0x0001,
+ Alert = 0x0002,
+ ForegroundChanged = 0x0003,
+ MenuStart = 0x0004,
+ MenuEnd = 0x0005,
+ PopupMenuStart = 0x0006,
+ PopupMenuEnd = 0x0007,
+ ContextHelpStart = 0x000C,
+ ContextHelpEnd = 0x000D,
+ DragDropStart = 0x000E,
+ DragDropEnd = 0x000F,
+ DialogStart = 0x0010,
+ DialogEnd = 0x0011,
+ ScrollingStart = 0x0012,
+ ScrollingEnd = 0x0013,
+
+ MenuCommand = 0x0018,
+
+ // Values from IAccessible2
+ ActionChanged = 0x0101,
+ ActiveDescendantChanged = 0x0102,
+ AttributeChanged = 0x0103,
+ DocumentContentChanged = 0x0104,
+ DocumentLoadComplete = 0x0105,
+ DocumentLoadStopped = 0x0106,
+ DocumentReload = 0x0107,
+ HyperlinkEndIndexChanged = 0x0108,
+ HyperlinkNumberOfAnchorsChanged = 0x0109,
+ HyperlinkSelectedLinkChanged = 0x010A,
+ HypertextLinkActivated = 0x010B,
+ HypertextLinkSelected = 0x010C,
+ HyperlinkStartIndexChanged = 0x010D,
+ HypertextChanged = 0x010E,
+ HypertextNLinksChanged = 0x010F,
+ ObjectAttributeChanged = 0x0110,
+ PageChanged = 0x0111,
+ SectionChanged = 0x0112,
+ TableCaptionChanged = 0x0113,
+ TableColumnDescriptionChanged = 0x0114,
+ TableColumnHeaderChanged = 0x0115,
+ TableModelChanged = 0x0116,
+ TableRowDescriptionChanged = 0x0117,
+ TableRowHeaderChanged = 0x0118,
+ TableSummaryChanged = 0x0119,
+ TextAttributeChanged = 0x011A,
+ TextCaretMoved = 0x011B,
+ // TextChanged = 0x011C, is deprecated in IA2, use TextUpdated
+ TextColumnChanged = 0x011D,
+ TextInserted = 0x011E,
+ TextRemoved = 0x011F,
+ TextUpdated = 0x0120,
+ TextSelectionChanged = 0x0121,
+ VisibleDataChanged = 0x0122,
+
+ ObjectCreated = 0x8000,
+ ObjectDestroyed = 0x8001,
+ ObjectShow = 0x8002,
+ ObjectHide = 0x8003,
+ ObjectReorder = 0x8004,
+ Focus = 0x8005,
+ Selection = 0x8006,
+ SelectionAdd = 0x8007,
+ SelectionRemove = 0x8008,
+ SelectionWithin = 0x8009,
+ StateChanged = 0x800A,
+ LocationChanged = 0x800B,
+ NameChanged = 0x800C,
+ DescriptionChanged = 0x800D,
+ ValueChanged = 0x800E,
+ ParentChanged = 0x800F,
+ HelpChanged = 0x80A0,
+ DefaultActionChanged = 0x80B0,
+ AcceleratorChanged = 0x80C0,
+
+ InvalidEvent
+ };
+ Q_ENUM(Event)
+
+ // 64 bit enums seem hard on some platforms (windows...)
+ // which makes using a bit field a sensible alternative
+ struct State {
+ // http://msdn.microsoft.com/en-us/library/ms697270.aspx
+ quint64 disabled : 1; // used to be Unavailable
+ quint64 selected : 1;
+ quint64 focusable : 1;
+ quint64 focused : 1;
+ quint64 pressed : 1;
+ quint64 checkable : 1;
+ quint64 checked : 1;
+ quint64 checkStateMixed : 1; // used to be Mixed
+ quint64 readOnly : 1;
+ quint64 hotTracked : 1;
+ quint64 defaultButton : 1;
+ quint64 expanded : 1;
+ quint64 collapsed : 1;
+ quint64 busy : 1;
+ quint64 expandable : 1;
+ quint64 marqueed : 1;
+ quint64 animated : 1;
+ quint64 invisible : 1;
+ quint64 offscreen : 1;
+ quint64 sizeable : 1;
+ quint64 movable : 1;
+ quint64 selfVoicing : 1;
+ quint64 selectable : 1;
+ quint64 linked : 1;
+ quint64 traversed : 1;
+ quint64 multiSelectable : 1;
+ quint64 extSelectable : 1;
+ quint64 passwordEdit : 1; // used to be Protected
+ quint64 hasPopup : 1;
+ quint64 modal : 1;
+
+ // IA2 - we chose to not add some IA2 states for now
+ // Below the ones that seem helpful
+ quint64 active : 1;
+ quint64 invalid : 1; // = defunct
+ quint64 editable : 1;
+ quint64 multiLine : 1;
+ quint64 selectableText : 1;
+ quint64 supportsAutoCompletion : 1;
+
+ quint64 searchEdit : 1;
+
+ // quint64 horizontal : 1;
+ // quint64 vertical : 1;
+ // quint64 invalidEntry : 1;
+ // quint64 managesDescendants : 1;
+ // quint64 singleLine : 1; // we have multi line, this is redundant.
+ // quint64 stale : 1;
+ // quint64 transient : 1;
+ // quint64 pinned : 1;
+
+ // Apple - see http://mattgemmell.com/2010/12/19/accessibility-for-iphone-and-ipad-apps/
+ // quint64 playsSound : 1;
+ // quint64 summaryElement : 1;
+ // quint64 updatesFrequently : 1;
+ // quint64 adjustable : 1;
+ // more and not included here: http://developer.apple.com/library/mac/#documentation/UserExperience/Reference/Accessibility_RoleAttribute_Ref/Attributes.html
+
+ // MSAA
+ // quint64 alertLow : 1;
+ // quint64 alertMedium : 1;
+ // quint64 alertHigh : 1;
+
+ State() {
+ std::memset(this, 0, sizeof(State));
+ }
+ friend inline bool operator==(const QAccessible::State &first, const QAccessible::State &second)
+ {
+ return std::memcmp(&first, &second, sizeof(QAccessible::State)) == 0;
+ }
+ };
+
+
+
+
+
+ enum Role {
+ NoRole = 0x00000000,
+ TitleBar = 0x00000001,
+ MenuBar = 0x00000002,
+ ScrollBar = 0x00000003,
+ Grip = 0x00000004,
+ Sound = 0x00000005,
+ Cursor = 0x00000006,
+ Caret = 0x00000007,
+ AlertMessage = 0x00000008,
+ Window = 0x00000009,
+ Client = 0x0000000A,
+ PopupMenu = 0x0000000B,
+ MenuItem = 0x0000000C,
+ ToolTip = 0x0000000D,
+ Application = 0x0000000E,
+ Document = 0x0000000F,
+ Pane = 0x00000010,
+ Chart = 0x00000011,
+ Dialog = 0x00000012,
+ Border = 0x00000013,
+ Grouping = 0x00000014,
+ Separator = 0x00000015,
+ ToolBar = 0x00000016,
+ StatusBar = 0x00000017,
+ Table = 0x00000018,
+ ColumnHeader = 0x00000019,
+ RowHeader = 0x0000001A,
+ Column = 0x0000001B,
+ Row = 0x0000001C,
+ Cell = 0x0000001D,
+ Link = 0x0000001E,
+ HelpBalloon = 0x0000001F,
+ Assistant = 0x00000020,
+ List = 0x00000021,
+ ListItem = 0x00000022,
+ Tree = 0x00000023,
+ TreeItem = 0x00000024,
+ PageTab = 0x00000025,
+ PropertyPage = 0x00000026,
+ Indicator = 0x00000027,
+ Graphic = 0x00000028,
+ StaticText = 0x00000029,
+ EditableText = 0x0000002A, // Editable, selectable, etc.
+ Button = 0x0000002B,
+#ifndef Q_QDOC
+ PushButton = Button, // deprecated
+#endif
+ CheckBox = 0x0000002C,
+ RadioButton = 0x0000002D,
+ ComboBox = 0x0000002E,
+ // DropList = 0x0000002F,
+ ProgressBar = 0x00000030,
+ Dial = 0x00000031,
+ HotkeyField = 0x00000032,
+ Slider = 0x00000033,
+ SpinBox = 0x00000034,
+ Canvas = 0x00000035, // MSAA: ROLE_SYSTEM_DIAGRAM - The object represents a graphical image that is used to diagram data.
+ Animation = 0x00000036,
+ Equation = 0x00000037,
+ ButtonDropDown = 0x00000038, // The object represents a button that expands a grid.
+ ButtonMenu = 0x00000039,
+ ButtonDropGrid = 0x0000003A,
+ Whitespace = 0x0000003B, // The object represents blank space between other objects.
+ PageTabList = 0x0000003C,
+ Clock = 0x0000003D,
+ Splitter = 0x0000003E,
+ // Reserved space in case MSAA roles needs to be added
+
+ // Additional Qt roles where enum value does not map directly to MSAA:
+ LayeredPane = 0x00000080,
+ Terminal = 0x00000081,
+ Desktop = 0x00000082,
+ Paragraph = 0x00000083,
+ WebDocument = 0x00000084,
+ Section = 0x00000085,
+ Notification = 0x00000086,
+
+ // IAccessible2 roles
+ // IA2_ROLE_CANVAS = 0x401, // An object that can be drawn into and to manage events from the objects drawn into it
+ // IA2_ROLE_CAPTION = 0x402,
+ // IA2_ROLE_CHECK_MENU_ITEM = 0x403,
+ ColorChooser = 0x404,
+ // IA2_ROLE_DATE_EDITOR = 0x405,
+ // IA2_ROLE_DESKTOP_ICON = 0x406,
+ // IA2_ROLE_DESKTOP_PANE = 0x407,
+ // IA2_ROLE_DIRECTORY_PANE = 0x408,
+ // IA2_ROLE_EDITBAR = 0x409,
+ // IA2_ROLE_EMBEDDED_OBJECT = 0x40A,
+ // IA2_ROLE_ENDNOTE = 0x40B,
+ // IA2_ROLE_FILE_CHOOSER = 0x40C,
+ // IA2_ROLE_FONT_CHOOSER = 0x40D,
+ Footer = 0x40E,
+ // IA2_ROLE_FOOTNOTE = 0x40F,
+ Form = 0x410,
+ // some platforms (windows and at-spi) use Frame for regular windows
+ // because window was taken for tool/dock windows by MSAA
+ // Frame = 0x411,
+ // IA2_ROLE_GLASS_PANE = 0x412,
+ // IA2_ROLE_HEADER = 0x413,
+ Heading = 0x414,
+ // IA2_ROLE_ICON = 0x415,
+ // IA2_ROLE_IMAGE_MAP = 0x416,
+ // IA2_ROLE_INPUT_METHOD_WINDOW = 0x417,
+ // IA2_ROLE_INTERNAL_FRAME = 0x418,
+ // IA2_ROLE_LABEL = 0x419,
+ // IA2_ROLE_LAYERED_PANE = 0x41A,
+ Note = 0x41B,
+ // IA2_ROLE_OPTION_PANE = 0x41C,
+ // IA2_ROLE_PAGE = 0x41D,
+ // IA2_ROLE_PARAGRAPH = 0x42E,
+ // IA2_ROLE_RADIO_MENU_ITEM = 0x41F,
+ // IA2_ROLE_REDUNDANT_OBJECT = 0x420,
+ // IA2_ROLE_ROOT_PANE = 0x421,
+ // IA2_ROLE_RULER = 0x422,
+ // IA2_ROLE_SCROLL_PANE = 0x423,
+ // IA2_ROLE_SECTION = 0x424,
+ // IA2_ROLE_SHAPE = 0x425,
+ // IA2_ROLE_SPLIT_PANE = 0x426,
+ // IA2_ROLE_TEAR_OFF_MENU = 0x427,
+ // IA2_ROLE_TERMINAL = 0x428,
+ // IA2_ROLE_TEXT_FRAME = 0x429,
+ // IA2_ROLE_TOGGLE_BUTTON = 0x42A,
+ // IA2_ROLE_VIEW_PORT = 0x42B,
+ ComplementaryContent = 0x42C,
+
+ UserRole = 0x0000ffff
+ };
+ Q_ENUM(Role)
+
+ enum Text {
+ Name = 0,
+ Description,
+ Value,
+ Help,
+ Accelerator,
+ DebugDescription,
+ UserText = 0x0000ffff
+ };
+
+ enum RelationFlag {
+ Label = 0x00000001,
+ Labelled = 0x00000002,
+ Controller = 0x00000004,
+ Controlled = 0x00000008,
+ DescriptionFor = 0x00000010,
+ Described = 0x00000020,
+ FlowsFrom = 0x00000040,
+ FlowsTo = 0x00000080,
+ AllRelations = 0xffffffff
+ };
+ Q_DECLARE_FLAGS(Relation, RelationFlag)
+
+ enum InterfaceType
+ {
+ TextInterface,
+ EditableTextInterface,
+ ValueInterface,
+ ActionInterface,
+ ImageInterface,
+ TableInterface,
+ TableCellInterface,
+ HyperlinkInterface,
+ SelectionInterface,
+ AttributesInterface,
+ };
+
+ enum TextBoundaryType {
+ CharBoundary,
+ WordBoundary,
+ SentenceBoundary,
+ ParagraphBoundary,
+ LineBoundary,
+ NoBoundary
+ };
+
+ enum class Attribute {
+ Custom,
+ Level,
+ };
+
+ typedef QAccessibleInterface*(*InterfaceFactory)(const QString &key, QObject*);
+ typedef void(*UpdateHandler)(QAccessibleEvent *event);
+ typedef void(*RootObjectHandler)(QObject*);
+
+ typedef unsigned Id;
+
+ static void installFactory(InterfaceFactory);
+ static void removeFactory(InterfaceFactory);
+ static UpdateHandler installUpdateHandler(UpdateHandler);
+ static RootObjectHandler installRootObjectHandler(RootObjectHandler);
+
+ class Q_GUI_EXPORT ActivationObserver
+ {
+ public:
+ virtual ~ActivationObserver();
+ virtual void accessibilityActiveChanged(bool active) = 0;
+ };
+ static void installActivationObserver(ActivationObserver *);
+ static void removeActivationObserver(ActivationObserver *);
+
+ static QAccessibleInterface *queryAccessibleInterface(QObject *);
+ static Id uniqueId(QAccessibleInterface *iface);
+ static QAccessibleInterface *accessibleInterface(Id uniqueId);
+ static Id registerAccessibleInterface(QAccessibleInterface *iface);
+ static void deleteAccessibleInterface(Id uniqueId);
+
+ static void updateAccessibility(QAccessibleEvent *event);
+
+ static bool isActive();
+ static void setActive(bool active);
+ static void setRootObject(QObject *object);
+
+ static void cleanup();
+
+ static QPair< int, int > qAccessibleTextBoundaryHelper(const QTextCursor &cursor, TextBoundaryType boundaryType);
+
+private:
+ static UpdateHandler updateHandler;
+ static RootObjectHandler rootObjectHandler;
+
+ QAccessible() {}
+
+ friend class QAccessibleCache;
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QAccessible::Relation)
+
+QT_END_NAMESPACE
+
+#endif // QT_CONFIG(accessibility)
+#endif // QACCESSIBLE_BASE_H
diff --git a/src/gui/accessible/qaccessiblebridge.cpp b/src/gui/accessible/qaccessiblebridge.cpp
index c6a417e063..a8b54b0c68 100644
--- a/src/gui/accessible/qaccessiblebridge.cpp
+++ b/src/gui/accessible/qaccessiblebridge.cpp
@@ -1,45 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qaccessiblebridge.h"
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
QT_BEGIN_NAMESPACE
@@ -138,4 +102,6 @@ QAccessibleBridgePlugin::~QAccessibleBridgePlugin()
QT_END_NAMESPACE
-#endif // QT_NO_ACCESSIBILITY
+#include "moc_qaccessiblebridge.cpp"
+
+#endif // QT_CONFIG(accessibility)
diff --git a/src/gui/accessible/qaccessiblebridge.h b/src/gui/accessible/qaccessiblebridge.h
index 168889135b..4d817c8e58 100644
--- a/src/gui/accessible/qaccessiblebridge.h
+++ b/src/gui/accessible/qaccessiblebridge.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QACCESSIBLEBRIDGE_H
#define QACCESSIBLEBRIDGE_H
@@ -47,7 +11,7 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
class QAccessibleInterface;
class QAccessibleEvent;
@@ -72,7 +36,7 @@ public:
virtual QAccessibleBridge *create(const QString &key) = 0;
};
-#endif // QT_NO_ACCESSIBILITY
+#endif // QT_CONFIG(accessibility)
QT_END_NAMESPACE
diff --git a/src/gui/accessible/qaccessiblebridgeutils.cpp b/src/gui/accessible/qaccessiblebridgeutils.cpp
index a15b93e31e..994f95fee9 100644
--- a/src/gui/accessible/qaccessiblebridgeutils.cpp
+++ b/src/gui/accessible/qaccessiblebridgeutils.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qaccessiblebridgeutils_p.h"
#include <QtCore/qmath.h>
diff --git a/src/gui/accessible/qaccessiblebridgeutils_p.h b/src/gui/accessible/qaccessiblebridgeutils_p.h
index f34fcc5816..b65a4d0b6c 100644
--- a/src/gui/accessible/qaccessiblebridgeutils_p.h
+++ b/src/gui/accessible/qaccessiblebridgeutils_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QACCESSIBLEBRIDGEUTILS_H
#define QACCESSIBLEBRIDGEUTILS_H
diff --git a/src/gui/accessible/qaccessiblecache.cpp b/src/gui/accessible/qaccessiblecache.cpp
index 84d0936386..b41a2481f9 100644
--- a/src/gui/accessible/qaccessiblecache.cpp
+++ b/src/gui/accessible/qaccessiblecache.cpp
@@ -1,47 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qaccessiblecache_p.h"
#include <QtCore/qdebug.h>
#include <QtCore/qloggingcategory.h>
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
QT_BEGIN_NAMESPACE
@@ -84,18 +48,18 @@ QAccessibleCache *QAccessibleCache::instance()
QAccessible::Id QAccessibleCache::acquireId() const
{
static const QAccessible::Id FirstId = QAccessible::Id(INT_MAX) + 1;
- static QAccessible::Id lastUsedId = FirstId;
+ static QAccessible::Id nextId = FirstId;
- while (idToInterface.contains(lastUsedId)) {
+ while (idToInterface.contains(nextId)) {
// (wrap back when when we reach UINT_MAX - 1)
// -1 because on Android -1 is taken for the "View" so just avoid it completely for consistency
- if (lastUsedId == UINT_MAX - 1)
- lastUsedId = FirstId;
+ if (nextId == UINT_MAX - 1)
+ nextId = FirstId;
else
- ++lastUsedId;
+ ++nextId;
}
- return lastUsedId;
+ return nextId++;
}
QAccessibleInterface *QAccessibleCache::interfaceForId(QAccessible::Id id) const
@@ -166,7 +130,7 @@ void QAccessibleCache::objectDestroyed(QObject* obj)
/*
In some cases we might add a not fully-constructed object to the cache. This might happen with
for instance QWidget subclasses that are in the construction phase. If updateAccessibility() is
- called in the constructor of QWidget (directly or indirectly), it it will end up asking for the
+ called in the constructor of QWidget (directly or indirectly), it will end up asking for the
classname of that widget in order to know which accessibility interface subclass the
accessibility factory should instantiate and return. However, since that requires a virtual
call to metaObject(), it will return the metaObject() of QWidget (not for the subclass), and so
@@ -215,4 +179,6 @@ void QAccessibleCache::deleteInterface(QAccessible::Id id, QObject *obj)
QT_END_NAMESPACE
+#include "moc_qaccessiblecache_p.cpp"
+
#endif
diff --git a/src/gui/accessible/qaccessiblecache_mac.mm b/src/gui/accessible/qaccessiblecache_mac.mm
index 3f49eb98fd..77a9613d38 100644
--- a/src/gui/accessible/qaccessiblecache_mac.mm
+++ b/src/gui/accessible/qaccessiblecache_mac.mm
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qaccessiblecache_p.h"
diff --git a/src/gui/accessible/qaccessiblecache_p.h b/src/gui/accessible/qaccessiblecache_p.h
index 387a54e783..d1abca0f5d 100644
--- a/src/gui/accessible/qaccessiblecache_p.h
+++ b/src/gui/accessible/qaccessiblecache_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QACCESSIBLECACHE_P
#define QACCESSIBLECACHE_P
@@ -57,7 +21,7 @@
#include "qaccessible.h"
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QMacAccessibilityElement));
@@ -103,6 +67,6 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_ACCESSIBILITY
+#endif // QT_CONFIG(accessibility)
#endif
diff --git a/src/gui/accessible/qaccessibleobject.cpp b/src/gui/accessible/qaccessibleobject.cpp
index 771cfda574..61d3a90632 100644
--- a/src/gui/accessible/qaccessibleobject.cpp
+++ b/src/gui/accessible/qaccessibleobject.cpp
@@ -1,45 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qaccessibleobject.h"
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
#include <QtGui/QGuiApplication>
#include <QtGui/QWindow>
@@ -160,7 +124,7 @@ static QObjectList topLevelObjects()
{
QObjectList list;
const QWindowList tlw(QGuiApplication::topLevelWindows());
- for (int i = 0; i < tlw.count(); ++i) {
+ for (int i = 0; i < tlw.size(); ++i) {
QWindow *w = tlw.at(i);
if (w->type() != Qt::Popup && w->type() != Qt::Desktop) {
if (QAccessibleInterface *root = w->accessibleRoot()) {
@@ -176,7 +140,7 @@ static QObjectList topLevelObjects()
/*! \reimp */
int QAccessibleApplication::childCount() const
{
- return topLevelObjects().count();
+ return topLevelObjects().size();
}
/*! \reimp */
@@ -196,7 +160,7 @@ QAccessibleInterface *QAccessibleApplication::parent() const
QAccessibleInterface *QAccessibleApplication::child(int index) const
{
const QObjectList tlo(topLevelObjects());
- if (index >= 0 && index < tlo.count())
+ if (index >= 0 && index < tlo.size())
return QAccessible::queryAccessibleInterface(tlo.at(index));
return nullptr;
}
@@ -239,4 +203,4 @@ QAccessible::State QAccessibleApplication::state() const
QT_END_NAMESPACE
-#endif //QT_NO_ACCESSIBILITY
+#endif // QT_CONFIG(accessibility)
diff --git a/src/gui/accessible/qaccessibleobject.h b/src/gui/accessible/qaccessibleobject.h
index fd07d33a18..8e7dd1399c 100644
--- a/src/gui/accessible/qaccessibleobject.h
+++ b/src/gui/accessible/qaccessibleobject.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QACCESSIBLEOBJECT_H
#define QACCESSIBLEOBJECT_H
@@ -46,7 +10,7 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
class QAccessibleObjectPrivate;
class QObject;
@@ -93,7 +57,7 @@ public:
QAccessible::State state() const override;
};
-#endif // QT_NO_ACCESSIBILITY
+#endif // QT_CONFIG(accessibility)
QT_END_NAMESPACE
diff --git a/src/gui/accessible/qaccessibleplugin.cpp b/src/gui/accessible/qaccessibleplugin.cpp
index 27497858b5..524d67bf35 100644
--- a/src/gui/accessible/qaccessibleplugin.cpp
+++ b/src/gui/accessible/qaccessibleplugin.cpp
@@ -1,45 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtCore/qglobal.h>
-
-#ifndef QT_NO_ACCESSIBILITY
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include <QtGui/qtguiglobal.h>
+
+#if QT_CONFIG(accessibility)
#include "qaccessibleplugin.h"
#include "qaccessible.h"
@@ -48,6 +12,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QAccessiblePlugin
+ \inmodule QtGui
\brief The QAccessiblePlugin class provides an abstract base class
for plugins provinding accessibility information for user interface elements.
@@ -89,4 +54,6 @@ QAccessiblePlugin::~QAccessiblePlugin()
QT_END_NAMESPACE
-#endif // QT_NO_ACCESSIBILITY
+#include "moc_qaccessibleplugin.cpp"
+
+#endif // QT_CONFIG(accessibility)
diff --git a/src/gui/accessible/qaccessibleplugin.h b/src/gui/accessible/qaccessibleplugin.h
index 04169fdeac..014f714b09 100644
--- a/src/gui/accessible/qaccessibleplugin.h
+++ b/src/gui/accessible/qaccessibleplugin.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QACCESSIBLEPLUGIN_H
#define QACCESSIBLEPLUGIN_H
@@ -47,7 +11,7 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
class QAccessibleInterface;
@@ -65,7 +29,7 @@ public:
virtual QAccessibleInterface *create(const QString &key, QObject *object) = 0;
};
-#endif // QT_NO_ACCESSIBILITY
+#endif // QT_CONFIG(accessibility)
QT_END_NAMESPACE
diff --git a/src/gui/accessible/qplatformaccessibility.cpp b/src/gui/accessible/qplatformaccessibility.cpp
index 75caeec5dc..ae7635ff7c 100644
--- a/src/gui/accessible/qplatformaccessibility.cpp
+++ b/src/gui/accessible/qplatformaccessibility.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qplatformaccessibility.h"
#include <private/qfactoryloader_p.h>
#include "qaccessibleplugin.h"
@@ -47,11 +11,13 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_ACCESSIBILITY
+using namespace Qt::StringLiterals;
+
+#if QT_CONFIG(accessibility)
/* accessiblebridge plugin discovery stuff */
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, bridgeloader,
- (QAccessibleBridgeFactoryInterface_iid, QLatin1String("/accessiblebridge")))
+ (QAccessibleBridgeFactoryInterface_iid, "/accessiblebridge"_L1))
Q_GLOBAL_STATIC(QList<QAccessibleBridge *>, bridges)
@@ -84,7 +50,7 @@ void QPlatformAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event)
if (!bridges() || bridges()->isEmpty())
return;
- for (int i = 0; i < bridges()->count(); ++i)
+ for (int i = 0; i < bridges()->size(); ++i)
bridges()->at(i)->notifyAccessibilityUpdate(event);
}
@@ -97,7 +63,7 @@ void QPlatformAccessibility::setRootObject(QObject *o)
if (!o)
return;
- for (int i = 0; i < bridges()->count(); ++i) {
+ for (int i = 0; i < bridges()->size(); ++i) {
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(o);
bridges()->at(i)->setRootObject(iface);
}
@@ -139,6 +105,6 @@ void QPlatformAccessibility::setActive(bool active)
QAccessible::setActive(active);
}
-#endif // QT_NO_ACCESSIBILITY
+#endif // QT_CONFIG(accessibility)
QT_END_NAMESPACE
diff --git a/src/gui/accessible/qplatformaccessibility.h b/src/gui/accessible/qplatformaccessibility.h
index 5d668c2bd6..004fcfb40f 100644
--- a/src/gui/accessible/qplatformaccessibility.h
+++ b/src/gui/accessible/qplatformaccessibility.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QPLATFORMACCESSIBILITY_H
#define QPLATFORMACCESSIBILITY_H
@@ -50,7 +14,7 @@
#include <QtGui/qtguiglobal.h>
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
#include <QtCore/qobject.h>
#include <QtGui/qaccessible.h>
@@ -78,6 +42,6 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_ACCESSIBILITY
+#endif // QT_CONFIG(accessibility)
#endif // QPLATFORMACCESSIBILITY_H
diff --git a/src/gui/accessible/windows/apisupport/qwindowsuiawrapper.cpp b/src/gui/accessible/windows/apisupport/qwindowsuiawrapper.cpp
deleted file mode 100644
index 8038e1a3c3..0000000000
--- a/src/gui/accessible/windows/apisupport/qwindowsuiawrapper.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <initguid.h>
-
-#include "qwindowsuiawrapper_p.h"
-#include <QtCore/private/qsystemlibrary_p.h>
-
-QT_BEGIN_NAMESPACE
-
-// private constructor
-QWindowsUiaWrapper::QWindowsUiaWrapper()
-{
- QSystemLibrary uiaLib(QStringLiteral("UIAutomationCore"));
- if (uiaLib.load()) {
- m_pUiaReturnRawElementProvider = reinterpret_cast<PtrUiaReturnRawElementProvider>(uiaLib.resolve("UiaReturnRawElementProvider"));
- m_pUiaHostProviderFromHwnd = reinterpret_cast<PtrUiaHostProviderFromHwnd>(uiaLib.resolve("UiaHostProviderFromHwnd"));
- m_pUiaRaiseAutomationPropertyChangedEvent = reinterpret_cast<PtrUiaRaiseAutomationPropertyChangedEvent>(uiaLib.resolve("UiaRaiseAutomationPropertyChangedEvent"));
- m_pUiaRaiseAutomationEvent = reinterpret_cast<PtrUiaRaiseAutomationEvent>(uiaLib.resolve("UiaRaiseAutomationEvent"));
- m_pUiaRaiseNotificationEvent = reinterpret_cast<PtrUiaRaiseNotificationEvent>(uiaLib.resolve("UiaRaiseNotificationEvent"));
- m_pUiaClientsAreListening = reinterpret_cast<PtrUiaClientsAreListening>(uiaLib.resolve("UiaClientsAreListening"));
- }
-}
-
-QWindowsUiaWrapper::~QWindowsUiaWrapper()
-{
-}
-
-// shared instance
-QWindowsUiaWrapper *QWindowsUiaWrapper::instance()
-{
- static QWindowsUiaWrapper wrapper;
- return &wrapper;
-}
-
-// True if most symbols resolved (UiaRaiseNotificationEvent is optional).
-BOOL QWindowsUiaWrapper::ready()
-{
- return m_pUiaReturnRawElementProvider
- && m_pUiaHostProviderFromHwnd
- && m_pUiaRaiseAutomationPropertyChangedEvent
- && m_pUiaRaiseAutomationEvent
- && m_pUiaClientsAreListening;
-}
-
-BOOL QWindowsUiaWrapper::clientsAreListening()
-{
- if (!m_pUiaClientsAreListening)
- return FALSE;
- return m_pUiaClientsAreListening();
-}
-
-LRESULT QWindowsUiaWrapper::returnRawElementProvider(HWND hwnd, WPARAM wParam, LPARAM lParam, IRawElementProviderSimple *el)
-{
- if (!m_pUiaReturnRawElementProvider)
- return static_cast<LRESULT>(NULL);
- return m_pUiaReturnRawElementProvider(hwnd, wParam, lParam, el);
-}
-
-HRESULT QWindowsUiaWrapper::hostProviderFromHwnd(HWND hwnd, IRawElementProviderSimple **ppProvider)
-{
- if (!m_pUiaHostProviderFromHwnd)
- return UIA_E_NOTSUPPORTED;
- return m_pUiaHostProviderFromHwnd(hwnd, ppProvider);
-}
-
-HRESULT QWindowsUiaWrapper::raiseAutomationPropertyChangedEvent(IRawElementProviderSimple *pProvider, PROPERTYID id, VARIANT oldValue, VARIANT newValue)
-{
- if (!m_pUiaRaiseAutomationPropertyChangedEvent)
- return UIA_E_NOTSUPPORTED;
- return m_pUiaRaiseAutomationPropertyChangedEvent(pProvider, id, oldValue, newValue);
-}
-
-HRESULT QWindowsUiaWrapper::raiseAutomationEvent(IRawElementProviderSimple *pProvider, EVENTID id)
-{
- if (!m_pUiaRaiseAutomationEvent)
- return UIA_E_NOTSUPPORTED;
- return m_pUiaRaiseAutomationEvent(pProvider, id);
-}
-
-HRESULT QWindowsUiaWrapper::raiseNotificationEvent(IRawElementProviderSimple *provider, NotificationKind notificationKind, NotificationProcessing notificationProcessing, BSTR displayString, BSTR activityId)
-{
- if (!m_pUiaRaiseNotificationEvent)
- return UIA_E_NOTSUPPORTED;
- return m_pUiaRaiseNotificationEvent(provider, notificationKind, notificationProcessing, displayString, activityId);
-}
-
-QT_END_NAMESPACE
-
diff --git a/src/gui/accessible/windows/apisupport/qwindowsuiawrapper_p.h b/src/gui/accessible/windows/apisupport/qwindowsuiawrapper_p.h
deleted file mode 100644
index b814295215..0000000000
--- a/src/gui/accessible/windows/apisupport/qwindowsuiawrapper_p.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWINDOWSUIAWRAPPER_H
-#define QWINDOWSUIAWRAPPER_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists for the convenience
-// of other Qt classes. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtGui/private/qtguiglobal_p.h>
-
-#include "uiatypes_p.h"
-#include "uiaattributeids_p.h"
-#include "uiacontroltypeids_p.h"
-#include "uiaerrorids_p.h"
-#include "uiaeventids_p.h"
-#include "uiageneralids_p.h"
-#include "uiapatternids_p.h"
-#include "uiapropertyids_p.h"
-#include "uiaserverinterfaces_p.h"
-#include "uiaclientinterfaces_p.h"
-
-QT_REQUIRE_CONFIG(accessibility);
-
-QT_BEGIN_NAMESPACE
-
-class Q_GUI_EXPORT QWindowsUiaWrapper
-{
- QWindowsUiaWrapper();
- virtual ~QWindowsUiaWrapper();
-public:
- static QWindowsUiaWrapper *instance();
- BOOL ready();
- BOOL clientsAreListening();
- LRESULT returnRawElementProvider(HWND hwnd, WPARAM wParam, LPARAM lParam, IRawElementProviderSimple *el);
- HRESULT hostProviderFromHwnd(HWND hwnd, IRawElementProviderSimple **ppProvider);
- HRESULT raiseAutomationPropertyChangedEvent(IRawElementProviderSimple *pProvider, PROPERTYID id, VARIANT oldValue, VARIANT newValue);
- HRESULT raiseAutomationEvent(IRawElementProviderSimple *pProvider, EVENTID id);
- HRESULT raiseNotificationEvent(IRawElementProviderSimple *provider, NotificationKind notificationKind, NotificationProcessing notificationProcessing, BSTR displayString, BSTR activityId);
-
-private:
- typedef LRESULT (WINAPI *PtrUiaReturnRawElementProvider)(HWND, WPARAM, LPARAM, IRawElementProviderSimple *);
- typedef HRESULT (WINAPI *PtrUiaHostProviderFromHwnd)(HWND, IRawElementProviderSimple **);
- typedef HRESULT (WINAPI *PtrUiaRaiseAutomationPropertyChangedEvent)(IRawElementProviderSimple *, PROPERTYID, VARIANT, VARIANT);
- typedef HRESULT (WINAPI *PtrUiaRaiseAutomationEvent)(IRawElementProviderSimple *, EVENTID);
- typedef HRESULT (WINAPI *PtrUiaRaiseNotificationEvent)(IRawElementProviderSimple *, NotificationKind, NotificationProcessing, BSTR, BSTR);
- typedef BOOL (WINAPI *PtrUiaClientsAreListening)();
- PtrUiaReturnRawElementProvider m_pUiaReturnRawElementProvider = nullptr;
- PtrUiaHostProviderFromHwnd m_pUiaHostProviderFromHwnd = nullptr;
- PtrUiaRaiseAutomationPropertyChangedEvent m_pUiaRaiseAutomationPropertyChangedEvent = nullptr;
- PtrUiaRaiseAutomationEvent m_pUiaRaiseAutomationEvent = nullptr;
- PtrUiaRaiseNotificationEvent m_pUiaRaiseNotificationEvent = nullptr;
- PtrUiaClientsAreListening m_pUiaClientsAreListening = nullptr;
-};
-
-QT_END_NAMESPACE
-
-#endif //QWINDOWSUIAWRAPPER_H
-
diff --git a/src/gui/accessible/windows/apisupport/uiaattributeids_p.h b/src/gui/accessible/windows/apisupport/uiaattributeids_p.h
deleted file mode 100644
index 795cb9e551..0000000000
--- a/src/gui/accessible/windows/apisupport/uiaattributeids_p.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef UIAATTRIBUTEIDS_H
-#define UIAATTRIBUTEIDS_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#define UIA_AnimationStyleAttributeId 40000
-#define UIA_BackgroundColorAttributeId 40001
-#define UIA_BulletStyleAttributeId 40002
-#define UIA_CapStyleAttributeId 40003
-#define UIA_CultureAttributeId 40004
-#define UIA_FontNameAttributeId 40005
-#define UIA_FontSizeAttributeId 40006
-#define UIA_FontWeightAttributeId 40007
-#define UIA_ForegroundColorAttributeId 40008
-#define UIA_HorizontalTextAlignmentAttributeId 40009
-#define UIA_IndentationFirstLineAttributeId 40010
-#define UIA_IndentationLeadingAttributeId 40011
-#define UIA_IndentationTrailingAttributeId 40012
-#define UIA_IsHiddenAttributeId 40013
-#define UIA_IsItalicAttributeId 40014
-#define UIA_IsReadOnlyAttributeId 40015
-#define UIA_IsSubscriptAttributeId 40016
-#define UIA_IsSuperscriptAttributeId 40017
-#define UIA_MarginBottomAttributeId 40018
-#define UIA_MarginLeadingAttributeId 40019
-#define UIA_MarginTopAttributeId 40020
-#define UIA_MarginTrailingAttributeId 40021
-#define UIA_OutlineStylesAttributeId 40022
-#define UIA_OverlineColorAttributeId 40023
-#define UIA_OverlineStyleAttributeId 40024
-#define UIA_StrikethroughColorAttributeId 40025
-#define UIA_StrikethroughStyleAttributeId 40026
-#define UIA_TabsAttributeId 40027
-#define UIA_TextFlowDirectionsAttributeId 40028
-#define UIA_UnderlineColorAttributeId 40029
-#define UIA_UnderlineStyleAttributeId 40030
-#define UIA_AnnotationTypesAttributeId 40031
-#define UIA_AnnotationObjectsAttributeId 40032
-#define UIA_StyleNameAttributeId 40033
-#define UIA_StyleIdAttributeId 40034
-#define UIA_LinkAttributeId 40035
-#define UIA_IsActiveAttributeId 40036
-#define UIA_SelectionActiveEndAttributeId 40037
-#define UIA_CaretPositionAttributeId 40038
-#define UIA_CaretBidiModeAttributeId 40039
-#define UIA_LineSpacingAttributeId 40040
-#define UIA_BeforeParagraphSpacingAttributeId 40041
-#define UIA_AfterParagraphSpacingAttributeId 40042
-#define UIA_SayAsInterpretAsAttributeId 40043
-
-#endif
diff --git a/src/gui/accessible/windows/apisupport/uiaclientinterfaces_p.h b/src/gui/accessible/windows/apisupport/uiaclientinterfaces_p.h
deleted file mode 100644
index a4f3e15baa..0000000000
--- a/src/gui/accessible/windows/apisupport/uiaclientinterfaces_p.h
+++ /dev/null
@@ -1,266 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef UIACLIENTINTERFACES_H
-#define UIACLIENTINTERFACES_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <unknwn.h>
-
-#ifndef __IUIAutomationElement_INTERFACE_DEFINED__
-
-struct IUIAutomationCondition;
-struct IUIAutomationCacheRequest;
-struct IUIAutomationElementArray;
-struct IUIAutomationTreeWalker;
-struct IUIAutomationEventHandler;
-struct IUIAutomationPropertyChangedEventHandler;
-struct IUIAutomationStructureChangedEventHandler;
-struct IUIAutomationFocusChangedEventHandler;
-struct IUIAutomationProxyFactory;
-struct IUIAutomationProxyFactoryEntry;
-struct IUIAutomationProxyFactoryMapping;
-#ifndef __IAccessible_FWD_DEFINED__
-#define __IAccessible_FWD_DEFINED__
-struct IAccessible;
-#endif /* __IAccessible_FWD_DEFINED__ */
-
-#define __IUIAutomationElement_INTERFACE_DEFINED__
-DEFINE_GUID(IID_IUIAutomationElement, 0xd22108aa, 0x8ac5, 0x49a5, 0x83,0x7b, 0x37,0xbb,0xb3,0xd7,0x59,0x1e);
-MIDL_INTERFACE("d22108aa-8ac5-49a5-837b-37bbb3d7591e")
-IUIAutomationElement : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE SetFocus() = 0;
- virtual HRESULT STDMETHODCALLTYPE GetRuntimeId(__RPC__deref_out_opt SAFEARRAY **runtimeId) = 0;
- virtual HRESULT STDMETHODCALLTYPE FindFirst(enum TreeScope scope, __RPC__in_opt IUIAutomationCondition *condition, __RPC__deref_out_opt IUIAutomationElement **found) = 0;
- virtual HRESULT STDMETHODCALLTYPE FindAll(enum TreeScope scope, __RPC__in_opt IUIAutomationCondition *condition, __RPC__deref_out_opt IUIAutomationElementArray **found) = 0;
- virtual HRESULT STDMETHODCALLTYPE FindFirstBuildCache(enum TreeScope scope, __RPC__in_opt IUIAutomationCondition *condition, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **found) = 0;
- virtual HRESULT STDMETHODCALLTYPE FindAllBuildCache(enum TreeScope scope, __RPC__in_opt IUIAutomationCondition *condition, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElementArray **found) = 0;
- virtual HRESULT STDMETHODCALLTYPE BuildUpdatedCache(__RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **updatedElement) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetCurrentPropertyValue(PROPERTYID propertyId, __RPC__out VARIANT *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetCurrentPropertyValueEx(PROPERTYID propertyId, BOOL ignoreDefaultValue, __RPC__out VARIANT *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetCachedPropertyValue(PROPERTYID propertyId, __RPC__out VARIANT *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetCachedPropertyValueEx(PROPERTYID propertyId, BOOL ignoreDefaultValue, __RPC__out VARIANT *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetCurrentPatternAs(PATTERNID patternId, __RPC__in REFIID riid, __RPC__deref_out_opt void **patternObject) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetCachedPatternAs(PATTERNID patternId, __RPC__in REFIID riid, __RPC__deref_out_opt void **patternObject) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetCurrentPattern(PATTERNID patternId, __RPC__deref_out_opt IUnknown **patternObject) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetCachedPattern(PATTERNID patternId, __RPC__deref_out_opt IUnknown **patternObject) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetCachedParent(__RPC__deref_out_opt IUIAutomationElement **parent) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetCachedChildren(__RPC__deref_out_opt IUIAutomationElementArray **children) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentProcessId(__RPC__out int *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentControlType(__RPC__out CONTROLTYPEID *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentLocalizedControlType(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentName(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentAcceleratorKey(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentAccessKey(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentHasKeyboardFocus(__RPC__out BOOL *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentIsKeyboardFocusable(__RPC__out BOOL *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentIsEnabled(__RPC__out BOOL *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentAutomationId(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentClassName(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentHelpText(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentCulture(__RPC__out int *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentIsControlElement(__RPC__out BOOL *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentIsContentElement(__RPC__out BOOL *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentIsPassword(__RPC__out BOOL *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentNativeWindowHandle(__RPC__deref_out_opt UIA_HWND *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentItemType(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentIsOffscreen(__RPC__out BOOL *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentOrientation(__RPC__out enum OrientationType *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentFrameworkId(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentIsRequiredForForm(__RPC__out BOOL *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentItemStatus(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentBoundingRectangle(__RPC__out RECT *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentLabeledBy(__RPC__deref_out_opt IUIAutomationElement **retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentAriaRole(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentAriaProperties(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentIsDataValidForForm(__RPC__out BOOL *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentControllerFor(__RPC__deref_out_opt IUIAutomationElementArray **retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentDescribedBy(__RPC__deref_out_opt IUIAutomationElementArray **retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentFlowsTo(__RPC__deref_out_opt IUIAutomationElementArray **retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CurrentProviderDescription(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedProcessId(__RPC__out int *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedControlType(__RPC__out CONTROLTYPEID *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedLocalizedControlType(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedName(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedAcceleratorKey(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedAccessKey(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedHasKeyboardFocus(__RPC__out BOOL *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedIsKeyboardFocusable(__RPC__out BOOL *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedIsEnabled(__RPC__out BOOL *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedAutomationId(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedClassName(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedHelpText(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedCulture(__RPC__out int *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedIsControlElement(__RPC__out BOOL *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedIsContentElement(__RPC__out BOOL *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedIsPassword(__RPC__out BOOL *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedNativeWindowHandle(__RPC__deref_out_opt UIA_HWND *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedItemType(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedIsOffscreen(__RPC__out BOOL *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedOrientation(__RPC__out enum OrientationType *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedFrameworkId(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedIsRequiredForForm(__RPC__out BOOL *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedItemStatus(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedBoundingRectangle(__RPC__out RECT *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedLabeledBy(__RPC__deref_out_opt IUIAutomationElement **retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedAriaRole(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedAriaProperties(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedIsDataValidForForm(__RPC__out BOOL *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedControllerFor(__RPC__deref_out_opt IUIAutomationElementArray **retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedDescribedBy(__RPC__deref_out_opt IUIAutomationElementArray **retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedFlowsTo(__RPC__deref_out_opt IUIAutomationElementArray **retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CachedProviderDescription(__RPC__deref_out_opt BSTR *retVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetClickablePoint(__RPC__out POINT *clickable, __RPC__out BOOL *gotClickable) = 0;
-};
-#ifdef __CRT_UUID_DECL
-__CRT_UUID_DECL(IUIAutomationElement, 0xd22108aa, 0x8ac5, 0x49a5, 0x83,0x7b, 0x37,0xbb,0xb3,0xd7,0x59,0x1e)
-#endif
-#endif
-
-
-#ifndef __IUIAutomation_INTERFACE_DEFINED__
-#define __IUIAutomation_INTERFACE_DEFINED__
-DEFINE_GUID(IID_IUIAutomation, 0x30cbe57d, 0xd9d0, 0x452a, 0xab,0x13, 0x7a,0xc5,0xac,0x48,0x25,0xee);
-MIDL_INTERFACE("30cbe57d-d9d0-452a-ab13-7ac5ac4825ee")
-IUIAutomation : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE CompareElements(__RPC__in_opt IUIAutomationElement *el1, __RPC__in_opt IUIAutomationElement *el2, __RPC__out BOOL *areSame) = 0;
- virtual HRESULT STDMETHODCALLTYPE CompareRuntimeIds(__RPC__in SAFEARRAY * runtimeId1, __RPC__in SAFEARRAY * runtimeId2, __RPC__out BOOL *areSame) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetRootElement(__RPC__deref_out_opt IUIAutomationElement **root) = 0;
- virtual HRESULT STDMETHODCALLTYPE ElementFromHandle(__RPC__in UIA_HWND hwnd, __RPC__deref_out_opt IUIAutomationElement **element) = 0;
- virtual HRESULT STDMETHODCALLTYPE ElementFromPoint(POINT pt, __RPC__deref_out_opt IUIAutomationElement **element) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetFocusedElement(__RPC__deref_out_opt IUIAutomationElement **element) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetRootElementBuildCache(__RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **root) = 0;
- virtual HRESULT STDMETHODCALLTYPE ElementFromHandleBuildCache(__RPC__in UIA_HWND hwnd, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **element) = 0;
- virtual HRESULT STDMETHODCALLTYPE ElementFromPointBuildCache(POINT pt, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **element) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetFocusedElementBuildCache(__RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **element) = 0;
- virtual HRESULT STDMETHODCALLTYPE CreateTreeWalker(__RPC__in_opt IUIAutomationCondition *pCondition, __RPC__deref_out_opt IUIAutomationTreeWalker **walker) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_ControlViewWalker(__RPC__deref_out_opt IUIAutomationTreeWalker **walker) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_ContentViewWalker(__RPC__deref_out_opt IUIAutomationTreeWalker **walker) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_RawViewWalker(__RPC__deref_out_opt IUIAutomationTreeWalker **walker) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_RawViewCondition(__RPC__deref_out_opt IUIAutomationCondition **condition) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_ControlViewCondition(__RPC__deref_out_opt IUIAutomationCondition **condition) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_ContentViewCondition(__RPC__deref_out_opt IUIAutomationCondition **condition) = 0;
- virtual HRESULT STDMETHODCALLTYPE CreateCacheRequest(__RPC__deref_out_opt IUIAutomationCacheRequest **cacheRequest) = 0;
- virtual HRESULT STDMETHODCALLTYPE CreateTrueCondition(__RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0;
- virtual HRESULT STDMETHODCALLTYPE CreateFalseCondition(__RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0;
- virtual HRESULT STDMETHODCALLTYPE CreatePropertyCondition(PROPERTYID propertyId, VARIANT value, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0;
- virtual HRESULT STDMETHODCALLTYPE CreatePropertyConditionEx(PROPERTYID propertyId, VARIANT value, enum PropertyConditionFlags flags, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0;
- virtual HRESULT STDMETHODCALLTYPE CreateAndCondition(__RPC__in_opt IUIAutomationCondition *condition1, __RPC__in_opt IUIAutomationCondition *condition2, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0;
- virtual HRESULT STDMETHODCALLTYPE CreateAndConditionFromArray(__RPC__in_opt SAFEARRAY * conditions, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0;
- virtual HRESULT STDMETHODCALLTYPE CreateAndConditionFromNativeArray(__RPC__in_ecount_full(conditionCount) IUIAutomationCondition **conditions, int conditionCount, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0;
- virtual HRESULT STDMETHODCALLTYPE CreateOrCondition(__RPC__in_opt IUIAutomationCondition *condition1, __RPC__in_opt IUIAutomationCondition *condition2, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0;
- virtual HRESULT STDMETHODCALLTYPE CreateOrConditionFromArray(__RPC__in_opt SAFEARRAY * conditions, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0;
- virtual HRESULT STDMETHODCALLTYPE CreateOrConditionFromNativeArray(__RPC__in_ecount_full(conditionCount) IUIAutomationCondition **conditions, int conditionCount, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0;
- virtual HRESULT STDMETHODCALLTYPE CreateNotCondition(__RPC__in_opt IUIAutomationCondition *condition, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0;
- virtual HRESULT STDMETHODCALLTYPE AddAutomationEventHandler(EVENTID eventId, __RPC__in_opt IUIAutomationElement *element, enum TreeScope scope, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__in_opt IUIAutomationEventHandler *handler) = 0;
- virtual HRESULT STDMETHODCALLTYPE RemoveAutomationEventHandler(EVENTID eventId, __RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationEventHandler *handler) = 0;
- virtual HRESULT STDMETHODCALLTYPE AddPropertyChangedEventHandlerNativeArray(__RPC__in_opt IUIAutomationElement *element, enum TreeScope scope, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__in_opt IUIAutomationPropertyChangedEventHandler *handler, __RPC__in_ecount_full(propertyCount) PROPERTYID *propertyArray, int propertyCount) = 0;
- virtual HRESULT STDMETHODCALLTYPE AddPropertyChangedEventHandler(__RPC__in_opt IUIAutomationElement *element, enum TreeScope scope, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__in_opt IUIAutomationPropertyChangedEventHandler *handler, __RPC__in SAFEARRAY * propertyArray) = 0;
- virtual HRESULT STDMETHODCALLTYPE RemovePropertyChangedEventHandler(__RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationPropertyChangedEventHandler *handler) = 0;
- virtual HRESULT STDMETHODCALLTYPE AddStructureChangedEventHandler(__RPC__in_opt IUIAutomationElement *element, enum TreeScope scope, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__in_opt IUIAutomationStructureChangedEventHandler *handler) = 0;
- virtual HRESULT STDMETHODCALLTYPE RemoveStructureChangedEventHandler(__RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationStructureChangedEventHandler *handler) = 0;
- virtual HRESULT STDMETHODCALLTYPE AddFocusChangedEventHandler(__RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__in_opt IUIAutomationFocusChangedEventHandler *handler) = 0;
- virtual HRESULT STDMETHODCALLTYPE RemoveFocusChangedEventHandler(__RPC__in_opt IUIAutomationFocusChangedEventHandler *handler) = 0;
- virtual HRESULT STDMETHODCALLTYPE RemoveAllEventHandlers() = 0;
- virtual HRESULT STDMETHODCALLTYPE IntNativeArrayToSafeArray(__RPC__in_ecount_full(arrayCount) int *array, int arrayCount, __RPC__deref_out_opt SAFEARRAY **safeArray) = 0;
- virtual HRESULT STDMETHODCALLTYPE IntSafeArrayToNativeArray(__RPC__in SAFEARRAY * intArray, __RPC__deref_out_ecount_full_opt(*arrayCount) int **array, __RPC__out int *arrayCount) = 0;
- virtual HRESULT STDMETHODCALLTYPE RectToVariant(RECT rc, __RPC__out VARIANT *var) = 0;
- virtual HRESULT STDMETHODCALLTYPE VariantToRect(VARIANT var, __RPC__out RECT *rc) = 0;
- virtual HRESULT STDMETHODCALLTYPE SafeArrayToRectNativeArray(__RPC__in SAFEARRAY * rects, __RPC__deref_out_ecount_full_opt(*rectArrayCount) RECT **rectArray, __RPC__out int *rectArrayCount) = 0;
- virtual HRESULT STDMETHODCALLTYPE CreateProxyFactoryEntry(__RPC__in_opt IUIAutomationProxyFactory *factory, __RPC__deref_out_opt IUIAutomationProxyFactoryEntry **factoryEntry) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_ProxyFactoryMapping(__RPC__deref_out_opt IUIAutomationProxyFactoryMapping **factoryMapping) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetPropertyProgrammaticName(PROPERTYID property, __RPC__deref_out_opt BSTR *name) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetPatternProgrammaticName(PATTERNID pattern, __RPC__deref_out_opt BSTR *name) = 0;
- virtual HRESULT STDMETHODCALLTYPE PollForPotentialSupportedPatterns(__RPC__in_opt IUIAutomationElement *pElement, __RPC__deref_out_opt SAFEARRAY **patternIds, __RPC__deref_out_opt SAFEARRAY **patternNames) = 0;
- virtual HRESULT STDMETHODCALLTYPE PollForPotentialSupportedProperties(__RPC__in_opt IUIAutomationElement *pElement, __RPC__deref_out_opt SAFEARRAY **propertyIds, __RPC__deref_out_opt SAFEARRAY **propertyNames) = 0;
- virtual HRESULT STDMETHODCALLTYPE CheckNotSupported(VARIANT value, __RPC__out BOOL *isNotSupported) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_ReservedNotSupportedValue(__RPC__deref_out_opt IUnknown **notSupportedValue) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_ReservedMixedAttributeValue(__RPC__deref_out_opt IUnknown **mixedAttributeValue) = 0;
- virtual HRESULT STDMETHODCALLTYPE ElementFromIAccessible(__RPC__in_opt IAccessible *accessible, int childId, __RPC__deref_out_opt IUIAutomationElement **element) = 0;
- virtual HRESULT STDMETHODCALLTYPE ElementFromIAccessibleBuildCache(__RPC__in_opt IAccessible *accessible, int childId, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **element) = 0;
-};
-#ifdef __CRT_UUID_DECL
-__CRT_UUID_DECL(IUIAutomation, 0x30cbe57d, 0xd9d0, 0x452a, 0xab,0x13, 0x7a,0xc5,0xac,0x48,0x25,0xee)
-#endif
-#endif
-
-
-#ifndef __IUIAutomationTreeWalker_INTERFACE_DEFINED__
-#define __IUIAutomationTreeWalker_INTERFACE_DEFINED__
-DEFINE_GUID(IID_IUIAutomationTreeWalker, 0x4042c624, 0x389c, 0x4afc, 0xa6,0x30, 0x9d,0xf8,0x54,0xa5,0x41,0xfc);
-MIDL_INTERFACE("4042c624-389c-4afc-a630-9df854a541fc")
-IUIAutomationTreeWalker : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE GetParentElement(__RPC__in_opt IUIAutomationElement *element, __RPC__deref_out_opt IUIAutomationElement **parent) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetFirstChildElement(__RPC__in_opt IUIAutomationElement *element, __RPC__deref_out_opt IUIAutomationElement **first) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetLastChildElement(__RPC__in_opt IUIAutomationElement *element, __RPC__deref_out_opt IUIAutomationElement **last) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetNextSiblingElement(__RPC__in_opt IUIAutomationElement *element, __RPC__deref_out_opt IUIAutomationElement **next) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetPreviousSiblingElement(__RPC__in_opt IUIAutomationElement *element, __RPC__deref_out_opt IUIAutomationElement **previous) = 0;
- virtual HRESULT STDMETHODCALLTYPE NormalizeElement(__RPC__in_opt IUIAutomationElement *element, __RPC__deref_out_opt IUIAutomationElement **normalized) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetParentElementBuildCache(__RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **parent) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetFirstChildElementBuildCache(__RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **first) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetLastChildElementBuildCache(__RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **last) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetNextSiblingElementBuildCache(__RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **next) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetPreviousSiblingElementBuildCache(__RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **previous) = 0;
- virtual HRESULT STDMETHODCALLTYPE NormalizeElementBuildCache(__RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **normalized) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_Condition(__RPC__deref_out_opt IUIAutomationCondition **condition) = 0;
-};
-#ifdef __CRT_UUID_DECL
-__CRT_UUID_DECL(IUIAutomationTreeWalker, 0x4042c624, 0x389c, 0x4afc, 0xa6,0x30, 0x9d,0xf8,0x54,0xa5,0x41,0xfc)
-#endif
-#endif
-
-DEFINE_GUID(CLSID_CUIAutomation, 0xff48dba4, 0x60ef, 0x4201, 0xaa,0x87, 0x54,0x10,0x3e,0xef,0x59,0x4e);
-
-#endif
diff --git a/src/gui/accessible/windows/apisupport/uiacontroltypeids_p.h b/src/gui/accessible/windows/apisupport/uiacontroltypeids_p.h
deleted file mode 100644
index b5c5a0a4ff..0000000000
--- a/src/gui/accessible/windows/apisupport/uiacontroltypeids_p.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef UIACONTROLTYPEIDS_H
-#define UIACONTROLTYPEIDS_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#define UIA_ButtonControlTypeId 50000
-#define UIA_CalendarControlTypeId 50001
-#define UIA_CheckBoxControlTypeId 50002
-#define UIA_ComboBoxControlTypeId 50003
-#define UIA_EditControlTypeId 50004
-#define UIA_HyperlinkControlTypeId 50005
-#define UIA_ImageControlTypeId 50006
-#define UIA_ListItemControlTypeId 50007
-#define UIA_ListControlTypeId 50008
-#define UIA_MenuControlTypeId 50009
-#define UIA_MenuBarControlTypeId 50010
-#define UIA_MenuItemControlTypeId 50011
-#define UIA_ProgressBarControlTypeId 50012
-#define UIA_RadioButtonControlTypeId 50013
-#define UIA_ScrollBarControlTypeId 50014
-#define UIA_SliderControlTypeId 50015
-#define UIA_SpinnerControlTypeId 50016
-#define UIA_StatusBarControlTypeId 50017
-#define UIA_TabControlTypeId 50018
-#define UIA_TabItemControlTypeId 50019
-#define UIA_TextControlTypeId 50020
-#define UIA_ToolBarControlTypeId 50021
-#define UIA_ToolTipControlTypeId 50022
-#define UIA_TreeControlTypeId 50023
-#define UIA_TreeItemControlTypeId 50024
-#define UIA_CustomControlTypeId 50025
-#define UIA_GroupControlTypeId 50026
-#define UIA_ThumbControlTypeId 50027
-#define UIA_DataGridControlTypeId 50028
-#define UIA_DataItemControlTypeId 50029
-#define UIA_DocumentControlTypeId 50030
-#define UIA_SplitButtonControlTypeId 50031
-#define UIA_WindowControlTypeId 50032
-#define UIA_PaneControlTypeId 50033
-#define UIA_HeaderControlTypeId 50034
-#define UIA_HeaderItemControlTypeId 50035
-#define UIA_TableControlTypeId 50036
-#define UIA_TitleBarControlTypeId 50037
-#define UIA_SeparatorControlTypeId 50038
-#define UIA_SemanticZoomControlTypeId 50039
-#define UIA_AppBarControlTypeId 50040
-
-#endif
diff --git a/src/gui/accessible/windows/apisupport/uiaerrorids_p.h b/src/gui/accessible/windows/apisupport/uiaerrorids_p.h
deleted file mode 100644
index 8c2a24dbc7..0000000000
--- a/src/gui/accessible/windows/apisupport/uiaerrorids_p.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef UIAERRORIDS_H
-#define UIAERRORIDS_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#define UIA_E_ELEMENTNOTENABLED 0x80040200
-#define UIA_E_ELEMENTNOTAVAILABLE 0x80040201
-#define UIA_E_NOCLICKABLEPOINT 0x80040202
-#define UIA_E_PROXYASSEMBLYNOTLOADED 0x80040203
-#define UIA_E_NOTSUPPORTED 0x80040204
-#define UIA_E_INVALIDOPERATION 0x80131509
-#define UIA_E_TIMEOUT 0x80131505
-
-#endif
diff --git a/src/gui/accessible/windows/apisupport/uiaeventids_p.h b/src/gui/accessible/windows/apisupport/uiaeventids_p.h
deleted file mode 100644
index ed6c36834e..0000000000
--- a/src/gui/accessible/windows/apisupport/uiaeventids_p.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef UIAEVENTIDS_H
-#define UIAEVENTIDS_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#define UIA_ToolTipOpenedEventId 20000
-#define UIA_ToolTipClosedEventId 20001
-#define UIA_StructureChangedEventId 20002
-#define UIA_MenuOpenedEventId 20003
-#define UIA_AutomationPropertyChangedEventId 20004
-#define UIA_AutomationFocusChangedEventId 20005
-#define UIA_AsyncContentLoadedEventId 20006
-#define UIA_MenuClosedEventId 20007
-#define UIA_LayoutInvalidatedEventId 20008
-#define UIA_Invoke_InvokedEventId 20009
-#define UIA_SelectionItem_ElementAddedToSelectionEventId 20010
-#define UIA_SelectionItem_ElementRemovedFromSelectionEventId 20011
-#define UIA_SelectionItem_ElementSelectedEventId 20012
-#define UIA_Selection_InvalidatedEventId 20013
-#define UIA_Text_TextSelectionChangedEventId 20014
-#define UIA_Text_TextChangedEventId 20015
-#define UIA_Window_WindowOpenedEventId 20016
-#define UIA_Window_WindowClosedEventId 20017
-#define UIA_MenuModeStartEventId 20018
-#define UIA_MenuModeEndEventId 20019
-#define UIA_InputReachedTargetEventId 20020
-#define UIA_InputReachedOtherElementEventId 20021
-#define UIA_InputDiscardedEventId 20022
-#define UIA_SystemAlertEventId 20023
-#define UIA_LiveRegionChangedEventId 20024
-#define UIA_HostedFragmentRootsInvalidatedEventId 20025
-#define UIA_Drag_DragStartEventId 20026
-#define UIA_Drag_DragCancelEventId 20027
-#define UIA_Drag_DragCompleteEventId 20028
-#define UIA_DropTarget_DragEnterEventId 20029
-#define UIA_DropTarget_DragLeaveEventId 20030
-#define UIA_DropTarget_DroppedEventId 20031
-#define UIA_TextEdit_TextChangedEventId 20032
-#define UIA_TextEdit_ConversionTargetChangedEventId 20033
-#define UIA_ChangesEventId 20034
-
-#endif
diff --git a/src/gui/accessible/windows/apisupport/uiageneralids_p.h b/src/gui/accessible/windows/apisupport/uiageneralids_p.h
deleted file mode 100644
index 220554f885..0000000000
--- a/src/gui/accessible/windows/apisupport/uiageneralids_p.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef UIAGENERALIDS_H
-#define UIAGENERALIDS_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#define UiaAppendRuntimeId 3
-#define UiaRootObjectId -25
-
-#endif
diff --git a/src/gui/accessible/windows/apisupport/uiapatternids_p.h b/src/gui/accessible/windows/apisupport/uiapatternids_p.h
deleted file mode 100644
index d3f4c9bd7a..0000000000
--- a/src/gui/accessible/windows/apisupport/uiapatternids_p.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef UIAPATTERNIDS_H
-#define UIAPATTERNIDS_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#define UIA_InvokePatternId 10000
-#define UIA_SelectionPatternId 10001
-#define UIA_ValuePatternId 10002
-#define UIA_RangeValuePatternId 10003
-#define UIA_ScrollPatternId 10004
-#define UIA_ExpandCollapsePatternId 10005
-#define UIA_GridPatternId 10006
-#define UIA_GridItemPatternId 10007
-#define UIA_MultipleViewPatternId 10008
-#define UIA_WindowPatternId 10009
-#define UIA_SelectionItemPatternId 10010
-#define UIA_DockPatternId 10011
-#define UIA_TablePatternId 10012
-#define UIA_TableItemPatternId 10013
-#define UIA_TextPatternId 10014
-#define UIA_TogglePatternId 10015
-#define UIA_TransformPatternId 10016
-#define UIA_ScrollItemPatternId 10017
-#define UIA_LegacyIAccessiblePatternId 10018
-#define UIA_ItemContainerPatternId 10019
-#define UIA_VirtualizedItemPatternId 10020
-#define UIA_SynchronizedInputPatternId 10021
-#define UIA_ObjectModelPatternId 10022
-#define UIA_AnnotationPatternId 10023
-#define UIA_TextPattern2Id 10024
-#define UIA_StylesPatternId 10025
-#define UIA_SpreadsheetPatternId 10026
-#define UIA_SpreadsheetItemPatternId 10027
-#define UIA_TransformPattern2Id 10028
-#define UIA_TextChildPatternId 10029
-#define UIA_DragPatternId 10030
-#define UIA_DropTargetPatternId 10031
-#define UIA_TextEditPatternId 10032
-#define UIA_CustomNavigationPatternId 10033
-
-#endif
diff --git a/src/gui/accessible/windows/apisupport/uiapropertyids_p.h b/src/gui/accessible/windows/apisupport/uiapropertyids_p.h
deleted file mode 100644
index 9c14a35271..0000000000
--- a/src/gui/accessible/windows/apisupport/uiapropertyids_p.h
+++ /dev/null
@@ -1,224 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef UIAPROPERTYIDS_H
-#define UIAPROPERTYIDS_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#define UIA_RuntimeIdPropertyId 30000
-#define UIA_BoundingRectanglePropertyId 30001
-#define UIA_ProcessIdPropertyId 30002
-#define UIA_ControlTypePropertyId 30003
-#define UIA_LocalizedControlTypePropertyId 30004
-#define UIA_NamePropertyId 30005
-#define UIA_AcceleratorKeyPropertyId 30006
-#define UIA_AccessKeyPropertyId 30007
-#define UIA_HasKeyboardFocusPropertyId 30008
-#define UIA_IsKeyboardFocusablePropertyId 30009
-#define UIA_IsEnabledPropertyId 30010
-#define UIA_AutomationIdPropertyId 30011
-#define UIA_ClassNamePropertyId 30012
-#define UIA_HelpTextPropertyId 30013
-#define UIA_ClickablePointPropertyId 30014
-#define UIA_CulturePropertyId 30015
-#define UIA_IsControlElementPropertyId 30016
-#define UIA_IsContentElementPropertyId 30017
-#define UIA_LabeledByPropertyId 30018
-#define UIA_IsPasswordPropertyId 30019
-#define UIA_NativeWindowHandlePropertyId 30020
-#define UIA_ItemTypePropertyId 30021
-#define UIA_IsOffscreenPropertyId 30022
-#define UIA_OrientationPropertyId 30023
-#define UIA_FrameworkIdPropertyId 30024
-#define UIA_IsRequiredForFormPropertyId 30025
-#define UIA_ItemStatusPropertyId 30026
-#define UIA_IsDockPatternAvailablePropertyId 30027
-#define UIA_IsExpandCollapsePatternAvailablePropertyId 30028
-#define UIA_IsGridItemPatternAvailablePropertyId 30029
-#define UIA_IsGridPatternAvailablePropertyId 30030
-#define UIA_IsInvokePatternAvailablePropertyId 30031
-#define UIA_IsMultipleViewPatternAvailablePropertyId 30032
-#define UIA_IsRangeValuePatternAvailablePropertyId 30033
-#define UIA_IsScrollPatternAvailablePropertyId 30034
-#define UIA_IsScrollItemPatternAvailablePropertyId 30035
-#define UIA_IsSelectionItemPatternAvailablePropertyId 30036
-#define UIA_IsSelectionPatternAvailablePropertyId 30037
-#define UIA_IsTablePatternAvailablePropertyId 30038
-#define UIA_IsTableItemPatternAvailablePropertyId 30039
-#define UIA_IsTextPatternAvailablePropertyId 30040
-#define UIA_IsTogglePatternAvailablePropertyId 30041
-#define UIA_IsTransformPatternAvailablePropertyId 30042
-#define UIA_IsValuePatternAvailablePropertyId 30043
-#define UIA_IsWindowPatternAvailablePropertyId 30044
-#define UIA_ValueValuePropertyId 30045
-#define UIA_ValueIsReadOnlyPropertyId 30046
-#define UIA_RangeValueValuePropertyId 30047
-#define UIA_RangeValueIsReadOnlyPropertyId 30048
-#define UIA_RangeValueMinimumPropertyId 30049
-#define UIA_RangeValueMaximumPropertyId 30050
-#define UIA_RangeValueLargeChangePropertyId 30051
-#define UIA_RangeValueSmallChangePropertyId 30052
-#define UIA_ScrollHorizontalScrollPercentPropertyId 30053
-#define UIA_ScrollHorizontalViewSizePropertyId 30054
-#define UIA_ScrollVerticalScrollPercentPropertyId 30055
-#define UIA_ScrollVerticalViewSizePropertyId 30056
-#define UIA_ScrollHorizontallyScrollablePropertyId 30057
-#define UIA_ScrollVerticallyScrollablePropertyId 30058
-#define UIA_SelectionSelectionPropertyId 30059
-#define UIA_SelectionCanSelectMultiplePropertyId 30060
-#define UIA_SelectionIsSelectionRequiredPropertyId 30061
-#define UIA_GridRowCountPropertyId 30062
-#define UIA_GridColumnCountPropertyId 30063
-#define UIA_GridItemRowPropertyId 30064
-#define UIA_GridItemColumnPropertyId 30065
-#define UIA_GridItemRowSpanPropertyId 30066
-#define UIA_GridItemColumnSpanPropertyId 30067
-#define UIA_GridItemContainingGridPropertyId 30068
-#define UIA_DockDockPositionPropertyId 30069
-#define UIA_ExpandCollapseExpandCollapseStatePropertyId 30070
-#define UIA_MultipleViewCurrentViewPropertyId 30071
-#define UIA_MultipleViewSupportedViewsPropertyId 30072
-#define UIA_WindowCanMaximizePropertyId 30073
-#define UIA_WindowCanMinimizePropertyId 30074
-#define UIA_WindowWindowVisualStatePropertyId 30075
-#define UIA_WindowWindowInteractionStatePropertyId 30076
-#define UIA_WindowIsModalPropertyId 30077
-#define UIA_WindowIsTopmostPropertyId 30078
-#define UIA_SelectionItemIsSelectedPropertyId 30079
-#define UIA_SelectionItemSelectionContainerPropertyId 30080
-#define UIA_TableRowHeadersPropertyId 30081
-#define UIA_TableColumnHeadersPropertyId 30082
-#define UIA_TableRowOrColumnMajorPropertyId 30083
-#define UIA_TableItemRowHeaderItemsPropertyId 30084
-#define UIA_TableItemColumnHeaderItemsPropertyId 30085
-#define UIA_ToggleToggleStatePropertyId 30086
-#define UIA_TransformCanMovePropertyId 30087
-#define UIA_TransformCanResizePropertyId 30088
-#define UIA_TransformCanRotatePropertyId 30089
-#define UIA_IsLegacyIAccessiblePatternAvailablePropertyId 30090
-#define UIA_LegacyIAccessibleChildIdPropertyId 30091
-#define UIA_LegacyIAccessibleNamePropertyId 30092
-#define UIA_LegacyIAccessibleValuePropertyId 30093
-#define UIA_LegacyIAccessibleDescriptionPropertyId 30094
-#define UIA_LegacyIAccessibleRolePropertyId 30095
-#define UIA_LegacyIAccessibleStatePropertyId 30096
-#define UIA_LegacyIAccessibleHelpPropertyId 30097
-#define UIA_LegacyIAccessibleKeyboardShortcutPropertyId 30098
-#define UIA_LegacyIAccessibleSelectionPropertyId 30099
-#define UIA_LegacyIAccessibleDefaultActionPropertyId 30100
-#define UIA_AriaRolePropertyId 30101
-#define UIA_AriaPropertiesPropertyId 30102
-#define UIA_IsDataValidForFormPropertyId 30103
-#define UIA_ControllerForPropertyId 30104
-#define UIA_DescribedByPropertyId 30105
-#define UIA_FlowsToPropertyId 30106
-#define UIA_ProviderDescriptionPropertyId 30107
-#define UIA_IsItemContainerPatternAvailablePropertyId 30108
-#define UIA_IsVirtualizedItemPatternAvailablePropertyId 30109
-#define UIA_IsSynchronizedInputPatternAvailablePropertyId 30110
-#define UIA_OptimizeForVisualContentPropertyId 30111
-#define UIA_IsObjectModelPatternAvailablePropertyId 30112
-#define UIA_AnnotationAnnotationTypeIdPropertyId 30113
-#define UIA_AnnotationAnnotationTypeNamePropertyId 30114
-#define UIA_AnnotationAuthorPropertyId 30115
-#define UIA_AnnotationDateTimePropertyId 30116
-#define UIA_AnnotationTargetPropertyId 30117
-#define UIA_IsAnnotationPatternAvailablePropertyId 30118
-#define UIA_IsTextPattern2AvailablePropertyId 30119
-#define UIA_StylesStyleIdPropertyId 30120
-#define UIA_StylesStyleNamePropertyId 30121
-#define UIA_StylesFillColorPropertyId 30122
-#define UIA_StylesFillPatternStylePropertyId 30123
-#define UIA_StylesShapePropertyId 30124
-#define UIA_StylesFillPatternColorPropertyId 30125
-#define UIA_StylesExtendedPropertiesPropertyId 30126
-#define UIA_IsStylesPatternAvailablePropertyId 30127
-#define UIA_IsSpreadsheetPatternAvailablePropertyId 30128
-#define UIA_SpreadsheetItemFormulaPropertyId 30129
-#define UIA_SpreadsheetItemAnnotationObjectsPropertyId 30130
-#define UIA_SpreadsheetItemAnnotationTypesPropertyId 30131
-#define UIA_IsSpreadsheetItemPatternAvailablePropertyId 30132
-#define UIA_Transform2CanZoomPropertyId 30133
-#define UIA_IsTransformPattern2AvailablePropertyId 30134
-#define UIA_LiveSettingPropertyId 30135
-#define UIA_IsTextChildPatternAvailablePropertyId 30136
-#define UIA_IsDragPatternAvailablePropertyId 30137
-#define UIA_DragIsGrabbedPropertyId 30138
-#define UIA_DragDropEffectPropertyId 30139
-#define UIA_DragDropEffectsPropertyId 30140
-#define UIA_IsDropTargetPatternAvailablePropertyId 30141
-#define UIA_DropTargetDropTargetEffectPropertyId 30142
-#define UIA_DropTargetDropTargetEffectsPropertyId 30143
-#define UIA_DragGrabbedItemsPropertyId 30144
-#define UIA_Transform2ZoomLevelPropertyId 30145
-#define UIA_Transform2ZoomMinimumPropertyId 30146
-#define UIA_Transform2ZoomMaximumPropertyId 30147
-#define UIA_FlowsFromPropertyId 30148
-#define UIA_IsTextEditPatternAvailablePropertyId 30149
-#define UIA_IsPeripheralPropertyId 30150
-#define UIA_IsCustomNavigationPatternAvailablePropertyId 30151
-#define UIA_PositionInSetPropertyId 30152
-#define UIA_SizeOfSetPropertyId 30153
-#define UIA_LevelPropertyId 30154
-#define UIA_AnnotationTypesPropertyId 30155
-#define UIA_AnnotationObjectsPropertyId 30156
-#define UIA_LandmarkTypePropertyId 30157
-#define UIA_LocalizedLandmarkTypePropertyId 30158
-#define UIA_FullDescriptionPropertyId 30159
-#define UIA_FillColorPropertyId 30160
-#define UIA_OutlineColorPropertyId 30161
-#define UIA_FillTypePropertyId 30162
-#define UIA_VisualEffectsPropertyId 30163
-#define UIA_OutlineThicknessPropertyId 30164
-#define UIA_CenterPointPropertyId 30165
-#define UIA_RotationPropertyId 30166
-#define UIA_SizePropertyId 30167
-#define UIA_IsDialogPropertyId 30174
-
-#endif
diff --git a/src/gui/accessible/windows/apisupport/uiaserverinterfaces_p.h b/src/gui/accessible/windows/apisupport/uiaserverinterfaces_p.h
deleted file mode 100644
index fde16206da..0000000000
--- a/src/gui/accessible/windows/apisupport/uiaserverinterfaces_p.h
+++ /dev/null
@@ -1,403 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef UIASERVERINTERFACES_H
-#define UIASERVERINTERFACES_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <unknwn.h>
-
-#ifndef __IRawElementProviderSimple_INTERFACE_DEFINED__
-#define __IRawElementProviderSimple_INTERFACE_DEFINED__
-DEFINE_GUID(IID_IRawElementProviderSimple, 0xd6dd68d1, 0x86fd, 0x4332, 0x86,0x66, 0x9a,0xbe,0xde,0xa2,0xd2,0x4c);
-MIDL_INTERFACE("d6dd68d1-86fd-4332-8666-9abedea2d24c")
-IRawElementProviderSimple : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE get_ProviderOptions(__RPC__out enum ProviderOptions *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetPatternProvider(PATTERNID patternId, __RPC__deref_out_opt IUnknown **pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetPropertyValue(PROPERTYID propertyId, __RPC__out VARIANT *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_HostRawElementProvider(__RPC__deref_out_opt IRawElementProviderSimple **pRetVal) = 0;
-};
-#ifdef __CRT_UUID_DECL
-__CRT_UUID_DECL(IRawElementProviderSimple, 0xd6dd68d1, 0x86fd, 0x4332, 0x86,0x66, 0x9a,0xbe,0xde,0xa2,0xd2,0x4c)
-#endif
-#endif
-
-
-#ifndef __IRawElementProviderFragmentRoot_FWD_DEFINED__
-#define __IRawElementProviderFragmentRoot_FWD_DEFINED__
-typedef interface IRawElementProviderFragmentRoot IRawElementProviderFragmentRoot;
-#endif
-
-
-#ifndef __IRawElementProviderFragment_FWD_DEFINED__
-#define __IRawElementProviderFragment_FWD_DEFINED__
-typedef interface IRawElementProviderFragment IRawElementProviderFragment;
-#endif
-
-
-#ifndef __IRawElementProviderFragment_INTERFACE_DEFINED__
-#define __IRawElementProviderFragment_INTERFACE_DEFINED__
-DEFINE_GUID(IID_IRawElementProviderFragment, 0xf7063da8, 0x8359, 0x439c, 0x92,0x97, 0xbb,0xc5,0x29,0x9a,0x7d,0x87);
-MIDL_INTERFACE("f7063da8-8359-439c-9297-bbc5299a7d87")
-IRawElementProviderFragment : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE Navigate(enum NavigateDirection direction, __RPC__deref_out_opt IRawElementProviderFragment **pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetRuntimeId(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_BoundingRectangle(__RPC__out struct UiaRect *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetEmbeddedFragmentRoots(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE SetFocus() = 0;
- virtual HRESULT STDMETHODCALLTYPE get_FragmentRoot(__RPC__deref_out_opt IRawElementProviderFragmentRoot **pRetVal) = 0;
-};
-#ifdef __CRT_UUID_DECL
-__CRT_UUID_DECL(IRawElementProviderFragment, 0xf7063da8, 0x8359, 0x439c, 0x92,0x97, 0xbb,0xc5,0x29,0x9a,0x7d,0x87)
-#endif
-#endif
-
-
-#ifndef __IRawElementProviderFragmentRoot_INTERFACE_DEFINED__
-#define __IRawElementProviderFragmentRoot_INTERFACE_DEFINED__
-DEFINE_GUID(IID_IRawElementProviderFragmentRoot, 0x620ce2a5, 0xab8f, 0x40a9, 0x86,0xcb, 0xde,0x3c,0x75,0x59,0x9b,0x58);
-MIDL_INTERFACE("620ce2a5-ab8f-40a9-86cb-de3c75599b58")
-IRawElementProviderFragmentRoot : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE ElementProviderFromPoint(double x, double y, __RPC__deref_out_opt IRawElementProviderFragment **pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetFocus(__RPC__deref_out_opt IRawElementProviderFragment **pRetVal) = 0;
-};
-#ifdef __CRT_UUID_DECL
-__CRT_UUID_DECL(IRawElementProviderFragmentRoot, 0x620ce2a5, 0xab8f, 0x40a9, 0x86,0xcb, 0xde,0x3c,0x75,0x59,0x9b,0x58)
-#endif
-#endif
-
-
-#ifndef __IValueProvider_INTERFACE_DEFINED__
-#define __IValueProvider_INTERFACE_DEFINED__
-DEFINE_GUID(IID_IValueProvider, 0xc7935180, 0x6fb3, 0x4201, 0xb1,0x74, 0x7d,0xf7,0x3a,0xdb,0xf6,0x4a);
-MIDL_INTERFACE("c7935180-6fb3-4201-b174-7df73adbf64a")
-IValueProvider : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE SetValue(__RPC__in LPCWSTR val) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_Value(__RPC__deref_out_opt BSTR *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_IsReadOnly(__RPC__out BOOL *pRetVal) = 0;
-};
-#ifdef __CRT_UUID_DECL
-__CRT_UUID_DECL(IValueProvider, 0xc7935180, 0x6fb3, 0x4201, 0xb1,0x74, 0x7d,0xf7,0x3a,0xdb,0xf6,0x4a)
-#endif
-#endif
-
-
-#ifndef __IRangeValueProvider_INTERFACE_DEFINED__
-#define __IRangeValueProvider_INTERFACE_DEFINED__
-DEFINE_GUID(IID_IRangeValueProvider, 0x36dc7aef, 0x33e6, 0x4691, 0xaf,0xe1, 0x2b,0xe7,0x27,0x4b,0x3d,0x33);
-MIDL_INTERFACE("36dc7aef-33e6-4691-afe1-2be7274b3d33")
-IRangeValueProvider : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE SetValue(double val) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_Value(__RPC__out double *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_IsReadOnly(__RPC__out BOOL *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_Maximum(__RPC__out double *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_Minimum(__RPC__out double *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_LargeChange(__RPC__out double *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_SmallChange(__RPC__out double *pRetVal) = 0;
-};
-#ifdef __CRT_UUID_DECL
-__CRT_UUID_DECL(IRangeValueProvider, 0x36dc7aef, 0x33e6, 0x4691, 0xaf,0xe1, 0x2b,0xe7,0x27,0x4b,0x3d,0x33)
-#endif
-#endif
-
-
-#ifndef __ITextRangeProvider_INTERFACE_DEFINED__
-#define __ITextRangeProvider_INTERFACE_DEFINED__
-DEFINE_GUID(IID_ITextRangeProvider, 0x5347ad7b, 0xc355, 0x46f8, 0xaf,0xf5, 0x90,0x90,0x33,0x58,0x2f,0x63);
-MIDL_INTERFACE("5347ad7b-c355-46f8-aff5-909033582f63")
-ITextRangeProvider : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE Clone(__RPC__deref_out_opt ITextRangeProvider **pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE Compare(__RPC__in_opt ITextRangeProvider *range, __RPC__out BOOL *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE CompareEndpoints(enum TextPatternRangeEndpoint endpoint, __RPC__in_opt ITextRangeProvider *targetRange, enum TextPatternRangeEndpoint targetEndpoint, __RPC__out int *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE ExpandToEnclosingUnit(enum TextUnit unit) = 0;
- virtual HRESULT STDMETHODCALLTYPE FindAttribute(TEXTATTRIBUTEID attributeId, VARIANT val, BOOL backward, __RPC__deref_out_opt ITextRangeProvider **pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE FindText(__RPC__in BSTR text, BOOL backward, BOOL ignoreCase, __RPC__deref_out_opt ITextRangeProvider **pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetAttributeValue(TEXTATTRIBUTEID attributeId, __RPC__out VARIANT *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetBoundingRectangles(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetEnclosingElement(__RPC__deref_out_opt IRawElementProviderSimple **pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetText(int maxLength, __RPC__deref_out_opt BSTR *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE Move(enum TextUnit unit, int count, __RPC__out int *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE MoveEndpointByUnit(enum TextPatternRangeEndpoint endpoint, enum TextUnit unit, int count, __RPC__out int *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE MoveEndpointByRange(enum TextPatternRangeEndpoint endpoint, __RPC__in_opt ITextRangeProvider *targetRange, enum TextPatternRangeEndpoint targetEndpoint) = 0;
- virtual HRESULT STDMETHODCALLTYPE Select() = 0;
- virtual HRESULT STDMETHODCALLTYPE AddToSelection() = 0;
- virtual HRESULT STDMETHODCALLTYPE RemoveFromSelection() = 0;
- virtual HRESULT STDMETHODCALLTYPE ScrollIntoView(BOOL alignToTop) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetChildren(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0;
-};
-#ifdef __CRT_UUID_DECL
-__CRT_UUID_DECL(ITextRangeProvider, 0x5347ad7b, 0xc355, 0x46f8, 0xaf,0xf5, 0x90,0x90,0x33,0x58,0x2f,0x63)
-#endif
-#endif
-
-
-#ifndef __ITextProvider_INTERFACE_DEFINED__
-#define __ITextProvider_INTERFACE_DEFINED__
-DEFINE_GUID(IID_ITextProvider, 0x3589c92c, 0x63f3, 0x4367, 0x99,0xbb, 0xad,0xa6,0x53,0xb7,0x7c,0xf2);
-MIDL_INTERFACE("3589c92c-63f3-4367-99bb-ada653b77cf2")
-ITextProvider : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE GetSelection(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetVisibleRanges(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE RangeFromChild(__RPC__in_opt IRawElementProviderSimple *childElement, __RPC__deref_out_opt ITextRangeProvider **pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE RangeFromPoint(struct UiaPoint point, __RPC__deref_out_opt ITextRangeProvider **pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_DocumentRange(__RPC__deref_out_opt ITextRangeProvider **pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_SupportedTextSelection(__RPC__out enum SupportedTextSelection *pRetVal) = 0;
-};
-#ifdef __CRT_UUID_DECL
-__CRT_UUID_DECL(ITextProvider, 0x3589c92c, 0x63f3, 0x4367, 0x99,0xbb, 0xad,0xa6,0x53,0xb7,0x7c,0xf2)
-#endif
-#endif
-
-
-#ifndef __ITextProvider2_INTERFACE_DEFINED__
-#define __ITextProvider2_INTERFACE_DEFINED__
-DEFINE_GUID(IID_ITextProvider2, 0x0dc5e6ed, 0x3e16, 0x4bf1, 0x8f,0x9a, 0xa9,0x79,0x87,0x8b,0xc1,0x95);
-MIDL_INTERFACE("0dc5e6ed-3e16-4bf1-8f9a-a979878bc195")
-ITextProvider2 : public ITextProvider
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE RangeFromAnnotation(__RPC__in_opt IRawElementProviderSimple *annotationElement, __RPC__deref_out_opt ITextRangeProvider **pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetCaretRange(__RPC__out BOOL *isActive, __RPC__deref_out_opt ITextRangeProvider **pRetVal) = 0;
-};
-#ifdef __CRT_UUID_DECL
-__CRT_UUID_DECL(ITextProvider2, 0x0dc5e6ed, 0x3e16, 0x4bf1, 0x8f,0x9a, 0xa9,0x79,0x87,0x8b,0xc1,0x95)
-#endif
-#endif
-
-
-#ifndef __IToggleProvider_INTERFACE_DEFINED__
-#define __IToggleProvider_INTERFACE_DEFINED__
-DEFINE_GUID(IID_IToggleProvider, 0x56d00bd0, 0xc4f4, 0x433c, 0xa8,0x36, 0x1a,0x52,0xa5,0x7e,0x08,0x92);
-MIDL_INTERFACE("56d00bd0-c4f4-433c-a836-1a52a57e0892")
-IToggleProvider : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE Toggle() = 0;
- virtual HRESULT STDMETHODCALLTYPE get_ToggleState(__RPC__out enum ToggleState *pRetVal) = 0;
-};
-#ifdef __CRT_UUID_DECL
-__CRT_UUID_DECL(IToggleProvider, 0x56d00bd0, 0xc4f4, 0x433c, 0xa8,0x36, 0x1a,0x52,0xa5,0x7e,0x08,0x92)
-#endif
-#endif
-
-
-#ifndef __IInvokeProvider_INTERFACE_DEFINED__
-#define __IInvokeProvider_INTERFACE_DEFINED__
-DEFINE_GUID(IID_IInvokeProvider, 0x54fcb24b, 0xe18e, 0x47a2, 0xb4,0xd3, 0xec,0xcb,0xe7,0x75,0x99,0xa2);
-MIDL_INTERFACE("54fcb24b-e18e-47a2-b4d3-eccbe77599a2")
-IInvokeProvider : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE Invoke() = 0;
-};
-#ifdef __CRT_UUID_DECL
-__CRT_UUID_DECL(IInvokeProvider, 0x54fcb24b, 0xe18e, 0x47a2, 0xb4,0xd3, 0xec,0xcb,0xe7,0x75,0x99,0xa2)
-#endif
-#endif
-
-
-#ifndef __ISelectionProvider_INTERFACE_DEFINED__
-#define __ISelectionProvider_INTERFACE_DEFINED__
-DEFINE_GUID(IID_ISelectionProvider, 0xfb8b03af, 0x3bdf, 0x48d4, 0xbd,0x36, 0x1a,0x65,0x79,0x3b,0xe1,0x68);
-MIDL_INTERFACE("fb8b03af-3bdf-48d4-bd36-1a65793be168")
-ISelectionProvider : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE GetSelection(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CanSelectMultiple(__RPC__out BOOL *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_IsSelectionRequired(__RPC__out BOOL *pRetVal) = 0;
-};
-#ifdef __CRT_UUID_DECL
-__CRT_UUID_DECL(ISelectionProvider, 0xfb8b03af, 0x3bdf, 0x48d4, 0xbd,0x36, 0x1a,0x65,0x79,0x3b,0xe1,0x68)
-#endif
-#endif
-
-
-#ifndef __ISelectionItemProvider_INTERFACE_DEFINED__
-#define __ISelectionItemProvider_INTERFACE_DEFINED__
-DEFINE_GUID(IID_ISelectionItemProvider, 0x2acad808, 0xb2d4, 0x452d, 0xa4,0x07, 0x91,0xff,0x1a,0xd1,0x67,0xb2);
-MIDL_INTERFACE("2acad808-b2d4-452d-a407-91ff1ad167b2")
-ISelectionItemProvider : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE Select() = 0;
- virtual HRESULT STDMETHODCALLTYPE AddToSelection() = 0;
- virtual HRESULT STDMETHODCALLTYPE RemoveFromSelection() = 0;
- virtual HRESULT STDMETHODCALLTYPE get_IsSelected(__RPC__out BOOL *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_SelectionContainer(__RPC__deref_out_opt IRawElementProviderSimple **pRetVal) = 0;
-};
-#ifdef __CRT_UUID_DECL
-__CRT_UUID_DECL(ISelectionItemProvider, 0x2acad808, 0xb2d4, 0x452d, 0xa4,0x07, 0x91,0xff,0x1a,0xd1,0x67,0xb2)
-#endif
-#endif
-
-
-#ifndef __ITableProvider_INTERFACE_DEFINED__
-#define __ITableProvider_INTERFACE_DEFINED__
-DEFINE_GUID(IID_ITableProvider, 0x9c860395, 0x97b3, 0x490a, 0xb5,0x2a, 0x85,0x8c,0xc2,0x2a,0xf1,0x66);
-MIDL_INTERFACE("9c860395-97b3-490a-b52a-858cc22af166")
-ITableProvider : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE GetRowHeaders(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetColumnHeaders(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_RowOrColumnMajor(__RPC__out enum RowOrColumnMajor *pRetVal) = 0;
-};
-#ifdef __CRT_UUID_DECL
-__CRT_UUID_DECL(ITableProvider, 0x9c860395, 0x97b3, 0x490a, 0xb5,0x2a, 0x85,0x8c,0xc2,0x2a,0xf1,0x66)
-#endif
-#endif
-
-
-#ifndef __ITableItemProvider_INTERFACE_DEFINED__
-#define __ITableItemProvider_INTERFACE_DEFINED__
-DEFINE_GUID(IID_ITableItemProvider, 0xb9734fa6, 0x771f, 0x4d78, 0x9c,0x90, 0x25,0x17,0x99,0x93,0x49,0xcd);
-MIDL_INTERFACE("b9734fa6-771f-4d78-9c90-2517999349cd")
-ITableItemProvider : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE GetRowHeaderItems(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE GetColumnHeaderItems(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0;
-};
-#ifdef __CRT_UUID_DECL
-__CRT_UUID_DECL(ITableItemProvider, 0xb9734fa6, 0x771f, 0x4d78, 0x9c,0x90, 0x25,0x17,0x99,0x93,0x49,0xcd)
-#endif
-#endif
-
-
-#ifndef __IGridProvider_INTERFACE_DEFINED__
-#define __IGridProvider_INTERFACE_DEFINED__
-DEFINE_GUID(IID_IGridProvider, 0xb17d6187, 0x0907, 0x464b, 0xa1,0x68, 0x0e,0xf1,0x7a,0x15,0x72,0xb1);
-MIDL_INTERFACE("b17d6187-0907-464b-a168-0ef17a1572b1")
-IGridProvider : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE GetItem(int row, int column, __RPC__deref_out_opt IRawElementProviderSimple **pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_RowCount(__RPC__out int *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_ColumnCount(__RPC__out int *pRetVal) = 0;
-};
-#ifdef __CRT_UUID_DECL
-__CRT_UUID_DECL(IGridProvider, 0xb17d6187, 0x0907, 0x464b, 0xa1,0x68, 0x0e,0xf1,0x7a,0x15,0x72,0xb1)
-#endif
-#endif
-
-
-#ifndef __IGridItemProvider_INTERFACE_DEFINED__
-#define __IGridItemProvider_INTERFACE_DEFINED__
-DEFINE_GUID(IID_IGridItemProvider, 0xd02541f1, 0xfb81, 0x4d64, 0xae,0x32, 0xf5,0x20,0xf8,0xa6,0xdb,0xd1);
-MIDL_INTERFACE("d02541f1-fb81-4d64-ae32-f520f8a6dbd1")
-IGridItemProvider : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE get_Row(__RPC__out int *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_Column(__RPC__out int *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_RowSpan(__RPC__out int *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_ColumnSpan(__RPC__out int *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_ContainingGrid(__RPC__deref_out_opt IRawElementProviderSimple **pRetVal) = 0;
-};
-#ifdef __CRT_UUID_DECL
-__CRT_UUID_DECL(IGridItemProvider, 0xd02541f1, 0xfb81, 0x4d64, 0xae,0x32, 0xf5,0x20,0xf8,0xa6,0xdb,0xd1)
-#endif
-#endif
-
-
-#ifndef __IWindowProvider_INTERFACE_DEFINED__
-#define __IWindowProvider_INTERFACE_DEFINED__
-DEFINE_GUID(IID_IWindowProvider, 0x987df77b, 0xdb06, 0x4d77, 0x8f,0x8a, 0x86,0xa9,0xc3,0xbb,0x90,0xb9);
-MIDL_INTERFACE("987df77b-db06-4d77-8f8a-86a9c3bb90b9")
-IWindowProvider : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE SetVisualState(enum WindowVisualState state) = 0;
- virtual HRESULT STDMETHODCALLTYPE Close( void) = 0;
- virtual HRESULT STDMETHODCALLTYPE WaitForInputIdle(int milliseconds, __RPC__out BOOL *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CanMaximize(__RPC__out BOOL *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_CanMinimize(__RPC__out BOOL *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_IsModal(__RPC__out BOOL *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_WindowVisualState(__RPC__out enum WindowVisualState *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_WindowInteractionState(__RPC__out enum WindowInteractionState *pRetVal) = 0;
- virtual HRESULT STDMETHODCALLTYPE get_IsTopmost(__RPC__out BOOL *pRetVal) = 0;
-};
-#ifdef __CRT_UUID_DECL
-__CRT_UUID_DECL(IWindowProvider, 0x987df77b, 0xdb06, 0x4d77, 0x8f,0x8a, 0x86,0xa9,0xc3,0xbb,0x90,0xb9)
-#endif
-#endif
-
-
-#ifndef __IExpandCollapseProvider_INTERFACE_DEFINED__
-#define __IExpandCollapseProvider_INTERFACE_DEFINED__
-DEFINE_GUID(IID_IExpandCollapseProvider, 0xd847d3a5, 0xcab0, 0x4a98, 0x8c,0x32, 0xec,0xb4,0x5c,0x59,0xad,0x24);
-MIDL_INTERFACE("d847d3a5-cab0-4a98-8c32-ecb45c59ad24")
-IExpandCollapseProvider : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE Expand() = 0;
- virtual HRESULT STDMETHODCALLTYPE Collapse() = 0;
- virtual HRESULT STDMETHODCALLTYPE get_ExpandCollapseState(__RPC__out enum ExpandCollapseState *pRetVal) = 0;
-};
-#ifdef __CRT_UUID_DECL
-__CRT_UUID_DECL(IExpandCollapseProvider, 0xd847d3a5, 0xcab0, 0x4a98, 0x8c,0x32, 0xec,0xb4,0x5c,0x59,0xad,0x24)
-#endif
-#endif
-
-#endif
diff --git a/src/gui/accessible/windows/apisupport/uiatypes_p.h b/src/gui/accessible/windows/apisupport/uiatypes_p.h
deleted file mode 100644
index 0d2e1161e4..0000000000
--- a/src/gui/accessible/windows/apisupport/uiatypes_p.h
+++ /dev/null
@@ -1,193 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef UIATYPES_H
-#define UIATYPES_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-typedef int PROPERTYID;
-typedef int PATTERNID;
-typedef int EVENTID;
-typedef int TEXTATTRIBUTEID;
-typedef int CONTROLTYPEID;
-typedef int LANDMARKTYPEID;
-typedef int METADATAID;
-
-typedef void *UIA_HWND;
-
-enum NavigateDirection {
- NavigateDirection_Parent = 0,
- NavigateDirection_NextSibling = 1,
- NavigateDirection_PreviousSibling = 2,
- NavigateDirection_FirstChild = 3,
- NavigateDirection_LastChild = 4
-};
-
-enum ProviderOptions {
- ProviderOptions_ClientSideProvider = 0x1,
- ProviderOptions_ServerSideProvider = 0x2,
- ProviderOptions_NonClientAreaProvider = 0x4,
- ProviderOptions_OverrideProvider = 0x8,
- ProviderOptions_ProviderOwnsSetFocus = 0x10,
- ProviderOptions_UseComThreading = 0x20,
- ProviderOptions_RefuseNonClientSupport = 0x40,
- ProviderOptions_HasNativeIAccessible = 0x80,
- ProviderOptions_UseClientCoordinates = 0x100
-};
-
-enum SupportedTextSelection {
- SupportedTextSelection_None = 0,
- SupportedTextSelection_Single = 1,
- SupportedTextSelection_Multiple = 2
-};
-
-enum TextUnit {
- TextUnit_Character = 0,
- TextUnit_Format = 1,
- TextUnit_Word = 2,
- TextUnit_Line = 3,
- TextUnit_Paragraph = 4,
- TextUnit_Page = 5,
- TextUnit_Document = 6
-};
-
-enum TextPatternRangeEndpoint {
- TextPatternRangeEndpoint_Start = 0,
- TextPatternRangeEndpoint_End = 1
-};
-
-enum CaretPosition {
- CaretPosition_Unknown = 0,
- CaretPosition_EndOfLine = 1,
- CaretPosition_BeginningOfLine = 2
-};
-
-enum ToggleState {
- ToggleState_Off = 0,
- ToggleState_On = 1,
- ToggleState_Indeterminate = 2
-};
-
-enum RowOrColumnMajor {
- RowOrColumnMajor_RowMajor = 0,
- RowOrColumnMajor_ColumnMajor = 1,
- RowOrColumnMajor_Indeterminate = 2
-};
-
-enum TreeScope {
- TreeScope_None = 0,
- TreeScope_Element = 0x1,
- TreeScope_Children = 0x2,
- TreeScope_Descendants = 0x4,
- TreeScope_Parent = 0x8,
- TreeScope_Ancestors = 0x10,
- TreeScope_Subtree = TreeScope_Element | TreeScope_Children | TreeScope_Descendants
-};
-
-enum OrientationType {
- OrientationType_None = 0,
- OrientationType_Horizontal = 1,
- OrientationType_Vertical = 2
-};
-
-enum PropertyConditionFlags {
- PropertyConditionFlags_None = 0,
- PropertyConditionFlags_IgnoreCase = 1
-};
-
-enum WindowVisualState {
- WindowVisualState_Normal = 0,
- WindowVisualState_Maximized = 1,
- WindowVisualState_Minimized = 2
-};
-
-enum WindowInteractionState {
- WindowInteractionState_Running = 0,
- WindowInteractionState_Closing = 1,
- WindowInteractionState_ReadyForUserInteraction = 2,
- WindowInteractionState_BlockedByModalWindow = 3,
- WindowInteractionState_NotResponding = 4
-};
-
-enum ExpandCollapseState {
- ExpandCollapseState_Collapsed = 0,
- ExpandCollapseState_Expanded = 1,
- ExpandCollapseState_PartiallyExpanded = 2,
- ExpandCollapseState_LeafNode = 3
-};
-
-enum NotificationKind {
- NotificationKind_ItemAdded = 0,
- NotificationKind_ItemRemoved = 1,
- NotificationKind_ActionCompleted = 2,
- NotificationKind_ActionAborted = 3,
- NotificationKind_Other = 4
-};
-
-enum NotificationProcessing {
- NotificationProcessing_ImportantAll = 0,
- NotificationProcessing_ImportantMostRecent = 1,
- NotificationProcessing_All = 2,
- NotificationProcessing_MostRecent = 3,
- NotificationProcessing_CurrentThenMostRecent = 4
-};
-
-struct UiaRect {
- double left;
- double top;
- double width;
- double height;
-};
-
-struct UiaPoint {
- double x;
- double y;
-};
-
-#endif