camerauis/cameraapp/generic/src/CamStillPreCaptureView.cpp
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:  Still image pre-capture view class for Camera application*
       
    15 */
       
    16 
       
    17 
       
    18 // INCLUDE FILES
       
    19 #include "CamAppUi.h"
       
    20 #include "CamAppController.h"
       
    21 #include "CamStillPreCaptureView.h"
       
    22 #include "CamLogger.h"
       
    23 #include "CamUtility.h"
       
    24 #include "CamContainerBase.h"
       
    25 #include "CamAppUiBase.h"
       
    26 #include <eikmenub.h>
       
    27 #include <eikapp.h>
       
    28 #include <avkon.rsg>
       
    29 #include "CamCaptureSetupMenu.h"
       
    30 #include "CamPanic.h"
       
    31 #include "Cam.hrh"
       
    32 #include "CamAppUid.h"
       
    33 #include <csxhelp/lcam.hlp.hrh>
       
    34 #include "CamShootingModeContainer.h"
       
    35 #include "CamInfoListBoxContainer.h"
       
    36 #include "CamStillPreCaptureContainer.h"
       
    37 #include "CamSelfTimer.h"
       
    38 #include "CamTimeLapseUtility.h"
       
    39 #include <CaeEngine.h>
       
    40 #include <cameraapp.rsg>
       
    41 #include <vgacamsettings.rsg>
       
    42 #include <akntoolbar.h>
       
    43 #include <akntoolbarextension.h>
       
    44 #include <aknbutton.h>
       
    45 #include <AknsUtils.h>
       
    46 #include <cameraapp.mbg>
       
    47 #include <AknIconUtils.h>
       
    48 
       
    49 
       
    50 #include "StringLoader.h"
       
    51 #include "camactivepalettehandler.h"
       
    52 #include "CameraUiConfigManager.h"
       
    53 
       
    54 #include "CamLocalViewIds.h"
       
    55 #include "OstTraceDefinitions.h"
       
    56 #ifdef OST_TRACE_COMPILER_IN_USE
       
    57 #include "CamStillPreCaptureViewTraces.h"
       
    58 #endif
       
    59 
       
    60 
       
    61 // ========================= MEMBER FUNCTIONS ================================
       
    62 
       
    63 // ---------------------------------------------------------------------------
       
    64 // CCamStillPreCaptureView::NewLC
       
    65 // Symbian OS two-phased constructor
       
    66 // ---------------------------------------------------------------------------
       
    67 //
       
    68 CCamStillPreCaptureView* CCamStillPreCaptureView::NewLC( CCamAppController& aController )
       
    69     {
       
    70     CCamStillPreCaptureView* self = 
       
    71         new( ELeave ) CCamStillPreCaptureView( aController );
       
    72 
       
    73     CleanupStack::PushL( self );
       
    74     self->ConstructL();
       
    75 
       
    76     return self;
       
    77     }
       
    78 
       
    79 // ---------------------------------------------------------------------------
       
    80 // CCamStillPreCaptureView destructor
       
    81 // 
       
    82 // ---------------------------------------------------------------------------
       
    83 //
       
    84 CCamStillPreCaptureView::~CCamStillPreCaptureView()
       
    85   {
       
    86   }
       
    87   
       
    88 // ---------------------------------------------------------------------------
       
    89 // CCamStillPreCaptureView::Id
       
    90 // Returns UID of view
       
    91 // ---------------------------------------------------------------------------
       
    92 //
       
    93 TUid CCamStillPreCaptureView::Id() const
       
    94     {
       
    95    	return TUid::Uid( ECamViewIdStillPreCapture );	
       
    96     }
       
    97 
       
    98 // ---------------------------------------------------------------------------
       
    99 // CCamStillPreCaptureView::DoDeactivate
       
   100 // Deactivate this view
       
   101 // ---------------------------------------------------------------------------
       
   102 //
       
   103 void CCamStillPreCaptureView::DoDeactivate()
       
   104     {
       
   105     OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMSTILLPRECAPTUREVIEW_DODEACTIVATE, "e_CCamStillPreCaptureView_DoDeactivate 1" );
       
   106     PERF_EVENT_START_L2( EPerfEventStillPreCaptureViewDeactivation );    
       
   107     PRINT( _L("Camera => CCamStillPreCaptureView::DoDeactivate" ) )
       
   108 
       
   109     CCamPreCaptureViewBase::DoDeactivate();
       
   110     PERF_EVENT_END_L2( EPerfEventStillPreCaptureViewDeactivation );
       
   111     PRINT( _L("Camera <= CCamStillPreCaptureView::DoDeactivate" ) )
       
   112     OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMSTILLPRECAPTUREVIEW_DODEACTIVATE, "e_CCamStillPreCaptureView_DoDeactivate 0" );
       
   113     }
       
   114 
       
   115 // -----------------------------------------------------------------------------
       
   116 // CCamStillPreCaptureView::HandleCommandL
       
   117 // Handle commands
       
   118 // -----------------------------------------------------------------------------
       
   119 //
       
   120 void CCamStillPreCaptureView::HandleCommandL( TInt aCommand )
       
   121     {
       
   122     CCamAppUi* appUi = static_cast<CCamAppUi*>( iEikonEnv->AppUi() );
       
   123     TCamOrientation orientation = appUi->CamOrientation();
       
   124     switch ( aCommand )
       
   125         {
       
   126         case ECamMSKCmdSelect:
       
   127         case ECamMSKCmdAppCapture:
       
   128         	{
       
   129         	if( orientation == ECamOrientationCamcorder || 
       
   130         	    orientation == ECamOrientationCamcorderLeft ||
       
   131 				orientation == ECamOrientationPortrait )
       
   132         		{
       
   133     		    if ( !StartMskCaptureL() )
       
   134         		    {
       
   135             		// If in the Landscape mode, MSK event is mapped 
       
   136             	  	// like a normal selection key so that AP items
       
   137             	  	// are selected and respective setting pages are launched
       
   138             	    TKeyEvent aKeyEvent;
       
   139     	    		aKeyEvent.iCode =  aKeyEvent.iRepeats = aKeyEvent.iModifiers = 0;
       
   140         			aKeyEvent.iScanCode = EStdKeyDevice3;
       
   141             		static_cast<CCamStillPreCaptureContainer*>
       
   142             				( Container() )->OfferKeyEventL( aKeyEvent, EEventKey );	
       
   143         		    }
       
   144             	}
       
   145             else if ( aCommand == ECamMSKCmdAppCapture )
       
   146                // if the Camera in the Portrait mode
       
   147           	   // MSK event is handled like a capture key
       
   148           		{
       
   149           		OstTrace0( CAMERAAPP_PERFORMANCE, DUP8_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_PRI_SHUTTER_RELEASE_LAG 1" );
       
   150           		if ( iController.IsViewFinding() && appUi->CheckMemoryL() )
       
   151                 	{
       
   152                     OstTrace0( CAMERAAPP_PERFORMANCE, CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_APP_SHOT_TO_SNAPSHOT 1" );
       
   153                     OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_PRI_SHOT_TO_SNAPSHOT 1" );
       
   154                     OstTrace0( CAMERAAPP_PERFORMANCE, DUP2_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_PRI_SHOT_TO_SAVE 1" );
       
   155                     OstTrace0( CAMERAAPP_PERFORMANCE, DUP3_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_PRI_SHOT_TO_SHOT 1" );
       
   156                     OstTrace0( CAMERAAPP_PERFORMANCE, DUP4_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_APP_SHOT_TO_STILL 1" );
       
   157                     OstTrace0( CAMERAAPP_PERFORMANCE, DUP5_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_APP_CAPTURE_START 1" );
       
   158                     OstTrace0( CAMERAAPP_PERFORMANCE, DUP6_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_PRI_SERIAL_SHOOTING 1" );
       
   159                 	SetSoftKeysL( R_CAM_SOFTKEYS_BLANK );
       
   160                 	iController.Capture();
       
   161                 	}
       
   162           		}
       
   163             break;
       
   164         	}
       
   165         case ECamCmdCaptureImage:
       
   166             {
       
   167       	    OstTrace0( CAMERAAPP_PERFORMANCE, DUP9_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_PRI_AF_LOCK 1" );
       
   168       	    OstTrace0( CAMERAAPP_PERFORMANCE, DUP10_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_PRI_SHUTTER_RELEASE_LAG 1" );
       
   169       	    if ( iController.IsViewFinding() && appUi->CheckMemoryL() &&
       
   170                 !iController.CaptureModeTransitionInProgress() &&
       
   171                 !iController.IsProcessingCapture() ) 
       
   172             	{
       
   173             	SetSoftKeysL( R_CAM_SOFTKEYS_BLANK );
       
   174 
       
   175             	// fixed toolbar is used only with touch devices
       
   176             	if ( iController.IsTouchScreenSupported() )
       
   177             	    {
       
   178                     CAknToolbar* fixedToolbar = Toolbar();
       
   179                     if ( fixedToolbar )
       
   180                         {
       
   181                         fixedToolbar->SetToolbarVisibility( EFalse );
       
   182                         }
       
   183             	    }
       
   184             	
       
   185                 // Start the autofocus operation now, the capture will be queued
       
   186                 // after focus completes
       
   187                 if ( !appUi->SelfTimerEnabled() 
       
   188                     && iController.ActiveCamera() != ECamActiveCameraSecondary
       
   189                     && iController.UiConfigManagerPtr()
       
   190                     && iController.UiConfigManagerPtr()->IsAutoFocusSupported()
       
   191                     && !iController.CurrentSceneHasForcedFocus() )
       
   192                     {
       
   193                     if( iController.CurrentOperation() == ECamNoOperation )
       
   194                         {
       
   195                         iController.SetAfNeeded( ETrue );
       
   196                         }    
       
   197                     OstTrace0( CAMERAAPP_PERFORMANCE, DUP7_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_APP_AF 1" );
       
   198                     iController.StartAutoFocus();
       
   199                     }
       
   200             	TKeyEvent keyEvent;
       
   201             	appUi->StartCaptureL( keyEvent );
       
   202 
       
   203             	}
       
   204             break;
       
   205             }
       
   206         case ECamCmdTimeLapseSlider:
       
   207             {               
       
   208             TCamTimeLapse settingValue = ECamTimeLapseOff;
       
   209 
       
   210             if ( appUi && !appUi->IsBurstEnabled() )
       
   211                 {
       
   212                 settingValue = ECamTimeLapseMin;
       
   213                 }                        
       
   214 
       
   215             TInt command = CamTimeLapseUtility::EnumToCommand( settingValue ); 
       
   216             TTimeIntervalMicroSeconds interval = CamTimeLapseUtility::EnumToInterval( settingValue );  
       
   217 
       
   218             // Update the current mode (single/burst/timelapse)
       
   219             if( appUi )
       
   220                 {
       
   221                 TRAP_IGNORE( appUi->HandleCommandL( command ) );                    
       
   222                 }
       
   223 
       
   224             // Update timelapse interval
       
   225             iController.SetTimeLapseInterval( interval ); 
       
   226 
       
   227             // stop and start the viewfinder in order to update the settings
       
   228             StopViewFinder();
       
   229             StartViewFinder();
       
   230             
       
   231             // fixed toolbar is used only with touch devices
       
   232             if ( iController.IsTouchScreenSupported() )
       
   233                 {
       
   234                 UpdateToolbarIconsL();
       
   235                 }
       
   236             
       
   237             }     
       
   238             break;
       
   239             
       
   240         case ECamCmdCaptureSetupLightSensitivityStill:
       
   241         // case ECamCmdCaptureSetupLightSensitivityVideo:
       
   242         	{
       
   243         	SwitchToInfoListBoxL( EInfoListBoxModeISO );
       
   244         	}
       
   245         	break;        	
       
   246    
       
   247         case ECamCmdGoToStandby:
       
   248             {
       
   249             // SwitchToStandbyModeL( ECamViewIdStillPreCapture, iStandbyError );
       
   250             SwitchToStandbyModeL( ECamViewIdStillPreCapture, appUi->StandbyStatus() );
       
   251             }
       
   252             break;
       
   253         case ECamCmdExitStandby:
       
   254             {
       
   255             ExitStandbyModeL();
       
   256             }
       
   257             break;
       
   258         case ECamCmdViewfinderGrid:
       
   259             {
       
   260             // Switch grid setting
       
   261             CCamPreCaptureViewBase::HandleCommandL( aCommand );
       
   262 			UpdateToolbarIconsL();
       
   263             }
       
   264             break;			
       
   265         case ECamCmdToggleFacetracking: 
       
   266             {
       
   267              // Switch facetracking setting
       
   268              CCamPreCaptureViewBase::HandleCommandL( aCommand );
       
   269              UpdateToolbarIconsL();
       
   270             
       
   271             break;
       
   272            }    
       
   273         default:
       
   274             {
       
   275             CCamPreCaptureViewBase::HandleCommandL( aCommand ); 
       
   276             }
       
   277         }
       
   278     }   
       
   279 
       
   280 // -----------------------------------------------------------------------------
       
   281 // CCamStillPreCaptureView::HandleForegroundEventL
       
   282 // Handle foreground event
       
   283 // -----------------------------------------------------------------------------
       
   284 //
       
   285 void 
       
   286 CCamStillPreCaptureView::HandleForegroundEventL( TBool aForeground )
       
   287   {
       
   288   PRINT( _L("Camera => CCamStillPreCaptureView::HandleForegroundEventL") );
       
   289 
       
   290   CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() );
       
   291 
       
   292   // -------------------------------------------------------
       
   293   // Foreground
       
   294   //
       
   295   // reset menu and cba as appropriate
       
   296   if( aForeground )
       
   297     {
       
   298     PRINT( _L("Camera <> CCamStillPreCaptureView::HandleForegroundEventL: to foreground") );
       
   299     PRINT1( _L("Camera <> CCamStillPreCaptureView .. Current controller operation [%s]"), KCamCaptureOperationNames[iController.CurrentOperation()] );
       
   300     PRINT1( _L("Camera <> CCamStillPreCaptureView .. Current controller mode      [%s]"), KCamModeNames[iController.CurrentMode()] );
       
   301 
       
   302 
       
   303     if( iController.SequenceCaptureInProgress() )
       
   304       {
       
   305       PRINT( _L("Camera <= CCamStillPreCaptureView::HandleForegroundEventL: sequence capture ongoing") );
       
   306       return;
       
   307       }
       
   308 
       
   309     if ( appUi->IsInPretendExit() )
       
   310       {
       
   311       PRINT( _L("Camera <= CCamStillPreCaptureView::HandleForegroundEventL: app in pretend exit so not grabbing resources") )
       
   312       // The view can get a foreground event while the application is
       
   313       // actually in a pretend exit situation. This occurs when the view switch
       
   314       // was called before the exit event, but didn't complete until after the
       
   315       // exit event. In this case the view should not register an interest in
       
   316       // the engine as the application is really in the background and the resources
       
   317       // need to be released
       
   318       return;
       
   319       }
       
   320     // if foreground event is received while in videocall, go to standby with error
       
   321     if ( iController.InVideocallOrRinging() && ECamNoOperation == iController.CurrentOperation() )
       
   322         {
       
   323         ExitAllModesL();
       
   324         appUi->SetStandbyStatus( KErrInUse );
       
   325         appUi->HandleCommandL( ECamCmdGoToStandby );
       
   326         SetTitlePaneTextL();	        
       
   327         return;
       
   328         }
       
   329         
       
   330     // check for silent profile whenever we come to foreground, we dont need it here,
       
   331     // but we keep track of this in appcontroller.
       
   332     iController.IsProfileSilent();
       
   333 
       
   334     // set embedded flag here
       
   335     iEmbedded = appUi->IsEmbedded();
       
   336     // make sure CBA is correct
       
   337     UpdateCbaL();
       
   338 
       
   339     SetMenuBar();
       
   340     
       
   341     if ( iContinueInBackground )
       
   342         {
       
   343         // make sure that CCamAppController is in view finder mode
       
   344         if ( iController.CurrentImageMode() == ECamImageCaptureNone )
       
   345             {
       
   346             StartViewFinder();
       
   347             }
       
   348         }
       
   349     }
       
   350   // -------------------------------------------------------
       
   351   // Background
       
   352   //
       
   353   // If going to the background, cancel any current autofocus.
       
   354   // This makes sure that the focus indicator is removed from the side pane
       
   355   // if the key release event is lost.
       
   356   // Cancelling focus does nothing if a capture has already been requested
       
   357   else
       
   358     {
       
   359     PRINT( _L("Camera <> CCamStillPreCaptureView::HandleForegroundEventL: to background") );
       
   360     // Cancel any outstanding capture
       
   361     iController.CancelFocusAndCapture();
       
   362 
       
   363     // stop any current sequence capture unless it is only a notification
       
   364     if( iController.SequenceCaptureInProgress() 
       
   365      && ( appUi->AppInBackground( EFalse ) 
       
   366        || appUi->ForegroundAppIsPhoneApp()
       
   367         )
       
   368       )
       
   369       {
       
   370       iController.StopSequenceCaptureL();
       
   371       }
       
   372      /*
       
   373     // stop any current sequence capture unless it is only an eikon server or AknCapServer window
       
   374     if ( iCoeEnv->WsSession().GetFocusWindowGroup() != iEikonServerWindowGroupId
       
   375         && iController.SequenceCaptureInProgress() )
       
   376       {
       
   377       TInt groupId = iCoeEnv->WsSession().GetFocusWindowGroup();
       
   378       if ( !CamUtility::IdMatchesName( groupId, KAknCapServer ) )
       
   379         {
       
   380         // If AknCapServer has NOT got foreground, (which would possibly 
       
   381         // indicate a "charging" note) stop sequence capture
       
   382         iController.StopSequenceCaptureL();
       
   383         }
       
   384       }
       
   385     */
       
   386     }
       
   387 
       
   388   CCamPreCaptureViewBase::HandleForegroundEventL( aForeground );
       
   389 
       
   390   PRINT( _L("Camera <= CCamStillPreCaptureView::HandleForegroundEventL") );
       
   391   }
       
   392     
       
   393 // -----------------------------------------------------------------------------
       
   394 // CCamStillPreCaptureView::HandleFocusLossL
       
   395 // Handle change of focus
       
   396 // -----------------------------------------------------------------------------
       
   397 //
       
   398 void CCamStillPreCaptureView::HandleFocusLossL()
       
   399     {
       
   400     PRINT( _L( "Camera => CCamStillPreCaptureView::HandleFocusLossL" ) );    
       
   401     // if the application was already in the background, but behind an
       
   402     // eikon server window, then handle backgrounding properly now.
       
   403     // Otherwise the backgrounding will be handled in the normal
       
   404     // HandleForeground() method.
       
   405     if ( iContinueInBackground )
       
   406         {
       
   407         if ( iController.SequenceCaptureInProgress() )
       
   408             {
       
   409             iController.StopSequenceCaptureL();
       
   410             }
       
   411         }
       
   412     CCamPreCaptureViewBase::HandleFocusLossL();
       
   413     PRINT( _L( "Camera <= CCamVideoPreCaptureView::HandleFocusLossL" ) );    
       
   414     }    
       
   415 
       
   416 // -----------------------------------------------------------------------------
       
   417 // CCamStillPreCaptureView::HandleControllerEventL
       
   418 // Handle controller events
       
   419 // -----------------------------------------------------------------------------
       
   420 //
       
   421 void CCamStillPreCaptureView::HandleControllerEventL( TCamControllerEvent aEvent, 
       
   422                                                      TInt aError )
       
   423     {
       
   424     PRINT( _L("Camera => CCamStillPreCaptureView::HandleControllerEventL") );
       
   425     
       
   426     CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() );
       
   427     if ( ECamEventControllerReady == aEvent )
       
   428             {
       
   429             iSoftkeyBlankIsNeeded = EFalse;
       
   430             UpdateCbaL();
       
   431             }
       
   432             else if ( aEvent == ECamEventOperationStateChanged )
       
   433         {
       
   434         PRINT( _L("Camera <> CCamStillPreCaptureView: ECamEventOperationStateChanged") );
       
   435         TCamCaptureOperation operation = iController.CurrentOperation();
       
   436         switch ( operation )
       
   437             {
       
   438             case ECamCompleting:
       
   439                 {
       
   440                 UpdateCbaL();
       
   441                 break;
       
   442                 }
       
   443 
       
   444             case ECamFocusing:
       
   445                 {
       
   446                 // Hide the AP during focussing
       
   447                 if ( appUi->AlwaysDrawPreCaptureCourtesyUI()
       
   448                     && !iController.CurrentSceneHasForcedFocus() )
       
   449                     {
       
   450                     appUi->SetActivePaletteVisibility( EFalse );
       
   451                     }
       
   452                 break;
       
   453                 }
       
   454 
       
   455             case ECamFocused:
       
   456                 {
       
   457                 // Hide the AP during focussing
       
   458                 if ( appUi->AlwaysDrawPreCaptureCourtesyUI()
       
   459                     && !iController.CurrentSceneHasForcedFocus() )
       
   460                     {
       
   461                     appUi->SetActivePaletteVisibility( EFalse );
       
   462                     }
       
   463                 UpdateCbaL();
       
   464                 break;
       
   465                 }                
       
   466                 
       
   467             case ECamNoOperation:
       
   468                 {
       
   469                 if( iController.IsAppUiAvailable() )
       
   470 	                {
       
   471 	                //Update softkey state.
       
   472 	                UpdateCbaL();
       
   473 	                	                
       
   474 	                // Hide the AP if we already have an autofocus request but operation doesn't
       
   475 	                // have it (likely shutter was half-pressed before precap view opened)
       
   476 	                if ( iController.PendingAFRequest() != 0 && 
       
   477 	                     appUi->AlwaysDrawPreCaptureCourtesyUI() &&
       
   478 	                     !iController.CurrentSceneHasForcedFocus() )
       
   479 	                    {
       
   480 	                    appUi->SetActivePaletteVisibility( EFalse );
       
   481 	                    UpdateCbaL();
       
   482 	                    }
       
   483 
       
   484 	                // Show the AP again if the shutter key is released
       
   485 	                // without taking a picture, don't show if uiorientationoverride
       
   486 	                // feature is on and VF not running (prevents AP flashing in startup)
       
   487 	                if ( iPreviousControllerOperation !=ECamStandby &&
       
   488 	                     appUi->CurrentViewState() == ECamViewStatePreCapture && 
       
   489 	                     appUi->AlwaysDrawPreCaptureCourtesyUI() && 
       
   490 	                     !iSceneSettingModeActive && 
       
   491 	                     !( iController.UiConfigManagerPtr() && 
       
   492 	                     iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() && 
       
   493 	                     !iController.IsViewFinding() ) ) 
       
   494 	                    {
       
   495 	                    appUi->SetActivePaletteVisibility( ETrue );
       
   496                         }
       
   497                     }
       
   498                     
       
   499                 break;
       
   500                 }
       
   501  
       
   502             case ECamCapturing:
       
   503                 {
       
   504                 // If in burst, make sure the correct CBA is shown
       
   505                 if( appUi->IsBurstEnabled() )
       
   506                     {
       
   507                     UpdateCbaL();
       
   508                     // show image counter
       
   509                     iContainer->SetupNaviPanesL( CCamContainerBase::ECamPaneCounter );
       
   510                     }
       
   511                 break;
       
   512                 }
       
   513             default:
       
   514                 {
       
   515                 // Hide the AP if we already have an autofocus request but operation doesn't
       
   516                 // have it (likely shutter was half-pressed before precap view opened)
       
   517                 if ( iController.PendingAFRequest() != 0 && 
       
   518                      appUi->AlwaysDrawPreCaptureCourtesyUI() &&
       
   519                      !iController.CurrentSceneHasForcedFocus() )
       
   520                     {
       
   521                     appUi->SetActivePaletteVisibility( EFalse );
       
   522                     UpdateCbaL();
       
   523                     }
       
   524                 break;
       
   525                 }
       
   526             }
       
   527         
       
   528         iPreviousControllerOperation = operation;
       
   529 
       
   530         }
       
   531     else
       
   532         {
       
   533         PRINT( _L("Camera <> CCamStillPreCaptureView: call CCamPreCaptureViewBase::HandleControllerEventL") );
       
   534         CCamPreCaptureViewBase::HandleControllerEventL( aEvent, aError );
       
   535         }
       
   536     PRINT( _L("Camera <= CCamStillPreCaptureView::HandleControllerEventL") );        
       
   537     }
       
   538 
       
   539 
       
   540 // ---------------------------------------------------------------------------
       
   541 // CCamStillPreCaptureView::CreateCaptureSetupMenuL
       
   542 // Creates a photo capture setup menu
       
   543 // ---------------------------------------------------------------------------
       
   544 //
       
   545 void CCamStillPreCaptureView::CreateCaptureSetupMenuL( )
       
   546     {
       
   547     OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMSTILLPRECAPTUREVIEW_CREATECAPTURESETUPMENUL, "e_CCamStillPreCaptureView_CreateCaptureSetupMenuL 1" );
       
   548     TInt resource;
       
   549     // check if we are Western or Arabic/Hebrew layout
       
   550     if ( !AknLayoutUtils::LayoutMirrored() )
       
   551         {
       
   552         // Do we need APAC layout
       
   553         if( AknLayoutUtils::Variant() == EApacVariant )
       
   554             {
       
   555             resource = ROID(R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA_APAC_ID);
       
   556             }
       
   557         else
       
   558             {
       
   559             // use Western resource
       
   560             resource = ROID(R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA_ID);
       
   561             }
       
   562         }
       
   563     else
       
   564         {
       
   565         resource = ROID(R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA_AH_ID);
       
   566         }
       
   567 
       
   568     // Use capture setup menu for second camera
       
   569     if ( static_cast<CCamAppUiBase*>( AppUi() )->IsSecondCameraEnabled() )
       
   570         {
       
   571         resource = ROID(R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA_ID);
       
   572         }
       
   573 
       
   574     iCaptureSetupMenuContainer = 
       
   575         CCamCaptureSetupMenu::NewL( iController, *this, AppUi()->ClientRect(),
       
   576         resource, iCaptureSetupMenuLastItemIndex );        
       
   577     OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMSTILLPRECAPTUREVIEW_CREATECAPTURESETUPMENUL, "e_CCamStillPreCaptureView_CreateCaptureSetupMenuL 0" );
       
   578     }
       
   579 
       
   580 // ---------------------------------------------------------------------------
       
   581 // CCamStillPreCaptureView::SetMenuBar()
       
   582 // Sets the menu bar according to camera state
       
   583 // ---------------------------------------------------------------------------
       
   584 //
       
   585 void 
       
   586 CCamStillPreCaptureView::SetMenuBar()
       
   587   {
       
   588   PRINT( _L("Camera => CCamStillPreCaptureView::SetMenuBar") );
       
   589 
       
   590   // update menu bar as required
       
   591   CEikMenuBar* menuBar = MenuBar();
       
   592 
       
   593   // if menuBar exists
       
   594   if ( menuBar )
       
   595     {       
       
   596     if ( iStandbyModeActive ) //&& iActivateToStandby )
       
   597       {
       
   598       PRINT( _L("Camera <> CCamStillPreCaptureView::SetMenuBar: setting standby menubar..") );
       
   599       menuBar->SetMenuTitleResourceId( R_CAM_STANDBY_MENUBAR );
       
   600       }
       
   601     else if ( iEmbedded && !iSceneSettingModeActive )
       
   602       {
       
   603       PRINT( _L("Camera <> CCamStillPreCaptureView::SetMenuBar: setting embedded menubar..") );
       
   604       menuBar->SetMenuTitleResourceId( ROID(R_CAM_STILL_EMBEDDED_PRE_CAPTURE_MENUBAR_ID));
       
   605       }
       
   606     else
       
   607       {
       
   608       if ( iSceneSettingModeActive )
       
   609         {
       
   610         PRINT( _L("Camera <> CCamStillPreCaptureView::SetMenuBar: setting scene setting menubar..") );
       
   611         menuBar->SetMenuTitleResourceId( ROID(R_CAM_SCENE_SETTING_MENUBAR_ID));
       
   612         }
       
   613       else
       
   614         {
       
   615         PRINT( _L("Camera <> CCamStillPreCaptureView::SetMenuBar: setting normal menubar..") );
       
   616 		    menuBar->SetMenuTitleResourceId( ROID(R_CAM_STILL_PRE_CAPTURE_MENUBAR_ID));
       
   617 		    }
       
   618       }
       
   619     }
       
   620   PRINT( _L("Camera <= CCamStillPreCaptureView::SetMenuBar") );
       
   621   }
       
   622 
       
   623 
       
   624 // ---------------------------------------------------------------------------
       
   625 // CCamStillPreCaptureView::CCamStillPreCaptureView
       
   626 // C++ constructor
       
   627 // ---------------------------------------------------------------------------
       
   628 //
       
   629 CCamStillPreCaptureView::CCamStillPreCaptureView( CCamAppController& aController )
       
   630     : CCamPreCaptureViewBase( aController ),iSoftkeyBlankIsNeeded( EFalse )
       
   631     {
       
   632     }
       
   633 
       
   634 // ---------------------------------------------------------------------------
       
   635 // CCamStillPreCaptureView::ConstructL
       
   636 // Symbian OS 2nd phase constructor
       
   637 // ---------------------------------------------------------------------------
       
   638 //
       
   639 void CCamStillPreCaptureView::ConstructL()
       
   640     {
       
   641     BaseConstructL( ROID(R_CAM_STILL_PRE_CAPTURE_VIEW_ID));
       
   642 
       
   643     iPreviousControllerOperation = ECamNoOperation;
       
   644     
       
   645     CCamPreCaptureViewBase::ConstructL();
       
   646     }
       
   647 
       
   648 
       
   649 // ---------------------------------------------------------------------------
       
   650 // CCamStillPreCaptureView::UpdateCbaL
       
   651 // Update softkeys to reflect current state
       
   652 // ---------------------------------------------------------------------------
       
   653 //
       
   654 void CCamStillPreCaptureView::UpdateCbaL()
       
   655   {
       
   656   PRINT( _L("Camera => CCamStillPreCaptureView::UpdateCbaL") );        
       
   657     
       
   658   CCamAppUi* appui = static_cast<CCamAppUi*>( AppUi() );
       
   659   TBool burstEnabled = appui->IsBurstEnabled();
       
   660  
       
   661   TCamCaptureOperation operation = iController.CurrentOperation();
       
   662   TBool isSecondaryPortrait = appui->IsSecondCameraEnabled() && !appui->IsQwerty2ndCamera();
       
   663   if ( iSoftkeyBlankIsNeeded )
       
   664         {
       
   665         isSecondaryPortrait?SetSoftKeysL( R_CAM_SOFTKEYS_BLANK_EXIT_SECONDARY ):SetSoftKeysL( R_CAM_SOFTKEYS_BLANK_EXIT );
       
   666         }
       
   667   // if video call is active
       
   668   else if ( iController.InVideocallOrRinging() )
       
   669       {
       
   670       SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT );	
       
   671       }	
       
   672   // if the view is in capture setup menu mode
       
   673   else  if ( iCaptureSetupMenuModeActive && 
       
   674       !iCaptureSetupModeActive  &&
       
   675       !iSceneSettingModeActive )
       
   676       {
       
   677       SetSoftKeysL( R_AVKON_SOFTKEYS_SELECT_BACK );
       
   678       }          
       
   679   // if the view is in capture setup mode
       
   680   else if ( iCaptureSetupModeActive )
       
   681       {
       
   682       SetSoftKeysL( R_AVKON_SOFTKEYS_OK_CANCEL__OK );
       
   683       }
       
   684   // if the view is in scene settings mode
       
   685   else if ( iSceneSettingModeActive )
       
   686       {
       
   687       SetSoftKeysL( R_AVKON_SOFTKEYS_SELECT_CANCEL );
       
   688       }
       
   689   else if ( iStandbyModeActive )
       
   690     {
       
   691     PRINT( _L("Camera <> CCamStillPreCaptureView::UpdateCbaL: Setting standby softkeys..") );        
       
   692     if( KErrNone == appui->StandbyStatus() )
       
   693       SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CONTINUE );
       
   694     else
       
   695       SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT );
       
   696     }
       
   697   else if( iInfoListBoxActive )
       
   698   	{
       
   699   	SetSoftKeysL( R_CAM_SOFTKEYS_SETTINGS_SELECT_BACK__CHANGE );
       
   700   	}
       
   701   else if (  ( operation == ECamFocusing || operation == ECamFocused  || operation == ECamFocusFailed )
       
   702          && !iController.CurrentSceneHasForcedFocus() )
       
   703       {
       
   704       // If AutoFocus operation in progress.  Can occur for still or
       
   705       // burst capture
       
   706       SetSoftKeysL( R_CAM_SOFTKEYS_BLANK );
       
   707       }
       
   708   // If timelapse capture is ongoing the keys should be blank and cancel
       
   709   else if ( burstEnabled && 
       
   710             appui->CurrentBurstMode() == ECamImageCaptureTimeLapse && 
       
   711             iController.SequenceCaptureInProgress() )
       
   712     {
       
   713     SetSoftKeysL( R_CAM_SOFTKEYS_BLANK_STOP );
       
   714     }
       
   715   // If "Burst" capture is starting
       
   716   else if ( burstEnabled && operation == ECamCapturing ) 
       
   717     {
       
   718     
       
   719     SetSoftKeysL( R_CAM_SOFTKEYS_BLANK_STOP );
       
   720     
       
   721     }
       
   722   // If "Burst" capture is completing
       
   723   else if ( burstEnabled && operation == ECamCompleting )   
       
   724     {
       
   725     SetSoftKeysL( R_CAM_SOFTKEYS_BLANK );               
       
   726     }   
       
   727   else if ( appui->SelfTimerEnabled() )                   
       
   728     {
       
   729     // If self-timer enabled, check the precise state to show the 
       
   730     // correct CBA state.
       
   731     CCamSelfTimer* selftimer = appui->SelfTimer();
       
   732     if ( selftimer->IsActive() )
       
   733       {
       
   734         {
       
   735         SetSoftKeysL( R_CAM_SOFTKEYS_SELFTIMER_BLANK_CANCEL );
       
   736         }                                
       
   737       }
       
   738     else if( iEmbedded && operation == ECamCompleting )
       
   739       {
       
   740       isSecondaryPortrait?SetSoftKeysL( R_CAM_SOFTKEYS_BLANK_SECONDARY ):SetSoftKeysL( R_CAM_SOFTKEYS_BLANK );
       
   741       }    
       
   742     else
       
   743       {
       
   744       ViewCba()->MakeVisible( ETrue );
       
   745       SetSoftKeysL( R_CAM_SOFTKEYS_ACTIVATE_CANCEL__SELECT );                
       
   746       }
       
   747     }
       
   748   else // otherwise, show the default softkeys
       
   749     {                        
       
   750     // options key is disabled if currently in capture mode
       
   751     // transition (i.e. switching to video mode)
       
   752     if ( iController.CaptureModeTransitionInProgress() )
       
   753       {
       
   754       SetSoftKeysL( iEmbedded
       
   755                   ? R_CAM_SOFTKEYS_BACK
       
   756                   : R_CAM_SOFTKEYS_BLANK_EXIT );
       
   757       if(iEmbedded )
       
   758             {
       
   759             if(isSecondaryPortrait)
       
   760                 {
       
   761                 SetSoftKeysL(R_CAM_SOFTKEYS_BACK_SECONDARY);
       
   762                 }
       
   763             else
       
   764                 {
       
   765                 SetSoftKeysL(R_CAM_SOFTKEYS_BACK);
       
   766                 }
       
   767             }
       
   768         else
       
   769             {
       
   770             if(isSecondaryPortrait)
       
   771                 {
       
   772                 SetSoftKeysL(R_CAM_SOFTKEYS_BLANK_EXIT_SECONDARY);
       
   773                 }
       
   774             else
       
   775                 {
       
   776                 SetSoftKeysL(R_CAM_SOFTKEYS_BLANK_EXIT);
       
   777                 }
       
   778             }
       
   779       }
       
   780     else
       
   781       {
       
   782       if ( iEmbedded )
       
   783         {
       
   784         if ( operation == ECamCapturing || operation == ECamCompleting )
       
   785            {
       
   786            SetSoftKeysL( R_CAM_SOFTKEYS_BLANK );
       
   787            }
       
   788         else 
       
   789            {
       
   790            if(appui->IsSecondCameraEnabled() && !appui->IsQwerty2ndCamera())
       
   791                {
       
   792                SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_BACK__CAPTURE_SECONDARY );
       
   793                }
       
   794            else
       
   795                {
       
   796                SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_BACK__CAPTURE );
       
   797                }
       
   798            		
       
   799            }
       
   800         }
       
   801       else
       
   802         {
       
   803         if ( operation != ECamCompleting 
       
   804             && ( !appui->ShowPostCaptureView() 
       
   805                 || iController.IsViewFinding() ) )
       
   806           {
       
   807           const TCamOrientation orientation = appui->CamOrientation();
       
   808           if ( iController.IsTouchScreenSupported()
       
   809                && (ECamOrientationCamcorder     == orientation 
       
   810                || ECamOrientationCamcorderLeft == orientation) )
       
   811               {
       
   812               SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CAPTURE );
       
   813               }
       
   814           else 
       
   815               {
       
   816               if ( !appui->IsToolBarVisible()
       
   817                   && appui->IsSecondCameraEnabled()
       
   818                   && !iController.IsTouchScreenSupported() )
       
   819                   {
       
   820                   SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CAPTURE_TXT );
       
   821                   }
       
   822               else
       
   823                   {
       
   824                   appui->IsSecondCameraEnabled()?SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CAPTURE_SECONDARY ):
       
   825                       SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CAPTURE );
       
   826                   }
       
   827               }
       
   828           }
       
   829         else // operation == ECamCompleting
       
   830           {
       
   831           SetSoftKeysL( R_CAM_SOFTKEYS_BLANK );
       
   832           }
       
   833 
       
   834         }
       
   835       }
       
   836     }
       
   837   PRINT( _L("Camera <= CCamStillPreCaptureView::UpdateCbaL") );        
       
   838   }
       
   839 
       
   840 
       
   841 // ---------------------------------------------------------------------------
       
   842 // CCamStillPreCaptureView::SetTitlePaneTextL
       
   843 // Set the view's title text
       
   844 // ---------------------------------------------------------------------------
       
   845 //
       
   846 void CCamStillPreCaptureView::SetTitlePaneTextL()
       
   847     {
       
   848     CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() );
       
   849 #ifndef __WINS__
       
   850     if ( iEmbedded /*&& !appUi->IsInCallSend()*/ )
       
   851         {
       
   852         // only set the title if the construction is complete
       
   853         // otherwise the application is not yet set up correctly
       
   854         // as embedded
       
   855         if ( appUi->IsConstructionComplete() )
       
   856             {
       
   857             // set title to name of embedding application
       
   858             appUi->SetTitleEmbeddedL();
       
   859             }                  
       
   860         }
       
   861     else
       
   862 #endif   
       
   863         {
       
   864         TInt titleResourceId = R_CAM_STILL_PRE_CAPTURE_TITLE_NAME;
       
   865      
       
   866         if ( iCaptureSetupModeActive || iSceneSettingModeActive || iInfoListBoxActive )
       
   867             {
       
   868             titleResourceId = CCamCaptureSetupViewBase::SetupModeTitlePaneResourceId();
       
   869             }
       
   870 
       
   871         appUi->SetTitleL( titleResourceId );
       
   872         }
       
   873     }
       
   874 
       
   875 // ---------------------------------------------------------------------------
       
   876 // CCamStillPreCaptureView::StartViewFinder
       
   877 // Enter viewfinder mode
       
   878 // ---------------------------------------------------------------------------
       
   879 //
       
   880 void CCamStillPreCaptureView::StartViewFinder()
       
   881     {
       
   882     iController.EnterViewfinderMode( ECamControllerImage );
       
   883     }
       
   884 
       
   885 // ---------------------------------------------------------------------------
       
   886 // CCamStillPreCaptureView::StopViewFinder
       
   887 // Exit viewfinder mode
       
   888 // ---------------------------------------------------------------------------
       
   889 //
       
   890 void CCamStillPreCaptureView::StopViewFinder()
       
   891     {
       
   892     iController.ExitViewfinderMode( ECamControllerImage );
       
   893     }
       
   894     
       
   895 // ---------------------------------------------------------------------------
       
   896 // CCamStillPreCaptureView::CreateContainerL
       
   897 // Create container control
       
   898 // ---------------------------------------------------------------------------
       
   899 //
       
   900 void CCamStillPreCaptureView::CreateContainerL()
       
   901     {
       
   902     PRINT( _L("Camera => CCamStillPreCaptureView::CreateContainerL" ) )
       
   903      
       
   904     TRect screen;
       
   905     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen );
       
   906 
       
   907     iContainer = CCamStillPreCaptureContainer::NewL(
       
   908         iController,
       
   909         *this,
       
   910         screen );
       
   911     iContainer->SetMopParent( this );
       
   912     PRINT( _L("Camera <= CCamStillPreCaptureView::CreateContainerL" ) )
       
   913     }
       
   914 
       
   915 // ---------------------------------------------------------------------------
       
   916 // CCamStillPreCaptureView::DynInitMenuPaneL
       
   917 // Changes MenuPane dynamically
       
   918 // ---------------------------------------------------------------------------
       
   919 //
       
   920 void CCamStillPreCaptureView::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
       
   921     {
       
   922     PRINT( _L("Camera => CamStillPreCaptureView::DynInitMenuPaneL"))
       
   923 
       
   924     if ( iContainer )
       
   925         {
       
   926         iContainer->Window().SetNonFading( ETrue );
       
   927         }
       
   928 
       
   929     CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() );
       
   930 	__ASSERT_DEBUG(appUi, CamPanic(ECamPanicNullPointer));
       
   931     TInt itemPos(0);
       
   932     if( aMenuPane->MenuItemExists(ECamCmdToggleCourtesyUI, itemPos) )
       
   933         {
       
   934         if ( !appUi->AlwaysDrawPreCaptureCourtesyUI() )
       
   935             {
       
   936             aMenuPane->SetItemTextL( ECamCmdToggleCourtesyUI, 
       
   937                                       R_CAM_CAPTURE_DISPLAY_ON_TEXT);
       
   938             }
       
   939         }
       
   940 
       
   941     // if menu pane is default still capture menu
       
   942     if ( aResourceId == ROID(R_CAM_STILL_PRE_CAPTURE_MENU_ID))
       
   943         {
       
   944         DynInitSwitchCameraMenuItemL( aMenuPane );
       
   945         }
       
   946 //    else if ( aResourceId == R_CAM_STANDBY_MENU && iStandbyError != KErrNone )
       
   947     else if ( aResourceId == R_CAM_STANDBY_MENU )
       
   948         {
       
   949         if( appUi->StandbyStatus() != KErrNone )
       
   950         aMenuPane->SetItemDimmed( ECamCmdExitStandby, ETrue );
       
   951         }
       
   952             
       
   953     else if( aResourceId == ROID(R_CAM_STILL_EMBEDDED_PRE_CAPTURE_MENU_ID))
       
   954         {
       
   955         DynInitSwitchCameraMenuItemL( aMenuPane );
       
   956         
       
   957 /*#ifndef __WINS__
       
   958         // if embedded and not in in-call send
       
   959         if ( !appUi->IsInCallSend() )
       
   960 #endif
       
   961             {
       
   962             aMenuPane->SetItemDimmed( ECamCmdNewVideo, ETrue );
       
   963 			}*/
       
   964 		aMenuPane->SetItemDimmed( ECamCmdNewVideo, ETrue );	
       
   965         }        
       
   966     else // otherwise, not embedded, not in burst mode or menu pane is not default
       
   967         {
       
   968         CCamCaptureSetupViewBase::DynInitMenuPaneL( aResourceId, aMenuPane );        
       
   969         }
       
   970     PRINT( _L("Camera <= CamStillPreCaptureView::DynInitMenuPaneL"))
       
   971     }
       
   972 
       
   973 
       
   974 // ---------------------------------------------------------------------------
       
   975 // CCamPreCaptureViewBase::SwitchToSceneSettingModeL
       
   976 // Switches the current mode to scene setting and activates a 
       
   977 // specific control.
       
   978 // ---------------------------------------------------------------------------
       
   979 //
       
   980 void CCamStillPreCaptureView::SwitchToSceneSettingModeL()
       
   981     {
       
   982     if ( !iSceneSettingContainer )
       
   983     	{
       
   984     	iSceneSettingContainer = CCamShootingModeContainer::NewL( AppUi()->ApplicationRect(),
       
   985                                                              *this,
       
   986                                                              ECamControllerImage,
       
   987                                                              iController );
       
   988         iSceneSettingContainer->DrawableWindow()->SetOrdinalPosition(-1);
       
   989     	}
       
   990     
       
   991     iSettingModeTitleResourceId = R_CAM_STILL_SCENE_SETTING_TITLE;
       
   992 
       
   993     if ( iEmbedded )
       
   994         {
       
   995         iPreviousMenuResourceId = ROID(R_CAM_STILL_EMBEDDED_PRE_CAPTURE_MENUBAR_ID);
       
   996         }
       
   997     else
       
   998         {
       
   999         iPreviousMenuResourceId = ROID(R_CAM_STILL_PRE_CAPTURE_MENUBAR_ID);
       
  1000         }
       
  1001     // Remove the view's main container, and add the capture setup 
       
  1002     // control associated with the input command to the container stack.
       
  1003     //CCamCaptureSetupViewBase::SwitchToSceneSettingModeL();
       
  1004     
       
  1005     CCamPreCaptureViewBase::SwitchToSceneSettingModeL();
       
  1006   
       
  1007 
       
  1008     // only remove the capture setup menu container after 
       
  1009     // the switch completes successfully
       
  1010     RemoveCaptureSetupMenuContainers();
       
  1011 
       
  1012     // Stop the viewfinder as it isn't required for scene settings
       
  1013     StopViewFinder();
       
  1014     }
       
  1015 
       
  1016 
       
  1017 // ---------------------------------------------------------------------------
       
  1018 // CCamPreCaptureViewBase::SwitchToInfoListBoxL
       
  1019 // Switches the current mode to scene setting and activates a 
       
  1020 // specific control.
       
  1021 // ---------------------------------------------------------------------------
       
  1022 //
       
  1023 void CCamStillPreCaptureView::SwitchToInfoListBoxL( TCamInfoListBoxMode aMode )
       
  1024     {   
       
  1025     CCamAppUi* appUi = static_cast<CCamAppUi*>( iCoeEnv->AppUi() );  	
       
  1026     
       
  1027     TBool modeSelected = EFalse;
       
  1028     TInt listBoxResource;
       
  1029     TInt summaryResource;
       
  1030     TInt initialValue;
       
  1031     TInt titleResource;
       
  1032     
       
  1033     switch( aMode )
       
  1034     		{
       
  1035     		case EInfoListBoxModeTimeLapse:	
       
  1036     	 			{
       
  1037     				// Find out whether we are in burst mode	
       
  1038     				TBool burstmode = EFalse;
       
  1039     				
       
  1040     				// if capturing burst with 0 interval then this is normal sequence mode  
       
  1041     				if ( appUi->IsBurstEnabled() )
       
  1042     						{
       
  1043         				burstmode = ETrue;
       
  1044         				}    
       
  1045     
       
  1046     				// Time lapse / sequence mode selector initialization values
       
  1047     				initialValue = CamTimeLapseUtility::IntervalToEnum( iController.TimeLapseInterval(), burstmode );	
       
  1048     				listBoxResource = R_CAM_CAPTURE_SETUP_LIST_SEQUENCE_MODE;
       
  1049     				summaryResource = R_CAM_CAPTURE_SETUP_LIST_SEQUENCE_MODE_SUMMARY;
       
  1050     				titleResource = R_CAM_TIME_LAPSE_TITLE;
       
  1051     				    
       
  1052     				modeSelected = ETrue;
       
  1053     				}
       
  1054     				break;
       
  1055     		
       
  1056 				case EInfoListBoxModeISO:
       
  1057     				{
       
  1058     				// Light sensitivity selector initialization values	
       
  1059     				initialValue = iController.IntegerSettingValue( ECamSettingItemDynamicPhotoLightSensitivity );	
       
  1060     				if ( iController.UiConfigManagerPtr()->IsExtendedLightSensitivitySupported() ) 
       
  1061     				    {
       
  1062         				listBoxResource = R_CAM_CAPTURE_SETUP_LIST_EXTENDED_LIGHT_SENSITIVITY;
       
  1063         				summaryResource = R_CAM_CAPTURE_SETUP_LIST_EXTENDED_LIGHT_SENSITIVITY_SUMMARY;
       
  1064     				    }
       
  1065     				else
       
  1066     				    {
       
  1067         				listBoxResource = R_CAM_CAPTURE_SETUP_LIST_LIGHT_SENSITIVITY;
       
  1068         				summaryResource = R_CAM_CAPTURE_SETUP_LIST_LIGHT_SENSITIVITY_SUMMARY;
       
  1069     				    }
       
  1070     				titleResource = R_CAM_LIGHT_SENSITIVITY_TITLE;   					    				
       
  1071  					modeSelected = ETrue;
       
  1072     				}
       
  1073     				break;
       
  1074     		
       
  1075     		default: 
       
  1076     				break;
       
  1077 				}    					
       
  1078     				    	
       
  1079 		if( modeSelected )
       
  1080 				{
       
  1081 				iInfoListBoxContainer = CCamInfoListBoxContainer::NewL( AppUi()->ApplicationRect(),
       
  1082                                                              		*this,                                                            
       
  1083                                                              		iController,
       
  1084                                                              		listBoxResource,
       
  1085                                                              		summaryResource,
       
  1086                                                              		initialValue, titleResource );		
       
  1087 				iInfoListBoxContainer->DrawableWindow()->SetOrdinalPosition(-1); 
       
  1088 				iInfoListBoxMode = aMode;          
       
  1089 				iSettingModeTitleResourceId = titleResource;                                                   					
       
  1090 
       
  1091     		if ( iEmbedded )
       
  1092         		{
       
  1093         		iPreviousMenuResourceId = ROID(R_CAM_STILL_EMBEDDED_PRE_CAPTURE_MENUBAR_ID);
       
  1094         		}
       
  1095     		else
       
  1096         		{
       
  1097         		iPreviousMenuResourceId = ROID(R_CAM_STILL_PRE_CAPTURE_MENUBAR_ID);
       
  1098         		}
       
  1099     		// Remove the view's main container, and add the capture setup 
       
  1100     		// control associated with the input command to the container stack.
       
  1101     		CCamCaptureSetupViewBase::SwitchToInfoListBoxL( aMode );
       
  1102 
       
  1103     		// only remove the capture setup menu container after 
       
  1104     		// the switch completes successfully
       
  1105     		RemoveCaptureSetupMenuContainers();
       
  1106 
       
  1107     		// Stop the viewfinder
       
  1108     		StopViewFinder();    		    	        
       
  1109     		}
       
  1110     }
       
  1111 
       
  1112 
       
  1113 // ---------------------------------------------------------------------------
       
  1114 // CCamStillPreCaptureView::DoActivateL
       
  1115 // Activate this view
       
  1116 // ---------------------------------------------------------------------------
       
  1117 //
       
  1118 void CCamStillPreCaptureView::DoActivateL( const TVwsViewId& aPrevViewId, 
       
  1119                                           TUid aCustomMessageId,
       
  1120                                           const TDesC8& aCustomMessage )
       
  1121   {
       
  1122   OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMSTILLPRECAPTUREVIEW_DOACTIVATEL, "e_CCamStillPreCaptureView_DoActivateL 1" );
       
  1123   PRINT( _L("Camera => CCamStillPreCaptureView::DoActivateL") );
       
  1124   PERF_EVENT_START_L2( EPerfEventStillPreCaptureViewActivation );    
       
  1125   // Ensure the correct menu is used for the current mode.
       
  1126 
       
  1127   // If we are coming back from settings plugin wait for the sequence to complete
       
  1128     // during that time, update the softkey with BLANK_EXIT softkey
       
  1129     if ( TUid::Uid ( EAknSoftkeyBack ) == aCustomMessageId )
       
  1130       {
       
  1131       iSoftkeyBlankIsNeeded = ETrue;
       
  1132       }
       
  1133   CCamAppUi* appUi =  static_cast<CCamAppUi*>( AppUi() );
       
  1134   
       
  1135   // fixed toolbar is used only with touch devices
       
  1136   if ( iController.IsTouchScreenSupported() )
       
  1137       {
       
  1138       if ( appUi && appUi->IsEmbedded() )
       
  1139           {
       
  1140           CAknToolbar* toolbar = Toolbar();
       
  1141           toolbar->SetToolbarVisibility(EFalse);
       
  1142           }
       
  1143 
       
  1144       UpdateToolbarIconsL();
       
  1145       }
       
  1146   else
       
  1147       {
       
  1148       // handled in CamPreCaptureViewBase
       
  1149       }
       
  1150   if ( appUi )
       
  1151     {
       
  1152     // inform appui of current capture mode
       
  1153     TCamImageCaptureMode mode = appUi->CurrentBurstMode();
       
  1154     
       
  1155     if ( ECamImageCaptureNone != mode )
       
  1156       {
       
  1157       appUi->SetCaptureMode( ECamControllerImage, mode );
       
  1158       }
       
  1159     else
       
  1160       {
       
  1161       appUi->SetCaptureMode( ECamControllerImage, ECamImageCaptureSingle );
       
  1162       }
       
  1163     }
       
  1164 
       
  1165 
       
  1166   CCamPreCaptureViewBase::DoActivateL( aPrevViewId, 
       
  1167                                        aCustomMessageId, 
       
  1168                                        aCustomMessage );                    
       
  1169 
       
  1170 
       
  1171   SetMenuBar();
       
  1172 
       
  1173 
       
  1174     PERF_EVENT_END_L2( EPerfEventStillPreCaptureViewActivation );
       
  1175   PRINT( _L("Camera <= CCamStillPreCaptureView::DoActivateL") );
       
  1176     OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMSTILLPRECAPTUREVIEW_DOACTIVATEL, "e_CCamStillPreCaptureView_DoActivateL 0" );
       
  1177     }
       
  1178 
       
  1179 
       
  1180 // ---------------------------------------------------------------------------
       
  1181 // CCamStillPreCaptureView::GetHelpContext
       
  1182 // Called to identify the help context for this view
       
  1183 // ---------------------------------------------------------------------------
       
  1184 //
       
  1185 void CCamStillPreCaptureView::GetHelpContext( TCoeHelpContext& aContext ) const
       
  1186     {
       
  1187     aContext.iMajor = TUid::Uid( KCameraappUID );
       
  1188     
       
  1189     // First check to see if the scene settings list is open
       
  1190     if ( iSceneSettingModeActive )
       
  1191         {
       
  1192         aContext.iContext = KLCAM_HLP_SCENES_PHOTO;
       
  1193         }
       
  1194     else if( iInfoListBoxActive && EInfoListBoxModeTimeLapse == iInfoListBoxMode )
       
  1195     	{
       
  1196      
       
  1197     	// aContext.iContext = KLCAM_HLP_SCENES_PHOTO;
       
  1198     	aContext.iContext = KLCAM_HLP_ADVANCED_SEQUENCE;
       
  1199     	}
       
  1200     else if( iInfoListBoxActive  && EInfoListBoxModeISO == iInfoListBoxMode )
       
  1201     	{
       
  1202      
       
  1203     	// aContext.iContext = KLCAM_HLP_SCENES_PHOTO;
       
  1204     	aContext.iContext = KLCAM_HLP_LIGHT_SENSITIVITY;
       
  1205     	}
       
  1206     // Else check for standby mode
       
  1207     else if ( iStandbyModeActive )
       
  1208         {
       
  1209         // Also check to see if this is embedded standby
       
  1210         if ( iEmbedded )
       
  1211             {
       
  1212             aContext.iContext = KLCAM_HLP_STANDYBY_EM;
       
  1213             }
       
  1214         else
       
  1215             {
       
  1216             aContext.iContext = KLCAM_HLP_STANDYBY_EM;
       
  1217             }        
       
  1218         }
       
  1219     // Else check for embedded mode
       
  1220     else if ( iEmbedded )
       
  1221         {
       
  1222         aContext.iContext = KLCAM_HLP_VIEWFINDER_PHOTO_EM;
       
  1223         }
       
  1224     // Else this is the plain photo viewfinder
       
  1225     else
       
  1226         {
       
  1227         aContext.iContext = KLCAM_HLP_VIEWFINDER_PHOTO;
       
  1228         }
       
  1229     }  
       
  1230 
       
  1231 // ---------------------------------------------------------------------------
       
  1232 // CCamStillPreCaptureView::DynInitToolbarL
       
  1233 // Dynamically initialize toolbar contents
       
  1234 // ---------------------------------------------------------------------------
       
  1235 //
       
  1236 void CCamStillPreCaptureView::DynInitToolbarL( TInt aResourceId, 
       
  1237                                        CAknToolbar* aToolbar )
       
  1238     {
       
  1239     PRINT2( _L("Camera => CCamStillPreCaptureView::DynInitToolbarL(%d, 0x%X)" ), aResourceId, aToolbar );
       
  1240     (void)aResourceId; // remove compiler warning
       
  1241 
       
  1242     CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() );
       
  1243     iController.StartIdleTimer();
       
  1244 
       
  1245     // fixed toolbar is used only with touch devices
       
  1246     if ( iController.IsTouchScreenSupported() )
       
  1247         {
       
  1248         UpdateToolbarIconsL();
       
  1249         if( aToolbar )
       
  1250                 {            
       
  1251                 if ( iEmbedded && appUi->IsSecondCameraEnabled() )
       
  1252                     {
       
  1253 					aToolbar->SetItemDimmed(ECamCmdNewVideo, ETrue, ETrue);
       
  1254                     }
       
  1255                 CAknToolbarExtension* extension = aToolbar->ToolbarExtension();
       
  1256 
       
  1257                 if( extension )
       
  1258                     {
       
  1259 
       
  1260                     if ( iEmbedded )
       
  1261                         {
       
  1262 						extension->HideItemL( ECamCmdNewVideo, ETrue );
       
  1263                         extension->HideItemL( ECamCmdTimeLapseSlider, ETrue );
       
  1264                         extension->HideItemL( ECamCmdPhotos, ETrue );
       
  1265                         }
       
  1266                     else
       
  1267                         {
       
  1268                         extension->HideItemL( ECamCmdNewVideo, EFalse );
       
  1269                         extension->HideItemL( ECamCmdToggleFacetracking, EFalse );
       
  1270                         extension->HideItemL( ECamCmdPhotos, EFalse );
       
  1271                         }
       
  1272                     if(aResourceId == ECamCmdToolbarExtension)
       
  1273                         {
       
  1274                         appUi->ZoomPane()->MakeVisible(EFalse,ETrue);
       
  1275                         }
       
  1276                     }
       
  1277                 }
       
  1278         }
       
  1279     
       
  1280     PRINT2( _L("Camera <= CCamStillPreCaptureView::DynInitToolbarL(%d, 0x%X)" ), aResourceId, aToolbar );
       
  1281     }
       
  1282 
       
  1283 // ---------------------------------------------------------------------------
       
  1284 // CCamStillPreCaptureView::UpdateToolbarIconsL
       
  1285 // Update fixed toolbar icons according to current settings
       
  1286 // ---------------------------------------------------------------------------
       
  1287 //
       
  1288 void CCamStillPreCaptureView::UpdateToolbarIconsL()
       
  1289     {
       
  1290 	OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMSTILLPRECAPTUREVIEW_UPDATETOOLBARICONSL, "e_CCamStillPreCaptureView_UpdateToolbarIconsL 1" );
       
  1291     // fixed toolbar is used only with touch devices
       
  1292     if(!iController.IsTouchScreenSupported())
       
  1293         return;
       
  1294 	UpdateFlashIconsL();
       
  1295 	UpdateLightSensitivityIconsL();
       
  1296 	UpdateColorToneIconsL();
       
  1297 	UpdateWhiteBalanceIconsL();
       
  1298 	UpdateSharpnessIconsL();
       
  1299 	UpdateExposureIconsL();
       
  1300 	UpdateContrastIconsL();
       
  1301 	UpdateSceneModeIconsL();            
       
  1302 	UpdateSelfTimerIconsL();
       
  1303 	UpdateVFGridIconsL();
       
  1304 	UpdateBurstModeIconsL();
       
  1305 	UpdateFaceTracKingIconsL(); 
       
  1306 	RedrawToolBar();
       
  1307     OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMSTILLPRECAPTUREVIEW_UPDATETOOLBARICONSL, "e_CCamStillPreCaptureView_UpdateToolbarIconsL 0" );
       
  1308     }
       
  1309 
       
  1310 // ---------------------------------------------------------------------------
       
  1311 // CCamStillPreCaptureView::UpdateFlashIconsL
       
  1312 // ---------------------------------------------------------------------------
       
  1313 //
       
  1314 void CCamStillPreCaptureView::UpdateFlashIconsL()
       
  1315     {
       
  1316     CAknButton* button = ToolbarButtonById(ECamCmdCaptureSetupFlashStill);
       
  1317     if(!button)
       
  1318         return;
       
  1319     TCamFlashId flash = static_cast< TCamFlashId > 
       
  1320                         ( iController.IntegerSettingValue( ECamSettingItemDynamicPhotoFlash ) );
       
  1321     MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
       
  1322     TFileName iconFileName;
       
  1323     CamUtility::ResourceFileName( iconFileName );
       
  1324     switch(flash)
       
  1325         {
       
  1326         case ECamFlashAuto:
       
  1327             {
       
  1328             SetIconL(
       
  1329                 button,
       
  1330                 iconFileName,
       
  1331                 EMbmCameraappQgn_indi_cam4_autoflash,
       
  1332                 EMbmCameraappQgn_indi_cam4_autoflash_mask,
       
  1333                 skinInstance,
       
  1334                 KAknsIIDQgnIndiCam4Autoflash );
       
  1335                 
       
  1336             break;
       
  1337             }
       
  1338         case ECamFlashOff:
       
  1339             {
       
  1340             SetIconL(
       
  1341                 button,
       
  1342                 iconFileName,
       
  1343                 EMbmCameraappQgn_indi_cam4_flash_off,
       
  1344                 EMbmCameraappQgn_indi_cam4_flash_off_mask,
       
  1345                 skinInstance,
       
  1346                 KAknsIIDQgnIndiCam4FlashOff );
       
  1347             break;
       
  1348             }
       
  1349         case ECamFlashAntiRedEye:
       
  1350             {
       
  1351             SetIconL(
       
  1352                 button,
       
  1353                 iconFileName,
       
  1354                 EMbmCameraappQgn_indi_cam4_antired,
       
  1355                 EMbmCameraappQgn_indi_cam4_antired_mask,
       
  1356                 skinInstance,
       
  1357                 KAknsIIDQgnIndiCam4Antired );
       
  1358             break;
       
  1359             }
       
  1360         case ECamFlashForced:
       
  1361             {
       
  1362             SetIconL(
       
  1363                 button,
       
  1364                 iconFileName,
       
  1365                 EMbmCameraappQgn_indi_cam4_flash_on,
       
  1366                 EMbmCameraappQgn_indi_cam4_flash_on_mask,
       
  1367                 skinInstance,
       
  1368                 KAknsIIDQgnIndiCam4FlashOn );
       
  1369             break;
       
  1370             }
       
  1371         default:
       
  1372             break;
       
  1373         }
       
  1374     }
       
  1375 
       
  1376 // ---------------------------------------------------------------------------
       
  1377 // CCamStillPreCaptureView::UpdateContrastIconsL
       
  1378 // ---------------------------------------------------------------------------
       
  1379 //
       
  1380 void CCamStillPreCaptureView::UpdateContrastIconsL()
       
  1381     {
       
  1382     CAknButton* button = ToolbarButtonById(ECamCmdCaptureSetupContrastStill);
       
  1383     if ( button )
       
  1384         {
       
  1385         if ( !iController.UiConfigManagerPtr()->IsContrastSupported() )
       
  1386             {
       
  1387             HideButton(ECamCmdCaptureSetupContrastStill);
       
  1388             return;
       
  1389             }
       
  1390         TInt contrast = iController.IntegerSettingValue( ECamSettingItemDynamicPhotoContrast );
       
  1391         MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
       
  1392         TFileName iconFileName;
       
  1393         CamUtility::ResourceFileName( iconFileName );
       
  1394         if (contrast > 0)
       
  1395             {
       
  1396             SetIconL(
       
  1397                 button,
       
  1398                 iconFileName,
       
  1399                 EMbmCameraappQgn_indi_cam4_contrast_plus,
       
  1400                 EMbmCameraappQgn_indi_cam4_contrast_plus_mask,
       
  1401                 skinInstance,
       
  1402                 KAknsIIDQgnIndiCam4ContrastPlus );
       
  1403            }
       
  1404         else if (contrast < 0)
       
  1405             {
       
  1406             SetIconL(
       
  1407                 button,
       
  1408                 iconFileName,
       
  1409                 EMbmCameraappQgn_indi_cam4_contrast_minus,
       
  1410                 EMbmCameraappQgn_indi_cam4_contrast_minus_mask,
       
  1411                 skinInstance,
       
  1412                 KAknsIIDQgnIndiCam4ContrastMinus );
       
  1413             }
       
  1414         else 
       
  1415             {
       
  1416             SetIconL(
       
  1417                 button,
       
  1418                 iconFileName,
       
  1419                 EMbmCameraappQgn_indi_cam4_contrast,
       
  1420                 EMbmCameraappQgn_indi_cam4_contrast_mask,
       
  1421                 skinInstance,
       
  1422                 KAknsIIDQgnIndiCam4Contrast );
       
  1423             }
       
  1424         }                
       
  1425     }
       
  1426 
       
  1427 
       
  1428 // ---------------------------------------------------------------------------
       
  1429 // CCamStillPreCaptureView::UpdateExposureIconsL
       
  1430 // ---------------------------------------------------------------------------
       
  1431 //
       
  1432 void CCamStillPreCaptureView::UpdateExposureIconsL()
       
  1433     {
       
  1434     CAknButton* button = ToolbarButtonById( ECamCmdCaptureSetupExposureStill );
       
  1435     if ( button )
       
  1436         {
       
  1437         if ( !iController.UiConfigManagerPtr()->IsEVSupported() )
       
  1438             {
       
  1439             HideButton(ECamCmdCaptureSetupExposureStill);
       
  1440             return;
       
  1441             }
       
  1442         TInt exposure = iController.IntegerSettingValue( ECamSettingItemDynamicPhotoExposure );
       
  1443         MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
       
  1444         TFileName iconFileName;
       
  1445         CamUtility::ResourceFileName( iconFileName );
       
  1446         if (exposure > 0)
       
  1447             {
       
  1448             SetIconL(
       
  1449                 button,
       
  1450                 iconFileName,
       
  1451                 EMbmCameraappQgn_indi_cam4_exposure_plus,
       
  1452                 EMbmCameraappQgn_indi_cam4_exposure_plus_mask,
       
  1453                 skinInstance,
       
  1454                 KAknsIIDQgnIndiCam4ExposurePlus );
       
  1455             }
       
  1456         else if (exposure < 0)
       
  1457             {
       
  1458             SetIconL(
       
  1459                 button,
       
  1460                 iconFileName,
       
  1461                 EMbmCameraappQgn_indi_cam4_exposure_minus,
       
  1462                 EMbmCameraappQgn_indi_cam4_exposure_minus_mask,
       
  1463                 skinInstance,
       
  1464                 KAknsIIDQgnIndiCam4ExposureMinus );
       
  1465             }
       
  1466         else 
       
  1467             {
       
  1468             SetIconL(
       
  1469                 button,
       
  1470                 iconFileName,
       
  1471                 EMbmCameraappQgn_indi_cam4_exposure,
       
  1472                 EMbmCameraappQgn_indi_cam4_exposure_mask,
       
  1473                 skinInstance,
       
  1474                 KAknsIIDQgnIndiCam4Exposure );
       
  1475             }
       
  1476         }                
       
  1477     }
       
  1478 
       
  1479 
       
  1480 // ---------------------------------------------------------------------------
       
  1481 // CCamStillPreCaptureView::UpdateSharpnessIconsL
       
  1482 // ---------------------------------------------------------------------------
       
  1483 //
       
  1484 void CCamStillPreCaptureView::UpdateSharpnessIconsL()
       
  1485     {
       
  1486     CAknButton* button = ToolbarButtonById(ECamCmdCaptureSetupImageSharpnessStill);
       
  1487     if ( button )
       
  1488         {
       
  1489         if ( !iController.UiConfigManagerPtr()->IsSharpnessFeatureSupported() )
       
  1490             {
       
  1491             HideButton(ECamCmdCaptureSetupImageSharpnessStill);
       
  1492             return;
       
  1493             }
       
  1494         TCamImageSharpnessId sharpness = 
       
  1495                   static_cast< TCamImageSharpnessId > 
       
  1496                     ( iController.IntegerSettingValue(
       
  1497                             ECamSettingItemDynamicPhotoImageSharpness ) ); 
       
  1498         MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
       
  1499         TFileName iconFileName;
       
  1500         CamUtility::ResourceFileName( iconFileName );
       
  1501         static_cast< TCamImageSharpnessId > 
       
  1502             ( iController.IntegerSettingValue(
       
  1503                     ECamSettingItemDynamicPhotoImageSharpness ) );
       
  1504 
       
  1505         switch ( sharpness )
       
  1506             {
       
  1507             case ECamImageSharpnessHard:
       
  1508                 {
       
  1509                 SetIconL(
       
  1510                     button,
       
  1511                     iconFileName,
       
  1512                     EMbmCameraappQgn_indi_cam4_sharpness_hard,
       
  1513                     EMbmCameraappQgn_indi_cam4_sharpness_hard_mask,
       
  1514                     skinInstance,
       
  1515                     KAknsIIDQgnIndiCam4SharpnessHard );
       
  1516                 break;
       
  1517                 }
       
  1518             case ECamImageSharpnessNorm:
       
  1519                 {
       
  1520                 SetIconL(
       
  1521                     button,
       
  1522                     iconFileName,
       
  1523                     EMbmCameraappQgn_indi_cam4_sharpness_normal,
       
  1524                     EMbmCameraappQgn_indi_cam4_sharpness_normal_mask,
       
  1525                     skinInstance,
       
  1526                     KAknsIIDQgnIndiCam4SharpnessNormal );
       
  1527                 break;
       
  1528                 }
       
  1529             case ECamImageSharpnessSoft:
       
  1530                 {
       
  1531                 SetIconL(
       
  1532                     button,
       
  1533                     iconFileName,
       
  1534                     EMbmCameraappQgn_indi_cam4_sharpness_soft,
       
  1535                     EMbmCameraappQgn_indi_cam4_sharpness_soft_mask,
       
  1536                     skinInstance,
       
  1537                     KAknsIIDQgnIndiCam4SharpnessSoft );
       
  1538                 break;
       
  1539                 }
       
  1540             default:
       
  1541                 {
       
  1542                 break;
       
  1543                 }
       
  1544             }
       
  1545         }
       
  1546     
       
  1547     }
       
  1548 
       
  1549 
       
  1550 // ---------------------------------------------------------------------------
       
  1551 // CCamStillPreCaptureView::UpdateWhiteBalanceIconsL
       
  1552 // ---------------------------------------------------------------------------
       
  1553 //
       
  1554 void CCamStillPreCaptureView::UpdateWhiteBalanceIconsL()
       
  1555     {
       
  1556     CAknButton* button = ToolbarButtonById( ECamCmdCaptureSetupWhiteBalanceStill );
       
  1557     if ( button )
       
  1558         {
       
  1559         if ( !iController.UiConfigManagerPtr()->IsWhiteBalanceFeatureSupported() )
       
  1560             {
       
  1561             HideButton(ECamCmdCaptureSetupWhiteBalanceStill);
       
  1562             return;
       
  1563             }
       
  1564         TCamWhiteBalanceId wb = static_cast< TCamWhiteBalanceId > 
       
  1565             ( iController.IntegerSettingValue( ECamSettingItemDynamicPhotoWhiteBalance ) );
       
  1566         MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
       
  1567         TFileName iconFileName;
       
  1568         CamUtility::ResourceFileName( iconFileName );    
       
  1569         switch ( wb )
       
  1570             {
       
  1571             case ECamWhiteBalanceAWB:
       
  1572                 {
       
  1573                 SetIconL(
       
  1574                     button,
       
  1575                     iconFileName,
       
  1576                     EMbmCameraappQgn_indi_cam4_wb_auto,
       
  1577                     EMbmCameraappQgn_indi_cam4_wb_auto_mask,
       
  1578                     skinInstance,
       
  1579                     KAknsIIDQgnIndiCam4WbAuto );
       
  1580                 break;
       
  1581                 }
       
  1582             case ECamWhiteBalanceDaylight:
       
  1583                 {
       
  1584                 SetIconL(
       
  1585                     button,
       
  1586                     iconFileName,
       
  1587                     EMbmCameraappQgn_indi_cam4_wb_sunny,
       
  1588                     EMbmCameraappQgn_indi_cam4_wb_sunny_mask,
       
  1589                     skinInstance,
       
  1590                     KAknsIIDQgnIndiCam4WbSunny );
       
  1591                 break;
       
  1592                 }
       
  1593             case ECamWhiteBalanceCloudy:
       
  1594                 {
       
  1595                 SetIconL(
       
  1596                     button,
       
  1597                     iconFileName,
       
  1598                     EMbmCameraappQgn_indi_cam4_wb_cloudy,
       
  1599                     EMbmCameraappQgn_indi_cam4_wb_cloudy_mask,
       
  1600                     skinInstance,
       
  1601                     KAknsIIDQgnIndiCam4WbCloudy );
       
  1602                 break;
       
  1603                 }
       
  1604             case ECamWhiteBalanceTungsten:
       
  1605                 {
       
  1606                 SetIconL(
       
  1607                     button,
       
  1608                     iconFileName,
       
  1609                     EMbmCameraappQgn_indi_cam4_wb_tungsten,
       
  1610                     EMbmCameraappQgn_indi_cam4_wb_tungsten_mask,
       
  1611                     skinInstance,
       
  1612                     KAknsIIDQgnIndiCam4WbTungsten );
       
  1613                 break;
       
  1614                 }
       
  1615             case ECamWhiteBalanceFlourescent:
       
  1616                 {
       
  1617                 SetIconL(
       
  1618                     button,
       
  1619                     iconFileName,
       
  1620                     EMbmCameraappQgn_indi_cam4_wb_fluorecent,
       
  1621                     EMbmCameraappQgn_indi_cam4_wb_fluorecent_mask,
       
  1622                     skinInstance,
       
  1623                     KAknsIIDQgnIndiCam4WbFluorecent );
       
  1624                 break;
       
  1625                 }
       
  1626             default:
       
  1627                 break;
       
  1628             }
       
  1629         }
       
  1630     
       
  1631     }
       
  1632 
       
  1633 
       
  1634 // ---------------------------------------------------------------------------
       
  1635 // CCamStillPreCaptureView::UpdateColorToneIconsL
       
  1636 // ---------------------------------------------------------------------------
       
  1637 //
       
  1638 void CCamStillPreCaptureView::UpdateColorToneIconsL()
       
  1639     {
       
  1640     CAknButton* button = ToolbarButtonById( ECamCmdCaptureSetupColourFilterStill );
       
  1641     if ( button )
       
  1642         {
       
  1643         if ( !iController.UiConfigManagerPtr()->IsColorToneFeatureSupported() )
       
  1644             {
       
  1645             HideButton(ECamCmdCaptureSetupColourFilterStill);
       
  1646             return;
       
  1647             }
       
  1648         TCamColourFilterId color = static_cast< TCamColourFilterId > 
       
  1649             ( iController.IntegerSettingValue( ECamSettingItemDynamicPhotoColourFilter ) );
       
  1650         MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
       
  1651         TFileName iconFileName;
       
  1652         CamUtility::ResourceFileName( iconFileName );    
       
  1653         switch ( color )
       
  1654             {
       
  1655             case ECamColourFilterColour:
       
  1656                 {
       
  1657                 SetIconL(
       
  1658                     button,
       
  1659                     iconFileName,
       
  1660                     EMbmCameraappQgn_indi_cam4_colour_normal,
       
  1661                     EMbmCameraappQgn_indi_cam4_colour_normal_mask,
       
  1662                     skinInstance,
       
  1663                     KAknsIIDQgnIndiCam4ColourNormal );
       
  1664                 break;
       
  1665                 }
       
  1666             case ECamColourFilterBlackAndWhite:
       
  1667                 {
       
  1668                 SetIconL(
       
  1669                     button,
       
  1670                     iconFileName,
       
  1671                     EMbmCameraappQgn_indi_cam4_colour_bw,
       
  1672                     EMbmCameraappQgn_indi_cam4_colour_bw_mask,
       
  1673                     skinInstance,
       
  1674                     KAknsIIDQgnIndiCam4ColourBw );
       
  1675                 break;
       
  1676                 }
       
  1677             case ECamColourFilterSepia:
       
  1678                 {
       
  1679                 SetIconL(
       
  1680                     button,
       
  1681                     iconFileName,
       
  1682                     EMbmCameraappQgn_indi_cam4_colour_sepia,
       
  1683                     EMbmCameraappQgn_indi_cam4_colour_sepia_mask,
       
  1684                     skinInstance,
       
  1685                     KAknsIIDQgnIndiCam4ColourSepia );
       
  1686                 break;
       
  1687                 }
       
  1688             case ECamColourFilterNegative:
       
  1689                 {
       
  1690                 SetIconL(
       
  1691                     button,
       
  1692                     iconFileName,
       
  1693                     EMbmCameraappQgn_indi_cam4_colour_negative,
       
  1694                     EMbmCameraappQgn_indi_cam4_colour_negative_mask,
       
  1695                     skinInstance,
       
  1696                     KAknsIIDQgnIndiCam4ColourNegative );
       
  1697                 break;
       
  1698                 }
       
  1699             case ECamColourFilterVivid:
       
  1700                 {
       
  1701                 SetIconL(
       
  1702                     button,
       
  1703                     iconFileName,
       
  1704                     EMbmCameraappQgn_indi_cam4_colour_vivid,
       
  1705                     EMbmCameraappQgn_indi_cam4_colour_vivid_mask,
       
  1706                     skinInstance,
       
  1707                     KAknsIIDQgnIndiCam4ColourVivid );
       
  1708                 break;
       
  1709                 }
       
  1710             default:
       
  1711                 break;
       
  1712             }
       
  1713         }
       
  1714     }
       
  1715 
       
  1716 // ---------------------------------------------------------------------------
       
  1717 // CCamStillPreCaptureView::UpdateLightSensitivityIconsL
       
  1718 // ---------------------------------------------------------------------------
       
  1719 //
       
  1720 void CCamStillPreCaptureView::UpdateLightSensitivityIconsL()
       
  1721     {
       
  1722     CAknButton* button = ToolbarButtonById( ECamCmdCaptureSetupLightSensitivityStill );
       
  1723     if ( button )
       
  1724         {
       
  1725         if (!iController.UiConfigManagerPtr()->IsISOSupported())
       
  1726             {
       
  1727             HideButton(ECamCmdCaptureSetupLightSensitivityStill);
       
  1728             return;
       
  1729             }
       
  1730         TCamLightSensitivityId iso = static_cast< TCamLightSensitivityId > 
       
  1731             ( iController.IntegerSettingValue( ECamSettingItemDynamicPhotoLightSensitivity ) );
       
  1732         MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
       
  1733         TFileName iconFileName;
       
  1734         CamUtility::ResourceFileName( iconFileName );     
       
  1735         switch ( iso )
       
  1736             {
       
  1737             case ECamLightSensitivityAuto:
       
  1738                 {
       
  1739                 SetIconL(
       
  1740                     button,
       
  1741                     iconFileName,
       
  1742                     EMbmCameraappQgn_indi_cam4_iso_auto,
       
  1743                     EMbmCameraappQgn_indi_cam4_iso_auto_mask,
       
  1744                     skinInstance,
       
  1745                     KAknsIIDQgnIndiCam4IsoAuto );
       
  1746                 break;
       
  1747                 }
       
  1748             case ECamLightSensitivityLow:
       
  1749             //case ECamLightSensitivityLowMed:
       
  1750                 {
       
  1751                 SetIconL(
       
  1752                     button,
       
  1753                     iconFileName,
       
  1754                     EMbmCameraappQgn_indi_cam4_iso_low,
       
  1755                     EMbmCameraappQgn_indi_cam4_iso_low_mask,
       
  1756                     skinInstance,
       
  1757                     KAknsIIDQgnIndiCam4IsoLow );
       
  1758                 break;
       
  1759                 }
       
  1760             case ECamLightSensitivityMed:
       
  1761             //case ECamLightSensitivityMedHigh:
       
  1762                 {
       
  1763                 SetIconL(
       
  1764                     button,
       
  1765                     iconFileName,
       
  1766                     EMbmCameraappQgn_indi_cam4_iso_medium,
       
  1767                     EMbmCameraappQgn_indi_cam4_iso_medium_mask,
       
  1768                     skinInstance,
       
  1769                     KAknsIIDQgnIndiCam4IsoMedium );
       
  1770                 break;
       
  1771                 }
       
  1772             case ECamLightSensitivityHigh:
       
  1773                 {
       
  1774                 SetIconL(
       
  1775                     button,
       
  1776                     iconFileName,
       
  1777                     EMbmCameraappQgn_indi_cam4_iso_high,
       
  1778                     EMbmCameraappQgn_indi_cam4_iso_high_mask,
       
  1779                     skinInstance,
       
  1780                     KAknsIIDQgnIndiCam4IsoHigh );
       
  1781                 break;
       
  1782                 }
       
  1783             default:
       
  1784                 break;
       
  1785             }
       
  1786         }
       
  1787     
       
  1788     }
       
  1789 
       
  1790 // ---------------------------------------------------------------------------
       
  1791 // CCamStillPreCaptureView::StartMskCapture()
       
  1792 // Try to start the capture with MSK command. Return true if started.
       
  1793 // ---------------------------------------------------------------------------
       
  1794 //
       
  1795 TBool CCamStillPreCaptureView::StartMskCaptureL()
       
  1796     {
       
  1797     PRINT( _L("Camera => CCamStillPreCaptureView::StartMskCapture") );
       
  1798     CCamAppUi* appUi = static_cast<CCamAppUi*>( iEikonEnv->AppUi() );
       
  1799     TCamOrientation orientation = appUi->CamOrientation();
       
  1800     TBool startedCapture(EFalse);
       
  1801 	if( orientation == ECamOrientationCamcorder || 
       
  1802 	    orientation == ECamOrientationCamcorderLeft ||
       
  1803 		orientation == ECamOrientationPortrait )
       
  1804 		{
       
  1805 		// In case of MSK if no AP on screen, it should work as capture
       
  1806 		// If optical joystic is not available, we will start the 
       
  1807 		// capturing with auto-focusing here. Otherwise it is handled
       
  1808 		// in CCamStillPreCaptureContainer
       
  1809 		if ( appUi && !appUi->IsToolBarVisible()
       
  1810 		     && iController.UiConfigManagerPtr() 
       
  1811 		     && !iController.UiConfigManagerPtr()->IsOpticalJoyStickSupported() )
       
  1812 		    {
       
  1813       	    OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMSTILLPRECAPTUREVIEW_STARTMSKCAPTUREL, "e_CAM_PRI_AF_LOCK 1" );
       
  1814       	    if ( iController.IsViewFinding() && appUi->CheckMemoryL() &&
       
  1815                 !iController.CaptureModeTransitionInProgress() ) 
       
  1816             	{
       
  1817             	SetSoftKeysL( R_CAM_SOFTKEYS_BLANK );
       
  1818 
       
  1819             	// fixed toolbar is used only with touch devices
       
  1820             	if ( iController.IsTouchScreenSupported() )
       
  1821             	    {
       
  1822                     CAknToolbar* fixedToolbar = Toolbar();
       
  1823                     if ( fixedToolbar )
       
  1824                         {
       
  1825                         fixedToolbar->SetToolbarVisibility( EFalse );
       
  1826                         }
       
  1827             	    }
       
  1828                     // Start the autofocus operation now, the capture will be queued
       
  1829                     // after focus completes
       
  1830                     if ( !appUi->SelfTimerEnabled() )
       
  1831                         {
       
  1832                         OstTrace0( CAMERAAPP_PERFORMANCE, CCAMSTILLPRECAPTUREVIEW_STARTMSKCAPTUREL, "e_CAM_APP_AF 1" );
       
  1833                         iController.StartAutoFocus();
       
  1834                         }
       
  1835                 	
       
  1836                 	TKeyEvent keyEvent;
       
  1837                 	appUi->StartCaptureL( keyEvent );
       
  1838                 	startedCapture = ETrue;
       
  1839     		    }
       
  1840     		}
       
  1841 	    // else let the calling function take care of capturing
       
  1842     	}
       
  1843 	PRINT( _L("Camera <= CCamStillPreCaptureView::StartMskCapture") );
       
  1844   	return startedCapture;
       
  1845   	}
       
  1846 
       
  1847 // ---------------------------------------------------------------------------
       
  1848 // CCamStillPreCaptureView::UpdateSelfTimerIconsL
       
  1849 // ---------------------------------------------------------------------------
       
  1850 //
       
  1851 void CCamStillPreCaptureView::UpdateSelfTimerIconsL()
       
  1852     {
       
  1853     CAknButton* button = ToolbarButtonById( ECamCmdCaptureSetupSelfTimer );
       
  1854     if ( button )
       
  1855         {
       
  1856         TCamSelfTimerId selftimer = static_cast< TCamSelfTimerId > 
       
  1857             ( iController.IntegerSettingValue( ECamSettingItemDynamicSelfTimer ) );
       
  1858         MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
       
  1859         TFileName iconFileName;
       
  1860         CamUtility::ResourceFileName( iconFileName );     
       
  1861         switch ( selftimer )
       
  1862             {
       
  1863             case ECamSelfTimerOff:
       
  1864                 {
       
  1865                 SetIconL(
       
  1866                     button,
       
  1867                     iconFileName,
       
  1868                     EMbmCameraappQgn_indi_cam4_selftimer_off,
       
  1869                     EMbmCameraappQgn_indi_cam4_selftimer_off_mask,
       
  1870                     skinInstance,
       
  1871                     KAknsIIDQgnIndiCam4SelftimerOff );
       
  1872                 break;
       
  1873                 }
       
  1874             case ECamSelfTimer2:
       
  1875                 {
       
  1876                 SetIconL(
       
  1877                     button,
       
  1878                     iconFileName,
       
  1879                     EMbmCameraappQgn_indi_cam4_selftimer_2sec,
       
  1880                     EMbmCameraappQgn_indi_cam4_selftimer_2sec_mask,
       
  1881                     skinInstance,
       
  1882                     KAknsIIDQgnIndiCam4Selftimer2sec );
       
  1883                 break;
       
  1884                 }
       
  1885             case ECamSelfTimer10:
       
  1886                 {
       
  1887                 SetIconL(
       
  1888                     button,
       
  1889                     iconFileName,
       
  1890                     EMbmCameraappQgn_indi_cam4_selftimer_10s,
       
  1891                     EMbmCameraappQgn_indi_cam4_selftimer_10s_mask,
       
  1892                     skinInstance,
       
  1893                     KAknsIIDQgnIndiCam4Selftimer10s );
       
  1894                 break;
       
  1895                 }
       
  1896             case ECamSelfTimer20:
       
  1897                 {
       
  1898                 SetIconL(
       
  1899                     button,
       
  1900                     iconFileName,
       
  1901                     EMbmCameraappQgn_indi_cam4_selftimer_20s,
       
  1902                     EMbmCameraappQgn_indi_cam4_selftimer_20s_mask,
       
  1903                     skinInstance,
       
  1904                     KAknsIIDQgnIndiCam4Selftimer20s );
       
  1905                 break;
       
  1906                 }
       
  1907             default:
       
  1908                 break;
       
  1909             }
       
  1910         }
       
  1911 
       
  1912     }
       
  1913 
       
  1914 // ---------------------------------------------------------------------------
       
  1915 // CCamStillPreCaptureView::UpdateSceneModeIconsL
       
  1916 // ---------------------------------------------------------------------------
       
  1917 //
       
  1918 void CCamStillPreCaptureView::UpdateSceneModeIconsL()
       
  1919     {
       
  1920     CAknButton* button = ToolbarButtonById( ECamCmdCaptureSetupSceneStill );
       
  1921 
       
  1922     if ( button )
       
  1923         {
       
  1924         TCamSceneId scene = static_cast< TCamSceneId > ( 
       
  1925             iController.IntegerSettingValue( ECamSettingItemDynamicPhotoScene ) );
       
  1926         MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
       
  1927         TFileName iconFileName;
       
  1928         CamUtility::ResourceFileName( iconFileName );     
       
  1929   
       
  1930         switch ( scene )
       
  1931             {
       
  1932             case ECamSceneAuto:
       
  1933                 {
       
  1934                 SetIconL(
       
  1935                     button,
       
  1936                     iconFileName,
       
  1937                     EMbmCameraappQgn_indi_cam4_mode_auto,
       
  1938                     EMbmCameraappQgn_indi_cam4_mode_auto_mask,
       
  1939                     skinInstance,
       
  1940                     KAknsIIDQgnIndiCam4ModeAuto );
       
  1941                 break;
       
  1942                 }
       
  1943             case ECamSceneUser:
       
  1944                 {
       
  1945                 SetIconL(
       
  1946                     button,
       
  1947                     iconFileName,
       
  1948                     EMbmCameraappQgn_indi_cam4_mode_userscene,
       
  1949                     EMbmCameraappQgn_indi_cam4_mode_userscene_mask,
       
  1950                     skinInstance,
       
  1951                     KAknsIIDQgnIndiCam4ModeUserscene );
       
  1952                 break;
       
  1953                 }                    
       
  1954             case ECamSceneMacro:
       
  1955                 {
       
  1956                 SetIconL(
       
  1957                     button,
       
  1958                     iconFileName,
       
  1959                     EMbmCameraappQgn_indi_cam4_mode_closeup,
       
  1960                     EMbmCameraappQgn_indi_cam4_mode_closeup_mask,
       
  1961                     skinInstance,
       
  1962                     KAknsIIDQgnIndiCam4ModeCloseup );
       
  1963                 break;
       
  1964                 }          
       
  1965             case ECamScenePortrait:
       
  1966                 {
       
  1967                 SetIconL(
       
  1968                     button,
       
  1969                     iconFileName,
       
  1970                     EMbmCameraappQgn_indi_cam4_mode_portrait,
       
  1971                     EMbmCameraappQgn_indi_cam4_mode_portrait_mask,
       
  1972                     skinInstance,
       
  1973                     KAknsIIDQgnIndiCam4ModePortrait );
       
  1974                 break;
       
  1975                 }
       
  1976             case ECamSceneScenery:
       
  1977                 {
       
  1978                 SetIconL(
       
  1979                     button,
       
  1980                     iconFileName,
       
  1981                     EMbmCameraappQgn_indi_cam4_mode_landscape,
       
  1982                     EMbmCameraappQgn_indi_cam4_mode_landscape_mask,
       
  1983                     skinInstance,
       
  1984                     KAknsIIDQgnIndiCam4ModeLandscape );
       
  1985                 break;
       
  1986                 }
       
  1987             case ECamSceneNight:
       
  1988                 {
       
  1989                 SetIconL(
       
  1990                     button,
       
  1991                     iconFileName,
       
  1992                     EMbmCameraappQgn_indi_cam4_mode_night, 
       
  1993                     EMbmCameraappQgn_indi_cam4_mode_night_mask,
       
  1994                     skinInstance,
       
  1995                     KAknsIIDQgnIndiCam4ModeNight );
       
  1996                 break;
       
  1997                 }
       
  1998             case ECamSceneSports:
       
  1999                 {
       
  2000                 SetIconL(
       
  2001                     button,
       
  2002                     iconFileName,
       
  2003                     EMbmCameraappQgn_indi_cam4_mode_sport,
       
  2004                     EMbmCameraappQgn_indi_cam4_mode_sport_mask,
       
  2005                     skinInstance,
       
  2006                     KAknsIIDQgnIndiCam4ModeSport );
       
  2007                 break;
       
  2008                 }
       
  2009             case ECamSceneNightScenery:
       
  2010             case ECamSceneNightPortrait:
       
  2011                 {
       
  2012                 SetIconL(
       
  2013                     button,
       
  2014                     iconFileName,
       
  2015                     EMbmCameraappQgn_indi_cam4_mode_portrait_night, 
       
  2016                     EMbmCameraappQgn_indi_cam4_mode_portrait_night_mask, 
       
  2017                     skinInstance,
       
  2018                     KAknsIIDQgnIndiCam4ModePortraitNight );
       
  2019                 break;
       
  2020                 }
       
  2021             case ECamSceneCandlelight:
       
  2022             default:
       
  2023                 break;
       
  2024             }
       
  2025         }
       
  2026     
       
  2027     }
       
  2028 
       
  2029 // ---------------------------------------------------------------------------
       
  2030 // CCamStillPreCaptureView::UpdateVFGridIconsL
       
  2031 // ---------------------------------------------------------------------------
       
  2032 //
       
  2033 void CCamStillPreCaptureView::UpdateVFGridIconsL()
       
  2034     {
       
  2035     CAknButton* button = ToolbarButtonById( ECamCmdViewfinderGrid  );
       
  2036     if ( button )
       
  2037         {
       
  2038         CAknButtonState* state = button->State();
       
  2039         if ( state )
       
  2040             {
       
  2041             TInt grid = iController.IntegerSettingValue( ECamSettingItemViewfinderGrid );
       
  2042             MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
       
  2043             TFileName iconFileName;
       
  2044             CamUtility::ResourceFileName( iconFileName );     
       
  2045 
       
  2046             if ( grid == ECamViewfinderGridOn )
       
  2047                 {
       
  2048                 SetIconL(
       
  2049                     button,
       
  2050                     iconFileName,
       
  2051                     EMbmCameraappQgn_indi_cam4_viewfinder_off,
       
  2052                     EMbmCameraappQgn_indi_cam4_viewfinder_off_mask,
       
  2053                     skinInstance,
       
  2054                     KAknsIIDQgnIndiCam4ViewfinderOff );
       
  2055                 HBufC* buttonText = StringLoader::LoadLC( R_QTN_LCAM_TB_HIDE_VIEWFINDER_GRID );
       
  2056                 state->SetTextL( *buttonText );
       
  2057                 CleanupStack::PopAndDestroy( buttonText );
       
  2058                 }
       
  2059             else
       
  2060                 {
       
  2061                 SetIconL(
       
  2062                     button,
       
  2063                     iconFileName,
       
  2064                     EMbmCameraappQgn_indi_cam4_viewfinder_on,
       
  2065                     EMbmCameraappQgn_indi_cam4_viewfinder_on_mask,
       
  2066                     skinInstance,
       
  2067                     KAknsIIDQgnIndiCam4ViewfinderOn );
       
  2068                 HBufC* buttonText = StringLoader::LoadLC( R_QTN_LCAM_TB_SHOW_VIEWFINDER_GRID );
       
  2069                 state->SetTextL( *buttonText );
       
  2070                 CleanupStack::PopAndDestroy( buttonText );
       
  2071                 }
       
  2072             }
       
  2073         }
       
  2074     
       
  2075     }
       
  2076 
       
  2077 // ---------------------------------------------------------------------------
       
  2078 // CCamStillPreCaptureView::UpdateVFGridIconsL
       
  2079 // ---------------------------------------------------------------------------
       
  2080 //
       
  2081 void CCamStillPreCaptureView::UpdateBurstModeIconsL()
       
  2082 	{
       
  2083 	if (!iController.UiConfigManagerPtr()->IsBurstModeSupported())
       
  2084 		{
       
  2085 		HideButton( ECamCmdTimeLapseSlider );
       
  2086 		return;
       
  2087 		}
       
  2088 	CAknButton* button = ToolbarButtonById( ECamCmdTimeLapseSlider );
       
  2089     if ( button )
       
  2090         {
       
  2091         CAknButtonState* state = button->State();
       
  2092         MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
       
  2093         TFileName iconFileName;
       
  2094         CamUtility::ResourceFileName( iconFileName );     
       
  2095         if ( state )
       
  2096             {
       
  2097             TCamImageCaptureMode captureMode = iController.CurrentImageModeSetup();
       
  2098             if ( captureMode == ECamImageCaptureSingle )
       
  2099                 {
       
  2100                 SetIconL(
       
  2101                         button,
       
  2102                         iconFileName,
       
  2103                         EMbmCameraappQgn_indi_cam4_sequence_burst,
       
  2104                         EMbmCameraappQgn_indi_cam4_sequence_burst_mask,
       
  2105                         skinInstance,
       
  2106                         KAknsIIDQgnIndiCam4Sequence );
       
  2107 
       
  2108                 HBufC* buttonText = StringLoader::LoadLC( R_QTN_LCAM_TB_SEQUENCE );
       
  2109                 state->SetTextL( *buttonText );
       
  2110                 CleanupStack::PopAndDestroy( buttonText );
       
  2111                 }
       
  2112             else if ( captureMode == ECamImageCaptureBurst )
       
  2113                 {
       
  2114                 SetIconL(
       
  2115                         button,
       
  2116                         iconFileName,
       
  2117                         EMbmCameraappQgn_indi_cam4_sequence,
       
  2118                         EMbmCameraappQgn_indi_cam4_sequence,
       
  2119                         skinInstance,
       
  2120                         KAknsIIDQgnIndiCam4SequenceBurst );
       
  2121 
       
  2122                 HBufC* buttonText = StringLoader::LoadLC( R_QTN_LCAM_TB_TURN_SEQUENCE_OFF );
       
  2123                 state->SetTextL( *buttonText );
       
  2124                 CleanupStack::PopAndDestroy( buttonText );
       
  2125 
       
  2126                 }
       
  2127             else
       
  2128                 {
       
  2129                 // pass
       
  2130                 }    
       
  2131             }
       
  2132         }	
       
  2133 	}
       
  2134 
       
  2135 // ---------------------------------------------------------------------------
       
  2136 // CCamStillPreCaptureView::UpdateFaceTrackingIconsL 
       
  2137 // ---------------------------------------------------------------------------
       
  2138 //
       
  2139 void CCamStillPreCaptureView::UpdateFaceTracKingIconsL()
       
  2140     {
       
  2141     CAknButton* button = ToolbarButtonById(  ECamCmdToggleFacetracking  );
       
  2142       
       
  2143     if ( button )
       
  2144               {
       
  2145               CAknButtonState* state = button->State();
       
  2146               if ( state )
       
  2147                   {
       
  2148                   TInt face = iController.IntegerSettingValue(  ECamSettingItemFaceTracking );
       
  2149                  
       
  2150                 MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
       
  2151                 TFileName iconFileName;
       
  2152                 CamUtility::ResourceFileName( iconFileName );  
       
  2153                   if ( face == ECamSettOn )
       
  2154                       {
       
  2155                       PRINT( _L( "Camera => UpdateFaceTrackingIconL on" ) ); 
       
  2156                       SetIconL (
       
  2157                                 button,
       
  2158                                 iconFileName,
       
  2159                                 EMbmCameraappQgn_indi_cam4_tb_facedet_off,
       
  2160                                 EMbmCameraappQgn_indi_cam4_tb_facedet_off_mask,
       
  2161                                 skinInstance,
       
  2162                                 KAknsIIDQgnIndiCam4TbFacedetOff );
       
  2163                       
       
  2164                       }
       
  2165                   else
       
  2166                       {
       
  2167                       PRINT( _L( "Camera => UpdateFaceTrackingIconL off" ) ); 
       
  2168                       SetIconL (
       
  2169                                  button,
       
  2170                                  iconFileName,
       
  2171                                  EMbmCameraappQgn_indi_cam4_tb_facedet,
       
  2172                                  EMbmCameraappQgn_indi_cam4_tb_facedet_mask,
       
  2173                                  skinInstance,
       
  2174                                  KAknsIIDQgnIndiCam4TbFacedet );
       
  2175                       }
       
  2176                   }
       
  2177               }
       
  2178     
       
  2179           
       
  2180       
       
  2181      }
       
  2182 
       
  2183 //  End of File