lib
mainmodule.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "mainmodule.h"
00021
00022 #include <kdebug.h>
00023
00024 using namespace Kross::Api;
00025
00026 namespace Kross { namespace Api {
00027
00029 class MainModulePrivate
00030 {
00031 public:
00036 Exception::Ptr exception;
00037 };
00038
00039 }}
00040
00041 MainModule::MainModule(const QString& name)
00042 : Module(name)
00043 , d(new MainModulePrivate())
00044 {
00045 d->exception = 0;
00046 }
00047
00048 MainModule::~MainModule()
00049 {
00050 delete d;
00051 }
00052
00053 const QString MainModule::getClassName() const
00054 {
00055 return "Kross::Api::MainModule";
00056 }
00057
00058 bool MainModule::hadException()
00059 {
00060 return d->exception != 0;
00061 }
00062
00063 Exception::Ptr MainModule::getException()
00064 {
00065 return d->exception;
00066 }
00067
00068 void MainModule::setException(Exception::Ptr exception)
00069 {
00070 d->exception = exception;
00071 }
00072
00073 bool MainModule::hasChild(const QString& name) const
00074 {
00075 return Object::hasChild(name);
00076 }
00077
00078 EventSignal::Ptr MainModule::addSignal(const QString& name, QObject* sender, QCString signal)
00079 {
00080 EventSignal* event = new EventSignal(name, this, sender, signal);
00081 if(! addChild(event)) {
00082 kdWarning() << QString("Failed to add signal name='%1' signature='%2'").arg(name).arg(signal) << endl;
00083 return 0;
00084 }
00085 return event;
00086 }
00087
00088 EventSlot::Ptr MainModule::addSlot(const QString& name, QObject* receiver, QCString slot)
00089 {
00090 EventSlot* event = new EventSlot(name, this, receiver, slot);
00091 if(! addChild(event)) {
00092 kdWarning() << QString("Failed to add slot name='%1' signature='%2'").arg(name).arg(slot) << endl;
00093 delete event;
00094 return 0;
00095 }
00096 return event;
00097 }
00098
00099 QtObject::Ptr MainModule::addQObject(QObject* object, const QString& name)
00100 {
00101 QtObject* qtobject = new QtObject(this, object, name);
00102 if(! addChild(qtobject)) {
00103 kdWarning() << QString("Failed to add QObject name='%1'").arg(object->name()) << endl;
00104 delete qtobject;
00105 return 0;
00106 }
00107 return qtobject;
00108 }
00109
00110 EventAction::Ptr MainModule::addKAction(KAction* action, const QString& name)
00111 {
00112 EventAction* event = new EventAction(name, this, action);
00113 if(! addChild(event)) {
00114 kdWarning() << QString("Failed to add KAction name='%1'").arg(action->name()) << endl;
00115 delete event;
00116 return 0;
00117 }
00118 return event;
00119 }
00120
|