X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fircuser.h;h=176e36ee7482dfbfd7290315ea9f6a9fe307fe48;hp=e933fb61fc6081252ec23cc14a1a78bf2bf4fb79;hb=56607f81246f04db3a0e71c9a8757d7f75d6cfcf;hpb=27be9c5a706bf690921617bf66614c4479550c4d diff --git a/src/common/ircuser.h b/src/common/ircuser.h index e933fb61..176e36ee 100644 --- a/src/common/ircuser.h +++ b/src/common/ircuser.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-07 by the Quassel IRC 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 * @@ -25,45 +25,78 @@ #include #include #include +#include + +#include "syncableobject.h" class SignalProxy; -class NetworkInfo; +class Network; class IrcChannel; -class IrcUser : public QObject { +class IrcUser : public SyncableObject { Q_OBJECT Q_PROPERTY(QString user READ user WRITE setUser STORED false) Q_PROPERTY(QString host READ host WRITE setHost STORED false) Q_PROPERTY(QString nick READ nick WRITE setNick STORED false) + Q_PROPERTY(QString realName READ realName WRITE setRealName STORED false) + Q_PROPERTY(bool away READ isAway WRITE setAway STORED false) + Q_PROPERTY(QString awayMessage READ awayMessage WRITE setAwayMessage STORED false) + Q_PROPERTY(QDateTime idleTime READ idleTime WRITE setIdleTime STORED false) + Q_PROPERTY(QString server READ server WRITE setServer STORED false) + Q_PROPERTY(QString ircOperator READ ircOperator WRITE setIrcOperator STORED false) + Q_PROPERTY(int lastAwayMessage READ lastAwayMessage WRITE setLastAwayMessage STORED false) Q_PROPERTY(QStringList channels READ channels STORED false) // Q_PROPERTY(QStringList usermodes READ usermodes WRITE setUsermodes) - public: - IrcUser(const QString &hostmask, NetworkInfo *networkInfo); + IrcUser(const QString &hostmask, Network *network); virtual ~IrcUser(); - bool initialized() const; - QString user() const; QString host() const; QString nick() const; + QString realName() const; QString hostmask() const; + bool isAway() const; + QString awayMessage() const; + QDateTime idleTime() const; + QString server() const; + QString ircOperator() const; + int lastAwayMessage() const; + Network *network() const; QString userModes() const; QStringList channels() const; + // user-specific encodings + 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 setUser(const QString &user); void setHost(const QString &host); void setNick(const QString &nick); + void setRealName(const QString &realName); + void setAway(const bool &away); + void setAwayMessage(const QString &awayMessage); + void setIdleTime(const QDateTime &idleTime); + void setServer(const QString &server); + void setIrcOperator(const QString &ircOperator); + void setLastAwayMessage(const int &lastAwayMessage); void updateHostmask(const QString &mask); void setUserModes(const QString &modes); - + void joinChannel(IrcChannel *channel); void joinChannel(const QString &channelname); void partChannel(IrcChannel *channel); @@ -75,33 +108,34 @@ public slots: // init seters void initSetChannels(const QStringList channels); - void setInitialized(); - signals: void userSet(QString user); void hostSet(QString host); void nickSet(QString newnick); + void realNameSet(QString realName); + void awaySet(bool away); + void awayMessageSet(QString awayMessage); + void idleTimeSet(QDateTime idleTime); + void serverSet(QString server); + void ircOperatorSet(QString ircOperator); + void lastAwayMessageSet(int lastAwayMessage); void hostmaskUpdated(QString mask); - + void userModesSet(QString modes); - - void channelJoined(QString channel); + + // void channelJoined(QString channel); void channelParted(QString channel); void userModeAdded(QString mode); void userModeRemoved(QString mode); - void renameObject(QString oldname, QString newname); - // void setUsermodes(const QSet &usermodes); // QSet usermodes() const; - void initDone(); - private slots: void updateObjectName(); void channelDestroyed(); - + private: inline bool operator==(const IrcUser &ircuser2) { return (_nick.toLower() == ircuser2.nick().toLower()); @@ -116,12 +150,22 @@ private: QString _nick; QString _user; QString _host; - + QString _realName; + QString _awayMessage; + bool _away; + QString _server; + QDateTime _idleTime; + QString _ircOperator; + int _lastAwayMessage; + // QSet _channels; QSet _channels; QString _userModes; - - NetworkInfo *networkInfo; + + Network *_network; + + QTextCodec *_codecForEncoding; + QTextCodec *_codecForDecoding; }; #endif