summaryrefslogtreecommitdiffstats
path: root/framework/mail/objecttreesource.cpp
diff options
context:
space:
mode:
authorSandro Knauß <sknauss@kde.org>2016-01-12 16:55:57 +0100
committerSandro Knauß <sknauss@kde.org>2016-01-12 16:55:57 +0100
commit06201e4d405cef119207b528f76f8f993c09e527 (patch)
treea8d5f9db850d8c977060b1f76e761c50eda7c047 /framework/mail/objecttreesource.cpp
parente9b4b2d564c46e1b75c46376e7d4f7fdac757e5e (diff)
downloadkube-06201e4d405cef119207b528f76f8f993c09e527.tar.gz
kube-06201e4d405cef119207b528f76f8f993c09e527.zip
render mail to html
Diffstat (limited to 'framework/mail/objecttreesource.cpp')
-rw-r--r--framework/mail/objecttreesource.cpp129
1 files changed, 129 insertions, 0 deletions
diff --git a/framework/mail/objecttreesource.cpp b/framework/mail/objecttreesource.cpp
new file mode 100644
index 00000000..cde4775a
--- /dev/null
+++ b/framework/mail/objecttreesource.cpp
@@ -0,0 +1,129 @@
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 <MessageViewer/AttachmentStrategy>
23
24class ObjectSourcePrivate
25{
26public:
27 ObjectSourcePrivate()
28 : mWriter(0)
29 , mCSSHelper(0)
30 , mAllowDecryption(false)
31 , mHtmlLoadExternal(false)
32 , mHtmlMail(false)
33 {
34
35 }
36 MessageViewer::HtmlWriter *mWriter;
37 MessageViewer::CSSHelper *mCSSHelper;
38 bool mAllowDecryption;
39 bool mHtmlLoadExternal;
40 bool mHtmlMail;
41};
42
43ObjectTreeSource::ObjectTreeSource(MessageViewer::HtmlWriter *writer,
44 MessageViewer::CSSHelper *cssHelper)
45 : MessageViewer::ObjectTreeSourceIf()
46 , d(new ObjectSourcePrivate)
47 {
48 d->mWriter = writer;
49 d->mCSSHelper = cssHelper;
50 }
51
52ObjectTreeSource::~ObjectTreeSource()
53{
54 delete d;
55}
56
57void ObjectTreeSource::setAllowDecryption(bool allowDecryption)
58{
59 d->mAllowDecryption = allowDecryption;
60}
61
62MessageViewer::HtmlWriter *ObjectTreeSource::htmlWriter()
63{
64 return d->mWriter;
65}
66MessageViewer::CSSHelper *ObjectTreeSource::cssHelper()
67{
68 return d->mCSSHelper;
69}
70
71bool ObjectTreeSource::htmlLoadExternal()
72{
73 return d->mHtmlLoadExternal;
74}
75
76void ObjectTreeSource::setHtmlLoadExternal(bool loadExternal)
77{
78 d->mHtmlLoadExternal = loadExternal;
79}
80
81bool ObjectTreeSource::htmlMail()
82{
83 return d->mHtmlMail;
84}
85
86void ObjectTreeSource::setHtmlMail(bool htmlMail)
87{
88 d->mHtmlMail = htmlMail;
89}
90
91bool ObjectTreeSource::decryptMessage()
92{
93 return d->mAllowDecryption;
94}
95
96bool ObjectTreeSource::showSignatureDetails()
97{
98 return true;
99}
100
101int ObjectTreeSource::levelQuote()
102{
103 return 1;
104}
105
106const QTextCodec *ObjectTreeSource::overrideCodec()
107{
108 return Q_NULLPTR;
109}
110
111QString ObjectTreeSource::createMessageHeader(KMime::Message *message)
112{
113 return QString();
114}
115
116const MessageViewer::AttachmentStrategy *ObjectTreeSource::attachmentStrategy()
117{
118 return MessageViewer::AttachmentStrategy::smart();
119}
120
121QObject *ObjectTreeSource::sourceObject()
122{
123 return Q_NULLPTR;
124}
125
126void ObjectTreeSource::setHtmlMode(MessageViewer::Util::HtmlMode mode)
127{
128 Q_UNUSED(mode);
129} \ No newline at end of file