kexi

metaparameter.h

00001 /***************************************************************************
00002  * This file is part of the KDE project
00003  * copyright (C) 2005 by Sebastian Sauer (mail@dipe.org)
00004  * copyright (C) 2005 by Tobi Krebs (tobi.krebs@gmail.com)
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  * This program 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  * You should have received a copy of the GNU Library General Public License
00015  * along with this program; see the file COPYING.  If not, write to
00016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018  ***************************************************************************/
00019 
00020 #ifndef KOMACRO_METAPARAMETER_H
00021 #define KOMACRO_METAPARAMETER_H
00022 
00023 #include <qstring.h>
00024 #include <qvariant.h>
00025 #include <qobject.h>
00026 #include <ksharedptr.h>
00027 
00028 #include "komacro_export.h"
00029 
00030 namespace KoMacro {
00031 
00032     // Forward declarations.
00033     class Variable;
00034 
00042     class KOMACRO_EXPORT MetaParameter : public KShared
00043     {
00044 
00048             Q_PROPERTY(Type type READ type)
00049 
00050             
00053             Q_PROPERTY(QString typeName READ typeName)
00054 
00055         public:
00056 
00060             typedef QValueList<KSharedPtr <MetaParameter > > List;
00061 
00070             explicit MetaParameter(const QString& signatureargument = QString::null);
00071 
00075             ~MetaParameter();
00076 
00080             enum Type {
00081                 TypeNone = 0, 
00082                 TypeVariant, 
00083                 TypeObject 
00084             };
00085 
00089             Type type() const;
00090 
00095             const QString typeName() const;
00096 
00100             void setType(Type type);
00101 
00105             QVariant::Type variantType() const;
00106 
00110             void setVariantType(QVariant::Type varianttype);
00111 
00117             bool validVariable(KSharedPtr<Variable> variable) const;
00118 
00119         protected:
00120 
00125             void setSignatureArgument(const QString& signatureargument);
00126 
00127         private:
00129             class Private;
00131             Private* const d;
00132     };
00133 
00134 }
00135 
00136 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys