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

source code of qtbase/src/dbus/qdbusmessage_p.h