From d42c8663e8fd441838a238bfb845a7c80c37b253 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 28 Mar 2006 18:56:08 +0000 Subject: * qt/*: * dbus/qdbus.h: Sync with KDE Subversion revision 523647. Hopefully, this will be the last of the source-incompatible changes. Documentation has been improved; support for QList has been added; QDBusObject is gone; QDBus(Abstract)Interface is now a QObject with auto-generated meta-object; QDBusIntrospection is marked private, since QMetaObject can be used now; lots of bugfixes. --- qt/qdbusconnection_p.h | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) (limited to 'qt/qdbusconnection_p.h') diff --git a/qt/qdbusconnection_p.h b/qt/qdbusconnection_p.h index 7904a843..53cb4361 100644 --- a/qt/qdbusconnection_p.h +++ b/qt/qdbusconnection_p.h @@ -52,13 +52,17 @@ #include #include "qdbusmessage.h" -#include "qdbusintrospection.h" class QDBusMessage; class QSocketNotifier; class QTimerEvent; class QDBusObjectPrivate; class CallDeliveryEvent; +class QMetaMethod; +class QDBusInterfacePrivate; +class QDBusMetaObject; +class QDBusAbstractInterface; +class QDBusBusService; typedef struct DBusConnection; typedef struct DBusServer; @@ -119,8 +123,7 @@ public: typedef QMultiHash WatcherHash; typedef QHash TimeoutHash; typedef QMultiHash SignalHookHash; - typedef QHash > KnownInterfacesHash; - typedef QHash KnownObjectsHash; + typedef QHash MetaObjectHash; public: // public methods @@ -134,23 +137,24 @@ public: void closeConnection(); void timerEvent(QTimerEvent *e); + QString getNameOwner(const QString &service); + bool send(const QDBusMessage &message) const; + QDBusMessage sendWithReply(const QDBusMessage &message, int mode); int sendWithReplyAsync(const QDBusMessage &message, QObject *receiver, - const char *method) const; + const char *method); void connectSignal(const QString &key, const SignalHook &hook); void registerObject(const ObjectTreeNode *node); + void connectRelay(const QString &service, const QString &path, const QString &interface, + QDBusAbstractInterface *receiver, const char *signal); + void disconnectRelay(const QString &service, const QString &path, const QString &interface, + QDBusAbstractInterface *receiver, const char *signal); bool handleSignal(const QString &path, const QDBusMessage &msg); bool handleSignal(const QDBusMessage &msg); bool handleObjectCall(const QDBusMessage &message); bool handleError(); - void disposeOfLocked(QDBusIntrospection::Object* obj); - void disposeOf(QDBusObjectPrivate* obj); - QSharedDataPointer findInterface(const QString& name); - QDBusIntrospection::Object* findObject(const QString& service, - const QString& path); - bool activateSignal(const SignalHook& hook, const QDBusMessage &msg); bool activateCall(QObject* object, int flags, const QDBusMessage &msg); bool activateObject(const ObjectTreeNode *node, const QDBusMessage &msg); @@ -160,9 +164,16 @@ public: CallDeliveryEvent *postedCallDeliveryEvent(); void deliverCall(const CallDeliveryEvent &data) const; + QDBusInterfacePrivate *findInterface(const QString &service, const QString &path, + const QString &interface); + protected: virtual void customEvent(QEvent *event); +private: + QDBusMetaObject *findMetaObject(const QString &service, const QString &path, + QString &interface); + public slots: // public slots void socketRead(int); @@ -182,6 +193,7 @@ public: ConnectionMode mode; DBusConnection *connection; DBusServer *server; + QDBusBusService *busService; WatcherHash watchers; TimeoutHash timeouts; @@ -189,20 +201,18 @@ public: QList pendingTimeouts; ObjectTreeNode rootNode; + MetaObjectHash cachedMetaObjects; QMutex callDeliveryMutex; CallDeliveryEvent *callDeliveryState; // protected by the callDeliveryMutex mutex -public: - // public mutable member variables - mutable KnownInterfacesHash knownInterfaces; - mutable KnownObjectsHash knownObjects; - public: // static methods static int messageMetaType; static int registerMessageMetaType(); static int findSlot(QObject *obj, const char *slotName, QList& params); + static DBusHandlerResult messageFilter(DBusConnection *, DBusMessage *, void *); + static void messageResultReceived(DBusPendingCall *, void *); }; class QDBusReplyWaiter: public QEventLoop @@ -215,7 +225,7 @@ public slots: void reply(const QDBusMessage &msg); }; -extern int qDBusParametersForMethod(const QByteArray &sig, QList& metaTypes); +extern int qDBusParametersForMethod(const QMetaMethod &mm, QList& metaTypes); extern int qDBusNameToTypeId(const char *name); extern bool qDBusCheckAsyncTag(const char *tag); -- cgit