1// Copyright (C) 2016 The Qt Company Ltd.
2// Copyright (C) 2016 Intel Corporation.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4// Qt-Security score:significant reason:default
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the public API. This header file may
11// change from version to version without notice, or even be
12// removed.
13//
14// We mean it.
15//
16//
17
18#ifndef QDBUSABSTRACTINTERFACE_P_H
19#define QDBUSABSTRACTINTERFACE_P_H
20
21#include <QtDBus/private/qtdbusglobal_p.h>
22#include <qdbusabstractinterface.h>
23#include <qdbusconnection.h>
24#include <qdbuserror.h>
25#include "qdbusconnection_p.h"
26#include "private/qobject_p.h"
27
28#define ANNOTATION_NO_WAIT "org.freedesktop.DBus.Method.NoReply"
29
30#ifndef QT_NO_DBUS
31
32QT_BEGIN_NAMESPACE
33
34class QDBusAbstractInterfacePrivate : public QObjectPrivate
35{
36public:
37 Q_DECLARE_PUBLIC(QDBusAbstractInterface)
38
39 mutable QDBusConnection connection; // mutable because we want to make calls from const functions
40 QString service;
41 QString currentOwner;
42 QString path;
43 QString interface;
44 mutable QDBusError lastError;
45 int timeout;
46 bool interactiveAuthorizationAllowed;
47
48 // this is set during creation and never changed
49 // it can't be const because QDBusInterfacePrivate has one more check
50 bool isValid;
51
52 QDBusAbstractInterfacePrivate(const QString &serv, const QString &p,
53 const QString &iface, const QDBusConnection& con, bool dynamic);
54 virtual ~QDBusAbstractInterfacePrivate() { }
55 void initOwnerTracking();
56 bool canMakeCalls() const;
57
58 // these functions do not check if the property is valid
59 bool property(const QMetaProperty &mp, void *returnValuePtr) const;
60 bool setProperty(const QMetaProperty &mp, const QVariant &value);
61
62 // return conn's d pointer
63 inline QDBusConnectionPrivate *connectionPrivate() const
64 { return QDBusConnectionPrivate::d(q: connection); }
65
66 void _q_serviceOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner);
67
68 static void finishDisconnectNotify(QDBusAbstractInterface *iface, int signalId);
69};
70
71QT_END_NAMESPACE
72
73#endif // QT_NO_DBUS
74#endif
75

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