KFileMetaData

extractorplugin.h
1 /*
2  <one line to give the library's name and an idea of what it does.>
3  Copyright (C) 2012 Vishesh Handa <[email protected]>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19 
20 
21 #ifndef _KFILEMETADATA_EXTRACTOR_PLUGIN_H
22 #define _KFILEMETADATA_EXTRACTOR_PLUGIN_H
23 
24 #include <QStringList>
25 #include <QDateTime>
26 
27 #include "kfilemetadata_export.h"
28 #include "extractionresult.h"
29 
30 namespace KFileMetaData
31 {
32 
46 class KFILEMETADATA_EXPORT ExtractorPlugin : public QObject
47 {
48  Q_OBJECT
49 public:
50  explicit ExtractorPlugin(QObject* parent);
51  virtual ~ExtractorPlugin();
52 
64  virtual QStringList mimetypes() const = 0;
65 
76  virtual void extract(ExtractionResult* result) = 0;
77 
78  //
79  // Helper functions
80  //
81 
85  static QDateTime dateTimeFromString(const QString& dateString);
86 
91  static QStringList contactsFromString(const QString& string);
92 
93 protected:
108  QString getSupportedMimeType(const QString& mimetype) const;
109 
110 private:
111  class Private;
112  Private* d;
113 };
114 }
115 
116 Q_DECLARE_INTERFACE(KFileMetaData::ExtractorPlugin, "org.kde.kf5.kfilemetadata.ExtractorPlugin")
117 
118 #endif // _KFILEMETADATA_EXTRACTOR_PLUGIN_H
The ExtractorPlugin is the base class for all file metadata extractors.
The ExtractionResult class is where all the data extracted by the indexer is saved.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 30 2020 23:13:31 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.