Eneboo - Documentación para desarrolladores
src/qsa/src/qsa/qsargument.h
Ir a la documentación de este archivo.
00001 /****************************************************************************
00002 ** $Id: qsargument.h  1.1.5   edited 2006-02-23T15:39:57$
00003 **
00004 ** Copyright (C) 2001-2006 Trolltech AS.  All rights reserved.
00005 **
00006 ** This file is part of the Qt Script for Applications framework (QSA).
00007 **
00008 ** This file may be distributed and/or modified under the terms of the
00009 ** GNU General Public License version 2 as published by the Free Software
00010 ** Foundation and appearing in the file LICENSE.GPL included in the
00011 ** packaging of this file.
00012 **
00013 ** Licensees holding a valid Qt Script for Applications license may use
00014 ** this file in accordance with the Qt Script for Applications License
00015 ** Agreement provided with the Software.
00016 **
00017 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00018 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00019 **
00020 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
00021 **   information about QSA Commercial License Agreements.
00022 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00023 **
00024 ** Contact info@trolltech.com if any conditions of this licensing are
00025 ** not clear to you.
00026 **
00027 *****************************************************************************/
00028 
00029 #ifndef QSARGUMENT_H
00030 #define QSARGUMENT_H
00031 
00032 #include <qsaglobal.h>
00033 #include <qvariant.h>
00034 #include <qvaluelist.h>
00035 
00036 class QObject;
00037 
00038 class QSA_EXPORT QSArgument
00039 {
00040     friend bool operator==( const QSArgument &a, const QSArgument &b );
00041 public:
00042     enum Type { Invalid, Variant, QObjectPtr, VoidPointer };
00043 
00044     QSArgument();
00045     QSArgument( const QVariant &v );
00046     QSArgument( QObject *o );
00047     QSArgument( void *p );
00048 
00049     QVariant variant() const;
00050     QObject *qobject() const;
00051     void *ptr() const;
00052     Type type() const;
00053     QString typeName() const;
00054 
00055 
00056 private:
00057     QVariant var;
00058     QObject *qobj;
00059     void *pt;
00060     Type typ;
00061 };
00062 
00063 QSA_EXPORT bool operator==( const QSArgument &a, const QSArgument &b );
00064 
00065 #if defined(Q_TEMPLATEDLL)
00066 // MOC_SKIP_BEGIN
00067 QSA_TEMPLATE_EXTERN template class QSA_EXPORT QValueList<QSArgument>;
00068 // MOC_SKIP_END
00069 #endif
00070 
00071 class QSA_EXPORT QSArgumentList : public QValueList<QSArgument>
00072 {
00073 public:
00074     QSArgumentList() {}
00075     QSArgumentList( const QValueList<QVariant> &l ) {
00076         for ( QValueList<QVariant>::ConstIterator it = l.begin(); it != l.end(); ++it )
00077             append( *it );
00078     }
00079     QSArgumentList( const QVariant &v ) { append( v ); }
00080     QSArgumentList( QObject *o ) { append( o ); }
00081     QSArgumentList( void *p ) { append( p ); }
00082 
00083 };
00084 
00085 #endif
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'