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 "../defaultrenderer_p.h"
12 #include "../htmlblock.h"
13 
14 #include "interfaces/htmlwriter.h"
15 
16 using namespace MessageViewer;
17 
18 MessagePartRenderer::MessagePartRenderer() = default;
19 
20 MessagePartRenderer::~MessagePartRenderer() = default;
21 
22 bool MessagePartRenderer::render(const MimeTreeParser::MessagePartPtr &msgPart, HtmlWriter *htmlWriter, RenderContext *context) const
23 {
24  AttachmentMarkBlock block(nullptr, msgPart->attachmentContent());
25  if (msgPart->isAttachment()) {
26  htmlWriter->write(block.enter());
27  }
28  quotedHTML(msgPart->text(), context, htmlWriter);
29  htmlWriter->write(block.exit());
30  return true;
31 }
The AttachmentMarkBlock class.
Definition: htmlblock.h:52
An interface for HTML sinks.
Definition: htmlwriter.h:28
void write(const QString &html)
Write out a chunk of text.
Definition: htmlwriter.cpp:27
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Dec 5 2021 23:04:54 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.