Kross
Kross::Manager Class Reference
The Manager class is a singleton that provides the main entry point to deal with the Kross Scripting Framework. More...
#include <manager.h>

Public Slots | |
| QStringList | interpreters () const |
| bool | hasAction (const QString &name) |
| QObject * | action (const QString &name) |
| QObject * | module (const QString &modulename) |
| bool | executeScriptFile (const QString &file=QString()) |
Signals | |
| void | started (Kross::Action *) |
| void | finished (Kross::Action *) |
Public Member Functions | |
| ~Manager () | |
| QHash< QString, InterpreterInfo * > | interpreterInfos () const |
| bool | hasInterpreterInfo (const QString &interpretername) const |
| InterpreterInfo * | interpreterInfo (const QString &interpretername) const |
| const QString | interpreternameForFile (const QString &file) |
| Interpreter * | interpreter (const QString &interpretername) const |
| ActionCollection * | actionCollection () const |
Static Public Member Functions | |
| static Manager & | self () |
Protected Member Functions | |
| Manager () | |
Detailed Description
The Manager class is a singleton that provides the main entry point to deal with the Kross Scripting Framework.
Use Interpreter to just work with some implementated interpreter like python or ruby. While Action implements a flexible abstract container to deal with single script files.
Definition at line 48 of file manager.h.
Constructor & Destructor Documentation
| Manager::Manager | ( | ) | [protected] |
Protected constructor.
Use self() to access the Manager singleton instance.
Definition at line 69 of file manager.cpp.
| Manager::~Manager | ( | ) |
Destructor.
Definition at line 195 of file manager.cpp.
Member Function Documentation
| ActionCollection * Manager::actionCollection | ( | ) | const |
- Returns:
- the root ActionCollection instance. Each collection could have children of other collections and/or Action instances.
Definition at line 248 of file manager.cpp.
Execute a script file.
- Parameters:
-
file The script file that should be executed.
Definition at line 314 of file manager.cpp.
| void Kross::Manager::finished | ( | Kross::Action * | ) | [signal] |
This signal is emitted when the execution of a script is finished.
- Returns:
- true if there exists a Action QObject instance which is child of this Manager instance and is defined as
nameelse false is returned.
Definition at line 253 of file manager.cpp.
- Returns:
- true if there exists an interpreter with the name
interpreternameelse false.
Definition at line 208 of file manager.cpp.
| Interpreter * Manager::interpreter | ( | const QString & | interpretername | ) | const |
Return the Interpreter instance defined by the interpretername.
- Parameters:
-
interpretername The name of the interpreter. e.g. "python" or "kjs".
- Returns:
- The Interpreter instance or NULL if there does not exists an interpreter with such an interpretername.
Definition at line 234 of file manager.cpp.
| InterpreterInfo * Manager::interpreterInfo | ( | const QString & | interpretername | ) | const |
- Returns:
- the InterpreterInfo* matching to the defined
interpreternameor NULL if there does not exists such a interpreter.
Definition at line 213 of file manager.cpp.
| QHash< QString, InterpreterInfo * > Manager::interpreterInfos | ( | ) | const |
- Returns:
- a map with InterpreterInfo* instances used to describe interpreters.
Definition at line 203 of file manager.cpp.
Return the name of the Interpreter that feels responsible for the defined file .
- Parameters:
-
file The filename we should try to determinate the interpretername for.
- Returns:
- The name of the Interpreter which will be used to execute the file or QString() if we failed to determinate a matching interpreter for the file.
Definition at line 218 of file manager.cpp.
| QStringList Manager::interpreters | ( | ) | const [slot] |
- Returns:
- a list of names of all supported scripting interpreters. The list may contain for example "python", "ruby" and "kjs" depending on what interpreter-plugins are installed.
Definition at line 243 of file manager.cpp.
Load and return an external module.
Modules are dynamic loadable plugins which could be loaded on demand to provide additional functionality.
- Parameters:
-
modulename The name of the module we should try to load.
- Returns:
- The QObject instance that repesents the module or NULL if loading failed.
Definition at line 270 of file manager.cpp.
| Manager & Manager::self | ( | ) | [static] |
Return the Manager instance.
Always use this function to access the Manager singleton.
Definition at line 63 of file manager.cpp.
| void Kross::Manager::started | ( | Kross::Action * | ) | [signal] |
This signal is emitted when the execution of a script is started.
The documentation for this class was generated from the following files:
KDE 4.0 API Reference