MessageList::Core::Theme::ContentItem

Search for usage in LXR

MessageList::Core::Theme::ContentItem Class Reference

#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 QColorcustomColor () 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.

Definition at line 55 of file theme.h.

Member Enumeration Documentation

◆ Flags

Enumerator
HideWhenDisabled 

In disabled state the icon should take no space (overrides SoftenByBlendingWhenDisabled)

SoftenByBlendingWhenDisabled 

In disabled state the icon should be still shown, but made very soft by alpha blending.

UseCustomColor 

For text and vertical line. If set then always use a custom color, otherwise use default text color.

IsBold 

For text items. If set then always show as bold, otherwise use the default font weight.

IsItalic 

Fot text items. If set then always show as italic, otherwise use the default font style.

SoftenByBlending 

For text items: use 60% opacity.

Definition at line 210 of file theme.h.

◆ Type

The available ContentItem types.

Note that the values in this enum are unique values or'ed with the TypePropertyBits above.

Enumerator
Subject 

Display the subject of the message item.

This is a long text.

Date 

Formatted date time of the message/group.

SenderOrReceiver 

From: or To: strip, depending on the folder settings.

Sender 

From: strip, always.

Receiver 

To: strip, always.

Size 

Formatted size of the message.

ReadStateIcon 

The icon that displays the unread/read state (never disabled)

AttachmentStateIcon 

The icon that displays the attachment state (may be disabled)

RepliedStateIcon 

The icon that displays the replied/forwarded state (may be disabled)

GroupHeaderLabel 

The group header label.

ActionItemStateIcon 

The ActionItem state icon.

May be disabled. Clickable (cycles todo->nothing)

ImportantStateIcon 

The Important tag icon.

May be disabled. Clickable (cycles important->nothing)

SpamHamStateIcon 

The Spam/Ham state icon.

May be disabled. Clickable (cycles spam->ham->nothing)

WatchedIgnoredStateIcon 

The Watched/Ignored state icon.

May be disabled. Clickable (cycles watched->ignored->nothing)

ExpandedStateIcon 

The Expanded state icon for group headers.

May be disabled. Clickable (expands/collapses the group)

EncryptionStateIcon 

The Encryption state icon for messages.

May be disabled (no encryption).

SignatureStateIcon 

The Signature state icon for messages.

May be disabled (no signature)

VerticalLine 

A vertical separation line.

HorizontalSpacer 

A small empty spacer usable as separator.

MostRecentDate 

The date of the most recent message in subtree.

CombinedReadRepliedStateIcon 

The combined icon that displays the unread/read/replied/forwarded state (never disabled)

TagList 

The list of MessageItem::Tag entries.

InvitationIcon 

Whether the message is an invitation.

Folder 

Folder of the message.

Definition at line 106 of file theme.h.

Constructor & Destructor Documentation

◆ ContentItem() [1/2]

Theme::ContentItem::ContentItem ( Type type)
explicit

Creates a ContentItem with the specified type.

A content item must be added to a theme Row.

Definition at line 52 of file theme.cpp.

◆ ContentItem() [2/2]

Theme::ContentItem::ContentItem ( const ContentItem & src)
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()

bool Theme::ContentItem::applicableToGroupHeaderItems ( Type type)
staticnodiscard

Static test that returns true if an instance of ContentItem with the specified type makes sense in a Row for group header items.

Definition at line 280 of file theme.cpp.

◆ applicableToMessageItems()

bool Theme::ContentItem::applicableToMessageItems ( Type type)
staticnodiscard

Static test that returns true if an instance of ContentItem with the specified type makes sense in a Row for message items.

Definition at line 275 of file theme.cpp.

◆ canBeDisabled()

bool Theme::ContentItem::canBeDisabled ( ) const
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.

Definition at line 67 of file theme.cpp.

◆ canUseCustomColor()

bool Theme::ContentItem::canUseCustomColor ( ) const
nodiscard

Returns true if this ContentItem can make use of a custom color.

