Messagelib

bufferedhtmlwriter.cpp
1 /*
2  SPDX-FileCopyrightText: 2017 Volker Krause <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "bufferedhtmlwriter.h"
8 
9 using namespace MessageViewer;
10 
11 BufferedHtmlWriter::BufferedHtmlWriter()
12  : m_buffer(&m_data)
13 {
14 }
15 
16 BufferedHtmlWriter::~BufferedHtmlWriter()
17 {
19 }
20 
22 {
23  m_buffer.open(QBuffer::WriteOnly);
25 }
26 
28 {
30  m_buffer.close();
31 }
32 
34 {
36  m_buffer.close();
37  clear();
38 }
39 
41 {
42  return const_cast<QBuffer *>(&m_buffer);
43 }
44 
45 void BufferedHtmlWriter::setExtraHead(const QString &str)
46 {
47  Q_UNUSED(str)
48 }
49 
50 void BufferedHtmlWriter::embedPart(const QByteArray &contentId, const QString &url)
51 {
52  Q_UNUSED(contentId)
53  Q_UNUSED(url)
54 }
55 
56 void BufferedHtmlWriter::setStyleBody(const QString &styleBody)
57 {
58  Q_UNUSED(styleBody)
59 }
60 
61 QByteArray BufferedHtmlWriter::data() const
62 {
63  return m_data;
64 }
65 
66 void BufferedHtmlWriter::clear()
67 {
68  m_data.clear();
69 }
QIODevice * device() const override
Returns the QIODevice backing this HtmlWriter instance.
void reset() override
Stop all possibly pending processing in order to be able to call begin() again.
void begin() override
Signal the begin of stuff to write.
void clear()
virtual void reset()
Stop all possibly pending processing in order to be able to call begin() again.
Definition: htmlwriter.cpp:45
virtual void begin()
Signal the begin of stuff to write.
Definition: htmlwriter.cpp:16
void end() override
Signal the end of stuff to write.
virtual void end()
Signal the end of stuff to write.
Definition: htmlwriter.cpp:36
void embedPart(const QByteArray &contentId, const QString &url) override
Embed a part with Content-ID contentId, using url url.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Mar 22 2023 04:07:14 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.