Changing the behavior how Quassel Events are processed.
[quassel.git] / src / common / signalproxy.h
index 9bae636..867ffdb 100644 (file)
@@ -76,6 +76,11 @@ public:
   void setProxyMode(ProxyMode mode);
   inline ProxyMode proxyMode() const { return _proxyMode; }
 
+  void setHeartBeatInterval(int secs);
+  inline int heartBeatInterval() const { return _heartBeatInterval; }
+  void setMaxHeartBeatCount(int max);
+  inline int maxHeartBeatCount() const { return _maxHeartBeatCount; }
+
   bool addPeer(QIODevice *iodev);
   bool addPeer(SignalProxy *proxy);
   void removePeer(QObject *peer);
@@ -85,6 +90,7 @@ public:
   bool attachSlot(const QByteArray& sigName, QObject *recv, const char *slot);
 
   void synchronize(SyncableObject *obj);
+  void stopSynchronize(SyncableObject *obj);
 
   //! Writes a QVariant to a device.
   /** The data item is prefixed with the resulting blocksize,
@@ -101,9 +107,9 @@ public:
 
   class ExtendedMetaObject;
   ExtendedMetaObject *extendedMetaObject(const QMetaObject *meta) const;
-  ExtendedMetaObject *createExtendedMetaObject(const QMetaObject *meta);
+  ExtendedMetaObject *createExtendedMetaObject(const QMetaObject *meta, bool checkConflicts = false);
   inline ExtendedMetaObject *extendedMetaObject(const QObject *obj) const { return extendedMetaObject(metaObject(obj)); }
-  inline ExtendedMetaObject *createExtendedMetaObject(const QObject *obj) { return createExtendedMetaObject(metaObject(obj)); }
+  inline ExtendedMetaObject *createExtendedMetaObject(const QObject *obj, bool checkConflicts = false) { return createExtendedMetaObject(metaObject(obj), checkConflicts); }
 
   bool isSecure() const { return _secure; }
   void dumpProxyStats();
@@ -112,16 +118,15 @@ public slots:
   void detachObject(QObject *obj);
   void detachSignals(QObject *sender);
   void detachSlots(QObject *receiver);
-  void stopSync(QObject *obj);
 
 protected:
   void customEvent(QEvent *event);
   void sync_call__(const SyncableObject *obj, ProxyMode modeType, const char *funcname, va_list ap);
+  void renameObject(const SyncableObject *obj, const QString &newname, const QString &oldname);
 
 private slots:
   void dataAvailable();
   void removePeerBySender();
-  void objectRenamed(const QString &newname, const QString &oldname);
   void objectRenamed(const QByteArray &classname, const QString &newname, const QString &oldname);
   void sendHeartBeat();
   void receiveHeartBeat(AbstractPeer *peer, const QVariantList &params);
@@ -195,6 +200,8 @@ private:
 
   ProxyMode _proxyMode;
   QTimer _heartBeatTimer;
+  int _heartBeatInterval;
+  int _maxHeartBeatCount;
 
   bool _secure; // determines if all connections are in a secured state (using ssl or internal connections)
 
@@ -227,7 +234,7 @@ class SignalProxy::ExtendedMetaObject {
   };
 
 public:
-  ExtendedMetaObject(const QMetaObject *meta);
+  ExtendedMetaObject(const QMetaObject *meta, bool checkConflicts);
 
   inline const QByteArray &methodName(int methodId) { return methodDescriptor(methodId).methodName(); }
   inline const QList<int> &argTypes(int methodId) { return methodDescriptor(methodId).argTypes(); }
@@ -238,14 +245,14 @@ public:
   inline int methodId(const QByteArray &methodName) { return _methodIds.contains(methodName) ? _methodIds[methodName] : -1; }
 
   inline int updatedRemotelyId() { return _updatedRemotelyId; }
-  
+
   inline const QHash<QByteArray, int> &slotMap() { return _methodIds; }
   const QHash<int, int> &receiveMap();
 
   const QMetaObject *metaObject() const { return _meta; }
 
   static QByteArray methodName(const QMetaMethod &method);
-  static QString ExtendedMetaObject::methodBaseName(const QMetaMethod &method);
+  static QString methodBaseName(const QMetaMethod &method);
 
 private:
   const MethodDescriptor &methodDescriptor(int methodId);