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

messagelist

  • MessageList
  • Core
  • ThemeDelegate
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
MessageList::Core::ThemeDelegate Class Referenceabstract

#include <themedelegate.h>

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

Public Member Functions

 ThemeDelegate (QAbstractItemView *parent)
 
 ~ThemeDelegate ()
 
const Theme::Column * hitColumn () const
 
int hitColumnIndex () const
 
const Theme::ContentItem * hitContentItem () const
 
QRect hitContentItemRect () const
 
bool hitContentItemRight () const
 
const QModelIndex & hitIndex () const
 
Item * hitItem () const
 
QRect hitItemRect () const
 
const Theme::Row * hitRow () const
 
int hitRowIndex () const
 
bool hitRowIsMessageRow () const
 
QRect hitRowRect () const
 
bool hitTest (const QPoint &viewportPoint, bool exact=true)
 
void setTheme (const Theme *theme)
 
QSize sizeHintForItemTypeAndColumn (Item::Type type, int column, const Item *item=0) const
 
const Theme * theme () const
 

Static Public Member Functions

static QFont itemFont (const Theme::ContentItem *ci, const Item *item)
 
static QString itemFontKey (const Theme::ContentItem *ci, const Item *item)
 

Protected Member Functions

virtual Item * itemFromIndex (const QModelIndex &index) const =0
 
void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
 
QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const
 

Detailed Description

The ThemeDelegate paints the message list view message and group items by using the supplied Theme.

Definition at line 45 of file themedelegate.h.

Constructor & Destructor Documentation

ThemeDelegate::ThemeDelegate ( QAbstractItemView *  parent)
explicit

Definition at line 50 of file themedelegate.cpp.

ThemeDelegate::~ThemeDelegate ( )

Definition at line 58 of file themedelegate.cpp.

Member Function Documentation

const Theme::Column* MessageList::Core::ThemeDelegate::hitColumn ( ) const
inline

Returns the theme column that was reported as hit by the previous call to hitTest().

The result of this function is valid only if hitTest() returned true and only within the same calling function.

Definition at line 125 of file themedelegate.h.

int MessageList::Core::ThemeDelegate::hitColumnIndex ( ) const
inline

Returns the index of the theme column that was reported as hit by the previous call to hitTest().

The result of this function is valid only if hitTest() returned true and only within the same calling function. This is the same as hitIndex().column().

Definition at line 134 of file themedelegate.h.

const Theme::ContentItem* MessageList::Core::ThemeDelegate::hitContentItem ( ) const
inline

Returns the theme content item that was reported as hit by the previous call to hitTest().

The result of this function is valid only if hitTest() returned true and only within the same calling function. This function may also return a null content item when hitTest() returned true. This means that the item was globally hit but no content item was exactly hit (the user might have clicked inside a blank unused space instead).

Definition at line 177 of file themedelegate.h.

QRect MessageList::Core::ThemeDelegate::hitContentItemRect ( ) const
inline

Returns the bounding rect of the content item that was reported as hit by the previous call to hitTest().

The result of this function is valid only if hitTest() returned true and only within the same calling function. The result of this function is to be considered invalid also when hitContentItem() returns 0.

Definition at line 193 of file themedelegate.h.

bool MessageList::Core::ThemeDelegate::hitContentItemRight ( ) const
inline

Returns true if the hit theme content item was a right item and false otherwise.

The result of this function is valid only if hitContentItem() returns true.

Definition at line 184 of file themedelegate.h.

const QModelIndex& MessageList::Core::ThemeDelegate::hitIndex ( ) const
inline

Returns the model index that was reported as hit by the previous call to hitTest().

The result of this function is valid only if hitTest() returned true and only within the same calling function.

Definition at line 100 of file themedelegate.h.

Item* MessageList::Core::ThemeDelegate::hitItem ( ) const
inline

Returns the Item that was reported as hit by the previous call to hitTest().

The result of this function is valid only if hitTest() returned true and only within the same calling function.

Definition at line 108 of file themedelegate.h.

