Messagelib
bodypartformatterfactory.cpp
25 BodyPartFormatterFactoryPrivate::BodyPartFormatterFactoryPrivate(BodyPartFormatterFactory *factory)
49 void BodyPartFormatterFactoryPrivate::insert(const QString &mimeType, const Interface::BodyPartFormatter *formatter, int priority)
68 void BodyPartFormatterFactoryPrivate::appendFormattersForType(const QString &mimeType, QVector<const Interface::BodyPartFormatter *> &formatters)
95 void BodyPartFormatterFactory::insert(const QString &mimeType, const Interface::BodyPartFormatter *formatter, int priority)
100 QVector<const Interface::BodyPartFormatter *> BodyPartFormatterFactory::formattersForType(const QString &mimeType) const
115 if (processedTypes[i] == QLatin1String("application/octet-stream")) { // we'll deal with that later
122 if (std::find(processedTypes.begin(), processedTypes.end(), parentType) != processedTypes.end()) {
143 KPluginLoader::forEachPlugin(QStringLiteral("messageviewer/bodypartformatter"), [this](const QString &path) {
145 const auto formatterData = loader.metaData().value(QLatin1String("MetaData")).toObject().value(QLatin1String("formatter")).toArray();
150 auto plugin = qobject_cast<MimeTreeParser::Interface::BodyPartFormatterPlugin *>(loader.instance());
160 qCWarning(MIMETREEPARSER_LOG) << "BodyPartFormatterFactory: plugin" << path << "returned empty mimetype specification for index" << i;
The place to obtain BodyPartFormatter candidates for a given mime type.
Definition: bodypartformatterfactory.h:28
QVector< const Interface::BodyPartFormatter * > formattersForType(const QString &mimeType) const
Returns all suitable formatters for the given mimetype.
Definition: bodypartformatterfactory.cpp:100
QJsonObject metaData() const const
Definition: headerstyle.h:24
The BodyPartFormatter class.
Definition: bodypartformatter.h:31
QJsonObject toObject() const const
int toInt(bool *ok, int base) const const
QJsonArray toArray() const const
bool isEmpty() const const
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const const
QObject * instance()
static void forEachPlugin(const QString &directory, std::function< void(const QString &)> callback=std::function< void(const QString &)>())
QMimeType mimeTypeForName(const QString &nameOrAlias) const const
interface for BodyPartFormatter plugins
Definition: bodypartformatter.h:52
QString toLower() const const
void push_back(const T &value)
QJsonValue value(const QString &key) const const
bool empty() const const
name
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Jan 27 2021 23:13:29 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Jan 27 2021 23:13:29 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.