Messagelib

headerstyle.h
1 /* -*- c++ -*-
2  headerstyle.h
3 
4  This file is part of KMail, the KDE mail client.
5  SPDX-FileCopyrightText: 2003 Marc Mutz <[email protected]>
6 
7  SPDX-FileCopyrightText: 2013-2021 Laurent Montel <[email protected]>
8 
9  SPDX-License-Identifier: GPL-2.0-or-later
10 */
11 
12 #pragma once
13 
14 #include "messageviewer_export.h"
15 
16 //#include <GrantleeTheme/GrantleeTheme>
17 
18 #include <Akonadi/KMime/MessageStatus>
19 #include <KMime/Message>
20 
21 class QString;
22 
23 namespace MimeTreeParser
24 {
25 class NodeHelper;
26 }
27 
28 namespace GrantleeTheme
29 {
30 class Theme;
31 }
32 
33 namespace MessageViewer
34 {
35 class HeaderStrategy;
36 class HeaderStylePrivate;
37 
38 /** This class encapsulates the visual appearance of message
39  headers. Together with HeaderStrategy, which determines
40  which of the headers present in the message be shown, it is
41  responsible for the formatting of message headers.
42 
43  @short Encapsulates visual appearance of message headers.
44  @author Marc Mutz <[email protected]>
45  @see HeaderStrategy
46 **/
47 class MESSAGEVIEWER_EXPORT HeaderStyle
48 {
49 protected:
50  HeaderStyle();
51 
52 public:
53  virtual ~HeaderStyle();
54  //
55  // Methods for handling the styles:
56  //
57  virtual const char *name() const = 0;
58 
59  //
60  // HeaderStyle interface:
61  //
62  virtual QString format(KMime::Message *message) const = 0;
63 
64  void setHeaderStrategy(const HeaderStrategy *strategy);
65  Q_REQUIRED_RESULT const HeaderStrategy *headerStrategy() const;
66 
67  void setVCardName(const QString &vCardName);
68  Q_REQUIRED_RESULT QString vCardName() const;
69 
70  void setPrinting(bool printing);
71  Q_REQUIRED_RESULT bool isPrinting() const;
72 
73  void setTopLevel(bool topLevel);
74  Q_REQUIRED_RESULT bool isTopLevel() const;
75 
76  void setNodeHelper(MimeTreeParser::NodeHelper *nodeHelper);
77  Q_REQUIRED_RESULT MimeTreeParser::NodeHelper *nodeHelper() const;
78 
79  void setAllowAsync(bool allowAsync);
80  Q_REQUIRED_RESULT bool allowAsync() const;
81 
82  void setSourceObject(QObject *sourceObject);
83  QObject *sourceObject() const;
84 
85  void setMessageStatus(Akonadi::MessageStatus status);
86  Q_REQUIRED_RESULT Akonadi::MessageStatus messageStatus() const;
87 
88  void setTheme(const GrantleeTheme::Theme &theme);
89  Q_REQUIRED_RESULT GrantleeTheme::Theme theme() const;
90 
91  Q_REQUIRED_RESULT bool readOnlyMessage() const;
92  void setReadOnlyMessage(bool readOnlyMessage);
93 
94  Q_REQUIRED_RESULT bool showEmoticons() const;
95  void setShowEmoticons(bool b);
96 
97  void setAttachmentHtml(const QString &html);
98  Q_REQUIRED_RESULT QString attachmentHtml() const;
99 
100 private:
101  HeaderStylePrivate *const d;
102 };
103 }
104 
This class encapsulates the visual appearance of message headers.
Definition: headerstyle.h:47
The HeaderStrategy class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Apr 16 2021 23:13:59 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.