X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatscene.h;h=e72308e43e0dba33ea322bbcafd32e46d8a50af5;hp=22dcb479a7dd289a1d7c7c84ca1e9a24df702e4e;hb=dbefd590650e9053c7a1513a5f49aad3e582108a;hpb=bd37d2c94e49e791d2ba44baab4270e030442832 diff --git a/src/qtui/chatscene.h b/src/qtui/chatscene.h index 22dcb479..e72308e4 100644 --- a/src/qtui/chatscene.h +++ b/src/qtui/chatscene.h @@ -25,8 +25,11 @@ #include #include +#include "types.h" + class AbstractUiMsg; class Buffer; +class BufferId; class ChatItem; class ChatLine; class ColumnHandleItem; @@ -40,10 +43,13 @@ class ChatScene : public QGraphicsScene { ChatScene(QAbstractItemModel *model, const QString &idString, QObject *parent); virtual ~ChatScene(); - Buffer *buffer() const; inline QAbstractItemModel *model() const { return _model; } inline QString idString() const { return _idString; } + inline bool isFetchingBacklog() const; + inline bool isBacklogFetchingEnabled() const; + inline BufferId bufferForBacklogFetching() const; + public slots: void setWidth(qreal); @@ -52,6 +58,9 @@ class ChatScene : public QGraphicsScene { ChatItem *selectingItem() const { return _selectingItem; } void startGlobalSelection(ChatItem *item, const QPointF &itemPos); + void setIsFetchingBacklog(bool); + inline void setBufferForBacklogFetching(BufferId buffer); + signals: void heightChanged(qreal height); @@ -71,6 +80,7 @@ class ChatScene : public QGraphicsScene { private: void updateSelection(const QPointF &pos); QString selectionToString() const; + void requestBacklogIfNeeded(); QString _idString; qreal _width, _height; @@ -86,6 +96,27 @@ class ChatScene : public QGraphicsScene { int _selectionStart; int _selectionEnd; bool _isSelecting; + + bool _fetchingBacklog; + BufferId _backlogFetchingBuffer; + MsgId _lastBacklogOffset; + int _lastBacklogSize; }; +bool ChatScene::isFetchingBacklog() const { + return _fetchingBacklog; +} + +bool ChatScene::isBacklogFetchingEnabled() const { + return _backlogFetchingBuffer.isValid(); +} + +BufferId ChatScene::bufferForBacklogFetching() const { + return _backlogFetchingBuffer; +} + +void ChatScene::setBufferForBacklogFetching(BufferId buf) { + _backlogFetchingBuffer = buf; +} + #endif