camerauis/cameraapp/generic/inc/CamCaptureSetupViewBase.h
branchRCL_3
changeset 24 bac7acad7cb3
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Base class for pre capture views*
       
    15 */
       
    16 
       
    17 
       
    18 #ifndef CAMCAPTURESETUPVIEWBASE_H
       
    19 #define CAMCAPTURESETUPVIEWBASE_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include "CamViewBase.h"
       
    23 
       
    24 // FORWARD DECLARATIONS
       
    25 class CCamCaptureSetupControlHandler;
       
    26 class CCamCaptureSetupContainer;
       
    27 class CCamShootingModeContainer;
       
    28 class CCamInfoListBoxContainer;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33 * Base class for views that need to run capture setup
       
    34 *
       
    35 *  @since 2.8
       
    36 */
       
    37 class CCamCaptureSetupViewBase : public CCamViewBase
       
    38     {
       
    39     public: // data types
       
    40 
       
    41     /**
       
    42     * Setting mode
       
    43     */
       
    44     enum TCamSettingMode
       
    45         {
       
    46         ECamSettingModeNone,
       
    47         ECamSettingModeCaptureMenu,
       
    48         ECamSettingModeCapture,
       
    49         ECamSettingModeScene,
       
    50         ECamSettingModeInfoListBox
       
    51         };
       
    52 
       
    53 		// Info listbox mode 
       
    54 	enum TCamInfoListBoxMode
       
    55 		{
       
    56 		EInfoListBoxModeNone,
       
    57 		EInfoListBoxModeTimeLapse,
       
    58 		EInfoListBoxModeISO
       
    59         };
       
    60 
       
    61     public:  // Constructors and destructor
       
    62         
       
    63         /**
       
    64         * Destructor.
       
    65         * @since 2.8
       
    66         */
       
    67         virtual ~CCamCaptureSetupViewBase();
       
    68 
       
    69     public: // Functions from base classes
       
    70 
       
    71      /**
       
    72         * Handle events sending app to foreground or background
       
    73         * @param aForeground whether the event brings the app to fore or background
       
    74      */       
       
    75         void HandleForegroundEventL( TBool aForeground );
       
    76         
       
    77         /**
       
    78         * From CAknView Handle commands
       
    79         * @since 2.8
       
    80         * @param aCommand command to be handled
       
    81         */
       
    82         void HandleCommandL( TInt aCommand );
       
    83 
       
    84         /**
       
    85         * Handle change of focus to another application
       
    86         * This only handles another application coming to the foreground when
       
    87         * the camera application is already in the background behind an eikon
       
    88         * server window
       
    89         * @since 2.8
       
    90         */
       
    91         void HandleFocusLossL();
       
    92         
       
    93         /**
       
    94         * Revert to normal mode
       
    95         * @since 2.8
       
    96         */
       
    97         virtual void ExitAllModesL();
       
    98 
       
    99     public: // New functions
       
   100 
       
   101         /**
       
   102         * From CAknView deactivate the view (free resources)
       
   103         * @return void
       
   104         */
       
   105         void DoDeactivate();
       
   106         
       
   107          /**
       
   108           * Sets the iSceneSettingModeActive flag
       
   109           * @param aActive What to set iSceneSettingModeActive to
       
   110           */
       
   111         void SetSceneSettingMode(TBool aActive);
       
   112         
       
   113          /**
       
   114           * Sets the iInfoListBoxActive flag
       
   115           * @param aActive What to set iInfoListBoxActive to
       
   116           */
       
   117         void SetInfoListBoxMode(TBool aActive, TBool aFullySkinned=EFalse);        
       
   118         
       
   119          /**
       
   120           * Sets the iCaptureSetupModeActive flag
       
   121           * @param aActive What to set iCaptureSetupModeActive to
       
   122           */
       
   123         void SetCaptureSetupModeActive(TBool aActive);
       
   124             
       
   125     protected:  // New functions
       
   126 
       
   127         /**
       
   128         * C++ default constructor.
       
   129         * @param aController Reference to either the application controller 
       
   130         * base class or test base class
       
   131         * @since 2.8
       
   132         */
       
   133         CCamCaptureSetupViewBase( CCamAppController& aController );
       
   134 
       
   135         /**
       
   136         * Creates a control handler for the appropriate control type
       
   137         * @since 2.8
       
   138         * @param aSetupCommand The command that initiated capture setup mode, used to 
       
   139         *                        determine the required control type
       
   140         */
       
   141         void CreateCaptureSetupControlHandlerL(  TInt aSetupCommand );
       
   142 
       
   143         /**
       
   144         * Enter capture setup mode.
       
   145         * Creates a capture setup control handler and a second container to replace 
       
   146         * the normal container on the control stack. Updates the Cba, title pane 
       
   147         * and navi pane.
       
   148         * Derived classes should override this method to add any additional 
       
   149         * functionality they require e.g. starting the viewfinder in the
       
   150         * appropriate capture mode if it is not already active.
       
   151         * @since 2.8
       
   152         * @param aSetupCommand The command that initiated capture setup mode, used to 
       
   153         *                        determine the required control type
       
   154         */
       
   155         virtual void SwitchToCaptureSetupModeL( TInt aSetupCommand, TBool aFullScreenVF=ETrue );
       
   156 
       
   157         /**
       
   158         * Exit capture setup mode.
       
   159         * Replaces the normal container on the control stack. 
       
   160         * Reverts the Cba and title pane.
       
   161         * Derived classes should override this method to add any additional 
       
   162         * functionality they require e.g exiting the viewfinder and
       
   163         * reverting the navi pane if necessary when switching back to the view's 
       
   164         * normal mode.
       
   165         * @since 2.8
       
   166         */
       
   167         virtual void ExitCaptureSetupModeL();
       
   168 
       
   169 
       
   170         /**
       
   171         * Enter scene setting mode.
       
   172         * Creates a container to replace the normal container on the control stack. 
       
   173         * Updates the Cba, title pane and navi pane.
       
   174         * @since 2.8
       
   175         */
       
   176         virtual void SwitchToSceneSettingModeL();
       
   177 
       
   178         /**
       
   179         * Exit capture setup mode.
       
   180         * Replaces the normal container on the control stack. 
       
   181         * Reverts the Cba and title pane.
       
   182         * @since 2.8
       
   183         */
       
   184         virtual void ExitSceneSettingModeL();
       
   185 
       
   186         /**
       
   187         * Enter InfoListBox mode
       
   188         * Creates a container to replace the normal container on the control stack. 
       
   189         * Updates the Cba, title pane and navi pane.
       
   190         * @param aMode
       
   191         * @since 3.0
       
   192         */
       
   193         virtual void SwitchToInfoListBoxL( TCamInfoListBoxMode aMode, TBool aFullySkinned=EFalse );        
       
   194 
       
   195         /**
       
   196         * Handle InfoListBox item selection
       
   197         * Updates the Cba, title pane and navi pane.
       
   198         * @since 3.0
       
   199         */
       
   200    		virtual void HandleInfoListBoxSelectionL();
       
   201         
       
   202         /**
       
   203         * Exit InfoListBox
       
   204         * Updates the Cba, title pane and navi pane.
       
   205         * @since 3.0
       
   206         */        
       
   207         virtual void ExitInfoListBoxL();
       
   208 
       
   209         /**
       
   210         * Determine the title pane resource for the current setup mode
       
   211         * @since 2.8
       
   212         * @return Id of the title pane text for current setup mode
       
   213         */
       
   214         TInt SetupModeTitlePaneResourceId();
       
   215 
       
   216         /**
       
   217         * From MEikMenuObserver Changes MenuPane dynamically
       
   218         * @param aResourceId Resource Id
       
   219         * @param aMenuPane Handle to menu pane
       
   220         * @since 2.8
       
   221         */
       
   222         void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
   223 
       
   224         void CaptureSetupModeSelection();
       
   225     private:
       
   226 
       
   227         /**
       
   228         * Cleans up the capture setup container if a leave occurs
       
   229         * while switching to capture setup mode
       
   230         * @param aAny pointer to the object to cleanup
       
   231         * @since 2.8
       
   232         */
       
   233         static void CleanupCaptureSetupContainer( TAny* aAny );
       
   234 
       
   235         /**
       
   236         * Cleans up the scene setting container if a leave occurs
       
   237         * while switching to scene setting mode
       
   238         * @param aAny pointer to the object to cleanup
       
   239         * @since 2.8
       
   240         */
       
   241         static void CleanupSceneSettingContainer( TAny* aAny );
       
   242 
       
   243         /**
       
   244         * Cleans up InfoListBox if a leave occurs
       
   245         * while switching to scene setting mode
       
   246         * @param aAny pointer to the object to cleanup
       
   247         * @since 2.8
       
   248         */
       
   249         static void CleanupInfoListBox( TAny* aAny );
       
   250 
       
   251         /**
       
   252         * Cleans up the containers if a leave occurs
       
   253         * while exiting scene setting/capture setup mode
       
   254         * @param aAny pointer to the object to cleanup
       
   255         * @since 2.8
       
   256         */
       
   257         static void CleanupExit( TAny* aAny );
       
   258 
       
   259     protected: // data
       
   260         // Used to determine when the view is in capture setup mode
       
   261         TBool iCaptureSetupModeActive;
       
   262 
       
   263         // Used to determine when the view is in scene settings mode
       
   264         TBool iSceneSettingModeActive;
       
   265         
       
   266         // Used to determine InfoListBox is visible
       
   267         TBool iInfoListBoxActive;
       
   268 
       
   269         // Resource Id for title view when in capture setup or scene setting mode
       
   270         TInt iSettingModeTitleResourceId;
       
   271 
       
   272         // Used to determine when user has pressed change button        
       
   273         TBool iChangeButtonPressed;
       
   274 
       
   275     protected:
       
   276         // A container that the view uses when in scene settings mode
       
   277         CCamShootingModeContainer* iSceneSettingContainer;        
       
   278         
       
   279         // Container for other settings using info listbox
       
   280         CCamInfoListBoxContainer* iInfoListBoxContainer;
       
   281         // Purpose of current instance of iInfoListBoxContainer
       
   282         TCamInfoListBoxMode iInfoListBoxMode;                
       
   283         
       
   284         TBool iForceAvkonCBA;
       
   285     private:   // data
       
   286 
       
   287         // Handler for the capture setup control
       
   288         CCamCaptureSetupControlHandler* iCaptureSetupControlHandler;
       
   289         
       
   290         // A second container that the view uses when in capture setup mode
       
   291         CCamCaptureSetupContainer* iCaptureSetupContainer;
       
   292         
       
   293         // Stores the previous capture mode of camera before entering Infolistbox mode 
       
   294         TCamPreCaptureMode iPrevCaptureMode;
       
   295 
       
   296     };
       
   297 
       
   298 #endif      // CAMCAPTURESETUPVIEWBASE_H 
       
   299             
       
   300 // End of File