MessageList::Core::Theme

Search for usage in LXR

#include <theme.h>

Inheritance diagram for MessageList::Core::Theme:

Classes

class  Column
 
class  ContentItem
 
class  Row
 

Public Types

enum  GroupHeaderBackgroundMode { Transparent , AutoColor , CustomColor }
 
enum  GroupHeaderBackgroundStyle {
  PlainRect , PlainJoinedRect , RoundedRect , RoundedJoinedRect ,
  GradientRect , GradientJoinedRect , StyledRect , StyledJoinedRect
}
 
enum  ThemeIcon {
  IconNew , IconUnread , IconRead , IconDeleted ,
  IconReplied , IconRepliedAndForwarded , IconQueued , IconActionItem ,
  IconSent , IconForwarded , IconImportant , IconWatched ,
  IconIgnored , IconSpam , IconHam , IconFullySigned ,
  IconPartiallySigned , IconUndefinedSigned , IconNotSigned , IconFullyEncrypted ,
  IconPartiallyEncrypted , IconUndefinedEncrypted , IconNotEncrypted , IconAttachment ,
  IconAnnotation , IconInvitation , IconShowMore , IconShowLess ,
  IconVerticalLine , IconHorizontalSpacer , _IconCount
}
 
enum  ViewHeaderPolicy { ShowHeaderAlways , NeverShowHeader }
 

Public Member Functions

 Theme ()
 
 Theme (const QString &name, const QString &description, bool readOnly=false)
 
 Theme (const Theme &src)
 
 ~Theme () override
 
void addColumn (Column *column)
 
Columncolumn (int idx) const
 
const QList< Column * > & columns () const
 
void detach ()
 
const QColorgroupHeaderBackgroundColor () const
 
GroupHeaderBackgroundMode groupHeaderBackgroundMode () const
 
GroupHeaderBackgroundStyle groupHeaderBackgroundStyle () const
 
int iconSize () const
 
void insertColumn (int idx, Column *column)
 
void moveColumn (int idx, int newPosition)
 
const QPixmappixmap (ThemeIcon icon) const
 
void removeAllColumns ()
 
void removeColumn (Column *col)
 
void resetColumnSizes ()
 
void resetColumnState ()
 
void setGroupHeaderBackgroundColor (const QColor &clr)
 
void setGroupHeaderBackgroundMode (GroupHeaderBackgroundMode bm)
 
void setGroupHeaderBackgroundStyle (GroupHeaderBackgroundStyle groupHeaderBackgroundStyle)
 
void setIconSize (int iconSize)
 
void setViewHeaderPolicy (ViewHeaderPolicy vhp)
 
ViewHeaderPolicy viewHeaderPolicy () const
 
- Public Member Functions inherited from MessageList::Core::OptionSet
 OptionSet (const OptionSet &src)
 
 OptionSet (const QString &name, const QString &description, bool readOnly=false)
 
const QStringdescription () const
 
void generateUniqueId ()
 
const QStringid () const
 
bool loadFromString (const QString &data)
 
const QStringname () const
 
bool readOnly () const
 
QString saveToString () const
 
void setDescription (const QString &description)
 
void setName (const QString &name)
 
void setReadOnly (bool b)
 

Static Public Member Functions

static bool compareName (Theme *theme1, Theme *theme2)
 
static QList< QPair< QString, int > > enumerateGroupHeaderBackgroundStyles ()
 
static QList< QPair< QString, int > > enumerateViewHeaderPolicyOptions ()
 

Protected Member Functions

void clearPixmapCache () const
 
bool load (QDataStream &stream) override
 
void populatePixmapCache () const
 
void save (QDataStream &stream) const override
 
- Protected Member Functions inherited from MessageList::Core::OptionSet

Additional Inherited Members

- Protected Attributes inherited from MessageList::Core::OptionSet
QString mDescription
 
QString mId
 
QString mName
 
bool mReadOnly = false
 

Detailed Description

The Theme class defines the visual appearance of the MessageList.

The core structure of the theme is made up of Column objects which are mapped to View (QTreeView) columns. Each theme must provide at least one column.

Each column contains a set of Row objects dedicated to message items and a set of Row objects dedicated to group header items. There must be at least one message row and one group header row in each column. Rows are visually ordered from top to bottom.

