Changeset View
Changeset View
Standalone View
Standalone View
framework/domain/mimetreeparser/objecttreesource.cpp
- This file was added.
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 | | ||||
27 | class ObjectSourcePrivate | ||||
28 | { | ||||
29 | public: | ||||
30 | ObjectSourcePrivate() | ||||
31 | : mWriter(0) | ||||
32 | , mAllowDecryption(true) | ||||
33 | , mHtmlLoadExternal(true) | ||||
34 | , mHtmlMail(true) | ||||
35 | { | ||||
36 | | ||||
37 | } | ||||
38 | MimeTreeParser::HtmlWriter *mWriter; | ||||
39 | MimeTreeParser::BodyPartFormatterBaseFactory mBodyPartFormatterBaseFactory; | ||||
40 | bool mAllowDecryption; | ||||
41 | bool mHtmlLoadExternal; | ||||
42 | bool mHtmlMail; | ||||
43 | }; | ||||
44 | | ||||
45 | ObjectTreeSource::ObjectTreeSource(MimeTreeParser::HtmlWriter *writer) | ||||
46 | : MimeTreeParser::Interface::ObjectTreeSource() | ||||
47 | , d(new ObjectSourcePrivate) | ||||
48 | { | ||||
49 | d->mWriter = writer; | ||||
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 | MimeTreeParser::HtmlWriter *ObjectTreeSource::htmlWriter() | ||||
63 | { | ||||
64 | return d->mWriter; | ||||
65 | } | ||||
66 | | ||||
67 | bool ObjectTreeSource::htmlLoadExternal() const | ||||
68 | { | ||||
69 | return d->mHtmlLoadExternal; | ||||
70 | } | ||||
71 | | ||||
72 | void ObjectTreeSource::setHtmlLoadExternal(bool loadExternal) | ||||
73 | { | ||||
74 | d->mHtmlLoadExternal = loadExternal; | ||||
75 | } | ||||
76 | | ||||
77 | bool ObjectTreeSource::htmlMail() const | ||||
78 | { | ||||
79 | return d->mHtmlMail; | ||||
80 | } | ||||
81 | | ||||
82 | void ObjectTreeSource::setHtmlMail(bool htmlMail) | ||||
83 | { | ||||
84 | d->mHtmlMail = htmlMail; | ||||
85 | } | ||||
86 | | ||||
87 | bool ObjectTreeSource::decryptMessage() const | ||||
88 | { | ||||
89 | return d->mAllowDecryption; | ||||
90 | } | ||||
91 | | ||||
92 | bool ObjectTreeSource::showSignatureDetails() const | ||||
93 | { | ||||
94 | return true; | ||||
95 | } | ||||
96 | | ||||
97 | int ObjectTreeSource::levelQuote() const | ||||
98 | { | ||||
99 | return 1; | ||||
100 | } | ||||
101 | | ||||
102 | const QTextCodec *ObjectTreeSource::overrideCodec() | ||||
103 | { | ||||
104 | return Q_NULLPTR; | ||||
105 | } | ||||
106 | | ||||
107 | QString ObjectTreeSource::createMessageHeader(KMime::Message *message) | ||||
108 | { | ||||
109 | return QString(); | ||||
110 | } | ||||
111 | | ||||
112 | const MimeTreeParser::AttachmentStrategy *ObjectTreeSource::attachmentStrategy() | ||||
113 | { | ||||
114 | return MimeTreeParser::AttachmentStrategy::smart(); | ||||
115 | } | ||||
116 | | ||||
117 | QObject *ObjectTreeSource::sourceObject() | ||||
118 | { | ||||
119 | return Q_NULLPTR; | ||||
120 | } | ||||
121 | | ||||
122 | void ObjectTreeSource::setHtmlMode(MimeTreeParser::Util::HtmlMode mode) | ||||
123 | { | ||||
124 | Q_UNUSED(mode); | ||||
125 | } | ||||
126 | | ||||
127 | bool ObjectTreeSource::autoImportKeys() const | ||||
128 | { | ||||
129 | return false; | ||||
130 | } | ||||
131 | | ||||
132 | bool ObjectTreeSource::showEmoticons() const | ||||
133 | { | ||||
134 | return false; | ||||
135 | } | ||||
136 | | ||||
137 | bool ObjectTreeSource::showExpandQuotesMark() const | ||||
138 | { | ||||
139 | return false; | ||||
140 | } | ||||
141 | | ||||
142 | const MimeTreeParser::BodyPartFormatterBaseFactory *ObjectTreeSource::bodyPartFormatterFactory() | ||||
143 | { | ||||
144 | return &(d->mBodyPartFormatterBaseFactory); | ||||
145 | } | ||||
146 | | ||||
147 | MimeTreeParser::Interface::MessagePartRenderer::Ptr ObjectTreeSource::messagePartTheme(MimeTreeParser::Interface::MessagePart::Ptr msgPart) | ||||
148 | { | ||||
149 | Q_UNUSED(msgPart); | ||||
150 | return MimeTreeParser::Interface::MessagePartRenderer::Ptr(); | ||||
151 | } |