Plasma
Plasma::WallpaperScript Class Reference
Provides a restricted interface for scripting a Wallpaper. More...
#include <Plasma/Scripting/WallpaperScript>

Public Member Functions | |
| WallpaperScript (QObject *parent=0) | |
| ~WallpaperScript () | |
| virtual QWidget * | createConfigurationInterface (QWidget *parent) |
| virtual void | initWallpaper (const KConfigGroup &config) |
| virtual void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) |
| virtual void | mousePressEvent (QGraphicsSceneMouseEvent *event) |
| virtual void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) |
| virtual void | paint (QPainter *painter, const QRectF &exposedRect) |
| virtual void | save (KConfigGroup &config) |
| void | setWallpaper (Wallpaper *wallpaper) |
| Wallpaper * | wallpaper () const |
| virtual void | wheelEvent (QGraphicsSceneWheelEvent *event) |
Protected Slots | |
| virtual void | renderCompleted (const QImage &image) |
| virtual void | urlDropped (const KUrl &url) |
Protected Member Functions | |
| QRectF | boundingRect () const |
| void | configNeedsSaving () |
| DataEngine * | dataEngine (const QString &name) const |
| KPluginInfo | description () const |
| bool | findInCache (const QString &key, QImage &image, unsigned int lastModified=0) |
| void | insertIntoCache (const QString &key, const QImage &image) |
| bool | isInitialized () const |
| QString | mainScript () const |
| const Package * | package () const |
| void | render (const QString &sourceImagePath, const QSize &size, Wallpaper::ResizeMethod resizeMethod=Plasma::Wallpaper::ScaledResize, const QColor &color=QColor(0, 0, 0)) |
| void | setConfigurationRequired (bool needsConfiguring, const QString &reason=QString()) |
| void | setContextualActions (const QList< QAction * > &actions) |
| void | setResizeMethodHint (Wallpaper::ResizeMethod resizeMethod) |
| void | setTargetSizeHint (const QSizeF &targetSize) |
| void | setUsingRenderingCache (bool useCache) |
| void | update (const QRectF &exposedArea) |
Detailed Description
Provides a restricted interface for scripting a Wallpaper.
Definition at line 42 of file wallpaperscript.h.
Constructor & Destructor Documentation
| Plasma::WallpaperScript::WallpaperScript | ( | QObject * | parent = 0 | ) | [explicit] |
Default constructor for a WallpaperScript.
Subclasses should not attempt to access the Plasma::Wallpaper associated with this WallpaperScript in the constructor. All such set up that requires the Wallpaper itself should be done in the init() method.
Definition at line 35 of file wallpaperscript.cpp.
| Plasma::WallpaperScript::~WallpaperScript | ( | ) |
Definition at line 41 of file wallpaperscript.cpp.
Member Function Documentation
| QRectF Plasma::WallpaperScript::boundingRect | ( | ) | const [protected] |
Definition at line 128 of file wallpaperscript.cpp.
| void Plasma::WallpaperScript::configNeedsSaving | ( | ) | [protected] |
Definition at line 207 of file wallpaperscript.cpp.
Returns a widget that can be used to configure the options (if any) associated with this wallpaper.
It will be deleted by the caller when it complete. The default implementation returns a null pointer.
To signal that settings have changed connect to settingsChanged(bool modified) in parent.
connect(this, SIGNAL(settingsChanged(bool), parent, SLOT(settingsChanged(bool)))
Emit settingsChanged(true) when the settings are changed and false when the original state is restored.
Implementation detail note: for best visual results, use a QGridLayout with two columns, with the option labels in column 0
Definition at line 94 of file wallpaperscript.cpp.
| DataEngine * Plasma::WallpaperScript::dataEngine | ( | const QString & | name | ) | const [protected] |
Definition at line 136 of file wallpaperscript.cpp.
| KPluginInfo Plasma::WallpaperScript::description | ( | ) | const [protected] |
- Returns:
- the KPluginInfo associated with this wallpaper
Definition at line 72 of file wallpaperscript.cpp.
| bool Plasma::WallpaperScript::findInCache | ( | const QString & | key, |
| QImage & | image, | ||
| unsigned int | lastModified = 0 |
||
| ) | [protected] |
Definition at line 178 of file wallpaperscript.cpp.
| void Plasma::WallpaperScript::initWallpaper | ( | const KConfigGroup & | config | ) | [virtual] |
This method is called once the wallpaper is loaded or mode is changed.
The mode can be retrieved using the renderingMode() method.
- Parameters:
-
config Config group to load settings
Definition at line 78 of file wallpaperscript.cpp.
| void Plasma::WallpaperScript::insertIntoCache | ( | const QString & | key, |
| const QImage & | image | ||
| ) | [protected] |
Definition at line 186 of file wallpaperscript.cpp.
| bool Plasma::WallpaperScript::isInitialized | ( | ) | const [protected] |
Definition at line 120 of file wallpaperscript.cpp.
| QString Plasma::WallpaperScript::mainScript | ( | ) | const [protected, virtual] |
- Returns:
- absolute path to the main script file for this wallpaper
Reimplemented from Plasma::ScriptEngine.
Definition at line 60 of file wallpaperscript.cpp.
| void Plasma::WallpaperScript::mouseMoveEvent | ( | QGraphicsSceneMouseEvent * | event | ) | [virtual] |
Mouse move event.
To prevent further propagation of the event, the event must be accepted.
- Parameters:
-
event the mouse event object
Definition at line 100 of file wallpaperscript.cpp.
| void Plasma::WallpaperScript::mousePressEvent | ( | QGraphicsSceneMouseEvent * | event | ) | [virtual] |
Mouse press event.
To prevent further propagation of the even, and to receive mouseMoveEvents, the event must be accepted.
- Parameters:
-
event the mouse event object
Definition at line 105 of file wallpaperscript.cpp.
| void Plasma::WallpaperScript::mouseReleaseEvent | ( | QGraphicsSceneMouseEvent * | event | ) | [virtual] |
Mouse release event.
To prevent further propagation of the event, the event must be accepted.
- Parameters:
-
event the mouse event object
Definition at line 110 of file wallpaperscript.cpp.
| const Package * Plasma::WallpaperScript::package | ( | ) | const [protected, virtual] |
- Returns:
- the Package associated with this wallpaper which can be used to request resources, such as images and interface files.
Reimplemented from Plasma::ScriptEngine.
Definition at line 66 of file wallpaperscript.cpp.
| void Plasma::WallpaperScript::paint | ( | QPainter * | painter, |
| const QRectF & | exposedRect | ||
| ) | [virtual] |
This method is called when the wallpaper should be painted.
- Parameters:
-
painter the QPainter to use to do the painting exposedRect the rect to paint within
Definition at line 83 of file wallpaperscript.cpp.
| void Plasma::WallpaperScript::render | ( | const QString & | sourceImagePath, |
| const QSize & | size, | ||
| Wallpaper::ResizeMethod | resizeMethod = Plasma::Wallpaper::ScaledResize, |
||
| const QColor & | color = QColor(0, 0, 0) |
||
| ) | [protected] |
Definition at line 163 of file wallpaperscript.cpp.
| void Plasma::WallpaperScript::renderCompleted | ( | const QImage & | image | ) | [protected, virtual, slot] |
Definition at line 214 of file wallpaperscript.cpp.
| void Plasma::WallpaperScript::save | ( | KConfigGroup & | config | ) | [virtual] |
This method is called when settings need to be saved.
- Parameters:
-
config Config group to save settings
Definition at line 89 of file wallpaperscript.cpp.
| void Plasma::WallpaperScript::setConfigurationRequired | ( | bool | needsConfiguring, |
| const QString & | reason = QString() |
||
| ) | [protected] |
Definition at line 156 of file wallpaperscript.cpp.
| void Plasma::WallpaperScript::setContextualActions | ( | const QList< QAction * > & | actions | ) | [protected] |
Definition at line 193 of file wallpaperscript.cpp.
| void Plasma::WallpaperScript::setResizeMethodHint | ( | Wallpaper::ResizeMethod | resizeMethod | ) | [protected] |
Definition at line 142 of file wallpaperscript.cpp.
| void Plasma::WallpaperScript::setTargetSizeHint | ( | const QSizeF & | targetSize | ) | [protected] |
Definition at line 149 of file wallpaperscript.cpp.
| void Plasma::WallpaperScript::setUsingRenderingCache | ( | bool | useCache | ) | [protected] |
Definition at line 171 of file wallpaperscript.cpp.
| void Plasma::WallpaperScript::setWallpaper | ( | Wallpaper * | wallpaper | ) |
Sets the Plasma::Wallpaper associated with this WallpaperScript.
Definition at line 46 of file wallpaperscript.cpp.
| void Plasma::WallpaperScript::update | ( | const QRectF & | exposedArea | ) | [protected] |
Definition at line 200 of file wallpaperscript.cpp.
| void Plasma::WallpaperScript::urlDropped | ( | const KUrl & | url | ) | [protected, virtual, slot] |
Definition at line 219 of file wallpaperscript.cpp.
| Wallpaper * Plasma::WallpaperScript::wallpaper | ( | ) | const |
Returns the Plasma::Wallpaper associated with this script component.
Definition at line 55 of file wallpaperscript.cpp.
| void Plasma::WallpaperScript::wheelEvent | ( | QGraphicsSceneWheelEvent * | event | ) | [virtual] |
Mouse wheel event.
To prevent further propagation of the event, the event must be accepted.
- Parameters:
-
event the wheel event object
Definition at line 115 of file wallpaperscript.cpp.
The documentation for this class was generated from the following files:
KDE 4.6 API Reference