Messagelib

grantleeheaderteststyle.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 "grantleeheaderteststyle.h"
8
9#include "header/grantleeheaderformatter.h"
10
11#include <KMime/Message>
12
13using namespace MessageViewer;
14
15class MessageViewer::GrantleeHeaderTestStylePrivate
16{
17public:
18 GrantleeHeaderTestStylePrivate()
19 : mGrantleeFormatter(new GrantleeHeaderFormatter)
20 {
21 }
22
23 ~GrantleeHeaderTestStylePrivate()
24 {
25 delete mGrantleeFormatter;
26 }
27
28 QStringList mExtraDisplay;
29 QString mAbsolutePath;
30 QString mMainFilename;
31 GrantleeHeaderFormatter *const mGrantleeFormatter;
32};
33
34GrantleeHeaderTestStyle::GrantleeHeaderTestStyle()
35 : HeaderStyle()
36 , d(new MessageViewer::GrantleeHeaderTestStylePrivate)
37{
38}
39
40GrantleeHeaderTestStyle::~GrantleeHeaderTestStyle() = default;
41
42const char *GrantleeHeaderTestStyle::name() const
43{
44 return "grantleetest";
45}
46
47QString GrantleeHeaderTestStyle::format(KMime::Message *message) const
48{
49 if (!message) {
50 return {};
51 }
52 return d->mGrantleeFormatter->toHtml(d->mExtraDisplay, d->mAbsolutePath, d->mMainFilename, this, message, isPrinting());
53}
54
55void GrantleeHeaderTestStyle::setAbsolutePath(const QString &path)
56{
57 d->mAbsolutePath = path;
58}
59
60void GrantleeHeaderTestStyle::setMainFilename(const QString &filename)
61{
62 d->mMainFilename = filename;
63}
64
65void GrantleeHeaderTestStyle::setExtraDisplayHeaders(const QStringList &extraDisplay)
66{
67 d->mExtraDisplay = extraDisplay;
68}
The GrantleeHeaderFormatter class.
This class encapsulates the visual appearance of message headers.
Definition headerstyle.h:47
QString path(const QString &relativePath)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:33:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.