Each Row contains a set of left aligned and a set of right aligned ContentItem objects. The right aligned items are painted from right to left while the left aligned ones are painted from left to right. In Right-To-Left mode the ThemeDelegate follows the exact opposite convention.

Each ContentItem object specifies a visual element to be displayed in a View row. The visual elements may be pieces of text (Subject, Date) or icons.

The Theme is designed to strictly interoperate with the ThemeDelegate class which takes care of rendering the contents when attached to an QAbstractItemView.

Definition at line 47 of file theme.h.

Member Enumeration Documentation

◆ GroupHeaderBackgroundMode

Which color do we use to paint group header background ?

Enumerator
Transparent 

No background at all: use style default.

AutoColor 

Automatically determine the color (somewhere in the middle between background and text)

CustomColor 

Use a custom color.

Definition at line 793 of file theme.h.

◆ GroupHeaderBackgroundStyle

How do we paint group header background ?

Enumerator
PlainRect 

One plain rect per column.

PlainJoinedRect 

One big plain rect for all the columns.

RoundedRect 

One rounded rect per column.

RoundedJoinedRect 

One big rounded rect for all the columns.

GradientRect 

One rounded gradient filled rect per column.

GradientJoinedRect 

One big rounded gradient rect for all the columns.

StyledRect 

One styled rect per column.

StyledJoinedRect 

One big styled rect per column.

Definition at line 802 of file theme.h.

◆ ThemeIcon

enum MessageList::Core::Theme::ThemeIcon

Definition at line 822 of file theme.h.

◆ ViewHeaderPolicy

How do we manage the QHeaderView attached to our View ?

Definition at line 816 of file theme.h.

Constructor & Destructor Documentation

◆ Theme() [1/3]

Theme::Theme ( )
explicit

Creates a totally uninitialized theme object.

Definition at line 891 of file theme.cpp.

◆ Theme() [2/3]

Theme::Theme ( const QString & name,
const QString & description,
bool readOnly = false )
explicit

Creates a theme object with the specified name and description.

Definition at line 900 of file theme.cpp.

◆ Theme() [3/3]

Theme::Theme ( const Theme & src)
explicit

Creates an exact copy of the theme sharing the same runtime data.

If you need an exact clone please use detach() and generateUniqueId() just after creation.

Definition at line 909 of file theme.cpp.

◆ ~Theme()

Theme::~Theme ( )
override

Destroys this theme object.

Definition at line 922 of file theme.cpp.

Member Function Documentation

◆ addColumn()

void Theme::addColumn ( Theme::Column * column)

Appends a column to this theme.

Definition at line 967 of file theme.cpp.

◆ clearPixmapCache()

void Theme::clearPixmapCache ( ) const
protected

Definition at line 1181 of file theme.cpp.

◆ column()

Theme::Column * Theme::column ( int idx) const

Returns a pointer to the column at the specified index or 0 if there is no such column.

Definition at line 955 of file theme.cpp.

◆ columns()

const QList< Theme::Column * > & Theme::columns ( ) const
nodiscard

Returns the list of columns available in this theme.

Definition at line 950 of file theme.cpp.

◆ compareName()

static bool MessageList::Core::Theme::compareName ( Theme * theme1,
Theme * theme2 )
inlinestatic

Definition at line 784 of file theme.h.

◆ detach()

void Theme::detach ( )

Detaches this object from the shared runtime data for columns.

Definition at line 928 of file theme.cpp.

◆ enumerateGroupHeaderBackgroundStyles()

QList< QPair< QString, int > > Theme::enumerateGroupHeaderBackgroundStyles ( )
static

Enumerates the available group header background styles.

The returned descriptors are pairs in that the first item is the localized description of the option value and the second item is the integer option value itself.

Definition at line 1032 of file theme.cpp.

◆ enumerateViewHeaderPolicyOptions()

QList< QPair< QString, int > > Theme::enumerateViewHeaderPolicyOptions ( )
static

Enumerates the available view header policy options.

The returned descriptors are pairs in that the first item is the localized description of the option value and the second item is the integer option value itself.

Definition at line 1027 of file theme.cpp.

◆ groupHeaderBackgroundColor()

const QColor & Theme::groupHeaderBackgroundColor ( ) const

Returns the group header background color for this theme.

