1 /***************************************************************************
2 * Copyright (C) 2005/06 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 ***************************************************************************/
21 #ifndef _SERVERINFO_H_
22 #define _SERVERINFO_H_
31 class ServerInfo : public QObject {
34 Q_PROPERTY(QString networkname READ networkname WRITE setNetworkname)
35 Q_PROPERTY(QString currentServer READ currentServer WRITE setCurrentServer)
36 Q_PROPERTY(QString ownNick READ ownNick WRITE setOwnNick)
37 Q_PROPERTY(QList<IrcUser *> ircUsers READ ircUsers)
40 ServerInfo(QObject *parent = 0);
43 void setNetworkname(const QString &networkname);
44 QString networkname() const;
46 void setCurrentServer(const QString ¤tServer);
47 QString currentServer() const;
49 void setOwnNick(const QString &ownnick);
50 QString ownNick() const;
52 QList<IrcUser *> ircUsers() const;
53 IrcUser *newIrcUser(const QString &hostmask);
54 IrcUser *ircUser(const QString &nickname) const;
56 void setTopics(const QHash<QString, QString> &topics);
57 QHash<QString, QString> topics() const;
59 void updateTopic(const QString &channel, const QString &topic);
60 QString topic(const QString &channel) const;
62 void setSupports(const QHash<QString, QString> &supports);
63 QHash<QString, QString> supports() const;
64 QString supports(const QString &feature) const;
66 bool isOwnNick(const QString &nick) const;
67 bool isOwnNick(const IrcUser &ircuser) const;
71 QString currentServer_;
74 //QVariantMap networkSettings;
75 //QVariantMap identity;
77 QHash<QString, IrcUser *> ircUsers_; // stores all known nicks for the server
78 QHash<QString, QString> topics_; // stores topics for each buffer
79 QHash<QString, QString> supports_; // stores results from RPL_ISUPPORT
82 struct UnsupportedFeatureException : public Exception {};