diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-03-09 15:20:31 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-03-09 15:20:31 +0100 |
commit | f5185c4799fe0e9c31a218dfc8310515ac921c2b (patch) | |
tree | 5524d7a85c8bf82890d79ec6d1bb82b5124fd3b3 /framework/domain/objecttreesource.cpp | |
parent | c9ccf868f5d533a07811b949577f772f618d2de3 (diff) | |
download | kube-f5185c4799fe0e9c31a218dfc8310515ac921c2b.tar.gz kube-f5185c4799fe0e9c31a218dfc8310515ac921c2b.zip |
Moved framework/mail to framework/domain
Diffstat (limited to 'framework/domain/objecttreesource.cpp')
-rw-r--r-- | framework/domain/objecttreesource.cpp | 144 |
1 files changed, 144 insertions, 0 deletions
diff --git a/framework/domain/objecttreesource.cpp b/framework/domain/objecttreesource.cpp new file mode 100644 index 00000000..d14b7b9b --- /dev/null +++ b/framework/domain/objecttreesource.cpp | |||
@@ -0,0 +1,144 @@ | |||
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(true) | ||
31 | , mHtmlLoadExternal(true) | ||
32 | , mHtmlMail(true) | ||
33 | { | ||
34 | |||
35 | } | ||
36 | MessageViewer::HtmlWriter *mWriter; | ||
37 | MessageViewer::CSSHelperBase *mCSSHelper; | ||
38 | bool mAllowDecryption; | ||
39 | bool mHtmlLoadExternal; | ||
40 | bool mHtmlMail; | ||
41 | }; | ||
42 | |||
43 | ObjectTreeSource::ObjectTreeSource(MessageViewer::HtmlWriter *writer, | ||
44 | MessageViewer::CSSHelperBase *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::CSSHelperBase *ObjectTreeSource::cssHelper() | ||
67 | { | ||
68 | return d->mCSSHelper; | ||
69 | } | ||
70 | |||
71 | bool ObjectTreeSource::htmlLoadExternal() const | ||
72 | { | ||
73 | return d->mHtmlLoadExternal; | ||
74 | } | ||
75 | |||
76 | void ObjectTreeSource::setHtmlLoadExternal(bool loadExternal) | ||
77 | { | ||
78 | d->mHtmlLoadExternal = loadExternal; | ||
79 | } | ||
80 | |||
81 | bool ObjectTreeSource::htmlMail() const | ||
82 | { | ||
83 | return d->mHtmlMail; | ||
84 | } | ||
85 | |||
86 | void ObjectTreeSource::setHtmlMail(bool htmlMail) | ||
87 | { | ||
88 | d->mHtmlMail = htmlMail; | ||
89 | } | ||
90 | |||
91 | bool ObjectTreeSource::decryptMessage() const | ||
92 | { | ||
93 | return d->mAllowDecryption; | ||
94 | } | ||
95 | |||
96 | bool ObjectTreeSource::showSignatureDetails() const | ||
97 | { | ||
98 | return true; | ||
99 | } | ||
100 | |||
101 | int ObjectTreeSource::levelQuote() const | ||
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 | } | ||
130 | |||
131 | bool ObjectTreeSource::autoImportKeys() const | ||
132 | { | ||
133 | return false; | ||
134 | } | ||
135 | |||
136 | bool ObjectTreeSource::showEmoticons() const | ||
137 | { | ||
138 | return false; | ||
139 | } | ||
140 | |||
141 | bool ObjectTreeSource::showExpandQuotesMark() const | ||
142 | { | ||
143 | return false; | ||
144 | } | ||