Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qdbuspendingcall.h
Go to the documentation of this file.
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 QDBUSPENDINGCALL_H
6#define QDBUSPENDINGCALL_H
7
8#include <QtDBus/qtdbusglobal.h>
9#include <QtDBus/qdbusmessage.h>
10#include <QtCore/qobject.h>
11#include <QtCore/qshareddata.h>
12
13#ifndef QT_NO_DBUS
14
15class tst_QDBusPendingReply;
16
17QT_BEGIN_NAMESPACE
18
19
20class QDBusConnection;
21class QDBusError;
22class QDBusPendingCallWatcher;
23
25
26QT_DECLARE_QESDP_SPECIALIZATION_DTOR(QDBusPendingCallPrivate)
27
28class Q_DBUS_EXPORT QDBusPendingCall
29{
30public:
31 QDBusPendingCall(const QDBusPendingCall &other);
32 QDBusPendingCall(QDBusPendingCall &&other) noexcept = default;
33 ~QDBusPendingCall();
34 QDBusPendingCall &operator=(QDBusPendingCall &&other) noexcept { swap(other); return *this; }
35 QDBusPendingCall &operator=(const QDBusPendingCall &other);
36
37 void swap(QDBusPendingCall &other) noexcept { d.swap(other.d); }
38
39#ifndef Q_QDOC
40 // pretend that they aren't here
41 bool isFinished() const;
42 void waitForFinished();
43
44 bool isError() const;
45 bool isValid() const;
46 QDBusError error() const;
47 QDBusMessage reply() const;
48#endif
49
50 static QDBusPendingCall fromError(const QDBusError &error);
51 static QDBusPendingCall fromCompletedCall(const QDBusMessage &message);
52
53protected:
54 QExplicitlySharedDataPointer<QDBusPendingCallPrivate> d;
55 friend class QDBusPendingCallPrivate;
56 friend class QDBusPendingCallWatcher;
57 friend class QDBusConnection;
58
59 QDBusPendingCall(QDBusPendingCallPrivate *dd);
60
61private:
62 QDBusPendingCall(); // not defined
63
64 friend class ::tst_QDBusPendingReply;
65};
66
68
69class Q_DBUS_EXPORT QDBusPendingCallWatcher: public QObject, public QDBusPendingCall
70{
71 Q_OBJECT
72public:
73 explicit QDBusPendingCallWatcher(const QDBusPendingCall &call, QObject *parent = nullptr);
74 ~QDBusPendingCallWatcher();
75
76#ifdef Q_QDOC
77 // trick qdoc into thinking this method is here
78 bool isFinished() const;
79#endif
80 void waitForFinished(); // non-virtual override
81
82Q_SIGNALS:
83 void finished(QDBusPendingCallWatcher *self = nullptr);
84};
85
86QT_END_NAMESPACE
87
88#endif // QT_NO_DBUS
89#endif
static void finishDisconnectNotify(QDBusAbstractInterface *iface, int signalId)
QDBusAbstractInterfacePrivate(const QString &serv, const QString &p, const QString &iface, const QDBusConnection &con, bool dynamic)
bool setProperty(const QMetaProperty &mp, const QVariant &value)
QDBusConnectionPrivate * connectionPrivate() const
bool property(const QMetaProperty &mp, void *returnValuePtr) const
void _q_serviceOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner)
\inmodule QtDBus
static void setParametersValidated(QDBusMessage &msg, bool enable)
\inmodule QtDBus
#define DBUS_INTERFACE_PROPERTIES
\inmodule QtDBus
Definition qdbusutil_p.h:33
@ EmptyNotAllowed
Definition qdbusutil_p.h:60
static QDBusError checkIfValid(const QString &service, const QString &path, const QString &interface, bool isDynamic, bool isPeer)
#define qPrintable(string)
Definition qstring.h:1685
#define QStringLiteral(str)
Definition qstring.h:1826