Changeset View
Changeset View
Standalone View
Standalone View
mimetreeparser/src/interfaces/bodypartformatter.cpp
Show All 32 Lines | |||||
33 | #include "bodypartformatter.h" | 33 | #include "bodypartformatter.h" | ||
34 | 34 | | |||
35 | #include "bodypart.h" | 35 | #include "bodypart.h" | ||
36 | #include "viewer/messagepart.h" | 36 | #include "viewer/messagepart.h" | ||
37 | #include "viewer/objecttreeparser.h" | 37 | #include "viewer/objecttreeparser.h" | ||
38 | 38 | | |||
39 | using namespace MimeTreeParser::Interface; | 39 | using namespace MimeTreeParser::Interface; | ||
40 | 40 | | |||
41 | namespace MimeTreeParser { | | |||
42 | namespace Interface { | | |||
43 | class MessagePartPrivate | | |||
44 | { | | |||
45 | public: | | |||
46 | MessagePart *mParentPart = nullptr; | | |||
47 | }; | | |||
48 | } | | |||
49 | } | | |||
50 | | ||||
51 | MessagePart::MessagePart() | | |||
52 | : QObject() | | |||
53 | , d(new MessagePartPrivate) | | |||
54 | { | | |||
55 | } | | |||
56 | | ||||
57 | MessagePart::~MessagePart() | | |||
58 | { | | |||
59 | delete d; | | |||
60 | } | | |||
61 | | ||||
62 | QString MessagePart::text() const | | |||
63 | { | | |||
64 | return QString(); | | |||
65 | } | | |||
66 | | ||||
67 | MessagePart *MessagePart::parentPart() const | | |||
68 | { | | |||
69 | return d->mParentPart; | | |||
70 | } | | |||
71 | | ||||
72 | void MessagePart::setParentPart(MessagePart *parentPart) | | |||
73 | { | | |||
74 | d->mParentPart = parentPart; | | |||
75 | } | | |||
76 | | ||||
77 | QString MessagePart::htmlContent() const | | |||
78 | { | | |||
79 | return text(); | | |||
80 | } | | |||
81 | | ||||
82 | QString MessagePart::plaintextContent() const | | |||
83 | { | | |||
84 | return text(); | | |||
85 | } | | |||
86 | | ||||
87 | BodyPartFormatter::Result BodyPartFormatter::format(BodyPart *part, MimeTreeParser::HtmlWriter *writer) const | 41 | BodyPartFormatter::Result BodyPartFormatter::format(BodyPart *part, MimeTreeParser::HtmlWriter *writer) const | ||
88 | { | 42 | { | ||
89 | Q_UNUSED(part); | 43 | Q_UNUSED(part); | ||
90 | Q_UNUSED(writer); | 44 | Q_UNUSED(writer); | ||
91 | return Failed; | 45 | return Failed; | ||
92 | } | 46 | } | ||
93 | 47 | | |||
94 | MessagePart::Ptr BodyPartFormatter::process(BodyPart&) const | 48 | MimeTreeParser::MessagePart::Ptr BodyPartFormatter::process(BodyPart &part) const | ||
95 | { | 49 | { | ||
96 | auto mp = MessagePart::Ptr(new LegacyPluginMessagePart); | 50 | auto mp = MimeTreeParser::MessagePart::Ptr(new LegacyPluginMessagePart(part.objectTreeParser())); | ||
97 | return mp; | 51 | return mp; | ||
98 | } | 52 | } | ||
99 | 53 | | |||
100 | BodyPartFormatterPlugin::~BodyPartFormatterPlugin() | 54 | BodyPartFormatterPlugin::~BodyPartFormatterPlugin() | ||
101 | { | 55 | { | ||
102 | } | 56 | } | ||
103 | 57 | | |||
104 | const BodyPartURLHandler *BodyPartFormatterPlugin::urlHandler(int idx) const | 58 | const BodyPartURLHandler *BodyPartFormatterPlugin::urlHandler(int idx) const | ||
105 | { | 59 | { | ||
106 | Q_UNUSED(idx); | 60 | Q_UNUSED(idx); | ||
107 | return nullptr; | 61 | return nullptr; | ||
108 | } | 62 | } |