File indexing completed on 2024-06-23 05:19:21
0001 /* 0002 SPDX-FileCopyrightText: 2016 Sandro Knauß <sknauss@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "mimetreeparser_export.h" 0010 0011 #include <QString> 0012 0013 class QMimeType; 0014 0015 namespace KMime 0016 { 0017 class Content; 0018 } 0019 0020 namespace MimeTreeParser 0021 { 0022 /** 0023 * The Util namespace contains a collection of helper functions use in 0024 * various places. 0025 */ 0026 namespace Util 0027 { 0028 /** 0029 * Describes the type of the displayed message. This depends on the MIME structure 0030 * of the mail and on whether HTML mode is enabled (which is decided by htmlMail()) 0031 */ 0032 enum HtmlMode { 0033 Normal, ///< A normal plaintext message, non-multipart 0034 Html, ///< A HTML message, non-multipart 0035 MultipartPlain, ///< A multipart/alternative message, the plain text part is currently displayed 0036 MultipartHtml, ///< A multipart/alternative message, the HTML part is currently displayed 0037 MultipartIcal ///< A multipart/alternative message, the ICal part is currently displayed 0038 }; 0039 0040 [[nodiscard]] MIMETREEPARSER_EXPORT QString htmlModeToString(Util::HtmlMode mode); 0041 0042 [[nodiscard]] MIMETREEPARSER_EXPORT bool isTypeBlacklisted(KMime::Content *node); 0043 0044 [[nodiscard]] MIMETREEPARSER_EXPORT QString labelForContent(KMime::Content *node); 0045 0046 [[nodiscard]] MIMETREEPARSER_EXPORT QMimeType mimetype(const QString &name); 0047 0048 [[nodiscard]] MIMETREEPARSER_EXPORT QString iconNameForMimetype(const QString &mimeType, 0049 const QString &fallbackFileName1 = QString(), 0050 const QString &fallbackFileName2 = QString()); 0051 0052 [[nodiscard]] MIMETREEPARSER_EXPORT QString iconNameForContent(KMime::Content *node); 0053 } 0054 }