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 #include "mimetreeparser_debug.h"
15 
16 using namespace MimeTreeParser;
17 
18 const TextHtmlBodyPartFormatter *TextHtmlBodyPartFormatter::self;
19 
20 const Interface::BodyPartFormatter *TextHtmlBodyPartFormatter::create()
21 {
22  if (!self) {
23  self = new TextHtmlBodyPartFormatter();
24  }
25  return self;
26 }
27 
28 MessagePart::Ptr TextHtmlBodyPartFormatter::process(Interface::BodyPart &part) const
29 {
30  KMime::Content *node = part.content();
31  HtmlMessagePart::Ptr mp(new HtmlMessagePart(part.objectTreeParser(), node, part.source()));
32  return mp;
33 }
virtual KMime::Content * content() const =0
Returns the KMime::Content node represented here.
interface of message body parts.
Definition: bodypart.h:44
virtual MimeTreeParser::ObjectTreeParser * objectTreeParser() const =0
For making it easier to refactor, add objectTreeParser.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Dec 5 2021 23:04:55 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.