Messagelib

mimetreeparser/src/utils/util.h
1/*
2 SPDX-FileCopyrightText: 2016 Sandro KnauƟ <sknauss@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "mimetreeparser_export.h"
10
11#include <QString>
12
13class QMimeType;
14
15namespace KMime
16{
17class Content;
18}
19
20namespace MimeTreeParser
21{
22/**
23 * The Util namespace contains a collection of helper functions use in
24 * various places.
25 */
26namespace Util
27{
28/**
29 * Describes the type of the displayed message. This depends on the MIME structure
30 * of the mail and on whether HTML mode is enabled (which is decided by htmlMail())
31 */
33 Normal, ///< A normal plaintext message, non-multipart
34 Html, ///< A HTML message, non-multipart
35 MultipartPlain, ///< A multipart/alternative message, the plain text part is currently displayed
36 MultipartHtml, ///< A multipart/alternative message, the HTML part is currently displayed
37 MultipartIcal ///< A multipart/alternative message, the ICal part is currently displayed
38};
39
40[[nodiscard]] MIMETREEPARSER_EXPORT QString htmlModeToString(Util::HtmlMode mode);
41
42[[nodiscard]] MIMETREEPARSER_EXPORT bool isTypeBlacklisted(KMime::Content *node);
43
44[[nodiscard]] MIMETREEPARSER_EXPORT QString labelForContent(KMime::Content *node);
45
46[[nodiscard]] MIMETREEPARSER_EXPORT QMimeType mimetype(const QString &name);
47
48[[nodiscard]] MIMETREEPARSER_EXPORT QString iconNameForMimetype(const QString &mimeType,
49 const QString &fallbackFileName1 = QString(),
50 const QString &fallbackFileName2 = QString());
51
52[[nodiscard]] MIMETREEPARSER_EXPORT QString iconNameForContent(KMime::Content *node);
53}
54}
MIMETREEPARSER_EXPORT QString htmlModeToString(Util::HtmlMode mode)
HtmlMode
Describes the type of the displayed message.
@ Html
A HTML message, non-multipart.
@ Normal
A normal plaintext message, non-multipart.
@ MultipartPlain
A multipart/alternative message, the plain text part is currently displayed.
@ MultipartIcal
A multipart/alternative message, the ICal part is currently displayed.
@ MultipartHtml
A multipart/alternative message, the HTML part is currently displayed.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:53:08 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.