lib
qtobject.h
00001 /*************************************************************************** 00002 * qtobject.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_QTOBJECT_H 00021 #define KROSS_API_QTOBJECT_H 00022 00023 #include "class.h" 00024 00025 #include <qstring.h> 00026 #include <qobject.h> 00027 00028 // Forward-declaration of the builtin Qt QUObject struct. 00029 struct QUObject; 00030 00031 namespace Kross { namespace Api { 00032 00033 // Forward declarations. 00034 class Object; 00035 class Variant; 00036 class ScriptContainer; 00037 class ScriptContrainer; 00038 00045 class QtObject : public Kross::Api::Class<QtObject> 00046 { 00047 public: 00048 00052 typedef KSharedPtr<QtObject> Ptr; 00053 00065 QtObject(Object::Ptr parent, QObject* object, const QString& name = QString::null); 00066 00070 virtual ~QtObject(); 00071 00073 virtual const QString getClassName() const; 00074 00080 QObject* getObject(); 00081 00092 static QUObject* toQUObject(const QString& signature, List::Ptr arguments); 00093 00094 private: 00096 QObject* m_object; 00097 00098 // QProperty's 00099 00101 Kross::Api::Object::Ptr propertyNames(Kross::Api::List::Ptr); 00103 Kross::Api::Object::Ptr hasProperty(Kross::Api::List::Ptr); 00105 Kross::Api::Object::Ptr getProperty(Kross::Api::List::Ptr); 00107 Kross::Api::Object::Ptr setProperty(Kross::Api::List::Ptr); 00108 00109 // Slots 00110 00112 Kross::Api::Object::Ptr slotNames(Kross::Api::List::Ptr); 00114 Kross::Api::Object::Ptr hasSlot(Kross::Api::List::Ptr); 00116 Kross::Api::Object::Ptr callSlot(Kross::Api::List::Ptr); 00117 00118 // Signals 00119 00121 Kross::Api::Object::Ptr signalNames(Kross::Api::List::Ptr); 00123 Kross::Api::Object::Ptr hasSignal(Kross::Api::List::Ptr); 00125 Kross::Api::Object::Ptr emitSignal(Kross::Api::List::Ptr); 00126 00128 Kross::Api::Object::Ptr connectSignal(Kross::Api::List::Ptr); 00130 Kross::Api::Object::Ptr disconnectSignal(Kross::Api::List::Ptr); 00131 00132 }; 00133 00134 }} 00135 00136 #endif 00137