Messagelib

grantleeheaderformatter.h
1 /*
2  SPDX-FileCopyrightText: 2013-2020 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef GRANTLEEHEADERFORMATTER_H
8 #define GRANTLEEHEADERFORMATTER_H
9 
10 #include <QString>
11 #include <grantlee/templateloader.h>
12 #include <GrantleeTheme/GrantleeTheme>
13 #include "messageviewer_export.h"
14 namespace KMime {
15 class Message;
16 }
17 
18 namespace MessageViewer {
19 class HeaderStyle;
24 class MESSAGEVIEWER_EXPORT GrantleeHeaderFormatter
25 {
26 public:
27  struct GrantleeHeaderFormatterSettings {
28  GrantleeHeaderFormatterSettings()
29  {
30  }
31 
33  bool isPrinting = false;
34  mutable const MessageViewer::HeaderStyle *style = nullptr;
35  KMime::Message *message = nullptr;
36  bool showEmoticons = true;
37  };
38 
39  explicit GrantleeHeaderFormatter();
41 
42  Q_REQUIRED_RESULT QString toHtml(const GrantleeHeaderFormatterSettings &settings) const;
43 
44  Q_REQUIRED_RESULT QString toHtml(const QStringList &displayExtraHeaders, const QString &absolutPath, const QString &filename, const MessageViewer::HeaderStyle *style, KMime::Message *message, bool isPrinting) const;
45 private:
46  Q_REQUIRED_RESULT QString format(const QString &absolutePath, const Grantlee::Template &headerTemplate, const QStringList &displayExtraHeaders, bool isPrinting, const MessageViewer::HeaderStyle *style, KMime::Message *message, bool showEmoticons = true) const;
47  class Private;
48  Private *const d;
49 };
50 }
51 
52 #endif // GRANTLEEHEADERFORMATTER_H
This class encapsulates the visual appearance of message headers.
Definition: headerstyle.h:45
The GrantleeHeaderFormatter class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Oct 19 2020 23:19:01 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.