X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fclient%2Fbuffer.h;h=72a30f114068bf4e259cf6f651a0b1b374e34032;hb=e1b6d538b7c4cc279f9218614e23adb5d8a81fe5;hp=9bf4b783f3ad05172fa28154cce8f9a455594380;hpb=08aac67d4dc813ed541a81d06fb83d9c4fec5834;p=quassel.git diff --git a/src/client/buffer.h b/src/client/buffer.h index 9bf4b783..72a30f11 100644 --- a/src/client/buffer.h +++ b/src/client/buffer.h @@ -21,6 +21,8 @@ #ifndef _BUFFER_H_ #define _BUFFER_H_ +#include + class AbstractUiMsg; class IrcChannel; class NickModel; @@ -30,35 +32,42 @@ struct BufferState; #include "message.h" #include "bufferinfo.h" -//!\brief Encapsulates the contents of a single channel, query or server status context. -/** A Buffer maintains a list of existing nicks and their status. +/** */ class Buffer : public QObject { Q_OBJECT public: + enum Activity { + NoActivity = 0x00, + OtherActivity = 0x01, + NewMessage = 0x02, + Highlight = 0x40 + }; + Q_DECLARE_FLAGS(ActivityLevel, Activity) + Buffer(BufferInfo, QObject *parent = 0); BufferInfo bufferInfo() const; - - QList contents() const; - -signals: - void msgAppended(AbstractUiMsg *); - void msgPrepended(AbstractUiMsg *); - void layoutQueueEmpty(); + inline bool isVisible() const { return _isVisible; } + inline MsgId lastSeenMsg() const { return _lastSeenMsg; } + inline ActivityLevel activityLevel() const { return _activityLevel; } public slots: - void appendMsg(const Message &); - void prependMsg(const Message &); - bool layoutMsg(); + void setVisible(bool visible); + void setLastSeenMsg(const MsgId &msgId); + void setActivityLevel(ActivityLevel level); + void updateActivityLevel(const Message &msg); private: BufferInfo _bufferInfo; - - QList layoutQueue; - QList layoutedMsgs; + bool _isVisible; + MsgId _lastSeenMsg; + Message _lastRcvdMsg; + ActivityLevel _activityLevel; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(Buffer::ActivityLevel) + #endif