KFileMetaData 5.109.0
extractorplugin.h
1/*
2 SPDX-FileCopyrightText: 2012 Vishesh Handa <me@vhanda.in>
3
4 SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7
8#ifndef _KFILEMETADATA_EXTRACTOR_PLUGIN_H
9#define _KFILEMETADATA_EXTRACTOR_PLUGIN_H
10
11#include <QStringList>
12#include <QDateTime>
13
14#include "kfilemetadata_export.h"
15#include "extractionresult.h"
16
17namespace KFileMetaData
18{
19
33class KFILEMETADATA_EXPORT ExtractorPlugin : public QObject
34{
35 Q_OBJECT
36public:
37 explicit ExtractorPlugin(QObject* parent);
38 ~ExtractorPlugin() override;
39
51 virtual QStringList mimetypes() const = 0;
52
63 virtual void extract(ExtractionResult* result) = 0;
64
65 //
66 // Helper functions
67 //
68
72 static QDateTime dateTimeFromString(const QString& dateString);
73
78 static QStringList contactsFromString(const QString& string);
79
80protected:
95 QString getSupportedMimeType(const QString& mimetype) const;
96
97private:
98 class ExtractorPluginPrivate;
99 ExtractorPluginPrivate *d_placeholder; // Placeholder for future binary compatible extensions
100};
101}
102
103Q_DECLARE_INTERFACE(KFileMetaData::ExtractorPlugin, "org.kde.kf5.kfilemetadata.ExtractorPlugin")
104
105#endif // _KFILEMETADATA_EXTRACTOR_PLUGIN_H
The ExtractionResult class is where all the data extracted by the indexer is saved.
Definition extractionresult.h:35
The ExtractorPlugin is the base class for all file metadata extractors.
Definition extractorplugin.h:34
static QDateTime dateTimeFromString(const QString &dateString)
Tries to extract a valid date time from the string provided.
QString getSupportedMimeType(const QString &mimetype) const
Return the inherited mimetype which the extractor directly supports.
virtual QStringList mimetypes() const =0
Provide a list of mimetypes which are supported by this plugin.
static QStringList contactsFromString(const QString &string)
Tries to split the string into names.
virtual void extract(ExtractionResult *result)=0
The main function of the plugin that is responsible for extracting the data and filling up the Extrac...