6#ifndef SWIFT_MISC_GENERICDBUSINTERFACE_H
7#define SWIFT_MISC_GENERICDBUSINTERFACE_H
9#include <QDBusAbstractInterface>
10#include <QDBusPendingCall>
11#include <QDBusPendingReply>
14#include <QSharedPointer>
24# define SWIFT_NO_RELAY
52 superMetaObject = superMetaObject->
superClass();
62 if (method.
tag() && strcmp(method.
tag(),
"SWIFT_NO_RELAY") == 0)
70 method.
name(), this->parent(), signature);
79 template <
typename... Args>
87 template <
typename Ret,
typename... Args>
95 CLogMessage(
this).
debug(u
"CGenericDBusInterface::callDBusRet(%1) returned: %2")
103 template <
typename Func,
typename... Args>
114 template <
typename Ret,
typename... Args>
120 std::forward<Args>(args)...);
121 return sharedPromise->future();
129 for (
auto w : watchers)
CGenericDBusInterface(const QString &serviceName, const QString &path, const QString &interfaceName, const QDBusConnection &connection, QObject *parent=nullptr)
Constructor.
QDBusPendingCallWatcher * callDBusAsync(QLatin1String method, Func callback, Args &&...args)
Call DBus with asynchronous return value Callback can be any callable object taking a single argument...
void callDBus(QLatin1String method, Args &&...args)
Call DBus, no return value.
QFuture< Ret > callDBusFuture(QLatin1String method, Args &&...args)
Call DBus with asynchronous return as a future.
void relayParentSignals()
For each signal in parent, attempt to connect to it an interface signal of the same name.
Ret callDBusRet(QLatin1String method, Args &&...args)
Call DBus with synchronous return value.
void cancelAllPendingAsyncCalls()
Cancel all asynchronous DBus calls which are currently pending.
Class for emitting a log message.
Derived & debug()
Set the severity to debug.
Derived & error(const char16_t(&format)[N])
Set the severity to error, providing a format string.
Free functions in swift::misc.
QByteArray & prepend(QByteArrayView ba)
QDBusPendingCall asyncCallWithArgumentList(const QString &method, const QList< QVariant > &args)
QDBusMessage callWithArgumentList(QDBus::CallMode mode, const QString &method, const QList< QVariant > &args)
QDBusConnection connection() const const
QString interface() const const
QString path() const const
QString service() const const
QString message() const const
void finished(QDBusPendingCallWatcher *self)
QDBusError error() const const
bool isError() const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QList< T > findChildren(QAnyStringView name, Qt::FindChildOptions options) const const
QObject * parent() const const
QVariant fromValue(T &&value)
#define SWIFT_MISC_EXPORT
Export a class or function from the library.