Public Member Functions | Static Public Member Functions | Protected Member Functions

WallpaperCurrentDescriptor Class Reference

#include <wallpapercurrentdescriptor.h>

Inheritance diagram for WallpaperCurrentDescriptor:
WallpaperDescriptor

List of all members.

Public Member Functions

 ~WallpaperCurrentDescriptor ()
virtual bool isCurrent () const
virtual int version () const
virtual QPixmap originalPixmap (M::Orientation orientation) const
virtual bool valid () const
QString editedFilename (M::Orientation orientation) const
bool setFromDesktopFile (const QString &desktopFileName, bool checkFilenames=false, const QString &landscapeFileName=QString(""), const QString &portraitFileName=QString(""))
bool setFromFilenames (QString landscapeFile, QString portraitFile)
bool setFromIDs (QString landscapeID, QString portraitID)
WallpaperITrans iTrans (M::Orientation orientation) const

Static Public Member Functions

static WallpaperCurrentDescriptorinstance ()

Protected Member Functions

 WallpaperCurrentDescriptor ()

Detailed Description

A class that represents the current wallpaper. Holds information about the modifications the user made and about the saved files created from the original image by implementing the modifications.

This class is also a singleton; there can be only one current wallpaper.


Constructor & Destructor Documentation

WallpaperCurrentDescriptor::~WallpaperCurrentDescriptor (  ) 

The destructor of the WallpaperCurrentDescriptor

WallpaperCurrentDescriptor::WallpaperCurrentDescriptor (  )  [protected]

The default constuctor implementation for the WallpaperCurrentDescriptor


Member Function Documentation

QString WallpaperCurrentDescriptor::editedFilename ( M::Orientation  orientation  )  const

Returns the filenames used when the images was last time saved. These properties are stored in the desktop file.

WallpaperCurrentDescriptor * WallpaperCurrentDescriptor::instance (  )  [static]
Returns:
the current wallpaper instance (as only one can be the current)
bool WallpaperCurrentDescriptor::isCurrent (  )  const [virtual]

For this class it is always the current wallpaper.

Reimplemented from WallpaperDescriptor.

WallpaperITrans WallpaperCurrentDescriptor::iTrans ( M::Orientation  orientation  )  const
Returns:
The image transformations for the given orientation. The wanted orientation
QPixmap WallpaperCurrentDescriptor::originalPixmap ( M::Orientation  orientation  )  const [virtual]
Returns:
the original pixmap of the current wallpaper
Parameters:
orientation whether which orientation is wanted

FIXME: handle the difference between the original image and the modified image in the WallpaperDescriptor?

bool WallpaperCurrentDescriptor::setFromDesktopFile ( const QString &  desktopFileName,
bool  checkFilenames = false,
const QString &  landscapeFileName = QString(""),
const QString &  portraitFileName = QString("") 
)
Parameters:
desktopFileName The full path of the desktop file to read
landscapeFileName If provided the method will report failure when the desktop file contains a different file name.
portraitFileName If provided the method will report failure when the desktop file contains a different file name.

Reads the data stored in a desktop wile and initializes the object using the data found there.

bool WallpaperCurrentDescriptor::setFromFilenames ( QString  landscapeFile,
QString  portraitFile 
)

Method for initialize the current-wallpaper-descriptor from filenames

Parameters:
landscapeFile The landscape wallpaper file-name
portraitFile The portrait wallpaper file-name
bool WallpaperCurrentDescriptor::setFromIDs ( QString  landscapeID,
QString  portraitID 
)

Method for initializing the current wallpaper descriptor from theme ids

Parameters:
landscapeID The theme-image-id for the landscape wallpaper
portraitID The theme-image-id for the portrait wallpaper
bool WallpaperCurrentDescriptor::valid (  )  const [virtual]
Returns:
true if the object is properly initialized

Currently this function will return true only if the object is initialized from the desktop file. FIXME: Need to enhance to handle the gconf keys!

Reimplemented from WallpaperDescriptor.

int WallpaperCurrentDescriptor::version (  )  const [virtual]
Returns:
The version number of the wallpaper.

In order to guaranty that the image file is always created by a new name (so that the gconf entry change can be recognized) the current wallpaper always have a version number stored in the desktop file.

Reimplemented from WallpaperDescriptor.


The documentation for this class was generated from the following files: