Nepomuk
resourcemanager.h
Go to the documentation of this file.
00001 /* 00002 * This file is part of the Nepomuk KDE project. 00003 * Copyright (C) 2006-2009 Sebastian Trueg <trueg@kde.org> 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Library General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Library General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Library General Public License 00016 * along with this library; see the file COPYING.LIB. If not, write to 00017 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 * Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef _NEPOMUK_RESOURCE_MANAGER_H_ 00022 #define _NEPOMUK_RESOURCE_MANAGER_H_ 00023 00024 #include "nepomuk_export.h" 00025 00026 #include <QtCore/QObject> 00027 #include <QtCore/QUrl> 00028 00029 00030 namespace Soprano { 00031 class Model; 00032 } 00033 00034 namespace Nepomuk { 00035 class Resource; 00036 class Variant; 00037 class ResourceManagerHelper; 00038 class ResourceManagerPrivate; 00039 namespace Types { 00040 class Class; 00041 class Property; 00042 } 00043 00055 class NEPOMUK_EXPORT ResourceManager : public QObject 00056 { 00057 Q_OBJECT 00058 00059 public: 00060 static ResourceManager* instance(); 00061 00071 void deleteInstance(); 00072 00084 int init(); 00085 00090 bool initialized() const; 00091 00095 Soprano::Model* mainModel(); 00096 00105 void setOverrideMainModel( Soprano::Model* model ); 00106 00117 #ifndef KDE_NO_DEPRECATED 00118 KDE_DEPRECATED Resource createResourceFromUri( const QString& uri ); 00119 #endif 00120 00127 void removeResource( const QString& uri ); 00128 00138 QList<Resource> allResources(); 00139 00150 QList<Resource> allResourcesOfType( const QUrl& type ); 00151 00155 #ifndef KDE_NO_DEPRECATED 00156 KDE_DEPRECATED QList<Resource> allResourcesOfType( const QString& type ); 00157 #endif 00158 00174 QList<Resource> allResourcesWithProperty( const QUrl& uri, const Variant& v ); 00175 00179 #ifndef KDE_NO_DEPRECATED 00180 KDE_DEPRECATED QList<Resource> allResourcesWithProperty( const QString& uri, const Variant& v ); 00181 #endif 00182 00189 void clearCache(); 00190 00197 #ifndef KDE_NO_DEPRECATED 00198 KDE_DEPRECATED QString generateUniqueUri(); 00199 #endif 00200 00211 QUrl generateUniqueUri( const QString& label ); 00212 00216 void notifyError( const QString& uri, int errorCode ); 00217 00228 static ResourceManager* createManagerForModel( Soprano::Model* model ); 00229 00230 Q_SIGNALS: 00240 void resourceModified( const QString& uri ); 00241 00249 void error( const QString& uri, int errorCode ); 00250 00260 void nepomukSystemStarted(); 00261 00267 void nepomukSystemStopped(); 00268 00269 private Q_SLOTS: 00270 void slotPropertyAdded(const Nepomuk::Resource &res, const Nepomuk::Types::Property &prop, const QVariant &value); 00271 void slotPropertyRemoved(const Nepomuk::Resource &res, const Nepomuk::Types::Property &prop, const QVariant &value); 00272 00273 private: 00274 friend class Nepomuk::Resource; 00275 friend class Nepomuk::ResourceManagerPrivate; 00276 00277 ResourceManager(); 00278 ~ResourceManager(); 00279 00280 static ResourceManager* s_instance; 00281 00282 ResourceManagerPrivate* const d; 00283 00284 Q_PRIVATE_SLOT( d, void _k_storageServiceInitialized(bool) ) 00285 Q_PRIVATE_SLOT( d, void _k_dbusServiceUnregistered(QString) ) 00286 }; 00287 } 00288 00289 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Wed May 2 2012 17:32:54 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Wed May 2 2012 17:32:54 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.