| 1 | /**************************************************************************** |
| 2 | ** |
| 3 | ** Copyright (C) 2016 The Qt Company Ltd. |
| 4 | ** Contact: https://www.qt.io/licensing/ |
| 5 | ** |
| 6 | ** This file is part of the QtGui module of the Qt Toolkit. |
| 7 | ** |
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ |
| 9 | ** Commercial License Usage |
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in |
| 11 | ** accordance with the commercial license agreement provided with the |
| 12 | ** Software or, alternatively, in accordance with the terms contained in |
| 13 | ** a written agreement between you and The Qt Company. For licensing terms |
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
| 15 | ** information use the contact form at https://www.qt.io/contact-us. |
| 16 | ** |
| 17 | ** GNU Lesser General Public License Usage |
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser |
| 19 | ** General Public License version 3 as published by the Free Software |
| 20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the |
| 21 | ** packaging of this file. Please review the following information to |
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements |
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. |
| 24 | ** |
| 25 | ** GNU General Public License Usage |
| 26 | ** Alternatively, this file may be used under the terms of the GNU |
| 27 | ** General Public License version 2.0 or (at your option) the GNU General |
| 28 | ** Public license version 3 or any later version approved by the KDE Free |
| 29 | ** Qt Foundation. The licenses are as published by the Free Software |
| 30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 |
| 31 | ** included in the packaging of this file. Please review the following |
| 32 | ** information to ensure the GNU General Public License requirements will |
| 33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and |
| 34 | ** https://www.gnu.org/licenses/gpl-3.0.html. |
| 35 | ** |
| 36 | ** $QT_END_LICENSE$ |
| 37 | ** |
| 38 | ****************************************************************************/ |
| 39 | |
| 40 | |
| 41 | #ifndef Q_SPI_STRUCT_MARSHALLERS_H |
| 42 | #define Q_SPI_STRUCT_MARSHALLERS_H |
| 43 | |
| 44 | // |
| 45 | // W A R N I N G |
| 46 | // ------------- |
| 47 | // |
| 48 | // This file is not part of the Qt API. It exists purely as an |
| 49 | // implementation detail. This header file may change from version to |
| 50 | // version without notice, or even be removed. |
| 51 | // |
| 52 | // We mean it. |
| 53 | // |
| 54 | |
| 55 | #include <QtGui/private/qtguiglobal_p.h> |
| 56 | #include <QtCore/qvector.h> |
| 57 | #include <QtCore/qpair.h> |
| 58 | #include <QtDBus/QDBusArgument> |
| 59 | #include <QtDBus/QDBusConnection> |
| 60 | #include <QtDBus/QDBusObjectPath> |
| 61 | |
| 62 | QT_REQUIRE_CONFIG(accessibility); |
| 63 | |
| 64 | QT_BEGIN_NAMESPACE |
| 65 | |
| 66 | typedef QVector<int> QSpiIntList; |
| 67 | typedef QVector<uint> QSpiUIntList; |
| 68 | |
| 69 | // FIXME: make this copy on write |
| 70 | struct QSpiObjectReference |
| 71 | { |
| 72 | QString service; |
| 73 | QDBusObjectPath path; |
| 74 | |
| 75 | QSpiObjectReference(); |
| 76 | QSpiObjectReference(const QDBusConnection& connection, const QDBusObjectPath& path) |
| 77 | : service(connection.baseService()), path(path) {} |
| 78 | }; |
| 79 | Q_DECLARE_TYPEINFO(QSpiObjectReference, Q_MOVABLE_TYPE); // QDBusObjectPath is movable, even though it |
| 80 | // cannot be marked that way until Qt 6 |
| 81 | |
| 82 | QDBusArgument &operator<<(QDBusArgument &argument, const QSpiObjectReference &address); |
| 83 | const QDBusArgument &operator>>(const QDBusArgument &argument, QSpiObjectReference &address); |
| 84 | |
| 85 | typedef QVector<QSpiObjectReference> QSpiObjectReferenceArray; |
| 86 | |
| 87 | struct QSpiAccessibleCacheItem |
| 88 | { |
| 89 | QSpiObjectReference path; |
| 90 | QSpiObjectReference application; |
| 91 | QSpiObjectReference parent; |
| 92 | QSpiObjectReferenceArray children; |
| 93 | QStringList supportedInterfaces; |
| 94 | QString name; |
| 95 | uint role; |
| 96 | QString description; |
| 97 | QSpiUIntList state; |
| 98 | }; |
| 99 | Q_DECLARE_TYPEINFO(QSpiAccessibleCacheItem, Q_MOVABLE_TYPE); |
| 100 | |
| 101 | typedef QVector<QSpiAccessibleCacheItem> QSpiAccessibleCacheArray; |
| 102 | |
| 103 | QDBusArgument &operator<<(QDBusArgument &argument, const QSpiAccessibleCacheItem &item); |
| 104 | const QDBusArgument &operator>>(const QDBusArgument &argument, QSpiAccessibleCacheItem &item); |
| 105 | |
| 106 | struct QSpiAction |
| 107 | { |
| 108 | QString name; |
| 109 | QString description; |
| 110 | QString keyBinding; |
| 111 | }; |
| 112 | Q_DECLARE_TYPEINFO(QSpiAction, Q_MOVABLE_TYPE); |
| 113 | |
| 114 | typedef QVector<QSpiAction> QSpiActionArray; |
| 115 | |
| 116 | QDBusArgument &operator<<(QDBusArgument &argument, const QSpiAction &action); |
| 117 | const QDBusArgument &operator>>(const QDBusArgument &argument, QSpiAction &action); |
| 118 | |
| 119 | struct QSpiEventListener |
| 120 | { |
| 121 | QString listenerAddress; |
| 122 | QString eventName; |
| 123 | }; |
| 124 | Q_DECLARE_TYPEINFO(QSpiEventListener, Q_MOVABLE_TYPE); |
| 125 | |
| 126 | typedef QVector<QSpiEventListener> QSpiEventListenerArray; |
| 127 | |
| 128 | QDBusArgument &operator<<(QDBusArgument &argument, const QSpiEventListener &action); |
| 129 | const QDBusArgument &operator>>(const QDBusArgument &argument, QSpiEventListener &action); |
| 130 | |
| 131 | typedef QPair<unsigned int, QSpiObjectReferenceArray> QSpiRelationArrayEntry; |
| 132 | typedef QVector<QSpiRelationArrayEntry> QSpiRelationArray; |
| 133 | |
| 134 | //a(iisv) |
| 135 | struct { |
| 136 | int ; |
| 137 | int ; |
| 138 | QString ; |
| 139 | QVariant ; |
| 140 | }; |
| 141 | Q_DECLARE_TYPEINFO(QSpiTextRange, Q_MOVABLE_TYPE); |
| 142 | |
| 143 | typedef QVector<QSpiTextRange> ; |
| 144 | typedef QMap <QString, QString> QSpiAttributeSet; |
| 145 | |
| 146 | enum QSpiAppUpdateType { |
| 147 | QSPI_APP_UPDATE_ADDED = 0, |
| 148 | QSPI_APP_UPDATE_REMOVED = 1 |
| 149 | }; |
| 150 | Q_DECLARE_TYPEINFO(QSpiAppUpdateType, Q_PRIMITIVE_TYPE); |
| 151 | |
| 152 | struct QSpiAppUpdate { |
| 153 | int type; /* Is an application added or removed */ |
| 154 | QString address; /* D-Bus address of application added or removed */ |
| 155 | }; |
| 156 | Q_DECLARE_TYPEINFO(QSpiAppUpdate, Q_MOVABLE_TYPE); |
| 157 | |
| 158 | QDBusArgument &operator<<(QDBusArgument &argument, const QSpiAppUpdate &update); |
| 159 | const QDBusArgument &operator>>(const QDBusArgument &argument, QSpiAppUpdate &update); |
| 160 | |
| 161 | struct QSpiDeviceEvent { |
| 162 | unsigned int type; |
| 163 | int id; |
| 164 | int hardwareCode; |
| 165 | int modifiers; |
| 166 | int timestamp; |
| 167 | QString text; |
| 168 | bool isText; |
| 169 | }; |
| 170 | Q_DECLARE_TYPEINFO(QSpiDeviceEvent, Q_MOVABLE_TYPE); |
| 171 | |
| 172 | QDBusArgument &operator<<(QDBusArgument &argument, const QSpiDeviceEvent &event); |
| 173 | const QDBusArgument &operator>>(const QDBusArgument &argument, QSpiDeviceEvent &event); |
| 174 | |
| 175 | void qSpiInitializeStructTypes(); |
| 176 | |
| 177 | QT_END_NAMESPACE |
| 178 | |
| 179 | Q_DECLARE_METATYPE(QSpiIntList) |
| 180 | Q_DECLARE_METATYPE(QSpiUIntList) |
| 181 | Q_DECLARE_METATYPE(QSpiObjectReference) |
| 182 | Q_DECLARE_METATYPE(QSpiObjectReferenceArray) |
| 183 | Q_DECLARE_METATYPE(QSpiAccessibleCacheItem) |
| 184 | Q_DECLARE_METATYPE(QSpiAccessibleCacheArray) |
| 185 | Q_DECLARE_METATYPE(QSpiAction) |
| 186 | Q_DECLARE_METATYPE(QSpiActionArray) |
| 187 | Q_DECLARE_METATYPE(QSpiEventListener) |
| 188 | Q_DECLARE_METATYPE(QSpiEventListenerArray) |
| 189 | Q_DECLARE_METATYPE(QSpiRelationArrayEntry) |
| 190 | Q_DECLARE_METATYPE(QSpiRelationArray) |
| 191 | Q_DECLARE_METATYPE(QSpiTextRange) |
| 192 | Q_DECLARE_METATYPE(QSpiTextRangeList) |
| 193 | Q_DECLARE_METATYPE(QSpiAttributeSet) |
| 194 | Q_DECLARE_METATYPE(QSpiAppUpdate) |
| 195 | Q_DECLARE_METATYPE(QSpiDeviceEvent) |
| 196 | |
| 197 | #endif /* Q_SPI_STRUCT_MARSHALLERS_H */ |
| 198 | |