X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fnetworkinfo.h;h=eb2b287a253f8252d9521f70a79198eb71d03cff;hp=f767603d67b38098bd73c92f6762cbf0745ae45e;hb=8699dd758516d0ded076811e8ea656adc95e69d0;hpb=99445d2c7ce2f5336798098963f4954eaafebdde diff --git a/src/common/networkinfo.h b/src/common/networkinfo.h index f767603d..eb2b287a 100644 --- a/src/common/networkinfo.h +++ b/src/common/networkinfo.h @@ -1,11 +1,11 @@ /*************************************************************************** - * Copyright (C) 2005/06 by The Quassel 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 * * 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. * + * (at your option) version 3. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * @@ -28,6 +28,8 @@ #include #include +#include "types.h" + class SignalProxy; class IrcUser; class IrcChannel; @@ -44,12 +46,12 @@ public: NetworkInfo(const uint &networkid, QObject *parent = 0); //virtual ~NetworkInfo(); - uint networkId() const; + NetworkId networkId() const; bool initialized() const; SignalProxy *proxy() const; void setProxy(SignalProxy *proxy); - + bool isMyNick(const QString &nick) const; bool isMyNick(IrcUser *ircuser) const; @@ -59,7 +61,7 @@ public: QString prefixToMode(const QCharRef &prefix); QString modeToPrefix(const QString &mode); QString modeToPrefix(const QCharRef &mode); - + QString networkName() const; QString currentServer() const; QString myNick() const; @@ -71,15 +73,30 @@ public: bool supports(const QString ¶m) const; QString support(const QString ¶m) const; - + IrcUser *newIrcUser(const QString &hostmask); - IrcUser *ircUser(const QString &nickname) const; + IrcUser *newIrcUser(const QByteArray &hostmask); + IrcUser *ircUser(QString nickname) const; + IrcUser *ircUser(const QByteArray &nickname) const; QList ircUsers() const; - + IrcChannel *newIrcChannel(const QString &channelname); - IrcChannel *ircChannel(const QString &channelname); + IrcChannel *newIrcChannel(const QByteArray &channelname); + IrcChannel *ircChannel(QString channelname); + IrcChannel *ircChannel(const QByteArray &channelname); + QList ircChannels() const; + QTextCodec *codecForEncoding() const; + QTextCodec *codecForDecoding() const; + void setCodecForEncoding(const QString &codecName); + void setCodecForEncoding(QTextCodec *codec); + void setCodecForDecoding(const QString &codecName); + void setCodecForDecoding(QTextCodec *codec); + + QString decodeString(const QByteArray &text) const; + QByteArray encodeString(const QString string) const; + public slots: void setNetworkName(const QString &networkName); void setCurrentServer(const QString ¤tServer); @@ -106,11 +123,12 @@ public slots: // these slots are to keep the hashlists of all users and the // channel lists up to date void ircUserNickChanged(QString newnick); + void setInitialized(); +private slots: void ircUserDestroyed(); void channelDestroyed(); - - void setInitialized(); + void removeIrcUser(IrcUser *ircuser); signals: void networkNameSet(const QString &networkName); @@ -149,6 +167,10 @@ private: QPointer _proxy; void determinePrefixes(); + + QTextCodec *_codecForEncoding; + QTextCodec *_codecForDecoding; + }; #endif