Messagelib

bufferedhtmlwriter.h
1 /*
2  SPDX-FileCopyrightText: 2017 Volker Krause <[email protected]>
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 
15 namespace MessageViewer
16 {
17 /**
18  * QBuffer-backed HtmlWriter
19  */
20 class MESSAGEVIEWER_EXPORT BufferedHtmlWriter : public HtmlWriter
21 {
22 public:
24  ~BufferedHtmlWriter() override;
25 
26  void begin() override;
27  void end() override;
28  void reset() override;
29  Q_REQUIRED_RESULT QIODevice *device() const override;
30 
31  Q_REQUIRED_RESULT 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 
38 protected:
39  QByteArray m_data;
40 
41 private:
42  QBuffer m_buffer;
43 };
44 }
45 
QBuffer-backed HtmlWriter.
An interface for HTML sinks.
Definition: htmlwriter.h:28
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Dec 6 2021 23:04:56 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.