MessageViewer::HtmlWriter Class

An interface for HTML sinks. Author: Marc Mutz <mutz@kde.org>. More...

Header: #include <MessageViewer/HtmlWriter>
CMake: find_package(KPim6MessageViewer REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::MessageViewer)
Inherited By:

MessageViewer::BufferedHtmlWriter and MessageViewer::FileHtmlWriter

Public Functions

virtual void begin()
virtual QIODevice *device() const = 0
virtual void embedPart(const QByteArray &contentId, const QString &url) = 0
virtual void end()
virtual void reset()
QTextStream *stream() const

Detailed Description

Member Function Documentation

[virtual] void HtmlWriter::begin()

Signal the begin of stuff to write. Sub-classes should open device() in a writable mode here and then call the base class.

[pure virtual] QIODevice *HtmlWriter::device() const

Returns the QIODevice backing this HtmlWriter instance. Before writing to this directly, make sure to flush stream().

[pure virtual] void HtmlWriter::embedPart(const QByteArray &contentId, const QString &url)

Embed a part with Content-ID contentId, using url url.

[virtual] void HtmlWriter::end()

Signal the end of stuff to write. Sub-classes should call the base class and then close device() here.

[virtual] void HtmlWriter::reset()

Stop all possibly pending processing in order to be able to call #begin() again. Sub-classes should call the base class and then reset device() here.

QTextStream *HtmlWriter::stream() const

Returns a QTextStream on device(). Use this for writing QString data, rather than local string concatenations.