kexi

metamethod.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_METAMETHOD_H
00021 #define KOMACRO_METAMETHOD_H
00022 
00023 #include <qstring.h>
00024 #include <qvaluelist.h>
00025 #include <ksharedptr.h>
00026 
00027 #include "komacro_export.h"
00028 
00029 struct QUObject;
00030 
00031 namespace KoMacro {
00032 
00033     // forward declarations.
00034     class Variable;
00035     class MetaObject;
00036     class MetaParameter;
00037     class MetaProxy;
00038 
00046     class KOMACRO_EXPORT MetaMethod : public KShared
00047     {
00048         public:
00049 
00054             enum Type {
00055                 Signal, 
00056                 Slot, 
00057                 Unknown 
00058             };
00059 
00072             explicit MetaMethod(const QString& signature, Type type = Unknown, KSharedPtr<MetaObject> object = 0);
00073 
00077             ~MetaMethod();
00078 
00083             KSharedPtr<MetaObject> const object() const;
00084 
00089             const QString signature() const;
00090 
00096             const QString signatureTag() const;
00097 
00103             const QString signatureArguments() const;
00104 
00109             Type type() const;
00110 
00115             QValueList< KSharedPtr<MetaParameter> > arguments() const;
00116 
00121             QUObject* toQUObject(QValueList< KSharedPtr<Variable> > arguments);
00122 
00127             KSharedPtr<Variable> toVariable(QUObject* uo);
00128 
00133             QValueList< KSharedPtr<Variable> > toVariableList(QUObject* uo);
00134 
00139             KSharedPtr<Variable> invoke(QValueList< KSharedPtr<Variable> > arguments);
00140 
00141         private:
00143             class Private;
00145             Private* const d;
00146     };
00147 
00148 }
00149 
00150 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys