lib

mainmodule.h

00001 /***************************************************************************
00002  * mainmodule.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_MAINMODULE_H
00021 #define KROSS_API_MAINMODULE_H
00022 
00023 #include "../api/object.h"
00024 #include "../api/variant.h"
00025 #include "../api/module.h"
00026 #include "../api/event.h"
00027 #include "../api/eventsignal.h"
00028 #include "../api/eventslot.h"
00029 #include "../api/qtobject.h"
00030 #include "../api/eventaction.h"
00031 
00032 #include <qstring.h>
00033 #include <qvariant.h>
00034 #include <qobject.h>
00035 
00036 #include <ksharedptr.h>
00037 #include <kaction.h>
00038 
00039 namespace Kross { namespace Api {
00040 
00041     // Forward declarations.
00042     class MainModulePrivate;
00043 
00053     class MainModule : public Module
00054     {
00055         public:
00056 
00058             typedef KSharedPtr<MainModule> Ptr;
00059 
00068             explicit MainModule(const QString& name);
00069 
00073             virtual ~MainModule();
00074 
00076             virtual const QString getClassName() const;
00077 
00082             bool hadException();
00083 
00087             Exception::Ptr getException();
00088 
00096             void setException(Exception::Ptr exception);
00097 
00103             bool hasChild(const QString& name) const;
00104 
00118             EventSignal::Ptr addSignal(const QString& name, QObject* sender, QCString signal);
00119 
00133             EventSlot::Ptr addSlot(const QString& name, QObject* receiver, QCString slot);
00134 
00149             QtObject::Ptr addQObject(QObject* object, const QString& name = QString::null);
00150 
00164             EventAction::Ptr addKAction(KAction* action, const QString& name = QString::null);
00165 
00166             //typedef QValueList<Callable::Ptr> EventList;
00167             //EventList getEvents();
00168             //const QString& serializeToXML();
00169             //void unserializeFromXML(const QString& xml);
00170 
00171         private:
00173             MainModulePrivate* d;
00174     };
00175 
00176 }}
00177 
00178 #endif
00179 
KDE Home | KDE Accessibility Home | Description of Access Keys