• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

Plasma

  • Plasma
  • WallpaperScript
Public Member Functions | Protected Slots | Protected Member Functions | List of all members
Plasma::WallpaperScript Class Reference

#include <Plasma/Scripting/WallpaperScript>

Inheritance diagram for Plasma::WallpaperScript:
Inheritance graph
[legend]

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 setUrls (const KUrl::List urls)
 
void setWallpaper (Wallpaper *wallpaper)
 
Wallpaper * wallpaper () const
 
virtual void wheelEvent (QGraphicsSceneWheelEvent *event)
 
- Public Member Functions inherited from Plasma::ScriptEngine
 ~ScriptEngine ()
 
virtual bool init ()
 

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)
 
- Protected Member Functions inherited from Plasma::ScriptEngine
 ScriptEngine (QObject *parent=0)
 

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 34 of file wallpaperscript.cpp.

Plasma::WallpaperScript::~WallpaperScript ( )

Definition at line 40 of file wallpaperscript.cpp.

Member Function Documentation

QRectF Plasma::WallpaperScript::boundingRect ( ) const
protected

Definition at line 135 of file wallpaperscript.cpp.

void Plasma::WallpaperScript::configNeedsSaving ( )
protected

Definition at line 214 of file wallpaperscript.cpp.

QWidget * Plasma::WallpaperScript::createConfigurationInterface ( QWidget *  parent)
virtual

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 93 of file wallpaperscript.cpp.

DataEngine * Plasma::WallpaperScript::dataEngine ( const QString &  name) const
protected

Definition at line 143 of file wallpaperscript.cpp.

KPluginInfo Plasma::WallpaperScript::description ( ) const
protected
Returns
the KPluginInfo associated with this wallpaper

Definition at line 71 of file wallpaperscript.cpp.

bool Plasma::WallpaperScript::findInCache ( const QString &  key,
QImage &  image,
unsigned int  lastModified = 0 
)
protected

Definition at line 185 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
configConfig group to load settings

Definition at line 77 of file wallpaperscript.cpp.

void Plasma::WallpaperScript::insertIntoCache ( const QString &  key,
const QImage &  image 
)
protected

Definition at line 193 of file wallpaperscript.cpp.

bool Plasma::WallpaperScript::isInitialized ( ) const
protected

Definition at line 127 of file wallpaperscript.cpp.

QString Plasma::WallpaperScript::mainScript ( ) const
protectedvirtual
Returns
absolute path to the main script file for this wallpaper

Reimplemented from Plasma::ScriptEngine.

Definition at line 59 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
eventthe mouse event object

Definition at line 99 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
eventthe mouse event object

Definition at line 104 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
eventthe mouse event object

Definition at line 109 of file wallpaperscript.cpp.

const Package * Plasma::WallpaperScript::package ( ) const
protectedvirtual
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 65 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
painterthe QPainter to use to do the painting
exposedRectthe rect to paint within

Definition at line 82 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 170 of file wallpaperscript.cpp.

void Plasma::WallpaperScript::renderCompleted ( const QImage &  image)
protectedvirtualslot

Definition at line 221 of file wallpaperscript.cpp.

void Plasma::WallpaperScript::save ( KConfigGroup &  config)
virtual

This method is called when settings need to be saved.

Parameters
configConfig group to save settings

Definition at line 88 of file wallpaperscript.cpp.

void Plasma::WallpaperScript::setConfigurationRequired ( bool  needsConfiguring,
const QString &  reason = QString() 
)
protected

Definition at line 163 of file wallpaperscript.cpp.

void Plasma::WallpaperScript::setContextualActions ( const QList< QAction * > &  actions)
protected

Definition at line 200 of file wallpaperscript.cpp.

void Plasma::WallpaperScript::setResizeMethodHint ( Wallpaper::ResizeMethod  resizeMethod)
protected

Definition at line 149 of file wallpaperscript.cpp.

void Plasma::WallpaperScript::setTargetSizeHint ( const QSizeF &  targetSize)
protected

Definition at line 156 of file wallpaperscript.cpp.

void Plasma::WallpaperScript::setUrls ( const KUrl::List  urls)

Adds urls (e.g.

from a drop)

Since
4.7

Definition at line 119 of file wallpaperscript.cpp.

void Plasma::WallpaperScript::setUsingRenderingCache ( bool  useCache)
protected

Definition at line 178 of file wallpaperscript.cpp.

void Plasma::WallpaperScript::setWallpaper ( Wallpaper *  wallpaper)

Sets the Plasma::Wallpaper associated with this WallpaperScript.

Definition at line 45 of file wallpaperscript.cpp.

void Plasma::WallpaperScript::update ( const QRectF &  exposedArea)
protected

Definition at line 207 of file wallpaperscript.cpp.

void Plasma::WallpaperScript::urlDropped ( const KUrl &  url)
protectedvirtualslot

Definition at line 226 of file wallpaperscript.cpp.

Wallpaper * Plasma::WallpaperScript::wallpaper ( ) const

Returns the Plasma::Wallpaper associated with this script component.

Definition at line 54 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
eventthe wheel event object

Definition at line 114 of file wallpaperscript.cpp.


The documentation for this class was generated from the following files:
  • wallpaperscript.h
  • wallpaperscript.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:35 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Plasma

Skip menu "Plasma"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal