1 /***************************************************************************
2 * Copyright (C) 2005 by The Quassel Team *
3 * devel@quassel-irc.org *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
24 /** The protocol version we use fo the communication between core and GUI */
25 #define GUI_PROTOCOL 3
27 #define BACKLOG_FORMAT 2
28 #define BACKLOG_STRING "QuasselIRC Backlog File"
30 #define DEFAULT_PORT 4242
37 /* Some global stuff */
43 enum RunMode { Monolithic, ClientOnly, CoreOnly };
44 extern RunMode runMode;
45 extern QString quasselDir;
49 Exception(QString msg = "Unknown Exception") : _msg(msg) {};
50 virtual ~Exception() {}; // make gcc happy
51 virtual inline QString msg() { return _msg; }
61 BufferId(uint _id, uint _networkid, uint _gid = 0, QString _net = QString(), QString _buf = QString());
63 inline uint uid() const { return _id; }
64 inline uint networkId() const { return _netid; }
65 inline uint groupId() const { return _gid; }
66 inline QString network() const { return _networkName; }
67 QString buffer() const;
69 void setGroupId(uint gid) { _gid = gid; }
71 inline bool operator==(const BufferId &other) const { return _id == other._id; }
77 QString _networkName; // WILL BE REMOVED
78 QString _bufferName; // IS this actually needed?
80 friend uint qHash(const BufferId &);
81 friend QDataStream &operator<<(QDataStream &out, const BufferId &bufferId);
82 friend QDataStream &operator>>(QDataStream &in, BufferId &bufferId);
85 QDataStream &operator<<(QDataStream &out, const BufferId &bufferId);
86 QDataStream &operator>>(QDataStream &in, BufferId &bufferId);
88 Q_DECLARE_METATYPE(BufferId);
90 uint qHash(const BufferId &);