lib

mainmodule.h
1/***************************************************************************
2 * mainmodule.h
3 * This file is part of the KDE project
4 * copyright (C)2004-2005 by Sebastian Sauer (mail@dipe.org)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public License
15 * along with this program; see the file COPYING. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 ***************************************************************************/
19
20#ifndef KROSS_API_MAINMODULE_H
21#define KROSS_API_MAINMODULE_H
22
23#include "../api/object.h"
24#include "../api/variant.h"
25#include "../api/module.h"
26#include "../api/event.h"
27#include "../api/eventsignal.h"
28#include "../api/eventslot.h"
29#include "../api/qtobject.h"
30#include "../api/eventaction.h"
31
32#include <tqstring.h>
33#include <tqvariant.h>
34#include <tqobject.h>
35
36#include <ksharedptr.h>
37#include <tdeaction.h>
38
39namespace Kross { namespace Api {
40
41 // Forward declarations.
42 class MainModulePrivate;
43
53 class MainModule : public Module
54 {
55 public:
56
58 typedef TDESharedPtr<MainModule> Ptr;
59
68 explicit MainModule(const TQString& name);
69
73 virtual ~MainModule();
74
76 virtual const TQString getClassName() const;
77
82 bool hadException();
83
88
96 void setException(Exception::Ptr exception);
97
98#if 0
104 bool hasChild(const TQString& name) const;
105#endif
106
120 EventSignal::Ptr addSignal(const TQString& name, TQObject* sender, TQCString signal);
121
135 EventSlot::Ptr addSlot(const TQString& name, TQObject* receiver, TQCString slot);
136
151 QtObject::Ptr addTQObject(TQObject* object, const TQString& name = TQString());
152
166 EventAction::Ptr addTDEAction(TDEAction* action, const TQString& name = TQString());
167
168 //typedef TQValueList<Callable::Ptr> EventList;
169 //EventList getEvents();
170 //const TQString& serializeToXML();
171 //void unserializeFromXML(const TQString& xml);
172
173 private:
175 MainModulePrivate* d;
176 };
177
178}}
179
180#endif
181
bool hasChild(const TQString &name) const
Returns if the defined child is avaible.
Definition callable.cpp:48
TDESharedPtr< EventAction > Ptr
Shared pointer to implement reference-counting.
Definition eventaction.h:48
TDESharedPtr< EventSignal > Ptr
Shared pointer to implement reference-counting.
Definition eventsignal.h:48
TDESharedPtr< EventSlot > Ptr
Shared pointer to implement reference-counting.
Definition eventslot.h:43
TDESharedPtr< Exception > Ptr
Shared pointer to implement reference-counting.
Definition exception.h:45
virtual const TQString getClassName() const
QtObject::Ptr addTQObject(TQObject *object, const TQString &name=TQString())
Add a TQObject to the eventcollection.
Exception::Ptr getException()
EventAction::Ptr addTDEAction(TDEAction *action, const TQString &name=TQString())
Add a TDEAction to the eventcollection.
MainModule(const TQString &name)
Constructor.
TDESharedPtr< MainModule > Ptr
Shared pointer to implement reference-counting.
Definition mainmodule.h:58
virtual ~MainModule()
Destructor.
void setException(Exception::Ptr exception)
Set the Exception this module throwed.
EventSlot::Ptr addSlot(const TQString &name, TQObject *receiver, TQCString slot)
Add a TQt slot to the Module by creating an EventSlot for it.
EventSignal::Ptr addSignal(const TQString &name, TQObject *sender, TQCString signal)
Add a TQt signal to the Module by creating an EventSignal for it.
Module(const TQString &name)
Constructor.
Definition module.h:51
TDESharedPtr< QtObject > Ptr
Shared pointer to implement reference-counting.
Definition qtobject.h:52
The common Kross API used as common codebase.
Definition callable.h:31
The Kross scripting bridge to embed scripting functionality into an application.
Definition callable.h:31