Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
PhosphorProtocol::ClientHelpers Namespace Reference

Daemon-bound convenience wrappers around PhosphorDBus::Client. More...

Functions

void fireAndForget (QObject *parent, const QString &interface, const QString &method, const QVariantList &args, const QString &logContext={})
 Fire-and-forget async call to the daemon, with error logging.
 
void sendOneWay (const QString &interface, const QString &method, const QVariantList &args={})
 One-way notification to the daemon with no expected reply.
 
QDBusPendingCall asyncCall (const QString &interface, const QString &method, const QVariantList &args={})
 Async method call to the daemon; caller attaches its own watcher.
 
QDBusMessage syncCall (const QString &interface, const QString &method, const QVariantList &args={})
 Blocking daemon call bounded by Service::SyncCallTimeoutMs.
 
template<typename Fn >
void loadSettingAsync (QObject *parent, const QString &name, Fn &&onValue)
 Async helper for loading a single daemon setting.
 

Detailed Description

Daemon-bound convenience wrappers around PhosphorDBus::Client.

These talk to the canonical PlasmaZones daemon. Code that needs to address a different service should construct its own PhosphorDBus::Client.

Function Documentation

◆ asyncCall()

QDBusPendingCall PhosphorProtocol::ClientHelpers::asyncCall ( const QString &  interface,
const QString &  method,
const QVariantList &  args = {} 
)
inline

Async method call to the daemon; caller attaches its own watcher.

See also
PhosphorDBus::Client::asyncCall

◆ fireAndForget()

void PhosphorProtocol::ClientHelpers::fireAndForget ( QObject *  parent,
const QString &  interface,
const QString &  method,
const QVariantList &  args,
const QString &  logContext = {} 
)
inline

Fire-and-forget async call to the daemon, with error logging.

See also
PhosphorDBus::Client::fireAndForget

◆ loadSettingAsync()

template<typename Fn >
void PhosphorProtocol::ClientHelpers::loadSettingAsync ( QObject *  parent,
const QString &  name,
Fn &&  onValue 
)

Async helper for loading a single daemon setting.

Sends getSetting(name) to the Settings interface, unwraps the QDBusVariant, and calls onValue with the extracted QVariant.

Parameters
parentQObject parent for the watcher
nameSetting name to load
onValueCallback receiving the unwrapped QVariant value (captured by move into the lambda — callers must pass a fresh rvalue each call)

◆ sendOneWay()

void PhosphorProtocol::ClientHelpers::sendOneWay ( const QString &  interface,
const QString &  method,
const QVariantList &  args = {} 
)
inline

One-way notification to the daemon with no expected reply.

See also
PhosphorDBus::Client::sendOneWay

◆ syncCall()

QDBusMessage PhosphorProtocol::ClientHelpers::syncCall ( const QString &  interface,
const QString &  method,
const QVariantList &  args = {} 
)
inline

Blocking daemon call bounded by Service::SyncCallTimeoutMs.

Prefer asyncCall whenever the caller can tolerate a callback.

See also
PhosphorDBus::Client::syncCall