Messagelib

bufferedhtmlwriter.h
1/*
2 SPDX-FileCopyrightText: 2017 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "messageviewer_export.h"
10#include <MessageViewer/HtmlWriter>
11
12#include <QBuffer>
13#include <QByteArray>
14
15namespace MessageViewer
16{
17/**
18 * QBuffer-backed HtmlWriter
19 */
20class MESSAGEVIEWER_EXPORT BufferedHtmlWriter : public HtmlWriter
21{
22public:
24 ~BufferedHtmlWriter() override;
25
26 void begin() override;
27 void end() override;
28 void reset() override;
29 [[nodiscard]] QIODevice *device() const override;
30
31 [[nodiscard]] QByteArray data() const;
32 void clear();
33
34 void setExtraHead(const QString &str) override;
35 void embedPart(const QByteArray &contentId, const QString &url) override;
36 void setStyleBody(const QString &styleBody) override;
37
38protected:
39 QByteArray m_data;
40
41private:
42 QBuffer m_buffer;
43};
44}
An interface for HTML sinks.
Definition htmlwriter.h:29
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:33:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.