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

Nepomuk

  • sources
  • kde-4.12
  • kdelibs
  • nepomuk
  • core
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 "../types/class.h"
26 #include "../types/property.h"
27 #include "resource.h"
28 
29 #include <QtDBus/QDBusVariant>
30 #include <QtCore/QVariant>
31 
32 namespace Nepomuk {
33 
78  class ResourceWatcher : public QObject
79  {
80  Q_OBJECT
81 
82  public:
89  ResourceWatcher( QObject* parent = 0 );
90 
94  virtual ~ResourceWatcher();
95 
96  public Q_SLOTS:
104  void addType( const Types::Class & type );
105 
114  void addResource( const Nepomuk::Resource & res );
115 
124  void addProperty( const Types::Property & property );
125 
133  void removeType( const Types::Class & type );
134 
143  void removeResource( const Nepomuk::Resource & res );
144 
153  void removeProperty( const Types::Property & property );
154 
162  void setTypes( const QList<Types::Class> & types_ );
163 
172  void setResources( const QList<Nepomuk::Resource> & resources_ );
173 
182  void setProperties( const QList<Types::Property> & properties_ );
183 
190  QList<Types::Class> types() const;
191 
199  int typeCount() const;
200 
207  QList<Nepomuk::Resource> resources() const;
208 
216  int resourceCount() const;
217 
224  QList<Types::Property> properties() const;
225 
233  int propertyCount() const;
234 
242  bool start();
243 
250  void stop();
251 
252  Q_SIGNALS:
259  void resourceCreated( const Nepomuk::Resource & resource, const QList<QUrl>& types ); //FIXME: Use either Resource or uri, not a mix
260 
267  void resourceRemoved( const QUrl & uri, const QList<QUrl>& types );
268 
275  void resourceTypeAdded( const Nepomuk::Resource & res, const Types::Class & type );
276 
285  void resourceTypeRemoved( const Nepomuk::Resource & res, const Types::Class & type );
286 
293  void propertyAdded( const Nepomuk::Resource & resource,
294  const Nepomuk::Types::Property & property,
295  const QVariant & value );
296 
303  void propertyRemoved( const Nepomuk::Resource & resource,
304  const Nepomuk::Types::Property & property,
305  const QVariant & value );
306 
321  void propertyChanged( const Nepomuk::Resource & resource,
322  const Nepomuk::Types::Property & property,
323  const QVariantList & oldValue,
324  const QVariantList & newValue );
325 
326  private Q_SLOTS:
327  void slotResourceCreated(const QString& res, const QStringList& types);
328  void slotResourceRemoved(const QString& res, const QStringList& types);
329  void slotResourceTypeAdded(const QString& res, const QString& type);
330  void slotResourceTypeRemoved(const QString& res, const QString& type);
331  void slotPropertyAdded(const QString& res, const QString& prop, const QVariantList& objects);
332  void slotPropertyRemoved(const QString& res, const QString& prop, const QVariantList& objects);
333  void slotPropertyChanged(const QString& res, const QString& prop,
334  const QVariantList & oldObjs,
335  const QVariantList & newObjs);
336  private:
337  class Private;
338  Private * d;
339  };
340 }
341 
342 #endif // RESOURCEWATCHER_H
Nepomuk::ResourceWatcher::propertyRemoved
void propertyRemoved(const Nepomuk::Resource &resource, const Nepomuk::Types::Property &property, const QVariant &value)
This signal is emitted when a property value is removed.
Nepomuk::ResourceWatcher::propertyChanged
void propertyChanged(const Nepomuk::Resource &resource, const Nepomuk::Types::Property &property, const QVariantList &oldValue, const QVariantList &newValue)
This signal is emitted when a property value is changed.
Nepomuk::ResourceWatcher::resourceTypeRemoved
void resourceTypeRemoved(const Nepomuk::Resource &res, const Types::Class &type)
This signal is emitted when a type has been removed from a resource.
Nepomuk::Resource
Resource is the central object type in Nepomuk.
Definition: resource.h:94
Nepomuk::ResourceWatcher::addProperty
void addProperty(const Types::Property &property)
Add a property to be watched.
Nepomuk::ResourceWatcher::propertyAdded
void propertyAdded(const Nepomuk::Resource &resource, const Nepomuk::Types::Property &property, const QVariant &value)
This signal is emitted when a property value is added.
Nepomuk::ResourceWatcher::start
bool start()
Start the signalling of changes.
Nepomuk::ResourceWatcher::resourceCount
int resourceCount() const
Return the number of resources that are being watched.
Nepomuk::ResourceWatcher::setResources
void setResources(const QList< Nepomuk::Resource > &resources_)
Set the resources to be watched.
Nepomuk::ResourceWatcher
Selectively monitor the nepomuk repository for changes.
Definition: resourcewatcher.h:78
Nepomuk::ResourceWatcher::resourceTypeAdded
void resourceTypeAdded(const Nepomuk::Resource &res, const Types::Class &type)
This signal is emitted when a type has been added to a resource.
QObject
Nepomuk::ResourceWatcher::resourceRemoved
void resourceRemoved(const QUrl &uri, const QList< QUrl > &types)
This signal is emitted when a resource is deleted.
Nepomuk::Types::Property
A property is a resource of type rdf:Property which relates a domain with a range.
Definition: property.h:52
Nepomuk::ResourceWatcher::addType
void addType(const Types::Class &type)
Add a type to be watched.
Nepomuk::ResourceWatcher::stop
void stop()
Stop the signalling of changes.
Nepomuk::ResourceWatcher::setProperties
void setProperties(const QList< Types::Property > &properties_)
Set the properties to be watched.
Nepomuk::ResourceWatcher::types
QList< Types::Class > types() const
The types that have been configured via addType() and setTypes().
resource.h
Nepomuk::ResourceWatcher::removeType
void removeType(const Types::Class &type)
Remove a type to be watched.
Nepomuk::ResourceWatcher::resourceCreated
void resourceCreated(const Nepomuk::Resource &resource, const QList< QUrl > &types)
This signal is emitted when a new resource is created.
Nepomuk::ResourceWatcher::setTypes
void setTypes(const QList< Types::Class > &types_)
Set the types to be watched.
Nepomuk::ResourceWatcher::removeResource
void removeResource(const Nepomuk::Resource &res)
Remove a resource to be watched.
Nepomuk::ResourceWatcher::removeProperty
void removeProperty(const Types::Property &property)
Remove a property to be watched.
Nepomuk::Types::Class
A Class is a resource of type rdf:Class.
Definition: class.h:49
Nepomuk::ResourceWatcher::typeCount
int typeCount() const
Return the number of types that are being watched.
Nepomuk::ResourceWatcher::propertyCount
int propertyCount() const
Return the number of properties that are being watched.
Nepomuk::ResourceWatcher::~ResourceWatcher
virtual ~ResourceWatcher()
Destructor.
Nepomuk::ResourceWatcher::properties
QList< Types::Property > properties() const
The properties that have been configured via addProperty() and setProperties().
Nepomuk::ResourceWatcher::resources
QList< Nepomuk::Resource > resources() const
The resources that have been configured via addResource() and setResources().
Nepomuk::ResourceWatcher::ResourceWatcher
ResourceWatcher(QObject *parent=0)
Create a new ResourceWatcher instance.
Nepomuk::ResourceWatcher::addResource
void addResource(const Nepomuk::Resource &res)
Add a resource to be watched.
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:27 by doxygen 1.8.7 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 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