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

Plasma

  • plasma
  • scripting
wallpaperscript.h
Go to the documentation of this file.
1/*
2 * Copyright 2009 by Aaron Seigo <aseigo@kde.org>
3 * Copyright 2009 by Petri Damsten <damu@iki.fi>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Library General Public License as
7 * published by the Free Software Foundation; either version 2, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details
14 *
15 * You should have received a copy of the GNU Library General Public
16 * License along with this program; if not, write to the
17 * Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21#ifndef PLASMA_WALLPAPERSCRIPT_H
22#define PLASMA_WALLPAPERSCRIPT_H
23
24#include <kgenericfactory.h>
25#include <kplugininfo.h>
26
27#include <plasma/plasma_export.h>
28#include <plasma/scripting/scriptengine.h>
29#include <plasma/wallpaper.h>
30
31namespace Plasma
32{
33
34class WallpaperScriptPrivate;
35class Service;
36
42class PLASMA_EXPORT WallpaperScript : public ScriptEngine
43{
44 Q_OBJECT
45
46public:
54 explicit WallpaperScript(QObject *parent = 0);
55 ~WallpaperScript();
56
60 void setWallpaper(Wallpaper *wallpaper);
61
65 Wallpaper *wallpaper() const;
66
74 virtual void initWallpaper(const KConfigGroup &config);
75
82 virtual void paint(QPainter *painter, const QRectF &exposedRect);
83
88 virtual void save(KConfigGroup &config);
89
106 virtual QWidget *createConfigurationInterface(QWidget *parent);
107
114 virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
115
122 virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
123
130 virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
131
138 virtual void wheelEvent(QGraphicsSceneWheelEvent *event);
139
144 void setUrls(const KUrl::List urls);
145
146protected:
150 QString mainScript() const;
151
157 const Package *package() const;
158
162 KPluginInfo description() const;
163
164 bool isInitialized() const;
165 QRectF boundingRect() const;
166 DataEngine *dataEngine(const QString &name) const;
167 void setResizeMethodHint(Wallpaper::ResizeMethod resizeMethod);
168 void setTargetSizeHint(const QSizeF &targetSize);
169 void setConfigurationRequired(bool needsConfiguring, const QString &reason = QString());
170 void render(const QString &sourceImagePath, const QSize &size,
171 Wallpaper::ResizeMethod resizeMethod = Plasma::Wallpaper::ScaledResize,
172 const QColor &color = QColor(0, 0, 0));
173 void setUsingRenderingCache(bool useCache);
174 bool findInCache(const QString &key, QImage &image, unsigned int lastModified = 0);
175 void insertIntoCache(const QString& key, const QImage &image);
176 void setContextualActions(const QList<QAction*> &actions);
177 void update(const QRectF &exposedArea);
178 void configNeedsSaving();
179
180protected Q_SLOTS:
181 virtual void renderCompleted(const QImage &image);
182 virtual void urlDropped(const KUrl &url);
183
184private:
185 WallpaperScriptPrivate *const d;
186};
187
188#define K_EXPORT_PLASMA_WALLPAPERSCRIPTENGINE(libname, classname) \
189K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \
190K_EXPORT_PLUGIN(factory("plasma_wallpaperscriptengine_" #libname))
191
192} //Plasma namespace
193
194#endif
Plasma::DataEngine
Data provider for plasmoids (Plasma plugins)
Definition: dataengine.h:59
Plasma::Package
object representing an installed Plasmagik package
Definition: package.h:43
Plasma::ScriptEngine
The base class for scripting interfaces to be used in loading plasmoids of a given language.
Definition: scriptengine.h:66
Plasma::WallpaperScript
Provides a restricted interface for scripting a Wallpaper.
Definition: wallpaperscript.h:43
Plasma::Wallpaper
The base Wallpaper class.
Definition: wallpaper.h:57
Plasma::Wallpaper::ResizeMethod
ResizeMethod
Various resize modes supported by the built in image renderer.
Definition: wallpaper.h:74
Plasma::Wallpaper::ScaledResize
@ ScaledResize
Scales the image to fit the full area.
Definition: wallpaper.h:75
QObject
QWidget
Plasma
Namespace for everything in libplasma.
Definition: abstractdialogmanager.cpp:25
plasma_export.h
scriptengine.h
wallpaper.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 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
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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