lib
Kross::Api::MainModule Class Reference
#include <mainmodule.h>
Inheritance diagram for Kross::Api::MainModule:

Detailed Description
This class implements Module for the global Manager singleton and local ScriptContainer instances.The MainModule class provides base functionality for a root node in a tree of Kross::Api::Object instances.
Definition at line 53 of file mainmodule.h.
Public Types | |
typedef KSharedPtr< MainModule > | Ptr |
Public Member Functions | |
MainModule (const QString &name) | |
virtual | ~MainModule () |
virtual const QString | getClassName () const |
bool | hadException () |
Exception::Ptr | getException () |
void | setException (Exception::Ptr exception) |
EventSignal::Ptr | addSignal (const QString &name, QObject *sender, QCString signal) |
EventSlot::Ptr | addSlot (const QString &name, QObject *receiver, QCString slot) |
QtObject::Ptr | addQObject (QObject *object, const QString &name=QString::null) |
EventAction::Ptr | addKAction (KAction *action, const QString &name=QString::null) |
Member Typedef Documentation
typedef KSharedPtr<MainModule> Kross::Api::MainModule::Ptr |
Shared pointer to implement reference-counting.
Reimplemented from Kross::Api::Module.
Reimplemented in Kross::Api::ScriptAction, and Kross::Api::ScriptContainer.
Definition at line 58 of file mainmodule.h.
Constructor & Destructor Documentation
MainModule::MainModule | ( | const QString & | name | ) | [explicit] |
Constructor.
- Parameters:
-
name the name of the Module . While the global manager module has the name "Kross" the ScriptContainer instances are accessible by there ScriptContainer::getName() name.
Definition at line 39 of file mainmodule.cpp.
MainModule::~MainModule | ( | ) | [virtual] |
Member Function Documentation
const QString MainModule::getClassName | ( | ) | const [virtual] |
- See also:
- Kross::Api::Object::getClassName()
Reimplemented from Kross::Api::Callable.
Definition at line 51 of file mainmodule.cpp.
bool MainModule::hadException | ( | ) |
- Returns:
- true if the script throwed an exception else false.
Definition at line 56 of file mainmodule.cpp.
Exception::Ptr MainModule::getException | ( | ) |
void MainModule::setException | ( | Exception::Ptr | exception | ) |
Set the Exception this module throwed.
- Parameters:
-
exception The Exception this module throws or NULL if you like to clear exception and to let hadException() return false.
Definition at line 66 of file mainmodule.cpp.
EventSignal::Ptr MainModule::addSignal | ( | const QString & | name, | |
QObject * | sender, | |||
QCString | signal | |||
) |
Add a Qt signal to the Module by creating an EventSignal for it.
- Parameters:
-
name the name the EventSignal is reachable as sender the QObject instance which is the sender of the signal
signal the Qt signal macro the sender
emits to call the EventSignal
- Returns:
- the newly added EventSignal instance which is now a child of this MainModule
Definition at line 78 of file mainmodule.cpp.
EventSlot::Ptr MainModule::addSlot | ( | const QString & | name, | |
QObject * | receiver, | |||
QCString | slot | |||
) |
Add a Qt slot to the Module by creating an EventSlot for it.
- Parameters:
-
name the name the EventSlot is reachable as receiver the QObject instance which is the receiver of the signal
slot the Qt slot macro of the receiver
to invoke if the EventSlot got called.
- Returns:
- the newly added EventSlot instance which is now a child of this MainModule
Definition at line 88 of file mainmodule.cpp.
QtObject::Ptr MainModule::addQObject | ( | QObject * | object, | |
const QString & | name = QString::null | |||
) |
Add a QObject to the eventcollection.
All signals and slots the QObject has will be added to a new EventCollection instance which is child of this EventCollection instance.
- Parameters:
-
object the QObject instance that should be added to this MainModule name the name under which this QObject instance should be registered as
- Returns:
- the newly added QtObject instance which is now a child of this MainModule
Definition at line 98 of file mainmodule.cpp.
EventAction::Ptr MainModule::addKAction | ( | KAction * | action, | |
const QString & | name = QString::null | |||
) |
Add a KAction to the eventcollection.
The KAction will be wrapped by a EventAction and will be added to this collection.
- Parameters:
-
name name to identify the action by action the KAction instance that should be added to this MainModule
- Returns:
- the newly added EventAction instance which is now a child of this MainModule
- Todo:
- check name dox.
Definition at line 108 of file mainmodule.cpp.
The documentation for this class was generated from the following files: