Messagelib
multipartalternative.cpp
34 AlternativeMessagePart::Ptr mp(new AlternativeMessagePart(part.objectTreeParser(), node, preferredMode));
36 MimeMessagePart::Ptr _mp(new MimeMessagePart(part.objectTreeParser(), node->contents().at(0), false));
40 KMime::Content *dataIcal = mp->childParts().contains(Util::MultipartIcal) ? mp->childParts()[Util::MultipartIcal]->content() : nullptr;
41 KMime::Content *dataHtml = mp->childParts().contains(Util::MultipartHtml) ? mp->childParts()[Util::MultipartHtml]->content() : nullptr;
42 KMime::Content *dataPlain = mp->childParts().contains(Util::MultipartPlain) ? mp->childParts()[Util::MultipartPlain]->content() : nullptr;
45 if (dataIcal && ((preferredMode != Util::MultipartHtml && preferredMode != Util::MultipartPlain))) {
53 } else if ((dataHtml && (preferredMode == Util::MultipartHtml || preferredMode == Util::Html)) || (dataHtml && dataPlain && dataPlain->body().isEmpty())) {
63 // qDebug() << " MessagePart::Ptr MultiPartAlternativeBodyPartFormatter::process(Interface::BodyPart &part) const";
65 // qDebug() << "MultiPartAlternativeBodyPartFormatter::processed Modes " << MimeTreeParser::Util::htmlModeToString(mp->availableModes().at(i));
67 // qDebug() << "MultiPartAlternativeBodyPartFormatter::process preferred " << MimeTreeParser::Util::htmlModeToString(preferredMode);
Content * content(const ContentIndex &index) const
QByteArray body() const
QList< Content * > contents() const
The AlternativeMessagePart class.
Definition mimetreeparser/src/messagepart.h:259
The BodyPartFormatter class.
Definition bodypartformatter.h:31
virtual MimeTreeParser::ObjectTreeParser * objectTreeParser() const =0
For making it easier to refactor, add objectTreeParser.
virtual MimeTreeParser::NodeHelper * nodeHelper() const =0
Ok, this is ugly, exposing the node helper here, but there is too much useful stuff in there for real...
virtual KMime::Content * content() const =0
Returns the KMime::Content node represented here.
virtual MimeTreeParser::Util::HtmlMode preferredMode() const =0
Return the mode that is the preferred to display.
virtual void setHtmlMode(MimeTreeParser::Util::HtmlMode mode, const QList< MimeTreeParser::Util::HtmlMode > &availableModes)=0
Sets the type of mail that is currently displayed.
The MimeMessagePart class.
Definition mimetreeparser/src/messagepart.h:149
@ MultipartPlain
A multipart/alternative message, the plain text part is currently displayed.
Definition mimetreeparser/src/utils/util.h:35
@ MultipartIcal
A multipart/alternative message, the ICal part is currently displayed.
Definition mimetreeparser/src/utils/util.h:37
@ MultipartHtml
A multipart/alternative message, the HTML part is currently displayed.
Definition mimetreeparser/src/utils/util.h:36
bool isEmpty() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:08:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:08:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.