MessageList::Core::Theme::ContentItem

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, AnnotationIcon = 23 | ApplicableToMessageItems | IsIcon | CanBeDisabled | IsClickable, InvitationIcon = 24 | ApplicableToMessageItems | IsIcon,
  Folder = 25 | DisplaysText | CanUseCustomColor | ApplicableToMessageItems
}
 

Public Member Functions

 ContentItem (Type type)
 
 ContentItem (const ContentItem &src)
 
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

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 215 of file theme.h.

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.

AnnotationIcon 

Whether the message has a annotation/note.

InvitationIcon 

Whether the message is an invitation.

Folder 

Folder of the message.

Definition at line 106 of file theme.h.

Constructor & Destructor Documentation

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 53 of file theme.cpp.

Theme::ContentItem::ContentItem ( const ContentItem src)
explicit

Creates a ContentItem that is a copy of the content item src.

A content item must be added to a theme Row.

Definition at line 59 of file theme.cpp.

Member Function Documentation

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

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 286 of file theme.cpp.

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

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 281 of file theme.cpp.

bool Theme::ContentItem::canBeDisabled ( ) const

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 71 of file theme.cpp.

bool Theme::ContentItem::canUseCustomColor ( ) const

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

Definition at line 76 of file theme.cpp.

const QColor & Theme::ContentItem::customColor ( ) const

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 271 of file theme.cpp.

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

Returns a descriptive name for the specified content item type.

Definition at line 106 of file theme.cpp.

bool Theme::ContentItem::displaysLongText ( ) const

Returns true if this item displays a long text.

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

Definition at line 86 of file theme.cpp.

bool Theme::ContentItem::displaysText ( ) const

Returns true if this item displays some kind of text.

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

Definition at line 81 of file theme.cpp.

bool Theme::ContentItem::hideWhenDisabled ( ) const

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 229 of file theme.cpp.

bool Theme::ContentItem::isBold ( ) const

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 201 of file theme.cpp.

bool Theme::ContentItem::isClickable ( ) const

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

Definition at line 96 of file theme.cpp.

bool Theme::ContentItem::isIcon ( ) const

Returns true if this item displays an icon.

Definition at line 91 of file theme.cpp.

bool Theme::ContentItem::isItalic ( ) const

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 215 of file theme.cpp.

bool Theme::ContentItem::isSpacer ( ) const

Returns true if this item is a small spacer.

Definition at line 101 of file theme.cpp.

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

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

Definition at line 298 of file theme.cpp.

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

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

Definition at line 291 of file theme.cpp.

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

Makes this item use a bold font.

Definition at line 206 of file theme.cpp.

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 276 of file theme.cpp.

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 234 of file theme.cpp.

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

Makes this item use italic font.

Definition at line 220 of file theme.cpp.

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 262 of file theme.cpp.

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 248 of file theme.cpp.

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 192 of file theme.cpp.

bool Theme::ContentItem::softenByBlending ( ) const

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

Meaningful only for text items.

Definition at line 257 of file theme.cpp.

bool Theme::ContentItem::softenByBlendingWhenDisabled ( ) const

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 243 of file theme.cpp.

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

Returns the type of this content item.

Definition at line 66 of file theme.cpp.

bool Theme::ContentItem::useCustomColor ( ) const

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 187 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-2020 The KDE developers.
Generated on Sat Sep 19 2020 23:12:53 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.