File indexing completed on 2025-03-09 04:54:40

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 "messageviewer_export.h"
0011 #include <MimeTreeParser/ObjectTreeSource>
0012 
0013 class QString;
0014 class QStringDecoder;
0015 namespace MessageViewer
0016 {
0017 class AttachmentStrategy;
0018 class CSSHelperBase;
0019 class HtmlWriter;
0020 
0021 /** An ObjectTreeSource that does not work on anything */
0022 class EmptySourcePrivate;
0023 /**
0024  * @brief The EmptySource class
0025  */
0026 class MESSAGEVIEWER_EXPORT EmptySource : public MimeTreeParser::Interface::ObjectTreeSource
0027 {
0028 public:
0029     EmptySource();
0030     ~EmptySource() override;
0031     [[nodiscard]] bool decryptMessage() const override;
0032     void setHtmlMode(MimeTreeParser::Util::HtmlMode mode, const QList<MimeTreeParser::Util::HtmlMode> &availableModes) override;
0033     [[nodiscard]] MimeTreeParser::Util::HtmlMode preferredMode() const override;
0034     void setAllowDecryption(bool allowDecryption);
0035     QByteArray overrideCodecName() const override;
0036     virtual QString createMessageHeader(KMime::Message *message);
0037     [[nodiscard]] bool autoImportKeys() const override;
0038 
0039     const MimeTreeParser::BodyPartFormatterFactory *bodyPartFormatterFactory() override;
0040     void render(const MimeTreeParser::MessagePartPtr &msgPart, bool showOnlyOneMimePart);
0041 
0042     virtual const AttachmentStrategy *attachmentStrategy() const;
0043     virtual HtmlWriter *htmlWriter() const;
0044     virtual CSSHelperBase *cssHelper() const;
0045     /** Return true if external sources should be loaded in a html mail */
0046     virtual bool htmlLoadExternal() const;
0047     virtual bool showSignatureDetails() const;
0048     virtual bool showEncryptionDetails() const;
0049     virtual bool showEmoticons() const;
0050     virtual bool showExpandQuotesMark() const;
0051     virtual bool isPrinting() const;
0052     virtual int levelQuote() const;
0053 
0054 private:
0055     std::unique_ptr<EmptySourcePrivate> const d;
0056 };
0057 }