camerauis/cameraapp/generic/inc/CamAppController.h
changeset 19 d9aefe59d544
parent 3 8b2d6d0384b0
child 21 fa6d9f75d6a6
child 28 3075d9b614e6
equal deleted inserted replaced
3:8b2d6d0384b0 19:d9aefe59d544
     1 /*
       
     2 * Copyright (c) 2007-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:  Class for managing intercommunication between Camcera UI*
       
    15 */
       
    16 
       
    17 
       
    18 #ifndef CAMAPPCONTROLLER_H
       
    19 #define CAMAPPCONTROLLER_H
       
    20 
       
    21 
       
    22 // ===========================================================================
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 
       
    26 #include <cflistener.h> // publish zoom state related
       
    27 #include <cfclient.h>
       
    28 
       
    29 #include <sensrvdatalistener.h>
       
    30 #include <sensrvchannel.h>
       
    31 #include <sensrvorientationsensor.h>
       
    32 
       
    33 #include "MCamAppController.h"
       
    34 #include "CamControllerObservers.h"
       
    35 #include "mcamsettingsmodelobserver.h"
       
    36 #include "CamSettings.hrh"
       
    37 #include "Cam.hrh"          // TCamSoundId
       
    38 #include "CamSettingsInternal.hrh"
       
    39 
       
    40 #include "mcamplayerobserver.h"
       
    41 
       
    42 #include "CamImageSaveActive.h"
       
    43 #include "CamCallStateAo.h"
       
    44 #include "CamObserver.h"
       
    45 #include "CamBurstModeObserver.h"
       
    46 #include "CamPerformance.h"
       
    47 
       
    48 #ifndef __WINSCW__
       
    49 #include <rlocationtrail.h>
       
    50 #endif
       
    51 
       
    52 #include "CamPropertyObserver.h"
       
    53 
       
    54 // <CAMERAAPP_CAPI_V2_MIGRATION>
       
    55 #include "mcamcameraobserver.h" 
       
    56 #include "camcamerarequests.h"
       
    57 #include "camfolderutility.h"
       
    58 #include "camcameracontroller.h"
       
    59 #include "CamDriveChangeNotifier.h"
       
    60 #include "CamSyncRotatorAo.h"
       
    61 
       
    62 
       
    63 // ===========================================================================
       
    64 // CONSTANTS
       
    65 
       
    66 // !Do not change the order of these without careful consideration!
       
    67 // 
       
    68 enum TCamCameraState
       
    69   {
       
    70   ECamCameraIdle          = 0,
       
    71   ECamCameraReserved      = 1 << 0,
       
    72   ECamCameraPowerOn       = 1 << 1,
       
    73   ECamCameraPreparedImage = 1 << 2,
       
    74   ECamCameraPreparedVideo = 1 << 3,
       
    75   ECamCameraStateLast // Not valid state, only marker
       
    76   };
       
    77 
       
    78 /**
       
    79 * Flags for ongoing operations
       
    80 */
       
    81 enum TCamBusyFlags
       
    82   {
       
    83   EBusyNone     = 0,
       
    84   EBusyRequest  = 1<<0,
       
    85   EBusySequence = 1<<1,
       
    86   EBusySetting  = 1<<2,
       
    87   EBusyLast // Marker
       
    88   };
       
    89 
       
    90 
       
    91 // ===========================================================================
       
    92 // FORWARD DECLARATIONS
       
    93 class CRepository;
       
    94 //class CCamSettingsModelBase;
       
    95 class MCamAppController;
       
    96 class MCamSettingsModel;
       
    97 class MCamSettingPreviewHandler;   // <CAMERAAPP_CAPI_V2_MIGRATION/>
       
    98 //class CCamConstantSettingProvider; // <CAMERAAPP_CAPI_V2_MIGRATION/>
       
    99 class CCamSettingProvider; // <CAMERAAPP_CAPI_V2_MIGRATION/>
       
   100 class CCamTimer;
       
   101 class CCamObserverHandler;
       
   102 class CCamBurstCaptureArray;
       
   103 class CCamAudioPlayerController;
       
   104 class MCamStaticSettings;
       
   105 class CCamGSInterface;
       
   106 class CCameraUiConfigManager;
       
   107 class CCamPropertyWatcher;
       
   108 class CCamSnapShotRotator;
       
   109 
       
   110 
       
   111 class CCamFlashStatus;
       
   112 class CCamConfiguration;
       
   113 class CCFClient;
       
   114 
       
   115 // ===========================================================================
       
   116 // CLASS DECLARATION
       
   117 
       
   118 class TCamAppControllerInfo
       
   119   {
       
   120   public:
       
   121     TCamAppControllerInfo();
       
   122 
       
   123   public:
       
   124     TCamActiveCamera      iActiveCamera;
       
   125 
       
   126     TCamCameraMode        iMode;
       
   127     TCamCameraMode        iTargetMode;
       
   128 
       
   129     TCamImageCaptureMode  iImageMode; // ECamImageCaptureNone in video controller mode
       
   130     TCamImageCaptureMode  iTargetImageMode; 
       
   131 
       
   132     TCamCaptureOperation iOperation; // Current operation 
       
   133 
       
   134     // Target viewfinder state and mode
       
   135     TCamCameraTriState iTargetVfState;
       
   136     TBool              iViewfinderMirror; // set when viewfinder initialized
       
   137 
       
   138     // Target image parameters        
       
   139     TInt               iTargetImageResolution;
       
   140     TInt               iTargetImageQuality;
       
   141     
       
   142     // Target video parameters
       
   143     /** not supported yet */
       
   144 
       
   145     // Request being handled        
       
   146     TCamCameraRequestId iBusyRequestId;
       
   147   };
       
   148 
       
   149 
       
   150 /**
       
   151 * Handle intercommunication between camcorder UI and engine.
       
   152 *
       
   153 *  @since 2.8
       
   154 */
       
   155 class CCamAppController : public CBase, 
       
   156                           public MCamAppController,
       
   157                           public MCamSettingsModelObserver,
       
   158                           public MCamCameraObserver,
       
   159                           public MCamImageSaveObserver,
       
   160                           public MCamCallStateObserver,
       
   161                           public MPropertyObserver,
       
   162                           public MSensrvDataListener,
       
   163                           public MCamPlayerObserver,
       
   164                           public MCamObserver,
       
   165                           public MCamBurstModeObserver,
       
   166                           public MCFListener
       
   167                           ,public MCamDriveChangeNotifierObserver
       
   168                           ,public MBitmapRotationObserver 
       
   169                           
       
   170     {
       
   171     public:  // Constructors and destructor
       
   172         
       
   173         /**
       
   174         * Two-phased constructor.
       
   175         * @since 2.8
       
   176         * @return pointer to the created CCamAppController object
       
   177         */
       
   178         static CCamAppController* NewL();
       
   179         
       
   180                
       
   181         /**
       
   182         * Complete construction of the engine and issue notification requests.
       
   183         * The camera engine cannot be instantiated until the application
       
   184         * orientation has been set by the CCamAppUi. This does not
       
   185         * exist when the CCamAppController is constructed. CompleteConstructionL
       
   186         * must be called in the CCamAppUi::ConstructL()
       
   187         * @since 3.0
       
   188         */ 
       
   189         void CompleteConstructionL();
       
   190 
       
   191         
       
   192         /**
       
   193         * Destructor.
       
   194         * @since 2.8
       
   195         */
       
   196         virtual ~CCamAppController();
       
   197 
       
   198    public:		
       
   199      /** 
       
   200       * Calls CamSettingModel to save user defined FT setting
       
   201       * @since S60 5.0
       
   202       * @param None
       
   203       * @return None
       
   204       */
       
   205       void StoreFaceTrackingValue();		
       
   206 
       
   207   // -------------------------------------------------------
       
   208   // From MCamCameraObserver
       
   209   public:
       
   210 
       
   211     virtual void HandleCameraEventL( TInt              aStatus, 
       
   212                                      TCamCameraEventId aEventId, 
       
   213                                      TAny*             aEventData /*= NULL*/ );
       
   214 
       
   215 
       
   216 
       
   217   // -------------------------------------------------------
       
   218   // from MCamSettingsModelObserver 
       
   219   public:
       
   220 
       
   221     virtual void IntSettingChangedL( TCamSettingItemIds aSettingItem, 
       
   222                                      TInt               aSettingValue );
       
   223     virtual void TextSettingChangedL( TCamSettingItemIds aSettingItem, 
       
   224                                       const TDesC&       aSettingValue );
       
   225 
       
   226 
       
   227   // -------------------------------------------------------
       
   228   // from MCamBurstModeObserver
       
   229   
       
   230     /**
       
   231     * Burst mode activation has changed
       
   232     * @since 2.8
       
   233     * @param aActive whether or not burst mode is active
       
   234     * @param aStillModeActive whether or not still capture is active
       
   235     */
       
   236     virtual void BurstModeActiveL( TBool aActive, TBool aStillModeActive );
       
   237 
       
   238   // -------------------------------------------------------
       
   239   // from MCamAudioPlayerObserver
       
   240     virtual void PlayComplete( TInt aStatus, TInt aSoundId );
       
   241 
       
   242 
       
   243   // -------------------------------------------------------
       
   244   public:
       
   245     // From MCFListener ( Context framework for publishing zoom state.
       
   246     /**
       
   247     * Indicates a change in context for subscribed clients.
       
   248     * If client has subscribed to partial context class path,
       
   249     * only the changed context will be indicated.
       
   250     * 
       
   251     * @since S60 4.0
       
   252     * @param aIndication: Context indication.
       
   253     * @return None
       
   254     */
       
   255     inline void ContextIndicationL(
       
   256             const CCFContextIndication& /*aChangedContext*/ ) {};
       
   257     
       
   258     /**
       
   259     * Indicates that specified action is needed to be executed.
       
   260     * When action indication is received certain rule has been triggered
       
   261     * and action is needed to be performed.
       
   262     *
       
   263     * @since S60 4.0
       
   264     * @param aActionToExecute Action indication.
       
   265     * @return None
       
   266     */
       
   267     inline void ActionIndicationL(
       
   268         const CCFActionIndication& /*aActionToExecute*/ ) {};
       
   269             
       
   270     /**
       
   271     * Indicates that error has occured.
       
   272     * @since S60 4.0
       
   273     * @param aError Error code.
       
   274     * @return None
       
   275     */
       
   276     inline void HandleContextFrameworkError( TCFError /*aError*/,
       
   277             const TDesC& /*aSource*/,
       
   278             const TDesC& /*aType*/ ){};
       
   279     
       
   280     /**
       
   281     * Returns an extension interface.
       
   282     * The extension interface is mapped with the extension UID.
       
   283     *
       
   284     * If the client does not support the requested interface,
       
   285     * client must return NULL. Otherwise client needs to return
       
   286     * the correct interface combined with the UID.
       
   287     *
       
   288     * @since S60 5.0
       
   289     * @param aExtensionUid: The identifier of the extension.
       
   290     * @return Pointer to the extension.
       
   291     */
       
   292    inline TAny* Extension( const TUid& /*aExtensionUid*/ ) const { return NULL; };
       
   293     
       
   294     // New Function
       
   295 
       
   296     /*
       
   297     * Method to publish the zoom key and setting the
       
   298     * value or the state to enabled or disabled.
       
   299     * @Paran aEnabled used to set the the state of zoom key
       
   300     * to be enabled or disabled.
       
   301     */
       
   302     void PublishZoomStateL( const TBool aEnabled );
       
   303 
       
   304   public: 
       
   305     
       
   306       /**
       
   307       * Returns whether or not the current profile is silent
       
   308       * @since 3.0
       
   309       * @return ETrue if current profile is silent
       
   310       */
       
   311       TBool IsProfileSilent();    
       
   312     
       
   313       /**
       
   314       * Returns whether or not we have touch screen support in the device
       
   315       * @return ETrue if device supports touch screen
       
   316       */
       
   317       TBool IsTouchScreenSupported();
       
   318     
       
   319       /**
       
   320       * Returns whether or not we have direct screen viewfinder support in the device
       
   321       * @return ETrue if device supports direct screen viewfinder
       
   322       */
       
   323       TBool IsDirectScreenVFSupported( TBool aPrimaryCamera = ETrue );
       
   324     
       
   325 	// ---------------------------------------------------------------------------
       
   326 	//Helper function for making notification about deleted files
       
   327 	//Added this method to do notification if files have been
       
   328 	//deleted outside camera application and then camera is
       
   329 	//put back to foreground in postcapture view.
       
   330 	//Security note. Contents of the files might have been
       
   331 	//changed when camera was in background.
       
   332 	// ---------------------------------------------------------------------------
       
   333 	//
       
   334 	void  MediaFileChangedNotification();
       
   335     
       
   336 	TBool EngineRequestsPending() const; 	
       
   337     /**
       
   338     * Set settings restore to be done at earliest
       
   339     * convenient time.
       
   340     */
       
   341     void  SetSettingsRestoreNeeded();
       
   342 
       
   343     /**
       
   344     * Set the flag to indicate that the original values 
       
   345     * of remaining images is stored
       
   346     */
       
   347      void SetRemainingImageStored();
       
   348     
       
   349     /** 
       
   350     * Returns the flag that indicates if the original value 
       
   351     * of remaing images is stored or not.
       
   352     */    
       
   353      TBool IsRemainingImageStored() const;
       
   354     
       
   355     /** 
       
   356     * Return whether saving is still in progress.
       
   357     */    
       
   358     TBool IsSavingInProgress() const;
       
   359      
       
   360     /**
       
   361     * Return if settings restore is set pending.
       
   362     */
       
   363     TBool IsSettingsRestoreNeeded() const;
       
   364   
       
   365 	
       
   366     void RestartTimeLapseTimerL();
       
   367 	
       
   368   
       
   369     static TInt CamerasAvailable();
       
   370 
       
   371     /**
       
   372     * Is time lapse supported.
       
   373     * Value read from Central Repository.
       
   374     */
       
   375     TBool TimeLapseSupported();
       
   376     
       
   377     /**
       
   378     * Is time lapse supported.
       
   379     * Value read from Central Repository.
       
   380     */
       
   381     TBool AlwaysOnSupported();
       
   382 
       
   383     /**
       
   384     * Release version number.
       
   385     * Value read from Central Repository.
       
   386     */
       
   387     const TVersion& Version();
       
   388 
       
   389     /***
       
   390     * Can a new request be made to controller or not.
       
   391     * Shutdown may be requested at any moment.
       
   392     */
       
   393     TBool Busy() const;
       
   394 
       
   395     /**
       
   396     * Returns true if the last captured image was saved
       
   397     * @since 2.8
       
   398     * @return ETrue if the last captured image has been saved.
       
   399     */
       
   400     TBool SavedCurrentImage() const;
       
   401 
       
   402     /**
       
   403     * Rename image/video.
       
   404     * @since 2.8
       
   405     * @param aNewName the new name for the current capture array file.
       
   406     * @param aMode the current capture mode.
       
   407     * @return ETrue if the file has been renamed successfully. 
       
   408     */
       
   409     TBool RenameCurrentFileL( const TDesC&          aNewName, 
       
   410                               const TCamCameraMode& aMode    );
       
   411 
       
   412     /**
       
   413     * Add a controller observer.
       
   414     * @since 2.8
       
   415     * @param aObserver Pointer to an object implementing 
       
   416     *                   MCamControllerObserver
       
   417     * @return ?description
       
   418     */
       
   419     void AddControllerObserverL( const MCamControllerObserver* aObserver );
       
   420 
       
   421     /**
       
   422     * Remove a controller observer
       
   423     * @since 2.8
       
   424     * @param aObserver Pointer to the observer to remove. The object
       
   425     *                  does not have to be added as an observer.
       
   426     */
       
   427     void RemoveControllerObserver
       
   428         ( const MCamControllerObserver* aObserver );
       
   429 
       
   430     /**
       
   431     * Add camera observer.
       
   432     * Forwards call to CCamCameraController.
       
   433     * @see CCamCameraController for more details.
       
   434     */
       
   435     void AddCameraObserverL( const MCamCameraObserver* aObserver, 
       
   436                              const TUint&              aEventInterest );
       
   437     
       
   438     /**
       
   439     * Removes camera observer.
       
   440     * Forwards call to CCamCameraController.
       
   441     * @see CCamCameraController for more details.
       
   442     */
       
   443     void RemoveCameraObserver( const MCamCameraObserver* aObserver );
       
   444 
       
   445     void AddSettingsObserverL( const MCamSettingsModelObserver* aObserver );
       
   446     void RemoveSettingsObserver( const MCamSettingsModelObserver* aObserver );
       
   447 
       
   448     TBool CameraControllerBusy() const;
       
   449     TUint CameraControllerState() const;
       
   450 
       
   451     TCamCameraState       CameraState() const;
       
   452     TCamCameraMode        CurrentMode() const;
       
   453     TCamCameraMode        TargetMode() const;
       
   454     TCamImageCaptureMode  CurrentImageModeSetup() const;
       
   455     TCamCaptureOperation  CurrentOperation() const;
       
   456     TCamCaptureOperation  CurrentImageOperation() const;
       
   457     TCamCaptureOperation  CurrentVideoOperation() const;
       
   458     TCamImageCaptureMode  CurrentImageMode() const;
       
   459     
       
   460 
       
   461     TInt CaptureLimit() const;
       
   462     TInt CaptureLimitSetting() const;
       
   463     void SetCaptureLimitL( TInt aLimit );
       
   464     
       
   465     /**
       
   466     * From MBitmapRotationObserver
       
   467     * Notification of bitmap rotation complete events
       
   468     * @param aErr KErrNone if successful
       
   469     */
       
   470     void RotationCompleteL( TInt aErr );
       
   471 
       
   472 private:
       
   473     void ReadVariantFlagsL();
       
   474 
       
   475 
       
   476     void SetMode( const TCamCameraMode& aNewMode );
       
   477     void SetTargetMode( const TCamCameraMode& aNewMode );
       
   478 
       
   479     void SetImageMode( const TCamImageCaptureMode& aNewMode );
       
   480     void SetTargetImageMode( const TCamImageCaptureMode& aNewMode );
       
   481     
       
   482     void SetOperation( TCamCaptureOperation aNewOperation, 
       
   483                        TInt                 aError = KErrNone );
       
   484                                      
       
   485     TCamCameraTriState ViewfinderTargetState() const;
       
   486 
       
   487 
       
   488 public:
       
   489     /*
       
   490      *  Handle to Camera Ui Config Manager
       
   491      */
       
   492     CCameraUiConfigManager* UiConfigManagerPtr();
       
   493     
       
   494     /*
       
   495     * De-register harvester client events.
       
   496     */
       
   497     void DeRegisterHarverterClientEvents();
       
   498         
       
   499     /**
       
   500     * Return resource id for video viewfinder layout
       
   501     * @since 3.0
       
   502     * @param aResolution for current resolution
       
   503     * @return Resource id for video viewfinder layout
       
   504     */
       
   505     TInt VideoViewFinderResourceId( TCamVideoResolution aResolution );
       
   506 
       
   507     /**
       
   508     * Start the viewfinder for the specified mode
       
   509     * as soon as the engine is intialised
       
   510     * @since 2.8
       
   511     * @param aMode The viewfinder mode being entered
       
   512     */
       
   513     void EnterViewfinderMode( const TCamCameraMode& aMode );
       
   514 
       
   515     /**
       
   516     * ExitViewinderMode    
       
   517     * @since 2.8
       
   518     * @param aMode The viewfinder mode being exited
       
   519     */
       
   520     void ExitViewfinderMode( const TCamCameraMode& aMode );
       
   521 
       
   522     /**
       
   523     * FreezeViewFinder    
       
   524     * @since 2.8
       
   525     * @param aFreeze Whether or not the viewfinder is
       
   526     * being frozen after this frame
       
   527     */
       
   528     void FreezeViewFinder( TBool aFreeze );
       
   529 
       
   530     /**
       
   531     * Return number of images that can still be captured
       
   532     * @since 2.8
       
   533     * @param aStorage storage location - defaults to current loation
       
   534     * @param aBurstActive - set to ETrue if burst mode is active
       
   535     * @return the number of images
       
   536     */
       
   537     TInt ImagesRemaining( TCamMediaStorage aStorage,
       
   538                           TBool            aBurstActive );
       
   539 
       
   540     /**
       
   541     * Return number of images that can still be captured for a particular
       
   542     * image quality
       
   543     * @since 2.8
       
   544     * @param aStorage storage location - defaults to current loation
       
   545     * @param aBurstActive - set to ETrue if burst mode is active
       
   546     * @param aQualityIndex - index of the image quality
       
   547     * @return the number of images
       
   548     */
       
   549     TInt ImagesRemaining( TCamMediaStorage aStorage,
       
   550                           TBool            aBurstActive, 
       
   551                           TInt             aQualityIndex );
       
   552 
       
   553     /**
       
   554     * Return amount of video that has been captured
       
   555     * @since 2.8
       
   556     * @return the amount of video in micro secs
       
   557     */
       
   558     TTimeIntervalMicroSeconds RecordTimeElapsed() const;
       
   559 
       
   560 
       
   561     /**
       
   562     * Set amount of video that has been captured
       
   563 	* @param aElapsed - recorded video time.
       
   564     */
       
   565     void RecordTimeElapsed(TTimeIntervalMicroSeconds aElapsed );
       
   566 
       
   567 
       
   568     /*
       
   569     * Return amount of video that can still be captured
       
   570     * @since 2.8
       
   571     * @return the amount of video in secs
       
   572     */
       
   573     TTimeIntervalMicroSeconds RecordTimeRemaining();
       
   574 
       
   575     /**
       
   576     * Updates the interval used in next TimeLapse capture
       
   577     * @since 3.0
       
   578     * @param aInterval The new interval to use
       
   579     */        
       
   580     void SetTimeLapseInterval( TTimeIntervalMicroSeconds aInterval );   
       
   581 
       
   582     /**
       
   583     * Returns the interval used in next TimeLapse capture
       
   584     * @since 3.0
       
   585     * @return The current time lapse interval in microseconds
       
   586     */
       
   587     TTimeIntervalMicroSeconds TimeLapseInterval();
       
   588     
       
   589     /**
       
   590     * Returns the remaining time lapse interval until the next capture
       
   591     * @since 3.0
       
   592     * @return The remaining time to the next timelapse capture
       
   593     */
       
   594     TTimeIntervalMicroSeconds TimeLapseCountdown();
       
   595 
       
   596     /** 
       
   597     * Start the autofocus procedure
       
   598     * @since 2.8
       
   599     */
       
   600     void StartAutoFocus();
       
   601 
       
   602     /**
       
   603     * Begin the capture procedure
       
   604     * @since 2.8
       
   605     */
       
   606     void Capture();               
       
   607 
       
   608     /**
       
   609     * Stop the burst capture operation
       
   610     * @since 2.8
       
   611     */
       
   612     void StopSequenceCaptureL();
       
   613 
       
   614     /**
       
   615     * Whether or not a still capture operation is pending
       
   616     * i.e. a request to start still capture has been made and is 
       
   617     * waiting for the focus operation to complete.
       
   618     * @since 2.8
       
   619     * @return ETrue if a still capture operation is pending
       
   620     */
       
   621     TBool CapturePending() const;
       
   622 
       
   623 	/**
       
   624     * Whether or not a capture key pressed during image saving
       
   625     * @since 2.8
       
   626     * @return ETrue if capture key is pressed during image saving
       
   627     */
       
   628     TBool CaptureKeyPressedWhileImageSaving() const;
       
   629 
       
   630 	/**
       
   631     * Stores shutter key press during saving image
       
   632     * @since 2.8
       
   633     */
       
   634     void SetCaptureKeyPressedWhileImageSaving(TBool aCaptureKeyPressed);
       
   635     
       
   636     /**
       
   637     * Whether or not a video recording operation is pending
       
   638     * i.e. a request to start video recording has been made and is
       
   639     * waiting for the engine to complete a video name update operation.
       
   640     * @since 2.8
       
   641     * @return ETrue if a record operation is pending
       
   642     */
       
   643     TBool VideoRecordPending() const;
       
   644 
       
   645     /**
       
   646     * Whether or not a sequence capture is in progress
       
   647     * @since 2.8
       
   648     * @return ETrue if a sequence capture is in progress
       
   649     */
       
   650     TBool SequenceCaptureInProgress() const;
       
   651 
       
   652     /**
       
   653     * Begin the recording procedure
       
   654     * @since 2.8
       
   655     */
       
   656     void StartVideoRecordingL();
       
   657 
       
   658     /**
       
   659     * End the recording procedure
       
   660     * @since 2.8
       
   661     */
       
   662     void StopVideoRecording();
       
   663 
       
   664     /**
       
   665     * End the recording procedure
       
   666     * @since 5.0
       
   667     */
       
   668     void StopVideoRecordingAsync();
       
   669     
       
   670     /**
       
   671     * Store the cause of the video stop
       
   672     * @since 3.0
       
   673     */
       
   674     void SetVideoStoppedForPhoneApp( TBool aIsPhoneApp );
       
   675 
       
   676     /**
       
   677     * Pause the recording procedure
       
   678     * @since 2.8
       
   679     */
       
   680     void PauseVideoRecording();
       
   681 
       
   682     /**
       
   683     * Continue the recording procedure
       
   684     * @since 2.8
       
   685     */
       
   686     void ContinueVideoRecording();
       
   687 
       
   688     /**
       
   689     * Issue AF request.
       
   690     */
       
   691     TBool TryAFRequest( TInt aAFRequest );
       
   692     
       
   693     /**
       
   694     * Cancel ongoing AutoFocus.
       
   695     */
       
   696     void CancelAFNow();
       
   697 	
       
   698     /**
       
   699     * Cancel a requested capture
       
   700     * @since 2.8
       
   701     */
       
   702     void CancelFocusAndCapture();
       
   703 
       
   704     /**
       
   705     * Return the current snapshot image
       
   706     * @since 2.8
       
   707     * @return the current snapshot image
       
   708     */
       
   709     const CFbsBitmap* SnapshotImage() const;
       
   710 
       
   711     /**
       
   712     * Sets the specified burst mode item as the current image, in 
       
   713     * preparation for a Post-capture view of the image.
       
   714     * @since 2.8        
       
   715     * @param aIndex The index of the burst item in "CCamBurstCaptureArray"
       
   716     */
       
   717     void SetAsCurrentImage( TInt aIndex );
       
   718 
       
   719     /**
       
   720     * Get the user-visible name for next image.
       
   721     * @since 2.8
       
   722     * @return file name for the current image or video without path or
       
   723     *         extension
       
   724     */
       
   725     const TDesC& CurrentImageName() const;
       
   726 
       
   727     /**
       
   728     * Delete the current image/video file
       
   729     * @since 2.8
       
   730         * @param aNofity Should notification be sent to observers about
       
   731         *                change in media files. When this call is made
       
   732         *                several times in a row, it's worth to do the
       
   733         *                notification only once.
       
   734     * @return KErrNone if delete successful, otherwise system-wide 
       
   735     * error code
       
   736     */
       
   737     TInt DeleteCurrentFile( TBool aNotify = ETrue );
       
   738     
       
   739     /**
       
   740     * Delete the timelapse sequence files
       
   741     * @since 3.0
       
   742     */
       
   743     void DeleteTimeLapseFiles();
       
   744     
       
   745     /**
       
   746     * Indicate whether or not the controller is actively engaged in still
       
   747     * or video capture - this includes paused video, saving photos/videos,
       
   748     * periods in between timelapse captures and pending captures 
       
   749     * (captures that have been requested but not yet started)
       
   750     * @since 3.0
       
   751     * @return EFalse if not currently capturing, otherwise ETrue
       
   752     */
       
   753     TBool IsProcessingCapture();
       
   754     
       
   755     /**
       
   756     * Complete current capture asap, then report completion to the observer
       
   757     * @since 3.0
       
   758     * @param aObserver To be notified when the current capture process completes
       
   759     * @param aSafeCompletion ETrue if all captures should be saved. EFalse to complete 
       
   760     * sooner and lose any images that have not yet begun to save
       
   761     */
       
   762     void CompleteCaptureAndNotifyL( MCamObserver* aObserver, TBool aSafeCompletion );
       
   763 
       
   764     /**
       
   765     * The application is closing. Complete any active operations then
       
   766     * exit the application.
       
   767     * @param aImmediateShutdown ETrue: shutdown immediately or 
       
   768     * EFalse: wait for pending operations to complete.
       
   769     * @since 2.8
       
   770     */
       
   771     void EnterShutdownMode( TBool aImmediateShutdown );
       
   772 
       
   773     /**
       
   774     * Whether or not the controller is in shutdown mode
       
   775     * @since 2.8
       
   776     * @return ETrue if the controller is in shutdown mode else EFalse
       
   777     */
       
   778     TBool IsInShutdownMode() const;
       
   779       
       
   780     /**
       
   781     * Returns true if AppUi has been constructed, and not yet
       
   782     * destructed.               
       
   783     */
       
   784     TBool IsAppUiAvailable() const;
       
   785     
       
   786     /**
       
   787     * Sets AppUi availablility (see IsAppUiAvailable())
       
   788     */
       
   789     void SetAppUiAvailable( TBool aAvailable );        
       
   790 
       
   791 
       
   792     /**
       
   793     * Called to return the range of supported zoom values
       
   794     * @since 2.8
       
   795     * @param aMinZoom on return contains the minimum zoom value
       
   796     * @param aMaxZoom on return contains the maximum zoom value
       
   797     */
       
   798     void GetZoomRange( TInt& aMinZoom, TInt& aMaxZoom ) const;
       
   799 
       
   800     /**
       
   801     * Called to return current zoom value
       
   802     * @since 2.8
       
   803     * @return the current zoom value
       
   804     */
       
   805     TInt ZoomValue() const;
       
   806 
       
   807     /**
       
   808     * Sets the current zoom value
       
   809     * @since 2.8
       
   810     * @param aValue the new zoom value to be used
       
   811     */
       
   812     void SetZoomValue( TInt aValue );
       
   813 
       
   814     /**
       
   815     * Resets all user scene settings to their defaults.
       
   816     * @since 2.8
       
   817     */
       
   818         void ResetUserSceneL();
       
   819  
       
   820         /**
       
   821     * Previews a new value for the specified integer setting
       
   822     * @param aSettingItem specifies which setting item that want 
       
   823     * to preview.
       
   824     * @param aSettingValue the new integer value for the specified 
       
   825     * setting item to be previewed.
       
   826     * @since 2.8
       
   827     */
       
   828     void PreviewSettingChangeL( TInt aSettingItem, TInt aSettingValue );
       
   829 
       
   830     /**
       
   831     * Cancels all preview changes, since last commit/cancel.
       
   832     * @since 2.8
       
   833     */
       
   834     void CancelPreviewChangesL();
       
   835 
       
   836     /**
       
   837     * Commits last preview change.
       
   838     * @since 2.8
       
   839     */
       
   840     void CommitPreviewChanges();
       
   841 
       
   842     /**
       
   843     * Re-prepare video after e.g. a setting change requires this.
       
   844     */
       
   845     void RePrepareVideoL();
       
   846 
       
   847     /**
       
   848     * Returns the current integer value for the specified setting
       
   849     * @return the current integer setting value
       
   850     * @param aSettingItem specifies which setting item that want 
       
   851     * the value of.
       
   852     * @since 2.8
       
   853     */
       
   854     TInt IntegerSettingValue( TInt aSettingItem ) const;
       
   855 
       
   856     /**
       
   857     * Returns the current integer value for the specified setting
       
   858     * without the filtering usually performed on storage location.
       
   859     * This is neccesary to allow the video/photo settings list to show
       
   860     * the selected storage location rather than the forced storage location.
       
   861     * @return the current integer setting value
       
   862     * @param aSettingItem specifies which setting item that want the value of.
       
   863     * @since 2.8
       
   864     */
       
   865     TInt IntegerSettingValueUnfiltered( TInt aSettingItem ) const;
       
   866 
       
   867     /**
       
   868     * Sets a new value for the specified integer setting
       
   869     * @param aSettingItem specifies which setting item that want 
       
   870     * to set the value of.
       
   871     * @param aSettingValue the new integer value for the specified 
       
   872     * setting item.
       
   873     * @since 2.8
       
   874     */
       
   875     void SetIntegerSettingValueL( TInt aSettingItem, TInt aSettingValue );
       
   876 
       
   877     /**
       
   878     * Sets pathnames for video and image files to point to the specified storage
       
   879     * @param aMediaStorage specifies phone memory or MMC
       
   880     * @since 2.8
       
   881     */
       
   882     void SetPathnamesToNewStorageL( TCamMediaStorage aMediaStorage );
       
   883 
       
   884    /**
       
   885     * Sets a new text value for the specified setting
       
   886     * @param aSettingItem specifies which setting item that want to set
       
   887     * the text value of.
       
   888     * @param aSettingValue the new text value for the specified setting 
       
   889     * item.
       
   890     * @since 2.8
       
   891     */
       
   892     void SetTextSettingValueL( TInt aSettingItem, 
       
   893         const TDesC& aSettingValue );
       
   894 
       
   895 
       
   896     /**
       
   897     * Returns the current text value for the specified setting
       
   898     * @return the current text setting value
       
   899     * @param aSettingItem specifies which setting item that want 
       
   900     * the text value of.
       
   901     * @since 2.8
       
   902     */
       
   903     TPtrC TextSettingValue( TInt aSettingItem ) const;
       
   904 
       
   905     /**
       
   906     * Returns whether a particular setting value can be set or not.
       
   907     * @return ETrue if can be set. Otherwise, EFalse.
       
   908     * @param aSettingItem the setting item in question. 
       
   909     * @param aSettingValue the value in question. 
       
   910     * @since 2.8
       
   911     */
       
   912     TBool SettingValueEnabled( TInt aSettingItem, TInt aSettingValue ) const;
       
   913 
       
   914     /**
       
   915     * Loads the settings from shared data, or if unable to from the 
       
   916     * resource file. 
       
   917     * @param aIsEmbedded whether or not the application is running in
       
   918     * embedded mode.
       
   919     * @since 2.8
       
   920     */       
       
   921     void LoadStaticSettingsL( TBool aIsEmbedded );   
       
   922 
       
   923     /**
       
   924     * Get the default value for a setting item.
       
   925     * @param  aSettingId The id of the setting.
       
   926     * @return The default value for setting item or KErrNotFound if not found.
       
   927     */
       
   928     TInt DynamicSettingDefaultValue( TInt aSettingId ) const;
       
   929 
       
   930     /**
       
   931     * Sets all dynamic settings to their defaults.
       
   932     * @since 2.8
       
   933     */       
       
   934     void SetDynamicSettingsToDefaults();
       
   935 
       
   936     /**
       
   937     * Sets a single dynamic setting to its default.
       
   938     * @since 2.8
       
   939     */       
       
   940     void SetDynamicSettingToDefault(TInt aSettingItem);
       
   941     
       
   942     /**
       
   943     * Set scene default value to a dynamic setting.
       
   944     * @param aSceneId    Id of the scene to use.
       
   945     * @param aSceneField Id of scene field.
       
   946     * @param aSettingId  If of the dynamic setting to set.
       
   947     * @param aVideoScene Does aSceneId refer to a video scene.
       
   948     * @return KErrNotFound, if setting could not be set.
       
   949     */
       
   950     TInt SetDynamicSettingToSceneDefaultL( TInt  aSceneId,
       
   951                                            TInt  aSceneField,
       
   952                                            TInt  aSettingId,
       
   953                                            TBool aVideoScene );
       
   954     
       
   955 
       
   956 #ifdef PRODUCT_USES_GENERIC_SETUP_INDICATOR
       
   957     /**
       
   958     * Returns whether or not the video setup settings are set to the
       
   959     * defaults for its current scene.
       
   960     * @since 2.8
       
   961     * @return ETrue if set to defaults. Otherwise, EFalse
       
   962     */       
       
   963     TBool VideoSceneDefaultsAreSet();
       
   964 
       
   965     /**
       
   966     * Returns whether or not the photo setup settings are set to the
       
   967     * defaults for its current scene.
       
   968     * @since 2.8
       
   969     * @return ETrue if set to defaults. Otherwise, EFalse
       
   970     */       
       
   971     TBool PhotoSceneDefaultsAreSet();
       
   972 #endif // PRODUCT_USES_GENERIC_SETUP_INDICATOR
       
   973 
       
   974     /**
       
   975     * Returns the file name of the most recent saved image/video clip
       
   976     * @return Filename of most recent captured image/video 
       
   977     * @since 2.8
       
   978     */
       
   979     const TDesC& CurrentFullFileName() const;
       
   980 
       
   981     /**
       
   982     * Get the current video filename.
       
   983     */
       
   984     const TDesC& CurrentVideoFileName() const;
       
   985 
       
   986     /**
       
   987     * Returns a pointer to an array representing the images in a burst
       
   988     * capture
       
   989     * @return reference to the burst capture array
       
   990     * @since 2.8
       
   991     */
       
   992     CCamBurstCaptureArray* BurstCaptureArray() const;
       
   993 
       
   994     /**
       
   995     * Returns the number of non-deleted items in the array
       
   996     * @return count of non-deleted items
       
   997     * @since 2.8
       
   998     */
       
   999     TInt CurrentItemCount();
       
  1000     
       
  1001     /**
       
  1002     * Returns the number of burst capture moments that have taken
       
  1003     * place in a current burst. If no burst is active this returns
       
  1004     * 0
       
  1005     * @return count of burst capture moments
       
  1006     * @since 3.0
       
  1007     */
       
  1008     TInt CurrentCapturedCount();
       
  1009     
       
  1010     /**
       
  1011     * Returns the number of items in a timelapse sequence
       
  1012     * @return count of timelapse sequence items
       
  1013     * @since 3.0
       
  1014     */
       
  1015     TInt TimeLapseImageCount();
       
  1016  
       
  1017     /**
       
  1018     * Resets the array of filenames used in timelapse capture
       
  1019     * @since 3.0
       
  1020     */   
       
  1021     void ResetTimelapseArray();
       
  1022 
       
  1023     /**
       
  1024     * Initiates the playing of the specified sound.
       
  1025     * @since 2.8
       
  1026     * @param aSoundId The enum value of the sound to play
       
  1027     * @param aEnableCallback Whether we want a callback when play complete
       
  1028     */
       
  1029     void PlaySound( TCamSoundId aSoundId, TBool aEnableCallback );
       
  1030 
       
  1031     /**
       
  1032     * Initiates the playing of the specified tone
       
  1033     * @since 2.8
       
  1034     * @param aToneHz The frequency of the tone to play in Hertz
       
  1035     * @param aLenMicSec The length of tone to play in microseconds
       
  1036     * @param aVolume The volume of the tone, range 0.0 to 1.0
       
  1037     * @param aEnableCallback Whether to be called back when playback complete
       
  1038     */
       
  1039     void PlayTone( TInt aToneHz, TInt aLenMicSec, TReal32 aVolume,  TBool aEnableCallback );
       
  1040 
       
  1041     /** 
       
  1042     * Releases the camera hardware for other apps to use
       
  1043     * @since 2.8
       
  1044     */
       
  1045     void ReleaseCamera();
       
  1046 
       
  1047     /**
       
  1048     * Increments the engine usage count
       
  1049     * @since 2.8
       
  1050     */
       
  1051     void IncCameraUsers();
       
  1052 
       
  1053     /**
       
  1054     * Decrements the engine usage count If the engine is no longer required
       
  1055     * then it is released. If it is still processing, the engine count will 
       
  1056     * be checked when the current process completes and the engine will be 
       
  1057     * released if it is no longer needed.
       
  1058     * @since 2.8
       
  1059     */
       
  1060     void DecCameraUsers();
       
  1061     
       
  1062     /*
       
  1063     * Gets the handle to the static settings model, which is used inturn by the
       
  1064     * plugin to call the interfaces for performing needed actions.
       
  1065     */
       
  1066     MCamStaticSettings& StaticSettingsModel();
       
  1067     
       
  1068     /*
       
  1069     * Check if image/video scene mode is supported
       
  1070     */
       
  1071     TBool IsSceneSupported( const TInt aSceneId, TBool aPhotoScene = ETrue  ) const;
       
  1072 
       
  1073     /** 
       
  1074     * Whether a call is active, including the ringing state
       
  1075     * @since 2.8
       
  1076     * @return ETrue if in call or ringing, else EFalse
       
  1077     */
       
  1078     TBool InCallOrRinging() const;
       
  1079 
       
  1080     /** 
       
  1081     * Whether a video call is active, including the ringing state
       
  1082     * @return ETrue if in videocall or ringing, else EFalse
       
  1083     */
       
  1084     TBool InVideocallOrRinging();
       
  1085     
       
  1086     /** 
       
  1087     * Whether or not a video clip is currently being saved
       
  1088     * @since 2.8
       
  1089     * @return ETrue if saving, else EFalse
       
  1090     */
       
  1091     TBool CurrentlySavingVideo() const;
       
  1092 
       
  1093     /**
       
  1094     * Returns whether all the settings list options for a particular setting
       
  1095     * item are visible or not
       
  1096     * @since 2.8
       
  1097     * @param aSettingItem The setting item to be checked.
       
  1098     * @param aRevisedResourceId Receives the id of a resource if the return
       
  1099     * value is EFalse. The resource contains the list of  visible
       
  1100     * options.
       
  1101     * @return ETrue if all options are visible. Otherwise, EFalse.
       
  1102     */
       
  1103     TBool AllOptionsVisibleForSettingItem( TInt aSettingItem, 
       
  1104                                                    TInt& aRevisedResourceId );
       
  1105 
       
  1106     /**
       
  1107     * Switches the camera being used
       
  1108     * @since 2.8
       
  1109     */
       
  1110     void SwitchCameraL();
       
  1111 
       
  1112     /**
       
  1113     * Returns the active camera
       
  1114     * @since 2.8
       
  1115     * @return @return either primary, secondary or none ( if in process of switching )
       
  1116     */
       
  1117     TCamActiveCamera ActiveCamera() const;
       
  1118     
       
  1119     /**
       
  1120     * Whether we currently have a camera switch required
       
  1121     * @since 2.8
       
  1122     * @return TCameraSwitchRequired a camera switch is required or not
       
  1123     */
       
  1124     TCameraSwitchRequired CameraSwitchQueued() const;
       
  1125 
       
  1126     /**
       
  1127     * Check if exit is required
       
  1128     * @since 2.8
       
  1129     * @return TBool True if exit is required
       
  1130     */
       
  1131     TBool CheckExitStatus();
       
  1132         
       
  1133     /**
       
  1134     * Informs the controller that an end key event is waiting
       
  1135     * to close the app, or has been acted upon
       
  1136     * This is used when the end key is pressed during sequence capture
       
  1137     * @since 2.8
       
  1138     */
       
  1139     void SetEndKeyExitWaiting( TBool aEndKeyWaiting );
       
  1140 
       
  1141     /**
       
  1142     * Returns the status of the camera slide
       
  1143     * @since 2.8
       
  1144     * @return the status of the camera slide
       
  1145     */
       
  1146     TInt CameraSlideState() const;
       
  1147 
       
  1148     /**
       
  1149     * Informs the controller that a slider close event has
       
  1150     * been reacted to by 'pretending' to exit
       
  1151     * @since 2.8
       
  1152     */
       
  1153     void SliderCloseEventActioned();
       
  1154     
       
  1155     /**
       
  1156     * Set camera switch to queue
       
  1157     */
       
  1158     void SetCameraSwitchRequired( TCameraSwitchRequired aSwitchRequired ); 
       
  1159 
       
  1160     /**
       
  1161     * Check slide state and schedule camera switch if required
       
  1162     * @since 2.8
       
  1163     */
       
  1164     void CheckSlideStatus();    
       
  1165             
       
  1166 
       
  1167     /**
       
  1168      * Return range of EV value supported for current product
       
  1169      * @since 3.0
       
  1170      * @return TEvRange struct
       
  1171      */
       
  1172     TCamEvCompRange EvRange() const;
       
  1173 
       
  1174   public: // Derived from MCamCallStateObserver base class     
       
  1175     /**
       
  1176     * Callback for when the current phone call state changes
       
  1177     * @since 3.0
       
  1178     * @param aState The new call state
       
  1179     * @param aError An error code associated with the event
       
  1180     */
       
  1181     void CallStateChanged( TPSCTsyCallState aState, TInt aError );
       
  1182 
       
  1183     /**
       
  1184     * Returns the file size of the specified file
       
  1185     * @since 3.0
       
  1186     * @param aFilename The file to retrieve the size of.
       
  1187     * @return The size of the file or KErrNotFound
       
  1188     */        
       
  1189     TInt FileSize( TDesC& aFilename ) const;
       
  1190 
       
  1191     /**
       
  1192     * Returns whether the current scene uses forced
       
  1193     * autofocus (so no AF required at capture time)
       
  1194     * @since 3.0       
       
  1195     * @return ETrue if forced, EFalse if not
       
  1196     */ 
       
  1197     TBool CurrentSceneHasForcedFocus() const;        
       
  1198 
       
  1199 public:
       
  1200 
       
  1201     /**
       
  1202     * Get the actual resolution (WxH) of current image quality.
       
  1203     */
       
  1204     TSize GetCurrentImageDimensions() const;
       
  1205 
       
  1206     /**
       
  1207     * Retrieves the current image resolution, taking into account
       
  1208     * the user settings and and modifications due to zoom state.
       
  1209     * @since 2.8
       
  1210     * @returns The current image resolution.
       
  1211     */
       
  1212     TCamPhotoSizeId GetCurrentImageResolution() const;
       
  1213     
       
  1214     /**
       
  1215     * Retrieves the current image compression
       
  1216     * @since 2.8
       
  1217     * @returns The current image compression.
       
  1218     */
       
  1219     TInt GetCurrentImageCompression() const;
       
  1220 
       
  1221     /**
       
  1222     * Retrieves the current video resolution.
       
  1223     * @since 2.8
       
  1224     * @returns The current video resolution.
       
  1225     */
       
  1226     TCamVideoResolution GetCurrentVideoResolution() const;
       
  1227     
       
  1228     /**
       
  1229     * Force use of phone memory storage
       
  1230     * @since 2.8
       
  1231     */
       
  1232     void UsePhoneMemoryL() const; 
       
  1233 
       
  1234     /**
       
  1235     * Sets the correct memory to be used based on settings 
       
  1236     * and availability of MMC.
       
  1237     * @since 4.0
       
  1238     * @return ETrue if memory location changed
       
  1239     */
       
  1240     TBool CheckMemoryToUseL();
       
  1241     
       
  1242     /**
       
  1243     * Indicate whether the phone memory is being force-used 
       
  1244     * because of un-availability or errors in MMC.
       
  1245     * @since 4.0
       
  1246     */        		
       
  1247 	TBool IsPhoneMemoryForced();        
       
  1248 
       
  1249     /**
       
  1250     * Retrieves the current image resolution from Settings.
       
  1251     * @since 2.8
       
  1252     * @returns The current image from Settings
       
  1253     */
       
  1254     TCamPhotoSizeId SettingsPhotoResolution() const;
       
  1255 
       
  1256 
       
  1257     /**
       
  1258     * Indication that a view has finished using the capture array
       
  1259     * @since 2.8
       
  1260         * @param aForcedRelease Should the array be released even if 
       
  1261         *                       the apparent usage count is not null.
       
  1262     */
       
  1263         void ReleaseArray( TBool aForcedRelease = EFalse );
       
  1264     
       
  1265     /**
       
  1266     * Restore Camera settings to default
       
  1267     * @since 3.0
       
  1268     * @param aIsEmbedded if app is embedded
       
  1269     */
       
  1270     void RestoreFactorySettingsL( TBool aIsEmbedded );
       
  1271 
       
  1272 private:
       
  1273     /**
       
  1274     * Called when playback of a sound has completed
       
  1275     * @since 2.8
       
  1276     */
       
  1277     void PlaySoundComplete();
       
  1278 public:
       
  1279 
       
  1280     /**
       
  1281     * Non-leaving version of StartViewFinderL()
       
  1282     * @since 2.8
       
  1283     */
       
  1284     void StartViewFinder();
       
  1285 
       
  1286     /**
       
  1287     * Stop viewfinder     
       
  1288     * @since 2.8
       
  1289     */
       
  1290     void StopViewFinder(); 
       
  1291 
       
  1292     /**
       
  1293     * Stop viewfinder Ecam only
       
  1294     * Needed with async video recording stopping     
       
  1295     * @since 5.0
       
  1296     */
       
  1297     void StopViewFinderEcam(); 
       
  1298 
       
  1299     /**
       
  1300     * Sets the zoom mode of the engine
       
  1301     * @param aZoomMode The zoom mode to set
       
  1302     * @since 3.0
       
  1303     */
       
  1304     // Only digital mode supported currently - no need for this
       
  1305     //void SetZoomMode( const TCamZoomMode& aZoomMode );
       
  1306 
       
  1307     /**
       
  1308     * Report whether a capture mode transition is currently in progress
       
  1309     * @since 2.8
       
  1310     * @return TBool ETrue if transition (i.e. still/video capture prepare) is 
       
  1311     *  currently in progress, EFalse otherwise;
       
  1312     */
       
  1313     TBool CaptureModeTransitionInProgress();
       
  1314 
       
  1315     /**
       
  1316     * Check if viewfinder is active
       
  1317     * @since 2.8
       
  1318     * @returns ETrue if viewfinding
       
  1319     */
       
  1320     TBool IsViewFinding() const;
       
  1321 
       
  1322     /**
       
  1323     * Check if capture key needs to be released before starting 
       
  1324     * new capture process. Used in post capture state to prevent
       
  1325     * image capture before viewfinder is completely shown.
       
  1326     * @since S60 v5.0
       
  1327     * @return ETrue if waiting key release before next capture
       
  1328     */
       
  1329     TBool IsDemandKeyRelease();
       
  1330 
       
  1331     /**
       
  1332     * Set iDemandKeyRelease value
       
  1333     * @param aDemand Demand to release capture key
       
  1334     * @since S60 v5.0
       
  1335     */
       
  1336     void SetDemandKeyRelease( TBool aDemand );
       
  1337 
       
  1338     /**
       
  1339     * Stop the idle timer
       
  1340     * @since 2.8
       
  1341     */
       
  1342     void StopIdleTimer();
       
  1343 
       
  1344     /**
       
  1345     * Restart the idle timer
       
  1346     * @since 2.8
       
  1347     */
       
  1348     void StartIdleTimer();
       
  1349 
       
  1350 
       
  1351     /**
       
  1352     * Flash modes supported by engine
       
  1353     * @since 3.0
       
  1354     * @return supported flash modes   
       
  1355     */
       
  1356     TUint32 SupportedFlashModes();
       
  1357     
       
  1358     
       
  1359     /**
       
  1360     * White balance modes supported by engine
       
  1361     * @since 3.0
       
  1362     * @return supported white balance modes   
       
  1363     */
       
  1364     TUint32 SupportedWBModes();
       
  1365     
       
  1366     /**
       
  1367     * EV modes supported by engine
       
  1368     * @since 3.0
       
  1369     * @return supported EV modes    
       
  1370     */
       
  1371     TUint32 SupportedEVModes();
       
  1372 
       
  1373     /**
       
  1374     * Capture state
       
  1375     * @return TInt capture state    
       
  1376     */
       
  1377     TInt CaptureState(); 
       
  1378 
       
  1379     /**
       
  1380     * Returns the current capture-tone id
       
  1381     * @since 3.0
       
  1382     * @return the current capture-tone id
       
  1383     */
       
  1384     TCamSoundId CaptureToneId( );
       
  1385 
       
  1386 #ifdef CAMERAAPP_PERFORMANCE_MEASUREMENT 
       
  1387   public:
       
  1388     void SetPerformanceState( TCamPerformanceState aState );
       
  1389 #endif        
       
  1390 
       
  1391   /**
       
  1392    * Set pointer to settings plug-in. Takes ownership!
       
  1393    * @param aPlugin Pointer to settings plug-in. This object
       
  1394    *                takes ownership.
       
  1395    * @since S60 v5.0
       
  1396    */
       
  1397 void SetSettingsPlugin( CCamGSInterface* aPlugin );
       
  1398 
       
  1399   /**
       
  1400   * Set viewfinder window for direct screen viewfinder. The handle must remain
       
  1401   * valid as long as viewfinder is running. 
       
  1402   * @since S60 v5.0
       
  1403   * @param aWindow Handle to viewfinder window. Must remain valid while
       
  1404   *                viewfinder is running. Ownership not transferred.
       
  1405   */
       
  1406   void SetViewfinderWindowHandle( RWindowBase* aWindow );
       
  1407     
       
  1408   /**
       
  1409   * Notify that the viewfinder window is about to be deleted. Viewfinder
       
  1410   * will be stopped if this window handle is currently used for the
       
  1411   * viewfinder.
       
  1412   * @since S60 v5.0
       
  1413   * @param aWindow Handle to viewfinder window. Ownership not transferred.
       
  1414   */
       
  1415   void ViewfinderWindowDeleted( RWindowBase* aWindow );
       
  1416 
       
  1417 protected:  // New functions
       
  1418 
       
  1419     /**
       
  1420     * C++ default constructor.
       
  1421     * @since 2.8
       
  1422     */
       
  1423     CCamAppController();
       
  1424 
       
  1425     /**
       
  1426     * Symbian OS 2nd phase constructor.
       
  1427     * @since 2.8
       
  1428     */
       
  1429     void ConstructL();
       
  1430 
       
  1431 // -----------------------------------------------------
       
  1432 // Burst related
       
  1433 public:   
       
  1434 
       
  1435     /**
       
  1436         * Stop burst in a soft way:
       
  1437         * - if have not moved yet to long burst mode,
       
  1438         *   wait until the short burst ends and do not 
       
  1439         *   enter long burst mode (if aFastStop is true,
       
  1440         *   stop asap when atleast 2 images captured).
       
  1441         * - if long burst already entered, stop capturing
       
  1442         *   after the next capture.
       
  1443         * @param aFastStop Stop also short burst asap, but so that
       
  1444         *                  atleast 2 images are captured.
       
  1445     */
       
  1446         void SoftStopBurstL( TBool aFastStop = EFalse );
       
  1447 
       
  1448     /**
       
  1449      * Set iNoBurstCancel flag which is used to prevent stopping burst
       
  1450      * when actual burst capture has started after focusing.
       
  1451      */
       
  1452      void SetNoBurstCancel( TBool aValue );
       
  1453         
       
  1454         /**
       
  1455         * Set iKeyUPl flag which is used to prevent late 
       
  1456         * activated burst timer when capturekey is up already
       
  1457         * before burstcapture has started.
       
  1458         */
       
  1459         void SetKeyUp( TBool aValue = EFalse );
       
  1460         
       
  1461         /**
       
  1462         * Returns amount of images captured in burst mode
       
  1463         * @return Amount of captured images
       
  1464         * 
       
  1465         */
       
  1466         TInt CapturedImages() const;
       
  1467 
       
  1468 private:   
       
  1469 
       
  1470     /**
       
  1471     * Start the burst timer for changing to long burst mode.
       
  1472     */
       
  1473     void StartBurstTimerL();
       
  1474 
       
  1475     /*
       
  1476     * Stop the burst timer.
       
  1477     */
       
  1478     void StopBurstTimer();
       
  1479 
       
  1480     /**
       
  1481     * Callback for short burst timer.
       
  1482     * @param aController Pointer to app controller instance.
       
  1483     * @return Always zero, implies no repeated callbacks wanted.
       
  1484     */
       
  1485     static TInt ShortBurstTimeout( TAny* aController );
       
  1486 
       
  1487     /**
       
  1488     * Helper method for short burst timer callback.
       
  1489     */
       
  1490     void DoShortBurstTimeoutL();
       
  1491 
       
  1492 
       
  1493     // -----------------------------------------------------
       
  1494     private:   
       
  1495 
       
  1496     /**
       
  1497     * Return number of images that can still be captured for a particular
       
  1498     * image photo resolution
       
  1499     * @since 2.8
       
  1500     * @param aStorage storage location - defaults to current loation
       
  1501     * @param aBurstActive - set to ETrue if burst mode is active
       
  1502     * @param aSize - the id of the photo resolution
       
  1503     * @return the number of images
       
  1504     */
       
  1505     TInt ImagesRemaining( TCamMediaStorage aStorage,
       
  1506                           TBool            aBurstActive, 
       
  1507                           TCamPhotoSizeId  aSize );
       
  1508 
       
  1509     /**
       
  1510     * Change the controller's current state
       
  1511     * Notifies controller observers of change
       
  1512     * @since 2.8
       
  1513     * @param aNewState new state code
       
  1514     */
       
  1515     void ChangeState( const TCamCameraState& aNewState );
       
  1516 
       
  1517     /**
       
  1518     * Change the controller's target state. The state will not be
       
  1519     * altered if the controller is already in shutdown mode.
       
  1520     * @since 2.8
       
  1521     * @param aNewState new state code
       
  1522     */
       
  1523     void ChangeTargetState( const TCamCameraState& aNewState );
       
  1524 
       
  1525     /**
       
  1526     * Change the controller's current operation
       
  1527     * Notifies controller observers of change
       
  1528     * @since 2.8
       
  1529     * @param aNewOperation new operation code
       
  1530     * @param aError error code associated with new state (if any)
       
  1531     */
       
  1532     void ChangeOperation( TCamCaptureOperation aNewOperation, 
       
  1533                           TInt          aError = KErrNone );
       
  1534 
       
  1535     /**
       
  1536     * Notify controller observers of an event.
       
  1537     * @since 2.8
       
  1538     * @param aEvent event code
       
  1539     * @param aError error code
       
  1540     */
       
  1541     void NotifyControllerObservers( TCamControllerEvent aEvent,
       
  1542                                     TInt                aError = KErrNone ) const;
       
  1543 
       
  1544     /**
       
  1545     * Starts the viewfinder if the engine has been prepared for the 
       
  1546     * current mode.  
       
  1547     * @since 2.8
       
  1548     */
       
  1549     void StartViewFinderL();
       
  1550 
       
  1551     /**        
       
  1552     * Initiate image capture
       
  1553     * @since 2.8
       
  1554     * @return ETrue if the capture was initiated otherwise EFalse
       
  1555     */
       
  1556     TBool DoCaptureL();
       
  1557 
       
  1558     /**
       
  1559     * Initiate video recording
       
  1560     * @since 2.8
       
  1561     */
       
  1562     void DoRecord();
       
  1563 
       
  1564     /**
       
  1565     * Make a local copy of the viewfinder frame to use when
       
  1566     * the viewfinder is frozen
       
  1567     * @since 2.8
       
  1568     */
       
  1569     void CopyFrameL( const CFbsBitmap& aBitmap );
       
  1570 
       
  1571     /**
       
  1572     * Reserve a set of file names for the current capture
       
  1573     * Store the reserved name(s) in iCaptureArray
       
  1574     * @since 2.8
       
  1575     * @param aCaptureMode still, burst or video mode
       
  1576     * @param aForcePhoneMem force path to use Phone memory (C:)
       
  1577     */
       
  1578     void ReserveFileNamesL( 
       
  1579            const TCamCameraMode&       aCaptureMode,
       
  1580            const TCamImageCaptureMode& aImageMode,
       
  1581            TBool                       aForcePhoneMem = EFalse );
       
  1582 
       
  1583     /**
       
  1584     * Create a file ready for saving captured image into
       
  1585     * @since 2.8
       
  1586     * @param aFs: Handle to RFs
       
  1587     * @param aFullPath: Full path including drive and extension
       
  1588     * @return error code from file creation
       
  1589     */
       
  1590     TInt CreateDummyFileL( RFs& aFs, const TDesC& aFullPath );
       
  1591 
       
  1592 
       
  1593     /**
       
  1594     * Store file name and full file name (incl. path)
       
  1595     * to burst capture array
       
  1596     * @since 2.8
       
  1597     * @param aFullPath: Full path including drive and extension
       
  1598     */
       
  1599     void StoreNextFileNameL( const TDesC& aFullPath );
       
  1600 
       
  1601     /**
       
  1602     * Generate a new file name and full path for saving the next video
       
  1603     * according to the specified mode (unless specified otherwise)
       
  1604     * @since 2.8
       
  1605     * @param aForcePhoneMem force path to use Phone memory (C:)
       
  1606     */
       
  1607     void GenerateNextVideoFilePathL( TBool aForcePhoneMem = EFalse );
       
  1608     
       
  1609     /**
       
  1610     * Generate a new path for saving the next image
       
  1611     * @since 3.0
       
  1612     */
       
  1613     void GenerateNextValidImagesPathL();
       
  1614 
       
  1615     /**
       
  1616     * Generate a new file name and full path for saving the next video
       
  1617     * according to the specified mode.  File will always be 
       
  1618     * available.
       
  1619     * @since 2.8      
       
  1620     */
       
  1621     void GenerateNextValidVideoPathL();
       
  1622 
       
  1623     /**
       
  1624     * Handle a notification from the autofocus custom extension
       
  1625     * @since 2.8
       
  1626     */
       
  1627     void HandleAutoFocusNotification( TCamExtAutoFocus aNotification );
       
  1628 
       
  1629     /**
       
  1630     * Static callback function for idle timer expiry
       
  1631     * @since 2.8
       
  1632     * @param aPtr Pointer to an instance of the CCamAppController
       
  1633     * @return TInt to indicate if function should be called again
       
  1634     */
       
  1635         static TInt IdleTimeoutL( TAny* aPtr );
       
  1636    
       
  1637         /**
       
  1638     * Static callback function for time lapse timer expiry
       
  1639     * @since 3.0
       
  1640     * @param aPtr Pointer to an instance of the CCamAppController
       
  1641     * @return TInt to indicate if function should be called again
       
  1642     */     
       
  1643     static TInt TimeLapseTimeoutL( TAny* aPtr );
       
  1644 
       
  1645 private: // Deep sleep timer
       
  1646     /**
       
  1647     * Static callback function for camera deep sleep
       
  1648     * @since S60 5.0
       
  1649     * @param aPtr Pointer to an instance of the CCamAppController
       
  1650     * @return TInt dummy
       
  1651     */
       
  1652     static TInt DeepSleepTimeout( TAny* aPtr );
       
  1653 
       
  1654     /**
       
  1655     * Deep sleep timeout handler
       
  1656     */
       
  1657     void DoDeepSleepTimeout();
       
  1658 
       
  1659 public: // Deep sleep timer
       
  1660     /**
       
  1661     * Start deep sleep timer
       
  1662     */
       
  1663     void DeepSleepTimerStart();
       
  1664     
       
  1665     /**
       
  1666     * Cancel deep sleep timer
       
  1667     */
       
  1668     void DeepSleepTimerCancel();
       
  1669 
       
  1670 private:
       
  1671     /**
       
  1672     * Set video length (max or short)
       
  1673     * @param aLength Length of video
       
  1674     * @since 2.8
       
  1675     */
       
  1676     void SetVideoLengthL( TInt aLength );
       
  1677 
       
  1678     /**
       
  1679     * Returns the current photo storage location.
       
  1680     * @return the photo storage location
       
  1681     * @since 2.8
       
  1682     */
       
  1683     TInt CurrentPhotoStorageLocation() const;
       
  1684 
       
  1685     /**
       
  1686     * Returns the current video storage location.
       
  1687     * @return the video storage location
       
  1688     * @since 2.8
       
  1689     */
       
  1690     TInt CurrentVideoStorageLocation() const;    
       
  1691     
       
  1692         /**
       
  1693         * Returns ETrue if the supplied toneId should be silent if the profile is 
       
  1694         * set to silent. Does *not* take into account network variant forcing 
       
  1695         * sounds on.
       
  1696         * @since 3.0
       
  1697         * @param aSoundId The tone to check
       
  1698         * @return ETrue if sound should always be played, else EFalse           
       
  1699         */
       
  1700     TBool ToneShouldBeSilent( TCamSoundId aSoundId );
       
  1701 
       
  1702         /**
       
  1703         * Report to any observers that capture processing has completed
       
  1704         * @since 3.0      
       
  1705         */    
       
  1706     void HandleCaptureCompletion();
       
  1707 
       
  1708     /**
       
  1709     * Tries to autofocus, will do nothing if camera in use is not
       
  1710     * primary camera, or focus range has not been set first
       
  1711     * @since 3.0
       
  1712     * @return Whether or not auto focus has been initiated
       
  1713     */
       
  1714     TBool TryAutoFocus();
       
  1715 
       
  1716     /**
       
  1717     * Checks the current scene, and where required, updates the autofocus
       
  1718     * mode in use.  Called when the photo scene or based-on-scene change
       
  1719     * @since 3.0      
       
  1720     * @param aForceAFReset Whether to force a ResetToIdle independant of scene mode
       
  1721     */    
       
  1722     void CheckAfModeForScene( TBool aForceAFReset = EFalse );
       
  1723 
       
  1724     /**
       
  1725     * Initalises the AutoFocus interface, if needed
       
  1726     * @since 3.0
       
  1727     */
       
  1728     void InitAutoFocusL();
       
  1729     
       
  1730     /**
       
  1731     * Timeout to play capture tone after delay (to match
       
  1732     * capture tone to actual capture event)
       
  1733     * @since 3.0
       
  1734     * @param aPtr TAny* ptr (cast to CCamAppController)
       
  1735     * @return Error code retruned by function
       
  1736     */
       
  1737     static TInt CaptureToneDelayTimeout( TAny* aPtr );
       
  1738     
       
  1739     /**
       
  1740     * Play the capture tone (called from capture delay timeout)
       
  1741     * @since 3.0
       
  1742     */
       
  1743     void PlayDelayedCaptureTone();
       
  1744 
       
  1745     /**
       
  1746     * Copy Snapshot if needed. Helper function for McaeoSnapImageReady
       
  1747     * @since 3.0
       
  1748     * @param aSnapshot the snapshot to copy
       
  1749     * @param aError Error code KErrNone to indicate success or a
       
  1750     *               standard Symbian OS error code.        
       
  1751     */
       
  1752     void CopySnapshotIfNeeded(const CFbsBitmap& aSnapshot, TInt aError);
       
  1753     
       
  1754    
       
  1755     /**
       
  1756     * Checks whether flash is required for taking a picture.
       
  1757     * @return true if flash is required current mode
       
  1758     */
       
  1759     TBool FlashRequired() const;              
       
  1760 
       
  1761 
       
  1762 private:  // Functions from base classes
       
  1763 
       
  1764     /**
       
  1765     * From MCamImageSaveObserver, image save has completed
       
  1766     * @since 2.8
       
  1767     */
       
  1768     void HandleSaveEvent( TCamSaveEvent aEvent );
       
  1769     
       
  1770     /**
       
  1771     * From MCamImageSaveObserver, image save has completed
       
  1772     * @since 2.8
       
  1773     */
       
  1774     void HandleFileHarvestingComplete();
       
  1775 
       
  1776     /**
       
  1777     * Idle timeout expiry - invoke switch to standby mode
       
  1778     * @since 2.8
       
  1779     * @return TInt to indicate if function should be called again
       
  1780     */
       
  1781     TInt DoIdleTimeoutL();
       
  1782 
       
  1783     /**
       
  1784     * Time lapse timeout expiry - update the remaining time countdown
       
  1785     * or initiate the next capture if the full period has expired
       
  1786     * @return TInt to indicate if function should be called again
       
  1787     */
       
  1788     TInt DoTimeLapseTimeoutL();
       
  1789 
       
  1790     /**
       
  1791     * Force the application to use phone memory for Video and Image saving.
       
  1792     * Typically called when attempting to access MMC fails.
       
  1793     * @since 2.8
       
  1794     */        
       
  1795     void ForceUsePhoneMemoryL( TBool aEnable = ETrue );
       
  1796 
       
  1797     /**
       
  1798     * Complete the burst operation
       
  1799     * @since 2.8
       
  1800     */      
       
  1801     void CompleteBurstOperation();
       
  1802     
       
  1803     /**
       
  1804     * Complete the time lapse operation
       
  1805     * @since 3.0
       
  1806     */  
       
  1807     void CompleteTimeLapseOperation();
       
  1808 
       
  1809 
       
  1810     /**
       
  1811     * Whether or not the engine is currently processing a capture
       
  1812     * still, video or sequence.
       
  1813     * @since 2.8
       
  1814     * @return ETrue if the engine is performing a capture operation
       
  1815     */
       
  1816     TBool EngineProcessingCapture() const;
       
  1817 
       
  1818     /**
       
  1819     * Handle an arriving call. Stops video and cancels sequence capture
       
  1820     * in early stages.
       
  1821     * @since 2.8
       
  1822     */
       
  1823     void HandleIncomingCall();
       
  1824 
       
  1825     /**
       
  1826 * Cleans up the controller active camera state
       
  1827     * @param aAny Pointer to the object which is the target 
       
  1828     * of the cleanup operation
       
  1829     * @since 2.8
       
  1830     */
       
  1831     static void Cleanup( TAny* aAny );
       
  1832     
       
  1833     /**
       
  1834     * Immediately cancels a still capture at any stage.
       
  1835     * @since 2.8
       
  1836     */
       
  1837     void CancelStillCaptureNow();
       
  1838     
       
  1839     /**
       
  1840     * Attempt to cleanup capture array if burst capture fails
       
  1841     * @since 2.8
       
  1842     * @param aImageCountDelivered number of images delivered
       
  1843     * @param aError error returned from burst capture operation
       
  1844     */
       
  1845     void TidyCaptureArray( TInt aImageCountDelivered, 
       
  1846                                     TInt aError );
       
  1847    
       
  1848     /**
       
  1849     * Load 2ndary caera specifc settings (on construction or camera switch)
       
  1850     * @since 3.0
       
  1851     */
       
  1852     void LoadSecondaryCameraSettingsL();
       
  1853 
       
  1854   // -------------------------------------------------------
       
  1855   // Orientation sensor / rotation related
       
  1856 public:
       
  1857 
       
  1858     /**
       
  1859     * Get current orientation to be used on image rotation.
       
  1860     * Always ECamOrientation0 if rotation setting is OFF.
       
  1861     * @return Current image orientation value.
       
  1862     */
       
  1863     TCamImageOrientation ImageOrientation() const;
       
  1864     
       
  1865     /**
       
  1866       *  Checks if mass storage exist in current phone.
       
  1867       *  @ return True if Mass storage exist
       
  1868       */
       
  1869      TBool ExistMassStorage() const;
       
  1870 
       
  1871     /**
       
  1872       *  Checks if a memory type is available on the phone.
       
  1873       *  @param aStorage TCamMediaStorage enum specifiying the type of storage;
       
  1874       *  	default=ECamMediaStorageCurrent
       
  1875       *  @return ETrue if the Memory type is available
       
  1876       */
       
  1877      TBool IsMemoryAvailable( const TCamMediaStorage aStorage = 
       
  1878         ECamMediaStorageCurrent, TBool aIgnoreUsbPersonality = EFalse ) const;
       
  1879     
       
  1880   public:
       
  1881 
       
  1882     /**
       
  1883     * Update the sensor api object
       
  1884     * @since 3.0
       
  1885     * @param aStartupApi eTrue if we need to recreate the Api
       
  1886     */
       
  1887     void UpdateSensorApiL( TBool aStartupApi );
       
  1888     
       
  1889     /**
       
  1890     * Forces a refresh of the local copy of the back slide status
       
  1891     * @since 2.8
       
  1892     */
       
  1893     void RefreshSlideStatus();
       
  1894 
       
  1895   private:
       
  1896 
       
  1897     /**
       
  1898     * From MSensrvDataListener receive Sensor Data
       
  1899     *
       
  1900     * Indicates data is available in the receiving buffer. A client can read 
       
  1901     * the data through GetData()-function in the related channel object. Data 
       
  1902     * is valid until the data received notification occurs again.
       
  1903     *
       
  1904     * @since 5.0
       
  1905     * @param[in] aChannel Reference to the related channel object
       
  1906     * @param[in] aCount Data object count in receiving buffer.
       
  1907     * @param[in] aDataLost Number of lost data items. Data loss can occur if
       
  1908     *     the client does not request new data from server fast enough. This 
       
  1909     *     can happen
       
  1910     *     when system is under heavy load and the client process has lower
       
  1911     *     priority than sensor server process. If data loss is a problem, 
       
  1912     *     consider using higher object count in data listening, which will reduce 
       
  1913     *     number of expensive IPC calls used in data transmission.
       
  1914     */
       
  1915     void DataReceived( CSensrvChannel& aChannel, 
       
  1916                        TInt aCount, 
       
  1917                        TInt aDataLost );
       
  1918     /**
       
  1919     * From MSensrvDataListener receive data error notice
       
  1920     *
       
  1921     * Data listening failed. 
       
  1922     * If error was fatal, channel has also been closed and sensor server session 
       
  1923     * terminated. If error was minor, some data has potentially been lost.
       
  1924     *
       
  1925     * @since 5.0
       
  1926     * @param[in] aChannel Reference to the related channel object
       
  1927     * @param[in] aError Error code.
       
  1928     */
       
  1929     void DataError( CSensrvChannel& aChannel, 
       
  1930                     TSensrvErrorSeverity aError );
       
  1931 
       
  1932     /** 
       
  1933     * From MSensrvDataListener
       
  1934     *
       
  1935     * Returns a pointer to a specified interface - to allow future extension
       
  1936     * of this class without breaking binary compatibility
       
  1937     *
       
  1938     * @since S60 5.0
       
  1939     * @param aInterfaceUid Identifier of the interface to be retrieved
       
  1940     * @param aInterface A reference to a pointer that retrieves the specified interface.
       
  1941     */
       
  1942     void GetDataListenerInterfaceL( TUid aInterfaceUid, 
       
  1943                                     TAny*& aInterface );
       
  1944                                                     
       
  1945     /**
       
  1946     * Set image rotation parameters
       
  1947     * @since 3.0
       
  1948     */
       
  1949     void SetImageOrientationL();
       
  1950 
       
  1951     /**
       
  1952     * Mapping from Sensor orientation data type to our own
       
  1953     * image orientation type.
       
  1954     * @param aSensorOrientation Orientation Sensor device orientation value.
       
  1955     * @return Camera orientation value.
       
  1956     */
       
  1957     static TCamImageOrientation MapSensorOrientatio2CamOrientation( 
       
  1958         const TSensrvOrientationData::TSensrvDeviceOrientation& aSensorOrientation, TCamImageOrientation aLastImageOrientation);
       
  1959         
       
  1960     /**
       
  1961     * Mapping from camera orientation data type to bitmap orientation type.
       
  1962     * @param camera orientation value.
       
  1963     * @return CBitmapRotator::TRotationAngle.
       
  1964     */
       
  1965     static CBitmapRotator::TRotationAngle MapCamOrientation2RotationAngle( 
       
  1966         const TCamImageOrientation aOrientation );        
       
  1967     
       
  1968   // -------------------------------------------------------
       
  1969 
       
  1970   private:        
       
  1971    
       
  1972         /**
       
  1973         * From MPropertyObserver Handle change in a watched property
       
  1974         * @since 2.8
       
  1975         * @param aCategory The type of property
       
  1976         * @param aKey The property that has changed
       
  1977         */
       
  1978         void HandlePropertyChangedL( const TUid& aCategory, const TUint aKey );
       
  1979           
       
  1980   private:        
       
  1981 
       
  1982         /**
       
  1983          * Callback function that is called when lens cover state changes.
       
  1984          * Used to implement delayed handling of lens cover events.
       
  1985          * @param aPtr Pointer to CCamAppController
       
  1986          * @return 
       
  1987          */
       
  1988         static TInt LensCoverUpdateL( TAny* aPtr );
       
  1989   
       
  1990         /**
       
  1991         * Handles the slide closed event
       
  1992         * @since 2.8
       
  1993         */
       
  1994         void HandleSlideClosedL();
       
  1995         
       
  1996         /**
       
  1997         * Handles the slide open event
       
  1998         * @since 2.8
       
  1999         */
       
  2000         void HandleSlideOpenedL();        
       
  2001 
       
  2002  
       
  2003     private: // Functions from base classes
       
  2004 
       
  2005         /**
       
  2006         * From MCamObserver
       
  2007         * Receives event codes from observables
       
  2008         * @since 3.0
       
  2009         * @param aEvent The event code
       
  2010         */
       
  2011         void HandleObservedEvent( TCamObserverEvent aEvent );
       
  2012 
       
  2013         /**
       
  2014         * Returns whether or not the current profile is silent
       
  2015         * @since 3.0
       
  2016         * @return ETrue if current profile is silent
       
  2017         */
       
  2018         TBool IsProfileSilentL();      
       
  2019 
       
  2020          /**
       
  2021         * Static callback function for backlight timer reset
       
  2022         * since 3.0
       
  2023         * @param aPtr Pointer to an instance of the CCamAppController
       
  2024         * @return TInt to indicate if function should be called again
       
  2025         */
       
  2026         static TInt ResetInactivityTimer( TAny* aPtr );
       
  2027         
       
  2028         /**
       
  2029     * Enable or disable the system screensaver
       
  2030     * @since 3.0
       
  2031     * @param aEnable ETrue if the screensaver is enabled
       
  2032     *           else EFalse
       
  2033     */  
       
  2034     void EnableScreenSaver( TBool aEnable );
       
  2035 
       
  2036     /**
       
  2037      * Static callback function for timer callback for closing 
       
  2038      * location trail.
       
  2039      * @since S60 v5.0
       
  2040      * @param aPtr Pointer to an instance of the CCamAppController
       
  2041      * @return TInt to indicate if function should be called again
       
  2042      */             
       
  2043      static TInt RetryStopLocationTrail( TAny* aPtr );   
       
  2044      
       
  2045     public:
       
  2046         void StartLocationTrailL();
       
  2047         void StopLocationTrail( TBool aCloseSession = EFalse );
       
  2048 
       
  2049     public:
       
  2050         /**
       
  2051         * Returns a pointer to flash status object. Never NULL if
       
  2052         * ConstructL has been executed successfully.
       
  2053         * @return flashStatusPointer
       
  2054         */
       
  2055         CCamFlashStatus* FlashStatus() const;        
       
  2056         
       
  2057         /**
       
  2058         * Returns false, if a picture cannot be taken, due to flash being
       
  2059         * required and recharged, true otherwise.
       
  2060         * @return flashstatus
       
  2061         */
       
  2062         TBool CheckFlash() const;
       
  2063         
       
  2064         /**
       
  2065         * Called when about to switch to burst or timelapse mode. Stores
       
  2066         * the current flash mode and scene.
       
  2067         */
       
  2068         void SaveFlashMode();
       
  2069         
       
  2070         /**
       
  2071         * Called when switching to single image capture mode. Restores
       
  2072         * flash mode, if using same scene mode as was used when the
       
  2073         * flash mode was stored. Otherwise clears the stored info.
       
  2074         */
       
  2075         void RestoreFlashMode();
       
  2076         
       
  2077      public:
       
  2078         /**
       
  2079         * Returns a pointer to dynamic Configuration Manager.
       
  2080         *
       
  2081         * Never NULL if ConstructL has been executed successfully.
       
  2082         * @return Pointer to Configuration Manager
       
  2083         */
       
  2084         CCamConfiguration* Configuration() const;
       
  2085 
       
  2086 
       
  2087         /**
       
  2088         * Returns whether or not the keylock is on
       
  2089         * @since 5.0
       
  2090         * @return ETrue if keylock is on, otherwise EFalse
       
  2091         */
       
  2092         TBool IsKeyLockOn();
       
  2093         
       
  2094         /**
       
  2095         * Used to get whether user is sliding in the self timer preview.
       
  2096         * @return ETrue if user is sliding in the self timer preview.
       
  2097         */
       
  2098         inline TBool IsSlideInSelfTimerPreview() const { return iSlideInSelfTimerPreview; };
       
  2099 
       
  2100         /**
       
  2101         * Used to set whether user is sliding in the self timer preview.
       
  2102         * @param aValue the value to indicate whether user is sliding in the self timer preview.
       
  2103         */
       
  2104         inline void SetSlideInSelfTimerPreview( TBool aValue ) { iSlideInSelfTimerPreview = aValue; };
       
  2105 
       
  2106         /**
       
  2107         * Used to get the current storage.
       
  2108         * @return the current storage.
       
  2109         */
       
  2110         TCamMediaStorage CurrentStorage();
       
  2111         
       
  2112         /**
       
  2113         * Returns whether autofocus is still needed before capturing.
       
  2114         * @return ETrue if it's necessary to try autofocus one more time before the capture.
       
  2115         */
       
  2116         TBool IsAfNeeded();
       
  2117         
       
  2118         /**
       
  2119         * Sets an autofocus needed flag, so that autofocus is done after cancel and range set are finished. 
       
  2120         */
       
  2121         void SetAfNeeded( TBool aAfNeeded );
       
  2122         
       
  2123         /**
       
  2124         * Returns whether recording was stopped because USB was connected.
       
  2125         * @return ETrue if video recording was stopped because USB was connected.
       
  2126         */
       
  2127         TBool IsCaptureStoppedForUsb();
       
  2128 
       
  2129         /**
       
  2130         * set the flag of iSetCaptureStoppedForUsb.
       
  2131         */
       
  2132         void SetCaptureStoppedForUsb( TBool aCaptureStoppedForUsb );
       
  2133 		
       
  2134         /**
       
  2135         * Cancels the memory card dismount monitoring
       
  2136         */
       
  2137         void CancelDismountMonitoring();
       
  2138         
       
  2139         /**
       
  2140         * Start the memory card dismount monitoring
       
  2141         */
       
  2142         void StartDismountMonitoring();
       
  2143         
       
  2144         /**
       
  2145         * Returns whether all snapshots have been received in burst mode
       
  2146         * @return ETrue if all snapshots have been received in burst mode.
       
  2147         */
       
  2148         TBool AllSnapshotsReceived();
       
  2149         
       
  2150         /**
       
  2151         * Returns the last made autofocusrequest type or 0, if there are
       
  2152         * no pending autofocus requests.  
       
  2153         */
       
  2154         TInt PendingAFRequest();
       
  2155         
       
  2156         /**
       
  2157 		* Calculates the remaining video recording time based on video
       
  2158 		* quality settings (instead of getting the value from camera
       
  2159 		* controller)
       
  2160 		* @param aStorage TCamMediaStorage enum specifying the type of storage;
       
  2161 		*	 default=ECamMediaStorageCurrent
       
  2162 		* @return remaining time
       
  2163 		*/       
       
  2164 		TTimeIntervalMicroSeconds 
       
  2165 			CalculateVideoTimeRemainingL(const TCamMediaStorage 
       
  2166 										aStorage = ECamMediaStorageCurrent);
       
  2167         /**
       
  2168         * Sets orientation of the application to CCamera
       
  2169         * 
       
  2170         */
       
  2171         void SetCameraOrientationModeL( TInt aOrientation );
       
  2172         
       
  2173         /**
       
  2174         * Final part in constructing cameracontroller
       
  2175         * 
       
  2176         */
       
  2177         void CompleteCameraConstructionL();
       
  2178         
       
  2179         /**
       
  2180          * Returns index of current image.
       
  2181          */
       
  2182         TInt CurrentImageIndex();
       
  2183         
       
  2184         /**
       
  2185          * Sets the value defining the need for CAE video init and prepare
       
  2186          */
       
  2187         void SetVideoInitNeeded( TBool aVideoInitNeeded );
       
  2188 
       
  2189         /**
       
  2190          * Returns the value defining the need for CAE video init and prepare
       
  2191          */
       
  2192         TBool VideoInitNeeded();
       
  2193         
       
  2194         /**
       
  2195          * Stores the UserScene settings
       
  2196          */
       
  2197         void StoreUserSceneSettingsL();
       
  2198         
       
  2199   private:
       
  2200 
       
  2201     // -----------------------------------------------------
       
  2202     // Construction parts
       
  2203 
       
  2204     void ConstructCameraControllerL( TInt aCameraIndex );
       
  2205 
       
  2206     // -----------------------------------------------------
       
  2207     // Helper utility methods  
       
  2208     TInt GetCriticalMemoryLevelL( const TCamMediaStorage& aStorage );
       
  2209 
       
  2210     // -----------------------------------------------------
       
  2211     // Events and requests handling  
       
  2212     void EventHandlingErrorRecovery( TInt aError );
       
  2213 
       
  2214     void HandleSequenceEventL( TInt              aStatus, 
       
  2215                                TCamCameraEventId aEventId, 
       
  2216                                TAny*             aEventData );
       
  2217 
       
  2218     void HandleRequestEventL( TInt              aStatus, 
       
  2219                               TCamCameraEventId aEventId, 
       
  2220                               TAny*             aEventData );
       
  2221 
       
  2222     void HandleSettingEventL( TInt              aStatus, 
       
  2223                               TCamCameraEventId aEventId, 
       
  2224                               TAny*             aEventData );
       
  2225 
       
  2226     void HandleImageCaptureEventL( TInt             aStatus, 
       
  2227                                    CCamBufferShare* aShare  );
       
  2228     void HandleImageStopEventL( TInt aStatus, 
       
  2229                                 TInt aFullCaptureCount  );
       
  2230 
       
  2231     void HandleViewfinderFrame( TInt aStatus, CFbsBitmap* aFrame );
       
  2232     void HandleSnapshotEvent( TInt aStatus, CFbsBitmap* aBitmap );
       
  2233     void HandleVideoAsyncStopEvent( TInt aStatus );
       
  2234     void HandleVideoStopEvent( TInt aStatus );
       
  2235 
       
  2236     void IssueModeChangeSequenceL( TBool aStartup = EFalse );
       
  2237     void GenerateModeChangeSequenceL( RCamRequestArray& aSequence );
       
  2238     void GenerateStartupSequenceL( RCamRequestArray& aSequence );
       
  2239     
       
  2240     void IssueRequestL( const TCamCameraRequestId& aId );
       
  2241     void IssueDirectRequestL( const TCamCameraRequestId& aId );
       
  2242     void IssueSettingsChangeRequestL();
       
  2243 
       
  2244     void ProceedPendingOrNotifyReadyL();
       
  2245 
       
  2246     void DoVideoNameRetryL( TInt aStatus );
       
  2247     
       
  2248     /**
       
  2249     * Sets the current image/video settings from UI to camera, by calling
       
  2250     * RestoreSettingIfNecessaryL for each supported setting, and starting
       
  2251     * the setting process if any of them needs setting.
       
  2252     * This function needs to be called after camera release and switches
       
  2253     * between image/video mode.
       
  2254     */    
       
  2255     void RestoreSettingsToCameraL();
       
  2256     
       
  2257     /**
       
  2258     * Checks if the setting needs restoring (UI setting value doesn't match
       
  2259     * the actual setting value in camera).  In that case, function adds
       
  2260     * this setting to the list of pending settings.
       
  2261     * @param aSettingItem Setting item id
       
  2262     */    
       
  2263     void RestoreSettingIfNecessaryL( TCamSettingItemIds aSettingItem );
       
  2264 
       
  2265     /**
       
  2266     * Checks if the setting needs restoring (UI setting value doesn't match
       
  2267     * the actual setting value in camera).  In that case, function 
       
  2268     * directly set settting to camera
       
  2269     * @param aSettingItem Setting item id
       
  2270     */ 
       
  2271     void DirectRestoreSettingIfNecessaryL( TCamSettingItemIds aSettingItem );
       
  2272 
       
  2273     /**
       
  2274     * Set internal state based on camera event.
       
  2275     */
       
  2276     void SetStateFromEvent( TCamCameraEventId aEventId );
       
  2277 
       
  2278     void InitCaptureLimitL();
       
  2279     
       
  2280     static TCamCameraRequestId 
       
  2281            NextRequestL( const TCamCameraState& aFrom, 
       
  2282                          const TCamCameraState& aTo   );
       
  2283     
       
  2284     static TCamCameraEventId 
       
  2285            ResponseForRequest( const TCamCameraRequestId& aRequestId );
       
  2286            
       
  2287     
       
  2288         /**
       
  2289     * Called when mmc is about to be dismounted
       
  2290     */       
       
  2291     TInt DriveChangeL( TCamDriveChangeType aType );
       
  2292     
       
  2293     /**
       
  2294     * Rotate the snapshot copy before thumbnail creation
       
  2295     */
       
  2296     void RotateSnapshotL();
       
  2297     
       
  2298     /**
       
  2299     * Handle change in image quality setting.
       
  2300     * Handle stopping viewfinder, re-preparing quality and
       
  2301     * restarting viewfinder if viewfinder is running.
       
  2302     * Notify observers about quality change.
       
  2303     */
       
  2304     void HandleImageQualitySettingChangeL();
       
  2305 
       
  2306   // =======================================================
       
  2307   private:    // Data
       
  2308     TBool  iValueIsStored;
       
  2309     CCamCameraController*        iCameraController;
       
  2310     CCamSettingProvider* iSettingProvider;
       
  2311 
       
  2312     TUint                        iBusyFlags; // TCamBusyFlags values    
       
  2313     TCamAppControllerInfo        iInfo;
       
  2314 
       
  2315     // Temporarily stop notifications to observers
       
  2316     TBool                        iMuteNotifications; 
       
  2317 
       
  2318     // Observers of controller events
       
  2319     RPointerArray<MCamControllerObserver> iControllerObservers;
       
  2320     TInt iCameraReferences;
       
  2321 
       
  2322     // The settings model for dynamic and static data.
       
  2323     // CCamSettingsModelBase* iSettingsModel;
       
  2324     MCamSettingsModel*         iSettingsModel;
       
  2325     MCamSettingPreviewHandler* iSettingsPreviewHandler; // Currently same object as iSettingsModel.
       
  2326     RArray<TCamSettingItemIds> iPreviewRollbacks;       // Used when cancelling previews.
       
  2327 
       
  2328     // Used to indicate whether user is sliding in the self timer preview.
       
  2329     TBool iSlideInSelfTimerPreview;
       
  2330 
       
  2331     TBool iVideoPrepareNeeded;       // Video re-prepare needed due to setting change
       
  2332 
       
  2333     // Boolean to record if view finder should be frozen at next frame
       
  2334     TBool iFreezeViewFinder;
       
  2335     // Boolean to indicate that the frozen frame should be updated
       
  2336     TBool iUpdateFrozenFrame;
       
  2337 
       
  2338     // name for next file, including path and extension
       
  2339     TFileName iSuggestedVideoPath;
       
  2340     // Used to indicate that the media storage has been changed tbe
       
  2341     // pathnames need to be checked
       
  2342     TCamMediaStorage iSetNewPathnamesPending;
       
  2343     // Counters used for creating multiple month folders 
       
  2344     TInt iMonthFolderCounters[CCamFolderUtility::ECamFolderTypeLast];
       
  2345     // Counter for image number. 
       
  2346     // Stored locally to avoid performance problems during burst.
       
  2347     TInt iImageNumberCache;
       
  2348 
       
  2349     // Whether or not the engine is initialized for video recording
       
  2350     TBool iVideoRecorderInitialized;
       
  2351 
       
  2352     // estimate of record time elapsed
       
  2353     TTimeIntervalMicroSeconds iVideoTimeElapsed;
       
  2354     // estimate of record time remaining
       
  2355     TTimeIntervalMicroSeconds iVideoTimeRemaining;
       
  2356 
       
  2357     // Whether or not a capture mode transition is in progress
       
  2358     TBool iCaptureModeTransitionInProgress;
       
  2359 
       
  2360     // Active object for saving images to file asynchronously
       
  2361     CCamImageSaveActive* iImageSaveActive;
       
  2362     // Array containing data that represents the images in a burst capture
       
  2363     CCamBurstCaptureArray* iCaptureArray;
       
  2364     // Index into burst capture array used to determine current image for
       
  2365     // SnapshotImage(), CurrentImageName(), CurrentFullFileName() and
       
  2366     // DeleteCurrentFile(). Set by call to SetAsCurrentImage().
       
  2367     // Single capture and video always use index 0.
       
  2368     TInt iCurrentImageIndex;                  
       
  2369     // Filenames for a timelapse sequence used for the delete sequence option
       
  2370     CDesCArray* iSequenceFilenameArray; 
       
  2371     // Tracks usage of the capture array, for timely release of memory
       
  2372     TInt iArrayUsageCount;
       
  2373     // Capture count requested.
       
  2374     // Used in burst and self-timer+timelapse modes.
       
  2375     TInt iRequestedCaptureCount;
       
  2376     // Indicates wheter autofocuscancel requests should be handled or not..
       
  2377     // Used in CancelFocusAndCapture.
       
  2378     TBool iNoBurstCancel;
       
  2379         
       
  2380         // Indicates if capturekey has been raised or not. This is used to
       
  2381         // determine if bursttimer should be activated or not.
       
  2382         TBool iKeyUP;
       
  2383 
       
  2384     // Timer to control when short burst is changed to  press and hold burst.
       
  2385     CCamTimer* iBurstTimer;   
       
  2386     // Timer for switch to standby mode
       
  2387     CCamTimer* iIdleTimer;
       
  2388     // Timer for initiating Time Lapse captures
       
  2389     CCamTimer* iTimeLapseTimer;
       
  2390         
       
  2391     // Status variable for location trail
       
  2392     TBool iLocationTrailStarted;
       
  2393         
       
  2394     // Timer for stopping location trail 
       
  2395     CCamTimer* iLocationTrailTimer;
       
  2396         
       
  2397 	// Whether or not a capture key pressed during image saving
       
  2398     TBool iCaptureKeyPressedWhileImageSaving;
       
  2399     // flag to indicate current VF status
       
  2400     TBool iViewFinding;
       
  2401     // timer to keep backlight active while VF is running
       
  2402 	CPeriodic* iBacklightTimer;
       
  2403     // Class for playing sounds
       
  2404     CCamAudioPlayerController* iSoundPlayer;
       
  2405     CRepository* iRepository;
       
  2406     TInt iDiskCriticalLevel;        // critical threshold for card storage
       
  2407     TInt iRamDiskCriticalLevel;     // critical threshold for phone memory storage
       
  2408     // Whether we are currently in a call or ringing
       
  2409     TBool iInCallOrRinging;
       
  2410     // Keep track of whether we are currently saving a video clip or image
       
  2411     TBool iSaving;
       
  2412     TBool iSaveStarted;
       
  2413     // Keep track of whether a ReleaseEngine call has been made while an Init call has been made
       
  2414     TBool iPendingRelease;
       
  2415     TBool iEndKeyWaiting;
       
  2416     TBool iCompleteTimeLapsePending;
       
  2417     TBool iAutoFocusRequested;
       
  2418     TBool iCaptureRequested;
       
  2419     TBool iVideoRequested;
       
  2420     TBool iAfNeeded;
       
  2421 
       
  2422     TBool iDemandKeyRelease; // Demand to release capture key
       
  2423 
       
  2424     // Keep track of the camera that the next switch will activate
       
  2425     TInt iNextSwitchIsToPrimaryCamera;
       
  2426 
       
  2427     // Flag for queued Camera switch operation
       
  2428     TCameraSwitchRequired iCameraSwitchRequired;  
       
  2429     
       
  2430     TBool iForceUseOfPhoneMemory;
       
  2431     
       
  2432     // Keeps track of the number of times we have attempted to set the video name
       
  2433     TInt iVideoNameRetries;
       
  2434 
       
  2435     // Specified whether an image save request is pending. That is,
       
  2436     // we are waiting for the engine to return with an image that can be saved.
       
  2437     // Required to let post-capture know whether an image has been saved yet.
       
  2438     TBool iImageSaveRequestPending;
       
  2439 
       
  2440     // Keeps track of the camera slider state so that
       
  2441     // we don't have to keep accessing the shared data file
       
  2442     TInt iSlideState;
       
  2443     TInt iNewSlideState;
       
  2444     
       
  2445     // callback used for delayed slider update
       
  2446     CPeriodic* iSliderCallBack;
       
  2447     
       
  2448     // Slider event flag
       
  2449     TBool iSliderCloseEvent;        
       
  2450 
       
  2451     // The period between each timelapse capture 
       
  2452     TTimeIntervalMicroSeconds iTimeLapseInterval;
       
  2453     // The time at which the previous timelapse capture was initiated
       
  2454     TTime iTimeLapseStartTime;
       
  2455 
       
  2456 
       
  2457 
       
  2458   	CSensrvChannel*       iAccSensorChannel;
       
  2459   	TBool                 iAccSensorListening;
       
  2460   	TBool                 iAccSensorInfoInitialized;
       
  2461     // Flag to allow delayed re-preparation of engine
       
  2462     TBool                 iOrientationChangeOccured;
       
  2463 
       
  2464     // Outside flags, as available for Camera Controller at all times.
       
  2465     TCamImageOrientation  iImageOrientation;
       
  2466     TCamImageOrientation  iLastImageOrientation;
       
  2467     
       
  2468     // Property watcher to report changes in the slide state
       
  2469     CCamPropertyWatcher* iSlideStateWatcher;
       
  2470     // Property watcher to report changes in the keylock state
       
  2471     CCamPropertyWatcher* iKeyLockStatusWatcher;
       
  2472     // Set to ETrue if shutter sound always played
       
  2473     // otherwise playing shutter sound depends on
       
  2474     // current profile
       
  2475     TBool iShutterSndAlwaysOn;
       
  2476     // Active object to listen to the call state.
       
  2477     CCamCallStateAo* iCallStateAo;   
       
  2478     // Organises notifications to observers of capture completion    
       
  2479     CCamObserverHandler* iCaptureCompletionObserverHandler;
       
  2480     TInt iActualBurst;
       
  2481     CCamTimer* iCaptureToneDelayTimer;
       
  2482     // Whether or not the video was stopped due to the phone app
       
  2483     // having the foreground
       
  2484     TBool iVideoStoppedForPhoneApp;        
       
  2485     // used to simulate the receipt of a viewfinder frame when 
       
  2486     // timelapse capturing.
       
  2487     CFbsBitmap* iSnapShotCopy;
       
  2488     // estimated snapshot size in bytes - used when monitoring free
       
  2489     // RAM during burst capture
       
  2490     TInt iSnapshotDataSize;
       
  2491     // array of estimated jpeg sizes in bytes for different image
       
  2492     // resolutions - used when monitoring free RAM during burst capture
       
  2493     RArray<TInt> iJpegDataSizes;
       
  2494     // array of estimated post capture sizes required in bytes for
       
  2495     // different image resolutions - used when monitoring free RAM
       
  2496     // during burst capture
       
  2497     RArray<TInt> iSequencePostProcessDataSizes;        
       
  2498     // Array of CameraEventInterested observers which wanted to be camera
       
  2499     // observers when camera wasn't yet created. When camera is created
       
  2500     // Observers from this array should be attached first and array should
       
  2501     // be cleared.
       
  2502     RArray<const MCamCameraObserver*> iPendingObserversArray;
       
  2503     RArray<TUint> iCameraEventInterested;
       
  2504 
       
  2505      // Used to wake the camera hardware approximately 2-3 seconds before 
       
  2506     // a timelapse capture
       
  2507     TBool iCameraWoken;
       
  2508     TBool iZoomWaitingForCamera;
       
  2509     TBool iNewZoomPending;
       
  2510     TInt iDesiredZoomVal;
       
  2511     
       
  2512     TBool iSequenceCaptureInProgress;
       
  2513     TInt  iLongSequenceLimit;
       
  2514     
       
  2515     // Boolean to determine whether filename has already been
       
  2516     // reserved for the image being currently captured. Reserving 
       
  2517     // is done when either the image's snapshot snapshot or
       
  2518     // image data arrives. (But not again when the other one comes)
       
  2519     TBool iFilenameReserved;
       
  2520     TCamEvCompRange iEvRange;
       
  2521         
       
  2522 #if defined(RD_MDS_2_5) && !defined(__WINSCW__)
       
  2523     RLocationTrail iLocationUtility;
       
  2524     TBool iLocationUtilityConnected;
       
  2525 #endif // __WINSCW__
       
  2526 
       
  2527 #ifdef CAMERAAPP_PERFORMANCE_MEASUREMENT 
       
  2528     TCamPerformanceState iPerformanceState; 
       
  2529 #endif        
       
  2530 
       
  2531     TBool iAppUiAvailable;
       
  2532     // If this boolean is set to true, the next focus successful
       
  2533     // or focus failed event should be ignored as it's resulted by
       
  2534     // moving lens to hyperfocal position when cancelling AF.
       
  2535     TBool iAFCancelInProgress;
       
  2536     // Holds last made autofocusrequest type or 0, if there are no
       
  2537     // pending autofocus requests.
       
  2538     TInt iPendingAFRequest;
       
  2539     // AFrequest currently in processing.    
       
  2540     TInt iCurrentAFRequest;
       
  2541     CCamFlashStatus* iFlashStatus;
       
  2542     TBool iFlashModeSaved;
       
  2543     TCamSceneId iSavedFlashScene;
       
  2544     TCamFlashId iSavedFlashMode;
       
  2545     TBool iSettingsRestoreNeeded;
       
  2546     CCamConfiguration*  iConfiguration; //< Configuration Manager. *owned*    
       
  2547     CCFClient* iContextFwClient;
       
  2548     TBool iDefineContextSuccessful;
       
  2549     TBool iStorageChangeProcessOngoing;
       
  2550     // own.
       
  2551     CCamGSInterface* iPlugin;
       
  2552     TBool iSilentProfile;
       
  2553     TInt iTimeLapseCaptureCount;
       
  2554     RFs iFs;
       
  2555     CCamDriveChangeNotifier* iDriveChangeNotifier;
       
  2556     TCamMediaStorage iCurrentStorage;
       
  2557     TCamMediaStorage iPreferredStorageLocation;
       
  2558     TCamMediaStorage iForcedStorageLocation;
       
  2559     TCamMediaStorage iInitialVideoStorageLocation;
       
  2560     TBool iCaptureStoppedForUsb;
       
  2561     TBool iDismountPending;
       
  2562     TBool iAllSnapshotsReceived;
       
  2563     CCamTimer* iDeepSleepTimer; // own
       
  2564     TBool iDeepSleepTimerExpired;
       
  2565     // not owned by camappcontroller
       
  2566     CCameraUiConfigManager* iConfigManager;
       
  2567     TBool iVideoInitNeeded; // Used to decide if the need to call CAE video init
       
  2568     CCamSyncRotatorAo* iRotatorAo;
       
  2569     CFbsBitmap* iRotatedSnapshot;
       
  2570     CCamBurstCaptureArray* iRotationArray;
       
  2571     CCamSnapShotRotator* iSnapShotRotator;
       
  2572     // orientation at capture time
       
  2573     TCamImageOrientation  iCaptureOrientation;
       
  2574     
       
  2575     };
       
  2576 
       
  2577 #endif      // CAMAPPCONTROLLER_H
       
  2578             
       
  2579 // End of File