21 #ifndef _NEPOMUK_VARIANT_H_
22 #define _NEPOMUK_VARIANT_H_
24 #include "nepomuk_export.h"
27 #include <QtCore/QDateTime>
28 #include <QtCore/QUrl>
29 #include <QtCore/QVariant>
75 explicit Variant(
const QVariant& other );
83 Variant(
const QString&
string );
86 Variant(
const QDateTime& datetime );
90 Variant(
const QList<qlonglong>& i );
91 Variant(
const QList<uint>& i );
92 Variant(
const QList<qulonglong>& i );
93 Variant(
const QList<bool>& b );
94 Variant(
const QList<double>& d );
95 Variant(
const QStringList& stringlist );
96 Variant(
const QList<QDate>& date );
97 Variant(
const QList<QTime>& time );
98 Variant(
const QList<QDateTime>& datetime );
99 Variant(
const QList<QUrl>& url );
100 Variant(
const QList<Resource>& r );
107 Variant(
const QList<Variant>& vl );
111 Variant& operator=( qlonglong i );
113 Variant& operator=( qulonglong i );
115 Variant& operator=(
double d );
116 Variant& operator=(
const QString&
string );
117 Variant& operator=(
const QDate& date );
118 Variant& operator=(
const QTime& time );
119 Variant& operator=(
const QDateTime& datetime );
120 Variant& operator=(
const QUrl& url );
122 Variant& operator=(
const QList<int>& i );
123 Variant& operator=(
const QList<qlonglong>& i );
124 Variant& operator=(
const QList<uint>& i );
125 Variant& operator=(
const QList<qulonglong>& i );
126 Variant& operator=(
const QList<bool>& b );
127 Variant& operator=(
const QList<double>& d );
128 Variant& operator=(
const QStringList& stringlist );
129 Variant& operator=(
const QList<QDate>& date );
130 Variant& operator=(
const QList<QTime>& time );
131 Variant& operator=(
const QList<QDateTime>& datetime );
132 Variant& operator=(
const QList<QUrl>& url );
133 Variant& operator=(
const QList<Resource>& r );
139 void append(
int i );
140 void append( qlonglong i );
141 void append( uint i );
142 void append( qulonglong i );
143 void append(
bool b );
144 void append(
double d );
145 void append(
const QString&
string );
146 void append(
const QDate& date );
147 void append(
const QTime& time );
148 void append(
const QDateTime& datetime );
149 void append(
const QUrl& url );
158 void append(
const Variant& v );
165 bool operator==(
const Variant& other )
const;
170 bool operator!=(
const Variant& other )
const;
172 bool isValid()
const;
183 int simpleType()
const;
201 bool isInt64()
const;
202 bool isUnsignedInt()
const;
203 bool isUnsignedInt64()
const;
205 bool isDouble()
const;
206 bool isString()
const;
209 bool isDateTime()
const;
211 bool isResource()
const;
213 bool isIntList()
const;
214 bool isInt64List()
const;
215 bool isUnsignedIntList()
const;
216 bool isUnsignedInt64List()
const;
217 bool isBoolList()
const;
218 bool isDoubleList()
const;
219 bool isStringList()
const;
220 bool isDateList()
const;
221 bool isTimeList()
const;
222 bool isDateTimeList()
const;
223 bool isUrlList()
const;
224 bool isResourceList()
const;
226 QVariant variant()
const;
242 qlonglong toInt64()
const;
250 uint toUnsignedInt()
const;
258 qulonglong toUnsignedInt64()
const;
272 double toDouble()
const;
282 QString toString()
const;
289 QDate toDate()
const;
296 QTime toTime()
const;
303 QDateTime toDateTime()
const;
323 QList<int> toIntList()
const;
324 QList<qlonglong> toInt64List()
const;
325 QList<uint> toUnsignedIntList()
const;
326 QList<qulonglong> toUnsignedInt64List()
const;
327 QList<bool> toBoolList()
const;
328 QList<double> toDoubleList()
const;
334 QStringList toStringList()
const;
335 QList<QDate> toDateList()
const;
336 QList<QTime> toTimeList()
const;
337 QList<QDateTime> toDateTimeList()
const;
338 QList<QUrl> toUrlList()
const;
339 QList<Resource> toResourceList()
const;
346 QList<Variant> toVariantList()
const;
353 Soprano::Node toNode()
const;
360 QList<Soprano::Node> toNodeList()
const;
367 static Variant fromString(
const QString& value,
int type );
374 static Variant fromNode(
const Soprano::Node& node );
381 static Variant fromNodeList(
const QList<Soprano::Node>& node );
393 Q_DECLARE_METATYPE(QList<Nepomuk::Resource>)
394 Q_DECLARE_METATYPE(QList<
int>)
395 Q_DECLARE_METATYPE(QList<qlonglong>)
396 Q_DECLARE_METATYPE(QList<uint>)
397 Q_DECLARE_METATYPE(QList<qulonglong>)
398 Q_DECLARE_METATYPE(QList<
double>)
399 Q_DECLARE_METATYPE(QList<
bool>)
400 Q_DECLARE_METATYPE(QList<QDate>)
401 Q_DECLARE_METATYPE(QList<QTime>)
402 Q_DECLARE_METATYPE(QList<QDateTime>)
403 Q_DECLARE_METATYPE(QList<QUrl>)
Resource is the central object type in Nepomuk.
The Nepomuk Variant extends over QVariant by introducing direct support for Resource embedding...
QDebug operator<<(QDebug dbg, const DateRange &range)
Debug streaming operator.