X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=main%2Fglobal.h;h=a662fd77ed32f5927cccb3ba7f15dbe672111018;hb=6f8bb3747b3b7a4cc07a3bb9717e1222850adcfa;hp=1faf4d18e993841a0034d4404245cffd6e7d0aef;hpb=117a8a4d7ced61a3e374f20c74bea1834386a1d7;p=quassel.git diff --git a/main/global.h b/main/global.h index 1faf4d18..a662fd77 100644 --- a/main/global.h +++ b/main/global.h @@ -24,7 +24,7 @@ /** The protocol version we use fo the communication between core and GUI */ #define GUI_PROTOCOL 1 -#define BACKLOG_FORMAT 1 +#define BACKLOG_FORMAT 2 #define BACKLOG_STRING "QuasselIRC Backlog File" class Global; @@ -36,6 +36,9 @@ class Global; typedef QMap VarMap; extern Global *global; +typedef uint UserId; +typedef uint MsgId; + /** * This class is mostly a globally synchronized data store, meant for storing systemwide settings such * as identities or network lists. This class is a singleton, but not static as we'd like to use signals and @@ -93,4 +96,35 @@ class Exception { }; +class BufferId { + public: + BufferId() { id = gid = 0; } // FIXME + BufferId(uint uid, QString net, QString buf, uint gid = 0); + + inline uint uid() { return id; } + inline uint groupId() { return gid; } + inline QString network() { return net; } + QString buffer(); // nickfrommask? + + void setGroupId(uint _gid) { gid = _gid; } + + inline bool operator==(const BufferId &other) const { return id == other.id; } + private: + uint id; + uint gid; + QString net; + QString buf; + + friend uint qHash(const BufferId &); + friend QDataStream &operator<<(QDataStream &out, const BufferId &bufferId); + friend QDataStream &operator>>(QDataStream &in, BufferId &bufferId); +}; + +QDataStream &operator<<(QDataStream &out, const BufferId &bufferId); +QDataStream &operator>>(QDataStream &in, BufferId &bufferId); + +Q_DECLARE_METATYPE(BufferId); + +uint qHash(const BufferId &); + #endif