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

messagelist

  • sources
  • kde-4.14
  • kdepim
  • messagelist
  • core
theme.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Copyright 2008 Szymon Tomasz Stefanek <pragma@kvirc.net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  *
19  *******************************************************************************/
20 
21 #ifndef __MESSAGELIST_CORE_THEME_H__
22 #define __MESSAGELIST_CORE_THEME_H__
23 
24 #include <QList>
25 #include <QPair>
26 #include <QString>
27 #include <QFont>
28 #include <QFontMetrics>
29 #include <QSize>
30 #include <QColor>
31 
32 #include <messagelist/core/optionset.h>
33 #include <messagelist/core/sortorder.h>
34 
35 class QPaintDevice;
36 
37 namespace MessageList
38 {
39 
40 namespace Core
41 {
42 
65 class Theme : public OptionSet
66 {
67 public:
73  class ContentItem
74  {
75  private:
80  enum TypePropertyBits
81  {
85  CanUseCustomColor = (1 << 16),
89  CanBeDisabled = (1 << 17),
93  DisplaysText = (1 << 18),
97  ApplicableToMessageItems = (1 << 19),
101  ApplicableToGroupHeaderItems = (1 << 20),
105  LongText = (1 << 21),
109  IsIcon = (1 << 22),
113  IsSpacer = (1 << 23),
117  IsClickable = (1 << 24)
118  };
119 
120  public:
125  enum Type
126  {
130  Subject = 1 | DisplaysText | CanUseCustomColor | ApplicableToMessageItems | LongText,
134  Date = 2 | DisplaysText | CanUseCustomColor | ApplicableToMessageItems | ApplicableToGroupHeaderItems,
138  SenderOrReceiver = 3 | DisplaysText | CanUseCustomColor | ApplicableToMessageItems,
142  Sender = 4 | DisplaysText | CanUseCustomColor | ApplicableToMessageItems,
146  Receiver = 5 | DisplaysText | CanUseCustomColor | ApplicableToMessageItems,
150  Size = 6 | DisplaysText | CanUseCustomColor | ApplicableToMessageItems,
154  ReadStateIcon = 7 | ApplicableToMessageItems | IsIcon,
158  AttachmentStateIcon = 8 | CanBeDisabled | ApplicableToMessageItems | IsIcon,
162  RepliedStateIcon = 9 | CanBeDisabled | ApplicableToMessageItems | IsIcon,
166  GroupHeaderLabel = 10 | DisplaysText | CanUseCustomColor | ApplicableToGroupHeaderItems,
170  ActionItemStateIcon = 11 | CanBeDisabled | ApplicableToMessageItems | IsIcon | IsClickable,
174  ImportantStateIcon = 12 | CanBeDisabled | ApplicableToMessageItems | IsIcon | IsClickable,
178  SpamHamStateIcon = 13 | CanBeDisabled | ApplicableToMessageItems | IsIcon | IsClickable,
182  WatchedIgnoredStateIcon = 14 | CanBeDisabled | ApplicableToMessageItems | IsIcon | IsClickable,
186  ExpandedStateIcon = 15 | CanBeDisabled | ApplicableToGroupHeaderItems | IsIcon | IsClickable,
190  EncryptionStateIcon = 16 | CanBeDisabled | ApplicableToMessageItems | IsIcon,
194  SignatureStateIcon = 17 | CanBeDisabled | ApplicableToMessageItems | IsIcon,
198  VerticalLine = 18 | CanUseCustomColor | ApplicableToMessageItems | ApplicableToGroupHeaderItems | IsSpacer,
202  HorizontalSpacer = 19 | ApplicableToMessageItems | ApplicableToGroupHeaderItems | IsSpacer,
206  MostRecentDate = 20 | DisplaysText | CanUseCustomColor | ApplicableToMessageItems | ApplicableToGroupHeaderItems,
210  CombinedReadRepliedStateIcon = 21 | ApplicableToMessageItems | IsIcon,
214  TagList = 22 | ApplicableToMessageItems | IsIcon,
218  AnnotationIcon = 23 | ApplicableToMessageItems | IsIcon | CanBeDisabled | IsClickable,
219 
223  InvitationIcon = 24 | ApplicableToMessageItems | IsIcon
224 #if 0
225  TotalMessageCount
226  UnreadMessageCount
227  NewMessageCount
228 #endif
229  };
230 
231  enum Flags
232  {
233  HideWhenDisabled = 1,
234  SoftenByBlendingWhenDisabled = (1 << 1),
235  UseCustomColor = (1 << 2),
236  UseCustomFont = (1 << 3),
237  SoftenByBlending = (1 << 4)
238  };
239 
240  private:
241  Type mType;
242  unsigned int mFlags;
243 
244  QFont mFont;
245  QString mFontKey;
246  QColor mCustomColor;
247 
248  public:
253  explicit ContentItem( Type type );
258  explicit ContentItem( const ContentItem &src );
259 
260  public:
264  Type type() const
265  { return mType; }
266 
273  bool canBeDisabled() const
274  { return ( static_cast< int >( mType ) & CanBeDisabled ) != 0; }
275 
279  bool canUseCustomColor() const
280  { return ( static_cast< int >( mType ) & CanUseCustomColor ) != 0; }
281 
286  bool displaysText() const
287  { return ( static_cast< int >( mType ) & DisplaysText ) != 0; }
288 
293  bool displaysLongText() const
294  { return ( static_cast< int >( mType ) & LongText ) != 0; }
295 
299  bool isIcon() const
300  { return ( static_cast< int >( mType ) & IsIcon ) != 0; }
304  bool isClickable() const
305  { return ( static_cast< int >( mType ) & IsClickable ) != 0; }
306 
310  bool isSpacer() const
311  { return ( static_cast< int >( mType ) & IsSpacer ) != 0; }
312 
317  static bool applicableToMessageItems( Type type );
318 
323  static bool applicableToGroupHeaderItems( Type type );
324 
328  static QString description( Type type );
329 
334  bool useCustomColor() const
335  { return mFlags & UseCustomColor; }
336 
341  void setUseCustomColor( bool useCustomColor )
342  { if ( useCustomColor )mFlags |= UseCustomColor; else mFlags &= ~UseCustomColor; }
343 
348  bool useCustomFont() const
349  { return mFlags & UseCustomFont; }
350 
355  void setUseCustomFont( bool useCustomFont )
356  { if ( useCustomFont )mFlags |= UseCustomFont; else mFlags &= ~UseCustomFont; }
357 
363  bool hideWhenDisabled() const
364  { return mFlags & HideWhenDisabled; }
365 
372  void setHideWhenDisabled( bool hideWhenDisabled )
373  { if ( hideWhenDisabled )mFlags |= HideWhenDisabled; else mFlags &= ~HideWhenDisabled; }
374 
380  bool softenByBlendingWhenDisabled() const
381  { return mFlags & SoftenByBlendingWhenDisabled; }
382 
389  void setSoftenByBlendingWhenDisabled( bool softenByBlendingWhenDisabled )
390  { if ( softenByBlendingWhenDisabled )mFlags |= SoftenByBlendingWhenDisabled; else mFlags &= ~SoftenByBlendingWhenDisabled; }
391 
396  bool softenByBlending() const
397  { return mFlags & SoftenByBlending; }
398 
403  void setSoftenByBlending( bool softenByBlending )
404  { if ( softenByBlending )mFlags |= SoftenByBlending; else mFlags &= ~SoftenByBlending; }
405 
411  void setFont( const QFont &font );
412 
419  const QFont & font() const
420  { return mFont; }
421 
429  const QString & fontKey() const
430  { return mFontKey; }
431 
437  const QColor & customColor() const
438  { return mCustomColor; }
439 
444  void setCustomColor( const QColor &clr )
445  { mCustomColor = clr; }
446 
447  // Stuff used by ThemeDelegate. This section should be protected but some gcc
448  // versions seem to get confused with nested class and friend declarations
449  // so for portability we're using a public interface also here.
450 
454  void save( QDataStream &stream ) const;
455 
459  bool load( QDataStream &stream, int themeVersion );
460  };
461 
466  class Row
467  {
468  public:
469  explicit Row();
470  explicit Row( const Row &src );
471  ~Row();
472 
473  private:
474  QList< ContentItem * > mLeftItems;
475  QList< ContentItem * > mRightItems;
476 
477  bool LoadContentItem(int val, QDataStream &stream, int themeVersion, bool leftItem);
478  public:
482  const QList< ContentItem * > & leftItems() const
483  { return mLeftItems; }
484 
488  void removeAllLeftItems();
489 
494  void addLeftItem( ContentItem * item )
495  { mLeftItems.append( item ); }
496 
501  void insertLeftItem( int idx, ContentItem * item );
502 
507  void removeLeftItem( ContentItem * item )
508  { mLeftItems.removeAll( item ); }
509 
513  const QList< ContentItem * > & rightItems() const
514  { return mRightItems; }
515 
519  void removeAllRightItems();
520 
526  void addRightItem( ContentItem * item )
527  { mRightItems.append( item ); }
528 
533  void insertRightItem( int idx, ContentItem * item );
534 
539  void removeRightItem( ContentItem * item )
540  { mRightItems.removeAll( item ); }
541 
547  bool containsTextItems() const;
548 
552  void save( QDataStream &stream ) const;
553 
557  bool load( QDataStream &stream, int themeVersion );
558 
559  };
560 
565  class Column
566  {
567  public:
572  class SharedRuntimeData
573  {
574  private:
575  int mReferences;
576 
577  int mCurrentlyVisible;
578  int mCurrentWidth;
579  public:
583  explicit SharedRuntimeData( bool currentlyVisible, int currentWidth );
584 
588  ~SharedRuntimeData();
589  public:
593  void addReference();
594 
599  bool deleteReference();
600 
605  int referenceCount() const
606  { return mReferences; }
607 
611  bool currentlyVisible() const
612  { return mCurrentlyVisible; }
613 
617  void setCurrentlyVisible( bool visible )
618  { mCurrentlyVisible = visible; }
619 
623  int currentWidth() const
624  { return mCurrentWidth; }
625 
629  void setCurrentWidth( int currentWidth )
630  { mCurrentWidth = currentWidth; }
631 
635  void save( QDataStream &stream ) const;
636 
642  bool load( QDataStream &stream, int themeVersion );
643  };
644  public:
648  explicit Column();
655  explicit Column( const Column &src );
659  ~Column();
660 
661  private:
662  QString mLabel;
663  QString mPixmapName;
664  bool mVisibleByDefault;
665  bool mIsSenderOrReceiver;
666  SortOrder::MessageSorting mMessageSorting;
667  QList< Row * > mGroupHeaderRows;
668  QList< Row * > mMessageRows;
669 
670  SharedRuntimeData * mSharedRuntimeData;
671  public:
675  const QString & label() const
676  { return mLabel; }
677 
681  void setLabel( const QString &label )
682  { mLabel = label; }
683 
687  const QString & pixmapName() const
688  { return mPixmapName; }
689 
693  void setPixmapName( const QString &pixmapName )
694  { mPixmapName = pixmapName; }
695 
700  bool isSenderOrReceiver() const
701  { return mIsSenderOrReceiver; }
702 
707  void setIsSenderOrReceiver( bool sor )
708  { mIsSenderOrReceiver = sor; }
709 
713  bool visibleByDefault() const
714  { return mVisibleByDefault; }
715 
719  void setVisibleByDefault( bool vbd )
720  { mVisibleByDefault = vbd; }
721 
726  void detach();
727 
732  SortOrder::MessageSorting messageSorting() const
733  { return mMessageSorting; }
734 
739  void setMessageSorting( SortOrder::MessageSorting ms )
740  { mMessageSorting = ms; }
741 
746  bool currentlyVisible() const
747  { return mSharedRuntimeData->currentlyVisible(); }
748 
753  void setCurrentlyVisible( bool currentlyVisible )
754  { mSharedRuntimeData->setCurrentlyVisible( currentlyVisible ); }
755 
761  int currentWidth() const
762  { return mSharedRuntimeData->currentWidth(); }
763 
768  void setCurrentWidth( int currentWidth )
769  { mSharedRuntimeData->setCurrentWidth( currentWidth ); }
770 
774  const QList< Row * > & messageRows() const
775  { return mMessageRows; }
776 
780  void removeAllMessageRows();
781 
786  void addMessageRow( Row * row )
787  { mMessageRows.append( row ); }
788 
793  void insertMessageRow( int idx, Row * row );
794 
798  void removeMessageRow( Row * row )
799  { mMessageRows.removeAll( row ); }
800 
804  const QList< Row * > & groupHeaderRows() const
805  { return mGroupHeaderRows; }
806 
810  void removeAllGroupHeaderRows();
811 
816  void addGroupHeaderRow( Row * row )
817  { mGroupHeaderRows.append( row ); }
818 
823  void insertGroupHeaderRow( int idx, Row * row );
824 
828  void removeGroupHeaderRow( Row * row )
829  { mGroupHeaderRows.removeAll( row ); }
830 
836  bool containsTextItems() const;
837 
841  void save( QDataStream &stream ) const;
842 
846  bool load( QDataStream &stream, int themeVersion );
847 
848  };
849 
850 public:
854  explicit Theme();
855 
859  explicit Theme( const QString &name, const QString &description, bool readOnly = false );
860 
866  explicit Theme( const Theme &src );
867 
871  ~Theme();
872 
873  static bool compareName( Theme *theme1, Theme *theme2 )
874  {
875  return ( theme1->name() < theme2->name() );
876  }
877 
878 public:
882  enum GroupHeaderBackgroundMode
883  {
884  Transparent,
885  AutoColor,
886  CustomColor
887  };
888 
892  enum GroupHeaderBackgroundStyle
893  {
894  PlainRect,
895  PlainJoinedRect,
896  RoundedRect,
897  RoundedJoinedRect,
898  GradientRect,
899  GradientJoinedRect,
900  StyledRect,
901  StyledJoinedRect
902  };
903 
907  enum ViewHeaderPolicy
908  {
909  ShowHeaderAlways,
910  NeverShowHeader
911  //ShowWhenMoreThanOneColumn, ///< This doesn't work at the moment (since without header we don't have means for showing columns back)
912  };
913 
914 private:
915  QList< Column * > mColumns;
916 
917  GroupHeaderBackgroundMode mGroupHeaderBackgroundMode;
918  QColor mGroupHeaderBackgroundColor;
919  GroupHeaderBackgroundStyle mGroupHeaderBackgroundStyle;
920  ViewHeaderPolicy mViewHeaderPolicy;
921  int mIconSize;
922 public:
926  void detach();
927 
931  void resetColumnState();
932 
936  void resetColumnSizes();
937 
941  const QList< Column * > & columns() const
942  { return mColumns; }
943 
947  Column * column( int idx ) const
948  { return mColumns.count() > idx ? mColumns.at( idx ) : 0; }
949 
950  void moveColumn(int idx, int newPosition);
951 
955  void removeAllColumns();
956 
960  void addColumn( Column * column )
961  { mColumns.append( column ); }
962 
966  void insertColumn( int idx, Column * column );
967 
971  void removeColumn( Column * col )
972  { mColumns.removeAll( col ); }
973 
977  GroupHeaderBackgroundMode groupHeaderBackgroundMode() const
978  { return mGroupHeaderBackgroundMode; }
979 
984  void setGroupHeaderBackgroundMode( GroupHeaderBackgroundMode bm );
985 
990  const QColor & groupHeaderBackgroundColor() const
991  { return mGroupHeaderBackgroundColor; }
992 
997  void setGroupHeaderBackgroundColor( const QColor &clr )
998  { mGroupHeaderBackgroundColor = clr; }
999 
1005  GroupHeaderBackgroundStyle groupHeaderBackgroundStyle() const
1006  { return mGroupHeaderBackgroundStyle; }
1007 
1013  void setGroupHeaderBackgroundStyle( GroupHeaderBackgroundStyle groupHeaderBackgroundStyle )
1014  { mGroupHeaderBackgroundStyle = groupHeaderBackgroundStyle; }
1015 
1021  static QList< QPair< QString, int > > enumerateGroupHeaderBackgroundStyles();
1022 
1026  ViewHeaderPolicy viewHeaderPolicy() const
1027  { return mViewHeaderPolicy; }
1028 
1032  void setViewHeaderPolicy( ViewHeaderPolicy vhp )
1033  { mViewHeaderPolicy = vhp; }
1034 
1038  int iconSize() const
1039  { return mIconSize; }
1040 
1046  void setIconSize( int iconSize );
1047 
1053  static QList< QPair< QString, int > > enumerateViewHeaderPolicyOptions();
1054 
1055 protected:
1059  virtual void save( QDataStream &stream ) const;
1060 
1064  virtual bool load( QDataStream &stream );
1065 
1066 };
1067 
1068 } // namespace Core
1069 
1070 } // namespace MessageList
1071 
1072 
1073 #endif
MessageList::Core::Theme::ContentItem
The ContentItem class defines a content item inside a Row.
Definition: theme.h:73
MessageList::Core::Theme::ContentItem::InvitationIcon
Whether the message is an invitation.
Definition: theme.h:223
MessageList::Core::Theme::ContentItem::isIcon
bool isIcon() const
Returns true if this item displays an icon.
Definition: theme.h:299
MessageList::Core::Theme::ContentItem::applicableToMessageItems
static bool applicableToMessageItems(Type type)
Static test that returns true if an instance of ContentItem with the specified type makes sense in a ...
Definition: theme.cpp:156
MessageList::Core::Theme::removeAllColumns
void removeAllColumns()
Removes all columns from this theme.
Definition: theme.cpp:730
MessageList::Core::Theme::ContentItem::ExpandedStateIcon
The Expanded state icon for group headers.
Definition: theme.h:186
MessageList::Core::Theme::Column::SharedRuntimeData::currentlyVisible
bool currentlyVisible() const
Returns the current visibility state.
Definition: theme.h:611
MessageList::Core::Theme::ContentItem::ReadStateIcon
The icon that displays the unread/read state (never disabled)
Definition: theme.h:154
MessageList::Core::OptionSet
A set of options that can be applied to the MessageList in one shot.
Definition: optionset.h:47
MessageList::Core::Theme::ContentItem::Flags
Flags
Definition: theme.h:231
MessageList::Core::Theme::Row::rightItems
const QList< ContentItem * > & rightItems() const
Returns the list of right aligned items for this row.
Definition: theme.h:513
MessageList::Core::Theme::Column::messageSorting
SortOrder::MessageSorting messageSorting() const
Returns the sort order for messages that we should switch to when clicking on this column's header (i...
Definition: theme.h:732
MessageList::Core::Theme::ContentItem::useCustomFont
bool useCustomFont() const
Returns true if this item uses a custom font.
Definition: theme.h:348
MessageList::Core::Theme::Column::addMessageRow
void addMessageRow(Row *row)
Appends a message row to this theme column.
Definition: theme.h:786
QPaintDevice
QDataStream
MessageList::Core::Theme::ContentItem::font
const QFont & font() const
Returns the font used by this item.
Definition: theme.h:419
MessageList::Core::Theme::ContentItem::CombinedReadRepliedStateIcon
The combined icon that displays the unread/read/replied/forwarded state (never disabled) ...
Definition: theme.h:210
MessageList::Core::Theme::ContentItem::description
static QString description(Type type)
Returns a descriptive name for the specified content item type.
Definition: theme.cpp:75
QFont
MessageList::Core::Theme::Column::pixmapName
const QString & pixmapName() const
Returns the icon's name (used in SmallIcon) set for this column.
Definition: theme.h:687
MessageList::Core::Theme::insertColumn
void insertColumn(int idx, Column *column)
Inserts a column to this theme at the specified position.
Definition: theme.cpp:736
MessageList::Core::Theme::Row
The Row class defines a row of items inside a Column.
Definition: theme.h:466
MessageList::Core::Theme::removeColumn
void removeColumn(Column *col)
Removes the specified message row.
Definition: theme.h:971
MessageList::Core::Theme::moveColumn
void moveColumn(int idx, int newPosition)
Definition: theme.cpp:746
MessageList::Core::Theme::Row::addRightItem
void addRightItem(ContentItem *item)
Adds a right aligned item to this row.
Definition: theme.h:526
MessageList::Core::Theme::ContentItem::setSoftenByBlendingWhenDisabled
void setSoftenByBlendingWhenDisabled(bool softenByBlendingWhenDisabled)
Sets the flag that causes this item to be painted "softly" when disabled.
Definition: theme.h:389
MessageList::Core::Theme::ContentItem::AttachmentStateIcon
The icon that displays the atachment state (may be disabled)
Definition: theme.h:158
MessageList::Core::Theme::ShowHeaderAlways
Definition: theme.h:909
MessageList::Core::Theme::ContentItem::Sender
From: strip, always.
Definition: theme.h:142
MessageList::Core::Theme::setGroupHeaderBackgroundMode
void setGroupHeaderBackgroundMode(GroupHeaderBackgroundMode bm)
Sets the group header background mode for this theme.
Definition: theme.cpp:753
MessageList::Core::Theme::groupHeaderBackgroundStyle
GroupHeaderBackgroundStyle groupHeaderBackgroundStyle() const
Returns the group header background style for this theme.
Definition: theme.h:1005
MessageList::Core::Theme::ContentItem::displaysText
bool displaysText() const
Returns true if this item displays some kind of text.
Definition: theme.h:286
MessageList::Core::Theme::ContentItem::applicableToGroupHeaderItems
static bool applicableToGroupHeaderItems(Type type)
Static test that returns true if an instance of ContentItem with the specified type makes sense in a ...
Definition: theme.cpp:161
MessageList::Core::Theme::Row::addLeftItem
void addLeftItem(ContentItem *item)
Adds a left aligned item to this row.
Definition: theme.h:494
MessageList::Core::Theme::Column::isSenderOrReceiver
bool isSenderOrReceiver() const
Returns true if this column is marked as "sender/receiver" and we should update its label on-the-fly...
Definition: theme.h:700
MessageList::Core::Theme::ContentItem::ImportantStateIcon
The Important tag icon.
Definition: theme.h:174
MessageList::Core::Theme::ContentItem::load
bool load(QDataStream &stream, int themeVersion)
Handles content item loading (used by Theme::Row::load())
Definition: theme.cpp:180
MessageList::Core::Theme::ContentItem::hideWhenDisabled
bool hideWhenDisabled() const
Returns true if this item should be hidden when in disabled state.
Definition: theme.h:363
MessageList::Core::Theme::ContentItem::AnnotationIcon
Whether the message has a annotation/note.
Definition: theme.h:218
MessageList::Core::Theme::Column::setVisibleByDefault
void setVisibleByDefault(bool vbd)
Sets the "visible by default" tag for this column.
Definition: theme.h:719
optionset.h
MessageList::Core::Theme::Column
The Column class defines a view column available inside this theme.
Definition: theme.h:565
MessageList::Core::Theme::StyledJoinedRect
One big styled rect per column.
Definition: theme.h:901
MessageList::Core::Theme::iconSize
int iconSize() const
Returns the currently set icon size.
Definition: theme.h:1038
MessageList::Core::Theme::ContentItem::setFont
void setFont(const QFont &font)
Sets the custom font to be used with this item.
Definition: theme.cpp:166
MessageList::Core::Theme::ContentItem::customColor
const QColor & customColor() const
Returns the custom color set for this item.
Definition: theme.h:437
MessageList::Core::Theme::Column::messageRows
const QList< Row * > & messageRows() const
Returns the list of rows visible in this column for a MessageItem.
Definition: theme.h:774
MessageList::Core::Theme::ContentItem::RepliedStateIcon
The icon that displays the replied/forwarded state (may be disabled)
Definition: theme.h:162
MessageList::Core::Theme::Column::SharedRuntimeData::referenceCount
int referenceCount() const
Returns the current number of reference counts, that is, the number of Theme::Column objects that use...
Definition: theme.h:605
MessageList::Core::Theme::enumerateGroupHeaderBackgroundStyles
static QList< QPair< QString, int > > enumerateGroupHeaderBackgroundStyles()
Enumerates the available group header background styles.
Definition: theme.cpp:768
MessageList::Core::OptionSet::name
const QString & name() const
Returns the name of this OptionSet.
Definition: optionset.h:72
MessageList::Core::Theme::Column::setLabel
void setLabel(const QString &label)
Sets the label for this column.
Definition: theme.h:681
MessageList::Core::Theme::Transparent
No background at all: use style default.
Definition: theme.h:884
MessageList::Core::Theme::PlainRect
One plain rect per column.
Definition: theme.h:894
MessageList::Core::Theme::ContentItem::isClickable
bool isClickable() const
Returns true if clicking on this kind of item can perform an action.
Definition: theme.h:304
MessageList::Core::Theme::Column::SharedRuntimeData::currentWidth
int currentWidth() const
Returns the current width or -1 if the width is unspecified/invalid.
Definition: theme.h:623
MessageList::Core::Theme::GradientJoinedRect
One big rounded gradient rect for all the columns.
Definition: theme.h:899
MessageList::Core::Theme::ContentItem::type
Type type() const
Returns the type of this content item.
Definition: theme.h:264
MessageList::Core::Theme::ContentItem::save
void save(QDataStream &stream) const
Handles content item saving (used by Theme::Row::save())
Definition: theme.cpp:172
MessageList::Core::Theme::ContentItem::Subject
Display the subject of the message item.
Definition: theme.h:130
MessageList::Core::Theme::ContentItem::canUseCustomColor
bool canUseCustomColor() const
Returns true if this ContentItem can make use of a custom color.
Definition: theme.h:279
MessageList::Core::SortOrder::MessageSorting
MessageSorting
The available message sorting options.
Definition: sortorder.h:78
MessageList::Core::Theme::Column::SharedRuntimeData::setCurrentlyVisible
void setCurrentlyVisible(bool visible)
Sets the current visibility state.
Definition: theme.h:617
MessageList::Core::Theme::ContentItem::useCustomColor
bool useCustomColor() const
Returns true if this item uses a custom color.
Definition: theme.h:334
MessageList::Core::Theme::GroupHeaderBackgroundMode
GroupHeaderBackgroundMode
Which color do we use to paint group header background ?
Definition: theme.h:882
MessageList::Core::Theme::setGroupHeaderBackgroundColor
void setGroupHeaderBackgroundColor(const QColor &clr)
Sets the group header background color for this theme.
Definition: theme.h:997
MessageList::Core::Theme::resetColumnState
void resetColumnState()
Resets the column state (visibility and width) to their default values (the "visible by default" ones...
Definition: theme.cpp:712
MessageList::Core::Theme::ContentItem::Date
Formatted date time of the message/group.
Definition: theme.h:134
MessageList::Core::Theme::Row::leftItems
const QList< ContentItem * > & leftItems() const
Returns the list of left aligned items for this row.
Definition: theme.h:482
QString
QList
QColor
MessageList::Core::Theme::ContentItem::Type
Type
The available ContentItem types.
Definition: theme.h:125
MessageList::Core::Theme::ContentItem::HorizontalSpacer
A small empty spacer usable as separator.
Definition: theme.h:202
MessageList::Core::Theme::ContentItem::TagList
The list of MessageItem::Tag entries.
Definition: theme.h:214
MessageList::Core::Theme::NeverShowHeader
Definition: theme.h:910
MessageList::Core::Theme::ContentItem::Receiver
To: strip, always.
Definition: theme.h:146
MessageList::Core::Theme::viewHeaderPolicy
ViewHeaderPolicy viewHeaderPolicy() const
Returns the currently set ViewHeaderPolicy.
Definition: theme.h:1026
MessageList::Core::Theme::ContentItem::fontKey
const QString & fontKey() const
Returns the font key used by this item.
Definition: theme.h:429
MessageList::Core::Theme::ContentItem::Size
Formatted size of the message.
Definition: theme.h:150
MessageList::Core::Theme::ContentItem::displaysLongText
bool displaysLongText() const
Returns true if this item displays a long text.
Definition: theme.h:293
MessageList::Core::Theme::CustomColor
Use a custom color.
Definition: theme.h:886
MessageList::Core::Theme::Column::SharedRuntimeData::setCurrentWidth
void setCurrentWidth(int currentWidth)
Sets the current width of the column.
Definition: theme.h:629
MessageList::Core::Theme::ContentItem::SenderOrReceiver
From: or To: strip, depending on the folder settings.
Definition: theme.h:138
MessageList::Core::Theme::Column::visibleByDefault
bool visibleByDefault() const
Returns true if this column has to be shown by default.
Definition: theme.h:713
MessageList::Core::Theme::Column::setCurrentlyVisible
void setCurrentlyVisible(bool currentlyVisible)
Sets the current shared visibility state for this column.
Definition: theme.h:753
MessageList::Core::Theme::ContentItem::setUseCustomColor
void setUseCustomColor(bool useCustomColor)
Makes this item use the custom color that can be set by setCustomColor().
Definition: theme.h:341
MessageList::Core::Theme::resetColumnSizes
void resetColumnSizes()
Resets the column sizes to "default" (subset of resetColumnState() above).
Definition: theme.cpp:722
MessageList::Core::Theme::ContentItem::setCustomColor
void setCustomColor(const QColor &clr)
Sets the custom color for this item.
Definition: theme.h:444
MessageList::Core::Theme::Theme
Theme()
Creates a totally uninitialized theme object.
Definition: theme.cpp:668
MessageList::Core::Theme::groupHeaderBackgroundMode
GroupHeaderBackgroundMode groupHeaderBackgroundMode() const
Returns the group header background mode for this theme.
Definition: theme.h:977
sortorder.h
MessageList::Core::Theme::RoundedJoinedRect
One big rounded rect for all the columns.
Definition: theme.h:897
MessageList::Core::Theme::ContentItem::SpamHamStateIcon
The Spam/Ham state icon.
Definition: theme.h:178
MessageList::Core::Theme::PlainJoinedRect
One big plain rect for all the columns.
Definition: theme.h:895
MessageList::Core::Theme::setIconSize
void setIconSize(int iconSize)
Sets the icon size for this theme.
Definition: theme.cpp:783
MessageList::Core::Theme::ContentItem::canBeDisabled
bool canBeDisabled() const
Returns true if this ContentItem can be in a "disabled" state.
Definition: theme.h:273
MessageList::Core::Theme::Column::setMessageSorting
void setMessageSorting(SortOrder::MessageSorting ms)
Sets the sort order for messages that we should switch to when clicking on this column's header (if v...
Definition: theme.h:739
MessageList::Core::Theme::enumerateViewHeaderPolicyOptions
static QList< QPair< QString, int > > enumerateViewHeaderPolicyOptions()
Enumerates the available view header policy options.
Definition: theme.cpp:760
MessageList::Core::Theme::ContentItem::ActionItemStateIcon
The ActionItem state icon.
Definition: theme.h:170
MessageList::Core::Theme::ContentItem::VerticalLine
A vertical separation line.
Definition: theme.h:198
MessageList::Core::Theme::compareName
static bool compareName(Theme *theme1, Theme *theme2)
Definition: theme.h:873
MessageList::Core::Theme::GroupHeaderBackgroundStyle
GroupHeaderBackgroundStyle
How do we paint group header background ?
Definition: theme.h:892
MessageList::Core::Theme::Column::currentWidth
int currentWidth() const
Returns the current shared width setting for this column or -1 if the width is not specified and shou...
Definition: theme.h:761
MessageList::Core::Theme::column
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
MessageList::Core::Theme::ContentItem::setUseCustomFont
void setUseCustomFont(bool useCustomFont)
Makes this item use the custom font that can be set by setCustomFont().
Definition: theme.h:355
MessageList::Core::Theme::ContentItem::UseCustomColor
For text and vertical line. If set then always use a custom color, otherwise use default text color...
Definition: theme.h:235
MessageList::Core::Theme::ContentItem::SoftenByBlending
For text items: use 60% opacity.
Definition: theme.h:237
MessageList::Core::Theme::ContentItem::UseCustomFont
For text items. If set then always use a custom font, otherwise default to the global font...
Definition: theme.h:236
MessageList::Core::Theme::ContentItem::setSoftenByBlending
void setSoftenByBlending(bool softenByBlending)
Sets the flag that causes this item to be painted "softly".
Definition: theme.h:403
MessageList::Core::Theme::Column::label
const QString & label() const
Returns the label set for this column.
Definition: theme.h:675
MessageList::Core::Theme::ContentItem::ContentItem
ContentItem(Type type)
Creates a ContentItem with the specified type.
Definition: theme.cpp:62
MessageList::Core::Theme::Column::groupHeaderRows
const QList< Row * > & groupHeaderRows() const
Returns the list of rows visible in this column for a GroupHeaderItem.
Definition: theme.h:804
MessageList::Core::Theme::detach
void detach()
Detaches this object from the shared runtime data for columns.
Definition: theme.cpp:705
MessageList::Core::Theme::ContentItem::SignatureStateIcon
The Signature state icon for messages.
Definition: theme.h:194
MessageList::Core::Theme
The Theme class defines the visual appearance of the MessageList.
Definition: theme.h:65
MessageList::Core::Theme::groupHeaderBackgroundColor
const QColor & groupHeaderBackgroundColor() const
Returns the group header background color for this theme.
Definition: theme.h:990
MessageList::Core::Theme::Column::setIsSenderOrReceiver
void setIsSenderOrReceiver(bool sor)
Marks this column as containing the "sender/receiver" field.
Definition: theme.h:707
MessageList::Core::Theme::ContentItem::GroupHeaderLabel
The group header label.
Definition: theme.h:166
MessageList::Core::OptionSet::readOnly
bool readOnly() const
Definition: optionset.h:118
MessageList::Core::Theme::addColumn
void addColumn(Column *column)
Appends a column to this theme.
Definition: theme.h:960
MessageList::Core::Theme::Row::removeRightItem
void removeRightItem(ContentItem *item)
Removes the specified right aligned content item from this row.
Definition: theme.h:539
MessageList::Core::Theme::ContentItem::softenByBlendingWhenDisabled
bool softenByBlendingWhenDisabled() const
Returns true if this item should be painted in a "soft" fashion when in disabled state.
Definition: theme.h:380
MessageList::Core::Theme::ContentItem::WatchedIgnoredStateIcon
The Watched/Ignored state icon.
Definition: theme.h:182
MessageList::Core::Theme::setGroupHeaderBackgroundStyle
void setGroupHeaderBackgroundStyle(GroupHeaderBackgroundStyle groupHeaderBackgroundStyle)
Sets the group header background style for this theme.
Definition: theme.h:1013
MessageList::Core::Theme::ContentItem::EncryptionStateIcon
The Encryption state icon for messages.
Definition: theme.h:190
MessageList::Core::Theme::ContentItem::MostRecentDate
The date of the most recent message in subtree.
Definition: theme.h:206
MessageList::Core::Theme::Column::addGroupHeaderRow
void addGroupHeaderRow(Row *row)
Appends a group header row to this theme.
Definition: theme.h:816
MessageList::Core::Theme::AutoColor
Automatically determine the color (somewhere in the middle between background and text) ...
Definition: theme.h:885
MessageList::Core::Theme::Row::removeLeftItem
void removeLeftItem(ContentItem *item)
Removes the specified left aligned content item from this row.
Definition: theme.h:507
MessageList::Core::Theme::ContentItem::HideWhenDisabled
In disabled state the icon should take no space (overrides SoftenByBlendingWhenDisabled) ...
Definition: theme.h:233
MessageList::Core::Theme::ContentItem::isSpacer
bool isSpacer() const
Returns true if this item is a small spacer.
Definition: theme.h:310
MessageList::Core::Theme::Column::removeMessageRow
void removeMessageRow(Row *row)
Removes the specified message row.
Definition: theme.h:798
MessageList::Core::Theme::Column::currentlyVisible
bool currentlyVisible() const
Returns the current shared visibility state for this column.
Definition: theme.h:746
MessageList::Core::Theme::setViewHeaderPolicy
void setViewHeaderPolicy(ViewHeaderPolicy vhp)
Sets the ViewHeaderPolicy for this theme.
Definition: theme.h:1032
MessageList::Core::Theme::~Theme
~Theme()
Destroys this theme object.
Definition: theme.cpp:700
MessageList::Core::Theme::GradientRect
One rounded gradient filled rect per column.
Definition: theme.h:898
MessageList::Core::Theme::ContentItem::softenByBlending
bool softenByBlending() const
Returns true if this item should be always painted in a "soft" fashion.
Definition: theme.h:396
MessageList::Core::Theme::ContentItem::setHideWhenDisabled
void setHideWhenDisabled(bool hideWhenDisabled)
Sets the flag that causes this item to be hidden when disabled.
Definition: theme.h:372
MessageList::Core::Theme::StyledRect
One styled rect per column.
Definition: theme.h:900
MessageList::Core::Theme::ContentItem::SoftenByBlendingWhenDisabled
In disabled state the icon should be still shown, but made very soft by alpha blending.
Definition: theme.h:234
MessageList::Core::Theme::Column::SharedRuntimeData
A set of shared runtime data.
Definition: theme.h:572
MessageList::Core::Theme::RoundedRect
One rounded rect per column.
Definition: theme.h:896
MessageList::Core::Theme::ViewHeaderPolicy
ViewHeaderPolicy
How do we manage the QHeaderView attacched to our View ?
Definition: theme.h:907
MessageList::Core::Theme::columns
const QList< Column * > & columns() const
Returns the list of columns available in this theme.
Definition: theme.h:941
MessageList::Core::Theme::Column::removeGroupHeaderRow
void removeGroupHeaderRow(Row *row)
Removes the specified group header row.
Definition: theme.h:828
MessageList::Core::Theme::Column::setCurrentWidth
void setCurrentWidth(int currentWidth)
Sets the current shared width setting for this column.
Definition: theme.h:768
MessageList::Core::Theme::Column::setPixmapName
void setPixmapName(const QString &pixmapName)
Sets the icon's name (used in SmallIcon) for this column.
Definition: theme.h:693
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

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
  • pimprint

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