| 1 | /* |
| 2 | SPDX-FileCopyrightText: 2012 Vishesh Handa <me@vhanda.in> |
| 3 | |
| 4 | SPDX-License-Identifier: LGPL-2.1-or-later |
| 5 | */ |
| 6 | |
| 7 | #ifndef _KFILEMETADATA_EXTRACTORCOLLECTION_H |
| 8 | #define |
| 9 | |
| 10 | #include "extractor.h" |
| 11 | #include "kfilemetadata_export.h" |
| 12 | |
| 13 | #include <memory> |
| 14 | |
| 15 | namespace KFileMetaData |
| 16 | { |
| 17 | class ; |
| 18 | /*! |
| 19 | * \class KFileMetaData::ExtractorCollection |
| 20 | * \inheaderfile KFileMetaData/ExtractorCollection |
| 21 | * \inmodule KFileMetaData |
| 22 | * |
| 23 | * \brief The ExtractorCollection is a helper class which internally |
| 24 | * loads all the extractor plugins. |
| 25 | * |
| 26 | * It can be used to fetch a certain |
| 27 | * subset of these plugins based on a given mimetype. |
| 28 | * |
| 29 | * Once the appropriate plugins have been fetched, an ExtractionResult |
| 30 | * should be created and passed to the plugin's extract function. |
| 31 | */ |
| 32 | class KFILEMETADATA_EXPORT |
| 33 | { |
| 34 | public: |
| 35 | /*! |
| 36 | * |
| 37 | */ |
| 38 | explicit (); |
| 39 | virtual (); |
| 40 | |
| 41 | /*! |
| 42 | * Fetch the extractors which can be used to extract |
| 43 | * data for the respective file with the given MIME type. |
| 44 | * |
| 45 | * If no match is found then the best matching plugins |
| 46 | * are returned, determined by MIME type inheritance. |
| 47 | * |
| 48 | * \sa QMimeType::allAncestors |
| 49 | */ |
| 50 | QList<Extractor*> (const QString& mimetype) const; |
| 51 | |
| 52 | private: |
| 53 | friend class ; |
| 54 | // exported for ExtractorCollectionTest |
| 55 | QList<Extractor*> (); |
| 56 | |
| 57 | const std::unique_ptr<ExtractorCollectionPrivate> ; |
| 58 | }; |
| 59 | } |
| 60 | |
| 61 | #endif |
| 62 | |