X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fclientbacklogmanager.h;h=f4a7b9054ca08f2903c370df9064337a6152fd4f;hp=2fb6a2d4ab7ac5627865a04a7ac78dd235e199d1;hb=02b4f33429788d35500454bfb5a8a9ab0a2a2b49;hpb=8f0946673bc3edc84b6f13e16cbe8ece912b4a3b diff --git a/src/client/clientbacklogmanager.h b/src/client/clientbacklogmanager.h index 2fb6a2d4..f4a7b905 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 * @@ -27,27 +27,48 @@ class BacklogRequester; class ClientBacklogManager : public BacklogManager { + SYNCABLE_OBJECT 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, 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 messagesProcessed(const QString &); + 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; + bool _initBacklogRequested; + QSet _buffersRequested; }; +// inlines +inline void ClientBacklogManager::checkForBacklog(BufferId bufferId) { + checkForBacklog(BufferIdList() << bufferId); +} + #endif // CLIENTBACKLOGMANAGER_H