Messagelib

simpleobjecttreesource.cpp
1 /*
2  SPDX-FileCopyrightText: 2017 Sandro Kanuß <[email protected]>
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 
13 using namespace MimeTreeParser;
14 
15 namespace MimeTreeParser
16 {
17 class SimpleObjectTreeSourcePrivate
18 {
19 public:
20  bool mDecryptMessage = false;
21  Util::HtmlMode mPreferredMode = Util::Html;
22  QTextCodec *mCodec = nullptr;
23 };
24 }
25 
26 SimpleObjectTreeSource::SimpleObjectTreeSource()
27  : d(new SimpleObjectTreeSourcePrivate)
28 {
29 }
30 
31 SimpleObjectTreeSource::~SimpleObjectTreeSource() = default;
32 
33 bool SimpleObjectTreeSource::autoImportKeys() const
34 {
35  return true;
36 }
37 
38 const BodyPartFormatterFactory *SimpleObjectTreeSource::bodyPartFormatterFactory()
39 {
40  return BodyPartFormatterFactory::instance();
41 }
42 
43 bool SimpleObjectTreeSource::decryptMessage() const
44 {
45  return d->mDecryptMessage;
46 }
47 
48 void SimpleObjectTreeSource::setDecryptMessage(bool decryptMessage)
49 {
50  d->mDecryptMessage = decryptMessage;
51 }
52 
53 void SimpleObjectTreeSource::setPreferredMode(MimeTreeParser::Util::HtmlMode mode)
54 {
55  d->mPreferredMode = mode;
56 }
57 
58 MimeTreeParser::Util::HtmlMode SimpleObjectTreeSource::preferredMode() const
59 {
60  return d->mPreferredMode;
61 }
62 
63 void SimpleObjectTreeSource::setOverrideCodec(QTextCodec *codec)
64 {
65  d->mCodec = codec;
66 }
67 
68 const QTextCodec *SimpleObjectTreeSource::overrideCodec()
69 {
70  return d->mCodec;
71 }
72 
73 void SimpleObjectTreeSource::setHtmlMode(MimeTreeParser::Util::HtmlMode mode, const QList<MimeTreeParser::Util::HtmlMode> &availableModes)
74 {
75  Q_UNUSED(mode)
76  Q_UNUSED(availableModes)
77 }
@ Html
A HTML message, non-multipart.
HtmlMode
Describes the type of the displayed message.
The place to obtain BodyPartFormatter candidates for a given mime type.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu May 19 2022 03:53:26 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.