2 Copyright (c) 2007 Paolo Capriotti <p.capriotti@gmail.com>
3 Copyright (c) 2008 by Petri Damsten <damu@iki.fi>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
16 #include <QStringList>
17 #include <Plasma/Wallpaper>
18 #include "backgroundpackage.h"
19 #include "renderthread.h"
20 #include "ui_imageconfig.h"
21 #include "ui_slideshowconfig.h"
24 class BackgroundContainer
;
25 class BackgroundListModel
;
27 class Image
: public Plasma::Wallpaper
31 Image(QObject
* parent
, const QVariantList
& args
);
34 virtual void save(KConfigGroup
&config
);
35 virtual void paint(QPainter
* painter
, const QRectF
& exposedRect
);
36 virtual QWidget
* createConfigurationInterface(QWidget
* parent
);
39 void timeChanged(const QTime
& time
);
40 void positioningChanged(int index
);
43 void getNewWallpaper();
44 void colorChanged(const QColor
& color
);
45 void pictureChanged(int index
);
48 void updateBackground(int token
, const QImage
&img
);
49 void showFileDialog();
50 void updateScreenshot(QPersistentModelIndex index
);
51 void removeBackground(const QString
&path
);
54 void init(const KConfigGroup
&config
);
56 void startSlideshow();
57 void fillMetaInfo(Background
* b
);
58 bool setMetadata(QLabel
*label
, const QString
&text
);
59 void render(const QString
& image
= QString());
60 void suspendStartup(bool suspend
); // for ksmserver
61 void calculateGeometry();
62 void setSingleImage();
66 Background::ResizeMethod m_resizeMethod
;
70 QStringList m_usersWallpapers
;
73 Ui::ImageConfig m_uiImage
;
74 Ui::SlideshowConfig m_uiSlideshow
;
76 QList
<Background
*> m_slideshowBackgrounds
;
81 BackgroundListModel
*m_model
;
82 KFileDialog
*m_dialog
;
83 RenderThread m_renderer
;
87 QDateTime m_previousModified
;
91 K_EXPORT_PLASMA_WALLPAPER(image
, Image
)