Messagelib

texthtml.cpp
1 /*
2  SPDX-FileCopyrightText: 2016 Sandro Knauß <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "texthtml.h"
8 
9 #include "messagepart.h"
10 #include "objecttreeparser.h"
11 
12 #include <KMime/Content>
13 
14 using namespace MimeTreeParser;
15 
16 const TextHtmlBodyPartFormatter *TextHtmlBodyPartFormatter::self;
17 
18 const Interface::BodyPartFormatter *TextHtmlBodyPartFormatter::create()
19 {
20  if (!self) {
21  self = new TextHtmlBodyPartFormatter();
22  }
23  return self;
24 }
25 
26 MessagePart::Ptr TextHtmlBodyPartFormatter::process(Interface::BodyPart &part) const
27 {
28  KMime::Content *node = part.content();
29  HtmlMessagePart::Ptr mp(new HtmlMessagePart(part.objectTreeParser(), node, part.source()));
30  return mp;
31 }
virtual MimeTreeParser::ObjectTreeParser * objectTreeParser() const =0
For making it easier to refactor, add objectTreeParser.
virtual KMime::Content * content() const =0
Returns the KMime::Content node represented here.
interface of message body parts.
Definition: bodypart.h:44
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Apr 1 2023 04:01:57 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.