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 | QString service, path, interface, name, message, signature; |
43 | |
44 | DBusMessage *msg; |
45 | DBusMessage *reply; |
46 | mutable QDBusMessage *localReply; |
47 | QAtomicInt ref; |
48 | QDBusMessage::MessageType type; |
49 | |
50 | mutable uint delayedReply : 1; |
51 | uint localMessage : 1; |
52 | mutable uint parametersValidated : 1; |
53 | uint autoStartService : 1; |
54 | uint interactiveAuthorizationAllowed : 1; |
55 | |
56 | static void setParametersValidated(QDBusMessage &msg, bool enable) |
57 | { msg.d_ptr->parametersValidated = enable; } |
58 | |
59 | static DBusMessage *toDBusMessage(const QDBusMessage &message, QDBusConnection::ConnectionCapabilities capabilities, |
60 | QDBusError *error); |
61 | static QDBusMessage fromDBusMessage(DBusMessage *dmsg, QDBusConnection::ConnectionCapabilities capabilities); |
62 | |
63 | static bool isLocal(const QDBusMessage &msg); |
64 | static QDBusMessage makeLocal(const QDBusConnectionPrivate &conn, |
65 | const QDBusMessage &asSent); |
66 | static QDBusMessage makeLocalReply(const QDBusConnectionPrivate &conn, |
67 | const QDBusMessage &asSent); |
68 | }; |
69 | |
70 | QT_END_NAMESPACE |
71 | |
72 | #endif // QT_NO_DBUS |
73 | #endif |
74 | |