lib

Kross::Api::Event< T > Class Template Reference

#include <event.h>

Inheritance diagram for Kross::Api::Event< T >:

Kross::Api::Callable Kross::Api::Object Kross::Api::Class< T > Kross::Api::EventAction Kross::Api::EventScript Kross::Api::EventSignal Kross::Api::EventSlot Kross::Api::Module Kross::Api::QtObject Kross::Api::MainModule Kross::Api::Manager Kross::Api::ScriptContainer Kross::Api::ScriptAction List of all members.

Detailed Description

template<class T>
class Kross::Api::Event< T >

Template class for all kinds of callable events.

An event is the abstract base for callable objects like methodfunctions in Class instances or EventSlot and EventSignal to access Qt signals and slots.

Definition at line 45 of file event.h.


Public Member Functions

 Event (const QString &name)
virtual ~Event ()
void addFunction (const QString &name, FunctionPtr function)
void addFunction (const QString &name, Function *function)
template<class RETURNOBJ, class ARG1OBJ, class ARG2OBJ, class ARG3OBJ, class ARG4OBJ, class INSTANCE, typename METHOD>
void addFunction4 (const QString &name, INSTANCE *instance, METHOD method, ARG1OBJ *arg1=0, ARG2OBJ *arg2=0, ARG3OBJ *arg3=0, ARG4OBJ *arg4=0)
template<class RETURNOBJ, class ARG1OBJ, class ARG2OBJ, class ARG3OBJ, class INSTANCE, typename METHOD>
void addFunction3 (const QString &name, INSTANCE *instance, METHOD method, ARG1OBJ *arg1=0, ARG2OBJ *arg2=0, ARG3OBJ *arg3=0)
template<class RETURNOBJ, class ARG1OBJ, class ARG2OBJ, class INSTANCE, typename METHOD>
void addFunction2 (const QString &name, INSTANCE *instance, METHOD method, ARG1OBJ *arg1=0, ARG2OBJ *arg2=0)
template<class RETURNOBJ, class ARG1OBJ, class INSTANCE, typename METHOD>
void addFunction1 (const QString &name, INSTANCE *instance, METHOD method, ARG1OBJ *arg1=0)
template<class RETURNOBJ, class INSTANCE, typename METHOD>
void addFunction0 (const QString &name, INSTANCE *instance, METHOD method)
bool isAFunction (const QString &name) const
virtual Object::Ptr call (const QString &name, List::Ptr arguments)

Constructor & Destructor Documentation

template<class T>
Kross::Api::Event< T >::Event ( const QString &  name  )  [inline]

Constructor.

Parameters:
name The name this Event has.

Definition at line 67 of file event.h.

template<class T>
virtual Kross::Api::Event< T >::~Event (  )  [inline, virtual]

Destructor.

Definition at line 75 of file event.h.


Member Function Documentation

template<class T>
void Kross::Api::Event< T >::addFunction ( const QString &  name,
FunctionPtr  function 
) [inline]

Add a Callable methodfunction to the list of functions this Object supports.

The FunctionPtr points to the concret Object::Ptr myfuncname(List::Ptr) method in the class defined with template T.

Parameters:
name The functionname. Each function this object holds should have an unique name to be still accessable.
function A pointer to the methodfunction that should handle calls.
Todo:
Remove this method as soon as there is no code using it

Definition at line 98 of file event.h.

template<class T>
void Kross::Api::Event< T >::addFunction ( const QString &  name,
Function function 
) [inline]

Add a methodfunction to the list of functions this Object supports.

Parameters:
name The functionname. Each function this object holds should have an unique name to be still accessable.
function A Function instance which defines the methodfunction. This Event will be the owner of the Function instance and will take care of deleting it if this Event got deleted.

Definition at line 115 of file event.h.

template<class T>
template<class RETURNOBJ, class ARG1OBJ, class ARG2OBJ, class ARG3OBJ, class ARG4OBJ, class INSTANCE, typename METHOD>
void Kross::Api::Event< T >::addFunction4 ( const QString &  name,
INSTANCE *  instance,
METHOD  method,
ARG1OBJ *  arg1 = 0,
ARG2OBJ *  arg2 = 0,
ARG3OBJ *  arg3 = 0,
ARG4OBJ *  arg4 = 0 
) [inline]

Template function to add a ProxyFunction as builtin-function to this Event instance.

Definition at line 125 of file event.h.

template<class T>
template<class RETURNOBJ, class ARG1OBJ, class ARG2OBJ, class ARG3OBJ, class INSTANCE, typename METHOD>
void Kross::Api::Event< T >::addFunction3 ( const QString &  name,
INSTANCE *  instance,
METHOD  method,
ARG1OBJ *  arg1 = 0,
ARG2OBJ *  arg2 = 0,
ARG3OBJ *  arg3 = 0 
) [inline]

Same as above with three arguments.

Definition at line 135 of file event.h.

template<class T>
template<class RETURNOBJ, class ARG1OBJ, class ARG2OBJ, class INSTANCE, typename METHOD>
void Kross::Api::Event< T >::addFunction2 ( const QString &  name,
INSTANCE *  instance,
METHOD  method,
ARG1OBJ *  arg1 = 0,
ARG2OBJ *  arg2 = 0 
) [inline]

Same as above with two arguments.

Definition at line 145 of file event.h.

template<class T>
template<class RETURNOBJ, class ARG1OBJ, class INSTANCE, typename METHOD>
void Kross::Api::Event< T >::addFunction1 ( const QString &  name,
INSTANCE *  instance,
METHOD  method,
ARG1OBJ *  arg1 = 0 
) [inline]

Same as above, but with one argument.

Definition at line 155 of file event.h.

template<class T>
template<class RETURNOBJ, class INSTANCE, typename METHOD>
void Kross::Api::Event< T >::addFunction0 ( const QString &  name,
INSTANCE *  instance,
METHOD  method 
) [inline]

Same as above with no arguments.

Definition at line 165 of file event.h.

template<class T>
bool Kross::Api::Event< T >::isAFunction ( const QString &  name  )  const [inline]

Check if a function is a member of this Callable.

Parameters:
name the function name
Returns:
true if the function is available in this Callable

Definition at line 178 of file event.h.

template<class T>
virtual Object::Ptr Kross::Api::Event< T >::call ( const QString &  name,
List::Ptr  arguments 
) [inline, virtual]

Overloaded method to handle function-calls.

Exceptions:
AttributeException if argumentparameters arn't valid.
RuntimeException if the functionname isn't valid.
Parameters:
name The functionname. Each function this Object holds should have a different name cause they are access by they name. If name is QString::null or empty, a self-reference to this instance is returned.
arguments The list of arguments.
Returns:
An Object representing the call result or NULL if there doesn't exists such a function with defined name.

Reimplemented from Kross::Api::Callable.

Definition at line 201 of file event.h.


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