X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fclientbacklogmanager.h;h=5a8585bd61089d9f565973986ac5338c6d465ca1;hp=2f0fcf360d38a9bbfbccc1986d7e10dab66e57fc;hb=ee7d56f3abdb6ee4ce6c79ddea0142407b4e9e74;hpb=5225cf288d73e76905f85380ec52418c3b04efee diff --git a/src/client/clientbacklogmanager.h b/src/client/clientbacklogmanager.h index 2f0fcf36..5a8585bd 100644 --- a/src/client/clientbacklogmanager.h +++ b/src/client/clientbacklogmanager.h @@ -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 * @@ -24,23 +24,38 @@ #include "backlogmanager.h" #include "message.h" +class BacklogRequester; + class ClientBacklogManager : public BacklogManager { Q_OBJECT public: ClientBacklogManager(QObject *parent = 0); - virtual const QMetaObject *syncMetaObject() const { return &BacklogManager::staticMetaObject; } + // helper for the backlogRequester, as it isn't a QObject and can't emit itself + inline void emitMessagesRequested(const QString &msg) const { emit messagesRequested(msg); } + + void reset(); public slots: - virtual void receiveBacklog(BufferId bufferId, int lastMsgs, int offset, QVariantList msgs); - virtual QVariantList requestBacklog(BufferId bufferId, int lastMsgs = -1, int offset = -1); + 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(); +signals: + void messagesReceived(BufferId bufferId, int count) const; + void messagesRequested(const QString &) const; + void messagesProcessed(const QString &) const; + + void updateProgress(int, int); + private: - bool _buffer; - QList _messageBuffer; - QSet _buffersWaiting; + bool isBuffering(); + void stopBuffering(); + + void dispatchMessages(const MessageList &messages, bool sort = false); + + BacklogRequester *_requester; }; #endif // CLIENTBACKLOGMANAGER_H