camerauis/cameraapp/generic/camerauiconfigmanager/inc/CameraUiConfigManagerImp.h
branchRCL_3
changeset 24 bac7acad7cb3
parent 0 1ddebce53859
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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:  Helper class which handles reading and storing the cr keys 
       
    15  *                and its values.
       
    16  *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CAMERAUICONFIGMANAGERIMP_H
       
    21 #define CAMERAUICONFIGMANAGERIMP_H
       
    22 
       
    23 // INCLUDES
       
    24 
       
    25 #include <eikenv.h>
       
    26 #include "CameraUiConfigManager.h"
       
    27 #include "CameraDynamicSettings.hrh"
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class TDynamicConfigSettingsData;
       
    31 class CRepository;
       
    32 
       
    33 
       
    34 // Class declaration
       
    35 class TDynamicSettingsData
       
    36     {
       
    37     public:
       
    38         TBuf<256> iText;
       
    39         TInt iItemId; // enum value converted to TInt
       
    40     };
       
    41 
       
    42 
       
    43 class TSupportedSettingsData
       
    44     {
       
    45     public:
       
    46         TInt    iSettingId;
       
    47         TInt    iSupportedValue;
       
    48         RArray<TInt> iSupportedSettingItems;
       
    49     };
       
    50 
       
    51 /**
       
    52 * Helper class which handles the Cr keys
       
    53 */
       
    54 class CCameraUiConfigManagerImp : public CCameraUiConfigManager
       
    55   {
       
    56   // =========================================================================
       
    57   public: // Constructors and destructor
       
    58   
       
    59         /**
       
    60         * Symbian two-phased constructor.
       
    61         * @since 2.8
       
    62         * @param aConfiguration    
       
    63         * engine changes.
       
    64         */
       
    65         static CCameraUiConfigManagerImp* NewLC();
       
    66       
       
    67         /**
       
    68         * Symbian two-phased constructor.
       
    69         * @since 2.8
       
    70         * @param aConfiguration    
       
    71         * engine changes.
       
    72         */
       
    73         static CCameraUiConfigManagerImp* NewL();
       
    74       
       
    75         /**
       
    76         * Destructor.
       
    77         */
       
    78         ~CCameraUiConfigManagerImp();
       
    79     
       
    80  public:
       
    81         
       
    82         /*
       
    83         * To check if a particular feature is supported and/or in somecase
       
    84         * used to return the configured setting for e.g. camera capture key
       
    85         */
       
    86         TInt IsFeatureSupported( const TCamDynamicSettings aSettingId ) const;
       
    87         
       
    88         /*
       
    89         *  To get all supported color tone setting items
       
    90         */
       
    91         void SupportedSettingItemsL( const TCamDynamicSettings aSettingId,
       
    92                                      RArray<TInt>& aSupportedValues );
       
    93         
       
    94         /*
       
    95         * Organizing CenRep data to a definite structure for scene modes.
       
    96         */
       
    97         void OrganiseSceneSettings( RArray<TSceneSettings>& aTargetArray,
       
    98                                     RArray<TInt>& aSceneSettingsArray,
       
    99                                     const TBool aPhotoScene );
       
   100         
       
   101  private:
       
   102         
       
   103         /*
       
   104         * To get the setting item id, based on string comparison
       
   105         */
       
   106         TInt SettingItemId( RArray<TDynamicSettingsData>& aPossibleSettings,
       
   107                             const TDesC& aItemString ) const;
       
   108 
       
   109         /*
       
   110         * Gets the string value from Cr key
       
   111         */
       
   112         HBufC* GetStringDataL( const TUint32 aCrKey );
       
   113         
       
   114         /*
       
   115         * Gets all supported items by mapping the item id's based on the configured
       
   116         * items in the cr key
       
   117         */
       
   118         void GetSupportedSettingIdsL( RArray<TDynamicSettingsData>& aAllItems,
       
   119                                       RArray<TInt>& aSupportedValues, 
       
   120                                       const TUint32 crKey );
       
   121         
       
   122         /*
       
   123         * Load all default setting items supported from the UI defined in the resource
       
   124         */
       
   125         void LoadDefaultSettingsDataL( const TInt aSettingItem,
       
   126                                        RArray<TDynamicSettingsData>& aDefaultItems );
       
   127         
       
   128         /*
       
   129         * Load all the dynamic setting values from cenrep
       
   130         */
       
   131         void LoadAllDynamicSettingsL();
       
   132         
       
   133         /*
       
   134         * Append all the dynamic settings to the array
       
   135         */
       
   136         void AppendToSettingsArrayL( const TInt aItemId,
       
   137                                      const TInt aFeatureSupported,
       
   138                                      RArray<TDynamicSettingsData>& aAllItems,
       
   139                                      TUint32 aCrItemsKey = 0,
       
   140                                      TBool loadSettingItems = 0 );
       
   141         
       
   142         /*
       
   143         * Search for setting item dynamic settings array
       
   144         */                             
       
   145         TInt SearchInSettingsListFor( 
       
   146                         const RPointerArray<TSupportedSettingsData>& aSettingsList, 
       
   147                         TInt                        aSettingItem  ) const;
       
   148         
       
   149         /*
       
   150         * Map setting item to corresponding "Feature" Cr key 
       
   151         */
       
   152         TUint32 MapSettingItemToCrFeatureKeyL( const TInt aSettingItem ) const;
       
   153         
       
   154         
       
   155         /*
       
   156         * Map setting item to configured setting "values" Cr key
       
   157         */
       
   158         TUint32 MapSettingItemToCrItemsKeyL( const TInt aSettingItem ) const;
       
   159         
       
   160         /*
       
   161         * Load all configured settings from CenRep
       
   162         */
       
   163         void LoadConfiguredSettingItemValuesFromCrL(
       
   164                                const TInt aSettingId,
       
   165                                const TInt aFeatureSupported,
       
   166                                RArray<TDynamicSettingsData>& aSettingItemDefaultData );
       
   167         
       
   168         /*
       
   169         * LoadCrForFeatureSupport
       
   170         */
       
   171         TBool LoadCrForFeatureSupport( const TInt aSettingId ) const;
       
   172         
       
   173         /*
       
   174         * Load corresponding setting item enumeration array
       
   175         */
       
   176         const TInt* LoadSettingEnumerationArray( const TInt aSettingItem );
       
   177         
       
   178         /*
       
   179         * Load corresponding setting item string array
       
   180         */
       
   181         const TUint16* const* LoadSettingStringArray( const TInt aSettingItem );
       
   182       
       
   183  private:
       
   184 
       
   185     /**
       
   186      * Actual constructor where the reading from the Central Repository
       
   187      * happens
       
   188      */
       
   189     void ConstructL();
       
   190           
       
   191  private:
       
   192     // we own
       
   193     CRepository* iRepository;
       
   194     RPointerArray<TSupportedSettingsData> iSupportedSettings;
       
   195 };
       
   196 
       
   197 #endif // CameraUiConfigManagerImp_H
       
   198 
       
   199 // End of File