Messagelib

messagepartrenderer.cpp
1/*
2 SPDX-FileCopyrightText: 2016 Sandro Knauß <sknauss@kde.org>
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
15using namespace MessageViewer;
16
17MessagePartRenderer::MessagePartRenderer() = default;
18
19MessagePartRenderer::~MessagePartRenderer() = default;
20
21bool 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}
The AttachmentMarkBlock class.
Definition htmlblock.h:53
An interface for HTML sinks.
Definition htmlwriter.h:29
void write(const QString &html)
Write out a chunk of text.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:33:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.