libplasma
Plasma::ScriptEngine Class Reference
#include <scriptengine.h>

Detailed Description
The base class for scripting interfaces to be used in loading plasmoids of a given language.All ScriptEngines should export as consistent an interface as possible so that the learning curve is limited. In particular, the following API should be made available in the script environment:
TODO: define the actual API ... PlasmaApplet - the applet of this plasmoid LoadUserInterface(String uiFile) - loads and returns a given UI file LoadImage - loads an image resource out of the plasmoid's package PlasmaSvg - creates and returns an Svg file
Definition at line 53 of file scriptengine.h.
Public Member Functions | |
| ScriptEngine (QObject *parent) | |
| virtual | ~ScriptEngine () |
| void | init (Applet *applet) |
| virtual void | paintInterface (QPainter *painter, const QStyleOptionGraphicsItem *option, const QRect &contentsRect) |
| Q_INVOKABLE QSizeF | size () const |
Static Public Member Functions | |
| static QStringList | knownLanguages () |
| static ScriptEngine * | load (const QString &language, Applet *applet) |
Protected Member Functions | |
| virtual bool | init () |
| QString | mainScript () const |
| const Package * | package () const |
| Applet * | applet () const |
| Q_INVOKABLE DataEngine * | dataEngine (const QString &engine) const |
Constructor & Destructor Documentation
| Plasma::ScriptEngine::ScriptEngine | ( | QObject * | parent | ) | [explicit] |
The default constructor for a ScriptEngine.
- Parameters:
-
applet the Applet object that will house the plasmoid
Definition at line 38 of file scriptengine.cpp.
| Plasma::ScriptEngine::~ScriptEngine | ( | ) | [virtual] |
Definition at line 45 of file scriptengine.cpp.
Member Function Documentation
| void Plasma::ScriptEngine::init | ( | Applet * | applet | ) |
Definition at line 50 of file scriptengine.cpp.
| QStringList Plasma::ScriptEngine::knownLanguages | ( | ) | [static] |
| ScriptEngine * Plasma::ScriptEngine::load | ( | const QString & | language, | |
| Applet * | applet | |||
| ) | [static] |
Loads a script engine for the given language.
- Parameters:
-
language the language to load an engine for applet the applet for this plasmoid
- Returns:
- pointer to the ScriptEngine or 0 on failure
Definition at line 120 of file scriptengine.cpp.
| void Plasma::ScriptEngine::paintInterface | ( | QPainter * | painter, | |
| const QStyleOptionGraphicsItem * | option, | |||
| const QRect & | contentsRect | |||
| ) | [virtual] |
Called when the script should paint the applet.
- Parameters:
-
painter the QPainter to use option the style option containing such flags as selection, level of detail, etc
Definition at line 58 of file scriptengine.cpp.
| QSizeF Plasma::ScriptEngine::size | ( | ) | const |
Definition at line 65 of file scriptengine.cpp.
| bool Plasma::ScriptEngine::init | ( | ) | [protected, virtual] |
Called when the script should set up the script environment and start the script itself.
Definition at line 74 of file scriptengine.cpp.
| QString Plasma::ScriptEngine::mainScript | ( | ) | const [protected] |
- Returns:
- absolute path to the main script file for this plasmoid
Definition at line 80 of file scriptengine.cpp.
| const Package * Plasma::ScriptEngine::package | ( | ) | const [protected] |
- Returns:
- the Package associated with this plasmoid which can be used to request resources, such as images and interface files.
Definition at line 98 of file scriptengine.cpp.
| Applet * Plasma::ScriptEngine::applet | ( | ) | const [protected] |
| DataEngine * Plasma::ScriptEngine::dataEngine | ( | const QString & | engine | ) | const [protected] |
- Returns:
- a data engine associated with this plasmoid
- engine name of the engine
Definition at line 92 of file scriptengine.cpp.
The documentation for this class was generated from the following files:
KDE 4.0 API Reference