00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef WALLPAPERCURRENTDESCRIPTOR_H
00020 #define WALLPAPERCURRENTDESCRIPTOR_H
00021
00022 #include <meegocontrolexport.h>
00023 #include "wallpaperdescriptor.h"
00024 #include "wallpaperitrans.h"
00025
00026 class MDesktopEntry;
00027
00035 class MC_EXPORT WallpaperCurrentDescriptor : public WallpaperDescriptor {
00036 Q_OBJECT
00037
00038 public:
00039 ~WallpaperCurrentDescriptor ();
00040
00041 static WallpaperCurrentDescriptor *instance ();
00042
00043 virtual bool isCurrent () const;
00044 virtual int version () const;
00045 virtual QPixmap originalPixmap (M::Orientation orientation) const;
00046 virtual bool valid () const;
00047
00048 QString editedFilename (M::Orientation orientation) const;
00049
00050 bool setFromDesktopFile (
00051 const QString &desktopFileName,
00052 bool checkFilenames = false,
00053 const QString &landscapeFileName = QString(""),
00054 const QString &portraitFileName = QString(""));
00055
00056 bool setFromFilenames (
00057 QString landscapeFile,
00058 QString portraitFile);
00059
00060 bool setFromIDs (
00061 QString landscapeID,
00062 QString portraitID);
00063
00064 WallpaperITrans iTrans (M::Orientation orientation) const;
00065
00066 protected:
00067 WallpaperCurrentDescriptor ();
00068
00069 private:
00070 bool getValue (
00071 const QString &group,
00072 const QString &key,
00073 QString &value);
00074
00075 bool getValue (
00076 const QString &group,
00077 WallpaperITrans &value);
00078
00079 bool getValue (
00080 const QString &group,
00081 const QString &key,
00082 qreal *value);
00083
00084 private:
00085 static WallpaperCurrentDescriptor *sm_Instance;
00086
00087 bool m_Valid;
00088 MDesktopEntry *m_DesktopEntry;
00089 WallpaperITrans m_LandscapeTrans;
00090 WallpaperITrans m_PortraitTrans;
00091 int m_Version;
00092 #ifdef UNIT_TEST
00093 friend class Ut_WallpaperCurrentDescriptor;
00094 #endif
00095 };
00096
00097 #endif