summaryrefslogtreecommitdiffstats
path: root/src/dbus/qdbusconnection.h
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@nokia.com>2011-05-22 21:36:10 +0200
committerQt by Nokia <qt-info@nokia.com>2011-08-18 17:59:18 +0200
commit3cea6b22a6b1628cedd59a3286dcaa8088491660 (patch)
tree3e99604c0c16f31387bcce7b6aa31bdc337d8023 /src/dbus/qdbusconnection.h
parenta34771074c4a2475b4c6702b6aef147eb4908cfe (diff)
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> (cherry picked from commit b07919b3de8cff3e44b7271062372b14bcda5b83) (cherry picked from commit 997c2dfed7a04da2fac577f1c29b89bda4939e2d) (cherry picked from commit c676b7095d826dc2d006f52a4b234546af5e2137) Change-Id: I003007604b286af8000959756ce9d25c17306f5b Reviewed-on: http://codereview.qt.nokia.com/3051 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
Diffstat (limited to 'src/dbus/qdbusconnection.h')
-rw-r--r--src/dbus/qdbusconnection.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/dbus/qdbusconnection.h b/src/dbus/qdbusconnection.h
index 4bdd055f52..8b126af77e 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