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
qdbuscontext.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 QDBUSCONTEXT_H
6#define QDBUSCONTEXT_H
7
8#include <QtDBus/qtdbusglobal.h>
9#include <QtCore/qstring.h>
10#include <QtDBus/qdbuserror.h>
11
12#ifndef QT_NO_DBUS
13
15
16
17class QDBusConnection;
18class QDBusMessage;
19
21class Q_DBUS_EXPORT QDBusContext
22{
23public:
24 QDBusContext();
25 ~QDBusContext();
26
27 bool calledFromDBus() const;
28 QDBusConnection connection() const;
29 const QDBusMessage &message() const;
30
31 // convenience methods
32 bool isDelayedReply() const;
33 // yes, they are const, so that you can use them even from const methods
34 void setDelayedReply(bool enable) const;
35 void sendErrorReply(const QString &name, const QString &msg = QString()) const;
36 void sendErrorReply(QDBusError::ErrorType type, const QString &msg = QString()) const;
37
38private:
39 QDBusContextPrivate *d_ptr;
40 friend class QDBusContextPrivate;
41};
42
43QT_END_NAMESPACE
44
45#endif // QT_NO_DBUS
46#endif
static QDBusContextPrivate * set(QObject *obj, QDBusContextPrivate *newContext)
The QDBusContext class allows slots to determine the D-Bus context of the calls.