| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QDBUSMESSAGE_P_H |
| 5 | #define QDBUSMESSAGE_P_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists for the convenience |
| 12 | // of the QLibrary class. This header file may change from |
| 13 | // version to version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <QtDBus/private/qtdbusglobal_p.h> |
| 19 | #include <qatomic.h> |
| 20 | #include <qstring.h> |
| 21 | #include <qdbusmessage.h> |
| 22 | #include <qdbusconnection.h> |
| 23 | |
| 24 | struct DBusMessage; |
| 25 | |
| 26 | #ifndef QT_NO_DBUS |
| 27 | |
| 28 | QT_BEGIN_NAMESPACE |
| 29 | |
| 30 | class QDBusConnectionPrivate; |
| 31 | |
| 32 | class QDBusMessagePrivate |
| 33 | { |
| 34 | public: |
| 35 | QDBusMessagePrivate(); |
| 36 | ~QDBusMessagePrivate(); |
| 37 | |
| 38 | QList<QVariant> arguments; |
| 39 | |
| 40 | // the following parameters are "const": they are not changed after the constructors |
| 41 | // the parametersValidated member below controls whether they've been validated already |
| 42 | // (service is also used to store the destination of reply-type messages) |
| 43 | QString service, path, interface, name, message, signature; |
| 44 | |
| 45 | mutable QDBusMessage *localReply; |
| 46 | QAtomicInt ref; |
| 47 | QDBusMessage::MessageType type; |
| 48 | uint32_t serial; // if type == MethodCall; the incoming serial; if type == Reply or Error, the serial we're replying to |
| 49 | |
| 50 | mutable uint delayedReply : 1; |
| 51 | mutable uint parametersValidated : 1; |
| 52 | uint localMessage : 1; |
| 53 | uint autoStartService : 1; |
| 54 | uint interactiveAuthorizationAllowed : 1; |
| 55 | uint isReplyRequired : 1; |
| 56 | |
| 57 | void createResponseLink(const QDBusMessagePrivate *call); |
| 58 | static void setParametersValidated(QDBusMessage &msg, bool enable) |
| 59 | { msg.d_ptr->parametersValidated = enable; } |
| 60 | |
| 61 | static DBusMessage *toDBusMessage(const QDBusMessage &message, QDBusConnection::ConnectionCapabilities capabilities, |
| 62 | QDBusError *error); |
| 63 | static QDBusMessage fromDBusMessage(DBusMessage *dmsg, QDBusConnection::ConnectionCapabilities capabilities); |
| 64 | |
| 65 | static bool isLocal(const QDBusMessage &msg); |
| 66 | static QDBusMessage makeLocal(const QDBusConnectionPrivate &conn, |
| 67 | const QDBusMessage &asSent); |
| 68 | static QDBusMessage makeLocalReply(const QDBusConnectionPrivate &conn, |
| 69 | const QDBusMessage &asSent); |
| 70 | }; |
| 71 | |
| 72 | QT_END_NAMESPACE |
| 73 | |
| 74 | #endif // QT_NO_DBUS |
| 75 | #endif |
| 76 | |