X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fuistyle.h;h=3bb1a45bf0feec7a45b6155caee44aca25f962a2;hp=2aae59b09edd689f46d64ba3d5a87aeacada2a04;hb=f824db0e31b54969e0b7fa0b5405b1e9173d482c;hpb=850f5ae9b96c609f70cdb565bb19054131487714 diff --git a/src/uisupport/uistyle.h b/src/uisupport/uistyle.h index 2aae59b0..3bb1a45b 100644 --- a/src/uisupport/uistyle.h +++ b/src/uisupport/uistyle.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel Project * + * Copyright (C) 2005-09 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -31,7 +31,7 @@ #include "settings.h" class UiStyle { - Q_DECLARE_TR_FUNCTIONS (UiStyle) + Q_DECLARE_TR_FUNCTIONS(UiStyle) public: UiStyle(const QString &settingsKey); @@ -122,11 +122,7 @@ class UiStyle { FormatList formatList; // starting pos, ftypes }; - struct StyledMessage { - StyledString timestamp; - StyledString sender; - StyledString contents; - }; + class StyledMessage; StyledString styleString(const QString &); StyledMessage styleMessage(const Message &); @@ -160,6 +156,30 @@ class UiStyle { QString _settingsKey; }; +class UiStyle::StyledMessage { + + public: + explicit StyledMessage(const Message &, UiStyle *style); + + QDateTime timestamp() const; + QString decoratedTimestamp() const; + QString sender() const; //!< Nickname (no decorations) for Plain and Notice, empty else + QString decoratedSender() const; + QString contents() const; + + FormatType timestampFormat() const; + FormatType senderFormat() const; + FormatList contentsFormatList() const; + + inline Message::Type type() const { return _msgType; } + + private: + StyledString _contents; + QDateTime _timestamp; + QString _sender; + Message::Type _msgType; +}; + QDataStream &operator<<(QDataStream &out, const UiStyle::FormatList &formatList); QDataStream &operator>>(QDataStream &in, UiStyle::FormatList &formatList);