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

messagelist

  • sources
  • kde-4.12
  • 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  public:
481  const QList< ContentItem * > & leftItems() const
482  { return mLeftItems; }
483 
487  void removeAllLeftItems();
488 
493  void addLeftItem( ContentItem * item )
494  { mLeftItems.append( item ); }
495 
500  void insertLeftItem( int idx, ContentItem * item );
501 
506  void removeLeftItem( ContentItem * item )
507  { mLeftItems.removeAll( item ); }
508 
512  const QList< ContentItem * > & rightItems() const
513  { return mRightItems; }
514 
518  void removeAllRightItems();
519 
525  void addRightItem( ContentItem * item )
526  { mRightItems.append( item ); }
527 
532  void insertRightItem( int idx, ContentItem * item );
533 
538  void removeRightItem( ContentItem * item )
539  { mRightItems.removeAll( item ); }
540 
546  bool containsTextItems() const;
547 
551  void save( QDataStream &stream ) const;
552 
556  bool load( QDataStream &stream, int themeVersion );
557 
558  };
559 
564  class Column
565  {
566  public:
571  class SharedRuntimeData
572  {
573  private:
574  int mReferences;
575 
576  int mCurrentlyVisible;
577  int mCurrentWidth;
578  public:
582  explicit SharedRuntimeData( bool currentlyVisible, int currentWidth );
583 
587  ~SharedRuntimeData();
588  public:
592  void addReference();
593 
598  bool deleteReference();
599 
604  int referenceCount() const
605  { return mReferences; }
606 
610  bool currentlyVisible() const
611  { return mCurrentlyVisible; }
612 
616  void setCurrentlyVisible( bool visible )
617  { mCurrentlyVisible = visible; }
618 
622  int currentWidth() const
623  { return mCurrentWidth; }
624 
628  void setCurrentWidth( int currentWidth )
629  { mCurrentWidth = currentWidth; }
630 
634  void save( QDataStream &stream ) const;
635 
641  bool load( QDataStream &stream, int themeVersion );
642  };
643  public:
647  explicit Column();
654  explicit Column( const Column &src );
658  ~Column();
659 
660  private:
661  QString mLabel;
662  QString mPixmapName;
663  bool mVisibleByDefault;
664  bool mIsSenderOrReceiver;
665  SortOrder::MessageSorting mMessageSorting;
666  QList< Row * > mGroupHeaderRows;
667  QList< Row * > mMessageRows;
668 
669  SharedRuntimeData * mSharedRuntimeData;
670  public:
674  const QString & label() const
675  { return mLabel; }
676 
680  void setLabel( const QString &label )
681  { mLabel = label; }
682 
686  const QString & pixmapName() const
687  { return mPixmapName; }
688 
692  void setPixmapName( const QString &pixmapName )
693  { mPixmapName = pixmapName; }
694 
699  bool isSenderOrReceiver() const
700  { return mIsSenderOrReceiver; }
701 
706  void setIsSenderOrReceiver( bool sor )
707  { mIsSenderOrReceiver = sor; }
708 
712  bool visibleByDefault() const
713  { return mVisibleByDefault; }
714 
718  void setVisibleByDefault( bool vbd )
719  { mVisibleByDefault = vbd; }
720 
725  void detach();
726 
731  SortOrder::MessageSorting messageSorting() const
732  { return mMessageSorting; }
733 
738  void setMessageSorting( SortOrder::MessageSorting ms )
739  { mMessageSorting = ms; }
740 
745  bool currentlyVisible() const
746  { return mSharedRuntimeData->currentlyVisible(); }
747 
752  void setCurrentlyVisible( bool currentlyVisible )
753  { mSharedRuntimeData->setCurrentlyVisible( currentlyVisible ); }
754 
760  int currentWidth() const
761  { return mSharedRuntimeData->currentWidth(); }
762 
767  void setCurrentWidth( int currentWidth )
768  { mSharedRuntimeData->setCurrentWidth( currentWidth ); }
769 
773  const QList< Row * > & messageRows() const
774  { return mMessageRows; }
775 
779  void removeAllMessageRows();
780 
785  void addMessageRow( Row * row )
786  { mMessageRows.append( row ); }
787 
792  void insertMessageRow( int idx, Row * row );
793 
797  void removeMessageRow( Row * row )
798  { mMessageRows.removeAll( row ); }
799 
803  const QList< Row * > & groupHeaderRows() const
804  { return mGroupHeaderRows; }
805 
809  void removeAllGroupHeaderRows();
810 
815  void addGroupHeaderRow( Row * row )
816  { mGroupHeaderRows.append( row ); }
817 
822  void insertGroupHeaderRow( int idx, Row * row );
823 
827  void removeGroupHeaderRow( Row * row )
828  { mGroupHeaderRows.removeAll( row ); }
829 
835  bool containsTextItems() const;
836 
840  void save( QDataStream &stream ) const;
841 
845  bool load( QDataStream &stream, int themeVersion );
846 
847  };
848 
849 public:
853  explicit Theme();
854 
858  explicit Theme( const QString &name, const QString &description, bool readOnly = false );
859 
865  explicit Theme( const Theme &src );
866 
870  ~Theme();
871 
872  static bool compareName( Theme *theme1, Theme *theme2 )
873  {
874  return ( theme1->name() < theme2->name() );
875  }
876 
877 public:
881  enum GroupHeaderBackgroundMode
882  {
883  Transparent,
884  AutoColor,
885  CustomColor
886  };
887 
891  enum GroupHeaderBackgroundStyle
892  {
893  PlainRect,
894  PlainJoinedRect,
895  RoundedRect,
896  RoundedJoinedRect,
897  GradientRect,
898  GradientJoinedRect,
899  StyledRect,
900  StyledJoinedRect
901  };
902 
906  enum ViewHeaderPolicy
907  {
908  ShowHeaderAlways,
909  NeverShowHeader
910  //ShowWhenMoreThanOneColumn, ///< This doesn't work at the moment (since without header we don't have means for showing columns back)
911  };
912 
913 private:
914  QList< Column * > mColumns;
915 
916  GroupHeaderBackgroundMode mGroupHeaderBackgroundMode;
917  QColor mGroupHeaderBackgroundColor;
918  GroupHeaderBackgroundStyle mGroupHeaderBackgroundStyle;
919  ViewHeaderPolicy mViewHeaderPolicy;
920  int mIconSize;
921 public:
925  void detach();
926 
930  void resetColumnState();
931 
935  void resetColumnSizes();
936 
940  const QList< Column * > & columns() const
941  { return mColumns; }
942 
946  Column * column( int idx ) const
947  { return mColumns.count() > idx ? mColumns.at( idx ) : 0; }
948 
949  void moveColumn(int idx, int newPosition);
950 
954  void removeAllColumns();
955 
959  void addColumn( Column * column )
960  { mColumns.append( column ); }
961 
965  void insertColumn( int idx, Column * column );
966 
970  void removeColumn( Column * col )
971  { mColumns.removeAll( col ); }
972 
976  GroupHeaderBackgroundMode groupHeaderBackgroundMode() const
977  { return mGroupHeaderBackgroundMode; }
978 
983  void setGroupHeaderBackgroundMode( GroupHeaderBackgroundMode bm );
984 
989  const QColor & groupHeaderBackgroundColor() const
990  { return mGroupHeaderBackgroundColor; }
991 
996  void setGroupHeaderBackgroundColor( const QColor &clr )
997  { mGroupHeaderBackgroundColor = clr; }
998 
1004  GroupHeaderBackgroundStyle groupHeaderBackgroundStyle() const
1005  { return mGroupHeaderBackgroundStyle; }
1006 
1012  void setGroupHeaderBackgroundStyle( GroupHeaderBackgroundStyle groupHeaderBackgroundStyle )
1013  { mGroupHeaderBackgroundStyle = groupHeaderBackgroundStyle; }
1014 
1020  static QList< QPair< QString, int > > enumerateGroupHeaderBackgroundStyles();
1021 
1025  ViewHeaderPolicy viewHeaderPolicy() const
1026  { return mViewHeaderPolicy; }
1027 
1031  void setViewHeaderPolicy( ViewHeaderPolicy vhp )
1032  { mViewHeaderPolicy = vhp; }
1033 
1037  int iconSize() const
1038  { return mIconSize; }
1039 
1045  void setIconSize( int iconSize );
1046 
1052  static QList< QPair< QString, int > > enumerateViewHeaderPolicyOptions();
1053 
1054 protected:
1058  virtual void save( QDataStream &stream ) const;
1059 
1063  virtual bool load( QDataStream &stream );
1064 
1065 };
1066 
1067 } // namespace Core
1068 
1069 } // namespace MessageList
1070 
1071 
1072 #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:743
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:610
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:512
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:731
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:785
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
MessageList::Core::Theme::Column::pixmapName
const QString & pixmapName() const
Returns the icon's name (used in SmallIcon) set for this column.
Definition: theme.h:686
MessageList::Core::Theme::insertColumn
void insertColumn(int idx, Column *column)
Inserts a column to this theme at the specified position.
Definition: theme.cpp:749
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:970
MessageList::Core::Theme::moveColumn
void moveColumn(int idx, int newPosition)
Definition: theme.cpp:759
MessageList::Core::Theme::Row::addRightItem
void addRightItem(ContentItem *item)
Adds a right aligned item to this row.
Definition: theme.h:525
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:908
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:766
MessageList::Core::Theme::groupHeaderBackgroundStyle
GroupHeaderBackgroundStyle groupHeaderBackgroundStyle() const
Returns the group header background style for this theme.
Definition: theme.h:1004
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:493
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:699
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:718
optionset.h
MessageList::Core::Theme::Column
The Column class defines a view column available inside this theme.
Definition: theme.h:564
MessageList::Core::Theme::StyledJoinedRect
One big styled rect per column.
Definition: theme.h:900
MessageList::Core::Theme::iconSize
int iconSize() const
Returns the currently set icon size.
Definition: theme.h:1037
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:773
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:604
MessageList::Core::Theme::enumerateGroupHeaderBackgroundStyles
static QList< QPair< QString, int > > enumerateGroupHeaderBackgroundStyles()
Enumerates the available group header background styles.
Definition: theme.cpp:781
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:680
MessageList::Core::Theme::Transparent
No background at all: use style default.
Definition: theme.h:883
MessageList::Core::Theme::PlainRect
One plain rect per column.
Definition: theme.h:893
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:622
MessageList::Core::Theme::GradientJoinedRect
One big rounded gradient rect for all the columns.
Definition: theme.h:898
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:616
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:881
MessageList::Core::Theme::setGroupHeaderBackgroundColor
void setGroupHeaderBackgroundColor(const QColor &clr)
Sets the group header background color for this theme.
Definition: theme.h:996
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:725
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:481
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:909
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:1025
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:885
MessageList::Core::Theme::Column::SharedRuntimeData::setCurrentWidth
void setCurrentWidth(int currentWidth)
Sets the current width of the column.
Definition: theme.h:628
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:712
MessageList::Core::Theme::Column::setCurrentlyVisible
void setCurrentlyVisible(bool currentlyVisible)
Sets the current shared visibility state for this column.
Definition: theme.h:752
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:735
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:681
MessageList::Core::Theme::groupHeaderBackgroundMode
GroupHeaderBackgroundMode groupHeaderBackgroundMode() const
Returns the group header background mode for this theme.
Definition: theme.h:976
sortorder.h
MessageList::Core::Theme::RoundedJoinedRect
One big rounded rect for all the columns.
Definition: theme.h:896
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:894
MessageList::Core::Theme::setIconSize
void setIconSize(int iconSize)
Sets the icon size for this theme.
Definition: theme.cpp:796
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:738
MessageList::Core::Theme::enumerateViewHeaderPolicyOptions
static QList< QPair< QString, int > > enumerateViewHeaderPolicyOptions()
Enumerates the available view header policy options.
Definition: theme.cpp:773
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:872
MessageList::Core::Theme::GroupHeaderBackgroundStyle
GroupHeaderBackgroundStyle
How do we paint group header background ?
Definition: theme.h:891
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:760
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:946
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:674
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:803
MessageList::Core::Theme::detach
void detach()
Detaches this object from the shared runtime data for columns.
Definition: theme.cpp:718
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:989
MessageList::Core::Theme::Column::setIsSenderOrReceiver
void setIsSenderOrReceiver(bool sor)
Marks this column as containing the "sender/receiver" field.
Definition: theme.h:706
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:959
MessageList::Core::Theme::Row::removeRightItem
void removeRightItem(ContentItem *item)
Removes the specified right aligned content item from this row.
Definition: theme.h:538
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:1012
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:815
MessageList::Core::Theme::AutoColor
Automatically determine the color (somewhere in the middle between background and text) ...
Definition: theme.h:884
MessageList::Core::Theme::Row::removeLeftItem
void removeLeftItem(ContentItem *item)
Removes the specified left aligned content item from this row.
Definition: theme.h:506
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:797
MessageList::Core::Theme::Column::currentlyVisible
bool currentlyVisible() const
Returns the current shared visibility state for this column.
Definition: theme.h:745
MessageList::Core::Theme::setViewHeaderPolicy
void setViewHeaderPolicy(ViewHeaderPolicy vhp)
Sets the ViewHeaderPolicy for this theme.
Definition: theme.h:1031
MessageList::Core::Theme::~Theme
~Theme()
Destroys this theme object.
Definition: theme.cpp:713
MessageList::Core::Theme::GradientRect
One rounded gradient filled rect per column.
Definition: theme.h:897
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:899
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:571
MessageList::Core::Theme::RoundedRect
One rounded rect per column.
Definition: theme.h:895
MessageList::Core::Theme::ViewHeaderPolicy
ViewHeaderPolicy
How do we manage the QHeaderView attacched to our View ?
Definition: theme.h:906
MessageList::Core::Theme::columns
const QList< Column * > & columns() const
Returns the list of columns available in this theme.
Definition: theme.h:940
MessageList::Core::Theme::Column::removeGroupHeaderRow
void removeGroupHeaderRow(Row *row)
Removes the specified group header row.
Definition: theme.h:827
MessageList::Core::Theme::Column::setCurrentWidth
void setCurrentWidth(int currentWidth)
Sets the current shared width setting for this column.
Definition: theme.h:767
MessageList::Core::Theme::Column::setPixmapName
void setPixmapName(const QString &pixmapName)
Sets the icon's name (used in SmallIcon) for this column.
Definition: theme.h:692
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