File indexing completed on 2024-03-24 05:01:23
0001 /* 0002 This file is part of the KDE project. 0003 0004 SPDX-FileCopyrightText: 2022 Stefano Crocco <stefano.crocco@alice.it> 0005 0006 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0007 */ 0008 0009 #ifndef PLUGINMETADATAUTILS_H 0010 #define PLUGINMETADATAUTILS_H 0011 0012 #include <KPluginMetaData> 0013 0014 #include <QDebug> 0015 0016 KPluginMetaData findPartById(const QString &id); 0017 0018 /** 0019 * @brief Finds the meta data for the preferred part to display the given mime type 0020 * @param mimeType the mime type 0021 * @return the plugin meta data for the preferred part to display @p mimeType or an 0022 * invalid @c KPluginMetaData if no part is available for the mime type 0023 */ 0024 KPluginMetaData preferredPart(const QString &mimeType); 0025 0026 QVector<KPluginMetaData> findParts(std::function<bool(const KPluginMetaData &)> filter, bool includeDefaultDir); 0027 0028 QVector<KPluginMetaData> findParts(std::function<bool(const KPluginMetaData &)> filter={}); 0029 0030 QDebug operator<<(QDebug debug, const KPluginMetaData &md); 0031 0032 QDebug operator<<(QDebug debug, const QVector<KPluginMetaData> &vec); 0033 0034 #endif //PLUGINMETADATAUTILS_H