Plasma
Plasma::AppletScript Class Reference
Provides a restricted interface for scripted applets. More...
#include <Plasma/Scripting/AppletScript>

Public Slots | |
virtual void | configChanged () |
virtual void | showConfigurationInterface () |
Public Member Functions | |
Plasma::Applet * | applet () const |
AppletScript (QObject *parent=0) | |
void | configNeedsSaving () const |
virtual void | constraintsEvent (Plasma::Constraints constraints) |
virtual QList< QAction * > | contextualActions () |
virtual void | paintInterface (QPainter *painter, const QStyleOptionGraphicsItem *option, const QRect &contentsRect) |
void | setApplet (Plasma::Applet *applet) |
void | setConfigurationRequired (bool req, const QString &reason=QString()) |
void | setFailedToLaunch (bool failed, const QString &reason=QString()) |
void | setHasConfigurationInterface (bool hasInterface) |
virtual QPainterPath | shape () const |
Q_INVOKABLE QSizeF | size () const |
~AppletScript () | |
Protected Member Functions | |
Q_INVOKABLE DataEngine * | dataEngine (const QString &engine) const |
QString | mainScript () const |
const Package * | package () const |
Detailed Description
Provides a restricted interface for scripted applets.Definition at line 46 of file appletscript.h.
Constructor & Destructor Documentation
Plasma::AppletScript::AppletScript | ( | QObject * | parent = 0 |
) | [explicit] |
Default constructor for an AppletScript.
Subclasses should not attempt to access the Plasma::Applet associated with this AppletScript in the constructor. All such set up that requires the Applet itself should be done in the init() method.
Definition at line 34 of file appletscript.cpp.
Plasma::AppletScript::~AppletScript | ( | ) |
Definition at line 41 of file appletscript.cpp.
Member Function Documentation
Applet * Plasma::AppletScript::applet | ( | ) | const |
Returns the Plasma::Applet associated with this script component.
Definition at line 51 of file appletscript.cpp.
void Plasma::AppletScript::configChanged | ( | ) | [virtual, slot] |
void Plasma::AppletScript::configNeedsSaving | ( | ) | const |
void Plasma::AppletScript::constraintsEvent | ( | Plasma::Constraints | constraints | ) | [virtual] |
Called when any of the geometry constraints have been updated.
This is always called prior to painting and should be used as an opportunity to layout the widget, calculate sizings, etc.
Do not call update() from this method; an update() will be triggered at the appropriate time for the applet.
- Parameters:
-
constraints the type of constraints that were updated
Definition at line 75 of file appletscript.cpp.
Returns a list of context-related QAction instances.
- Returns:
- A list of actions. The default implementation returns an empty list.
Definition at line 80 of file appletscript.cpp.
DataEngine * Plasma::AppletScript::dataEngine | ( | const QString & | engine | ) | const [protected] |
- engine name of the engine
- Returns:
- a data engine associated with this plasmoid
Definition at line 132 of file appletscript.cpp.
QString Plasma::AppletScript::mainScript | ( | ) | const [protected, virtual] |
- Returns:
- absolute path to the main script file for this plasmoid
Reimplemented from Plasma::ScriptEngine.
Definition at line 138 of file appletscript.cpp.
const Package * Plasma::AppletScript::package | ( | ) | const [protected, virtual] |
- Returns:
- the Package associated with this plasmoid which can be used to request resources, such as images and interface files.
Reimplemented from Plasma::ScriptEngine.
Definition at line 144 of file appletscript.cpp.
void Plasma::AppletScript::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 contentsRect the rect to paint within; automatically adjusted for the background, if any
Definition at line 57 of file appletscript.cpp.
void Plasma::AppletScript::setApplet | ( | Plasma::Applet * | applet | ) |
void Plasma::AppletScript::setHasConfigurationInterface | ( | bool | hasInterface | ) |
Sets whether or not this script has a configuration interface or not.
- hasInterface true if the applet is user configurable
Definition at line 96 of file appletscript.cpp.
QPainterPath Plasma::AppletScript::shape | ( | ) | const [virtual] |
Returns the shape of the widget, defaults to the bounding rect.
Definition at line 85 of file appletscript.cpp.
void Plasma::AppletScript::showConfigurationInterface | ( | ) | [virtual, slot] |
QSizeF Plasma::AppletScript::size | ( | ) | const |
Returns the area within which contents can be painted.
Definition at line 66 of file appletscript.cpp.
The documentation for this class was generated from the following files: