Messagelib

simpleobjecttreesource.cpp
1/*
2 SPDX-FileCopyrightText: 2017 Sandro Kanuß <sknauss@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "simpleobjecttreesource.h"
8
9#include <MimeTreeParser/BodyPartFormatterFactory>
10#include <MimeTreeParser/MessagePart>
11#include <MimeTreeParser/ObjectTreeSource>
12
13using namespace MimeTreeParser;
14
15namespace MimeTreeParser
16{
17class SimpleObjectTreeSourcePrivate
18{
19public:
20 bool mDecryptMessage = false;
21 Util::HtmlMode mPreferredMode = Util::Html;
22 QByteArray mCodec;
23};
24}
25
26SimpleObjectTreeSource::SimpleObjectTreeSource()
27 : d(new SimpleObjectTreeSourcePrivate)
28{
29}
30
31SimpleObjectTreeSource::~SimpleObjectTreeSource() = default;
32
34{
35 return true;
36}
37
38const BodyPartFormatterFactory *SimpleObjectTreeSource::bodyPartFormatterFactory()
39{
40 return BodyPartFormatterFactory::instance();
41}
42
44{
45 return d->mDecryptMessage;
46}
47
48void SimpleObjectTreeSource::setDecryptMessage(bool decryptMessage)
49{
50 d->mDecryptMessage = decryptMessage;
51}
52
53void SimpleObjectTreeSource::setPreferredMode(MimeTreeParser::Util::HtmlMode mode)
54{
55 d->mPreferredMode = mode;
56}
57
59{
60 return d->mPreferredMode;
61}
62
63void SimpleObjectTreeSource::setOverrideCodecName(const QByteArray &codec)
64{
65 d->mCodec = codec;
66}
67
69{
70 return d->mCodec;
71}
72
74{
75 Q_UNUSED(mode)
76 Q_UNUSED(availableModes)
77}
The place to obtain BodyPartFormatter candidates for a given mime type.
MimeTreeParser::Util::HtmlMode preferredMode() const override
Return the mode that is the preferred to display.
QByteArray overrideCodecName() const override
The override codec that should be used for the mail.
bool decryptMessage() const override
Return true if an encrypted mail should be decrypted.
bool autoImportKeys() const override
should keys be imported automatically
void setHtmlMode(MimeTreeParser::Util::HtmlMode mode, const QList< MimeTreeParser::Util::HtmlMode > &availableModes) override
Sets the type of mail that is currently displayed.
HtmlMode
Describes the type of the displayed message.
@ Html
A HTML message, non-multipart.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 11:56:32 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.