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

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