MessageList::Core::Theme::ContentItem
#include <theme.h>
Public Types | |
enum | Flags { HideWhenDisabled = 1 , SoftenByBlendingWhenDisabled = (1 << 1) , UseCustomColor = (1 << 2) , IsBold = (1 << 3) , IsItalic = (1 << 4) , SoftenByBlending = (1 << 5) } |
enum | Type { Subject = 1 | DisplaysText | CanUseCustomColor | ApplicableToMessageItems | LongText , Date = 2 | DisplaysText | CanUseCustomColor | ApplicableToMessageItems | ApplicableToGroupHeaderItems , SenderOrReceiver = 3 | DisplaysText | CanUseCustomColor | ApplicableToMessageItems , Sender = 4 | DisplaysText | CanUseCustomColor | ApplicableToMessageItems , Receiver = 5 | DisplaysText | CanUseCustomColor | ApplicableToMessageItems , Size = 6 | DisplaysText | CanUseCustomColor | ApplicableToMessageItems , ReadStateIcon = 7 | ApplicableToMessageItems | IsIcon , AttachmentStateIcon = 8 | CanBeDisabled | ApplicableToMessageItems | IsIcon , RepliedStateIcon = 9 | CanBeDisabled | ApplicableToMessageItems | IsIcon , GroupHeaderLabel = 10 | DisplaysText | CanUseCustomColor | ApplicableToGroupHeaderItems , ActionItemStateIcon = 11 | CanBeDisabled | ApplicableToMessageItems | IsIcon | IsClickable , ImportantStateIcon = 12 | CanBeDisabled | ApplicableToMessageItems | IsIcon | IsClickable , SpamHamStateIcon = 13 | CanBeDisabled | ApplicableToMessageItems | IsIcon | IsClickable , WatchedIgnoredStateIcon = 14 | CanBeDisabled | ApplicableToMessageItems | IsIcon | IsClickable , ExpandedStateIcon = 15 | CanBeDisabled | ApplicableToGroupHeaderItems | IsIcon | IsClickable , EncryptionStateIcon = 16 | CanBeDisabled | ApplicableToMessageItems | IsIcon , SignatureStateIcon = 17 | CanBeDisabled | ApplicableToMessageItems | IsIcon , VerticalLine = 18 | CanUseCustomColor | ApplicableToMessageItems | ApplicableToGroupHeaderItems | IsSpacer , HorizontalSpacer = 19 | ApplicableToMessageItems | ApplicableToGroupHeaderItems | IsSpacer , MostRecentDate = 20 | DisplaysText | CanUseCustomColor | ApplicableToMessageItems | ApplicableToGroupHeaderItems , CombinedReadRepliedStateIcon = 21 | ApplicableToMessageItems | IsIcon , TagList = 22 | ApplicableToMessageItems | IsIcon , InvitationIcon = 24 | ApplicableToMessageItems | IsIcon , Folder = 25 | DisplaysText | CanUseCustomColor | ApplicableToMessageItems } |
Public Member Functions | |
ContentItem (const ContentItem &src) | |
ContentItem (Type type) | |
bool | canBeDisabled () const |
bool | canUseCustomColor () const |
const QColor & | customColor () const |
bool | displaysLongText () const |
bool | displaysText () const |
bool | hideWhenDisabled () const |
bool | isBold () const |
bool | isClickable () const |
bool | isIcon () const |
bool | isItalic () const |
bool | isSpacer () const |
bool | load (QDataStream &stream, int themeVersion) |
void | save (QDataStream &stream) const |
void | setBold (bool isBold) |
void | setCustomColor (const QColor &clr) |
void | setHideWhenDisabled (bool hideWhenDisabled) |
void | setItalic (bool isItalic) |
void | setSoftenByBlending (bool softenByBlending) |
void | setSoftenByBlendingWhenDisabled (bool softenByBlendingWhenDisabled) |
void | setUseCustomColor (bool useCustomColor) |
bool | softenByBlending () const |
bool | softenByBlendingWhenDisabled () const |
Type | type () const |
bool | useCustomColor () const |
Static Public Member Functions | |
static bool | applicableToGroupHeaderItems (Type type) |
static bool | applicableToMessageItems (Type type) |
static QString | description (Type type) |
Detailed Description
The ContentItem class defines a content item inside a Row.
Content items are data items extracted from a message or a group header: they can be text, spacers, separators or icons.
Member Enumeration Documentation
◆ Flags
◆ Type
The available ContentItem types.
Note that the values in this enum are unique values or'ed with the TypePropertyBits above.
Constructor & Destructor Documentation
◆ ContentItem() [1/2]
|
explicit |
Creates a ContentItem with the specified type.
A content item must be added to a theme Row.
◆ ContentItem() [2/2]
|
explicitdefault |
Creates a ContentItem that is a copy of the content item src.
A content item must be added to a theme Row.
Member Function Documentation
◆ applicableToGroupHeaderItems()
|
staticnodiscard |
Static test that returns true if an instance of ContentItem with the specified type makes sense in a Row for group header items.
◆ applicableToMessageItems()
|
staticnodiscard |
Static test that returns true if an instance of ContentItem with the specified type makes sense in a Row for message items.
◆ canBeDisabled()
|
nodiscard |
Returns true if this ContentItem can be in a "disabled" state.
The attachment state icon, for example, can be disabled when the related message has no attachments. For such items the HideWhenDisabled and SoftenByBlendingWhenDisabled flags are meaningful.
◆ canUseCustomColor()
|
nodiscard |
Returns true if this ContentItem can make use of a custom color.
◆ customColor()
|
nodiscard |
Returns the custom color set for this item.
The return value is meaningful only if canUseCustomColor() returns true returns true and setUseCustomColor( true ) has been called.
◆ description()
◆ displaysLongText()
|
nodiscard |
Returns true if this item displays a long text.
The returned value makes sense only if displaysText() returned true.
◆ displaysText()
|
nodiscard |
◆ hideWhenDisabled()
|
nodiscard |
Returns true if this item should be hidden when in disabled state.
Hidden content items simply aren't painted and take no space. This flag has meaning only on items for that canBeDisabled() returns true.
◆ isBold()
|
nodiscard |
Returns true if this item uses a bold text.
The return value of this function is valid only if displaysText() returns true.
◆ isClickable()
|
nodiscard |
◆ isIcon()
|
nodiscard |
◆ isItalic()
|
nodiscard |
Returns true if this item uses an italic text.
The return value of this function is valid only if displaysText() returns true.
◆ isSpacer()
|
nodiscard |
◆ load()
bool Theme::ContentItem::load | ( | QDataStream & | stream, |
int | themeVersion ) |
Handles content item loading (used by Theme::Row::load())
◆ save()
void Theme::ContentItem::save | ( | QDataStream & | stream | ) | const |
Handles content item saving (used by Theme::Row::save())
◆ setBold()
void Theme::ContentItem::setBold | ( | bool | isBold | ) |
◆ setCustomColor()
void Theme::ContentItem::setCustomColor | ( | const QColor & | clr | ) |
Sets the custom color for this item.
Meaningful only if canUseCustomColor() returns true and you call setUseCustomColor( true )
◆ setHideWhenDisabled()
void Theme::ContentItem::setHideWhenDisabled | ( | bool | hideWhenDisabled | ) |
Sets the flag that causes this item to be hidden when disabled.
Hidden content items simply aren't painted and take no space. This flag overrides the setSoftenByBlendingWhenDisabled() setting. This flag has meaning only on items for that canBeDisabled() returns true.
◆ setItalic()
void Theme::ContentItem::setItalic | ( | bool | isItalic | ) |
◆ setSoftenByBlending()
void Theme::ContentItem::setSoftenByBlending | ( | bool | softenByBlending | ) |
◆ setSoftenByBlendingWhenDisabled()
void Theme::ContentItem::setSoftenByBlendingWhenDisabled | ( | bool | softenByBlendingWhenDisabled | ) |
Sets the flag that causes this item to be painted "softly" when disabled.
Soft icons are painted with very low opacity. This flag may be overridden by the setHideWhenDisabled() setting. This flag has meaning only on items for that canBeDisabled() returns true.
◆ setUseCustomColor()
void Theme::ContentItem::setUseCustomColor | ( | bool | useCustomColor | ) |
Makes this item use the custom color that can be set by setCustomColor().
The custom color is meaningful only if canUseCustomColor() returns true.
◆ softenByBlending()
|
nodiscard |
◆ softenByBlendingWhenDisabled()
|
nodiscard |
Returns true if this item should be painted in a "soft" fashion when in disabled state.
Soft icons are painted with very low opacity. This flag has meaning only on items for that canBeDisabled() returns true.
◆ type()
|
nodiscard |
◆ useCustomColor()
|
nodiscard |
Returns true if this item uses a custom color.
The return value of this function is valid only if canUseCustomColor() returns true.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:08:47 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.