Plasma
wallpaper.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef PLASMA_WALLPAPER_H
00022 #define PLASMA_WALLPAPER_H
00023
00024 #include <kplugininfo.h>
00025
00026 #include <plasma/plasma.h>
00027 #include <plasma/version.h>
00028
00029 namespace Plasma
00030 {
00031 class WallpaperPrivate;
00032
00051 class PLASMA_EXPORT Wallpaper : public QObject
00052 {
00053 Q_OBJECT
00054 Q_PROPERTY(QRectF boundingRect READ boundingRect WRITE setBoundingRect)
00055 Q_PROPERTY(QString name READ name)
00056 Q_PROPERTY(QString pluginName READ pluginName)
00057 Q_PROPERTY(QString icon READ icon)
00058 Q_PROPERTY(KServiceAction renderingMode READ renderingMode)
00059 Q_PROPERTY(QList<KServiceAction> listRenderingModes READ listRenderingModes)
00060
00061 public:
00062 ~Wallpaper();
00063
00069 static KPluginInfo::List listWallpaperInfo(const QString &formFactor = QString());
00070
00082 static Wallpaper *load(const QString &name, const QVariantList &args = QVariantList());
00083
00095 static Wallpaper *load(const KPluginInfo &info, const QVariantList &args = QVariantList());
00096
00103 QString name() const;
00104
00108 QString pluginName() const;
00109
00113 QString icon() const;
00114
00118 KServiceAction renderingMode() const;
00119
00120
00126 void setRenderingMode(const QString &mode);
00127
00132 QList<KServiceAction> listRenderingModes() const;
00133
00137 bool isInitialized() const;
00138
00142 QRectF boundingRect() const;
00143
00147 void setBoundingRect(const QRectF &boundingRect);
00148
00155 virtual void paint(QPainter *painter, const QRectF &exposedRect) = 0;
00156
00162 void restore(const KConfigGroup &config);
00163
00168 virtual void save(KConfigGroup &config);
00169
00173 virtual QWidget *createConfigurationInterface(QWidget *parent);
00174
00181 virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
00182
00189 virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
00190
00197 virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
00198
00205 virtual void wheelEvent(QGraphicsSceneWheelEvent *event);
00206
00207 Q_SIGNALS:
00211 void update(const QRectF &exposedArea);
00212
00213 protected:
00222 Wallpaper(QObject *parent, const QVariantList &args);
00223
00231 virtual void init(const KConfigGroup &config);
00232
00233 private:
00234 WallpaperPrivate *const d;
00235 };
00236
00237 }
00238
00242 #define K_EXPORT_PLASMA_WALLPAPER(libname, classname) \
00243 K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \
00244 K_EXPORT_PLUGIN(factory("plasma_wallpaper_" #libname)) \
00245 K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION)
00246
00247 #endif // multiple inclusion guard