Messagelib

messagepartrenderer.cpp
1 /*
2  SPDX-FileCopyrightText: 2016 Sandro KnauƟ <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "messagepartrenderer.h"
8 
9 #include "quotehtml.h"
10 
11 #include "../htmlblock.h"
12 
13 #include "interfaces/htmlwriter.h"
14 
15 using namespace MessageViewer;
16 
17 MessagePartRenderer::MessagePartRenderer() = default;
18 
19 MessagePartRenderer::~MessagePartRenderer() = default;
20 
21 bool MessagePartRenderer::render(const MimeTreeParser::MessagePartPtr &msgPart, HtmlWriter *htmlWriter, RenderContext *context) const
22 {
23  AttachmentMarkBlock block(nullptr, msgPart->attachmentContent());
24  if (msgPart->isAttachment()) {
25  htmlWriter->write(block.enter());
26  }
27  quotedHTML(msgPart->text(), context, htmlWriter);
28  htmlWriter->write(block.exit());
29  return true;
30 }
void write(const QString &html)
Write out a chunk of text.
Definition: htmlwriter.cpp:27
An interface for HTML sinks.
Definition: htmlwriter.h:28
The AttachmentMarkBlock class.
Definition: htmlblock.h:52
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Mar 26 2023 04:08:11 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.