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

messageviewer

  • sources
  • kde-4.12
  • kdepim
  • messageviewer
  • header
headerstyle.h
Go to the documentation of this file.
1 /* -*- c++ -*-
2  headerstyle.h
3 
4  This file is part of KMail, the KDE mail client.
5  Copyright (c) 2003 Marc Mutz <mutz@kde.org>
6 
7  Copyright (c) 2013 Laurent Montel <montel@kde.org>
8 
9  KMail is free software; you can redistribute it and/or modify it
10  under the terms of the GNU General Public License, version 2, as
11  published by the Free Software Foundation.
12 
13  KMail is distributed in the hope that it will be useful, but
14  WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 
22  In addition, as a special exception, the copyright holders give
23  permission to link the code of this program with any edition of
24  the Qt library by Trolltech AS, Norway (or with modified versions
25  of Qt that use the same license as Qt), and distribute linked
26  combinations including the two. You must obey the GNU General
27  Public License in all respects for all of the code used other than
28  Qt. If you modify this file, you may extend this exception to
29  your version of the file, but you are not obligated to do so. If
30  you do not wish to do so, delete this exception statement from
31  your version.
32 */
33 
34 #ifndef __MESSAGEVIEWER_HEADERSTYLE_H__
35 #define __MESSAGEVIEWER_HEADERSTYLE_H__
36 
37 #include "messageviewer_export.h"
38 
39 #include "grantleetheme/grantleetheme.h"
40 
41 #include <akonadi/kmime/messagestatus.h>
42 #include <KMime/Message>
43 
44 class QString;
45 
46 namespace MessageViewer {
47 
48 class HeaderStrategy;
49 class NodeHelper;
50 
60 class MESSAGEVIEWER_EXPORT HeaderStyle {
61 protected:
62  HeaderStyle();
63  virtual ~HeaderStyle();
64 
65 public:
66  //
67  // Factory methods:
68  //
69  enum Type {
70  Brief,
71  Plain,
72  Fancy,
73  Enterprise,
74  Mobile,
75  MobileExtended,
76  Custom,
77  Grantlee
78  };
79 
80  static HeaderStyle * create( Type type );
81  static HeaderStyle * create( const QString & type );
82 
83  static HeaderStyle * brief();
84  static HeaderStyle * plain();
85  static HeaderStyle * fancy();
86  static HeaderStyle * enterprise();
87  static HeaderStyle * mobile();
88  static HeaderStyle * mobileExtended();
89  static HeaderStyle * custom();
90  static HeaderStyle * grantlee();
91 
92  //
93  // Methods for handling the styles:
94  //
95  virtual const char * name() const = 0;
96 
97  //
98  // HeaderStyle interface:
99  //
100  virtual QString format( KMime::Message *message ) const = 0;
101 
102  // Should return true if this style has an attachment quick list
103  virtual bool hasAttachmentQuickList() const;
104 
105  void setMessagePath( const QString &path ) { mMessagePath = path; }
106  QString messagePath() const { return mMessagePath; }
107 
108  void setHeaderStrategy( const HeaderStrategy *strategy ) { mStrategy = strategy; }
109  const HeaderStrategy* headerStrategy() const { return mStrategy; }
110 
111  void setVCardName( const QString &vCardName ) { mVCardName = vCardName; }
112  QString vCardName() const { return mVCardName; }
113 
114  void setPrinting( bool printing ) { mPrinting = printing; }
115  bool isPrinting() const { return mPrinting; }
116 
117  void setTopLevel( bool topLevel ) { mTopLevel = topLevel; }
118  bool isTopLevel() const { return mTopLevel; }
119 
120  void setNodeHelper( NodeHelper *nodeHelper ) { mNodeHelper = nodeHelper; }
121  NodeHelper* nodeHelper() const { return mNodeHelper; }
122 
123  void setAllowAsync( bool allowAsync ) { mAllowAsync = allowAsync; }
124  bool allowAsync() const { return mAllowAsync; }
125 
126  void setSourceObject( QObject *sourceObject ) { mSourceObject = sourceObject; }
127  QObject* sourceObject() const { return mSourceObject; }
128 
129  void setMessageStatus( const Akonadi::MessageStatus &status ) { mMessageStatus = status; }
130  Akonadi::MessageStatus messageStatus() const { return mMessageStatus; }
131 
132  void setTheme(const GrantleeTheme::Theme &theme) { mTheme = theme; }
133  GrantleeTheme::Theme theme() const { return mTheme; }
134 
135 private:
136  GrantleeTheme::Theme mTheme;
137  QString mMessagePath;
138  const HeaderStrategy *mStrategy;
139  QString mVCardName;
140  bool mPrinting;
141  bool mTopLevel;
142  NodeHelper *mNodeHelper;
143  bool mAllowAsync;
144  QObject *mSourceObject;
145  Akonadi::MessageStatus mMessageStatus;
146 };
147 }
148 
149 #endif // __MESSAGEVIEWER_HEADERSTYLE_H__
MessageViewer::HeaderStyle::allowAsync
bool allowAsync() const
Definition: headerstyle.h:124
MessageViewer::HeaderStyle::setMessagePath
void setMessagePath(const QString &path)
Definition: headerstyle.h:105
MessageViewer::HeaderStyle
This class encapsulates the visual appearance of message headers.
Definition: headerstyle.h:60
MessageViewer::HeaderStyle::Brief
Definition: headerstyle.h:70
MessageViewer::HeaderStyle::headerStrategy
const HeaderStrategy * headerStrategy() const
Definition: headerstyle.h:109
MessageViewer::HeaderStyle::setHeaderStrategy
void setHeaderStrategy(const HeaderStrategy *strategy)
Definition: headerstyle.h:108
MessageViewer::HeaderStyle::setMessageStatus
void setMessageStatus(const Akonadi::MessageStatus &status)
Definition: headerstyle.h:129
MessageViewer::HeaderStyle::setTopLevel
void setTopLevel(bool topLevel)
Definition: headerstyle.h:117
MessageViewer::HeaderStyle::setPrinting
void setPrinting(bool printing)
Definition: headerstyle.h:114
MessageViewer::HeaderStrategy
Definition: headerstrategy.h:42
MessageViewer::HeaderStyle::Mobile
Definition: headerstyle.h:74
QObject
MessageViewer::HeaderStyle::setSourceObject
void setSourceObject(QObject *sourceObject)
Definition: headerstyle.h:126
MessageViewer::HeaderStyle::nodeHelper
NodeHelper * nodeHelper() const
Definition: headerstyle.h:121
MessageViewer::HeaderStyle::messageStatus
Akonadi::MessageStatus messageStatus() const
Definition: headerstyle.h:130
MessageViewer::HeaderStyle::Enterprise
Definition: headerstyle.h:73
MessageViewer::HeaderStyle::Plain
Definition: headerstyle.h:71
MessageViewer::HeaderStyle::messagePath
QString messagePath() const
Definition: headerstyle.h:106
MessageViewer::HeaderStyle::isTopLevel
bool isTopLevel() const
Definition: headerstyle.h:118
MessageViewer::HeaderStyle::setVCardName
void setVCardName(const QString &vCardName)
Definition: headerstyle.h:111
MessageViewer::HeaderStyle::theme
GrantleeTheme::Theme theme() const
Definition: headerstyle.h:133
MESSAGEVIEWER_EXPORT
#define MESSAGEVIEWER_EXPORT
Definition: messageviewer_export.h:37
type
const char * type
Definition: bodypartformatter.cpp:192
MessageViewer::NodeHelper
Definition: nodehelper.h:71
MessageViewer::HeaderStyle::isPrinting
bool isPrinting() const
Definition: headerstyle.h:115
MessageViewer::HeaderStyle::setAllowAsync
void setAllowAsync(bool allowAsync)
Definition: headerstyle.h:123
MessageViewer::HeaderStyle::sourceObject
QObject * sourceObject() const
Definition: headerstyle.h:127
MessageViewer::HeaderStyle::setTheme
void setTheme(const GrantleeTheme::Theme &theme)
Definition: headerstyle.h:132
MessageViewer::HeaderStyle::setNodeHelper
void setNodeHelper(NodeHelper *nodeHelper)
Definition: headerstyle.h:120
MessageViewer::HeaderStyle::Fancy
Definition: headerstyle.h:72
MessageViewer::HeaderStyle::Type
Type
Definition: headerstyle.h:69
MessageViewer::HeaderStyle::Custom
Definition: headerstyle.h:76
MessageViewer::HeaderStyle::vCardName
QString vCardName() const
Definition: headerstyle.h:112
MessageViewer::HeaderStyle::MobileExtended
Definition: headerstyle.h:75
messageviewer_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:57 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

messageviewer

Skip menu "messageviewer"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

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