lib

Kross::Api::MainModule Class Reference

#include <mainmodule.h>

Inheritance diagram for Kross::Api::MainModule:

Kross::Api::Module Kross::Api::Class< T > Kross::Api::Event< T > Kross::Api::Callable Kross::Api::Object Kross::Api::Manager Kross::Api::ScriptContainer Kross::Api::ScriptAction List of all members.

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< MainModulePtr

Public Member Functions

 MainModule (const QString &name)
virtual ~MainModule ()
virtual const QString getClassName () const
bool hadException ()
Exception::Ptr getException ()
void setException (Exception::Ptr exception)
bool hasChild (const QString &name) const
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

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 41 of file mainmodule.cpp.

MainModule::~MainModule (  )  [virtual]

Destructor.

Definition at line 48 of file mainmodule.cpp.


Member Function Documentation

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 110 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 99 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.

const QString MainModule::getClassName (  )  const [virtual]

See also:
Kross::Api::Object::getClassName()

Reimplemented from Kross::Api::Callable.

Definition at line 53 of file mainmodule.cpp.

Exception::Ptr MainModule::getException (  ) 

Returns:
the Exception this module throwed.

Definition at line 63 of file mainmodule.cpp.

bool MainModule::hadException (  ) 

Returns:
true if the script throwed an exception else false.

Definition at line 58 of file mainmodule.cpp.

bool MainModule::hasChild ( const QString &  name  )  const

Returns if the defined child is avaible.

Returns:
true if child exists else false.

Reimplemented from Kross::Api::Object.

Definition at line 73 of file mainmodule.cpp.

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 68 of file mainmodule.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys