1 /***************************************************************************
2 * Copyright (C) 2005-08 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 ***************************************************************************/
24 #include <QDataStream>
27 #include <QStringList>
31 class Identity : public QObject {
34 Q_PROPERTY(IdentityId identityId READ id STORED false)
35 Q_PROPERTY(QString identityName READ identityName WRITE setIdentityName STORED false)
36 Q_PROPERTY(QString realName READ realName WRITE setRealName STORED false)
37 Q_PROPERTY(QStringList nicks READ nicks WRITE setNicks STORED false)
38 Q_PROPERTY(QString awayNick READ awayNick WRITE setAwayNick STORED false)
39 Q_PROPERTY(QString awayReason READ awayReason WRITE setAwayReason STORED false)
40 Q_PROPERTY(QString returnMessage READ returnMessage WRITE setReturnMessage STORED false)
44 Identity(IdentityId id = -1, QObject *parent = 0);
45 Identity(const Identity &other, QObject *parent = 0);
48 IdentityId id() const;
49 QString identityName() const;
50 QString realName() const;
51 QStringList nicks() const;
52 QString awayNick() const;
53 QString awayReason() const;
54 QString returnMessage() const;
56 bool initialized() const;
57 void setInitialized();
60 void setIdentityName(const QString &name);
61 void setRealName(const QString &realName);
62 void setNicks(const QStringList &nicks);
63 void setAwayNick(const QString &awayNick);
64 void setAwayReason(const QString &awayReason);
65 void setReturnMessage(const QString &returnMessage);
67 void update(const Identity &other);
70 void identityNameSet(const QString &name);
71 void realNameSet(const QString &realName);
72 void nicksSet(const QStringList &nicks);
73 void awayNickSet(const QString &awayNick);
74 void awayReasonSet(const QString &awayReason);
75 void returnMessageSet(const QString &returnMessage);
79 IdentityId _identityId;
80 QString _identityName, _realName;
82 QString _awayNick, _awayReason, _returnMessage;
86 friend QDataStream &operator>>(QDataStream &in, Identity &identity);
89 QDataStream &operator<<(QDataStream &out, const Identity &identity);
90 QDataStream &operator>>(QDataStream &in, Identity &identity);
92 Q_DECLARE_METATYPE(Identity);