21 #ifndef PLASMA_WALLPAPER_H
22 #define PLASMA_WALLPAPER_H
24 #include <kmimetype.h>
25 #include <kplugininfo.h>
35 class WallpaperPrivate;
59 Q_PROPERTY(QRectF boundingRect READ boundingRect WRITE setBoundingRect)
60 Q_PROPERTY(QString name READ name)
61 Q_PROPERTY(QString pluginName READ pluginName)
62 Q_PROPERTY(QString icon READ icon)
63 Q_PROPERTY(KServiceAction renderingMode READ renderingMode)
64 Q_PROPERTY(QList<KServiceAction> listRenderingModes READ listRenderingModes)
65 Q_PROPERTY(
bool usingRenderingCache READ isUsingRenderingCache WRITE setUsingRenderingCache)
66 Q_PROPERTY(
bool previewing READ isPreviewing WRITE setPreviewing)
67 Q_PROPERTY(
ResizeMethod resizeMethod READ resizeMethodHint WRITE setResizeMethodHint)
68 Q_PROPERTY(QSizeF targetSize READ targetSizeHint WRITE setTargetSizeHint)
77 ScaledAndCroppedResize ,
81 LastResizeMethod = MaxpectResize
97 void setUrls(const KUrl::List &urls);
106 static KPluginInfo::List listWallpaperInfo(const QString &formFactor = QString());
114 static KPluginInfo::List listWallpaperInfoForMimetype(const QString &mimetype,
115 const QString &formFactor = QString());
128 static
Wallpaper *load(const QString &name, const QVariantList &args = QVariantList());
141 static
Wallpaper *load(const KPluginInfo &info, const QVariantList &args = QVariantList());
160 QString name() const;
167 const
Package *package() const;
172 QString pluginName() const;
177 QString icon() const;
182 KServiceAction renderingMode() const;
191 bool supportsMimetype(const QString &mimetype) const;
198 void setRenderingMode(const QString &mode);
204 QList<KServiceAction> listRenderingModes() const;
209 bool isInitialized() const;
214 QRectF boundingRect() const;
219 void setBoundingRect(const QRectF &boundingRect);
227 virtual
void paint(QPainter *painter, const QRectF &exposedRect) = 0;
234 void restore(const KConfigGroup &config);
240 virtual
void save(KConfigGroup &config);
266 virtual
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
274 virtual
void mousePressEvent(QGraphicsSceneMouseEvent *event);
282 virtual
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
290 virtual
void wheelEvent(QGraphicsSceneWheelEvent *event);
311 Q_INVOKABLE
DataEngine *dataEngine(const QString &name) const;
318 bool configurationRequired() const;
324 bool isUsingRenderingCache() const;
336 void setResizeMethodHint(
Wallpaper::ResizeMethod resizeMethod);
342 Wallpaper::ResizeMethod resizeMethodHint() const;
353 void setTargetSizeHint(const QSizeF &targetSize);
359 QSizeF targetSizeHint() const;
364 QList<QAction*> contextualActions() const;
370 bool isPreviewing() const;
376 void setPreviewing(
bool previewing);
382 bool needsPreviewDuringConfiguration() const;
389 void update(const QRectF &exposedArea);
395 void configureRequested();
402 void configurationRequired(
bool needsConfig);
409 void configNeedsSaving();
415 void renderCompleted(const QImage &image);
423 KDE_DEPRECATED
void urlDropped(const KUrl &url);
428 void renderHintsChanged();
437 void addUrls(const KUrl::List &urls);
457 virtual
void init(const KConfigGroup &config);
470 void setConfigurationRequired(
bool needsConfiguring, const QString &reason = QString());
485 void render(const QString &sourceImagePath, const QSize &size,
486 Wallpaper::ResizeMethod resizeMethod = ScaledResize,
487 const QColor &color = QColor(0, 0, 0));
501 void render(const QImage &image, const QSize &size,
502 Wallpaper::ResizeMethod resizeMethod = ScaledResize,
503 const QColor &color = QColor(0, 0, 0));
515 void setUsingRenderingCache(
bool useCache);
528 bool findInCache(const QString &key, QImage &image,
unsigned int lastModified = 0);
543 void insertIntoCache(const QString& key, const QImage &image);
552 void setContextualActions(const QList<QAction*> &actions);
555 QList<QAction*> contextActions;
565 void setPreviewDuringConfiguration(const
bool preview);
568 Q_PRIVATE_SLOT(d,
void newRenderCompleted(const WallpaperRenderRequest &request,
569 const QImage &image))
570 Q_PRIVATE_SLOT(d,
void initScript())
572 friend class WallpaperPackage;
573 friend class WallpaperPrivate;
575 friend class WallpaperWithPaint;
576 friend class ContainmentPrivate;
577 WallpaperPrivate *const d;
585 #define K_EXPORT_PLASMA_WALLPAPER(libname, classname) \
586 K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \
587 K_EXPORT_PLUGIN(factory("plasma_wallpaper_" #libname)) \
588 K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION)
590 #endif // multiple inclusion guard
Provides a restricted interface for scripting a Wallpaper.
ResizeMethod
Various resize modes supported by the built in image renderer.
Data provider for plasmoids (Plasma plugins)
object representing an installed Plasmagik package
PackageStructure::Ptr packageStructure(const QString &language, ComponentType type)
Loads an appropriate PackageStructure for the given language and type.
A description of the expected file structure of a given package type.
The base Wallpaper class.