1 /***************************************************************************
2 * Copyright (C) 2005/06 by the Quassel IRC 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) version 3. *
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 _IRCCHANNEL_H_
22 #define _IRCCHANNEL_H_
26 #include <QStringList>
27 #include <QVariantMap>
33 class IrcChannel : public QObject {
36 Q_PROPERTY(QString name READ name STORED false)
37 Q_PROPERTY(QString topic READ topic WRITE setTopic STORED false)
40 IrcChannel(const QString &channelname, NetworkInfo *networkInfo);
43 bool isKnownUser(IrcUser *ircuser) const;
44 bool isValidChannelUserMode(const QString &mode) const;
46 bool initialized() const;
49 QString topic() const;
51 QList<IrcUser *> ircUsers() const;
53 QString userModes(IrcUser *ircuser) const;
54 QString userModes(const QString &nick) const;
57 void setTopic(const QString &topic);
59 void join(IrcUser *ircuser);
60 void join(const QString &nick);
62 void part(IrcUser *ircuser);
63 void part(const QString &nick);
65 void setUserModes(IrcUser *ircuser, const QString &modes);
66 void setUserModes(const QString &nick, const QString &modes);
68 void addUserMode(IrcUser *ircuser, const QString &mode);
69 void addUserMode(const QString &nick, const QString &mode);
71 void removeUserMode(IrcUser *ircuser, const QString &mode);
72 void removeUserMode(const QString &nick, const QString &mode);
75 QVariantMap initUserModes() const;
78 void initSetUserModes(const QVariantMap &usermodes);
80 void setInitialized();
83 void topicSet(QString topic);
84 void userModesSet(QString nick, QString modes);
85 //void userModesSet(IrcUser *ircuser, QString modes);
86 void userModeAdded(QString nick, QString mode);
87 //void userModeAdded(IrcUser *ircuser, QString mode);
88 void userModeRemoved(QString nick, QString mode);
89 //void userModeRemoved(IrcUser *ircuser, QString mode);
91 void ircUserJoined(IrcUser *ircuser);
92 void ircUserParted(IrcUser *ircuser);
93 void ircUserNickSet(IrcUser *ircuser, QString nick);
94 void ircUserModeAdded(IrcUser *ircuser, QString mode);
95 void ircUserModeRemoved(IrcUser *ircuser, QString mode);
96 void ircUserModesSet(IrcUser *ircuser, QString modes);
101 void ircUserDestroyed();
102 void ircUserNickSet(QString nick);
109 QHash<IrcUser *, QString> _userModes;
111 NetworkInfo *networkInfo;