lib
callable.h
00001 /*************************************************************************** 00002 * callable.h 00003 * This file is part of the KDE project 00004 * copyright (C)2004-2005 by Sebastian Sauer (mail@dipe.org) 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 KROSS_API_CALLABLE_H 00021 #define KROSS_API_CALLABLE_H 00022 00023 #include "object.h" 00024 #include "list.h" 00025 //#include "exception.h" 00026 #include "argument.h" 00027 00028 #include <qstring.h> 00029 #include <qvaluelist.h> 00030 #include <ksharedptr.h> 00031 #include <kdebug.h> 00032 00033 namespace Kross { namespace Api { 00034 00041 class Callable : public Object 00042 { 00043 public: 00044 00048 typedef KSharedPtr<Callable> Ptr; 00049 00060 Callable(const QString& name, Object::Ptr parent, const ArgumentList& arglist); 00061 00065 virtual ~Callable(); 00066 00074 virtual const QString getClassName() const; 00075 00079 virtual Object::Ptr call(const QString& name, List::Ptr arguments); 00080 00085 Object::Ptr hasChild(List::Ptr args); 00086 00091 Object::Ptr getChild(List::Ptr args); 00092 00093 //Object::Ptr setChild(List::Ptr args); 00094 00102 Object::Ptr getChildrenList(List::Ptr args); 00103 00110 Object::Ptr getChildrenDict(List::Ptr args); 00111 00116 Object::Ptr callChild(List::Ptr args); 00117 00118 protected: 00119 00123 ArgumentList m_arglist; 00124 00129 //void checkArguments(KSharedPtr<List> arguments); 00130 00131 }; 00132 00133 }} 00134 00135 #endif 00136