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

0001 /*  -*- c++ -*-
0002     filehtmlwriter.h
0003 
0004     This file is part of KMail, the KDE mail client.
0005     SPDX-FileCopyrightText: 2003 Marc Mutz <mutz@kde.org>
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 
0010 #pragma once
0011 
0012 #include "messageviewer_export.h"
0013 #include <MessageViewer/HtmlWriter>
0014 
0015 #include <QFile>
0016 
0017 namespace MessageViewer
0018 {
0019 /**
0020  * @brief The FileHtmlWriter class
0021  */
0022 class MESSAGEVIEWER_EXPORT FileHtmlWriter : public HtmlWriter
0023 {
0024 public:
0025     explicit FileHtmlWriter(const QString &filename);
0026     ~FileHtmlWriter() override;
0027 
0028     void begin() override;
0029     void end() override;
0030     void reset() override;
0031     [[nodiscard]] QIODevice *device() const override;
0032     void embedPart(const QByteArray &contentId, const QString &url) override;
0033     void setExtraHead(const QString &str) override;
0034     void setStyleBody(const QString &styleBody) override;
0035 
0036 private:
0037     QFile mFile;
0038 };
0039 } // namespace MessageViewer