photosgallery/common/inc/glxsettingsmodel.h
changeset 0 4e91876724a2
equal deleted inserted replaced
-1:000000000000 0:4e91876724a2
       
     1 /*
       
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:    MC Photos settings model
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #ifndef _GLXSETTINGSMDL_H_
       
    23 #define _GLXSETTINGSMDL_H_
       
    24 
       
    25 #include <e32base.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 
       
    29 class CRepository;
       
    30 
       
    31 // CONSTANTS
       
    32 // LOCAL CONSTANTS NAMESPACE
       
    33 namespace
       
    34 	{
       
    35 	// CenRep Key Ids
       
    36     const TUint32 KGlxSortOrderTagManager 	= 0x00000001;
       
    37     const TUint32 KGlxSortOrderTagBrowser 	= 0x00000002;
       
    38     const TUint32 KGlxIconHiddenState       = 0x00000003;
       
    39     const TUint32 KGlxDefaultOrientation    = 0x00000004;
       
    40     const TUint32 KGlxDownloadLink          = 0x00000005;
       
    41     const TUint32 KGlxDownloadLinkIcon      = 0x00000006;
       
    42     const TUint32 KGlxDownloadLinkText      = 0x00000007; 
       
    43     const TUint32 KGlxShowGeoCoordinates    = 0x00000008; 
       
    44 	}
       
    45 
       
    46 // CLASS DECLARATION
       
    47 
       
    48 /**
       
    49  * GlxSettingsModel class 
       
    50  * 
       
    51  */
       
    52 NONSHARABLE_CLASS( CGlxSettingsModel ) : public CBase
       
    53     {
       
    54     public:
       
    55         /**
       
    56         * Possible values for the "supported orientations" CR key.
       
    57         */
       
    58         enum TSupportedOrientations
       
    59             {
       
    60             ELandscapeAndPortrait = 1,
       
    61             ELandscape = 2
       
    62             };
       
    63 
       
    64     public:
       
    65         /**
       
    66         * Get singleton instance of the settings model.
       
    67         */ 
       
    68         IMPORT_C static CGlxSettingsModel* InstanceL();
       
    69         /**
       
    70         * Release instance of the settings model.
       
    71         */ 
       
    72         IMPORT_C void Close();
       
    73         /**
       
    74         * Destructor.
       
    75         */ 
       
    76         ~CGlxSettingsModel();
       
    77 
       
    78         /**
       
    79         * Get the supported screen orientations for the application.
       
    80         */
       
    81         IMPORT_C TSupportedOrientations SupportedOrientations();
       
    82         /**
       
    83         * Does screen orientation change to portrait for text entry?
       
    84         */
       
    85         IMPORT_C TBool IsTextEntryPortrait();
       
    86         /**
       
    87         * Is "view in portrait/landscape" available in the toolbar?
       
    88         */
       
    89         IMPORT_C TBool ShowRotateInToolbar();
       
    90         /**
       
    91         * Is slideshow available in the toolbar?
       
    92         */
       
    93         IMPORT_C TBool ShowSlideshowInToolbar();
       
    94 
       
    95         /**
       
    96         * Should geocoordinates be shown in display?
       
    97         */
       
    98         IMPORT_C TBool ShowGeoCoordinatesInDisplay();
       
    99 
       
   100         /**
       
   101          * DEPRECATED - Introduce a new function instead of using this for more things
       
   102          * Retrieves the settings value for the attribute identifier
       
   103          * @param aSettingsId the identity of the setting
       
   104          * @return The setting value
       
   105          */
       
   106         template <typename T>
       
   107         /* Deprecated */ static inline T ValueL(const TUint32& aSettingsId);
       
   108         
       
   109     
       
   110         /**
       
   111          * DEPRECATED - Introduce a new function instead of using this for more things
       
   112          * Persist the value of a gallery setting. 
       
   113          * @param aSettingsId The settings identifier for which the value is 
       
   114          *          persisted
       
   115          * @param aValue The value that is written
       
   116          */
       
   117         template<typename T> 
       
   118         /* Deprecated */ static inline void SetValueL(const TUint32& aSettingsId, T aValue);
       
   119 
       
   120     private:
       
   121         /**
       
   122         * Two phase constructor.
       
   123         */ 
       
   124         static CGlxSettingsModel* NewL();
       
   125         /**
       
   126         * Default constructor.
       
   127         */ 
       
   128         CGlxSettingsModel();
       
   129         /**
       
   130         * 2nd phase constructor.
       
   131         */ 
       
   132         void ConstructL();
       
   133 
       
   134     private:
       
   135         /** Whether feature manager was successfully initialised */
       
   136         TBool iFeatureManagerInitialised;
       
   137         /** Central repository for reading settings */
       
   138         CRepository* iRepository;
       
   139     };
       
   140 
       
   141 #include "glxsettingsmodel.inl"    
       
   142 
       
   143 #endif // _GLXSETTINGSMDL_H_