Testing the new SyncObjects concept - looking good so far
[quassel.git] / src / client / clientbacklogmanager.h
index a0420ab..f52eb16 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-08 by the Quassel IRC Team                         *
+ *   Copyright (C) 2005-09 by the Quassel Project                          *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -27,6 +27,7 @@
 class BacklogRequester;
 
 class ClientBacklogManager : public BacklogManager {
+  SYNCABLE_OBJECT
   Q_OBJECT
 
 public:
@@ -38,22 +39,35 @@ public:
   void reset();
 
 public slots:
+  virtual QVariantList requestBacklog(BufferId bufferId, MsgId first = -1, MsgId last = -1, int limit = -1, int additional = 0);
   virtual void receiveBacklog(BufferId bufferId, MsgId first, MsgId last, int limit, int additional, QVariantList msgs);
   virtual void receiveBacklogAll(MsgId first, MsgId last, int limit, int additional, QVariantList msgs);
+
   void requestInitialBacklog();
 
+  void checkForBacklog(BufferId bufferId);
+  void checkForBacklog(const BufferIdList &bufferIds);
+
 signals:
   void messagesReceived(BufferId bufferId, int count) const;
   void messagesRequested(const QString &) const;
   void messagesProcessed(const QString &) const;
 
+  void updateProgress(int, int);
+
 private:
   bool isBuffering();
-  void stopBuffering();
+  BufferIdList filterNewBufferIds(const BufferIdList &bufferIds);
 
   void dispatchMessages(const MessageList &messages, bool sort = false);
 
   BacklogRequester *_requester;
+  QSet<BufferId> _buffersRequested;
 };
 
+// inlines
+inline void ClientBacklogManager::checkForBacklog(BufferId bufferId) {
+  checkForBacklog(BufferIdList() << bufferId);
+}
+
 #endif // CLIENTBACKLOGMANAGER_H