X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fbufferinfo.h;h=4eec164ec5be853d149bd8c970d253afd77f2ba4;hp=82293634caf95247ab41e6ecb3287e23cb21fac6;hb=0b9f74984780aacbe85ca04c44ec6304c86557c2;hpb=45d9ea6ed5d64eec3ca351fdcf7610c7cff3529d diff --git a/src/common/bufferinfo.h b/src/common/bufferinfo.h index 82293634..4eec164e 100644 --- a/src/common/bufferinfo.h +++ b/src/common/bufferinfo.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-07 by the Quassel IRC Team * + * Copyright (C) 2005-08 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -21,30 +21,40 @@ #define _BUFFERINFO_H_ #include +#include "types.h" class QString; class QDataStream; class BufferInfo { public: - BufferInfo(); - BufferInfo(uint id, uint networkid, uint gid = 0, QString net = QString(), QString buf = QString()); + enum Type { + InvalidBuffer = 0x00, + StatusBuffer = 0x01, + ChannelBuffer = 0x02, + QueryBuffer = 0x04, + GroupBuffer = 0x08 + }; - inline uint uid() const { return _id; } - inline uint networkId() const { return _netid; } - inline uint groupId() const { return _gid; } - inline QString network() const { return _networkName; } - QString buffer() const; + BufferInfo(); + BufferInfo(BufferId id, NetworkId networkid, Type type, uint gid = 0, QString buf = QString()); + + inline bool isValid() const { return _bufferId != 0; } + inline BufferId bufferId() const { return _bufferId; } + inline NetworkId networkId() const { return _netid; } + inline Type type() const { return _type; } + inline uint groupId() const { return _groupId; } + QString bufferName() const; - void setGroupId(uint gid) { _gid = gid; } + void setGroupId(uint gid) { _groupId = gid; } - inline bool operator==(const BufferInfo &other) const { return _id == other._id; } + inline bool operator==(const BufferInfo &other) const { return _bufferId == other._bufferId; } private: - uint _id; - uint _netid; - uint _gid; - QString _networkName; // WILL BE REMOVED + BufferId _bufferId; + NetworkId _netid; + Type _type; + uint _groupId; QString _bufferName; friend uint qHash(const BufferInfo &);