• Main Page
  • Classes
  • Files
  • File List

/home/bifh8/cs2009q3-i386/work/meegotouch-controlpanelapplets-0.20.61/src/wallpaperapplet/wallpapercurrentdescriptor.h

00001 /****************************************************************************
00002 **
00003 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
00004 ** All rights reserved.
00005 ** Contact: Nokia Corporation (directui@nokia.com)
00006 **
00007 ** This file is part of meegotouch-controlpanelapplets.
00008 **
00009 ** If you have questions regarding the use of this file, please contact
00010 ** Nokia at directui@nokia.com.
00011 **
00012 ** This library is free software; you can redistribute it and/or
00013 ** modify it under the terms of the GNU Lesser General Public
00014 ** License version 2.1 as published by the Free Software Foundation
00015 ** and appearing in the file LICENSE.LGPL included in the packaging
00016 ** of this file.
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

Generated on Mon Jul 11 2011 12:00:31 for libMeegoControl by  doxygen 1.7.1