Messagelib

grantleeheaderstyle.cpp
1/*
2 SPDX-FileCopyrightText: 2013-2025 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/Message>
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 : d(new MessageViewer::GrantleeHeaderStylePrivate)
32{
33}
34
35GrantleeHeaderStyle::~GrantleeHeaderStyle() = default;
36
37const char *GrantleeHeaderStyle::name() const
38{
39 return "grantlee";
40}
41
42QString GrantleeHeaderStyle::format(KMime::Message *message) const
43{
44 if (!message) {
45 return {};
46 }
47
48 GrantleeHeaderFormatter::GrantleeHeaderFormatterSettings settings;
49 settings.isPrinting = isPrinting();
50 settings.theme = theme();
51 settings.style = this;
52 settings.message = message;
53 settings.showEmoticons = showEmoticons();
54 return d->mGrantleeFormatter->toHtml(settings);
55}
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Apr 25 2025 11:46:37 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.