KWin
Loading...
Searching...
No Matches
Public Slots | Signals | Public Member Functions | Properties | List of all members
KWin::DBusCall Class Reference

Qml export for providing a wrapper for sending a message over the DBus session bus. More...

#include <dbuscall.h>

Inheritance diagram for KWin::DBusCall:

Public Slots

void call ()
 
void setService (const QString &service)
 
void setPath (const QString &path)
 
void setInterface (const QString &interface)
 
void setMethod (const QString &method)
 
void setArguments (const QVariantList &arguments)
 

Signals

void finished (QVariantList returnValue)
 
void failed ()
 
void serviceChanged ()
 
void pathChanged ()
 
void interfaceChanged ()
 
void methodChanged ()
 
void argumentsChanged ()
 

Public Member Functions

 DBusCall (QObject *parent=nullptr)
 
 ~DBusCall () override
 
const QString & service () const
 
const QString & path () const
 
const QString & interface () const
 
const QString & method () const
 
const QVariantList & arguments () const
 

Properties

QString service
 
QString path
 
QString dbusInterface
 
QString method
 
QVariantList arguments
 

Detailed Description

Qml export for providing a wrapper for sending a message over the DBus session bus.

Allows to setup the connection arguments just like in QDBusMessage and supports adding arguments to the call. To invoke the message use the slot call.

If the call succeeds the signal finished is emitted, if the call fails the signal failed is emitted.

Note: the DBusCall always uses the session bus and performs an async call.

Example on how to use in Qml:

id: dbus
service: "org.kde.KWin"
path: "/KWin"
method: "nextDesktop"
Component.onCompleted: dbus.call()
}
Qml export for providing a wrapper for sending a message over the DBus session bus.
Definition dbuscall.h:65
QString service
Definition dbuscall.h:67
QString method
Definition dbuscall.h:70
QString path
Definition dbuscall.h:68

Example with arguments:

id: dbus
service: "org.kde.KWin"
path: "/KWin"
method: "setCurrentDesktop"
arguments: [1]
Component.onCompleted: dbus.call()
}
QVariantList arguments
Definition dbuscall.h:71

Example with a callback:

id: dbus
service: "org.kde.KWin"
path: "/KWin"
method: "currentDesktop"
onFinished: console.log(returnValue[0])
}

Definition at line 64 of file dbuscall.h.

Constructor & Destructor Documentation

◆ DBusCall()

KWin::DBusCall::DBusCall ( QObject * parent = nullptr)
explicit

Definition at line 19 of file dbuscall.cpp.

◆ ~DBusCall()

KWin::DBusCall::~DBusCall ( )
override

Definition at line 24 of file dbuscall.cpp.

Member Function Documentation

◆ arguments()

const QVariantList & KWin::DBusCall::arguments ( ) const

◆ argumentsChanged

void KWin::DBusCall::argumentsChanged ( )
signal

◆ call

void KWin::DBusCall::call ( )
slot

Definition at line 28 of file dbuscall.cpp.

◆ failed

void KWin::DBusCall::failed ( )
signal

◆ finished

void KWin::DBusCall::finished ( QVariantList returnValue)
signal

◆ interface()

const QString & KWin::DBusCall::interface ( ) const

◆ interfaceChanged

void KWin::DBusCall::interfaceChanged ( )
signal

◆ method()

const QString & KWin::DBusCall::method ( ) const

◆ methodChanged

void KWin::DBusCall::methodChanged ( )
signal

◆ path()

const QString & KWin::DBusCall::path ( ) const

◆ pathChanged

void KWin::DBusCall::pathChanged ( )
signal

◆ service()

const QString & KWin::DBusCall::service ( ) const

◆ serviceChanged

void KWin::DBusCall::serviceChanged ( )
signal

◆ setArguments

void KWin::DBusCall::setArguments ( const QVariantList & arguments)
slot

◆ setInterface

void KWin::DBusCall::setInterface ( const QString & interface)
slot

◆ setMethod

void KWin::DBusCall::setMethod ( const QString & method)
slot

◆ setPath

void KWin::DBusCall::setPath ( const QString & path)
slot

◆ setService

void KWin::DBusCall::setService ( const QString & service)
slot

Property Documentation

◆ arguments

QVariantList KWin::DBusCall::arguments
readwrite

Definition at line 71 of file dbuscall.h.

◆ dbusInterface

QString KWin::DBusCall::dbusInterface
readwrite

Definition at line 69 of file dbuscall.h.

◆ method

QString KWin::DBusCall::method
readwrite

Definition at line 70 of file dbuscall.h.

◆ path

QString KWin::DBusCall::path
readwrite

Definition at line 68 of file dbuscall.h.

◆ service

QString KWin::DBusCall::service
readwrite

Definition at line 67 of file dbuscall.h.


The documentation for this class was generated from the following files: