diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-01-21 11:36:43 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-01-21 11:36:43 +0100 |
commit | bf96cfa0d75d256e036c76ec64f0f456014f2739 (patch) | |
tree | 3ab0ff603dfccb9f28040af3a1559b01af09aa3f /framework/mail/stringhtmlwriter.h | |
parent | e4e11ba46f4ccce5f9ca63ab758a132d945061e8 (diff) | |
parent | 9a3059769a0bf9dbf81e523c9245d2aa98420bb5 (diff) | |
download | kube-bf96cfa0d75d256e036c76ec64f0f456014f2739.tar.gz kube-bf96cfa0d75d256e036c76ec64f0f456014f2739.zip |
Merge remote-tracking branch 'origin/dev/libotp' into develop
Conflicts:
framework/mail/CMakeLists.txt
Diffstat (limited to 'framework/mail/stringhtmlwriter.h')
-rw-r--r-- | framework/mail/stringhtmlwriter.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/framework/mail/stringhtmlwriter.h b/framework/mail/stringhtmlwriter.h new file mode 100644 index 00000000..0805d027 --- /dev/null +++ b/framework/mail/stringhtmlwriter.h | |||
@@ -0,0 +1,68 @@ | |||
1 | /* -*- c++ -*- | ||
2 | |||
3 | Copyright (c) 2016 Sandro Knauß <sknauss@kde.org> | ||
4 | |||
5 | Kube is free software; you can redistribute it and/or modify it | ||
6 | under the terms of the GNU General Public License, version 2, as | ||
7 | published by the Free Software Foundation. | ||
8 | |||
9 | Kube is distributed in the hope that it will be useful, but | ||
10 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program; if not, write to the Free Software | ||
16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
17 | |||
18 | In addition, as a special exception, the copyright holders give | ||
19 | permission to link the code of this program with any edition of | ||
20 | the Qt library by Trolltech AS, Norway (or with modified versions | ||
21 | of Qt that use the same license as Qt), and distribute linked | ||
22 | combinations including the two. You must obey the GNU General | ||
23 | Public License in all respects for all of the code used other than | ||
24 | Qt. If you modify this file, you may extend this exception to | ||
25 | your version of the file, but you are not obligated to do so. If | ||
26 | you do not wish to do so, delete this exception statement from | ||
27 | your version. | ||
28 | */ | ||
29 | |||
30 | #ifndef __KUBE_FRAMEWORK_MAIL_STRINGHTMLWRITER_H__ | ||
31 | #define __KUBE_FRAMEWORK_MAIL_STRINGHTMLWRITER_H__ | ||
32 | |||
33 | #include <MessageViewer/HtmlWriter> | ||
34 | |||
35 | #include <QFile> | ||
36 | #include <QTextStream> | ||
37 | |||
38 | class QString; | ||
39 | |||
40 | class StringHtmlWriter : public MessageViewer::HtmlWriter | ||
41 | { | ||
42 | public: | ||
43 | explicit StringHtmlWriter(); | ||
44 | virtual ~StringHtmlWriter(); | ||
45 | |||
46 | void begin(const QString &cssDefs) Q_DECL_OVERRIDE; | ||
47 | void end() Q_DECL_OVERRIDE; | ||
48 | void reset() Q_DECL_OVERRIDE; | ||
49 | void write(const QString &str) Q_DECL_OVERRIDE; | ||
50 | void queue(const QString &str) Q_DECL_OVERRIDE; | ||
51 | void flush() Q_DECL_OVERRIDE; | ||
52 | void embedPart(const QByteArray &contentId, const QString &url) Q_DECL_OVERRIDE; | ||
53 | void extraHead(const QString &str) Q_DECL_OVERRIDE; | ||
54 | |||
55 | QString html() const; | ||
56 | private: | ||
57 | void insertExtraHead(); | ||
58 | |||
59 | QString mHtml; | ||
60 | QString mExtraHead; | ||
61 | enum State { | ||
62 | Begun, | ||
63 | Queued, | ||
64 | Ended | ||
65 | } mState; | ||
66 | }; | ||
67 | |||
68 | #endif // __MESSAGEVIEWER_FILEHTMLWRITER_H__ | ||