• Skip to content
  • Skip to link menu
KDE 4.3 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-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_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 namespace Nepomuk {
00031 
00032     class ResourceManager;
00033     class ResourceData;
00034     class Variant;
00035     class Tag;
00036     class Thing;
00037 
00038     enum ErrorCode {
00039         NoError = 0,
00040         CommunicationError, 
00041         InvalidType,
00042         UnknownError
00043     };
00044 
00048     // FIXME: add the uri of the resource as parameter
00049     NEPOMUK_EXPORT QString errorString( ErrorCode code );
00050 
00070     class NEPOMUK_EXPORT Resource
00071     {
00072     public:
00078         Resource();
00079 
00090         Resource( ResourceManager* manager );
00091 
00095         Resource( const Resource& );
00096 
00134         Resource( const QString& pathOrIdentifier, const QUrl& type = QUrl() );
00135 
00144         Resource( const QString& pathOrIdentifier, const QUrl& type, ResourceManager* manager );
00145 
00149         KDE_DEPRECATED Resource( const QString& pathOrIdentifier, const QString& type );
00150 
00163         Resource( const QUrl& uri, const QUrl& type = QUrl() );
00164 
00173         Resource( const QUrl& uri, const QUrl& type, ResourceManager* manager );
00174 
00178         Resource( ResourceData* );
00179 
00183         virtual ~Resource();
00184 
00188         Resource& operator=( const Resource& other );
00189 
00193         Resource& operator=( const QUrl& uri );
00194 
00200         ResourceManager* manager() const;
00201 
00219         KDE_DEPRECATED QString uri() const;
00220 
00233         QUrl resourceUri() const;
00234 
00249         KDE_DEPRECATED QString type() const;
00250 
00260         QUrl resourceType() const;
00261 
00268         QList<QUrl> types() const;
00269 
00275         void setTypes( const QList<QUrl>& types );
00276 
00282         void addType( const QUrl& type );
00283 
00288         bool hasType( const QUrl& typeUri ) const;
00289 
00298         QString className() const;
00299 
00303         KDE_DEPRECATED QHash<QString, Variant> allProperties() const;
00304 
00308         QHash<QUrl, Variant> properties() const;
00309 
00318         bool hasProperty( const QUrl& uri ) const;
00319 
00323         KDE_DEPRECATED bool hasProperty( const QString& uri ) const;
00324 
00331         Variant property( const QUrl& uri ) const;
00332 
00336         KDE_DEPRECATED Variant property( const QString& uri ) const;
00337 
00344         void setProperty( const QUrl& uri, const Variant& value );
00345 
00354         void addProperty( const QUrl& uri, const Variant& value );
00355 
00359         KDE_DEPRECATED void setProperty( const QString& uri, const Variant& value );
00360 
00366         void removeProperty( const QUrl& uri );
00367 
00376         void removeProperty( const QUrl& uri, const Variant& value );
00377 
00381         KDE_DEPRECATED void removeProperty( const QString& uri );
00382 
00388         void remove();
00389 
00394         bool exists() const;
00395 
00403         bool isValid() const;
00404 
00412         QString genericLabel() const;
00413 
00422         QString genericDescription() const;
00423 
00429         QString genericIcon() const;
00430 
00439         Thing pimoThing();
00440 
00445         bool operator==( const Resource& ) const;
00446 
00451         QString description() const;
00452 
00457         void setDescription( const QString& value );
00458 
00462         static QString descriptionUri();
00463 
00467         QStringList identifiers() const;
00468 
00472         void setIdentifiers( const QStringList& value );
00473 
00477         void addIdentifier( const QString& value );
00478 
00482         static QString identifierUri();
00483 
00487         QStringList altLabels() const;
00488 
00492         void setAltLabels( const QStringList& value );
00493 
00497         void addAltLabel( const QString& value );
00498 
00502         static QString altLabelUri();
00503 
00507         QList<Resource> annotations() const;
00508 
00512         void setAnnotations( const QList<Resource>& value );
00513 
00517         void addAnnotation( const Resource& value );
00518 
00522         static QString annotationUri();
00523 
00528         QList<Tag> tags() const;
00529 
00534         void setTags( const QList<Tag>& value );
00535 
00541         void addTag( const Tag& value );
00542 
00546         static QString tagUri();
00547 
00551         QList<Resource> topics() const;
00552 
00556         void setTopics( const QList<Resource>& value );
00557 
00561         void addTopic( const Resource& value );
00562 
00566         static QString topicUri();
00567 
00571         QList<Resource> isTopicOfs() const;
00572 
00576         void setIsTopicOfs( const QList<Resource>& value );
00577 
00581         void addIsTopicOf( const Resource& value );
00582 
00586         static QString isTopicOfUri();
00587 
00591         QList<Resource> isRelateds() const;
00592 
00596         void setIsRelateds( const QList<Resource>& value );
00597 
00601         void addIsRelated( const Resource& value );
00602 
00606         static QString isRelatedUri();
00607 
00611         QString label() const;
00612 
00616         void setLabel( const QString& value );
00617 
00621         static QString labelUri();
00622 
00626         quint32 rating() const;
00627 
00631         void setRating( const quint32& value );
00632 
00636         static QString ratingUri();
00637 
00644         QStringList symbols() const;
00645 
00652         void setSymbols( const QStringList& value );
00653 
00660         void addSymbol( const QString& value );
00661 
00665         static QString symbolUri();
00666 
00671         QList<Resource> annotationOf() const;
00672 
00677         QList<Resource> isRelatedOf() const;
00678 
00688         static QList<Resource> allResources();
00689 
00690     private:
00691         ResourceData* m_data;
00692 
00693         class Private;
00694         Private* d; // unused
00695 
00696         friend class ResourceData;
00697     };
00698 }
00699 
00700 #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
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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