compile
[kdegraphics.git] / strigi-analyzer / mobi / mobiendanalyzer.h
blobc289c9367b0831b98b9d7c33aee1360f891701ee
1 /***************************************************************************
2 * Copyright (C) 2008 by Jakub Stachowski <qbast@go2.pl> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 ***************************************************************************/
10 #ifndef MOBIENDANALYZER
11 #define MOBIENDANALYZER
13 #include <strigi/streamendanalyzer.h>
14 #include <strigi/streambase.h>
16 class MobiEndAnalyzerFactory;
17 class MobiEndAnalyzer : public Strigi::StreamEndAnalyzer {
18 private:
19 const MobiEndAnalyzerFactory* factory;
20 bool checkHeader(const char* header, int32_t headersize) const; //krazy:exclude=typedefs
21 signed char analyze(Strigi::AnalysisResult& idx, Strigi::InputStream* in);
22 const char* name() const { return "MobiEndAnalyzer"; }
23 public:
24 MobiEndAnalyzer(const MobiEndAnalyzerFactory* f);
27 class MobiEndAnalyzerFactory : public Strigi::StreamEndAnalyzerFactory {
28 friend class MobiEndAnalyzer;
29 private:
30 const Strigi::RegisteredField* titleField;
31 const Strigi::RegisteredField* authorField;
32 const Strigi::RegisteredField* copyrightField;
33 const Strigi::RegisteredField* subjectField;
34 const Strigi::RegisteredField* descriptionField;
35 const Strigi::RegisteredField* encryptedField;
36 // const Strigi::RegisteredField* typeField;
38 const char* name() const {
39 return "MobiEndAnalyzer";
41 Strigi::StreamEndAnalyzer* newInstance() const {
42 return new MobiEndAnalyzer(this);
44 void registerFields(Strigi::FieldRegister&);
47 #endif