X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fircchannel.h;h=a499b24cdf5c314f12be74fdb9608eaaf83cd6e0;hp=40ed3fbf864cc0707bc93f7f70da50a5be3a2b87;hb=0b881e26eb5d741effae4a8096b319c9f5bcd462;hpb=0ff076706c3d353ec9b098b1eca270195288774e diff --git a/src/common/ircchannel.h b/src/common/ircchannel.h index 40ed3fbf..a499b24c 100644 --- a/src/common/ircchannel.h +++ b/src/common/ircchannel.h @@ -1,11 +1,11 @@ /*************************************************************************** - * Copyright (C) 2005/06 by The Quassel Team * + * Copyright (C) 2005/06 by the Quassel IRC 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. * + * (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 * @@ -26,18 +26,19 @@ #include #include -class SignalProxy; -class NetworkInfo; class IrcUser; +class NetworkInfo; +class SignalProxy; class IrcChannel : public QObject { Q_OBJECT - + Q_PROPERTY(QString name READ name STORED false) Q_PROPERTY(QString topic READ topic WRITE setTopic STORED false) public: IrcChannel(const QString &channelname, NetworkInfo *networkInfo); + ~IrcChannel(); bool isKnownUser(IrcUser *ircuser) const; bool isValidChannelUserMode(const QString &mode) const; @@ -46,14 +47,23 @@ public: QString name() const; QString topic() const; - + QList ircUsers() const; - - QString userMode(IrcUser *ircuser) const; - QString userMode(const QString &nick) const; + QString userModes(IrcUser *ircuser) const; + QString userModes(const QString &nick) 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); -public slots: + QString decodeString(const QByteArray &text) const; + QByteArray encodeString(const QString string) const; + +public slots: void setTopic(const QString &topic); void join(IrcUser *ircuser); @@ -64,10 +74,10 @@ public slots: void setUserModes(IrcUser *ircuser, const QString &modes); void setUserModes(const QString &nick, const QString &modes); - + void addUserMode(IrcUser *ircuser, const QString &mode); void addUserMode(const QString &nick, const QString &mode); - + void removeUserMode(IrcUser *ircuser, const QString &mode); void removeUserMode(const QString &nick, const QString &mode); @@ -76,28 +86,42 @@ public slots: // init seters void initSetUserModes(const QVariantMap &usermodes); - + void setInitialized(); signals: void topicSet(QString topic); void userModesSet(QString nick, QString modes); + //void userModesSet(IrcUser *ircuser, QString modes); void userModeAdded(QString nick, QString mode); + //void userModeAdded(IrcUser *ircuser, QString mode); void userModeRemoved(QString nick, QString mode); + //void userModeRemoved(IrcUser *ircuser, QString mode); + + void ircUserJoined(IrcUser *ircuser); + void ircUserParted(IrcUser *ircuser); + void ircUserNickSet(IrcUser *ircuser, QString nick); + void ircUserModeAdded(IrcUser *ircuser, QString mode); + void ircUserModeRemoved(IrcUser *ircuser, QString mode); + void ircUserModesSet(IrcUser *ircuser, QString modes); void initDone(); private slots: void ircUserDestroyed(); + void ircUserNickSet(QString nick); private: bool _initialized; QString _name; QString _topic; - QHash _userModes; - + QHash _userModes; + NetworkInfo *networkInfo; + + QTextCodec *_codecForEncoding; + QTextCodec *_codecForDecoding; }; #endif