Nepomuk
entity.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _NEPOMUK_ENTITY_H_
00021 #define _NEPOMUK_ENTITY_H_
00022
00023 #include <QtCore/QUrl>
00024 #include <QtCore/QString>
00025 #include <QtCore/QSharedData>
00026 #include <QtCore/QHash>
00027
00028 #include <Soprano/Node>
00029
00030 #include <kglobal.h>
00031 #include <klocale.h>
00032
00033 #include "nepomuk_export.h"
00034
00035 class QIcon;
00036
00037
00038 namespace Nepomuk {
00039 namespace Types {
00040 class EntityPrivate;
00041
00052 class NEPOMUK_EXPORT Entity
00053 {
00054 public:
00058 Entity( const Entity& );
00059
00063 virtual ~Entity();
00064
00068 Entity& operator=( const Entity& );
00069
00074 QString name() const;
00075
00079 QUrl uri() const;
00080
00092 QString label( const QString& language = KGlobal::locale()->language() );
00093
00105 QString comment( const QString& language = KGlobal::locale()->language() );
00106
00114 QIcon icon();
00115
00123 bool isValid() const;
00124
00129 bool isAvailable();
00130
00144 void reset( bool recursive = false );
00145
00149 operator QUrl() const { return uri(); }
00150
00154 bool operator==( const Entity& other ) const;
00155
00159 bool operator!=( const Entity& other ) const;
00160
00161 protected:
00165 Entity();
00166
00167 QExplicitlySharedDataPointer<EntityPrivate> d;
00168 };
00169
00170 inline uint qHash( const Entity& c )
00171 {
00172 return qHash( c.uri().toString() );
00173 }
00174 }
00175 }
00176
00177 #ifndef DISABLE_NEPOMUK_LEGACY
00178
00179 namespace Nepomuk {
00180
00181 class Ontology;
00182
00186 class KDE_DEPRECATED NEPOMUK_EXPORT Entity
00187 {
00188 public:
00189 Entity( const Entity& );
00190 ~Entity();
00191
00192 Entity& operator=( const Entity& );
00193
00197 const Ontology* definingOntology() const;
00198
00203 QString name() const;
00204
00208 QUrl uri() const;
00209
00210 QString label( const QString& language = QString() ) const;
00211 QString comment( const QString& language = QString() ) const;
00212
00213 protected:
00214 Entity();
00215
00216 private:
00217 class Private;
00218 QSharedDataPointer<Private> d;
00219
00220 friend class OntologyManager;
00221 };
00222 }
00223
00224 #endif // DISABLE_NEPOMUK_LEGACY
00225
00226 #endif // _NEPOMUK_ENTITY_H_