Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qdbuspendingcall_p.h
Go to the documentation of this file.
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 QDBUSPENDINGCALL_P_H
18#define QDBUSPENDINGCALL_P_H
19
20#include <QtDBus/private/qtdbusglobal_p.h>
21#include <qlist.h>
22#include <qmutex.h>
23#include <qpointer.h>
24#include <qshareddata.h>
25#include <qwaitcondition.h>
26
27#include "qdbusmessage.h"
28#include "qdbus_symbols_p.h"
29
30#ifndef QT_NO_DBUS
31
33
38
40{
41public:
42 // {
43 // set only during construction:
46
47 // for the callback mechanism (see setReplyCallback and QDBusConnectionPrivate::sendWithReplyAsync)
51
52 // }
53
54 mutable QMutex mutex;
56
57 // {
58 // protected by the mutex above:
61 DBusPendingCall *pending;
63 // }
64
67 { }
69 bool setReplyCallback(QObject *target, const char *member);
70 void waitForFinished();
71 void setMetaTypes(int count, const QMetaType *types);
73
75};
76
78{
80public:
82
83 void emitSignals(const QDBusMessage &replyMessage, const QDBusMessage &sentMessage)
84 {
85 if (replyMessage.type() == QDBusMessage::ReplyMessage)
86 emit reply(replyMessage);
87 else
88 emit error(QDBusError(replyMessage), sentMessage);
89 emit finished();
90 }
91
93 void finished();
94 void reply(const QDBusMessage &msg);
95 void error(const QDBusError &error, const QDBusMessage &msg);
96};
97
99
100#endif // QT_NO_DBUS
101#endif
\inmodule QtDBus
Definition qdbuserror.h:21
\inmodule QtDBus
MessageType type() const
Returns the message type.
QPointer< QObject > receiver
QDBusPendingCallWatcherHelper * watcherHelper
QWaitCondition waitForFinishedCondition
bool setReplyCallback(QObject *target, const char *member)
QDBusConnectionPrivate *const connection
QList< QMetaType > metaTypes
void setMetaTypes(int count, const QMetaType *types)
QDBusPendingCallPrivate(const QDBusMessage &sent, QDBusConnectionPrivate *connection)
static QDBusPendingCall fromMessage(const QDBusMessage &msg)
const QDBusMessage sentMessage
void error(const QDBusError &error, const QDBusMessage &msg)
void emitSignals(const QDBusMessage &replyMessage, const QDBusMessage &sentMessage)
void reply(const QDBusMessage &msg)
void add(QDBusPendingCallWatcher *watcher)
\inmodule QtDBus
Definition qlist.h:74
\inmodule QtCore
Definition qmetatype.h:320
\inmodule QtCore
Definition qmutex.h:285
\inmodule QtCore
Definition qobject.h:90
\inmodule QtCore
Definition qpointer.h:18
\inmodule QtCore
Definition qshareddata.h:19
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
Combined button and popup list for selecting options.
GLsizei GLenum GLenum * types
GLenum GLenum GLsizei count
GLenum target
#define Q_OBJECT
#define Q_SIGNALS
#define emit
QFutureWatcher< int > watcher
QObject::connect nullptr