#include <wallpaperbusinesslogic.h>
Signals | |
void | wallpaperChanged () |
void | imageEditRequested () |
void | fileListChanged () |
Public Member Functions | |
WallpaperBusinessLogic (QObject *parent=0) | |
QList< WallpaperDescriptor * > | availableWallpapers () const |
void | setEditedImage (WallpaperDescriptor *desc, bool ours=false) |
void | startEdit (WallpaperDescriptor *desc=NULL) |
WallpaperDescriptor * | editedImage () |
void | setBackground (WallpaperITrans *landscapeITrans, WallpaperITrans *portraitITrans, WallpaperDescriptor *desc=0) |
The logic which handling the loading/saving and management work for wallpaper settings applet
QList< WallpaperDescriptor * > WallpaperBusinessLogic::availableWallpapers | ( | ) | const |
Returns a list wallpaper descriptors with the available wallpapers. The current wallpaper is the first element of the available wallpapers.
FIXME: This function needs some polishing.
WallpaperDescriptor * WallpaperBusinessLogic::editedImage | ( | ) |
Returns the wallpaper that is being edited.
void WallpaperBusinessLogic::setBackground | ( | WallpaperITrans * | landscapeITrans, | |
WallpaperITrans * | portraitITrans, | |||
WallpaperDescriptor * | desc = 0 | |||
) |
landscapeITrans | Image transformations for the landscape orientation. | |
portraitITrans | Image transformations for the portrait orientation. | |
desc | The image descriptor that holds the image(s). |
A high level method to set the current wallpaper. This method will load the image file(s), apply the image transformations to create the portrait and landscape variants then will save the modified images and set them as wallpaper image(s). This method will also save some metadata that makes it possible to re-edit the images using the image transformations as default values for the image editor widget.
void WallpaperBusinessLogic::setEditedImage | ( | WallpaperDescriptor * | desc, | |
bool | ours = false | |||
) |
ours | if true the descriptor will be destroyed when not needed any more |
While a wallpaper image is edited the WallpaperBusinessLogic holds a descriptor on it. This function is used to set this wallpaper descriptor.