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-2023 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 <Akonadi/MessageStatus>
17 #include <KMime/Message>
18 #include <memory.h>
19 
20 class QString;
21 
22 namespace MimeTreeParser
23 {
24 class NodeHelper;
25 }
26 
27 namespace GrantleeTheme
28 {
29 class Theme;
30 }
31 
32 namespace MessageViewer
33 {
34 class HeaderStrategy;
35 class HeaderStylePrivate;
36 
37 /** This class encapsulates the visual appearance of message
38  headers. Together with HeaderStrategy, which determines
39  which of the headers present in the message be shown, it is
40  responsible for the formatting of message headers.
41 
42  @short Encapsulates visual appearance of message headers.
43  @author Marc Mutz <[email protected]>
44  @see HeaderStrategy
45 **/
46 class MESSAGEVIEWER_EXPORT HeaderStyle
47 {
48 protected:
49  HeaderStyle();
50 
51 public:
52  virtual ~HeaderStyle();
53  //
54  // Methods for handling the styles:
55  //
56  virtual const char *name() const = 0;
57 
58  //
59  // HeaderStyle interface:
60  //
61  virtual QString format(KMime::Message *message) const = 0;
62 
63  void setHeaderStrategy(const HeaderStrategy *strategy);
64  [[nodiscard]] const HeaderStrategy *headerStrategy() const;
65 
66  void setVCardName(const QString &vCardName);
67  [[nodiscard]] QString vCardName() const;
68 
69  void setPrinting(bool printing);
70  [[nodiscard]] bool isPrinting() const;
71 
72  void setTopLevel(bool topLevel);
73  [[nodiscard]] bool isTopLevel() const;
74 
75  void setNodeHelper(MimeTreeParser::NodeHelper *nodeHelper);
76  [[nodiscard]] MimeTreeParser::NodeHelper *nodeHelper() const;
77 
78  void setAllowAsync(bool allowAsync);
79  [[nodiscard]] bool allowAsync() const;
80 
81  void setSourceObject(QObject *sourceObject);
82  QObject *sourceObject() const;
83 
84  void setMessageStatus(Akonadi::MessageStatus status);
85  [[nodiscard]] Akonadi::MessageStatus messageStatus() const;
86 
87  void setTheme(const GrantleeTheme::Theme &theme);
88  [[nodiscard]] GrantleeTheme::Theme theme() const;
89 
90  [[nodiscard]] bool readOnlyMessage() const;
91  void setReadOnlyMessage(bool readOnlyMessage);
92 
93  [[nodiscard]] bool showEmoticons() const;
94  void setShowEmoticons(bool b);
95 
96  void setAttachmentHtml(const QString &html);
97  [[nodiscard]] QString attachmentHtml() const;
98 
99 private:
100  std::unique_ptr<HeaderStylePrivate> const d;
101 };
102 }
The HeaderStrategy class.
This class encapsulates the visual appearance of message headers.
Definition: headerstyle.h:46
Q_SCRIPTABLE CaptureState status()
QString message
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Dec 2 2023 03:56:53 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.