• Skip to content
  • Skip to link menu
KDE 4.3 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 
00218         int toInt() const;
00219         qlonglong toInt64() const;
00220         uint toUnsignedInt() const;
00221         qulonglong toUnsignedInt64() const;
00222 
00223         bool toBool() const;
00224         double toDouble() const;
00225 
00234         QString toString() const;
00235         QDate toDate() const;
00236         QTime toTime() const;
00237         QDateTime toDateTime() const;
00238         QUrl toUrl() const;
00239         Resource toResource() const;
00240 
00241         QList<int> toIntList() const;
00242         QList<qlonglong> toInt64List() const;
00243         QList<uint> toUnsignedIntList() const;
00244         QList<qulonglong> toUnsignedInt64List() const;
00245         QList<bool> toBoolList() const;
00246         QList<double> toDoubleList() const;
00247 
00252         QStringList toStringList() const;
00253         QList<QDate> toDateList() const;
00254         QList<QTime> toTimeList() const;
00255         QList<QDateTime> toDateTimeList() const;
00256         QList<QUrl> toUrlList() const;
00257         QList<Resource> toResourceList() const;
00258 
00264         QList<Variant> toVariantList() const;
00265 
00271         static Variant fromString( const QString& value, int type );
00272 
00273     private:
00274         class Private;
00275         Private* const d;
00276     };
00277 }
00278 
00279 
00280 NEPOMUK_EXPORT QDebug operator<<( QDebug dbg, const Nepomuk::Variant& );
00281 
00282 Q_DECLARE_METATYPE(Nepomuk::Resource)
00283 Q_DECLARE_METATYPE(QList<Nepomuk::Resource>)
00284 Q_DECLARE_METATYPE(QList<int>)
00285 Q_DECLARE_METATYPE(QList<qlonglong>)
00286 Q_DECLARE_METATYPE(QList<uint>)
00287 Q_DECLARE_METATYPE(QList<qulonglong>)
00288 Q_DECLARE_METATYPE(QList<double>)
00289 Q_DECLARE_METATYPE(QList<bool>)
00290 Q_DECLARE_METATYPE(QList<QDate>)
00291 Q_DECLARE_METATYPE(QList<QTime>)
00292 Q_DECLARE_METATYPE(QList<QDateTime>)
00293 Q_DECLARE_METATYPE(QList<QUrl>)
00294 
00295 #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
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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