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

Nepomuk-Core

  • sources
  • kde-4.12
  • kdelibs
  • nepomuk-core
  • libnepomukcore
  • datamanagement
resourcewatcher.h
Go to the documentation of this file.
1 /*
2  This file is part of the Nepomuk KDE project.
3  Copyright (C) 2011 Vishesh Handa <handa.vish@gmail.com>
4  Copyright (C) 2011 Sebastian Trueg <trueg@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with this library; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20 
21 
22 #ifndef RESOURCEWATCHER_H
23 #define RESOURCEWATCHER_H
24 
25 #include "class.h"
26 #include "property.h"
27 #include "resource.h"
28 
29 #include <QtDBus/QDBusVariant>
30 #include <QDBusPendingCallWatcher>
31 #include <QtCore/QVariant>
32 
33 #include "nepomuk_export.h"
34 
35 namespace Nepomuk2 {
36 
81  class NEPOMUK_EXPORT ResourceWatcher : public QObject
82  {
83  Q_OBJECT
84 
85  public:
92  ResourceWatcher( QObject* parent = 0 );
93 
97  virtual ~ResourceWatcher();
98 
99  public Q_SLOTS:
107  void addType( const Types::Class & type );
108 
117  void addResource( const Nepomuk2::Resource & res );
118 
127  void addResource( const QUrl& resUri );
128 
137  void addProperty( const Types::Property & property );
138 
146  void removeType( const Types::Class & type );
147 
156  void removeResource( const Nepomuk2::Resource & res );
157 
166  void removeResource( const QUrl& resUri );
167 
176  void removeProperty( const Types::Property & property );
177 
185  void setTypes( const QList<Types::Class> & types_ );
186 
195  void setResources( const QList<Nepomuk2::Resource> & resources_ );
196 
205  void setProperties( const QList<Types::Property> & properties_ );
206 
213  QList<Types::Class> types() const;
214 
222  int typeCount() const;
223 
230  QList<Nepomuk2::Resource> resources() const;
231 
239  int resourceCount() const;
240 
247  QList<Types::Property> properties() const;
248 
256  int propertyCount() const;
257 
265  bool start();
266 
273  void stop();
274 
275  Q_SIGNALS:
282  void resourceCreated( const Nepomuk2::Resource & resource, const QList<QUrl>& types ); //FIXME: Use either Resource or uri, not a mix
283 
290  void resourceRemoved( const QUrl & uri, const QList<QUrl>& types );
291 
298  void resourceTypeAdded( const Nepomuk2::Resource & res, const Nepomuk2::Types::Class & type );
299 
308  void resourceTypeRemoved( const Nepomuk2::Resource & res, const Nepomuk2::Types::Class & type );
309 
316  void propertyAdded( const Nepomuk2::Resource & resource,
317  const Nepomuk2::Types::Property & property,
318  const QVariant & value );
319 
326  void propertyRemoved( const Nepomuk2::Resource & resource,
327  const Nepomuk2::Types::Property & property,
328  const QVariant & value );
329 
346  void propertyChanged( const Nepomuk2::Resource & resource,
347  const Nepomuk2::Types::Property & property,
348  const QVariantList & addedValues,
349  const QVariantList & removedValues );
350 
351  private Q_SLOTS:
352  void slotWatchFinished(QDBusPendingCallWatcher* replyWatcher);
353  void slotResourceCreated(const QString& res, const QStringList& types);
354  void slotResourceRemoved(const QString& res, const QStringList& types);
355  void slotResourceTypesAdded(const QString& res, const QStringList& types);
356  void slotResourceTypesRemoved(const QString& res, const QStringList& types);
357  void slotPropertyChanged(const QString& res, const QString& prop_, const QVariantList& addedObjs, const QVariantList& removedObjs);
358  private:
359  class Private;
360  Private * d;
361  };
362 }
363 
364 #endif // RESOURCEWATCHER_H
class.h
Nepomuk2::addProperty
KJob * addProperty(const QList< QUrl > &resources, const QUrl &property, const QVariantList &values, const KComponentData &component=KGlobal::mainComponent())
Add one or more property values to one or more resources.
Definition: datamanagement.cpp:36
Nepomuk2::removeProperty
KJob * removeProperty(const QList< QUrl > &resources, const QUrl &property, const QVariantList &values, const KComponentData &component=KGlobal::mainComponent())
Remove values of a property from one or more resources.
Definition: datamanagement.cpp:61
QObject
Nepomuk2::Types::Class
A Class is a resource of type rdf:Class.
Definition: class.h:49
resource.h
Nepomuk2::Types::Property
A property is a resource of type rdf:Property which relates a domain with a range.
Definition: libnepomukcore/types/property.h:52
Nepomuk2::ResourceWatcher
Selectively monitor the nepomuk repository for changes.
Definition: resourcewatcher.h:81
Nepomuk2::Resource
Resource is the central object type in Nepomuk.
Definition: resource.h:93
start
void start()
Definition: ontologydownloadjob.cpp:13
nepomuk_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:09 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Nepomuk-Core

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

kdelibs API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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