File indexing completed on 2024-06-23 05:19:20
0001 /* 0002 SPDX-FileCopyrightText: 2009 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.net 0003 SPDX-FileCopyrightText: 2009 Andras Mantia <andras@kdab.net> 0004 0005 SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #pragma once 0009 0010 #include "mimetreeparser_export.h" 0011 #include <MimeTreeParser/Util> 0012 0013 #include <KMime/Message> 0014 #include <QSharedPointer> 0015 #include <QStringDecoder> 0016 0017 namespace MimeTreeParser 0018 { 0019 class BodyPartFormatterFactory; 0020 class MessagePart; 0021 using MessagePartPtr = QSharedPointer<MessagePart>; 0022 } 0023 0024 namespace MimeTreeParser 0025 { 0026 namespace Interface 0027 { 0028 /** 0029 * Interface for object tree sources. 0030 * @author Andras Mantia <amantia@kdab.net> 0031 */ 0032 class MIMETREEPARSER_EXPORT ObjectTreeSource 0033 { 0034 public: 0035 ObjectTreeSource(); 0036 virtual ~ObjectTreeSource(); 0037 0038 /** 0039 * Sets the type of mail that is currently displayed. Applications can display this 0040 * information to the user, for example KMail displays a HTML status bar. 0041 * Note: This is not called when the mode is "Normal". 0042 */ 0043 virtual void setHtmlMode(MimeTreeParser::Util::HtmlMode mode, const QList<MimeTreeParser::Util::HtmlMode> &availableModes) = 0; 0044 0045 /** Return the mode that is the preferred to display */ 0046 virtual MimeTreeParser::Util::HtmlMode preferredMode() const = 0; 0047 0048 /** Return true if an encrypted mail should be decrypted */ 0049 virtual bool decryptMessage() const = 0; 0050 0051 /** The override codec that should be used for the mail */ 0052 virtual QByteArray overrideCodecName() const = 0; 0053 0054 /** should keys be imported automatically **/ 0055 virtual bool autoImportKeys() const = 0; 0056 0057 virtual const BodyPartFormatterFactory *bodyPartFormatterFactory() = 0; 0058 0059 private: 0060 Q_DISABLE_COPY(ObjectTreeSource) 0061 }; 0062 } 0063 }