lib

Kross::Api::ScriptAction Class Reference

#include <scriptaction.h>

Inheritance diagram for Kross::Api::ScriptAction:

KAction Kross::Api::ScriptContainer Kross::Api::MainModule Kross::Api::Module Kross::Api::Class< Module > Kross::Api::Event< Module > Kross::Api::Callable Kross::Api::Object List of all members.

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< ScriptActionPtr

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 86 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 107 of file scriptaction.cpp.

ScriptAction::~ScriptAction  )  [virtual]
 

Destructor.

Definition at line 175 of file scriptaction.cpp.


Member Function Documentation

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 231 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 ScriptAction::attach ScriptActionCollection collection  ) 
 

Attach this ScriptAction to the ScriptActionCollection collection .

Definition at line 215 of file scriptaction.cpp.

void ScriptAction::detach ScriptActionCollection collection  ) 
 

Detach this ScriptAction from the ScriptActionCollection collection .

Definition at line 220 of file scriptaction.cpp.

void ScriptAction::detachAll  ) 
 

Detach this ScriptAction from all ScriptActionCollection instance his ScriptAction is attached to.

Definition at line 225 of file scriptaction.cpp.

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.

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 248 of file scriptaction.cpp.

const QString ScriptAction::getDescription  )  const
 

Returns:
the description for this ScriptAction has.

Definition at line 187 of file scriptaction.cpp.

const QStringList & ScriptAction::getLogs  )  const
 

Returns:
a list of all kind of logs this ScriptAction does remember.

Definition at line 210 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 205 of file scriptaction.cpp.

void ScriptAction::setDescription const QString &  description  ) 
 

Set the description description for this ScriptAction .

Definition at line 192 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 199 of file scriptaction.cpp.

void Kross::Api::ScriptAction::success  )  [signal]
 

This signal got emitted after this ScriptAction got executed successfully.

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 182 of file scriptaction.cpp.


Property Documentation

QString Kross::Api::ScriptAction::description [read, write]
 

The description for this ScriptAction .

Definition at line 55 of file scriptaction.h.


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