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 > 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 47 of file event.h.


Public Member Functions

 Event (const QString &name, Object::Ptr parent)
virtual ~Event ()
void addFunction (const QString &name, FunctionPtr function, const ArgumentList &arglist=ArgumentList())
void addFunction (const QString &name, Function *function)
template<class RET, class ARG1, class ARG2, class ARG3, class ARG4, class INSTANCE, typename METHOD>
void addProxyFunction (const QString &name, INSTANCE *instance, METHOD method)
template<class RET, class ARG1, class ARG2, class ARG3, class INSTANCE, typename METHOD>
void addProxyFunction (const QString &name, INSTANCE *instance, METHOD method)
template<class RET, class ARG1, class ARG2, class INSTANCE, typename METHOD>
void addProxyFunction (const QString &name, INSTANCE *instance, METHOD method)
template<class RET, class ARG1, class INSTANCE, typename METHOD>
void addProxyFunction (const QString &name, INSTANCE *instance, METHOD method)
template<class RET, class INSTANCE, typename METHOD>
void addProxyFunction (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,
Object::Ptr  parent
[inline]
 

Constructor.

Parameters:
name The name this Event has.
parent The Object that this Event is child of.

Definition at line 71 of file event.h.

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

Destructor.

Definition at line 79 of file event.h.


Member Function Documentation

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 121 of file event.h.

template<class T>
void Kross::Api::Event< T >::addFunction const QString &  name,
FunctionPtr  function,
const ArgumentList arglist = ArgumentList()
[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.
arglist A list of arguments for the function.
Todo:
Remove this method as soon as there is no code using it

Definition at line 103 of file event.h.

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

Same as above, but with no arguments.

Definition at line 175 of file event.h.

template<class T>
template<class RET, class ARG1, class INSTANCE, typename METHOD>
void Kross::Api::Event< T >::addProxyFunction const QString &  name,
INSTANCE *  instance,
METHOD  method
[inline]
 

Same as above, but with one argument.

Definition at line 164 of file event.h.

template<class T>
template<class RET, class ARG1, class ARG2, class INSTANCE, typename METHOD>
void Kross::Api::Event< T >::addProxyFunction const QString &  name,
INSTANCE *  instance,
METHOD  method
[inline]
 

Same as above, but with two arguments.

Definition at line 153 of file event.h.

template<class T>
template<class RET, class ARG1, class ARG2, class ARG3, class INSTANCE, typename METHOD>
void Kross::Api::Event< T >::addProxyFunction const QString &  name,
INSTANCE *  instance,
METHOD  method
[inline]
 

Same as above, but with three arguments.

Definition at line 142 of file event.h.

template<class T>
template<class RET, class ARG1, class ARG2, class ARG3, class ARG4, class INSTANCE, typename METHOD>
void Kross::Api::Event< T >::addProxyFunction const QString &  name,
INSTANCE *  instance,
METHOD  method
[inline]
 

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

Definition at line 131 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 212 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 189 of file event.h.


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