X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fbufferinfo.h;h=2956af651c5dd23dc16b75fd27b654c5ccb80207;hp=63ba6a52c9639562b05d74f339c8ac0d3284c5d2;hb=694f9bfbf7f1af19108461c7e00d133e55082bce;hpb=61c8d84d1c849373e0f115dc748ed45cff95287d diff --git a/src/common/bufferinfo.h b/src/common/bufferinfo.h index 63ba6a52..2956af65 100644 --- a/src/common/bufferinfo.h +++ b/src/common/bufferinfo.h @@ -25,53 +25,55 @@ class QString; class QDataStream; -class BufferInfo { +class BufferInfo +{ public: - enum Type { - InvalidBuffer = 0x00, - StatusBuffer = 0x01, - ChannelBuffer = 0x02, - QueryBuffer = 0x04, - GroupBuffer = 0x08 - }; - - enum Activity { - NoActivity = 0x00, - OtherActivity = 0x01, - NewMessage = 0x02, - Highlight = 0x40 - }; - Q_DECLARE_FLAGS(ActivityLevel, Activity) - - BufferInfo(); - BufferInfo(BufferId id, NetworkId networkid, Type type, uint gid = 0, QString buf = QString()); - - static BufferInfo fakeStatusBuffer(NetworkId networkId); - - inline bool isValid() const { return _bufferId != 0; } - inline const BufferId &bufferId() const { return _bufferId; } - inline void setBufferId(BufferId id) { _bufferId = id; } - inline const NetworkId &networkId() const { return _netid; } - inline const Type &type() const { return _type; } - inline const uint &groupId() const { return _groupId; } - void setGroupId(uint gid) { _groupId = gid; } - - QString bufferName() const; - - inline bool operator==(const BufferInfo &other) const { return _bufferId == other._bufferId; } + enum Type { + InvalidBuffer = 0x00, + StatusBuffer = 0x01, + ChannelBuffer = 0x02, + QueryBuffer = 0x04, + GroupBuffer = 0x08 + }; + + enum Activity { + NoActivity = 0x00, + OtherActivity = 0x01, + NewMessage = 0x02, + Highlight = 0x40 + }; + Q_DECLARE_FLAGS(ActivityLevel, Activity) + + BufferInfo(); + BufferInfo(BufferId id, NetworkId networkid, Type type, uint gid = 0, QString buf = QString()); + + static BufferInfo fakeStatusBuffer(NetworkId networkId); + + inline bool isValid() const { return _bufferId != 0; } + inline const BufferId &bufferId() const { return _bufferId; } + inline void setBufferId(BufferId id) { _bufferId = id; } + inline const NetworkId &networkId() const { return _netid; } + inline const Type &type() const { return _type; } + inline const uint &groupId() const { return _groupId; } + void setGroupId(uint gid) { _groupId = gid; } + + QString bufferName() const; + + inline bool operator==(const BufferInfo &other) const { return _bufferId == other._bufferId; } private: - BufferId _bufferId; - NetworkId _netid; - Type _type; - uint _groupId; - QString _bufferName; - - friend uint qHash(const BufferInfo &); - friend QDataStream &operator<<(QDataStream &out, const BufferInfo &bufferInfo); - friend QDataStream &operator>>(QDataStream &in, BufferInfo &bufferInfo); + BufferId _bufferId; + NetworkId _netid; + Type _type; + uint _groupId; + QString _bufferName; + + friend uint qHash(const BufferInfo &); + friend QDataStream &operator<<(QDataStream &out, const BufferInfo &bufferInfo); + friend QDataStream &operator>>(QDataStream &in, BufferInfo &bufferInfo); }; + QDataStream &operator<<(QDataStream &out, const BufferInfo &bufferInfo); QDataStream &operator>>(QDataStream &in, BufferInfo &bufferInfo); QDebug operator<<(QDebug dbg, const BufferInfo &b);