KItinerary
mimedocumentprocessor.cpp
60bool MimeDocumentProcessor::canHandleData(const QByteArray &encodedData, QStringView fileName) const
67ExtractorDocumentNode MimeDocumentProcessor::createNodeFromData(const QByteArray &encodedData) const
88ExtractorDocumentNode MimeDocumentProcessor::createNodeFromContent(const QVariant &decodedData) const
117static ExtractorDocumentNode expandContentNode(ExtractorDocumentNode &node, const KMime::Content *content, const ExtractorEngine *engine)
130 if ((contentType && contentType->isPlainText() && fileName.isEmpty()) || (!contentType && content->isTopLevel())) {
135 child = engine->documentNodeFactory()->createNode(QVariant::fromValue(content->bodyAsMessage().get()), u"message/rfc822");
143static void expandContentNodeRecursive(ExtractorDocumentNode &node, const KMime::Content *content, const ExtractorEngine *engine)
153 if (ct && ct->isMultipart() && ct->isSubtype("related") && ct->parameter("type") == "text/html"_L1 && children.size() >= 2) {
171 expandContentNode(node, child, engine); // do not recurse into nested emails, we want those as dedicated nodes
178void MimeDocumentProcessor::expandNode(ExtractorDocumentNode &node, const ExtractorEngine *engine) const
184bool MimeDocumentProcessor::matches(const ExtractorFilter &filter, const ExtractorDocumentNode &node) const
ExtractorDocumentNode createNode(const QByteArray &data, QStringView fileName={}, QStringView mimeType={}) const
Create a new document node from data.
Definition extractordocumentnodefactory.cpp:159
A node in the extracted document object tree.
Definition extractordocumentnode.h:50
void appendChild(ExtractorDocumentNode &child)
Add another child node.
Definition extractordocumentnode.cpp:141
void setContextDateTime(const QDateTime &contextDateTime)
Set the context date/time.
Definition extractordocumentnode.cpp:173
void setContent(const QVariant &content)
Set decoded content.
Definition extractordocumentnode.cpp:120
const ExtractorDocumentNodeFactory * documentNodeFactory() const
Factory for creating new document nodes.
Definition engine/extractorengine.cpp:172
Determines whether an extractor is applicable to a given email.
Definition extractorfilter.h:24
void destroyNode(ExtractorDocumentNode &node) const override
Destroys type-specific data in node.
Definition mimedocumentprocessor.cpp:191
ExtractorDocumentNode createNodeFromContent(const QVariant &decodedData) const override
Create a document node from an already decoded data type.
Definition mimedocumentprocessor.cpp:88
bool matches(const ExtractorFilter &filter, const ExtractorDocumentNode &node) const override
Checks whether the given filter matches node.
Definition mimedocumentprocessor.cpp:184
void expandNode(ExtractorDocumentNode &node, const ExtractorEngine *engine) const override
Create child nodes for node, as far as that's necessary for this document type.
Definition mimedocumentprocessor.cpp:178
ExtractorDocumentNode createNodeFromData(const QByteArray &encodedData) const override
Create a document node from raw data.
Definition mimedocumentprocessor.cpp:67
bool canHandleData(const QByteArray &encodedData, QStringView fileName) const override
Fast check whether the given encoded data can possibly be processed by this instance.
Definition mimedocumentprocessor.cpp:60
QString decodedText(bool trimText, bool removeTrailingNewlines=false) const
const Headers::ContentType * contentType() const
T * header() const
Headers::Base * headerByType(QByteArrayView type) const
Content * parent()
QByteArray decodedContent() const
QSharedPointer< Message > bodyAsMessage()
bool isTopLevel() const
bool bodyIsMessage() const
const Headers::ContentID * contentID() const
void setContent(const QByteArray &s)
const Headers::ContentDisposition * contentDisposition() const
QList< Content * > contents()
Classes for reservation/travel data models, data extraction and data augmentation.
Definition berelement.h:17
bool isEmpty() const const
bool endsWith(QChar ch) const const
CaseInsensitive
QVariant fromValue(T &&value)
T value() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.