X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Fuistyle.h;h=9b9365d47b2f999beb8f0b45ef7f80c2f9b921ca;hb=c639f2b13b485c0d158ee3857742eaf4d1fa4760;hp=22ade27a02ea7355617bee9e0aeddddef3faf53c;hpb=2c16b8e356817cb4a4bf7fcd59c0c7429b0100e1;p=quassel.git diff --git a/src/uisupport/uistyle.h b/src/uisupport/uistyle.h index 22ade27a..9b9365d4 100644 --- a/src/uisupport/uistyle.h +++ b/src/uisupport/uistyle.h @@ -32,11 +32,11 @@ #include "message.h" #include "settings.h" -class UiStyle { - Q_DECLARE_TR_FUNCTIONS(UiStyle) +class UiStyle : public QObject{ + Q_OBJECT public: - UiStyle(); + UiStyle(QObject *parent = 0); virtual ~UiStyle(); typedef QList > FormatList; @@ -114,12 +114,14 @@ public: QList toTextLayoutList(const FormatList &, int textLength, quint32 messageLabel = 0); -protected: +public slots: void loadStyleSheet(); - //! Determines the format set to be used for the given hostmask - //int formatSetIndex(const QString &hostmask) const; - //int formatSetIndexForSelf() const; +signals: + void changed(); + +protected: + QString loadStyleSheet(const QString &name, bool shouldExist = false); QTextCharFormat cachedFormat(quint64 key) const; QTextCharFormat cachedFormat(quint32 formatType, quint32 messageLabel = 0) const; @@ -148,6 +150,9 @@ public: inline FormatType timestampFormat() const { return UiStyle::Timestamp; } FormatType senderFormat() const; const FormatList &contentsFormatList() const; + + quint8 senderHash() const; + protected: //! Styling is only needed for calls to plainContents() and contentsFormatList() void style() const; @@ -155,6 +160,7 @@ protected: private: mutable StyledString _contents; + mutable quint8 _senderHash; }; QDataStream &operator<<(QDataStream &out, const UiStyle::FormatList &formatList);