Messagelib

partnodebodypart.cpp
1/*
2 partnodebodypart.cpp
3
4 This file is part of KMail, the KDE mail client.
5 SPDX-FileCopyrightText: 2004 Marc Mutz <mutz@kde.org>
6 SPDX-FileCopyrightText: 2004 Ingo Kloecker <kloecker@kde.org>
7
8 SPDX-License-Identifier: GPL-2.0-or-later
9*/
10
11#include "partnodebodypart.h"
12#include "nodehelper.h"
13#include "objecttreeparser.h"
14#include <KMime/Content>
15
16using namespace MimeTreeParser;
17
18PartNodeBodyPart::PartNodeBodyPart(ObjectTreeParser *otp,
19 ProcessResult *result,
20 KMime::Content *topLevelContent,
21 KMime::Content *content,
22 NodeHelper *nodeHelper)
23 : Interface::BodyPart()
24 , mTopLevelContent(topLevelContent)
25 , mContent(content)
26 , mNodeHelper(nodeHelper)
27 , mObjectTreeParser(otp)
28 , mProcessResult(result)
29{
30}
31
33{
34 /*TODO(Andras) Volker suggests to use a ContentIndex->Mememnto mapping
35 Also review if the reader's bodyPartMemento should be returned or the NodeHelper's one
36 */
37 return mNodeHelper->bodyPartMemento(mContent, "__plugin__");
38}
39
40Interface::ObjectTreeSource *PartNodeBodyPart::source() const
41{
42 return mObjectTreeParser->mSource;
43}
44
46{
47 return mContent;
48}
49
51{
52 return mTopLevelContent;
53}
54
56{
57 return mNodeHelper;
58}
59
61{
62 return mObjectTreeParser;
63}
64
65ProcessResult *PartNodeBodyPart::processResult() const
66{
67 return mProcessResult;
68}
interface of classes that implement status for BodyPartFormatters.
Definition bodypart.h:34
Interface for object tree sources.
Parses messages and generates HTML display code out of them.
Interface::BodyPartMemento * memento() const override
ObjectTreeParser * objectTreeParser() const override
For making it easier to refactor, add objectTreeParser.
KMime::Content * content() const override
Returns the KMime::Content node represented here.
NodeHelper * nodeHelper() const override
Ok, this is ugly, exposing the node helper here, but there is too much useful stuff in there for real...
KMime::Content * topLevelContent() const override
Returns the top-level content.
The ProcessResult class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sun Feb 25 2024 18:37:31 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.