X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fsignalproxy.h;h=d9871a2301d43cda1faa3b54eef5f2ee911bced3;hp=23dbc9f2c7ecabc5569a1df23a021eb24b088321;hb=d1b6499b0b848d4287efae89107576548533502c;hpb=17a902604b2631d1165fb8c7af65e064e37a49d7 diff --git a/src/common/signalproxy.h b/src/common/signalproxy.h index 23dbc9f2..d9871a23 100644 --- a/src/common/signalproxy.h +++ b/src/common/signalproxy.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-07 by the Quassel IRC Team * + * Copyright (C) 2005-08 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -32,6 +32,7 @@ #include class SignalRelay; +class SyncableObject; class QMetaObject; class SignalProxy : public QObject { @@ -63,16 +64,16 @@ public: bool attachSignal(QObject *sender, const char *signal, const QByteArray& sigName = QByteArray()); bool attachSlot(const QByteArray& sigName, QObject *recv, const char *slot); - void synchronize(QObject *obj); + void synchronize(SyncableObject *obj); - void setInitialized(QObject *obj); - bool initialized(QObject *obj); - void requestInit(QObject *obj); + void setInitialized(SyncableObject *obj); + bool isInitialized(SyncableObject *obj) const; + void requestInit(SyncableObject *obj); void detachObject(QObject *obj); void detachSignals(QObject *sender); void detachSlots(QObject *receiver); - void stopSync(QObject *obj); + void stopSync(SyncableObject *obj); //! Writes a QVariant to a device. /** The data item is prefixed with the resulting blocksize, @@ -88,10 +89,10 @@ public: static bool readDataFromDevice(QIODevice *dev, quint32 &blockSize, QVariant &item); static QString methodBaseName(const QMetaMethod &method); - + const QList &argTypes(QObject *obj, int methodId); const QByteArray &methodName(QObject *obj, int methodId); - const QHash &syncMap(QObject *obj); + const QHash &syncMap(SyncableObject *obj); typedef QHash > ArgHash; typedef QHash MethodNameHash; @@ -114,6 +115,7 @@ signals: void peerRemoved(QIODevice *obj); void connected(); void disconnected(); + void objectInitialized(SyncableObject *); private: void initServer(); @@ -122,7 +124,7 @@ private: void createClassInfo(QObject *obj); void setArgTypes(QObject *obj, int methodId); void setMethodName(QObject *obj, int methodId); - void setSyncMap(QObject *obj); + void setSyncMap(SyncableObject *obj); bool methodsMatch(const QMetaMethod &signal, const QMetaMethod &slot) const; @@ -137,16 +139,17 @@ private: bool invokeSlot(QObject *receiver, int methodId, const QVariantList ¶ms); - QVariantMap initData(QObject *obj) const; - void setInitData(QObject *obj, const QVariantMap &properties); - bool setInitValue(QObject *obj, const QString &property, const QVariant &value); + QVariantMap initData(SyncableObject *obj) const; + void setInitData(SyncableObject *obj, const QVariantMap &properties); void _detachSignals(QObject *sender); void _detachSlots(QObject *receiver); - void _stopSync(QObject *obj); + void _stopSync(SyncableObject *obj); + + public: + void dumpSyncMap(SyncableObject *object); + private: - void dumpSyncMap(QObject *object); - // Hash of used QIODevices QHash _peerByteCount; @@ -162,7 +165,7 @@ private: SlotHash _attachedSlots; // slaves for sync - typedef QHash ObjectId; + typedef QHash ObjectId; QHash _syncSlave;