• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

NepomukDaemons

repository.h

Go to the documentation of this file.
00001 /*
00002  *
00003  * $Id: sourceheader 511311 2006-02-19 14:51:05Z trueg $
00004  *
00005  * This file is part of the Nepomuk KDE project.
00006  * Copyright (C) 2006-2007 Sebastian Trueg <trueg@kde.org>
00007  *
00008  * This program is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version.
00012  * See the file "COPYING" for the exact licensing terms.
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         // the base path for the data. Will contain subfolders:
00091         // "index" for the fulltext index
00092         // "data" for the data
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

NepomukDaemons

Skip menu "NepomukDaemons"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • KCMShell
  • KNotify
  • KStyles
  • Nepomuk Daemons
Generated for API Reference by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal