lib
Kross::Api::ScriptAction Class Reference
#include <scriptaction.h>
Inheritance diagram for Kross::Api::ScriptAction:

Detailed Description
A ScriptAction extends a KAction by providing a wrapper around a ScriptContainer to execute scripting code on activation.
Definition at line 39 of file scriptaction.h.
Public Types | |
| typedef KSharedPtr< ScriptAction > | Ptr |
Public Slots | |
| virtual void | activate () |
| void | finalize () |
Signals | |
| void | activated (const Kross::Api::ScriptAction *) |
| void | success () |
| void | failed (const QString &errormessage, const QString &tracedetails) |
Public Member Functions | |
| ScriptAction (const QString &file) | |
| ScriptAction (const QString &scriptconfigfile, const QDomElement &element) | |
| virtual | ~ScriptAction () |
| int | version () const |
| const QString | getDescription () const |
| void | setDescription (const QString &description) |
| void | setInterpreterName (const QString &name) |
| const QString | getPackagePath () const |
| const QStringList & | getLogs () const |
| void | attach (ScriptActionCollection *collection) |
| void | detach (ScriptActionCollection *collection) |
| void | detachAll () |
Properties | |
| QString | description [] |
Member Typedef Documentation
| typedef KSharedPtr<ScriptAction> Kross::Api::ScriptAction::Ptr |
Shared pointer to implement reference-counting.
Reimplemented from Kross::Api::ScriptContainer.
Definition at line 60 of file scriptaction.h.
Constructor & Destructor Documentation
| ScriptAction::ScriptAction | ( | const QString & | file | ) | [explicit] |
Constructor.
- Parameters:
-
file The KURL scriptfile this ScriptAction points to.
Definition at line 85 of file scriptaction.cpp.
| ScriptAction::ScriptAction | ( | const QString & | scriptconfigfile, | |
| const QDomElement & | element | |||
| ) | [explicit] |
Constructor.
- Parameters:
-
scriptconfigfile The XML-configurationfile the DOM-element was readed from. element The QDomElement which will be used to setup the ScriptAction attributes.
Definition at line 104 of file scriptaction.cpp.
| ScriptAction::~ScriptAction | ( | ) | [virtual] |
Member Function Documentation
| int ScriptAction::version | ( | ) | const |
- Returns:
- the version this script has.
Versions are used to be able to manage different versions of the same script. The version is 0 by default if not defined to something else in the rc-file.
Definition at line 176 of file scriptaction.cpp.
| const QString ScriptAction::getDescription | ( | ) | const |
| void ScriptAction::setDescription | ( | const QString & | description | ) |
Set the description description for this ScriptAction .
Definition at line 186 of file scriptaction.cpp.
| void ScriptAction::setInterpreterName | ( | const QString & | name | ) |
Set the name of the interpreter which will be used on activation to execute the scripting code.
- Parameters:
-
name The name of the Interpreter . This could be e.g. "python".
Reimplemented from Kross::Api::ScriptContainer.
Definition at line 193 of file scriptaction.cpp.
| const QString ScriptAction::getPackagePath | ( | ) | const |
- Returns:
- the path of the package this ScriptAction belongs to or QString::null if it doesn't belong to any package.
Definition at line 199 of file scriptaction.cpp.
| const QStringList & ScriptAction::getLogs | ( | ) | const |
- Returns:
- a list of all kind of logs this ScriptAction does remember.
Definition at line 204 of file scriptaction.cpp.
| void ScriptAction::attach | ( | ScriptActionCollection * | collection | ) |
Attach this ScriptAction to the ScriptActionCollection collection .
Definition at line 209 of file scriptaction.cpp.
| void ScriptAction::detach | ( | ScriptActionCollection * | collection | ) |
Detach this ScriptAction from the ScriptActionCollection collection .
Definition at line 214 of file scriptaction.cpp.
| void ScriptAction::detachAll | ( | ) |
Detach this ScriptAction from all ScriptActionCollection instance his ScriptAction is attached to.
Definition at line 219 of file scriptaction.cpp.
| void ScriptAction::activate | ( | ) | [virtual, slot] |
If the ScriptAction got activated the ScriptContainer got executed.
Once this slot got executed it will emit a success() or failed() signal.
Reimplemented from KAction.
Definition at line 225 of file scriptaction.cpp.
| void ScriptAction::finalize | ( | ) | [slot] |
This slot finalizes the ScriptContainer and tries to clean any still running script.
Reimplemented from Kross::Api::ScriptContainer.
Definition at line 242 of file scriptaction.cpp.
| void Kross::Api::ScriptAction::activated | ( | const Kross::Api::ScriptAction * | ) | [signal] |
This signal got emitted when this action is emitted before execution.
| void Kross::Api::ScriptAction::success | ( | ) | [signal] |
This signal got emitted after this ScriptAction got executed successfully.
| void Kross::Api::ScriptAction::failed | ( | const QString & | errormessage, | |
| const QString & | tracedetails | |||
| ) | [signal] |
This signal got emitted after the try to execute this ScriptAction failed.
The errormessage contains the error message.
Property Documentation
QString Kross::Api::ScriptAction::description [read, write] |
The documentation for this class was generated from the following files:

