• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

Nepomuk

variant.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_VARIANT_H_
00022 #define _NEPOMUK_VARIANT_H_
00023 
00024 #include "nepomuk_export.h"
00025 #include "resource.h"
00026 
00027 #include <QtCore/QDateTime>
00028 #include <QtCore/QUrl>
00029 #include <QtCore/QVariant>
00030 
00031 namespace Nepomuk {
00032 
00033     class Resource;
00034 
00055     class NEPOMUK_EXPORT Variant
00056     {
00057     public:
00058         Variant();
00059         ~Variant();
00060         Variant( const Variant& other );
00061 
00065         explicit Variant( const QVariant& other );
00066         Variant( int i );
00067         Variant( qlonglong i );
00068         Variant( uint i );
00069         Variant( qulonglong i );
00070         Variant( bool b );
00071         Variant( double d );
00072         Variant( const char* string );
00073         Variant( const QString& string );
00074         Variant( const QDate& date );
00075         Variant( const QTime& time );
00076         Variant( const QDateTime& datetime );
00077         Variant( const QUrl& url );
00078         Variant( const Resource& r );
00079         Variant( const QList<int>& i );
00080         Variant( const QList<qlonglong>& i );
00081         Variant( const QList<uint>& i );
00082         Variant( const QList<qulonglong>& i );
00083         Variant( const QList<bool>& b );
00084         Variant( const QList<double>& d );
00085         Variant( const QStringList& stringlist );
00086         Variant( const QList<QDate>& date );
00087         Variant( const QList<QTime>& time );
00088         Variant( const QList<QDateTime>& datetime );
00089         Variant( const QList<QUrl>& url );
00090         Variant( const QList<Resource>& r );
00091 
00097         Variant( const QList<Variant>& vl );
00098 
00099         Variant& operator=( const Variant& );
00100         Variant& operator=( int i );
00101         Variant& operator=( qlonglong i );
00102         Variant& operator=( uint i );
00103         Variant& operator=( qulonglong i );
00104         Variant& operator=( bool b );
00105         Variant& operator=( double d );
00106         Variant& operator=( const QString& string );
00107         Variant& operator=( const QDate& date );
00108         Variant& operator=( const QTime& time );
00109         Variant& operator=( const QDateTime& datetime );
00110         Variant& operator=( const QUrl& url );
00111         Variant& operator=( const Resource& r );
00112         Variant& operator=( const QList<int>& i );
00113         Variant& operator=( const QList<qlonglong>& i );
00114         Variant& operator=( const QList<uint>& i );
00115         Variant& operator=( const QList<qulonglong>& i );
00116         Variant& operator=( const QList<bool>& b );
00117         Variant& operator=( const QList<double>& d );
00118         Variant& operator=( const QStringList& stringlist );
00119         Variant& operator=( const QList<QDate>& date );
00120         Variant& operator=( const QList<QTime>& time );
00121         Variant& operator=( const QList<QDateTime>& datetime );
00122         Variant& operator=( const QList<QUrl>& url );
00123         Variant& operator=( const QList<Resource>& r );
00124 
00129         void append( int i );
00130         void append( qlonglong i );
00131         void append( uint i );
00132         void append( qulonglong i );
00133         void append( bool b );
00134         void append( double d );
00135         void append( const QString& string );
00136         void append( const QDate& date );
00137         void append( const QTime& time );
00138         void append( const QDateTime& datetime );
00139         void append( const QUrl& url );
00140         void append( const Resource& r );
00141 
00148         void append( const Variant& v );
00149 
00155         bool operator==( const Variant& other ) const;
00156 
00160         bool operator!=( const Variant& other ) const;
00161 
00162         bool isValid() const;
00163 
00167         int type() const;
00168 
00173         int simpleType() const;
00174 
00188         bool isList() const;
00189 
00190         bool isInt() const;
00191         bool isInt64() const;
00192         bool isUnsignedInt() const;
00193         bool isUnsignedInt64() const;
00194         bool isBool() const;
00195         bool isDouble() const;
00196         bool isString() const;
00197         bool isDate() const;
00198         bool isTime() const;
00199         bool isDateTime() const;
00200         bool isUrl() const;
00201         bool isResource() const;
00202 
00203         bool isIntList() const;
00204         bool isInt64List() const;
00205         bool isUnsignedIntList() const;
00206         bool isUnsignedInt64List() const;
00207         bool isBoolList() const;
00208         bool isDoubleList() const;
00209         bool isStringList() const;
00210         bool isDateList() const;
00211         bool isTimeList() const;
00212         bool isDateTimeList() const;
00213         bool isUrlList() const;
00214         bool isResourceList() const;
00215 
00216         QVariant variant() const;
00217 
00224         int toInt() const;
00225 
00232         qlonglong toInt64() const;
00233 
00240         uint toUnsignedInt() const;
00241 
00248         qulonglong toUnsignedInt64() const;
00249 
00255         bool toBool() const;
00256 
00262         double toDouble() const;
00263 
00272         QString toString() const;
00273 
00279         QDate toDate() const;
00280 
00286         QTime toTime() const;
00287 
00293         QDateTime toDateTime() const;
00294 
00303         QUrl toUrl() const;
00304 
00310         Resource toResource() const;
00311 
00312         QList<int> toIntList() const;
00313         QList<qlonglong> toInt64List() const;
00314         QList<uint> toUnsignedIntList() const;
00315         QList<qulonglong> toUnsignedInt64List() const;
00316         QList<bool> toBoolList() const;
00317         QList<double> toDoubleList() const;
00318 
00323         QStringList toStringList() const;
00324         QList<QDate> toDateList() const;
00325         QList<QTime> toTimeList() const;
00326         QList<QDateTime> toDateTimeList() const;
00327         QList<QUrl> toUrlList() const;
00328         QList<Resource> toResourceList() const;
00329 
00335         QList<Variant> toVariantList() const;
00336 
00342         static Variant fromString( const QString& value, int type );
00343 
00344     private:
00345         class Private;
00346         Private* const d;
00347     };
00348 }
00349 
00350 
00351 NEPOMUK_EXPORT QDebug operator<<( QDebug dbg, const Nepomuk::Variant& );
00352 
00353 Q_DECLARE_METATYPE(Nepomuk::Resource)
00354 Q_DECLARE_METATYPE(QList<Nepomuk::Resource>)
00355 Q_DECLARE_METATYPE(QList<int>)
00356 Q_DECLARE_METATYPE(QList<qlonglong>)
00357 Q_DECLARE_METATYPE(QList<uint>)
00358 Q_DECLARE_METATYPE(QList<qulonglong>)
00359 Q_DECLARE_METATYPE(QList<double>)
00360 Q_DECLARE_METATYPE(QList<bool>)
00361 Q_DECLARE_METATYPE(QList<QDate>)
00362 Q_DECLARE_METATYPE(QList<QTime>)
00363 Q_DECLARE_METATYPE(QList<QDateTime>)
00364 Q_DECLARE_METATYPE(QList<QUrl>)
00365 
00366 #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
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  •     Sodep
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.9-20090814
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