Messagelib

multipartmixed.cpp
1 /*
2  SPDX-FileCopyrightText: 2016 Sandro KnauƟ <[email protected]>
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 
14 #include "mimetreeparser_debug.h"
15 
16 using namespace MimeTreeParser;
17 
18 const MultiPartMixedBodyPartFormatter *MultiPartMixedBodyPartFormatter::self;
19 
20 const Interface::BodyPartFormatter *MultiPartMixedBodyPartFormatter::create()
21 {
22  if (!self) {
23  self = new MultiPartMixedBodyPartFormatter();
24  }
25  return self;
26 }
27 
28 MessagePart::Ptr MultiPartMixedBodyPartFormatter::process(Interface::BodyPart &part) const
29 {
30  if (part.content()->contents().isEmpty()) {
31  return {};
32  }
33 
34  // normal treatment of the parts in the mp/mixed container
35  MimeMessagePart::Ptr mp(new MimeMessagePart(part.objectTreeParser(), part.content()->contents().at(0), false));
36  return mp;
37 }
QVector< Content * > contents() const
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 Nov 28 2021 23:05:44 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.