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
00091 QString label( const QString& language = KGlobal::locale()->language() );
00092
00103 QString comment( const QString& language = KGlobal::locale()->language() );
00104
00112 QIcon icon();
00113
00121 bool isValid() const;
00122
00127 bool isAvailable();
00128
00142 void reset( bool recursive = false );
00143
00147 operator QUrl() const { return uri(); }
00148
00152 bool operator==( const Entity& other ) const;
00153
00157 bool operator!=( const Entity& other ) const;
00158
00159 protected:
00163 Entity();
00164
00165 QExplicitlySharedDataPointer<EntityPrivate> d;
00166 };
00167
00168 inline uint qHash( const Entity& c )
00169 {
00170 return qHash( c.uri().toString() );
00171 }
00172 }
00173 }
00174
00175
00176 namespace Nepomuk {
00177
00178 class Ontology;
00179
00183 class KDE_DEPRECATED NEPOMUK_EXPORT Entity
00184 {
00185 public:
00186 Entity( const Entity& );
00187 ~Entity();
00188
00189 Entity& operator=( const Entity& );
00190
00194 const Ontology* definingOntology() const;
00195
00200 QString name() const;
00201
00205 QUrl uri() const;
00206
00207 QString label( const QString& language = QString() ) const;
00208 QString comment( const QString& language = QString() ) const;
00209
00210 protected:
00211 Entity();
00212
00213 private:
00214 class Private;
00215 QSharedDataPointer<Private> d;
00216
00217 friend class OntologyManager;
00218 };
00219 }
00220
00221 #endif