photosgallery/common/inc/glxsettingsmodel.h
branchRCL_3
changeset 60 5b3385a43d68
parent 0 4e91876724a2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/photosgallery/common/inc/glxsettingsmodel.h	Wed Sep 01 12:33:26 2010 +0100
@@ -0,0 +1,143 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    MC Photos settings model
+ *
+*/
+
+
+
+
+
+#ifndef _GLXSETTINGSMDL_H_
+#define _GLXSETTINGSMDL_H_
+
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+
+class CRepository;
+
+// CONSTANTS
+// LOCAL CONSTANTS NAMESPACE
+namespace
+	{
+	// CenRep Key Ids
+    const TUint32 KGlxSortOrderTagManager 	= 0x00000001;
+    const TUint32 KGlxSortOrderTagBrowser 	= 0x00000002;
+    const TUint32 KGlxIconHiddenState       = 0x00000003;
+    const TUint32 KGlxDefaultOrientation    = 0x00000004;
+    const TUint32 KGlxDownloadLink          = 0x00000005;
+    const TUint32 KGlxDownloadLinkIcon      = 0x00000006;
+    const TUint32 KGlxDownloadLinkText      = 0x00000007; 
+    const TUint32 KGlxShowGeoCoordinates    = 0x00000008; 
+	}
+
+// CLASS DECLARATION
+
+/**
+ * GlxSettingsModel class 
+ * 
+ */
+NONSHARABLE_CLASS( CGlxSettingsModel ) : public CBase
+    {
+    public:
+        /**
+        * Possible values for the "supported orientations" CR key.
+        */
+        enum TSupportedOrientations
+            {
+            ELandscapeAndPortrait = 1,
+            ELandscape = 2
+            };
+
+    public:
+        /**
+        * Get singleton instance of the settings model.
+        */ 
+        IMPORT_C static CGlxSettingsModel* InstanceL();
+        /**
+        * Release instance of the settings model.
+        */ 
+        IMPORT_C void Close();
+        /**
+        * Destructor.
+        */ 
+        ~CGlxSettingsModel();
+
+        /**
+        * Get the supported screen orientations for the application.
+        */
+        IMPORT_C TSupportedOrientations SupportedOrientations();
+        /**
+        * Does screen orientation change to portrait for text entry?
+        */
+        IMPORT_C TBool IsTextEntryPortrait();
+        /**
+        * Is "view in portrait/landscape" available in the toolbar?
+        */
+        IMPORT_C TBool ShowRotateInToolbar();
+        /**
+        * Is slideshow available in the toolbar?
+        */
+        IMPORT_C TBool ShowSlideshowInToolbar();
+
+        /**
+        * Should geocoordinates be shown in display?
+        */
+        IMPORT_C TBool ShowGeoCoordinatesInDisplay();
+
+        /**
+         * DEPRECATED - Introduce a new function instead of using this for more things
+         * Retrieves the settings value for the attribute identifier
+         * @param aSettingsId the identity of the setting
+         * @return The setting value
+         */
+        template <typename T>
+        /* Deprecated */ static inline T ValueL(const TUint32& aSettingsId);
+        
+    
+        /**
+         * DEPRECATED - Introduce a new function instead of using this for more things
+         * Persist the value of a gallery setting. 
+         * @param aSettingsId The settings identifier for which the value is 
+         *          persisted
+         * @param aValue The value that is written
+         */
+        template<typename T> 
+        /* Deprecated */ static inline void SetValueL(const TUint32& aSettingsId, T aValue);
+
+    private:
+        /**
+        * Two phase constructor.
+        */ 
+        static CGlxSettingsModel* NewL();
+        /**
+        * Default constructor.
+        */ 
+        CGlxSettingsModel();
+        /**
+        * 2nd phase constructor.
+        */ 
+        void ConstructL();
+
+    private:
+        /** Whether feature manager was successfully initialised */
+        TBool iFeatureManagerInitialised;
+        /** Central repository for reading settings */
+        CRepository* iRepository;
+    };
+
+#include "glxsettingsmodel.inl"    
+
+#endif // _GLXSETTINGSMDL_H_