camerauis/cameraapp/generic/src/CamCaptureSetupViewBase.cpp
changeset 0 1ddebce53859
child 10 8c55c525d5d7
equal deleted inserted replaced
-1:000000000000 0:1ddebce53859
       
     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 // INCLUDE FILES
       
    19 #include <eikmenub.h>
       
    20 
       
    21 #include <cameraapp.rsg>
       
    22 #include <vgacamsettings.rsg>
       
    23 
       
    24 #include "CamCaptureSetupViewBase.h"
       
    25 #include "CamAppUiBase.h"
       
    26 #include "CamAppController.h"
       
    27 #include "CamUtility.h"
       
    28 #include "CamCaptureSetupControlHandler.h"
       
    29 #include "CamCaptureSetupContainer.h"
       
    30 #include "CamShootingModeContainer.h"
       
    31 #include "CamInfoListBoxContainer.h"
       
    32 #include "CamPanic.h"
       
    33 #include "Cam.hrh"
       
    34 #include "CamZoomPane.h"
       
    35 #include "CamTimeLapseUtility.h"
       
    36 #include "camactivepalettehandler.h"
       
    37 #include "CamAppUi.h"
       
    38 
       
    39 #include <akntoolbar.h>
       
    40 
       
    41 // ========================= MEMBER FUNCTIONS ================================
       
    42 
       
    43 
       
    44 // ---------------------------------------------------------------------------
       
    45 // CCamPreCaptureViewBase destructor
       
    46 // 
       
    47 // ---------------------------------------------------------------------------
       
    48 //
       
    49 CCamCaptureSetupViewBase::~CCamCaptureSetupViewBase()
       
    50   {
       
    51   PRINT( _L("Camera => ~CCamCaptureSetupViewBase") );
       
    52   if( AppUi() )
       
    53     {
       
    54     if ( iCaptureSetupContainer )
       
    55       {
       
    56       AppUi()->RemoveFromStack( iCaptureSetupContainer );
       
    57       delete iCaptureSetupContainer;
       
    58       }
       
    59     if ( iSceneSettingContainer )
       
    60       {
       
    61       AppUi()->RemoveFromStack( iSceneSettingContainer );
       
    62       delete iSceneSettingContainer;
       
    63       iSceneSettingContainer = NULL;
       
    64       }
       
    65     if ( iInfoListBoxContainer )
       
    66       {
       
    67       AppUi()->RemoveFromStack( iInfoListBoxContainer );
       
    68       delete iInfoListBoxContainer;
       
    69       }        
       
    70     }
       
    71   PRINT( _L("Camera <= ~CCamCaptureSetupViewBase") );
       
    72   }
       
    73 
       
    74 // -----------------------------------------------------------------------------
       
    75 // CCamCaptureSetupViewBase::HandleCommandL
       
    76 // Handle commands
       
    77 // -----------------------------------------------------------------------------
       
    78 //
       
    79 void CCamCaptureSetupViewBase::HandleCommandL( TInt aCommand )
       
    80     {
       
    81     PRINT( _L("Camera => CCamCaptureSetupViewBase::HandleCommandL") );
       
    82     TUid view = Id();
       
    83     
       
    84     TBool userSceneActive = ( view.iUid == ECamViewIdPhotoUserSceneSetup );
       
    85     
       
    86     CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( AppUi() );
       
    87     
       
    88     switch ( aCommand )
       
    89         {
       
    90         case ECamCmdCaptureSetupWhiteBalanceStill: // fallthrough
       
    91         case ECamCmdCaptureSetupColourFilterStill:
       
    92         case ECamCmdCaptureSetupExposureStill:
       
    93         case ECamCmdCaptureSetupWhiteBalanceVideo:
       
    94         case ECamCmdCaptureSetupColourFilterVideo:
       
    95         case ECamCmdCaptureSetupBrightnessStill:
       
    96         case ECamCmdCaptureSetupContrastStill:
       
    97         case ECamCmdCaptureSetupBrightnessVideo:
       
    98         case ECamCmdCaptureSetupContrastVideo:
       
    99         case ECamCmdCaptureSetupImageSharpnessStill:
       
   100             {
       
   101             SwitchToCaptureSetupModeL( aCommand );
       
   102             }
       
   103             break;
       
   104         case ECamCmdCaptureSetupFlashStill:
       
   105         case ECamCmdCaptureSetupSelfTimer:
       
   106             {
       
   107             iController.ExitViewfinderMode( ECamControllerImage );
       
   108             SwitchToCaptureSetupModeL( aCommand );
       
   109             }
       
   110             break;
       
   111         case ECamCmdCaptureSetupSceneStill:
       
   112         case ECamCmdCaptureSetupSceneVideo:
       
   113             {
       
   114             SwitchToSceneSettingModeL();
       
   115             
       
   116              
       
   117             }
       
   118             break;
       
   119         case EAknSoftkeyBack:
       
   120             {
       
   121             if( appUi && appUi->APHandler()->AccessedViaAP() )
       
   122                 {
       
   123                 if( !userSceneActive)
       
   124                 	{
       
   125                 	appUi->APHandler()->APOperationComplete();
       
   126                 	}
       
   127                 
       
   128                 if ( iSceneSettingModeActive )
       
   129                     {
       
   130                     iSceneSettingContainer->SaveSceneSettingIfChangedL();
       
   131                     }
       
   132                 
       
   133                 iChangeButtonPressed = EFalse;
       
   134                 ExitAllModesL();
       
   135                 }
       
   136             else
       
   137                 {
       
   138 				if( iSceneSettingModeActive )
       
   139                	    {
       
   140 	           	   	ExitSceneSettingModeL();
       
   141 	           	    }	
       
   142 	      		else if ( iInfoListBoxActive )
       
   143 	           	    {
       
   144 	           	   	ExitInfoListBoxL();
       
   145 	           		}
       
   146                 }
       
   147             }
       
   148             break;
       
   149         case EAknSoftkeyCancel:
       
   150             {
       
   151             if ( iCaptureSetupModeActive && iCaptureSetupControlHandler )
       
   152                 {
       
   153                 TCamSettingItemIds iSettingItemId = iCaptureSetupControlHandler->SettingType();		
       
   154                 
       
   155                 if ( iSettingItemId == ECamSettingItemDynamicSelfTimer )					//judge if current operation selfTimer
       
   156                   {
       
   157                   iController.SetSlideInSelfTimerPreview(EFalse);
       
   158                   TInt iSelfTimerVal = iController.IntegerSettingValueUnfiltered( ECamSettingItemDynamicSelfTimer );	//get the actual selfTimer value, not the focus one 
       
   159                        
       
   160                   iController.IntSettingChangedL(iSettingItemId, iSelfTimerVal);			//set the actual status to the actual index
       
   161                   }
       
   162 
       
   163                 iController.CancelPreviewChangesL();
       
   164                 // fallthrough to exit CaptureSetup mode
       
   165                 }
       
   166             else if ( iInfoListBoxActive )
       
   167                 {
       
   168                 ExitAllModesL();
       
   169                 break;
       
   170                 }
       
   171             else if ( iSceneSettingModeActive )
       
   172                 {
       
   173                 iChangeButtonPressed = EFalse;
       
   174                 ExitAllModesL();
       
   175                 break;
       
   176                 }
       
   177             else
       
   178                 {
       
   179                 // do nothing, the command is handled by the framework
       
   180                 break;
       
   181                 }
       
   182             }
       
   183             //lint -fallthrough
       
   184         case EAknSoftkeyOk:
       
   185             {
       
   186             if ( iCaptureSetupModeActive && iCaptureSetupControlHandler )
       
   187                 {
       
   188                 TCamSettingItemIds iSettingItemId = iCaptureSetupControlHandler->SettingType();
       
   189                 if ( iSettingItemId == ECamSettingItemDynamicSelfTimer )
       
   190                     {
       
   191                     iController.SetSlideInSelfTimerPreview(EFalse);
       
   192                     }
       
   193 
       
   194                 iController.CommitPreviewChanges();
       
   195                 // fallthrough to exit CaptureSetup mode
       
   196                 }
       
   197             if( appUi && appUi->APHandler()->AccessedViaAP() )
       
   198                {
       
   199                if( !userSceneActive)
       
   200                 	{
       
   201                 	appUi->APHandler()->APOperationComplete();
       
   202                 	}
       
   203                ExitAllModesL();
       
   204                }
       
   205             }
       
   206             break;
       
   207         case ECamMSKCmdAppChange:
       
   208         case EAknSoftkeySelect:
       
   209             {
       
   210             if ( iSceneSettingContainer )
       
   211                 {
       
   212                 
       
   213                 if ( iSceneSettingContainer->UserSceneHighlighted() )
       
   214                     {                  
       
   215                     // use context specific ok options menu if user scene is highlighted
       
   216                     CEikMenuBar* menuBar = MenuBar();            
       
   217                     if ( menuBar )
       
   218                         {
       
   219                         menuBar->SetMenuTitleResourceId( R_CAM_SCENE_SETTING_OK_MENUBAR );
       
   220                         MenuBar()->SetMenuType( CEikMenuBar::EMenuContext );
       
   221                         menuBar->TryDisplayMenuBarL();
       
   222                         menuBar->SetMenuTitleResourceId( R_CAM_SCENE_SETTING_MENUBAR );
       
   223                         //Here we again set back the type of menu to "Options" when pressed LSK
       
   224             			menuBar->SetMenuType( CEikMenuBar::EMenuOptions );
       
   225                         }
       
   226                     break;
       
   227                     }
       
   228                 
       
   229                 } 
       
   230             }
       
   231             //lint -fallthrough
       
   232         case ECamCmdSelect:
       
   233             {
       
   234             if ( iSceneSettingContainer )
       
   235                 {
       
   236                 // If successfully saved the scene change to the settings model
       
   237                 // then exit the scene setting mode.
       
   238                 if ( iSceneSettingContainer->SaveSceneSettingL() )
       
   239                     {
       
   240                     if( appUi && appUi->APHandler()->AccessedViaAP() )
       
   241                         {
       
   242                         if( !userSceneActive)
       
   243 		                	{
       
   244 		                	appUi->APHandler()->APOperationComplete();
       
   245 		                	}
       
   246 		                	
       
   247                         ExitAllModesL();
       
   248                         }
       
   249                     else
       
   250                         {
       
   251                     	ExitSceneSettingModeL();
       
   252                         }
       
   253                     }
       
   254                 }
       
   255             else if( iInfoListBoxContainer )
       
   256             		{
       
   257             		HandleInfoListBoxSelectionL();	
       
   258  					}
       
   259             }
       
   260             break;
       
   261         case ECamCmdEdit:
       
   262             {
       
   263             // If 'change' user scene selected from scene list, exit all
       
   264             // modes in the precapture view and switch view to user scene.
       
   265             if ( iSceneSettingModeActive )
       
   266                 {
       
   267                 iChangeButtonPressed = ETrue;
       
   268             	AppUi()->HandleCommandL( ECamCmdUserScene );
       
   269             	AppUi()->StatusPane()->MakeVisible( ETrue );
       
   270                 }
       
   271             
       
   272             }
       
   273             break;
       
   274         case ECamCmdUserSceneSelected:
       
   275             {
       
   276             // check as a precaution that there is a container and userscene is highlighted
       
   277             if ( iSceneSettingContainer && iSceneSettingContainer->UserSceneHighlighted() )
       
   278                 {
       
   279                                 
       
   280                 // use context specific ok options menu if user scene is highlighted
       
   281                 CEikMenuBar* menuBar = MenuBar();            
       
   282                 if ( menuBar )
       
   283                     {
       
   284                     MenuBar()->SetMenuType( CEikMenuBar::EMenuContext );
       
   285                     menuBar->SetMenuTitleResourceId( R_CAM_SCENE_SETTING_OK_MENUBAR );
       
   286                     menuBar->TryDisplayMenuBarL();
       
   287                     menuBar->SetMenuType( CEikMenuBar::EMenuOptions );
       
   288                     menuBar->SetMenuTitleResourceId( R_CAM_SCENE_SETTING_MENUBAR );
       
   289                     }
       
   290                 }
       
   291             
       
   292             break;
       
   293             }
       
   294         case ECamCmdInternalExit:
       
   295             {
       
   296             if ( appUi )
       
   297                 {
       
   298                 if ( !appUi->ZoomPane()->IsZoomAtMinimum() )
       
   299                     {
       
   300                     appUi->ZoomPane()->ResetZoomTo1x();
       
   301                     }
       
   302                 }
       
   303             ExitAllModesL();
       
   304             CCamViewBase::HandleCommandL( aCommand );
       
   305             }
       
   306             break;
       
   307         case ECamCmdRedrawScreen:
       
   308             {
       
   309             if( iCaptureSetupContainer )
       
   310                 {
       
   311                 iCaptureSetupContainer->DrawDeferred();
       
   312                 }
       
   313             CCamViewBase::HandleCommandL( aCommand );
       
   314             }
       
   315             break;
       
   316         default:
       
   317             {
       
   318             CCamViewBase::HandleCommandL( aCommand );
       
   319             break;
       
   320             }
       
   321         }
       
   322     PRINT( _L("Camera <= CCamCaptureSetupViewBase::HandleCommandL") );
       
   323     }
       
   324 
       
   325 // -----------------------------------------------------------------------------
       
   326 // CCamCaptureSetupViewBase::HandleFocusLossL
       
   327 // Handle focus loss
       
   328 // -----------------------------------------------------------------------------
       
   329 //
       
   330 void CCamCaptureSetupViewBase::HandleFocusLossL()
       
   331     {
       
   332 	// We dont exit any of the modes when we loose focus
       
   333 	// we do it when we gain focus.
       
   334     }
       
   335 
       
   336 // ---------------------------------------------------------------------------
       
   337 // CCamCaptureSetupViewBase::DoDeactivate
       
   338 // From CAknView deactivates the view
       
   339 // ---------------------------------------------------------------------------
       
   340 //
       
   341 void CCamCaptureSetupViewBase::DoDeactivate()
       
   342     {
       
   343     if ( iSceneSettingContainer )
       
   344         {
       
   345         AppUi()->RemoveFromStack( iSceneSettingContainer );
       
   346     
       
   347         delete iSceneSettingContainer;
       
   348         iSceneSettingContainer = NULL;
       
   349         }
       
   350     CCamViewBase::DoDeactivate();
       
   351     }
       
   352 
       
   353 
       
   354 // ---------------------------------------------------------------------------
       
   355 // CCamCaptureSetupViewBase::CCamCaptureSetupViewBase
       
   356 // C++ constructor
       
   357 // ---------------------------------------------------------------------------
       
   358 //
       
   359 CCamCaptureSetupViewBase::CCamCaptureSetupViewBase( CCamAppController& aController )
       
   360     : CCamViewBase( aController )
       
   361     {
       
   362     }
       
   363 
       
   364 // ---------------------------------------------------------------------------
       
   365 // CCamCaptureSetupViewBase::CreateCaptureSetupControlHandlerL
       
   366 // Create a control handler for the correct capture setup item
       
   367 // ---------------------------------------------------------------------------
       
   368 //
       
   369 void CCamCaptureSetupViewBase::CreateCaptureSetupControlHandlerL( TInt aSetupCommand )
       
   370     {
       
   371     __ASSERT_DEBUG( !iCaptureSetupControlHandler, CamPanic( ECamPanicInvalidState ) );
       
   372     TCamSettingItemIds settingItemId = ECamSettingItemDynamicPhotoWhiteBalance;
       
   373     switch ( aSetupCommand )
       
   374         {
       
   375         case ECamCmdCaptureSetupWhiteBalanceStill:
       
   376             {
       
   377             settingItemId = ECamSettingItemDynamicPhotoWhiteBalance;
       
   378             iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_STILL;
       
   379             }
       
   380             break;
       
   381         case ECamCmdCaptureSetupColourFilterStill:
       
   382             {
       
   383             settingItemId = ECamSettingItemDynamicPhotoColourFilter;
       
   384             iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_STILL;
       
   385             }
       
   386             break;
       
   387 
       
   388         case ECamCmdCaptureSetupExposureStill:
       
   389             {
       
   390             settingItemId = ECamSettingItemDynamicPhotoExposure;
       
   391             iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_STILL;
       
   392             }
       
   393             break;
       
   394 
       
   395         case ECamCmdCaptureSetupFlashStill:
       
   396             {
       
   397             settingItemId = ECamSettingItemDynamicPhotoFlash;
       
   398             iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_STILL;
       
   399             }
       
   400             break;
       
   401         case ECamCmdCaptureSetupSelfTimer:
       
   402             {
       
   403             settingItemId = ECamSettingItemDynamicSelfTimer;
       
   404             iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_STILL;
       
   405             }
       
   406             break;
       
   407             
       
   408         case ECamCmdCaptureSetupWhiteBalanceVideo:
       
   409             {
       
   410             settingItemId = ECamSettingItemDynamicVideoWhiteBalance;
       
   411             iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_VIDEO;
       
   412             }
       
   413             break;
       
   414         case ECamCmdCaptureSetupColourFilterVideo:
       
   415             {
       
   416             settingItemId = ECamSettingItemDynamicVideoColourFilter;
       
   417             iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_VIDEO;
       
   418             }
       
   419             break;
       
   420 
       
   421         // User scene settings pages.
       
   422         case ECamCmdCaptureSetupWhiteBalanceUser:
       
   423             {
       
   424             settingItemId = ECamSettingItemUserSceneWhitebalance;
       
   425             iSettingModeTitleResourceId = R_CAM_USER_SCENE_SETUP_TITLE;
       
   426             }
       
   427             break;
       
   428         case ECamCmdCaptureSetupColourFilterUser:
       
   429             {
       
   430             settingItemId = ECamSettingItemUserSceneColourFilter;
       
   431             iSettingModeTitleResourceId = R_CAM_USER_SCENE_SETUP_TITLE;
       
   432             }
       
   433             break;
       
   434         case ECamCmdCaptureSetupExposureUser:
       
   435             {
       
   436             settingItemId = ECamSettingItemUserSceneExposure;
       
   437             iSettingModeTitleResourceId = R_CAM_USER_SCENE_SETUP_TITLE;
       
   438             }
       
   439             break;
       
   440         case ECamCmdCaptureSetupFlashUser:
       
   441             {
       
   442             settingItemId = ECamSettingItemUserSceneFlash;
       
   443             iSettingModeTitleResourceId = R_CAM_USER_SCENE_SETUP_TITLE;
       
   444             }
       
   445             break;
       
   446 
       
   447 		case ECamCmdCaptureSetupBrightnessStill:
       
   448 			{
       
   449 			settingItemId = ECamSettingItemDynamicPhotoBrightness;
       
   450 			iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_STILL;
       
   451 			}
       
   452 			break;
       
   453 		case ECamCmdCaptureSetupContrastStill:
       
   454 			{
       
   455 			settingItemId = ECamSettingItemDynamicPhotoContrast;
       
   456 			iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_STILL;
       
   457 			}
       
   458 			break;
       
   459 		case ECamCmdCaptureSetupBrightnessVideo:
       
   460 			{
       
   461 			settingItemId = ECamSettingItemDynamicVideoBrightness;
       
   462 			iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_VIDEO;
       
   463 			}
       
   464 			break;
       
   465         case ECamCmdCaptureSetupContrastVideo:
       
   466 			{
       
   467 			settingItemId = ECamSettingItemDynamicVideoContrast;
       
   468 			iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_VIDEO;
       
   469 			}
       
   470 			break;
       
   471         case ECamCmdCaptureSetupBrightnessUser:
       
   472             {
       
   473             settingItemId = ECamSettingItemUserSceneBrightness;
       
   474 			iSettingModeTitleResourceId = R_CAM_USER_SCENE_SETUP_TITLE;
       
   475             }
       
   476             break;
       
   477         case ECamCmdCaptureSetupContrastUser:
       
   478             {
       
   479             settingItemId = ECamSettingItemUserSceneContrast;
       
   480 			iSettingModeTitleResourceId = R_CAM_USER_SCENE_SETUP_TITLE;
       
   481             }
       
   482             break;
       
   483 
       
   484         case ECamCmdCaptureSetupImageSharpnessStill:
       
   485             {
       
   486             settingItemId = ECamSettingItemDynamicPhotoImageSharpness;
       
   487 			iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_STILL;
       
   488             }
       
   489             break;
       
   490         case ECamCmdCaptureSetupImageSharpnessUser:
       
   491             {
       
   492             settingItemId = ECamSettingItemUserSceneImageSharpness;
       
   493 			iSettingModeTitleResourceId = R_CAM_USER_SCENE_SETUP_TITLE;
       
   494             }
       
   495             break;
       
   496 
       
   497         case ECamCmdCaptureSetupLightSensitivityStill:
       
   498             {
       
   499             settingItemId = ECamSettingItemDynamicPhotoLightSensitivity;
       
   500             iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_STILL;
       
   501             }
       
   502             break;
       
   503         case ECamCmdCaptureSetupLightSensitivityVideo:
       
   504             {
       
   505             settingItemId = ECamSettingItemDynamicVideoLightSensitivity;
       
   506             iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_VIDEO;
       
   507             }
       
   508             break;
       
   509         case ECamCmdCaptureSetupLightSensitivityUser:
       
   510             {
       
   511             settingItemId = ECamSettingItemUserSceneLightSensitivity;
       
   512             iSettingModeTitleResourceId = R_CAM_USER_SCENE_SETUP_TITLE;
       
   513             }
       
   514             break;
       
   515         default:
       
   516             {
       
   517             User::Leave( KErrNotSupported );
       
   518             }
       
   519             break;
       
   520         }
       
   521 
       
   522     iCaptureSetupControlHandler = new( ELeave )
       
   523         CCamCaptureSetupControlHandler( iController, settingItemId );
       
   524     }
       
   525 
       
   526 // ---------------------------------------------------------------------------
       
   527 // CCamCaptureSetupViewBase::CleanupCaptureSetupContainer
       
   528 // Cleanup the capture setup controls if a leave occurs
       
   529 // ---------------------------------------------------------------------------
       
   530 //
       
   531 void CCamCaptureSetupViewBase::CleanupCaptureSetupContainer( TAny* aAny )
       
   532     {
       
   533     CCamCaptureSetupViewBase* view = static_cast<CCamCaptureSetupViewBase*>( aAny );
       
   534     delete view->iCaptureSetupControlHandler;
       
   535     view->iCaptureSetupControlHandler = NULL;
       
   536 
       
   537     if ( view->iCaptureSetupContainer )
       
   538         {
       
   539         view->AppUi()->RemoveFromStack( view->iCaptureSetupContainer );
       
   540         delete view->iCaptureSetupContainer;
       
   541         view->iCaptureSetupContainer = NULL;
       
   542         }
       
   543     // reset the active flag
       
   544     view->SetCaptureSetupModeActive(EFalse);
       
   545 
       
   546     CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( view->AppUi() );
       
   547     appUi->SetPreCaptureMode(ECamPreCapViewfinder);
       
   548     }
       
   549 
       
   550 // ---------------------------------------------------------------------------
       
   551 // CCamCaptureSetupViewBase::SwitchToCaptureSetupModeL
       
   552 // Enter capture setup mode
       
   553 // ---------------------------------------------------------------------------
       
   554 //
       
   555 void CCamCaptureSetupViewBase::SwitchToCaptureSetupModeL( TInt aSetupCommand )
       
   556     {
       
   557     __ASSERT_DEBUG( !iCaptureSetupControlHandler && !iCaptureSetupContainer, CamPanic( ECamPanicResourceLeak ) );
       
   558 
       
   559     CreateCaptureSetupControlHandlerL( aSetupCommand );
       
   560     // Cleanup the view correctly if a leave occurs
       
   561     CleanupStack::PushL( TCleanupItem( CleanupCaptureSetupContainer, this ) );
       
   562     CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( AppUi() );
       
   563 
       
   564     TRect rect = appUi->ApplicationRect();
       
   565     if ( !CamUtility::IsNhdDevice() ) 
       
   566         {
       
   567         // Space for visible statuspane for non-touch device
       
   568         AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, rect );
       
   569         }
       
   570     iCaptureSetupContainer = CCamCaptureSetupContainer::NewL( iController, 
       
   571                                    *this, *iCaptureSetupControlHandler, rect );
       
   572     iCaptureSetupContainer->SetMopParent( this ); 
       
   573     appUi->AddToStackL( *this, iCaptureSetupContainer );
       
   574     iCaptureSetupContainer->ActivateL();
       
   575     iCaptureSetupContainer->DrawNow();
       
   576 
       
   577     // UpdateCbaL need this boolean to be set in order
       
   578     // to return the correct CBA
       
   579     SetCaptureSetupModeActive(ETrue);
       
   580     
       
   581     iCaptureSetupContainer->DrawableWindow()->SetOrdinalPosition(
       
   582             KCamPreCaptureWindowOrdinalPos );
       
   583 
       
   584     UpdateCbaL();
       
   585     SetTitlePaneTextL();
       
   586     appUi->PushDefaultNaviPaneL();
       
   587     CleanupStack::Pop(); // CleanupCaptureSetupContainer
       
   588     // after all leaving functions have completed
       
   589     // remove the container from the stack
       
   590     appUi->RemoveFromStack( iContainer );
       
   591     iContainer->MakeVisible( EFalse );
       
   592     }
       
   593 
       
   594 // ---------------------------------------------------------------------------
       
   595 // CCamCaptureSetupViewBase::ExitCaptureSetupModeL
       
   596 // Exit capture setup mode
       
   597 // ---------------------------------------------------------------------------
       
   598 //
       
   599 void CCamCaptureSetupViewBase::ExitCaptureSetupModeL()
       
   600     {
       
   601     PRINT( _L("Camera => CCamCaptureSetupViewBase::ExitCaptureSetupModeL()") );	   
       
   602     if ( !iController.InVideocallOrRinging() )
       
   603         {
       
   604         iController.CancelPreviewChangesL();
       
   605         }
       
   606     if ( !iCaptureSetupModeActive )
       
   607 		{
       
   608         return;
       
   609 		}
       
   610 
       
   611     // Cleanup the view correctly if a leave occurs
       
   612     CleanupStack::PushL( TCleanupItem( CleanupExit, this ) );
       
   613     AppUi()->AddToStackL( *this, iContainer );
       
   614     iContainer->MakeVisible( ETrue );   
       
   615     //Draw already here to prevent the activepalette showing briefly before it is updated
       
   616     if ( !iController.IsTouchScreenSupported() )
       
   617         {
       
   618         iContainer->DrawNow();
       
   619         }
       
   620     SetCaptureSetupModeActive(EFalse);
       
   621 
       
   622     UpdateCbaL();
       
   623     SetTitlePaneTextL();  
       
   624     CleanupStack::Pop(); // CleanupExit
       
   625 
       
   626     // delete the capture setup controls when all
       
   627     // leaving functions have completed
       
   628     AppUi()->RemoveFromStack( iCaptureSetupContainer );
       
   629     delete iCaptureSetupContainer;
       
   630     iCaptureSetupContainer = NULL;
       
   631     delete iCaptureSetupControlHandler;
       
   632     iCaptureSetupControlHandler = NULL;
       
   633     PRINT( _L("Camera <= CCamCaptureSetupViewBase::ExitCaptureSetupModeL()") );	   
       
   634     }
       
   635 
       
   636 // ---------------------------------------------------------------------------
       
   637 // CCamCaptureSetupViewBase::CleanupSceneSettingContainer
       
   638 // Cleanup the capture setup controls if a leave occurs
       
   639 // ---------------------------------------------------------------------------
       
   640 //
       
   641 void CCamCaptureSetupViewBase::CleanupSceneSettingContainer( TAny* aAny )
       
   642     {
       
   643     CCamCaptureSetupViewBase* view = static_cast<CCamCaptureSetupViewBase*>( aAny );
       
   644     if ( view->iSceneSettingContainer )
       
   645         {
       
   646         view->AppUi()->RemoveFromStack( view->iSceneSettingContainer );
       
   647         delete view->iSceneSettingContainer;
       
   648         view->iSceneSettingContainer = NULL;
       
   649         }
       
   650     // reset the active mode
       
   651     view->SetSceneSettingMode(EFalse);
       
   652     }
       
   653 
       
   654 // ---------------------------------------------------------------------------
       
   655 // CCamCaptureSetupViewBase::CleanupInfoListBox
       
   656 // Cleanup the InfoListBox controls if a leave occurs
       
   657 // ---------------------------------------------------------------------------
       
   658 //
       
   659 void CCamCaptureSetupViewBase::CleanupInfoListBox( TAny* aAny )
       
   660     {
       
   661     CCamCaptureSetupViewBase* view = static_cast<CCamCaptureSetupViewBase*>( aAny );
       
   662     if ( view->iInfoListBoxContainer )
       
   663         {
       
   664         view->AppUi()->RemoveFromStack( view->iInfoListBoxContainer );
       
   665         delete view->iInfoListBoxContainer;
       
   666         view->iInfoListBoxContainer = NULL;
       
   667         }
       
   668     // reset the active mode
       
   669     view->SetInfoListBoxMode(EFalse);
       
   670     }
       
   671 
       
   672 // ---------------------------------------------------------------------------
       
   673 // CCamCaptureSetupViewBase::SwitchToSceneSettingModeL
       
   674 // Enter scene setup mode
       
   675 // ---------------------------------------------------------------------------
       
   676 //
       
   677 void CCamCaptureSetupViewBase::SwitchToSceneSettingModeL()
       
   678     {
       
   679     // Cleanup the view correctly if a leave occurs
       
   680     CleanupStack::PushL( TCleanupItem( CleanupSceneSettingContainer, this ) );
       
   681     CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() );
       
   682     iSceneSettingContainer->SetMopParent( this );  
       
   683     appUi->AddToStackL( *this, iSceneSettingContainer );
       
   684     iSceneSettingContainer->ActivateL();
       
   685     
       
   686     if ( iChangeButtonPressed && iSceneSettingContainer )
       
   687     	{
       
   688     	iSceneSettingContainer->SelectItem( iSceneSettingContainer->IndexForValueId( ECamSceneUser ) );
       
   689     	// iChangeButtonPressed is set to EFalse in SetSceneSettingMode method
       
   690     	}
       
   691     
       
   692     // UpdateCbaL need this boolean to be set in
       
   693     // order to return the correct CBA
       
   694     SetSceneSettingMode(ETrue);
       
   695     
       
   696     appUi->SetToolbarVisibility();
       
   697     
       
   698     UpdateCbaL();
       
   699     SetTitlePaneTextL();
       
   700     appUi->PushDefaultNaviPaneL();
       
   701     CleanupStack::Pop(); // CleanupSceneSettingContainer
       
   702     // after all leaving functions have completed
       
   703     // remove the container from the stack and
       
   704     // set the capture setup mode active 
       
   705     appUi->RemoveFromStack( iContainer );
       
   706     iContainer->MakeVisible( EFalse );  
       
   707 
       
   708     CEikMenuBar* menuBar = MenuBar();
       
   709     // if menuBar exists
       
   710     if ( menuBar )
       
   711         {
       
   712         menuBar->SetMenuTitleResourceId( ROID(R_CAM_SCENE_SETTING_MENUBAR_ID));
       
   713         }
       
   714     
       
   715     }
       
   716 
       
   717 // ---------------------------------------------------------------------------
       
   718 // CCamCaptureSetupViewBase::SwitchToInfoListBoxL
       
   719 // Show InfoListBox
       
   720 // ---------------------------------------------------------------------------
       
   721 //
       
   722 void CCamCaptureSetupViewBase::SwitchToInfoListBoxL( TCamInfoListBoxMode /* aMode */ )
       
   723     {
       
   724     // Cleanup the view correctly if a leave occurs
       
   725     CleanupStack::PushL( TCleanupItem( CleanupInfoListBox, this ) );
       
   726     CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( AppUi() );
       
   727     iInfoListBoxContainer->SetMopParent( this );  
       
   728     appUi->AddToStackL( *this, iInfoListBoxContainer );
       
   729     iInfoListBoxContainer->ActivateL();
       
   730     // UpdateCbaL need this boolean to be set in
       
   731     // order to return the correct CBA
       
   732     SetInfoListBoxMode(ETrue);
       
   733     UpdateCbaL();
       
   734     SetTitlePaneTextL();
       
   735     appUi->PushDefaultNaviPaneL();
       
   736     CleanupStack::Pop(); // CleanupSceneSettingContainer
       
   737 
       
   738     // after all leaving functions have completed
       
   739     // remove the container from the stack and
       
   740     // set the capture setup mode active 
       
   741     appUi->RemoveFromStack( iContainer );
       
   742     iContainer->MakeVisible( EFalse );  
       
   743 
       
   744     CEikMenuBar* menuBar = MenuBar();
       
   745     // if menuBar exists
       
   746     if ( menuBar )
       
   747         {
       
   748         // Use same menu resource as scene setting
       
   749         menuBar->SetMenuTitleResourceId( R_CAM_INFOLISTBOX_MENUBAR );
       
   750         }
       
   751     }
       
   752 
       
   753 
       
   754 // ---------------------------------------------------------------------------
       
   755 // CCamCaptureSetupViewBase::HandleInfoListBoxSelectionL()
       
   756 // Handle selection events from InfoListBox
       
   757 // ---------------------------------------------------------------------------
       
   758 //
       
   759 void CCamCaptureSetupViewBase::HandleInfoListBoxSelectionL()
       
   760 		{            		   
       
   761 		CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( AppUi() );            		   
       
   762 		
       
   763 		TUid view = Id();           		   
       
   764 		TBool userSceneActive = ( view.iUid == ECamViewIdPhotoUserSceneSetup );
       
   765 		
       
   766 		if( iInfoListBoxContainer->SettingValueChanged() )
       
   767 				{
       
   768 				// Store the selected setting
       
   769 				switch( iInfoListBoxMode )
       
   770 						{
       
   771 						case EInfoListBoxModeTimeLapse:
       
   772 								{
       
   773   		  				TCamTimeLapse settingValue = static_cast<TCamTimeLapse>( iInfoListBoxContainer->CurrentSettingItemValue() );
       
   774    			 				TInt command = CamTimeLapseUtility::EnumToCommand( settingValue ); 
       
   775 		    				TTimeIntervalMicroSeconds interval = CamTimeLapseUtility::EnumToInterval( settingValue );  
       
   776             		
       
   777 		    				// Update the current mode (single/burst/timelapse)
       
   778   		  				if( appUi )
       
   779     								{
       
   780  		   							TRAP_IGNORE( appUi->HandleCommandL( command ) );            		
       
   781    			     				}
       
   782 						
       
   783 								// Update timelapse interval
       
   784  			       		iController.SetTimeLapseInterval( interval ); 
       
   785   		     			}
       
   786   		     			break;
       
   787        			
       
   788 						case EInfoListBoxModeISO:
       
   789 								{
       
   790 								TInt settingValue = iInfoListBoxContainer->CurrentSettingItemValue();
       
   791 								
       
   792 								// For the light sensitivity setting, PreviewSettingChangeL and CommitPreviewChanges
       
   793 								// must be used, instead of UpdateEngineWithSettingL, in order to actually change
       
   794 								// the setting value.
       
   795 								iController.PreviewSettingChangeL( ECamSettingItemDynamicPhotoLightSensitivity, settingValue );
       
   796 								iController.CommitPreviewChanges();
       
   797 								}            	  
       
   798 								break;
       
   799 						
       
   800 						default:
       
   801 								break;												
       
   802 						}				
       
   803 				}
       
   804         	  
       
   805             	            			
       
   806     if( appUi && appUi->APHandler()->AccessedViaAP() )
       
   807     		{ 
       
   808     		if( !userSceneActive)
       
   809 		    	{
       
   810 		    	// If user scene is active, we aren't yet done
       
   811 		      appUi->APHandler()->APOperationComplete();
       
   812 		      }	
       
   813 		                		                	
       
   814         ExitAllModesL();
       
   815         }
       
   816     else
       
   817     		{
       
   818         	ExitInfoListBoxL();
       
   819         	}                     
       
   820        
       
   821 		}
       
   822 
       
   823 // ---------------------------------------------------------------------------
       
   824 // CCamCaptureSetupViewBase::CleanupExit
       
   825 // Stop the scene setting mode from exiting if a leave occurs
       
   826 // ---------------------------------------------------------------------------
       
   827 //
       
   828 void CCamCaptureSetupViewBase::CleanupExit( TAny* aAny )
       
   829     {
       
   830     CCamCaptureSetupViewBase* view = static_cast<CCamCaptureSetupViewBase*>( aAny );
       
   831     view->AppUi()->RemoveFromStack( view->iContainer );
       
   832     view->iContainer->MakeVisible( EFalse );
       
   833     if ( view->iSceneSettingContainer )
       
   834         {
       
   835         // reset the active mode
       
   836         view->SetSceneSettingMode(ETrue);
       
   837         }
       
   838     if ( view->iCaptureSetupContainer )
       
   839         {
       
   840         // reset the active mode
       
   841         view->SetCaptureSetupModeActive(ETrue);
       
   842         }
       
   843     if ( view->iInfoListBoxContainer )
       
   844         {
       
   845         // reset the active mode
       
   846         view->SetInfoListBoxMode(ETrue);
       
   847         }        
       
   848     }
       
   849 
       
   850 // ---------------------------------------------------------------------------
       
   851 // CCamCaptureSetupViewBase::ExitSceneSettingModeL
       
   852 // Exit scene setup mode
       
   853 // ---------------------------------------------------------------------------
       
   854 //
       
   855 void CCamCaptureSetupViewBase::ExitSceneSettingModeL()
       
   856     {   
       
   857 	PRINT( _L( "Camera => CCamCaptureSetupViewBase::ExitSceneSettingModeL" ) );
       
   858     
       
   859     if ( !iSceneSettingModeActive )
       
   860 		{
       
   861 	   	AppUi()->RemoveFromStack( iSceneSettingContainer );  
       
   862 		
       
   863         if ( iSceneSettingContainer )
       
   864         	{
       
   865         	delete iSceneSettingContainer;
       
   866     	    iSceneSettingContainer = NULL;
       
   867         	}
       
   868 		return;
       
   869         }
       
   870     	
       
   871     // Cleanup the view correctly if a leave occurs
       
   872     CleanupStack::PushL( TCleanupItem( CleanupExit, this ) );
       
   873     AppUi()->AddToStackL( *this, iContainer );
       
   874     
       
   875     if ( iChangeButtonPressed == EFalse )
       
   876     	{
       
   877         AppUi()->RemoveFromStack( iSceneSettingContainer );               
       
   878         if ( iSceneSettingContainer )
       
   879         	{
       
   880     	    delete iSceneSettingContainer;
       
   881     	    iSceneSettingContainer = NULL;
       
   882         	} 
       
   883         iContainer->MakeVisible( ETrue );
       
   884     	  //Draw already here to prevent the activepalette showing briefly before it is updated
       
   885         if ( !iController.IsTouchScreenSupported() )
       
   886             {
       
   887             iContainer->DrawNow();
       
   888             }
       
   889       	SetSceneSettingMode(EFalse);
       
   890         UpdateCbaL();
       
   891         SetTitlePaneTextL();
       
   892         CleanupStack::Pop(); // CleanupExit
       
   893         
       
   894 
       
   895         
       
   896     	}
       
   897     else // iChangeButtonPressed == ETrue
       
   898     	{
       
   899     	iContainer->MakeVisible( EFalse );
       
   900     	SetSceneSettingMode(EFalse);
       
   901         SetTitlePaneTextL();
       
   902         CleanupStack::Pop(); // CleanupExit
       
   903     	}
       
   904     
       
   905     
       
   906     CEikMenuBar* menuBar = MenuBar();
       
   907     // if menuBar exists
       
   908     if ( menuBar )
       
   909         {
       
   910         menuBar->SetMenuTitleResourceId( iPreviousMenuResourceId );
       
   911         }
       
   912 	PRINT( _L( "Camera <= CCamCaptureSetupViewBase::ExitSceneSettingModeL" ) );        
       
   913     }
       
   914 
       
   915 
       
   916 // ---------------------------------------------------------------------------
       
   917 // CCamCaptureSetupViewBase::ExitInfoListBoxL
       
   918 // Exit scene setup mode
       
   919 // ---------------------------------------------------------------------------
       
   920 //
       
   921 void CCamCaptureSetupViewBase::ExitInfoListBoxL()
       
   922     {   
       
   923 	PRINT( _L( "Camera => CCamCaptureSetupViewBase::ExitInfoListBoxL" ) );
       
   924     
       
   925     if ( !iInfoListBoxActive )
       
   926 		{
       
   927         return;
       
   928     } 
       
   929     
       
   930     // Cleanup the view correctly if a leave occurs
       
   931     CleanupStack::PushL( TCleanupItem( CleanupExit, this ) );
       
   932     AppUi()->AddToStackL( *this, iContainer );
       
   933   	PRINT( _L( "Camera => CCamCaptureSetupViewBase::ExitInfoListBoxL removing iInfoListBoxContainer" ) );
       
   934     AppUi()->RemoveFromStack( iInfoListBoxContainer );
       
   935     delete iInfoListBoxContainer;
       
   936     iInfoListBoxContainer = NULL;
       
   937 	PRINT( _L( "Camera => CCamCaptureSetupViewBase::ExitInfoListBoxL removed iInfoListBoxContainer" ) );   
       
   938    
       
   939     iContainer->MakeVisible( ETrue );  
       
   940     //Draw already here to prevent the activepalette showing briefly before it is updated
       
   941     if ( !iController.IsTouchScreenSupported() )
       
   942         {
       
   943         iContainer->DrawNow();
       
   944         }
       
   945     SetInfoListBoxMode(EFalse);
       
   946     UpdateCbaL();
       
   947     SetTitlePaneTextL();
       
   948     CleanupStack::Pop(); // CleanupExit
       
   949 
       
   950     CEikMenuBar* menuBar = MenuBar();
       
   951     // if menuBar exists
       
   952     if ( menuBar )
       
   953         {
       
   954         menuBar->SetMenuTitleResourceId( iPreviousMenuResourceId );
       
   955         }
       
   956         
       
   957 		iInfoListBoxActive = EFalse;
       
   958 		
       
   959 		// StartViewFinderL();      
       
   960 	PRINT( _L( "Camera <= CCamCaptureSetupViewBase::ExitInfoListBoxL" ) );        
       
   961     }
       
   962 
       
   963 // ---------------------------------------------------------------------------
       
   964 // CCamCaptureSetupViewBase::SetupModeTitlePaneResourceId
       
   965 // Return the resource id for the title pane text while in setup mode
       
   966 // ---------------------------------------------------------------------------
       
   967 //
       
   968 TInt CCamCaptureSetupViewBase::SetupModeTitlePaneResourceId()
       
   969     {
       
   970     return iSettingModeTitleResourceId;
       
   971     }
       
   972 
       
   973 
       
   974 // ---------------------------------------------------------------------------
       
   975 // CCamCaptureSetupViewBase::DynInitMenuPaneL
       
   976 // Dynamically initialise the options menu
       
   977 // ---------------------------------------------------------------------------
       
   978 //
       
   979 void CCamCaptureSetupViewBase::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
       
   980     {
       
   981     PRINT( _L("Camera => CCamCaptureSetupViewBase::DynInitMenuPaneL"))
       
   982     iController.StartIdleTimer();
       
   983     if( iSceneSettingModeActive && aResourceId == ROID(R_CAM_SCENE_SETTING_MENU_ID))
       
   984         {
       
   985         if ( iSceneSettingContainer && !iSceneSettingContainer->UserSceneHighlighted() )
       
   986             {
       
   987             aMenuPane->SetItemDimmed( ECamCmdEdit, ETrue );
       
   988             }
       
   989         else
       
   990             {
       
   991             // do nothing
       
   992             }
       
   993         }
       
   994     else
       
   995         {
       
   996         // do nothing
       
   997         }
       
   998     PRINT( _L("Camera <= CCamCaptureSetupViewBase::DynInitMenuPaneL"))
       
   999     }
       
  1000 
       
  1001 // ---------------------------------------------------------------------------
       
  1002 // CCamCaptureSetupViewBase::ExitAllModesL
       
  1003 // Revert to normal mode
       
  1004 // ---------------------------------------------------------------------------
       
  1005 //
       
  1006 void CCamCaptureSetupViewBase::ExitAllModesL()
       
  1007     {
       
  1008     // intentionally doing nothing
       
  1009     PRINT( _L("Camera =><= CCamCaptureSetupViewBase::ExitAllModesL empty impl."))
       
  1010     }
       
  1011 
       
  1012 // ---------------------------------------------------------------------------
       
  1013 // CCamCaptureSetupViewBase::SetSceneSettingMode
       
  1014 // Sets the iSceneSettingModeActive flag
       
  1015 // ---------------------------------------------------------------------------
       
  1016 //
       
  1017 void CCamCaptureSetupViewBase::SetSceneSettingMode(TBool aActive)
       
  1018     {
       
  1019     // This should be the only place iSceneSettingModeActive is set!
       
  1020     // We need to inform the AppUi
       
  1021     iSceneSettingModeActive = aActive;
       
  1022 
       
  1023     CCamAppUi* appUi = static_cast<CCamAppUi*>(AppUi()); //static_cast<CCamAppUiBase*>( AppUi() );
       
  1024     
       
  1025     if ( appUi )
       
  1026         {
       
  1027         if ( aActive )
       
  1028             {
       
  1029             appUi->SetPreCaptureMode(ECamPreCapSceneSetting);
       
  1030             iChangeButtonPressed = EFalse; 
       
  1031             }
       
  1032         else if ( iChangeButtonPressed )
       
  1033         	{
       
  1034         	// transfering to user scene setup view
       
  1035         	 appUi->SetPreCaptureMode(ECamPreCapSceneSetting);
       
  1036         	}
       
  1037         else
       
  1038             {
       
  1039            	appUi->SetPreCaptureMode(ECamPreCapViewfinder);
       
  1040             }        
       
  1041         }
       
  1042           
       
  1043     }
       
  1044     
       
  1045 // ---------------------------------------------------------------------------
       
  1046 // CCamCaptureSetupViewBase::SetInfoListBoxMode
       
  1047 // Sets the iInfoListBoxActive flag
       
  1048 // ---------------------------------------------------------------------------
       
  1049 //
       
  1050 void CCamCaptureSetupViewBase::SetInfoListBoxMode( TBool aActive )
       
  1051     {
       
  1052     // We need to inform the AppUi
       
  1053     iInfoListBoxActive = aActive;
       
  1054 
       
  1055     CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( AppUi() );
       
  1056     
       
  1057     if ( appUi)
       
  1058         {
       
  1059         if ( aActive )
       
  1060             {
       
  1061             appUi->SetPreCaptureMode(ECamPreCapGenericSetting);
       
  1062             }
       
  1063         else
       
  1064             {
       
  1065             appUi->SetPreCaptureMode(ECamPreCapViewfinder);
       
  1066             }        
       
  1067         }
       
  1068     }    
       
  1069     
       
  1070 // ---------------------------------------------------------------------------
       
  1071 // CCamCaptureSetupViewBase::SetCaptureSetupModeActive
       
  1072 // Sets the iSceneSettingModeActive flag
       
  1073 // ---------------------------------------------------------------------------
       
  1074 //
       
  1075 void CCamCaptureSetupViewBase::SetCaptureSetupModeActive(TBool aActive)
       
  1076     {
       
  1077     // This should be the only place iCaptureSetupModeActive is set!
       
  1078     // We need to inform the AppUi
       
  1079     iCaptureSetupModeActive = aActive;
       
  1080 
       
  1081     CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( AppUi() );
       
  1082     
       
  1083     if ( appUi)
       
  1084         {
       
  1085         if ( aActive )
       
  1086             {
       
  1087             appUi->SetPreCaptureMode(ECamPreCapCaptureSetup);
       
  1088             }
       
  1089         else
       
  1090             {
       
  1091             appUi->SetPreCaptureMode(ECamPreCapViewfinder);
       
  1092             }        
       
  1093         }
       
  1094     }
       
  1095 // ---------------------------------------------------------------------------
       
  1096 // CCamCaptureSetupViewBase::HandleForegroundEventL
       
  1097 // Called to notify of change of app fore/background state
       
  1098 // ---------------------------------------------------------------------------
       
  1099 //
       
  1100  void CCamCaptureSetupViewBase::HandleForegroundEventL( TBool aForeground )
       
  1101      {
       
  1102      
       
  1103      PRINT1( _L("Camera => CCamCaptureSetupViewBase::HandleForegroundEventL foreground:%d"), aForeground );
       
  1104      
       
  1105      if( aForeground )
       
  1106          {
       
  1107          
       
  1108          if ( iCaptureSetupModeActive && iCaptureSetupContainer )
       
  1109              {
       
  1110              iCaptureSetupContainer->HandleForegroundEventL( aForeground );
       
  1111              }
       
  1112          }
       
  1113      }
       
  1114 //  End of File