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

Nepomuk

resource.h

Go to the documentation of this file.
00001 /*
00002  * This file is part of the Nepomuk KDE project.
00003  * Copyright (C) 2006-2008 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_H_
00022 #define _NEPOMUK_RESOURCE_H_
00023 
00024 #include <QtCore/QHash>
00025 #include <QtCore/QStringList>
00026 #include <QtCore/QUrl>
00027 
00028 #include "nepomuk_export.h"
00029 
00030 
00031 namespace Nepomuk {
00032 
00033     class ResourceData;
00034     class Variant;
00035     class Tag;
00036     class Resource;
00037 
00038 
00039     enum ErrorCode {
00040         NoError = 0,
00041         CommunicationError, 
00042         InvalidType,
00043         UnknownError
00044     };
00045 
00049     // FIXME: add the uri of the resource as parameter
00050     NEPOMUK_EXPORT QString errorString( ErrorCode code );
00051 
00071     class NEPOMUK_EXPORT Resource
00072     {
00073     public:
00079         Resource();
00080 
00081         Resource( const Resource& );
00082 
00128         Resource( const QString& uriOrIdentifier, const QUrl& type = QUrl() );
00129 
00133         KDE_DEPRECATED Resource( const QString& uriOrIdentifier, const QString& type );
00134 
00145         Resource( const QUrl& uri, const QUrl& type = QUrl() );
00146 
00150         Resource( ResourceData* );
00151 
00152         virtual ~Resource();
00153 
00154         Resource& operator=( const Resource& );
00155 
00173         KDE_DEPRECATED QString uri() const;
00174 
00187         QUrl resourceUri() const;
00188 
00203         KDE_DEPRECATED QString type() const;
00204 
00214         QUrl resourceType() const;
00215 
00222         QList<QUrl> types() const;
00223 
00228         bool hasType( const QUrl& typeUri ) const;
00229 
00238         QString className() const;
00239 
00243         KDE_DEPRECATED QHash<QString, Variant> allProperties() const;
00244 
00248         QHash<QUrl, Variant> properties() const;
00249 
00258         bool hasProperty( const QUrl& uri ) const;
00259 
00263         KDE_DEPRECATED bool hasProperty( const QString& uri ) const;
00264 
00271         Variant property( const QUrl& uri ) const;
00272 
00276         KDE_DEPRECATED Variant property( const QString& uri ) const;
00277 
00284         void setProperty( const QUrl& uri, const Variant& value );
00285 
00289         KDE_DEPRECATED void setProperty( const QString& uri, const Variant& value );
00290 
00296         void removeProperty( const QUrl& uri );
00297 
00301         KDE_DEPRECATED void removeProperty( const QString& uri );
00302 
00308         void remove();
00309 
00314         bool exists() const;
00315 
00323         bool isValid() const;
00324 
00332         QString genericLabel() const;
00333 
00342         QString genericDescription() const;
00343 
00349         QString genericIcon() const;
00350 
00355         bool operator==( const Resource& ) const;
00356 
00361         QString description() const;
00362 
00367         void setDescription( const QString& value );
00368 
00372         static QString descriptionUri();
00373 
00377         QStringList identifiers() const;
00378 
00382         void setIdentifiers( const QStringList& value );
00383 
00387         void addIdentifier( const QString& value );
00388 
00392         static QString identifierUri();
00393 
00397         QStringList altLabels() const;
00398 
00402         void setAltLabels( const QStringList& value );
00403 
00407         void addAltLabel( const QString& value );
00408 
00412         static QString altLabelUri();
00413 
00417         QList<Resource> annotations() const;
00418 
00422         void setAnnotations( const QList<Resource>& value );
00423 
00427         void addAnnotation( const Resource& value );
00428 
00432         static QString annotationUri();
00433 
00438         QList<Tag> tags() const;
00439 
00444         void setTags( const QList<Tag>& value );
00445 
00451         void addTag( const Tag& value );
00452 
00456         static QString tagUri();
00457 
00461         QList<Resource> topics() const;
00462 
00466         void setTopics( const QList<Resource>& value );
00467 
00471         void addTopic( const Resource& value );
00472 
00476         static QString topicUri();
00477 
00481         QList<Resource> isTopicOfs() const;
00482 
00486         void setIsTopicOfs( const QList<Resource>& value );
00487 
00491         void addIsTopicOf( const Resource& value );
00492 
00496         static QString isTopicOfUri();
00497 
00501         QList<Resource> isRelateds() const;
00502 
00506         void setIsRelateds( const QList<Resource>& value );
00507 
00511         void addIsRelated( const Resource& value );
00512 
00516         static QString isRelatedUri();
00517 
00521         QString label() const;
00522 
00526         void setLabel( const QString& value );
00527 
00531         static QString labelUri();
00532 
00536         quint32 rating() const;
00537 
00541         void setRating( const quint32& value );
00542 
00546         static QString ratingUri();
00547 
00554         QStringList symbols() const;
00555 
00562         void setSymbols( const QStringList& value );
00563 
00570         void addSymbol( const QString& value );
00571 
00575         static QString symbolUri();
00576 
00581         QList<Resource> annotationOf() const;
00582 
00587         QList<Resource> isRelatedOf() const;
00588 
00596         static QList<Resource> allResources();
00597 
00598 
00599     private:
00600         ResourceData* m_data;
00601 
00602         class Private;
00603         Private* d; // unused
00604 
00605         friend class ResourceData;
00606     };
00607 }
00608 
00609 #endif

Nepomuk

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal