File indexing completed on 2022-11-29 20:22:24

0001 /**
0002  * SPDX-FileCopyrightText: (C) 2015 by Gleb Baryshev <gleb.baryshev@gmail.com>
0003  * SPDX-License-Identifier: GPL-2.0-or-later
0004  */
0005 
0006 #ifndef FILE_METADATA_H
0007 #define FILE_METADATA_H
0008 
0009 #include <QList>
0010 
0011 #include <KFileMetaData/KFileMetaData/ExtractionResult>
0012 #include <KFileMetaData/KFileMetaData/ExtractorCollection>
0013 
0014 /// Store and retrieve metadata extraction results
0015 class MetaDataExtractionResult : public KFileMetaData::ExtractionResult
0016 {
0017 public:
0018     MetaDataExtractionResult(const QString &url, const QString &mimetype)
0019         : KFileMetaData::ExtractionResult(url, mimetype, KFileMetaData::ExtractionResult::ExtractMetaData)
0020     {
0021     }
0022 
0023     void append(const QString &) override
0024     {
0025     } // not used
0026     void add(KFileMetaData::Property::Property property, const QVariant &value) override;
0027     void addType(KFileMetaData::Type::Type) override
0028     {
0029     } // not used
0030 
0031     /// Get preferred metadata as "property-value" pairs
0032     QList<QPair<QString, QString>> preferredGroups();
0033 
0034 private:
0035     KFileMetaData::PropertyMap m_groups;
0036 };
0037 
0038 #endif // FILE_METADATA_H