Messagelib

multipartmixed.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 "multipartmixed.h"
8
9#include "messagepart.h"
10#include "objecttreeparser.h"
11
12#include <KMime/Content>
13
14using namespace MimeTreeParser;
15
16const MultiPartMixedBodyPartFormatter *MultiPartMixedBodyPartFormatter::self;
17
18const Interface::BodyPartFormatter *MultiPartMixedBodyPartFormatter::create()
19{
20 if (!self) {
21 self = new MultiPartMixedBodyPartFormatter();
22 }
23 return self;
24}
25
26MessagePart::Ptr MultiPartMixedBodyPartFormatter::process(Interface::BodyPart &part) const
27{
28 if (part.content()->contents().isEmpty()) {
29 return {};
30 }
31
32 // normal treatment of the parts in the mp/mixed container
33 MimeMessagePart::Ptr mp(new MimeMessagePart(part.objectTreeParser(), part.content()->contents().at(0), false));
34 return mp;
35}
QList< Content * > contents() const
interface of message body parts.
Definition bodypart.h:45
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.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:12:43 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.