diff -r 61bc0f252b2b -r bac7acad7cb3 camerauis/cameraapp/generic/camerauiconfigmanager/inc/CameraUiConfigManagerImp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/camerauiconfigmanager/inc/CameraUiConfigManagerImp.h Wed Sep 01 12:30:54 2010 +0100 @@ -0,0 +1,199 @@ +/* +* Copyright (c) 2007-2008 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: Helper class which handles reading and storing the cr keys + * and its values. + * +*/ + + +#ifndef CAMERAUICONFIGMANAGERIMP_H +#define CAMERAUICONFIGMANAGERIMP_H + +// INCLUDES + +#include +#include "CameraUiConfigManager.h" +#include "CameraDynamicSettings.hrh" + +// FORWARD DECLARATIONS +class TDynamicConfigSettingsData; +class CRepository; + + +// Class declaration +class TDynamicSettingsData + { + public: + TBuf<256> iText; + TInt iItemId; // enum value converted to TInt + }; + + +class TSupportedSettingsData + { + public: + TInt iSettingId; + TInt iSupportedValue; + RArray iSupportedSettingItems; + }; + +/** +* Helper class which handles the Cr keys +*/ +class CCameraUiConfigManagerImp : public CCameraUiConfigManager + { + // ========================================================================= + public: // Constructors and destructor + + /** + * Symbian two-phased constructor. + * @since 2.8 + * @param aConfiguration + * engine changes. + */ + static CCameraUiConfigManagerImp* NewLC(); + + /** + * Symbian two-phased constructor. + * @since 2.8 + * @param aConfiguration + * engine changes. + */ + static CCameraUiConfigManagerImp* NewL(); + + /** + * Destructor. + */ + ~CCameraUiConfigManagerImp(); + + public: + + /* + * To check if a particular feature is supported and/or in somecase + * used to return the configured setting for e.g. camera capture key + */ + TInt IsFeatureSupported( const TCamDynamicSettings aSettingId ) const; + + /* + * To get all supported color tone setting items + */ + void SupportedSettingItemsL( const TCamDynamicSettings aSettingId, + RArray& aSupportedValues ); + + /* + * Organizing CenRep data to a definite structure for scene modes. + */ + void OrganiseSceneSettings( RArray& aTargetArray, + RArray& aSceneSettingsArray, + const TBool aPhotoScene ); + + private: + + /* + * To get the setting item id, based on string comparison + */ + TInt SettingItemId( RArray& aPossibleSettings, + const TDesC& aItemString ) const; + + /* + * Gets the string value from Cr key + */ + HBufC* GetStringDataL( const TUint32 aCrKey ); + + /* + * Gets all supported items by mapping the item id's based on the configured + * items in the cr key + */ + void GetSupportedSettingIdsL( RArray& aAllItems, + RArray& aSupportedValues, + const TUint32 crKey ); + + /* + * Load all default setting items supported from the UI defined in the resource + */ + void LoadDefaultSettingsDataL( const TInt aSettingItem, + RArray& aDefaultItems ); + + /* + * Load all the dynamic setting values from cenrep + */ + void LoadAllDynamicSettingsL(); + + /* + * Append all the dynamic settings to the array + */ + void AppendToSettingsArrayL( const TInt aItemId, + const TInt aFeatureSupported, + RArray& aAllItems, + TUint32 aCrItemsKey = 0, + TBool loadSettingItems = 0 ); + + /* + * Search for setting item dynamic settings array + */ + TInt SearchInSettingsListFor( + const RPointerArray& aSettingsList, + TInt aSettingItem ) const; + + /* + * Map setting item to corresponding "Feature" Cr key + */ + TUint32 MapSettingItemToCrFeatureKeyL( const TInt aSettingItem ) const; + + + /* + * Map setting item to configured setting "values" Cr key + */ + TUint32 MapSettingItemToCrItemsKeyL( const TInt aSettingItem ) const; + + /* + * Load all configured settings from CenRep + */ + void LoadConfiguredSettingItemValuesFromCrL( + const TInt aSettingId, + const TInt aFeatureSupported, + RArray& aSettingItemDefaultData ); + + /* + * LoadCrForFeatureSupport + */ + TBool LoadCrForFeatureSupport( const TInt aSettingId ) const; + + /* + * Load corresponding setting item enumeration array + */ + const TInt* LoadSettingEnumerationArray( const TInt aSettingItem ); + + /* + * Load corresponding setting item string array + */ + const TUint16* const* LoadSettingStringArray( const TInt aSettingItem ); + + private: + + /** + * Actual constructor where the reading from the Central Repository + * happens + */ + void ConstructL(); + + private: + // we own + CRepository* iRepository; + RPointerArray iSupportedSettings; +}; + +#endif // CameraUiConfigManagerImp_H + +// End of File