summaryrefslogtreecommitdiffstats
path: root/framework/src/domain/objecttreesource.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/domain/objecttreesource.cpp')
-rw-r--r--framework/src/domain/objecttreesource.cpp152
1 files changed, 152 insertions, 0 deletions
diff --git a/framework/src/domain/objecttreesource.cpp b/framework/src/domain/objecttreesource.cpp
new file mode 100644
index 00000000..567f3516
--- /dev/null
+++ b/framework/src/domain/objecttreesource.cpp
@@ -0,0 +1,152 @@
1/*
2 Copyright (C) 2009 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.net
3 Copyright (c) 2009 Andras Mantia <andras@kdab.net>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18*/
19
20#include "objecttreesource.h"
21
22#include <MimeTreeParser/AttachmentStrategy>
23#include <MimeTreeParser/BodyPartFormatterBaseFactory>
24#include <MimeTreeParser/MessagePart>
25#include <MimeTreeParser/MessagePartRenderer>
26
27class ObjectSourcePrivate
28{
29public:
30 ObjectSourcePrivate()
31 : mWriter(0)
32 , mAllowDecryption(true)
33 , mHtmlLoadExternal(true)
34 , mPreferredMode(MimeTreeParser::Util::Html)
35 {
36
37 }
38 MimeTreeParser::HtmlWriter *mWriter;
39 MimeTreeParser::BodyPartFormatterBaseFactory mBodyPartFormatterBaseFactory;
40 bool mAllowDecryption;
41 bool mHtmlLoadExternal;
42 MimeTreeParser::Util::HtmlMode mPreferredMode;
43};
44
45ObjectTreeSource::ObjectTreeSource(MimeTreeParser::HtmlWriter *writer)
46 : MimeTreeParser::Interface::ObjectTreeSource()
47 , d(new ObjectSourcePrivate)
48 {
49 d->mWriter = writer;
50 }
51
52ObjectTreeSource::~ObjectTreeSource()
53{
54 delete d;
55}
56
57void ObjectTreeSource::setAllowDecryption(bool allowDecryption)
58{
59 d->mAllowDecryption = allowDecryption;
60}
61
62MimeTreeParser::HtmlWriter *ObjectTreeSource::htmlWriter()
63{
64 return d->mWriter;
65}
66
67bool ObjectTreeSource::htmlLoadExternal() const
68{
69 return d->mHtmlLoadExternal;
70}
71
72void ObjectTreeSource::setHtmlLoadExternal(bool loadExternal)
73{
74 d->mHtmlLoadExternal = loadExternal;
75}
76
77bool ObjectTreeSource::decryptMessage() const
78{
79 return d->mAllowDecryption;
80}
81
82bool ObjectTreeSource::showSignatureDetails() const
83{
84 return true;
85}
86
87int ObjectTreeSource::levelQuote() const
88{
89 return 1;
90}
91
92const QTextCodec *ObjectTreeSource::overrideCodec()
93{
94 return Q_NULLPTR;
95}
96
97QString ObjectTreeSource::createMessageHeader(KMime::Message *message)
98{
99 return QString();
100}
101
102const MimeTreeParser::AttachmentStrategy *ObjectTreeSource::attachmentStrategy()
103{
104 return MimeTreeParser::AttachmentStrategy::smart();
105}
106
107QObject *ObjectTreeSource::sourceObject()
108{
109 return Q_NULLPTR;
110}
111
112void ObjectTreeSource::setHtmlMode(MimeTreeParser::Util::HtmlMode mode, const QList<MimeTreeParser::Util::HtmlMode> &availableModes)
113{
114 Q_UNUSED(mode);
115 Q_UNUSED(availableModes);
116}
117
118MimeTreeParser::Util::HtmlMode ObjectTreeSource::preferredMode() const
119{
120 return d->mPreferredMode;
121}
122
123bool ObjectTreeSource::autoImportKeys() const
124{
125 return false;
126}
127
128bool ObjectTreeSource::showEmoticons() const
129{
130 return false;
131}
132
133bool ObjectTreeSource::showExpandQuotesMark() const
134{
135 return false;
136}
137
138bool ObjectTreeSource::isPrinting() const
139{
140 return false;
141}
142
143const MimeTreeParser::BodyPartFormatterBaseFactory *ObjectTreeSource::bodyPartFormatterFactory()
144{
145 return &(d->mBodyPartFormatterBaseFactory);
146}
147
148MimeTreeParser::Interface::MessagePartRenderer::Ptr ObjectTreeSource::messagePartTheme(MimeTreeParser::Interface::MessagePart::Ptr msgPart)
149{
150 Q_UNUSED(msgPart);
151 return MimeTreeParser::Interface::MessagePartRenderer::Ptr();
152}