X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fbuffer.h;h=44e6efd1fcb8f604a8023dadc9d43bd0fd20e4d5;hp=9bf4b783f3ad05172fa28154cce8f9a455594380;hb=a2bf6dec2ea5a72d15a3310f8a7abc11988228c4;hpb=08aac67d4dc813ed541a81d06fb83d9c4fec5834 diff --git a/src/client/buffer.h b/src/client/buffer.h index 9bf4b783..44e6efd1 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,19 +32,29 @@ 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. +/// Encapsulates the contents of a single channel, query or server status context. +/** */ 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; + const QList &contents() const; + inline bool isVisible() const { return _isVisible; } + inline MsgId lastSeenMsg() const { return _lastSeenMsg; } + inline ActivityLevel activityLevel() const { return _activityLevel; } - QList contents() const; - signals: void msgAppended(AbstractUiMsg *); void msgPrepended(AbstractUiMsg *); @@ -52,13 +64,22 @@ 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); private: BufferInfo _bufferInfo; + bool _isVisible; + MsgId _lastSeenMsg; + ActivityLevel _activityLevel; - QList layoutQueue; + QLinkedList layoutQueue; QList layoutedMsgs; + void updateActivityLevel(const Message &msg); }; +Q_DECLARE_OPERATORS_FOR_FLAGS(Buffer::ActivityLevel) + #endif