File indexing completed on 2024-06-23 05:19:20

0001 /*
0002    SPDX-FileCopyrightText: 2016 Sandro Knauß <sknauss@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "texthtml.h"
0008 
0009 #include "messagepart.h"
0010 #include "objecttreeparser.h"
0011 
0012 #include <KMime/Content>
0013 
0014 using namespace MimeTreeParser;
0015 
0016 const TextHtmlBodyPartFormatter *TextHtmlBodyPartFormatter::self;
0017 
0018 const Interface::BodyPartFormatter *TextHtmlBodyPartFormatter::create()
0019 {
0020     if (!self) {
0021         self = new TextHtmlBodyPartFormatter();
0022     }
0023     return self;
0024 }
0025 
0026 MessagePart::Ptr TextHtmlBodyPartFormatter::process(Interface::BodyPart &part) const
0027 {
0028     KMime::Content *node = part.content();
0029     HtmlMessagePart::Ptr mp(new HtmlMessagePart(part.objectTreeParser(), node, part.source()));
0030     return mp;
0031 }