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/Util/SignalCacheModel>
00022
00023
00024 namespace Soprano {
00025 class Model;
00026 class Backend;
00027 namespace Index {
00028 class IndexFilterModel;
00029 class CLuceneIndex;
00030 }
00031 }
00032
00033 class KJob;
00034
00035 namespace Nepomuk {
00036
00037 class CLuceneAnalyzer;
00038
00039 class Repository : public Soprano::Util::SignalCacheModel
00040 {
00041 Q_OBJECT
00042
00043 public:
00044 Repository( const QString& name );
00045 ~Repository();
00046
00047 QString name() const { return m_name; }
00048
00049 enum State {
00050 CLOSED,
00051 OPENING,
00052 OPEN
00053 };
00054
00055 State state() const;
00056
00057 static const Soprano::Backend* activeSopranoBackend();
00058
00059 public Q_SLOTS:
00063 void open();
00064
00065 void close();
00066
00070 void optimize();
00071
00072 Q_SIGNALS:
00073 void opened( Repository*, bool success );
00074
00075 private Q_SLOTS:
00076 void copyFinished( KJob* job );
00077 void rebuildingIndexFinished();
00078 void slotDoOptimize();
00079
00080 private:
00085 bool rebuildIndexIfNecessary();
00086
00087 QString m_name;
00088 State m_state;
00089
00090
00091
00092
00093 QString m_basePath;
00094
00095 const Soprano::Backend* m_oldStorageBackend;
00096 QString m_oldStoragePath;
00097
00098 Soprano::Model* m_model;
00099 Nepomuk::CLuceneAnalyzer* m_analyzer;
00100 Soprano::Index::CLuceneIndex* m_index;
00101 Soprano::Index::IndexFilterModel* m_indexModel;
00102 };
00103
00104 typedef QMap<QString, Repository*> RepositoryMap;
00105 }
00106
00107 #endif