X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fnetworkmodel.h;h=c3577f4c1dcc847b1e7deee0de2d133f5af9eb04;hp=f2342e8f632da82dc311d649ed0efe31e7af5c2b;hb=54ead1bace1c9306ccfd5ebd7fb7bbd0c9843db7;hpb=0a43227b8cd44625f4881cc1545d42c8c8a4876c diff --git a/src/client/networkmodel.h b/src/client/networkmodel.h index f2342e8f..c3577f4c 100644 --- a/src/client/networkmodel.h +++ b/src/client/networkmodel.h @@ -45,6 +45,19 @@ public : virtual QVariant data(int column, int row) const; + /** + * Escapes a string as HTML, ready for Qt markup. + * + * Implementation depends on Qt version - Qt4 uses Qt::escape, while Qt5 uses .toHtmlEscaped(). + * + * @param[in] string QString to escape + * @param[in] useNonbreakingSpaces + * @parblock + * If true, replace spaces with non-breaking spaces (i.e. ' '), otherwise only HTML escape. + * @endparblock + */ + static QString escapeHTML(const QString &string, bool useNonbreakingSpaces = false); + inline bool isActive() const { return (bool)_network ? _network->isConnected() : false; } inline const NetworkId &networkId() const { return _networkId; } @@ -118,6 +131,8 @@ public : void setActivityLevel(BufferInfo::ActivityLevel level); void clearActivityLevel(); void updateActivityLevel(const Message &msg); + void setActivity(Message::Types msg, bool highlight); + bool addActivity(Message::Types msg, bool highlight); inline const MsgId &firstUnreadMsgId() const { return _firstUnreadMsgId; } @@ -200,6 +215,14 @@ public: void attachIrcChannel(IrcChannel *ircChannel); + /** + * Gets the list of channel modes for a given nick. + * + * @param[in] nick IrcUser nickname to check + * @returns Channel modes as a string if any, otherwise empty string + */ + QString nickChannelModes(const QString &nick) const; + public slots: void join(const QList &ircUsers); void part(IrcUser *ircUser); @@ -266,6 +289,13 @@ public : virtual QVariant data(int column, int role) const; virtual QString toolTip(int column) const; + /** + * Gets the list of channel modes for this nick if parented to channel. + * + * @returns Channel modes as a string if any, otherwise empty string + */ + QString channelModes() const; + private slots: inline void ircUserQuited() { parent()->removeChild(this); } @@ -355,6 +385,7 @@ public slots: void clearBufferActivity(const BufferId &bufferId); void updateBufferActivity(Message &msg); void networkRemoved(const NetworkId &networkId); + void bufferActivityChanged(BufferId, Message::Types); signals: void requestSetLastSeenMsg(BufferId buffer, MsgId msg);