Messagelib

grantleeheaderformatter.h
1/*
2 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "messageviewer_export.h"
10#include <GrantleeTheme/GrantleeTheme>
11#include <KTextTemplate/TemplateLoader>
12#include <QString>
13namespace KMime
14{
15class Message;
16}
17
18namespace MessageViewer
19{
20class HeaderStyle;
21/**
22 * @brief The GrantleeHeaderFormatter class
23 * @author Laurent Montel <montel@kde.org>
24 */
25class MESSAGEVIEWER_EXPORT GrantleeHeaderFormatter
26{
27public:
28 struct GrantleeHeaderFormatterSettings {
29 GrantleeHeaderFormatterSettings() = default;
30
32 bool isPrinting = false;
33 mutable const MessageViewer::HeaderStyle *style = nullptr;
34 KMime::Message *message = nullptr;
35 bool showEmoticons = true;
36 };
37
38 explicit GrantleeHeaderFormatter();
40
41 [[nodiscard]] QString toHtml(const GrantleeHeaderFormatterSettings &settings) const;
42
43 [[nodiscard]] QString toHtml(const QStringList &displayExtraHeaders,
44 const QString &absolutPath,
45 const QString &filename,
46 const MessageViewer::HeaderStyle *style,
47 KMime::Message *message,
48 bool isPrinting) const;
49
50private:
51 [[nodiscard]] MESSAGEVIEWER_NO_EXPORT QString format(const QString &absolutePath,
52 const KTextTemplate::Template &headerTemplate,
53 const QStringList &displayExtraHeaders,
54 bool isPrinting,
55 const MessageViewer::HeaderStyle *style,
56 KMime::Message *message,
57 bool showEmoticons = true) const;
58 class GrantleeHeaderFormatterPrivate;
59 std::unique_ptr<GrantleeHeaderFormatterPrivate> const d;
60};
61}
The GrantleeHeaderFormatter class.
This class encapsulates the visual appearance of message headers.
Definition headerstyle.h:47
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:12:43 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.