NepomukDaemons
repository.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef _REPOSITORY_H_
00016 #define _REPOSITORY_H_
00017
00018 #include <QtCore/QString>
00019 #include <QtCore/QMap>
00020
00021 #include <soprano/version.h>
00022
00023 #ifndef SOPRANO_IS_VERSION
00024 #define SOPRANO_IS_VERSION(a,b,c) false
00025 #endif
00026
00027 #if SOPRANO_IS_VERSION(2,0,90)
00028 #include <Soprano/Util/SignalCacheModel>
00029 #else
00030 #include <Soprano/FilterModel>
00031 #endif
00032
00033
00034 namespace Soprano {
00035 class Model;
00036 class Backend;
00037 namespace Index {
00038 class IndexFilterModel;
00039 class CLuceneIndex;
00040 }
00041 }
00042
00043 class KJob;
00044
00045 namespace Nepomuk {
00046
00047 class CLuceneAnalyzer;
00048
00049 class Repository : public
00050 #if SOPRANO_IS_VERSION(2,0,90)
00051 Soprano::Util::SignalCacheModel
00052 #else
00053 Soprano::FilterModel
00054 #endif
00055 {
00056 Q_OBJECT
00057
00058 public:
00059 Repository( const QString& name );
00060 ~Repository();
00061
00062 QString name() const { return m_name; }
00063
00064 enum State {
00065 CLOSED,
00066 OPENING,
00067 OPEN
00068 };
00069
00070 State state() const;
00071
00072 static const Soprano::Backend* activeSopranoBackend();
00073
00074 public Q_SLOTS:
00078 void open();
00079
00080 void close();
00081
00082 Q_SIGNALS:
00083 void opened( Repository*, bool success );
00084
00085 private Q_SLOTS:
00086 void copyFinished( KJob* job );
00087
00088 private:
00089 QString m_name;
00090 State m_state;
00091
00092
00093
00094
00095 QString m_basePath;
00096
00097 const Soprano::Backend* m_oldStorageBackend;
00098 QString m_oldStoragePath;
00099
00100 Soprano::Model* m_model;
00101 Nepomuk::CLuceneAnalyzer* m_analyzer;
00102 Soprano::Index::CLuceneIndex* m_index;
00103 Soprano::Index::IndexFilterModel* m_indexModel;
00104 };
00105
00106 typedef QMap<QString, Repository*> RepositoryMap;
00107 }
00108
00109 #endif