X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fbuffer.h;fp=src%2Fclient%2Fbuffer.h;h=def01bddc05e1977dc921004aeb60b21c2df2138;hp=9bf4b783f3ad05172fa28154cce8f9a455594380;hb=8010224cf5bfe5685dc2cf535e8dc1ec19c4c364;hpb=1f02b7201ab7b86238e705d2ce5b22f50bf6acfe diff --git a/src/client/buffer.h b/src/client/buffer.h index 9bf4b783..def01bdd 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; - QList contents() const; - + inline bool isVisible() const { return _isVisible; } + inline QDateTime lastSeen() const { return _lastSeen; } + inline ActivityLevel activityLevel() const { return _activityLevel; } + 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 setLastSeen(const QDateTime &); + void setActivityLevel(ActivityLevel level); private: BufferInfo _bufferInfo; + bool _isVisible; + QDateTime _lastSeen; + ActivityLevel _activityLevel; QList layoutQueue; QList layoutedMsgs; + void updateActivityLevel(const Message &msg); }; +Q_DECLARE_OPERATORS_FOR_FLAGS(Buffer::ActivityLevel) + #endif