lib

Kross::Api::Callable Class Reference

#include <callable.h>

Inheritance diagram for Kross::Api::Callable:

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

Detailed Description

Base class for callable objects.

Classes like Event or Class are inherited from this class and implement the Object::call() method to handle the call.

Definition at line 39 of file callable.h.


Public Types

typedef KSharedPtr< CallablePtr

Public Member Functions

 Callable (const QString &name)
virtual ~Callable ()
const QString getName () const
virtual const QString getClassName () const
bool hasChild (const QString &name) const
Object::Ptr getChild (const QString &name) const
QMap< QString, Object::PtrgetChildren () const
bool addChild (const QString &name, Object *object)
bool addChild (Callable *object)
void removeChild (const QString &name)
void removeAllChildren ()
virtual Object::Ptr call (const QString &name, List::Ptr arguments)

Member Typedef Documentation


Constructor & Destructor Documentation

Callable::Callable ( const QString &  name  ) 

Constructor.

Parameters:
name The name this callable object has and it is reachable as via getChild() .

Definition at line 28 of file callable.cpp.

Callable::~Callable (  )  [virtual]

Destructor.

Definition at line 34 of file callable.cpp.


Member Function Documentation

const QString Callable::getName (  )  const

Returns:
the name this object has.

Each callable object has a name which is used e.g. on addChild to be able to identify the object itself.

Reimplemented in Kross::Api::ScriptContainer.

Definition at line 38 of file callable.cpp.

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

Return the class name.

This could be something like "Kross::Api::Callable" for this object. The value is mainly used for display purposes.

Returns:
The name of this class.

Implements Kross::Api::Object.

Reimplemented in Kross::Api::EventAction, Kross::Api::EventScript, Kross::Api::EventSignal, Kross::Api::EventSlot, Kross::Api::QtObject, and Kross::Api::MainModule.

Definition at line 43 of file callable.cpp.

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

Returns if the defined child is avaible.

Returns:
true if child exists else false.

Definition at line 48 of file callable.cpp.

Object::Ptr Callable::getChild ( const QString &  name  )  const

Return the defined child or NULL if there is no such object with that name avaible.

Parameters:
name The name of the Object to return.
Returns:
The Object matching to the defined name or NULL if there is no such Object.

Definition at line 53 of file callable.cpp.

QMap< QString, Object::Ptr > Callable::getChildren (  )  const

Return all children.

Returns:
A ObjectMap of children this Object has.

Definition at line 58 of file callable.cpp.

bool Callable::addChild ( const QString &  name,
Object object 
)

Add a new child.

Replaces a possible already existing child with such a name.

Parameters:
name the name of the child
object The Object to add.
Returns:
true if the Object was added successfully else false.

Definition at line 63 of file callable.cpp.

bool Callable::addChild ( Callable object  ) 

Same as the addChild method above but for callable objects which define there own name.

Definition at line 73 of file callable.cpp.

void Callable::removeChild ( const QString &  name  ) 

Remove an existing child.

Parameters:
name The name of the Object to remove. If there doesn't exists an Object with such name just nothing will be done.

Definition at line 78 of file callable.cpp.

void Callable::removeAllChildren (  ) 

Remove all children.

Definition at line 86 of file callable.cpp.


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