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

NepomukDaemons

kio_nepomuksearch.h

Go to the documentation of this file.
00001 /*
00002    Copyright (C) 2008 by Sebastian Trueg <trueg at kde.org>
00003 
00004    This program is free software; you can redistribute it and/or modify
00005    it under the terms of the GNU General Public License as published by
00006    the Free Software Foundation; either version 2, or (at your option)
00007    any later version.
00008 
00009    This program is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012    GNU General Public License for more details.
00013 
00014    You should have received a copy of the GNU General Public License
00015    along with this program; if not, write to the Free Software
00016    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
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         // the default search folders
00092         QHash<QString, Nepomuk::Search::Query> m_defaultSearches;
00093 
00094         // cache of all on-the-fly search folders
00095         QHash<QString, SearchFolder*>  m_searchCache;
00096 
00097         // queue to remember the order of the search cache
00098         // when enforcing the cache max
00099         QQueue<QString> m_searchCacheNameQueue;
00100 
00101         // cache for the default searches, needs to differ from
00102         // on-the-fly cache because of the name
00103         QHash<QString, SearchFolder*>  m_defaultSearchCache;
00104     };
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