X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fserverinfo.h;fp=src%2Fcore%2Fserverinfo.h;h=22421ec11b07930cec7af3b270b7d94b18b51aef;hb=cfbd7e0ec3624307cfb612fe4804d58c34b7eec9;hp=0000000000000000000000000000000000000000;hpb=82c333488067c4aa77dee07f27818c47ecaf10fe;p=quassel.git diff --git a/src/core/serverinfo.h b/src/core/serverinfo.h new file mode 100644 index 00000000..22421ec1 --- /dev/null +++ b/src/core/serverinfo.h @@ -0,0 +1,84 @@ +/*************************************************************************** + * Copyright (C) 2005/06 by The Quassel Team * + * devel@quassel-irc.org * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef _SERVERINFO_H_ +#define _SERVERINFO_H_ + +#include +#include +#include + +#include "global.h" +#include "ircuser.h" + +class ServerInfo : public QObject { + Q_OBJECT + + Q_PROPERTY(QString networkname READ networkname WRITE setNetworkname) + Q_PROPERTY(QString currentServer READ currentServer WRITE setCurrentServer) + Q_PROPERTY(QString ownNick READ ownNick WRITE setOwnNick) + Q_PROPERTY(QList ircUsers READ ircUsers) + +public: + ServerInfo(QObject *parent = 0); + ~ServerInfo(); + + void setNetworkname(const QString &networkname); + QString networkname() const; + + void setCurrentServer(const QString ¤tServer); + QString currentServer() const; + + void setOwnNick(const QString &ownnick); + QString ownNick() const; + + QList ircUsers() const; + IrcUser *newIrcUser(const QString &hostmask); + IrcUser *ircUser(const QString &nickname) const; + + void setTopics(const QHash &topics); + QHash topics() const; + + void updateTopic(const QString &channel, const QString &topic); + QString topic(const QString &channel) const; + + void setSupports(const QHash &supports); + QHash supports() const; + QString supports(const QString &feature) const; + + bool isOwnNick(const QString &nick) const; + bool isOwnNick(const IrcUser &ircuser) const; + +private: + QString networkname_; + QString currentServer_; + QString ownNick_; + + //VarMap networkSettings; + //VarMap identity; + + QHash ircUsers_; // stores all known nicks for the server + QHash topics_; // stores topics for each buffer + QHash supports_; // stores results from RPL_ISUPPORT +}; + +struct UnsupportedFeatureException : public Exception {}; + +#endif