summaryrefslogtreecommitdiffstats
path: root/framework/src/domain/mime/mimetreeparser/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/domain/mime/mimetreeparser/util.h')
-rw-r--r--framework/src/domain/mime/mimetreeparser/util.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/framework/src/domain/mime/mimetreeparser/util.h b/framework/src/domain/mime/mimetreeparser/util.h
new file mode 100644
index 00000000..099c647a
--- /dev/null
+++ b/framework/src/domain/mime/mimetreeparser/util.h
@@ -0,0 +1,67 @@
1/*
2 Copyright (c) 2016 Sandro Knauß <sknauss@kde.org>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19#ifndef __MIMETREEPARSER_UTILS_UTIL_H__
20#define __MIMETREEPARSER_UTILS_UTIL_H__
21
22#include <QString>
23
24class QMimeType;
25
26namespace KMime
27{
28class Content;
29}
30
31namespace MimeTreeParser
32{
33
34/**
35 * The Util namespace contains a collection of helper functions use in
36 * various places.
37 */
38namespace Util
39{
40
41/**
42 * Describes the type of the displayed message. This depends on the MIME structure
43 * of the mail and on whether HTML mode is enabled (which is decided by htmlMail())
44 */
45enum HtmlMode {
46 Normal, ///< A normal plaintext message, non-multipart
47 Html, ///< A HTML message, non-multipart
48 MultipartPlain, ///< A multipart/alternative message, the plain text part is currently displayed
49 MultipartHtml, ///< A multipart/altervative message, the HTML part is currently displayed
50 MultipartIcal ///< A multipart/altervative message, the ICal part is currently displayed
51};
52
53bool isTypeBlacklisted(KMime::Content *node);
54
55QString labelForContent(KMime::Content *node);
56
57QMimeType mimetype(const QString &name);
58
59QString iconNameForMimetype(const QString &mimeType,
60 const QString &fallbackFileName1 = QString(),
61 const QString &fallbackFileName2 = QString());
62
63QString iconNameForContent(KMime::Content *node);
64}
65}
66
67#endif