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 00063 QtObject(QObject* object, const QString& name = QString::null); 00064 00068 virtual ~QtObject(); 00069 00071 virtual const QString getClassName() const; 00072 00078 QObject* getObject(); 00079 00090 static QUObject* toQUObject(const QString& signature, List::Ptr arguments); 00091 00092 private: 00094 QObject* m_object; 00095 00096 // QProperty's 00097 00099 Kross::Api::Object::Ptr propertyNames(Kross::Api::List::Ptr); 00101 Kross::Api::Object::Ptr hasProperty(Kross::Api::List::Ptr); 00103 Kross::Api::Object::Ptr getProperty(Kross::Api::List::Ptr); 00105 Kross::Api::Object::Ptr setProperty(Kross::Api::List::Ptr); 00106 00107 // Slots 00108 00110 Kross::Api::Object::Ptr slotNames(Kross::Api::List::Ptr); 00112 Kross::Api::Object::Ptr hasSlot(Kross::Api::List::Ptr); 00114 Kross::Api::Object::Ptr callSlot(Kross::Api::List::Ptr); 00115 00116 // Signals 00117 00119 Kross::Api::Object::Ptr signalNames(Kross::Api::List::Ptr); 00121 Kross::Api::Object::Ptr hasSignal(Kross::Api::List::Ptr); 00123 Kross::Api::Object::Ptr emitSignal(Kross::Api::List::Ptr); 00124 00126 Kross::Api::Object::Ptr connectSignal(Kross::Api::List::Ptr); 00128 Kross::Api::Object::Ptr disconnectSignal(Kross::Api::List::Ptr); 00129 00130 }; 00131 00132 }} 00133 00134 #endif 00135