QRect MessageList::Core::ThemeDelegate::hitItemRect ( ) const
inline

Returns the visual rectangle of the item that was reported as hit by the previous call to hitTest().

The result of this function is valid only if hitTest() returned true and only within the same calling function. Please note that this rectangle refers to a specific item column (and not all of the columns).

Definition at line 117 of file themedelegate.h.

const Theme::Row* MessageList::Core::ThemeDelegate::hitRow ( ) const
inline

Returns the theme row that was reported as hit by the previous call to hitTest().

The result of this function is valid only if hitTest() returned true and only within the same calling function. This function may also return a null row when hitTest() returned true. This means that the item was globally hit but no row was exactly hit (the user probably hit the margin instead).

Definition at line 144 of file themedelegate.h.

int MessageList::Core::ThemeDelegate::hitRowIndex ( ) const
inline

Returns the index of the theme row that was reported as hit by the previous call to hitTest().

The result of this function is valid only if hitRow() returns a non null value.

Definition at line 151 of file themedelegate.h.

bool MessageList::Core::ThemeDelegate::hitRowIsMessageRow ( ) const
inline

Returns true if the hitRow() is a message row, false otherwise.

The result of this function has a meaning only if hitRow() returns a non zero result.

Definition at line 167 of file themedelegate.h.

QRect MessageList::Core::ThemeDelegate::hitRowRect ( ) const
inline

Returns the rectangle of the row that was reported as hit by the previous call to hitTest().

The result of this function is valid only if hitTest() returned true and only within the same calling function. The result of this function is also invalid if hitRow() returns 0.

Definition at line 160 of file themedelegate.h.

bool ThemeDelegate::hitTest ( const QPoint &  viewportPoint,
bool  exact = true 
)

Performs a hit test on the specified viewport point.

Returns true if the point hit something and false otherwise. When the hit test is succesfull then the hitIndex(), hitItem(), hitColumn(), hitRow(), and hitContentItem() function will return information about the item that was effectively hit. If exact is set to true then hitTest() will return true only if the viewportPoint is exactly over an item. If exact is set to false then the hitTest() function will do its best to find the closest object to be actually "hit": this is useful, for example, in drag and drop operations.

Definition at line 1173 of file themedelegate.cpp.

QFont ThemeDelegate::itemFont ( const Theme::ContentItem *  ci,
const Item *  item 
)
static

return the font to paint given item with, checking global kmail settings and theme settings

Definition at line 1662 of file themedelegate.cpp.

QString ThemeDelegate::itemFontKey ( const Theme::ContentItem *  ci,
const Item *  item 
)
static

return the font key to paint given item with, checking global kmail settings and theme settings

Definition at line 1683 of file themedelegate.cpp.

virtual Item* MessageList::Core::ThemeDelegate::itemFromIndex ( const QModelIndex &  index) const
protectedpure virtual

Returns the Item for the specified model index.

Pure virtual: must be reimplemented by derived classes.

Implemented in MessageList::Utils::ThemePreviewDelegate, and MessageList::Core::Delegate.

void ThemeDelegate::paint ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
protected

Reimplemented from QStyledItemDelegate.

Definition at line 550 of file themedelegate.cpp.

void ThemeDelegate::setTheme ( const Theme *  theme)

Definition at line 62 of file themedelegate.cpp.

QSize ThemeDelegate::sizeHint ( const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
protected

Reimplemented from QStyledItemDelegate.

Definition at line 1645 of file themedelegate.cpp.

QSize ThemeDelegate::sizeHintForItemTypeAndColumn ( Item::Type  type,
int  column,
const Item *  item = 0 
) const

Returns a heuristic sizeHint() for the specified item type and column.

The hint is based on the contents of the theme (and not of any message or group header).

Definition at line 1592 of file themedelegate.cpp.

const Theme* MessageList::Core::ThemeDelegate::theme ( ) const
inline

Definition at line 73 of file themedelegate.h.


The documentation for this class was generated from the following files:
  • themedelegate.h
  • themedelegate.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