This color is used only if groupHeaderBackgroundMode() is set to CustomColor.

Definition at line 1007 of file theme.cpp.

◆ groupHeaderBackgroundMode()

Theme::GroupHeaderBackgroundMode Theme::groupHeaderBackgroundMode ( ) const
nodiscard

Returns the group header background mode for this theme.

Definition at line 986 of file theme.cpp.

◆ groupHeaderBackgroundStyle()

Theme::GroupHeaderBackgroundStyle Theme::groupHeaderBackgroundStyle ( ) const
nodiscard

Returns the group header background style for this theme.

The group header background style makes sense only if groupHeaderBackgroundMode() is set to something different than Transparent.

Definition at line 1017 of file theme.cpp.

◆ iconSize()

int Theme::iconSize ( ) const
nodiscard

Returns the currently set icon size.

Definition at line 1054 of file theme.cpp.

◆ insertColumn()

void Theme::insertColumn ( int idx,
Column * column )

Inserts a column to this theme at the specified position.

Definition at line 972 of file theme.cpp.

◆ load()

bool Theme::load ( QDataStream & stream)
overrideprotectedvirtual

Pure virtual reimplemented from OptionSet.

Implements MessageList::Core::OptionSet.

Definition at line 1071 of file theme.cpp.

◆ moveColumn()

void Theme::moveColumn ( int idx,
int newPosition )

Definition at line 991 of file theme.cpp.

◆ pixmap()

const QPixmap * MessageList::Core::Theme::pixmap ( ThemeIcon icon) const
inline

Definition at line 989 of file theme.h.

◆ populatePixmapCache()

void Theme::populatePixmapCache ( ) const
protected

Definition at line 1187 of file theme.cpp.

◆ removeAllColumns()

void Theme::removeAllColumns ( )

Removes all columns from this theme.

Definition at line 960 of file theme.cpp.

◆ removeColumn()

void Theme::removeColumn ( Theme::Column * col)

Removes the specified message row.

The row is NOT deleted.

Definition at line 981 of file theme.cpp.

◆ resetColumnSizes()

void Theme::resetColumnSizes ( )

Resets the column sizes to "default" (subset of resetColumnState() above).

Definition at line 943 of file theme.cpp.

◆ resetColumnState()

void Theme::resetColumnState ( )

Resets the column state (visibility and width) to their default values (the "visible by default" ones).

Definition at line 935 of file theme.cpp.

◆ save()

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

Pure virtual reimplemented from OptionSet.

Implements MessageList::Core::OptionSet.

Definition at line 1162 of file theme.cpp.

◆ setGroupHeaderBackgroundColor()

void Theme::setGroupHeaderBackgroundColor ( const QColor & clr)

Sets the group header background color for this theme.

This color is used only if groupHeaderBackgroundMode() is set to CustomColor.

Definition at line 1012 of file theme.cpp.

◆ setGroupHeaderBackgroundMode()

void Theme::setGroupHeaderBackgroundMode ( GroupHeaderBackgroundMode bm)

Sets the group header background mode for this theme.

If you set it to CustomColor then please also setGroupHeaderBackgroundColor()

Definition at line 999 of file theme.cpp.

◆ setGroupHeaderBackgroundStyle()

void Theme::setGroupHeaderBackgroundStyle ( Theme::GroupHeaderBackgroundStyle groupHeaderBackgroundStyle)

Sets the group header background style for this theme.

The group header background style makes sense only if groupHeaderBackgroundMode() is set to something different than Transparent.

Definition at line 1022 of file theme.cpp.

◆ setIconSize()

void Theme::setIconSize ( int iconSize)

Sets the icon size for this theme.

Please note that the function will not let you set insane values. The allowable range is [8,64]

Definition at line 1059 of file theme.cpp.

◆ setViewHeaderPolicy()

void Theme::setViewHeaderPolicy ( Theme::ViewHeaderPolicy vhp)

Sets the ViewHeaderPolicy for this theme.

Definition at line 1049 of file theme.cpp.

◆ viewHeaderPolicy()

Theme::ViewHeaderPolicy Theme::viewHeaderPolicy ( ) const
nodiscard

Returns the currently set ViewHeaderPolicy.

Definition at line 1044 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 4 2024 11:53:55 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.