Plasma.Wallpaper

KDE 4.2 PyKDE API Reference

- KDE's Python API

# Wallpaper Class Reference

`from PyKDE4.plasma import *`

Inherits: QObject
Namespace: Plasma

## Detailed Description

Abstract class:
  This class can be used as a base class for new classes, but can not be instantiated directly.

Wallpaper plasma/wallpaper.h <Plasma/Wallpaper>

The base Wallpaper class

"Wallpapers" are components that paint the background for Containments that do not provide their own background rendering.

Wallpaper plugins are registered using .desktop files. These files should be named using the following naming scheme:

plasma-wallpaper-<pluginname>.desktop

If a wallpaper plugin provides more than on mode (e.g. Single Image, Wallpaper) it should include a Actions= entry in the .desktop file, listing the possible actions. An actions group should be included to provide for translatable names.

## Signals
| update (QRectF exposedArea)
## Methods
| __init__ (self, QObject parent, QVariantList args)
QRectF | boundingRect (self)
QWidget | createConfigurationInterface (self, QWidget parent)
QString | icon (self)
| init (self, KConfigGroup config)
bool | isInitialized (self)
[KServiceAction] | listRenderingModes (self)
| mouseMoveEvent (self, QGraphicsSceneMouseEvent event)
| mousePressEvent (self, QGraphicsSceneMouseEvent event)
| mouseReleaseEvent (self, QGraphicsSceneMouseEvent event)
QString | name (self)
| paint (self, QPainter painter, QRectF exposedRect)
QString | pluginName (self)
KServiceAction | renderingMode (self)
| restore (self, KConfigGroup config)
| save (self, KConfigGroup config)
| setBoundingRect (self, QRectF boundingRect)
| setRenderingMode (self, QString mode)
| update (self, QRectF exposedArea)
| wheelEvent (self, QGraphicsSceneWheelEvent event)
## Static Methods
KPluginInfo.List | listWallpaperInfo (QString formFactor=QString())
Plasma.Wallpaper | load (QString name, QVariantList args=QVariantList())
Plasma.Wallpaper | load (KPluginInfo info, QVariantList args=QVariantList())

## Method Documentation

__init__ | ( | self, |
|  | QObject | parent,
|  | QVariantList | args
| ) |  |  |

This constructor is to be used with the plugin loading systems found in KPluginInfo and KService. The argument list is expected to have one element: the KService service ID for the desktop entry.

Parameters:

  | parent | a QObject parent; you probably want to pass in 0
  | args | a list of strings containing one entry: the service id

QRectF boundingRect | ( |  | self ) |

Returns bounding rectangle

QWidget createConfigurationInterface | ( | self, |
|  | QWidget | parent
| ) |  |  |

Returns widget for configuration dialog.

QString icon | ( |  | self ) |

Returns the icon related to this wallpaper

init | ( | self, |
|  | KConfigGroup | config
| ) |  |  |

This method is called once the wallpaper is loaded or mode is changed.

The mode can be retrieved using the renderMode() method.

Parameters:

  | config | Config group to load settings

bool isInitialized | ( |  | self ) |

Returns:
  true if initialized (usually by calling retore), false otherwise

[KServiceAction] listRenderingModes | ( |  | self ) |

Returns modes the wallpaper has, as specified in the .desktop file.

KPluginInfo.List listWallpaperInfo | ( | QString | formFactor=QString()
| ) |  |  |

Returns a list of all known wallpapers.

Returns:
  list of wallpapers

Plasma.Wallpaper load | ( | QString | name,
|  | QVariantList | args=QVariantList()
| ) |  |  |

Attempts to load an wallpaper

Returns a pointer to the wallpaper if successful. The caller takes responsibility for the wallpaper, including deleting it when no longer needed.

Parameters:

  | name | the plugin name, as returned by KPluginInfo.pluginName()
  | args | to send the wallpaper extra arguments

Returns:
  a pointer to the loaded wallpaper, or 0 on load failure

Plasma.Wallpaper load | ( | KPluginInfo | info,
|  | QVariantList | args=QVariantList()
| ) |  |  |

Attempts to load an wallpaper

Returns a pointer to the wallpaper if successful. The caller takes responsibility for the wallpaper, including deleting it when no longer needed.

Parameters:

  | info | KPluginInfo object for the desired wallpaper
  | args | to send the wallpaper extra arguments

Returns:
  a pointer to the loaded wallpaper, or 0 on load failure

mouseMoveEvent | ( | self, |
|  | QGraphicsSceneMouseEvent | event
| ) |  |  |

Mouse move event. To prevent further propagation of the event, the event must be accepted.

Parameters:

  | event | the mouse event object

mousePressEvent | ( | self, |
|  | QGraphicsSceneMouseEvent | event
| ) |  |  |

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

mouseReleaseEvent | ( | self, |
|  | QGraphicsSceneMouseEvent | event
| ) |  |  |

Mouse release event. To prevent further propagation of the event, the event must be accepted.

Parameters:

  | event | the mouse event object

QString name | ( |  | self ) |

Returns the user-visible name for the wallpaper, as specified in the .desktop file.

Returns:
  the user-visible name for the wallpaper.

paint | ( | self, |
|  | QPainter | painter,
|  | QRectF | exposedRect
| ) |  |  |

Abstract method:
  This method is abstract and can be overridden but not called directly.

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

QString pluginName | ( |  | self ) |

Returns the plugin name for the wallpaper

KServiceAction renderingMode | ( |  | self ) |

Returns:
  the currently active rendering mode

restore | ( | self, |
|  | KConfigGroup | config
| ) |  |  |

This method should be called once the wallpaper is loaded or mode is changed.

Parameters:

  | config | Config group to load settings

See also:
  init

save | ( | self, |
|  | KConfigGroup | config
| ) |  |  |

This method is called when settings need to be saved.

Parameters:

  | config | Config group to save settings

setBoundingRect | ( | self, |
|  | QRectF | boundingRect
| ) |  |  |

Sets bounding rectangle

setRenderingMode | ( | self, |
|  | QString | mode
| ) |  |  |

Sets the rendering mode for this wallpaper.

Parameters:

  | mode | One of the modes supported by the plugin, or an empty string for the default mode.

update | ( | self, |
|  | QRectF | exposedArea
| ) |  |  |

This signal indicates that wallpaper needs to be repainted.

Signal syntax:
  `QObject.connect(source, SIGNAL("update(const QRectF&)"), target_slot)`

wheelEvent | ( | self, |
|  | QGraphicsSceneWheelEvent | event
| ) |  |  |

Mouse wheel event. To prevent further propagation of the event, the event must be accepted.

Parameters:

  | event | the wheel event object