diff options
author | Frederik Gladhorn <frederik.gladhorn@nokia.com> | 2011-05-22 19:36:10 (GMT) |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@nokia.com> | 2011-07-04 11:44:14 (GMT) |
commit | b07919b3de8cff3e44b7271062372b14bcda5b83 (patch) | |
tree | fb6e9c5ebbade0756b85819b59eb3efcf0ee242d /src/dbus/qdbusconnection.h | |
parent | cee1f6454a7b52a52795590e2f793c0cd4e15ce1 (diff) | |
download | Qt-b07919b3de8cff3e44b7271062372b14bcda5b83.zip Qt-b07919b3de8cff3e44b7271062372b14bcda5b83.tar.gz Qt-b07919b3de8cff3e44b7271062372b14bcda5b83.tar.bz2 |
Add DBus VirtualObject to handle multiple paths.
When a virtual object is registered with the SubPath option
it will handle all dbus calls to itself and all child paths.
It needs to reimplement handleMessage for that purpose.
Introspection needs to be implemented manually in the introspect function.
Reviewed-by: Thiago Macieira <thiago.macieira@nokia.com>
Diffstat (limited to 'src/dbus/qdbusconnection.h')
-rw-r--r-- | src/dbus/qdbusconnection.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/dbus/qdbusconnection.h b/src/dbus/qdbusconnection.h index 4bdd055..8b126af 100644 --- a/src/dbus/qdbusconnection.h +++ b/src/dbus/qdbusconnection.h @@ -69,6 +69,7 @@ class QDBusError; class QDBusMessage; class QDBusPendingCall; class QDBusConnectionInterface; +class QDBusVirtualObject; class QObject; class QDBusConnectionPrivate; @@ -104,8 +105,8 @@ public: // Qt 4.2 had a misspelling here ExportAllSignal = ExportAllSignals, #endif - ExportChildObjects = 0x1000 + // Reserved = 0xff000000 }; enum UnregisterMode { UnregisterNode, @@ -113,6 +114,15 @@ public: }; Q_DECLARE_FLAGS(RegisterOptions, RegisterOption) + enum VirtualObjectRegisterOption { + SingleNode = 0x0, + SubPath = 0x1 + // Reserved = 0xff000000 + }; +#ifndef Q_QDOC + Q_DECLARE_FLAGS(VirtualObjectRegisterOptions, VirtualObjectRegisterOption) +#endif + enum ConnectionCapability { UnixFileDescriptorPassing = 0x0001 }; @@ -163,6 +173,9 @@ public: void unregisterObject(const QString &path, UnregisterMode mode = UnregisterNode); QObject *objectRegisteredAt(const QString &path) const; + bool registerVirtualObject(const QString &path, QDBusVirtualObject *object, + VirtualObjectRegisterOption options = SingleNode); + bool registerService(const QString &serviceName); bool unregisterService(const QString &serviceName); @@ -192,6 +205,7 @@ private: }; Q_DECLARE_OPERATORS_FOR_FLAGS(QDBusConnection::RegisterOptions) +Q_DECLARE_OPERATORS_FOR_FLAGS(QDBusConnection::VirtualObjectRegisterOptions) QT_END_NAMESPACE |