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 ***************************************************************************/
26 #include <QStringList>
27 #include <QVariantMap>
33 class IrcUser : public QObject {
36 Q_PROPERTY(QString user READ user WRITE setUser STORED false)
37 Q_PROPERTY(QString host READ host WRITE setHost STORED false)
38 Q_PROPERTY(QString nick READ nick WRITE setNick STORED false)
40 Q_PROPERTY(QStringList channels READ channels STORED false)
41 // Q_PROPERTY(QStringList usermodes READ usermodes WRITE setUsermodes)
45 IrcUser(const QString &hostmask, NetworkInfo *networkInfo);
47 bool initialized() const;
52 QString hostmask() const;
54 QString userModes() const;
56 QStringList channels() const;
58 void updateObjectName();
61 void setUser(const QString &user);
62 void setHost(const QString &host);
63 void setNick(const QString &nick);
64 void updateHostmask(const QString &mask);
66 void setUserModes(const QString &modes);
68 void joinChannel(const QString &channel);
69 void partChannel(const QString &channel);
71 void addUserMode(const QString &mode);
72 void removeUserMode(const QString &mode);
75 void initSetChannels(const QStringList channels);
77 void setInitialized();
80 void userSet(QString user);
81 void hostSet(QString host);
82 void nickSet(QString newnick);
83 void hostmaskUpdated(QString mask);
85 void channelsSet(QStringList channels);
86 void userModesSet(QString modes);
88 void channelJoined(QString channel);
89 void channelParted(QString channel);
91 void userModeAdded(QString mode);
92 void userModeRemoved(QString mode);
96 // void setUsermodes(const QSet<QString> &usermodes);
97 // QSet<QString> usermodes() const;
102 inline bool operator==(const IrcUser &ircuser2) {
103 return (_nick.toLower() == ircuser2.nick().toLower());
106 inline bool operator==(const QString &nickname) {
107 return (_nick.toLower() == nickname.toLower());
116 QSet<QString> _channels;
119 NetworkInfo *networkInfo;