messagelist
themedelegate.cpp
Go to the documentation of this file.
55 connect( KGlobalSettings::self(), SIGNAL(kdisplayFontChanged()), this, SLOT(slotGeneralFontChanged()) );
120 static inline void paint_right_aligned_elided_text( const QString &text, Theme::ContentItem * ci, QPainter * painter, int &left, int top, int &right, Qt::LayoutDirection layoutDir, const QFont &font )
125 const QString elidedText = fontMetrics.elidedText( text, layoutDir == Qt::LeftToRight ? Qt::ElideLeft : Qt::ElideRight, w );
133 painter->drawText( rct, Qt::AlignTop | Qt::AlignRight | Qt::TextSingleLine, elidedText, &outRct );
136 painter->drawText( rct, Qt::AlignTop | Qt::AlignRight | Qt::TextSingleLine, elidedText, &outRct );
144 static inline void compute_bounding_rect_for_right_aligned_elided_text( const QString &text, int &left, int top, int &right, QRect &outRect, Qt::LayoutDirection layoutDir, const QFont &font )
148 const QString elidedText = fontMetrics.elidedText( text, layoutDir == Qt::LeftToRight ? Qt::ElideLeft : Qt::ElideRight, w );
159 static inline void paint_left_aligned_elided_text( const QString &text, Theme::ContentItem * ci, QPainter * painter, int &left, int top, int &right, Qt::LayoutDirection layoutDir, const QFont &font )
164 const QString elidedText = fontMetrics.elidedText( text, layoutDir == Qt::LeftToRight ? Qt::ElideRight : Qt::ElideLeft, w );
171 painter->drawText( rct, Qt::AlignTop | Qt::AlignLeft | Qt::TextSingleLine, elidedText, &outRct );
174 painter->drawText( rct, Qt::AlignTop | Qt::AlignLeft | Qt::TextSingleLine, elidedText, &outRct );
182 static inline void compute_bounding_rect_for_left_aligned_elided_text( const QString &text, int &left, int top, int &right, QRect &outRect, Qt::LayoutDirection layoutDir, const QFont &font )
186 const QString elidedText = fontMetrics.elidedText( text, layoutDir == Qt::LeftToRight ? Qt::ElideRight : Qt::ElideLeft, w );
227 static inline const QPixmap * get_encryption_state_icon( MessageItem * messageItem, bool *treatAsEnabled )
257 static inline const QPixmap * get_signature_state_icon( MessageItem * messageItem, bool *treatAsEnabled )
319 static inline void paint_vertical_line( QPainter * painter, int &left, int top, int &right, int bottom, bool alignOnRight )
338 static inline void compute_bounding_rect_for_vertical_line( int &left, int top, int &right, int bottom, QRect &outRect, bool alignOnRight )
351 static inline void paint_horizontal_spacer( int &left, int, int &right, int, bool alignOnRight )
361 static inline void compute_bounding_rect_for_horizontal_spacer( int &left, int top, int &right, int bottom, QRect &outRect, bool alignOnRight )
442 static inline void compute_bounding_rect_for_boolean_state_icon( bool enabled, Theme::ContentItem * ci,
453 compute_bounding_rect_for_permanent_icon( ci, left, top, right, outRect, alignOnRight, iconSize );
456 static inline void paint_tag_list( const QList< MessageItem::Tag * > &tagList, QPainter * painter,
478 static inline void compute_bounding_rect_for_tag_list( const QList< MessageItem::Tag * > &tagList,
529 static inline QSize compute_size_hint_for_row( const Theme::Row * r, int iconSize, const Item *item )
539 compute_size_hint_for_item( const_cast< Theme::ContentItem * >( *itemit ), maxh, totalw, iconSize, item );
545 compute_size_hint_for_item( const_cast< Theme::ContentItem * >( *itemit ), maxh, totalw, iconSize, item );
550 void ThemeDelegate::paint( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const
587 int right = opt.rect.left() + opt.rect.width(); // don't use opt.rect.right() since it's screwed
647 QPalette::ColorGroup cg = opt.state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled;
678 int rleft = ( opt.viewItemPosition == QStyleOptionViewItemV4::Beginning ) || ( opt.viewItemPosition == QStyleOptionViewItemV4::OnlyOne ) ? left : opt.rect.left();
679 int rright = ( opt.viewItemPosition == QStyleOptionViewItemV4::End ) || ( opt.viewItemPosition == QStyleOptionViewItemV4::OnlyOne ) ? right : opt.rect.left() + opt.rect.width();
681 QRect( rleft, top, rright - rleft, opt.rect.height() - ( gGroupHeaderInnerVerticalMargin * 2 ) ),
691 QRect( opt.rect.left(), top, opt.rect.width(), opt.rect.height() - ( gGroupHeaderInnerVerticalMargin * 2 ) ),
699 QRect( opt.rect.left() + opt.rect.width() - 10, top, 10, opt.rect.height() - ( gGroupHeaderInnerVerticalMargin * 2 ) ),
705 QRect( opt.rect.left(), top, 10 , opt.rect.height() - ( gGroupHeaderInnerVerticalMargin * 2 ) ),
733 QLinearGradient gradient( 0, top, 0, top + opt.rect.height() - ( gGroupHeaderInnerVerticalMargin * 2 ) );
734 gradient.setColorAt( 0.0, KColorScheme::shade( mGroupHeaderBackgroundColor, KColorScheme::LightShade, 0.3 ) );
739 QRect( opt.rect.left(), top, opt.rect.width(), opt.rect.height() - ( gGroupHeaderInnerVerticalMargin * 2 ) ),
747 QRect( opt.rect.left() + opt.rect.width() - 10, top, 10, opt.rect.height() - ( gGroupHeaderInnerVerticalMargin * 2 ) ),
753 QRect( opt.rect.left(), top, 10 , opt.rect.height() - ( gGroupHeaderInnerVerticalMargin * 2 ) ),
762 QLinearGradient gradient( 0, top, 0, top + opt.rect.height() - ( gGroupHeaderInnerVerticalMargin * 2 ) );
763 gradient.setColorAt( 0.0, KColorScheme::shade( mGroupHeaderBackgroundColor, KColorScheme::LightShade, 0.3 ) );
785 opt.rect = QRect( left, top, right - left, opt.rect.height() - ( gGroupHeaderInnerVerticalMargin * 2 ) );
794 int rleft = ( opt.viewItemPosition == QStyleOptionViewItemV4::Beginning ) || ( opt.viewItemPosition == QStyleOptionViewItemV4::OnlyOne ) ? left : opt.rect.left();
795 int rright = ( opt.viewItemPosition == QStyleOptionViewItemV4::End ) || ( opt.viewItemPosition == QStyleOptionViewItemV4::OnlyOne ) ? right : opt.rect.left() + opt.rect.width();
796 opt.rect = QRect( rleft, top, rright - rleft, opt.rect.height() - ( gGroupHeaderInnerVerticalMargin * 2 ) );
833 for ( QList< Theme::ContentItem * >::ConstIterator itemit = items->constBegin(); itemit != endit ; ++itemit )
867 paint_right_aligned_elided_text( MessageCore::StringUtil::stripEmailAddr( item->senderOrReceiver() ),
879 paint_right_aligned_elided_text( item->formattedDate(), ci, painter, l, top, r, layoutDir, font );
882 paint_right_aligned_elided_text( item->formattedMaxDate(), ci, painter, l, top, r, layoutDir, font );
885 paint_right_aligned_elided_text( item->formattedSize(), ci, painter, l, top, r, layoutDir, font );
889 paint_right_aligned_elided_text( groupHeaderItem->label(), ci, painter, l, top, r, layoutDir, font );
902 const QPixmap * pix = item->childItemCount() > 0 ? ((option.state & QStyle::State_Open) ? Manager::instance()->pixmapShowLess() : Manager::instance()->pixmapShowMore()) : 0;
992 paint_tag_list( tagList, painter, l, top, r, layoutDir == Qt::LeftToRight, mTheme->iconSize() );
1002 for ( QList< Theme::ContentItem * >::ConstIterator itemit = items->constBegin(); itemit != endItem ; ++itemit )
1037 paint_left_aligned_elided_text( MessageCore::StringUtil::stripEmailAddr( item->senderOrReceiver() ),
1049 paint_left_aligned_elided_text( item->formattedDate(), ci, painter, l, top, r, layoutDir, font );
1052 paint_left_aligned_elided_text( item->formattedMaxDate(), ci, painter, l, top, r, layoutDir, font );
1055 paint_left_aligned_elided_text( item->formattedSize(), ci, painter, l, top, r, layoutDir, font );
1059 paint_left_aligned_elided_text( groupHeaderItem->label(), ci, painter, l, top, r, layoutDir, font );
1072 const QPixmap * pix = item->childItemCount() > 0 ? ((option.state & QStyle::State_Open) ? Manager::instance()->pixmapShowLess() : Manager::instance()->pixmapShowMore()) : 0;
1159 paint_tag_list( tagList, painter, l, top, r, layoutDir != Qt::LeftToRight, mTheme->iconSize() );
1251 break; // not this row (tough we should have already found it... probably clicked upper margin)
1292 compute_bounding_rect_for_right_aligned_elided_text( mHitItem->subject(), l, top, r, mHitContentItemRect, layoutDir, font );
1295 compute_bounding_rect_for_right_aligned_elided_text( MessageCore::StringUtil::stripEmailAddr( mHitItem->senderOrReceiver() ),
1299 compute_bounding_rect_for_right_aligned_elided_text( MessageCore::StringUtil::stripEmailAddr( mHitItem->receiver() ),
1303 compute_bounding_rect_for_right_aligned_elided_text( MessageCore::StringUtil::stripEmailAddr( mHitItem->sender() ),
1307 compute_bounding_rect_for_right_aligned_elided_text( mHitItem->formattedDate(), l, top, r, mHitContentItemRect, layoutDir, font );
1310 compute_bounding_rect_for_right_aligned_elided_text( mHitItem->formattedMaxDate(), l, top, r, mHitContentItemRect, layoutDir, font );
1313 compute_bounding_rect_for_right_aligned_elided_text( mHitItem->formattedSize(), l, top, r, mHitContentItemRect, layoutDir, font );
1317 compute_bounding_rect_for_right_aligned_elided_text( groupHeaderItem->label(), l, top, r, mHitContentItemRect, layoutDir, font );
1320 compute_bounding_rect_for_permanent_icon( ci, l, top, r, mHitContentItemRect, layoutDir == Qt::LeftToRight, mTheme->iconSize() );
1323 compute_bounding_rect_for_permanent_icon( ci, l, top, r, mHitContentItemRect, layoutDir == Qt::LeftToRight, mTheme->iconSize() );
1326 compute_bounding_rect_for_boolean_state_icon( mHitItem->childItemCount() > 0, ci, l, top, r, mHitContentItemRect, layoutDir == Qt::LeftToRight, mTheme->iconSize() );
1332 compute_bounding_rect_for_boolean_state_icon( pix != 0, ci, l, top, r, mHitContentItemRect, layoutDir == Qt::LeftToRight, mTheme->iconSize() );
1340 compute_bounding_rect_for_boolean_state_icon( enabled, ci, l, top, r, mHitContentItemRect, layoutDir == Qt::LeftToRight, mTheme->iconSize() );
1348 compute_bounding_rect_for_boolean_state_icon( enabled, ci, l, top, r, mHitContentItemRect, layoutDir == Qt::LeftToRight, mTheme->iconSize() );
1355 compute_bounding_rect_for_boolean_state_icon( pix != 0, ci, l, top, r, mHitContentItemRect, layoutDir == Qt::LeftToRight, mTheme->iconSize() );
1362 compute_bounding_rect_for_boolean_state_icon( pix != 0, ci, l, top, r, mHitContentItemRect, layoutDir == Qt::LeftToRight, mTheme->iconSize() );
1367 compute_bounding_rect_for_boolean_state_icon( messageItem->status().hasAttachment(), ci, l, top, r, mHitContentItemRect, layoutDir == Qt::LeftToRight, mTheme->iconSize() );
1371 compute_bounding_rect_for_boolean_state_icon( messageItem->hasAnnotation(), ci, l, top, r, mHitContentItemRect, layoutDir == Qt::LeftToRight, mTheme->iconSize() );
1375 compute_bounding_rect_for_boolean_state_icon( messageItem->status().hasInvitation(), ci, l, top, r, mHitContentItemRect, layoutDir == Qt::LeftToRight, mTheme->iconSize() );
1379 compute_bounding_rect_for_boolean_state_icon( messageItem->status().isToAct(), ci, l, top, r, mHitContentItemRect, layoutDir == Qt::LeftToRight, mTheme->iconSize() );
1383 compute_bounding_rect_for_boolean_state_icon( messageItem->status().isImportant(), ci, l, top, r, mHitContentItemRect, layoutDir == Qt::LeftToRight, mTheme->iconSize() );
1386 compute_bounding_rect_for_vertical_line( l, top, r, bottom, mHitContentItemRect, layoutDir == Qt::LeftToRight );
1389 compute_bounding_rect_for_horizontal_spacer( l, top, r, bottom, mHitContentItemRect, layoutDir == Qt::LeftToRight );
1395 compute_bounding_rect_for_tag_list( tagList, l, top, r, mHitContentItemRect, layoutDir == Qt::LeftToRight, mTheme->iconSize() );
1410 QRect inexactRect( mHitContentItemRect.left(), mHitRowRect.top(), mHitContentItemRect.width(), mHitRowRect.height() );
1417 int inexactDistance = viewportPoint.x() > inexactRect.right() ? viewportPoint.x() - inexactRect.right() : inexactRect.left() - viewportPoint.x();
1445 compute_bounding_rect_for_left_aligned_elided_text( mHitItem->subject(), l, top, r, mHitContentItemRect, layoutDir, font );
1448 compute_bounding_rect_for_left_aligned_elided_text( MessageCore::StringUtil::stripEmailAddr( mHitItem->senderOrReceiver() ),
1452 compute_bounding_rect_for_left_aligned_elided_text( MessageCore::StringUtil::stripEmailAddr( mHitItem->receiver() ),
1456 compute_bounding_rect_for_left_aligned_elided_text( MessageCore::StringUtil::stripEmailAddr( mHitItem->sender() ),
1460 compute_bounding_rect_for_left_aligned_elided_text( mHitItem->formattedDate(), l, top, r, mHitContentItemRect, layoutDir, font );
1463 compute_bounding_rect_for_left_aligned_elided_text( mHitItem->formattedMaxDate(), l, top, r, mHitContentItemRect, layoutDir, font );
1466 compute_bounding_rect_for_left_aligned_elided_text( mHitItem->formattedSize(), l, top, r, mHitContentItemRect, layoutDir, font );
1470 compute_bounding_rect_for_left_aligned_elided_text( groupHeaderItem->label(), l, top, r, mHitContentItemRect, layoutDir, font );
1473 compute_bounding_rect_for_permanent_icon( ci, l, top, r, mHitContentItemRect, layoutDir != Qt::LeftToRight, mTheme->iconSize() );
1476 compute_bounding_rect_for_permanent_icon( ci, l, top, r, mHitContentItemRect, layoutDir != Qt::LeftToRight, mTheme->iconSize() );
1479 compute_bounding_rect_for_boolean_state_icon( mHitItem->childItemCount() > 0, ci, l, top, r, mHitContentItemRect, layoutDir != Qt::LeftToRight, mTheme->iconSize() );
1485 compute_bounding_rect_for_boolean_state_icon( pix != 0, ci, l, top, r, mHitContentItemRect, layoutDir != Qt::LeftToRight, mTheme->iconSize() );
1493 compute_bounding_rect_for_boolean_state_icon( enabled, ci, l, top, r, mHitContentItemRect, layoutDir != Qt::LeftToRight, mTheme->iconSize() );
1501 compute_bounding_rect_for_boolean_state_icon( enabled, ci, l, top, r, mHitContentItemRect, layoutDir != Qt::LeftToRight, mTheme->iconSize() );
1508 compute_bounding_rect_for_boolean_state_icon( pix != 0, ci, l, top, r, mHitContentItemRect, layoutDir != Qt::LeftToRight, mTheme->iconSize() );
1515 compute_bounding_rect_for_boolean_state_icon( pix != 0, ci, l, top, r, mHitContentItemRect, layoutDir != Qt::LeftToRight, mTheme->iconSize() );
1520 compute_bounding_rect_for_boolean_state_icon( messageItem->status().hasAttachment(), ci, l, top, r, mHitContentItemRect, layoutDir != Qt::LeftToRight, mTheme->iconSize() );
1524 compute_bounding_rect_for_boolean_state_icon( messageItem->hasAnnotation(), ci, l, top, r, mHitContentItemRect, layoutDir != Qt::LeftToRight, mTheme->iconSize() );
1528 compute_bounding_rect_for_boolean_state_icon( messageItem->status().hasInvitation(), ci, l, top, r, mHitContentItemRect, layoutDir != Qt::LeftToRight, mTheme->iconSize() );
1532 compute_bounding_rect_for_boolean_state_icon( messageItem->status().isToAct(), ci, l, top, r, mHitContentItemRect, layoutDir != Qt::LeftToRight, mTheme->iconSize() );
1536 compute_bounding_rect_for_boolean_state_icon( messageItem->status().isImportant(), ci, l, top, r, mHitContentItemRect, layoutDir != Qt::LeftToRight, mTheme->iconSize() );
1539 compute_bounding_rect_for_vertical_line( l, top, r, bottom, mHitContentItemRect, layoutDir != Qt::LeftToRight );
1542 compute_bounding_rect_for_horizontal_spacer( l, top, r, bottom, mHitContentItemRect, layoutDir != Qt::LeftToRight );
1548 compute_bounding_rect_for_tag_list( tagList, l, top, r, mHitContentItemRect, layoutDir != Qt::LeftToRight, mTheme->iconSize() );
1563 QRect inexactRect( mHitContentItemRect.left(), mHitRowRect.top(), mHitContentItemRect.width(), mHitRowRect.height() );
1570 int inexactDistance = viewportPoint.x() > inexactRect.right() ? viewportPoint.x() - inexactRect.right() : inexactRect.left() - viewportPoint.x();
1592 QSize ThemeDelegate::sizeHintForItemTypeAndColumn( Item::Type type, int column, const Item *item ) const
1634 for ( QList< Theme::Row * >::ConstIterator rowit = rows->constBegin(), endRowIt = rows->constEnd(); rowit != endRowIt; ++rowit )
The ContentItem class defines a content item inside a Row.
Definition: theme.h:73
Whether the message is an invitation.
Definition: theme.h:223
const QPixmap * pixmapMessageIgnored() const
Definition: manager.h:146
const QPixmap * pixmapMessagePartiallyEncrypted() const
Definition: manager.h:162
const QPixmap * pixmapMessageSent() const
Definition: manager.h:138
void setOpacity(qreal opacity)
The Expanded state icon for group headers.
Definition: theme.h:186
static void paint_right_aligned_elided_text(const QString &text, Theme::ContentItem *ci, QPainter *painter, int &left, int top, int &right, Qt::LayoutDirection layoutDir, const QFont &font)
Definition: themedelegate.cpp:120
const QPixmap * pixmapMessageUnread() const
Definition: manager.h:124
void setBackgroundMode(Qt::BGMode mode)
static QFont itemFont(const Theme::ContentItem *ci, const Item *item)
return the font to paint given item with, checking global kmail settings and theme settings ...
Definition: themedelegate.cpp:1662
virtual void reset()
palette
iterator insert(const Key &key, const T &value)
The icon that displays the unread/read state (never disabled)
Definition: theme.h:154
int width() const
void fillRect(const QRectF &rectangle, const QBrush &brush)
static void paint_boolean_state_icon(bool enabled, const QPixmap *pix, Theme::ContentItem *ci, QPainter *painter, int &left, int top, int &right, bool alignOnRight, int iconSize)
Definition: themedelegate.cpp:410
void setRenderHint(RenderHint hint, bool on)
ThemeDelegate(QAbstractItemView *parent)
Definition: themedelegate.cpp:50
int right() const
static void compute_bounding_rect_for_vertical_line(int &left, int top, int &right, int bottom, QRect &outRect, bool alignOnRight)
Definition: themedelegate.cpp:338
static void compute_bounding_rect_for_boolean_state_icon(bool enabled, Theme::ContentItem *ci, int &left, int top, int &right, QRect &outRect, bool alignOnRight, int iconSize)
Definition: themedelegate.cpp:442
Definition: messageitem.h:46
const QList< ContentItem * > & rightItems() const
Returns the list of right aligned items for this row.
Definition: theme.h:513
RenderHints renderHints() const
const QString & label() const
Definition: groupheaderitem.cpp:35
const QPixmap * pixmapMessageForwarded() const
Definition: manager.h:140
const QPixmap * pixmapMessageUndefinedEncrypted() const
Definition: manager.h:164
virtual void initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const
void setColorAt(qreal position, const QColor &color)
const QString & senderOrReceiver() const
Returns the sender or the receiver, depending on the underlying StorageModel settings.
Definition: item.cpp:461
The combined icon that displays the unread/read/replied/forwarded state (never disabled) ...
Definition: theme.h:210
const QFont & font() const
static void compute_bounding_rect_for_horizontal_spacer(int &left, int top, int &right, int bottom, QRect &outRect, bool alignOnRight)
Definition: themedelegate.cpp:361
const QPixmap * pixmapMessageSpam() const
Definition: manager.h:148
QStyle * style() const
static QFontMetrics cachedFontMetrics(const QFont &font)
Definition: themedelegate.cpp:95
const QColor & color(ColorGroup group, ColorRole role) const
The Row class defines a row of items inside a Column.
Definition: theme.h:466
virtual QModelIndex indexAt(const QPoint &point) const =0
EncryptionState encryptionState() const
Definition: messageitem.cpp:438
const QPixmap * pixmapMessageNotEncrypted() const
Definition: manager.h:166
QString formattedSize() const
A string with a text rappresentation of size().
Definition: item.cpp:254
The icon that displays the atachment state (may be disabled)
Definition: theme.h:158
const QPixmap * pixmapMessageHam() const
Definition: manager.h:150
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Reimplemented from QStyledItemDelegate.
Definition: themedelegate.cpp:1645
int height() const
const QString & receiver() const
Returns the receiver associated to this item.
Definition: item.cpp:451
const QPixmap * pixmapMessageAnnotation() const
Definition: manager.h:170
const QString & subject() const
Returns the subject associated to this Item.
Definition: item.cpp:471
GroupHeaderBackgroundStyle groupHeaderBackgroundStyle() const
Returns the group header background style for this theme.
Definition: theme.h:1005
void drawLine(const QLineF &line)
bool displaysText() const
Returns true if this item displays some kind of text.
Definition: theme.h:286
static const int gGroupHeaderInnerVerticalMargin
Definition: themedelegate.cpp:43
const QPixmap * pixmapMessageAttachment() const
Definition: manager.h:168
The Important tag icon.
Definition: theme.h:174
bool hideWhenDisabled() const
Returns true if this item should be hidden when in disabled state.
Definition: theme.h:363
Whether the message has a annotation/note.
Definition: theme.h:218
static const QPixmap * get_read_state_icon(Item *item)
Definition: themedelegate.cpp:196
int x() const
int y() const
bool isValid() const
Returns true if this ModelInvariantIndex is valid, that is, it has been attacched to a ModelInvariant...
Definition: modelinvariantindex.cpp:42
static const int gGroupHeaderOuterVerticalMargin
Definition: themedelegate.cpp:41
The Column class defines a view column available inside this theme.
Definition: theme.h:565
const QPixmap * pixmapMessageFullySigned() const
Definition: manager.h:152
static QString itemFontKey(const Theme::ContentItem *ci, const Item *item)
return the font key to paint given item with, checking global kmail settings and theme settings ...
Definition: themedelegate.cpp:1683
QString formattedMaxDate() const
A string with a text rappresentation of maxDate() obtained via Manager.
Definition: item.cpp:267
static void compute_bounding_rect_for_permanent_icon(Theme::ContentItem *, int &left, int top, int &right, QRect &outRect, bool alignOnRight, int iconSize)
Definition: themedelegate.cpp:393
const QColor & customColor() const
Returns the custom color set for this item.
Definition: theme.h:437
const QList< Row * > & messageRows() const
Returns the list of rows visible in this column for a MessageItem.
Definition: theme.h:774
The icon that displays the replied/forwarded state (may be disabled)
Definition: theme.h:162
static const int gGroupHeaderInnerHorizontalMargin
Definition: themedelegate.cpp:44
QColor color() const
bool isValid() const
QRect boundingRect(QChar ch) const
void setFont(const QFont &font)
static QSize compute_size_hint_for_row(const Theme::Row *r, int iconSize, const Item *item)
Definition: themedelegate.cpp:529
const QPixmap * pixmapShowMore() const
Definition: manager.h:174
int count(const T &value) const
virtual bool hasAnnotation() const
Returns true if this message has an annotation.
Definition: messageitem.cpp:260
No background at all: use style default.
Definition: theme.h:884
static const QPixmap * get_watched_ignored_state_icon(MessageItem *messageItem)
Definition: themedelegate.cpp:310
static const QPixmap * get_spam_ham_state_icon(MessageItem *messageItem)
Definition: themedelegate.cpp:301
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Reimplemented from QStyledItemDelegate.
Definition: themedelegate.cpp:550
layoutDirection
const QPixmap * pixmapMessageWatched() const
Definition: manager.h:144
int top() const
One big rounded gradient rect for all the columns.
Definition: theme.h:899
int red() const
void setPen(const QColor &color)
Display the subject of the message item.
Definition: theme.h:130
int left() const
void drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode)
void drawPixmap(const QRectF &target, const QPixmap &pixmap, const QRectF &source)
bool canUseCustomColor() const
Returns true if this ContentItem can make use of a custom color.
Definition: theme.h:279
QString key() const
static void paint_horizontal_spacer(int &left, int, int &right, int, bool alignOnRight)
Definition: themedelegate.cpp:351
bool aboutToBeRemoved() const
Definition: messageitem.cpp:510
SignatureState signatureState() const
Definition: messageitem.cpp:426
QString elidedText(const QString &text, Qt::TextElideMode mode, int width, int flags) const
void setBrush(const QBrush &brush)
void drawText(const QPointF &position, const QString &text)
const QPixmap * pixmapMessageRepliedAndForwarded() const
Definition: manager.h:132
static void compute_bounding_rect_for_right_aligned_elided_text(const QString &text, int &left, int top, int &right, QRect &outRect, Qt::LayoutDirection layoutDir, const QFont &font)
Definition: themedelegate.cpp:144
bool contains(const QPoint &point, bool proper) const
Formatted date time of the message/group.
Definition: theme.h:134
const QList< ContentItem * > & leftItems() const
Returns the list of left aligned items for this row.
Definition: theme.h:482
static const QPixmap * get_encryption_state_icon(MessageItem *messageItem, bool *treatAsEnabled)
Definition: themedelegate.cpp:227
static const QPixmap * get_combined_read_replied_state_icon(MessageItem *messageItem)
Definition: themedelegate.cpp:213
A small empty spacer usable as separator.
Definition: theme.h:202
The list of MessageItem::Tag entries.
Definition: theme.h:214
const QPixmap * pixmapMessageUndefinedSigned() const
Definition: manager.h:156
static void compute_size_hint_for_item(Theme::ContentItem *ci, int &maxh, int &totalw, int iconSize, const Item *item)
Definition: themedelegate.cpp:493
bool displaysLongText() const
Returns true if this item displays a long text.
Definition: theme.h:293
QString formattedDate() const
A string with a text rappresentation of date() obtained via Manager.
Definition: item.cpp:259
int green() const
static void compute_bounding_rect_for_tag_list(const QList< MessageItem::Tag * > &tagList, int &left, int top, int &right, QRect &outRect, bool alignOnRight, int iconSize)
Definition: themedelegate.cpp:478
iterator end()
From: or To: strip, depending on the folder settings.
Definition: theme.h:138
A single item of the MessageList tree managed by MessageList::Model.
Definition: item.h:52
const QPixmap * pixmapMessageReplied() const
Definition: manager.h:130
bool isValid() const
virtual QRect visualRect(const QModelIndex &index) const =0
const QPixmap * pixmapShowLess() const
Definition: manager.h:176
bool hitTest(const QPoint &viewportPoint, bool exact=true)
Performs a hit test on the specified viewport point.
Definition: themedelegate.cpp:1173
const QPixmap * pixmapMessageQueued() const
Definition: manager.h:134
GroupHeaderBackgroundMode groupHeaderBackgroundMode() const
Returns the group header background mode for this theme.
Definition: theme.h:977
const QPixmap * pixmapMessageNotSigned() const
Definition: manager.h:158
int blue() const
QColor backgroundColor() const
Definition: messageitem.cpp:356
const QPixmap * pixmapMessageImportant() const
Definition: manager.h:142
virtual Item * itemFromIndex(const QModelIndex &index) const =0
Returns the Item for the specified model index.
virtual QList< Tag * > tagList() const
Returns the list of tags for this item.
Definition: messageitem.cpp:254
static const int gGroupHeaderOuterHorizontalMargin
Definition: themedelegate.cpp:42
One big rounded rect for all the columns.
Definition: theme.h:897
The Spam/Ham state icon.
Definition: theme.h:178
int width() const
One big plain rect for all the columns.
Definition: theme.h:895
static int cachedFontHeightKey(const QFont &font, const QString &fontKey)
Definition: themedelegate.cpp:108
const QPixmap * pixmapMessageActionItem() const
Definition: manager.h:136
The ActionItem state icon.
Definition: theme.h:170
A vertical separation line.
Definition: theme.h:198
Column * column(int idx) const
Returns a pointer to the column at the specified index or 0 if there is no such column.
Definition: theme.h:947
virtual void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const =0
int height() const
int height() const
static const QPixmap * get_signature_state_icon(MessageItem *messageItem, bool *treatAsEnabled)
Definition: themedelegate.cpp:257
static void compute_bounding_rect_for_left_aligned_elided_text(const QString &text, int &left, int top, int &right, QRect &outRect, Qt::LayoutDirection layoutDir, const QFont &font)
Definition: themedelegate.cpp:182
int column() const
void setTheme(const Theme *theme)
Definition: themedelegate.cpp:62
static void paint_tag_list(const QList< MessageItem::Tag * > &tagList, QPainter *painter, int &left, int top, int &right, bool alignOnRight, int iconSize)
Definition: themedelegate.cpp:456
const QPixmap * pixmapMessageFullyEncrypted() const
Definition: manager.h:160
const QList< Row * > & groupHeaderRows() const
Returns the list of rows visible in this column for a GroupHeaderItem.
Definition: theme.h:804
const Akonadi::MessageStatus & status() const
Returns the status associated to this Item.
Definition: item.cpp:401
bool contains(const Key &key) const
The Signature state icon for messages.
Definition: theme.h:194
The Theme class defines the visual appearance of the MessageList.
Definition: theme.h:65
static void paint_vertical_line(QPainter *painter, int &left, int top, int &right, int bottom, bool alignOnRight)
Definition: themedelegate.cpp:319
const QPixmap * pixmapMessageRead() const
Definition: manager.h:126
const QColor & groupHeaderBackgroundColor() const
Returns the group header background color for this theme.
Definition: theme.h:990
The group header label.
Definition: theme.h:166
The ThemeDelegate paints the message list view message and group items by using the supplied Theme...
Definition: themedelegate.h:45
const_iterator constEnd() const
const_iterator constBegin() const
bool softenByBlendingWhenDisabled() const
Returns true if this item should be painted in a "soft" fashion when in disabled state.
Definition: theme.h:380
The Watched/Ignored state icon.
Definition: theme.h:182
The Encryption state icon for messages.
Definition: theme.h:190
The date of the most recent message in subtree.
Definition: theme.h:206
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QObject * parent() const
Automatically determine the color (somewhere in the middle between background and text) ...
Definition: theme.h:885
QSize sizeHintForItemTypeAndColumn(Item::Type type, int column, const Item *item=0) const
Returns a heuristic sizeHint() for the specified item type and column.
Definition: themedelegate.cpp:1592
const QPen & pen() const
const QPixmap * pixmapMessageDeleted() const
Definition: manager.h:128
static const QPixmap * get_replied_state_icon(MessageItem *messageItem)
Definition: themedelegate.cpp:287
static void paint_left_aligned_elided_text(const QString &text, Theme::ContentItem *ci, QPainter *painter, int &left, int top, int &right, Qt::LayoutDirection layoutDir, const QFont &font)
Definition: themedelegate.cpp:159
iterator begin()
One rounded gradient filled rect per column.
Definition: theme.h:898
bool softenByBlending() const
Returns true if this item should be always painted in a "soft" fashion.
Definition: theme.h:396
qreal opacity() const
static void paint_permanent_icon(const QPixmap *pix, Theme::ContentItem *, QPainter *painter, int &left, int top, int &right, bool alignOnRight, int iconSize)
Definition: themedelegate.cpp:374
const QPixmap * pixmapMessageInvitation() const
Definition: manager.h:172
const QPixmap * pixmapMessagePartiallySigned() const
Definition: manager.h:154
bool isValid() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:01 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:01 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.