Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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)
48 QPointer<QObject> receiver;
49 QList<QMetaType> metaTypes;
51
52 // }
53
54 mutable QMutex mutex;
56
57 // {
58 // protected by the mutex above:
61 DBusPendingCall *pending;
63 // }
64
69 bool setReplyCallback(QObject *target, const char *member);
70 void waitForFinished();
72 void setMetaTypes(int count, const QMetaType *types);
74};
75
77{
79public:
81
82 void emitSignals(const QDBusMessage &replyMessage, const QDBusMessage &sentMessage)
83 {
84 if (replyMessage.type() == QDBusMessage::ReplyMessage)
85 emit reply(replyMessage);
86 else
87 emit error(QDBusError(replyMessage), sentMessage);
88 emit finished();
89 }
90
92 void finished();
93 void reply(const QDBusMessage &msg);
94 void error(const QDBusError &error, const QDBusMessage &msg);
95};
96
98
99#endif // QT_NO_DBUS
100#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)
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
\inmodule QtCore
Definition qmetatype.h:341
\inmodule QtCore
Definition qmutex.h:281
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore
Definition qshareddata.h:19
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
GLsizei GLenum GLenum * types
GLenum GLenum GLsizei count
GLenum target
#define Q_OBJECT
#define Q_SIGNALS
#define emit
QFutureWatcher< int > watcher
QObject::connect nullptr
QNetworkReply * reply