X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fuistyle.h;h=2a098da1f16f1d7804ebb8c59a93cce1b769fff0;hp=b87e2211eaa939f77d89553812ccdc7fae33a315;hb=900cce213a6ed000b7131a05a0dec7d04b35b023;hpb=5e4bfcea8cf62cded326d385acd47528c1974b09 diff --git a/src/uisupport/uistyle.h b/src/uisupport/uistyle.h index b87e2211..2a098da1 100644 --- a/src/uisupport/uistyle.h +++ b/src/uisupport/uistyle.h @@ -20,6 +20,8 @@ #pragma once +#include "uisupport-export.h" + #include #include @@ -38,14 +40,14 @@ #include "networkmodel.h" #include "settings.h" -class UiStyle : public QObject +class UISUPPORT_EXPORT UiStyle : public QObject { Q_OBJECT Q_ENUMS(SenderPrefixModes) public: - UiStyle(QObject *parent = 0); - virtual ~UiStyle(); + UiStyle(QObject *parent = nullptr); + ~UiStyle() override; //! This enumerates the possible formats a text element may have. */ /** These formats are ordered on increasing importance, in cases where a given property is specified @@ -105,7 +107,9 @@ public: None = 0x00000000, OwnMsg = 0x00000001, Highlight = 0x00000002, - Selected = 0x00000004 // must be last! + Selected = 0x00000004, + Hovered = 0x00000008, + Last = Hovered }; enum class ItemFormatType : quint32 { @@ -164,11 +168,7 @@ public: }; /// Display of sender prefix modes -#if QT_VERSION >= 0x050000 enum class SenderPrefixMode { -#else - enum SenderPrefixMode { -#endif NoModes = 0, ///< Hide sender modes HighestMode = 1, ///< Show the highest active sender mode AllModes = 2 ///< Show all active sender modes @@ -298,8 +298,8 @@ protected: /** * Cache the system locale timestamp format string * - * Based on whether or not AM/PM designators are used in the QLocale::system().timeFormat(), - * this extends the system locale timestamp format string to include seconds. + * Based on whether or not AM/PM designators are used in the QLocale.timeFormat(), this extends + * the application locale timestamp format string to include seconds. * * @see UiStyle::systemTimestampFormatString() */ @@ -367,7 +367,7 @@ private: }; -class UiStyle::StyledMessage : public Message +class UISUPPORT_EXPORT UiStyle::StyledMessage : public Message { Q_DECLARE_TR_FUNCTIONS(UiStyle::StyledMessage) @@ -391,34 +391,30 @@ private: mutable quint8 _senderHash; }; -#if QT_VERSION < 0x050000 -uint qHash(UiStyle::ItemFormatType key); -#else uint qHash(UiStyle::ItemFormatType key, uint seed); -#endif // ---- Operators for dealing with enums ---------------------------------------------------------- -UiStyle::FormatType operator|(UiStyle::FormatType lhs, UiStyle::FormatType rhs); -UiStyle::FormatType& operator|=(UiStyle::FormatType &lhs, UiStyle::FormatType rhs); -UiStyle::FormatType operator|(UiStyle::FormatType lhs, quint32 rhs); -UiStyle::FormatType& operator|=(UiStyle::FormatType &lhs, quint32 rhs); -UiStyle::FormatType operator&(UiStyle::FormatType lhs, UiStyle::FormatType rhs); -UiStyle::FormatType& operator&=(UiStyle::FormatType &lhs, UiStyle::FormatType rhs); -UiStyle::FormatType operator&(UiStyle::FormatType lhs, quint32 rhs); -UiStyle::FormatType& operator&=(UiStyle::FormatType &lhs, quint32 rhs); -UiStyle::FormatType& operator^=(UiStyle::FormatType &lhs, UiStyle::FormatType rhs); - -UiStyle::MessageLabel operator|(UiStyle::MessageLabel lhs, UiStyle::MessageLabel rhs); -UiStyle::MessageLabel& operator|=(UiStyle::MessageLabel &lhs, UiStyle::MessageLabel rhs); -UiStyle::MessageLabel operator&(UiStyle::MessageLabel lhs, quint32 rhs); -UiStyle::MessageLabel& operator&=(UiStyle::MessageLabel &lhs, UiStyle::MessageLabel rhs); +UISUPPORT_EXPORT UiStyle::FormatType operator|(UiStyle::FormatType lhs, UiStyle::FormatType rhs); +UISUPPORT_EXPORT UiStyle::FormatType& operator|=(UiStyle::FormatType &lhs, UiStyle::FormatType rhs); +UISUPPORT_EXPORT UiStyle::FormatType operator|(UiStyle::FormatType lhs, quint32 rhs); +UISUPPORT_EXPORT UiStyle::FormatType& operator|=(UiStyle::FormatType &lhs, quint32 rhs); +UISUPPORT_EXPORT UiStyle::FormatType operator&(UiStyle::FormatType lhs, UiStyle::FormatType rhs); +UISUPPORT_EXPORT UiStyle::FormatType& operator&=(UiStyle::FormatType &lhs, UiStyle::FormatType rhs); +UISUPPORT_EXPORT UiStyle::FormatType operator&(UiStyle::FormatType lhs, quint32 rhs); +UISUPPORT_EXPORT UiStyle::FormatType& operator&=(UiStyle::FormatType &lhs, quint32 rhs); +UISUPPORT_EXPORT UiStyle::FormatType& operator^=(UiStyle::FormatType &lhs, UiStyle::FormatType rhs); + +UISUPPORT_EXPORT UiStyle::MessageLabel operator|(UiStyle::MessageLabel lhs, UiStyle::MessageLabel rhs); +UISUPPORT_EXPORT UiStyle::MessageLabel& operator|=(UiStyle::MessageLabel &lhs, UiStyle::MessageLabel rhs); +UISUPPORT_EXPORT UiStyle::MessageLabel operator&(UiStyle::MessageLabel lhs, quint32 rhs); +UISUPPORT_EXPORT UiStyle::MessageLabel& operator&=(UiStyle::MessageLabel &lhs, UiStyle::MessageLabel rhs); // Shifts the label into the upper half of the return value -quint64 operator|(UiStyle::FormatType lhs, UiStyle::MessageLabel rhs); +UISUPPORT_EXPORT quint64 operator|(UiStyle::FormatType lhs, UiStyle::MessageLabel rhs); -UiStyle::ItemFormatType operator|(UiStyle::ItemFormatType lhs, UiStyle::ItemFormatType rhs); -UiStyle::ItemFormatType& operator|=(UiStyle::ItemFormatType &lhs, UiStyle::ItemFormatType rhs); +UISUPPORT_EXPORT UiStyle::ItemFormatType operator|(UiStyle::ItemFormatType lhs, UiStyle::ItemFormatType rhs); +UISUPPORT_EXPORT UiStyle::ItemFormatType& operator|=(UiStyle::ItemFormatType &lhs, UiStyle::ItemFormatType rhs); // ---- Allow for FormatList in QVariant ----------------------------------------------------------