42 #ifndef QDBUSBINDING_H 43 #define QDBUSBINDING_H 45 #include <QtDBus/QtDBus> 46 #include <QtScript/qscriptable.h> 47 #include <QtScript/qscriptengine.h> 83 inline bool isConnected()
const {
return connection.isConnected(); }
90 {
return connection.send(message); }
92 {
return connection.call(message,
QDBus::CallMode(callMode), timeout); }
95 {
return connection.registerService(serviceName); }
97 {
return connection.unregisterService(serviceName); }
100 {
return connection.lastError(); }
103 {
return connection.unregisterObject(path, mode); }
105 {
return connection.objectRegisteredAt(path); }
109 const char *slot,
int timeout = -1)
const;
118 QObject *receiver,
const char *slot);
121 QObject *receiver,
const char *slot);
124 RegisterOptions options = ExportAdaptors);
179 #endif // QDBUSBINDING_H UnregisterMode
The mode for unregistering an object path:
void unregisterObject(const QString &path, QDBusConnection::UnregisterMode mode=QDBusConnection::UnregisterNode)
The QScriptContext class represents a Qt Script function invocation.
QDBusError lastError() const
QObject * objectRegisteredAt(const QString &path) const
CallMode
This enum describes the various ways of placing a function call.
The QDBusError class represents an error received from the D-Bus bus or from remote applications foun...
QScriptEngine * engine() const
Returns a pointer to the QScriptEngine associated with the current Qt function call, or 0 if the Qt function was not invoked from script code.
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
QObject * qscript_call(const QString &name)
bool send(const QDBusMessage &message) const
bool registerService(const QString &serviceName)
QScriptValue sessionBus() const
The QScriptable class provides access to the Qt Script environment from Qt C++ member functions...
The QScriptEngine class provides an environment for evaluating Qt Script code.
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
QDBusConnectionConstructor(QScriptEngine *engine, QScriptValue extensionObject)
QString baseService() const
bool unregisterService(const QString &serviceName)
BusType
Specifies the type of the bus connection.
QScriptValue protoType() const
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
Disconnects signal in object sender from method in object receiver.
QDBusMessage call(const QDBusMessage &message, int callMode=QDBus::Block, int timeout=-1) const
QScriptContext * context() const
Returns a pointer to the QScriptContext associated with the current Qt function call, or 0 if the Qt function was not invoked from script code.
The QDBusConnection class represents a connection to the D-Bus bus daemon.
QObject * parent() const
Returns a pointer to the parent object.
QScriptValue systemBus() const
QDBusConnection dbusConnection() const
QDBusConnection connectToBus(const QString &address, const QString &name)
The QDBusMessage class represents one message sent or received over the D-Bus bus.
void disconnectFromBus(const QString &name)
QScriptValue dbusInterface
QDBusConnection connection
The QScriptValue class acts as a container for the Qt Script data types.