Definition at line 72 of file theme.cpp.

◆ customColor()

const QColor & Theme::ContentItem::customColor ( ) const
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.

Definition at line 265 of file theme.cpp.

◆ description()

QString Theme::ContentItem::description ( Type type)
staticnodiscard

Returns a descriptive name for the specified content item type.

Definition at line 102 of file theme.cpp.

◆ displaysLongText()

bool Theme::ContentItem::displaysLongText ( ) const
nodiscard

Returns true if this item displays a long text.

The returned value makes sense only if displaysText() returned true.

Definition at line 82 of file theme.cpp.

◆ displaysText()

bool Theme::ContentItem::displaysText ( ) const
nodiscard

Returns true if this item displays some kind of text.

Items that display text make use of the customFont() setting.

Definition at line 77 of file theme.cpp.

◆ hideWhenDisabled()

bool Theme::ContentItem::hideWhenDisabled ( ) const
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.

Definition at line 223 of file theme.cpp.

◆ isBold()

bool Theme::ContentItem::isBold ( ) const
nodiscard

Returns true if this item uses a bold text.

The return value of this function is valid only if displaysText() returns true.

Definition at line 195 of file theme.cpp.

◆ isClickable()

bool Theme::ContentItem::isClickable ( ) const
nodiscard

Returns true if clicking on this kind of item can perform an action.

Definition at line 92 of file theme.cpp.

◆ isIcon()

bool Theme::ContentItem::isIcon ( ) const
nodiscard

Returns true if this item displays an icon.

Definition at line 87 of file theme.cpp.

◆ isItalic()

bool Theme::ContentItem::isItalic ( ) const
nodiscard

Returns true if this item uses an italic text.

The return value of this function is valid only if displaysText() returns true.

Definition at line 209 of file theme.cpp.

◆ isSpacer()

bool Theme::ContentItem::isSpacer ( ) const
nodiscard

Returns true if this item is a small spacer.

Definition at line 97 of file theme.cpp.

◆ load()

bool Theme::ContentItem::load ( QDataStream & stream,
int themeVersion )

Handles content item loading (used by Theme::Row::load())

Definition at line 292 of file theme.cpp.

◆ save()

void Theme::ContentItem::save ( QDataStream & stream) const

Handles content item saving (used by Theme::Row::save())

Definition at line 285 of file theme.cpp.

◆ setBold()

void Theme::ContentItem::setBold ( bool isBold)

Makes this item use a bold font.

Definition at line 200 of file theme.cpp.

◆ 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 )

Definition at line 270 of file theme.cpp.

◆ 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.

Definition at line 228 of file theme.cpp.

◆ setItalic()

void Theme::ContentItem::setItalic ( bool isItalic)

Makes this item use italic font.

Definition at line 214 of file theme.cpp.

◆ setSoftenByBlending()

void Theme::ContentItem::setSoftenByBlending ( bool softenByBlending)

Sets the flag that causes this item to be painted "softly".

Meaningful only for text items.

Definition at line 256 of file theme.cpp.

◆ 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.

Definition at line 242 of file theme.cpp.

◆ 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.

Definition at line 186 of file theme.cpp.

◆ softenByBlending()

bool Theme::ContentItem::softenByBlending ( ) const
nodiscard

Returns true if this item should be always painted in a "soft" fashion.

Meaningful only for text items.

Definition at line 251 of file theme.cpp.

◆ softenByBlendingWhenDisabled()

bool Theme::ContentItem::softenByBlendingWhenDisabled ( ) const
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.

Definition at line 237 of file theme.cpp.

◆ type()

Theme::ContentItem::Type Theme::ContentItem::type ( ) const
nodiscard

Returns the type of this content item.

Definition at line 62 of file theme.cpp.

◆ useCustomColor()

bool Theme::ContentItem::useCustomColor ( ) const
nodiscard

Returns true if this item uses a custom color.

The return value of this function is valid only if canUseCustomColor() returns true.

Definition at line 181 of file theme.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
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.