camerauis/cameraapp/generic/common/inc/mcamsettingsmodel.h
branchRCL_3
changeset 54 bac7acad7cb3
equal deleted inserted replaced
53:61bc0f252b2b 54:bac7acad7cb3
       
     1 /*
       
     2 * Copyright (c) 2007 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:  Interface to object that manages all settings data.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef MCAMSETTINGSMODEL_H
       
    21 #define MCAMSETTINGSMODEL_H
       
    22 
       
    23 // ===========================================================================
       
    24 // INCLUDES
       
    25 #include <aknview.h>
       
    26  
       
    27 #include "CamSettings.hrh"
       
    28 #include "CamSettingsInternal.hrh"
       
    29 
       
    30 // ===========================================================================
       
    31 // CONSTANTS
       
    32 
       
    33 // ===========================================================================
       
    34 // FORWARD DECLARATIONS
       
    35 class CCamVideoQualityLevel;
       
    36 class MCamSettingsModelObserver;
       
    37 
       
    38 
       
    39 // ===========================================================================
       
    40 // STRUCTURES
       
    41 class TIntSetting
       
    42   {
       
    43   public:
       
    44     TInt iItemId;
       
    45     TInt iValueId;
       
    46   };
       
    47 
       
    48 class TSceneData 
       
    49   {
       
    50   public: // Destructor
       
    51     ~TSceneData ();
       
    52   
       
    53   public: // Data
       
    54     TInt iSceneId;
       
    55     RPointerArray<TIntSetting> iSettings;
       
    56   };
       
    57 
       
    58 class TCamVariantInfo
       
    59   {
       
    60   public:
       
    61     TCamVariantInfo();
       
    62 
       
    63   public:
       
    64     
       
    65     TInt            iFlags;
       
    66     TCamSupportFlag iTimeLapseSupport;
       
    67     TCamSupportFlag iAlwaysOnSupport;
       
    68     TVersion        iVersion;
       
    69   };
       
    70 
       
    71 // ===========================================================================
       
    72 // CLASS DECLARATION
       
    73 
       
    74 /**
       
    75 * Interface to object that manages all settings data.
       
    76 * @since 2.8
       
    77 */
       
    78 class MCamSettingsModel
       
    79   {
       
    80   public: // Interface
       
    81 
       
    82     /**
       
    83     * This needs to be here to be able to greacefully delete
       
    84     * an object of inherited class through mixin pointer.
       
    85     * If this is not defined, deleting through the mixin pointer
       
    86     * results in User-42 panic!
       
    87     */
       
    88     virtual ~MCamSettingsModel() {};
       
    89     
       
    90     /**
       
    91     * Add a settings model observer.
       
    92     * Observers will be notified of settings changes.
       
    93     */
       
    94     virtual void AttachObserverL( const MCamSettingsModelObserver* aObserver ) = 0;
       
    95 
       
    96     /**
       
    97     * Remove a settings model observer.
       
    98     */
       
    99     virtual void DetachObserver( const MCamSettingsModelObserver* aObserver ) = 0;
       
   100    
       
   101     /**
       
   102     * Resets all user scene settings to their defaults.
       
   103     * @since 2.8
       
   104     */
       
   105     virtual void ResetUserSceneL() = 0;
       
   106         
       
   107     /**
       
   108     * Previews a new value for the specified integer setting
       
   109     * @param aSettingItem specifies which setting item that want to preview the value of.
       
   110     * @param aSettingValue the new integer value for the specified setting item to be previewed.
       
   111     * @since 2.8
       
   112     */
       
   113 //    virtual void PreviewSettingChangeL( TInt aSettingItem, TInt aSettingValue ) = 0;
       
   114     
       
   115     /**
       
   116     * Cancels all preview changes, since last commit/cancel.
       
   117     * @since 2.8
       
   118     */
       
   119 //    virtual void CancelPreviewChangesL() = 0;
       
   120     
       
   121     /**
       
   122     * Commits last preview change.
       
   123     * @since 2.8
       
   124     */
       
   125 //    virtual void CommitPreviewChanges() = 0;
       
   126     
       
   127     /**
       
   128     * Returns the current integer value for the specified setting
       
   129     * @return the current integer setting value
       
   130     * @param aSettingItem specifies which setting item that want the value of.
       
   131     * @since 2.8
       
   132     */
       
   133     virtual TInt IntegerSettingValue( TInt aSettingItem ) const = 0; 
       
   134     
       
   135     /**
       
   136     * Returns the setting value for a specific field of a scene 
       
   137     * @return the setting value
       
   138     * @param aSceneId specifies which scene.
       
   139     * @param aSceneId specifies which field of the scene.
       
   140     * @since 2.8
       
   141     */
       
   142     virtual TInt SceneSettingValue( TInt aSceneId, TInt aSceneField ) const = 0; 
       
   143 
       
   144     /**
       
   145     * Sets a new value for the specified integer setting
       
   146     * @param aSettingItem specifies which setting item that want to set the value of.
       
   147     * @param aSettingValue the new integer value for the specified setting item.
       
   148     * @since 2.8
       
   149     */
       
   150     virtual void SetIntegerSettingValueL( TInt aSettingItem, TInt aSettingValue ) = 0; 
       
   151 
       
   152     /**
       
   153     * Sets a new text value for the specified setting
       
   154     * @param aSettingItem specifies which setting item that want to set the text value of.
       
   155     * @param aSettingValue the new text value for the specified setting item.
       
   156     * @since 2.8
       
   157     */
       
   158     virtual void SetTextSettingValueL(       TInt aSettingItem, 
       
   159                                        const TDesC& aSettingValue ) = 0; 
       
   160     
       
   161     /**
       
   162     * Returns the current text value for the specified setting
       
   163     * @return the current text setting value
       
   164     * @param aSettingItem specifies which setting item that want the text value of.
       
   165     * @since 2.8
       
   166     */
       
   167     virtual TPtrC TextSettingValue( TInt aSettingItem ) const = 0; 
       
   168 
       
   169     /**
       
   170     * Returns whether a particular setting value can be set or not.
       
   171     * @return ETrue if can be set. Otherwise, EFalse.
       
   172     * @param aSettingValue the value in question. 
       
   173     * @param aSettingItem the setting item in question. 
       
   174     * @since 2.8
       
   175     */
       
   176     virtual TBool SettingValueEnabled( TInt aSettingItem, 
       
   177                                        TInt aSettingValue ) const = 0;
       
   178 
       
   179     /**
       
   180     * Get the default value for a setting item.
       
   181     * @param  aSettingId The id of the setting.
       
   182     * @return The default value for setting item or KErrNotFound if not found.
       
   183     */
       
   184     virtual TInt DynamicSettingDefaultValue( TInt aSettingId ) const = 0;
       
   185     
       
   186     /**
       
   187     * Sets all dynamic settings to their defaults.
       
   188     * @since 2.8
       
   189     */       
       
   190     virtual void SetDynamicSettingsToDefaults() = 0;
       
   191     
       
   192     /**
       
   193     * Sets a single dynamic setting to its default.
       
   194     * @since 2.8
       
   195     */       
       
   196     virtual void SetDynamicSettingToDefault(TInt aSettingItem) = 0;
       
   197 
       
   198     /**
       
   199     * Sets a single dynamic setting to scene default value.
       
   200     * @param  aSceneId    Scene which the default value is taken from.
       
   201     * @param  aSceneField Id of the setting in scene data.
       
   202     * @param  aSettingId  Id of the setting in dynamic settings.
       
   203     * @param  aVideoScene Is the scene a video scene.
       
   204     * @return KErrNotFound, if setting could not be set.
       
   205     */
       
   206     virtual TInt SetDynamicSettingToSceneDefaultL( TInt  aSceneId,
       
   207                                                    TInt  aSceneField,
       
   208                                                    TInt  aSettingId,
       
   209                                                    TBool aVideoScene ) = 0;
       
   210 
       
   211     /**
       
   212     * Loads the static settings from shared data. Required to update
       
   213     * the settings whenever get foreground event, in case of external
       
   214     * changes to the settings.
       
   215     * @since 2.8
       
   216     * @param aIsEmbedded Specifies whether the application is embedded
       
   217     * or not.
       
   218     */       
       
   219     virtual void LoadStaticSettingsL( TBool aIsEmbedded ) = 0;
       
   220 
       
   221     /**
       
   222     * Return handle to video quality level array
       
   223     * @since 2.8
       
   224     * @return reference to array of video quality levels
       
   225     */
       
   226     virtual const RPointerArray<CCamVideoQualityLevel>& VideoQualityArray() = 0;
       
   227 
       
   228     /**
       
   229     * Return handle to video resolution array
       
   230     * @since 2.8
       
   231     * @param return reference to array of video resolutions
       
   232     */
       
   233     virtual const RArray<TSize>& VideoResolutions() = 0;
       
   234 
       
   235     /** 
       
   236     * Returns the image resolution for a given resolution index.
       
   237     * @since 2.8
       
   238     * @param aIndex The index to get the resolution for
       
   239     * @returns The X and Y dimensions in pixels of the resolution.
       
   240     */
       
   241     virtual TSize ImageResolutionFromIndex( TCamPhotoSizeId aIndex ) = 0;
       
   242 
       
   243     /**
       
   244     * Returns the current photo quality.
       
   245     * @return the quality.
       
   246     * @since 2.8
       
   247     */
       
   248     virtual TInt CurrentPhotoCompression() const = 0;
       
   249 
       
   250     /**
       
   251     * Returns the current photo resolution from Settings
       
   252     * @return the resolution.
       
   253     * @since 2.8
       
   254     */
       
   255     virtual TCamPhotoSizeId CurrentPhotoResolution() const = 0;
       
   256 
       
   257     /**
       
   258     * Returns the photo resolution for a particular quality
       
   259     * @return the resolution.
       
   260     * @param aQualityIndex The index of the quality
       
   261     * @since 3.0
       
   262     */
       
   263     virtual TCamPhotoSizeId PhotoResolution( TInt aQualityIndex ) const = 0;
       
   264 
       
   265     /**
       
   266     * Stores the primary camera settings when changing to secondary camera
       
   267     * that they can be reapplied when changing back
       
   268     * @since 2.8
       
   269     */
       
   270     virtual void StorePrimaryCameraSettingsL() = 0;
       
   271 
       
   272     /**
       
   273     * Restores the primary camera settings 
       
   274     * @since 2.8
       
   275     */
       
   276     virtual void RestorePrimaryCameraSettingsL() = 0;
       
   277 
       
   278     /**
       
   279     * Return variant info.
       
   280     */
       
   281     virtual const TCamVariantInfo& VariantInfo() = 0;
       
   282 
       
   283     /*
       
   284     * Reset repository file
       
   285     * @since3.0
       
   286     */
       
   287     virtual void ResetRepository() = 0;
       
   288     
       
   289 	/**
       
   290     * Store FT user defined setting
       
   291     * @since 5.0
       
   292     */
       
   293     virtual void StoreFaceTrackingValue() = 0;
       
   294     
       
   295     /**
       
   296     * Returns the face tracking state as it was before the latest scene mode change
       
   297     */     
       
   298     virtual TCamSettingsOnOff GetPreviousFaceTrack() = 0;
       
   299     
       
   300     /**
       
   301     * Sets the face tracking state as it was before the latest scene mode change
       
   302     */       
       
   303     virtual void SetPreviousFaceTrack( TCamSettingsOnOff aPreviousFaceTrack ) = 0;
       
   304   
       
   305     /**
       
   306     * Returns the scene mode that was in use before the current scene mode was selected
       
   307     */       
       
   308     virtual TCamSceneId GetPreviousSceneMode() = 0;
       
   309     /**
       
   310     * Sets the scene mode that was in use before the current scene mode was selected
       
   311     */         
       
   312     virtual void SetPreviousSceneMode( TCamSceneId aPreviousSceneMode ) = 0;
       
   313     
       
   314     /**
       
   315     * Sets user scene setting to default
       
   316     */
       
   317     virtual void SetUserSceneDefault() = 0;
       
   318     
       
   319     /**
       
   320     * Handles a change in the value for the photo scene setting.
       
   321     * That is, it updates the rest of the photo dynamic setings.
       
   322     * @param the new scene value.
       
   323     * @since 2.8
       
   324     */
       
   325     virtual void PhotoSceneHasChangedL( TInt aSettingValue ) = 0;
       
   326     
       
   327     /**
       
   328     * Store UserScene settings
       
   329     * @since 5.1
       
   330     */
       
   331     virtual void StoreUserSceneSettingsL() = 0;
       
   332   };
       
   333 // ===========================================================================
       
   334 
       
   335 #endif // MCAMSETTINGSMODEL_H
       
   336 
       
   337 // End of File