NepomukDaemons
queryservice.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_VIRTUAL_FOLDER_SERVICE_H_
00020 #define _NEPOMUK_VIRTUAL_FOLDER_SERVICE_H_
00021
00022 #include <Nepomuk/Service>
00023
00024 #include <QtCore/QUrl>
00025 #include <QtCore/QVariant>
00026 #include <QtCore/QMultiHash>
00027
00028 class QDBusObjectPath;
00029 class QDBusMessage;
00030
00031
00032 namespace Nepomuk {
00033 namespace Search {
00034
00035 class Folder;
00036 class FolderConnection;
00037 class Query;
00038
00039 class QueryService : public Service
00040 {
00041 Q_OBJECT
00042 Q_CLASSINFO( "D-Bus Interface", "org.kde.nepomuk.QueryService" )
00043
00044 public:
00045 QueryService( QObject* parent, const QVariantList& );
00046 ~QueryService();
00047
00048 Soprano::Model* mainModel();
00049
00050 static QueryService* instance();
00051
00052 public Q_SLOTS:
00053 Q_SCRIPTABLE QDBusObjectPath query( const QString& query, const QStringList& props, const QDBusMessage& msg );
00054 Q_SCRIPTABLE QDBusObjectPath query( const Nepomuk::Search::Query& query, const QDBusMessage& msg );
00055
00056 private Q_SLOTS:
00057 void slotServiceOwnerChanged( const QString& serviceName,
00058 const QString&,
00059 const QString& newOwner );
00060 void slotFolderDestroyed( QObject* folder );
00061 void slotFolderConnectionDestroyed( QObject* conn );
00062
00063 private:
00067 Folder* getFolder( const Query& query );
00068
00069 static QueryService* s_instance;
00070
00071 QHash<Query, Folder*> m_openFolders;
00072 QHash<Folder*, Query> m_folderQueryHash;
00073 QMultiHash<QString, FolderConnection*> m_openConnections;
00074 QHash<FolderConnection*, QString> m_connectionDBusServiceHash;
00075
00076 int m_folderConnectionCnt;
00077 };
00078 }
00079 }
00080
00081 #endif