diff options
author | Sandro Knauß <sknauss@kde.org> | 2016-01-12 16:55:57 +0100 |
---|---|---|
committer | Sandro Knauß <sknauss@kde.org> | 2016-01-12 16:55:57 +0100 |
commit | 06201e4d405cef119207b528f76f8f993c09e527 (patch) | |
tree | a8d5f9db850d8c977060b1f76e761c50eda7c047 /framework/mail/objecttreesource.cpp | |
parent | e9b4b2d564c46e1b75c46376e7d4f7fdac757e5e (diff) | |
download | kube-06201e4d405cef119207b528f76f8f993c09e527.tar.gz kube-06201e4d405cef119207b528f76f8f993c09e527.zip |
render mail to html
Diffstat (limited to 'framework/mail/objecttreesource.cpp')
-rw-r--r-- | framework/mail/objecttreesource.cpp | 129 |
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 | |||
24 | class ObjectSourcePrivate | ||
25 | { | ||
26 | public: | ||
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 | |||
43 | ObjectTreeSource::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 | |||
52 | ObjectTreeSource::~ObjectTreeSource() | ||
53 | { | ||
54 | delete d; | ||
55 | } | ||
56 | |||
57 | void ObjectTreeSource::setAllowDecryption(bool allowDecryption) | ||
58 | { | ||
59 | d->mAllowDecryption = allowDecryption; | ||
60 | } | ||
61 | |||
62 | MessageViewer::HtmlWriter *ObjectTreeSource::htmlWriter() | ||
63 | { | ||
64 | return d->mWriter; | ||
65 | } | ||
66 | MessageViewer::CSSHelper *ObjectTreeSource::cssHelper() | ||
67 | { | ||
68 | return d->mCSSHelper; | ||
69 | } | ||
70 | |||
71 | bool ObjectTreeSource::htmlLoadExternal() | ||
72 | { | ||
73 | return d->mHtmlLoadExternal; | ||
74 | } | ||
75 | |||
76 | void ObjectTreeSource::setHtmlLoadExternal(bool loadExternal) | ||
77 | { | ||
78 | d->mHtmlLoadExternal = loadExternal; | ||
79 | } | ||
80 | |||
81 | bool ObjectTreeSource::htmlMail() | ||
82 | { | ||
83 | return d->mHtmlMail; | ||
84 | } | ||
85 | |||
86 | void ObjectTreeSource::setHtmlMail(bool htmlMail) | ||
87 | { | ||
88 | d->mHtmlMail = htmlMail; | ||
89 | } | ||
90 | |||
91 | bool ObjectTreeSource::decryptMessage() | ||
92 | { | ||
93 | return d->mAllowDecryption; | ||
94 | } | ||
95 | |||
96 | bool ObjectTreeSource::showSignatureDetails() | ||
97 | { | ||
98 | return true; | ||
99 | } | ||
100 | |||
101 | int ObjectTreeSource::levelQuote() | ||
102 | { | ||
103 | return 1; | ||
104 | } | ||
105 | |||
106 | const QTextCodec *ObjectTreeSource::overrideCodec() | ||
107 | { | ||
108 | return Q_NULLPTR; | ||
109 | } | ||
110 | |||
111 | QString ObjectTreeSource::createMessageHeader(KMime::Message *message) | ||
112 | { | ||
113 | return QString(); | ||
114 | } | ||
115 | |||
116 | const MessageViewer::AttachmentStrategy *ObjectTreeSource::attachmentStrategy() | ||
117 | { | ||
118 | return MessageViewer::AttachmentStrategy::smart(); | ||
119 | } | ||
120 | |||
121 | QObject *ObjectTreeSource::sourceObject() | ||
122 | { | ||
123 | return Q_NULLPTR; | ||
124 | } | ||
125 | |||
126 | void ObjectTreeSource::setHtmlMode(MessageViewer::Util::HtmlMode mode) | ||
127 | { | ||
128 | Q_UNUSED(mode); | ||
129 | } \ No newline at end of file | ||