• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

Nepomuk

  • nepomuk
  • core
resourcemanager.h
Go to the documentation of this file.
1/*
2 * This file is part of the Nepomuk KDE project.
3 * Copyright (C) 2006-2009 Sebastian Trueg <trueg@kde.org>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20
21#ifndef _NEPOMUK_RESOURCE_MANAGER_H_
22#define _NEPOMUK_RESOURCE_MANAGER_H_
23
24#include "nepomuk_export.h"
25
26#include <QtCore/QObject>
27#include <QtCore/QUrl>
28
29
30namespace Soprano {
31 class Model;
32}
33
34namespace Nepomuk {
35 class Resource;
36 class Variant;
37 class ResourceManagerHelper;
38 class ResourceManagerPrivate;
39 namespace Types {
40 class Class;
41 class Property;
42 }
43
55 class NEPOMUK_EXPORT ResourceManager : public QObject
56 {
57 Q_OBJECT
58
59 public:
60 static ResourceManager* instance();
61
71 void deleteInstance();
72
84 int init();
85
90 bool initialized() const;
91
95 Soprano::Model* mainModel();
96
105 void setOverrideMainModel( Soprano::Model* model );
106
117#ifndef KDE_NO_DEPRECATED
118 KDE_DEPRECATED Resource createResourceFromUri( const QString& uri );
119#endif
120
127 void removeResource( const QString& uri );
128
138 QList<Resource> allResources();
139
150 QList<Resource> allResourcesOfType( const QUrl& type );
151
155#ifndef KDE_NO_DEPRECATED
156 KDE_DEPRECATED QList<Resource> allResourcesOfType( const QString& type );
157#endif
158
174 QList<Resource> allResourcesWithProperty( const QUrl& uri, const Variant& v );
175
179#ifndef KDE_NO_DEPRECATED
180 KDE_DEPRECATED QList<Resource> allResourcesWithProperty( const QString& uri, const Variant& v );
181#endif
182
189 void clearCache();
190
197#ifndef KDE_NO_DEPRECATED
198 KDE_DEPRECATED QString generateUniqueUri();
199#endif
200
211 QUrl generateUniqueUri( const QString& label );
212
216 void notifyError( const QString& uri, int errorCode );
217
228 static ResourceManager* createManagerForModel( Soprano::Model* model );
229
230 Q_SIGNALS:
240 void resourceModified( const QString& uri );
241
249 void error( const QString& uri, int errorCode );
250
260 void nepomukSystemStarted();
261
267 void nepomukSystemStopped();
268
269 private Q_SLOTS:
270 void slotPropertyAdded(const Nepomuk::Resource &res, const Nepomuk::Types::Property &prop, const QVariant &value);
271 void slotPropertyRemoved(const Nepomuk::Resource &res, const Nepomuk::Types::Property &prop, const QVariant &value);
272
273 private:
274 friend class Nepomuk::Resource;
275 friend class Nepomuk::ResourceManagerPrivate;
276
277 ResourceManager();
278 ~ResourceManager();
279
280 static ResourceManager* s_instance;
281
282 ResourceManagerPrivate* const d;
283
284 Q_PRIVATE_SLOT( d, void _k_storageServiceInitialized(bool) )
285 Q_PRIVATE_SLOT( d, void _k_dbusServiceUnregistered(QString) )
286 };
287}
288
289#endif
Nepomuk::ResourceManager
The ResourceManager is the central Nepomuk configuration point.
Definition: resourcemanager.h:56
Nepomuk::ResourceManager::init
int init()
Initialize the Nepomuk framework.
Nepomuk::ResourceManager::allResources
QList< Resource > allResources()
Retrieve a list of all resource managed by this manager.
Nepomuk::ResourceManager::error
void error(const QString &uri, int errorCode)
Whenever a problem occurs (like for example failed resource syncing) this signal is emitted.
Nepomuk::ResourceManager::createResourceFromUri
Resource createResourceFromUri(const QString &uri)
Nepomuk::ResourceManager::allResourcesOfType
QList< Resource > allResourcesOfType(const QUrl &type)
Retrieve a list of all resources of the specified type.
Nepomuk::ResourceManager::allResourcesWithProperty
QList< Resource > allResourcesWithProperty(const QString &uri, const Variant &v)
Nepomuk::ResourceManager::allResourcesWithProperty
QList< Resource > allResourcesWithProperty(const QUrl &uri, const Variant &v)
Retrieve a list of all resources that have property uri defined with a value of v.
Nepomuk::ResourceManager::removeResource
void removeResource(const QString &uri)
Remove the resource denoted by uri completely.
Nepomuk::ResourceManager::createManagerForModel
static ResourceManager * createManagerForModel(Soprano::Model *model)
Create a new ResourceManager instance which uses model as its override model.
Nepomuk::ResourceManager::resourceModified
void resourceModified(const QString &uri)
This signal gets emitted whenever a Resource changes due to a sync procedure.
Nepomuk::ResourceManager::deleteInstance
void deleteInstance()
In KDE 4.3 support for multiple ResourceManager instances has been introduced.
Nepomuk::ResourceManager::allResourcesOfType
QList< Resource > allResourcesOfType(const QString &type)
Nepomuk::ResourceManager::generateUniqueUri
QUrl generateUniqueUri(const QString &label)
Generates a unique URI that is not used in the store yet.
Nepomuk::ResourceManager::generateUniqueUri
QString generateUniqueUri()
Nepomuk::ResourceManager::mainModel
Soprano::Model * mainModel()
Retrieve the main data storage model.
Nepomuk::ResourceManager::setOverrideMainModel
void setOverrideMainModel(Soprano::Model *model)
Override the main model used for all storage.
Nepomuk::ResourceManager::clearCache
void clearCache()
ResourceManager caches resource locally so subsequent access is faster.
Nepomuk::ResourceManager::nepomukSystemStopped
void nepomukSystemStopped()
Emitted once the Nepomuk system goes down.
Nepomuk::ResourceManager::initialized
bool initialized() const
Nepomuk::ResourceManager::nepomukSystemStarted
void nepomukSystemStarted()
Emitted once the Nepomuk system is up and can be used.
Nepomuk::ResourceManager::notifyError
void notifyError(const QString &uri, int errorCode)
Nepomuk::ResourceManager::instance
static ResourceManager * instance()
Nepomuk::Resource
Resource is the central object type in Nepomuk.
Definition: resource.h:95
Nepomuk::Types::Property
A property is a resource of type rdf:Property which relates a domain with a range.
Definition: property.h:53
Nepomuk::Variant
The Nepomuk Variant extends over QVariant by introducing direct support for Resource embedding,...
Definition: variant.h:66
QObject
Nepomuk
Soprano
Definition: nepomukservice.h:25
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Nepomuk

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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal