• Skip to content
  • Skip to link menu
KDE 4.2 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 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 
00080         Resource( const Resource& );
00081 
00127         Resource( const QString& uriOrIdentifier, const QUrl& type = QUrl() );
00128 
00132         KDE_DEPRECATED Resource( const QString& uriOrIdentifier, const QString& type );
00133 
00144         Resource( const QUrl& uri, const QUrl& type = QUrl() );
00145 
00149         Resource( ResourceData* );
00150 
00151         virtual ~Resource();
00152 
00153         Resource& operator=( const Resource& );
00154 
00155         Resource& operator=( const QUrl& );
00156 
00174         KDE_DEPRECATED QString uri() const;
00175 
00188         QUrl resourceUri() const;
00189 
00204         KDE_DEPRECATED QString type() const;
00205 
00215         QUrl resourceType() const;
00216 
00223         QList<QUrl> types() const;
00224 
00230         void setTypes( const QList<QUrl>& types );
00231 
00237         void addType( const QUrl& type );
00238 
00243         bool hasType( const QUrl& typeUri ) const;
00244 
00253         QString className() const;
00254 
00258         KDE_DEPRECATED QHash<QString, Variant> allProperties() const;
00259 
00263         QHash<QUrl, Variant> properties() const;
00264 
00273         bool hasProperty( const QUrl& uri ) const;
00274 
00278         KDE_DEPRECATED bool hasProperty( const QString& uri ) const;
00279 
00286         Variant property( const QUrl& uri ) const;
00287 
00291         KDE_DEPRECATED Variant property( const QString& uri ) const;
00292 
00299         void setProperty( const QUrl& uri, const Variant& value );
00300 
00304         KDE_DEPRECATED void setProperty( const QString& uri, const Variant& value );
00305 
00311         void removeProperty( const QUrl& uri );
00312 
00316         KDE_DEPRECATED void removeProperty( const QString& uri );
00317 
00323         void remove();
00324 
00329         bool exists() const;
00330 
00338         bool isValid() const;
00339 
00347         QString genericLabel() const;
00348 
00357         QString genericDescription() const;
00358 
00364         QString genericIcon() const;
00365 
00374         Thing pimoThing();
00375 
00380         bool operator==( const Resource& ) const;
00381 
00386         QString description() const;
00387 
00392         void setDescription( const QString& value );
00393 
00397         static QString descriptionUri();
00398 
00402         QStringList identifiers() const;
00403 
00407         void setIdentifiers( const QStringList& value );
00408 
00412         void addIdentifier( const QString& value );
00413 
00417         static QString identifierUri();
00418 
00422         QStringList altLabels() const;
00423 
00427         void setAltLabels( const QStringList& value );
00428 
00432         void addAltLabel( const QString& value );
00433 
00437         static QString altLabelUri();
00438 
00442         QList<Resource> annotations() const;
00443 
00447         void setAnnotations( const QList<Resource>& value );
00448 
00452         void addAnnotation( const Resource& value );
00453 
00457         static QString annotationUri();
00458 
00463         QList<Tag> tags() const;
00464 
00469         void setTags( const QList<Tag>& value );
00470 
00476         void addTag( const Tag& value );
00477 
00481         static QString tagUri();
00482 
00486         QList<Resource> topics() const;
00487 
00491         void setTopics( const QList<Resource>& value );
00492 
00496         void addTopic( const Resource& value );
00497 
00501         static QString topicUri();
00502 
00506         QList<Resource> isTopicOfs() const;
00507 
00511         void setIsTopicOfs( const QList<Resource>& value );
00512 
00516         void addIsTopicOf( const Resource& value );
00517 
00521         static QString isTopicOfUri();
00522 
00526         QList<Resource> isRelateds() const;
00527 
00531         void setIsRelateds( const QList<Resource>& value );
00532 
00536         void addIsRelated( const Resource& value );
00537 
00541         static QString isRelatedUri();
00542 
00546         QString label() const;
00547 
00551         void setLabel( const QString& value );
00552 
00556         static QString labelUri();
00557 
00561         quint32 rating() const;
00562 
00566         void setRating( const quint32& value );
00567 
00571         static QString ratingUri();
00572 
00579         QStringList symbols() const;
00580 
00587         void setSymbols( const QStringList& value );
00588 
00595         void addSymbol( const QString& value );
00596 
00600         static QString symbolUri();
00601 
00606         QList<Resource> annotationOf() const;
00607 
00612         QList<Resource> isRelatedOf() const;
00613 
00621         static QList<Resource> allResources();
00622 
00623 
00624     private:
00625         ResourceData* m_data;
00626 
00627         class Private;
00628         Private* d; // unused
00629 
00630         friend class ResourceData;
00631     };
00632 }
00633 
00634 #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
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
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