NepomukDaemons
kio_nepomuksearch.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _NEPOMUK_KIO_NEPOMUK_SEARCH_H_
00020 #define _NEPOMUK_KIO_NEPOMUK_SEARCH_H_
00021
00022 #include <kio/forwardingslavebase.h>
00023
00024 #include "term.h"
00025 #include "searchfolder.h"
00026
00027 #include <QtCore/QQueue>
00028
00029 namespace Nepomuk {
00030 namespace Search {
00031 class Query;
00032 }
00033
00034 class SearchProtocol : public KIO::ForwardingSlaveBase
00035 {
00036 Q_OBJECT
00037
00038 public:
00039 SearchProtocol( const QByteArray& poolSocket, const QByteArray& appSocket );
00040 virtual ~SearchProtocol();
00041
00045 void listDir( const KUrl& url );
00046
00050 void get( const KUrl& url );
00051
00055 void put( const KUrl& url, int permissions, KIO::JobFlags flags );
00056
00061 void mimetype( const KUrl& url );
00062
00067 void stat( const KUrl& url );
00068
00069 protected:
00073 bool rewriteUrl( const KUrl& url, KUrl& newURL );
00074
00075 private:
00076 void listRoot();
00077 void listQuery( const QString& query );
00078 void listActions();
00079 void listDefaultSearches();
00080 void listDefaultSearch( const QString& path );
00081 void addDefaultSearch( const QString& name, const Search::Query& );
00082
00083 SearchFolder* extractSearchFolder( const KUrl& url );
00084
00088 SearchFolder* getQueryResults( const QString& query );
00089 SearchFolder* getDefaultQueryFolder( const QString& name );
00090
00091
00092 QHash<QString, Nepomuk::Search::Query> m_defaultSearches;
00093
00094
00095 QHash<QString, SearchFolder*> m_searchCache;
00096
00097
00098
00099 QQueue<QString> m_searchCacheNameQueue;
00100
00101
00102
00103 QHash<QString, SearchFolder*> m_defaultSearchCache;
00104 };
00105 }
00106
00107 #endif