• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

messagelist

  • MessageList
  • Core
  • Theme
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
MessageList::Core::Theme Class Reference

#include <theme.h>

Inheritance diagram for MessageList::Core::Theme:
Inheritance graph
[legend]

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  ViewHeaderPolicy { ShowHeaderAlways, NeverShowHeader }
 

Public Member Functions

 Theme ()
 
 Theme (const QString &name, const QString &description, bool readOnly=false)
 
 Theme (const Theme &src)
 
 ~Theme ()
 
void addColumn (Column *column)
 
Column * column (int idx) const
 
const QList< Column * > & columns () const
 
void detach ()
 
const QColor & groupHeaderBackgroundColor () const
 
GroupHeaderBackgroundMode groupHeaderBackgroundMode () const
 
GroupHeaderBackgroundStyle groupHeaderBackgroundStyle () const
 
int iconSize () const
 
void insertColumn (int idx, Column *column)
 
void moveColumn (int idx, int newPosition)
 
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 ()
 
 OptionSet (const OptionSet &src)
 
 OptionSet (const QString &name, const QString &description, bool readOnly=false)
 
virtual ~OptionSet ()
 
const QString & description () const
 
void generateUniqueId ()
 
const QString & id () const
 
bool loadFromString (const QString &data)
 
const QString & name () 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

virtual bool load (QDataStream &stream)
 
virtual void save (QDataStream &stream) const
 

Additional Inherited Members

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

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

Member Enumeration Documentation

enum MessageList::Core::Theme::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 881 of file theme.h.

enum MessageList::Core::Theme::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 891 of file theme.h.

enum MessageList::Core::Theme::ViewHeaderPolicy

How do we manage the QHeaderView attacched to our View ?

Enumerator
ShowHeaderAlways 
NeverShowHeader 

Definition at line 906 of file theme.h.

Constructor & Destructor Documentation

Theme::Theme ( )
explicit

Creates a totally uninitialized theme object.

Definition at line 681 of file theme.cpp.

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

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

Theme::~Theme ( )

Destroys this theme object.

Definition at line 713 of file theme.cpp.

Member Function Documentation

void MessageList::Core::Theme::addColumn ( Column *  column)
inline

Appends a column to this theme.

Definition at line 959 of file theme.h.

Column* MessageList::Core::Theme::column ( int  idx) const
inline

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

Definition at line 946 of file theme.h.

const QList< Column * >& MessageList::Core::Theme::columns ( ) const
inline

Returns the list of columns available in this theme.

Definition at line 940 of file theme.h.

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

Definition at line 872 of file theme.h.

void Theme::detach ( )

Detaches this object from the shared runtime data for columns.

Definition at line 718 of file theme.cpp.

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

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

const QColor& MessageList::Core::Theme::groupHeaderBackgroundColor ( ) const
inline

Returns the group header background color for this theme.

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

Definition at line 989 of file theme.h.

GroupHeaderBackgroundMode MessageList::Core::Theme::groupHeaderBackgroundMode ( ) const
inline

Returns the group header background mode for this theme.

Definition at line 976 of file theme.h.

GroupHeaderBackgroundStyle MessageList::Core::Theme::groupHeaderBackgroundStyle ( ) const
inline

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

int MessageList::Core::Theme::iconSize ( ) const
inline

Returns the currently set icon size.

Definition at line 1037 of file theme.h.

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

Inserts a column to this theme at the specified position.

Definition at line 749 of file theme.cpp.

bool Theme::load ( QDataStream &  stream)
protectedvirtual

Pure virtual reimplemented from OptionSet.

Implements MessageList::Core::OptionSet.

Definition at line 803 of file theme.cpp.

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

Definition at line 759 of file theme.cpp.

void Theme::removeAllColumns ( )

Removes all columns from this theme.

Definition at line 743 of file theme.cpp.

void MessageList::Core::Theme::removeColumn ( Column *  col)
inline

Removes the specified message row.

The row is NOT deleted.

Definition at line 970 of file theme.h.

void Theme::resetColumnSizes ( )

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

Definition at line 735 of file theme.cpp.

void Theme::resetColumnState ( )

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

Definition at line 725 of file theme.cpp.

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

Pure virtual reimplemented from OptionSet.

Implements MessageList::Core::OptionSet.

Definition at line 905 of file theme.cpp.

void MessageList::Core::Theme::setGroupHeaderBackgroundColor ( const QColor &  clr)
inline

Sets the group header background color for this theme.

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

Definition at line 996 of file theme.h.

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

void MessageList::Core::Theme::setGroupHeaderBackgroundStyle ( GroupHeaderBackgroundStyle  groupHeaderBackgroundStyle)
inline

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

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

void MessageList::Core::Theme::setViewHeaderPolicy ( ViewHeaderPolicy  vhp)
inline

Sets the ViewHeaderPolicy for this theme.

Definition at line 1031 of file theme.h.

ViewHeaderPolicy MessageList::Core::Theme::viewHeaderPolicy ( ) const
inline

Returns the currently set ViewHeaderPolicy.

Definition at line 1025 of file theme.h.


The documentation for this class was generated from the following files:
  • theme.h
  • theme.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:32 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

messagelist

Skip menu "messagelist"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal