Changeset View
Changeset View
Standalone View
Standalone View
src/file/basicindexingjob.h
Show All 17 Lines | |||||
18 | * You should have received a copy of the GNU Lesser General Public | 18 | * You should have received a copy of the GNU Lesser General Public | ||
19 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | 19 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
20 | * | 20 | * | ||
21 | */ | 21 | */ | ||
22 | 22 | | |||
23 | #ifndef BASICINDEXINGJOB_H | 23 | #ifndef BASICINDEXINGJOB_H | ||
24 | #define BASICINDEXINGJOB_H | 24 | #define BASICINDEXINGJOB_H | ||
25 | 25 | | |||
26 | #include <KFileMetaData/Types> | | |||
27 | #include "document.h" | 26 | #include "document.h" | ||
28 | 27 | | |||
29 | namespace Baloo { | 28 | namespace Baloo { | ||
30 | 29 | | |||
31 | class BasicIndexingJob | 30 | class BasicIndexingJob | ||
32 | { | 31 | { | ||
33 | public: | 32 | public: | ||
34 | enum IndexingLevel { | 33 | enum IndexingLevel { | ||
35 | NoLevel, | 34 | NoLevel, | ||
36 | MarkForContentIndexing | 35 | MarkForContentIndexing | ||
37 | }; | 36 | }; | ||
38 | 37 | | |||
39 | BasicIndexingJob(const QString& filePath, const QString& mimetype, | 38 | BasicIndexingJob(const QString& filePath, const QString& mimetype, | ||
40 | IndexingLevel level = MarkForContentIndexing); | 39 | IndexingLevel level = MarkForContentIndexing); | ||
41 | ~BasicIndexingJob(); | 40 | ~BasicIndexingJob(); | ||
42 | 41 | | |||
43 | bool index(); | 42 | bool index(); | ||
44 | 43 | | |||
45 | Document document() { return m_doc; } | 44 | Document document() { return m_doc; } | ||
46 | 45 | | |||
47 | private: | 46 | private: | ||
48 | static QVector<KFileMetaData::Type::Type> typesForMimeType(const QString& mimeType); | | |||
49 | | ||||
50 | QString m_filePath; | 47 | QString m_filePath; | ||
51 | QString m_mimetype; | 48 | QString m_mimetype; | ||
52 | IndexingLevel m_indexingLevel; | 49 | IndexingLevel m_indexingLevel; | ||
53 | 50 | | |||
54 | Document m_doc; | 51 | Document m_doc; | ||
55 | 52 | | |||
56 | friend class BasicIndexingJobTest; | 53 | friend class BasicIndexingJobTest; | ||
57 | }; | 54 | }; | ||
58 | 55 | | |||
59 | } | 56 | } | ||
60 | 57 | | |||
61 | #endif // BASICINDEXINGJOB_H | 58 | #endif // BASICINDEXINGJOB_H |