summaryrefslogtreecommitdiffstats
path: root/framework/domain/objecttreesource.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'framework/domain/objecttreesource.cpp')
-rw-r--r--framework/domain/objecttreesource.cpp144
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
24class ObjectSourcePrivate
25{
26public:
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
43ObjectTreeSource::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
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::CSSHelperBase *ObjectTreeSource::cssHelper()
67{
68 return d->mCSSHelper;
69}
70
71bool ObjectTreeSource::htmlLoadExternal() const
72{
73 return d->mHtmlLoadExternal;
74}
75
76void ObjectTreeSource::setHtmlLoadExternal(bool loadExternal)
77{
78 d->mHtmlLoadExternal = loadExternal;
79}
80
81bool ObjectTreeSource::htmlMail() const
82{
83 return d->mHtmlMail;
84}
85
86void ObjectTreeSource::setHtmlMail(bool htmlMail)
87{
88 d->mHtmlMail = htmlMail;
89}
90
91bool ObjectTreeSource::decryptMessage() const
92{
93 return d->mAllowDecryption;
94}
95
96bool ObjectTreeSource::showSignatureDetails() const
97{
98 return true;
99}
100
101int ObjectTreeSource::levelQuote() const
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}
130
131bool ObjectTreeSource::autoImportKeys() const
132{
133 return false;
134}
135
136bool ObjectTreeSource::showEmoticons() const
137{
138 return false;
139}
140
141bool ObjectTreeSource::showExpandQuotesMark() const
142{
143 return false;
144}