Messagelib

grantleeheaderstyle.cpp
1/*
2 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "grantleeheaderstyle.h"
8#include "header/grantleeheaderformatter.h"
9#include <GrantleeTheme/GrantleeTheme>
10
11#include <KMime/KMimeMessage>
12
13using namespace MessageViewer;
14class MessageViewer::GrantleeHeaderStylePrivate
15{
16public:
17 GrantleeHeaderStylePrivate()
18 : mGrantleeFormatter(new GrantleeHeaderFormatter)
19 {
20 }
21
22 ~GrantleeHeaderStylePrivate()
23 {
24 delete mGrantleeFormatter;
25 }
26
27 GrantleeHeaderFormatter *const mGrantleeFormatter;
28};
29
30GrantleeHeaderStyle::GrantleeHeaderStyle()
31 : HeaderStyle()
32 , d(new MessageViewer::GrantleeHeaderStylePrivate)
33{
34}
35
36GrantleeHeaderStyle::~GrantleeHeaderStyle() = default;
37
38const char *GrantleeHeaderStyle::name() const
39{
40 return "grantlee";
41}
42
43QString GrantleeHeaderStyle::format(KMime::Message *message) const
44{
45 if (!message) {
46 return {};
47 }
48
49 GrantleeHeaderFormatter::GrantleeHeaderFormatterSettings settings;
50 settings.isPrinting = isPrinting();
51 settings.theme = theme();
52 settings.style = this;
53 settings.message = message;
54 settings.showEmoticons = showEmoticons();
55 return d->mGrantleeFormatter->toHtml(settings);
56}
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 Sun Feb 25 2024 18:37:31 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.