camerauis/cameraapp/generic/src/CamPostCaptureViewBase.cpp
branchRCL_3
changeset 24 bac7acad7cb3
child 25 2c87b2808fd7
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
       
     1 /*
       
     2 * Copyright (c) 2007-2010 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:  Post-capture view class for Camera application*
       
    15 */
       
    16 
       
    17 
       
    18 // INCLUDE FILES
       
    19 #include <sendnorm.rsg>
       
    20 #include <sendui.h>
       
    21 #include <SenduiMtmUids.h>
       
    22 #ifndef __WINS__
       
    23 //  #include <SFIUtilsAppInterface.h>
       
    24 #endif
       
    25 #include <eikbtgpc.h>
       
    26 #include <avkon.rsg>
       
    27 #include <cameraapp.rsg>
       
    28 #include <vgacamsettings.rsg>
       
    29 #include <aknradiobuttonsettingpage.h>
       
    30 #include <akntextsettingpage.h>
       
    31 #include <akntitle.h>  // CAknTitlePane
       
    32 #include <CMessageData.h>
       
    33 #include "MCamAddToAlbumObserver.h"
       
    34 #include "CamCollectionManagerAo.h"
       
    35 #include <glxmetadataviewutility.h>
       
    36 #include <glxcollectionselectionpopup.h>
       
    37 #include <akntoolbar.h>
       
    38 #include <aknbutton.h>
       
    39 #include <StringLoader.h>
       
    40 
       
    41 
       
    42 #include "Cam.hrh"
       
    43 #include "CamUtility.h"
       
    44 #include "CamPostCaptureViewBase.h"
       
    45 #include "CamAppController.h"
       
    46 #include "CamAppUi.h"
       
    47 #include "CamLogger.h"
       
    48 #include "camactivepalettehandler.h"
       
    49 #include "CamPostCaptureContainer.h"
       
    50 #include "camoneclickuploadutility.h"
       
    51 #include "CameraUiConfigManager.h"
       
    52 
       
    53 
       
    54 
       
    55 //CONSTANTS
       
    56 
       
    57 
       
    58 const TInt KCamSendUiBodySize = 0;
       
    59 const TInt KCamSendUiMessageSize = 0;
       
    60 
       
    61 
       
    62 const TUint KCamSendAsArrayGranularity = 1;
       
    63 
       
    64 
       
    65 // ========================= MEMBER FUNCTIONS ================================
       
    66 
       
    67 // ---------------------------------------------------------------------------
       
    68 // CCamPostCaptureViewBase::~CCamPostCaptureViewBase
       
    69 // Destructor
       
    70 // ---------------------------------------------------------------------------
       
    71 //
       
    72 CCamPostCaptureViewBase::~CCamPostCaptureViewBase()
       
    73   {
       
    74   PRINT( _L("Camera => ~CCamPostCaptureViewBase") );
       
    75   delete iSendAppUi;    
       
    76   delete iSendMtmsToDim;
       
    77   
       
    78   if ( iAiwServiceHandler )
       
    79     {
       
    80     // unload service provider if any
       
    81     iAiwServiceHandler->Reset();
       
    82     delete iAiwServiceHandler;
       
    83     }
       
    84 
       
    85 #ifndef __WINS__    
       
    86   iSFIUtils = NULL;       // Not owned
       
    87 #endif // __WINS__
       
    88 
       
    89 
       
    90   if ( iCollectionManagerCallBack )
       
    91       {
       
    92       delete iCollectionManagerCallBack;
       
    93       iCollectionManagerCallBack = NULL;
       
    94       }
       
    95   delete iOneClickUploadUtility;
       
    96 
       
    97   PRINT( _L("Camera <= ~CCamPostCaptureViewBase") );
       
    98   }
       
    99 
       
   100 // -----------------------------------------------------------------------------
       
   101 // CCamPostCaptureViewBase::HandleCommandL
       
   102 // Handle commands
       
   103 // -----------------------------------------------------------------------------
       
   104 //
       
   105 void CCamPostCaptureViewBase::HandleCommandL( TInt aCommand )
       
   106     {
       
   107     PRINT1( _L("Camera => CCamPostCaptureViewBase::HandleCommandL (%d)"), aCommand )
       
   108     CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() );
       
   109     switch ( aCommand )
       
   110         {
       
   111         case ECamCmdOneClickUpload:
       
   112             {
       
   113             iOneClickUploadUtility->UploadL(
       
   114                     iController.CurrentFullFileName() );
       
   115             break;
       
   116             }
       
   117         case ECamCmdToggleActiveToolbar:
       
   118             {
       
   119        		// If in the Landscape mode, MSK event is mapped 
       
   120       	  	// like a normal selection key so that AP items
       
   121        	  	// are selected and respective setting pages are launched´
       
   122        	  	// refer to @ProcessCommandL, since we get here only from there
       
   123        	    TKeyEvent aKeyEvent;
       
   124     		aKeyEvent.iCode =  aKeyEvent.iRepeats = aKeyEvent.iModifiers = 0;
       
   125    			aKeyEvent.iScanCode = EStdKeyDevice3;
       
   126    			static_cast<CCamContainerBase*>
       
   127        				( Container() )->OfferKeyEventL( aKeyEvent, EEventKey );	
       
   128             break;
       
   129             }
       
   130         case EAknSoftkeyBack:
       
   131             {
       
   132             iController.DeepSleepTimerCancel();
       
   133             appUi->HandleCommandL( aCommand );
       
   134             }
       
   135             break;
       
   136 
       
   137         case ECamCmdSend:
       
   138         case ECamCmdSendToCallerMultimedia:    
       
   139         case ECamCmdQuickSend:
       
   140             {
       
   141 /*            TBool inCall = EFalse;
       
   142 #if !defined(__WINS__) && !defined(__WINSCW__)
       
   143             inCall = iSFIUtils->IsCLIValidL();
       
   144 #endif	            */
       
   145             //use both inCall and InCallOrRinging() conditions to make sure if it is in call state
       
   146 // In-Call-Send no longer used
       
   147 //            if ( /*inCall &&*/ iController.InCallOrRinging() )
       
   148 //                {
       
   149 //#ifndef __WINS__
       
   150 //                DoInCallSendL();
       
   151 //#endif
       
   152 //                }
       
   153 //            else
       
   154 //                {
       
   155                 DoSendAsL();                    	
       
   156 //                }    
       
   157             }
       
   158             break;
       
   159 
       
   160         case ECamCmdExitStandby:
       
   161         	{
       
   162         	// leave standby mode
       
   163         	ExitStandbyModeL();
       
   164         	}
       
   165         	break;
       
   166         case ECamCmdToggleCourtesyUI:
       
   167             {
       
   168             /*
       
   169             * EFalse --> We just hide the AP tool bar
       
   170             * ETrue  --> We show the AP tool bar
       
   171             * In this case, we dont toggle the UI between Show/Hide icons so
       
   172             * we send EFalse as a parameter to SetAlwaysDrawPostCaptureCourtesyUI method
       
   173             */
       
   174             if ( appUi )
       
   175                 {
       
   176                 appUi->SetAlwaysDrawPostCaptureCourtesyUI( EFalse );
       
   177                 }
       
   178             break;
       
   179             }
       
   180 		case ECamCmdProperties:
       
   181             {
       
   182             // Passing the name of the current file
       
   183             // Asking the MetadataViewUtility to lauch an view for us
       
   184             CEikStatusPane* sp = StatusPane();
       
   185             CAknTitlePane* title = 
       
   186                 static_cast<CAknTitlePane*>( sp->ControlL( 
       
   187                         TUid::Uid( EEikStatusPaneUidTitle ) ) );
       
   188             title->SetTextL( KNullDesC );
       
   189             sp->MakeVisible( ETrue );
       
   190             title->MakeVisible( ETrue );
       
   191             iContainer->SetRect( AppUi()->ClientRect() );
       
   192             GlxMetadataViewUtility::ActivateViewL( iController.CurrentFullFileName() );
       
   193             static_cast<CCamContainerBase*>(iContainer)->CheckForFileName( ETrue );
       
   194             title->MakeVisible( EFalse );
       
   195             sp->MakeVisible( EFalse );
       
   196             iContainer->SetRect( AppUi()->ApplicationRect() );                
       
   197 			break;
       
   198             }
       
   199         // Add Photo/Video to the album
       
   200         case ECamCmdAddToAlbum:
       
   201             {
       
   202 
       
   203                 /*
       
   204                 * Status = 0 ( User confirms add to album operation )
       
   205                 * Status = 1 ( User cancels add to album operation )
       
   206                 */
       
   207                 /*TInt status = ShowAddToAlbumConfirmationQueryL();
       
   208                 if ( status == 0 )
       
   209                     {
       
   210                     StartAddToAlbumOperationL();
       
   211                     }
       
   212                 else
       
   213                     { // Lint warnings
       
   214                     }*/
       
   215             StartAddToAlbumOperationL();
       
   216             }
       
   217             break;
       
   218         case KAiwCmdEdit:
       
   219         case ECamCmdEdit:
       
   220         case ECamCmdEditPhoto:
       
   221         case ECamCmdEditVideo:    
       
   222             {
       
   223             CAiwGenericParamList& inputParams = iAiwServiceHandler->InParamListL();
       
   224             TPtrC currentFullFileName(iController.CurrentFullFileName());
       
   225             TAiwGenericParam param( EGenericParamFile, TAiwVariant(currentFullFileName));
       
   226             inputParams.AppendL( param );
       
   227             
       
   228             
       
   229             TAiwVariant param2Variant;
       
   230             if(Id().iUid == ECamViewIdVideoPostCapture)
       
   231                 {
       
   232                 param2Variant.Set(_L("video/*"));
       
   233                 }
       
   234             else
       
   235                 {
       
   236                 param2Variant.Set(_L("image/jpeg"));
       
   237                 }
       
   238             TAiwGenericParam param2( EGenericParamMIMEType, param2Variant );
       
   239             inputParams.AppendL( param2 );
       
   240 
       
   241             iAiwServiceHandler->ExecuteServiceCmdL(KAiwCmdEdit, inputParams, iAiwServiceHandler->OutParamListL());        
       
   242             }
       
   243             break;
       
   244         case ECamCmdShareSettings: // SHARE_AIW
       
   245         case KAiwCmdView:
       
   246             {
       
   247             PRINT1( _L("Camera <> CCamPostCaptureViewBase::HandleCommandL - ECamCmdShareSettings start, cmd:%d"), aCommand );
       
   248             iOneClickUploadUtility->LaunchShareSettings();
       
   249             PRINT( _L("Camera <> CCamPostCaptureViewBase::HandleCommandL - ECamCmdShareSettings end") );            
       
   250             }
       
   251             break;
       
   252         default:
       
   253             {
       
   254             CCamViewBase::HandleCommandL( aCommand );
       
   255             }
       
   256         }
       
   257 
       
   258     PRINT1( _L("Camera <= CCamPostCaptureViewBase::HandleCommandL (%d)"), aCommand )
       
   259     }
       
   260 
       
   261 // -----------------------------------------------------------------------------
       
   262 // CCamPostCaptureViewBase::HandleControllerEventL
       
   263 // Handle user menu selections
       
   264 // -----------------------------------------------------------------------------
       
   265 //
       
   266 void 
       
   267 CCamPostCaptureViewBase::HandleControllerEventL( TCamControllerEvent aEvent, 
       
   268                                                  TInt               /*aError*/ )
       
   269   {
       
   270   PRINT( _L("Camera => CCamPostCaptureViewBase::HandleControllerEventL") );
       
   271     
       
   272   switch( aEvent )
       
   273     {
       
   274     // -----------------------------------------------------
       
   275     case ECamEventCallStateChanged:
       
   276       {
       
   277       PRINT( _L("Camera <> case ECamEventCallStateChanged") );
       
   278       
       
   279       CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( AppUi() );      
       
   280       
       
   281       // Reset the Send and Send to caller items in the active toolbar  
       
   282       if ( !iEmbedded )
       
   283         {
       
   284 		CCamActivePaletteHandler* apHandler = appUi->APHandler();    
       
   285 		// Hide Send or Send to caller
       
   286         ResetSendAvailabilityL( apHandler );
       
   287 		if ( iController.IsTouchScreenSupported() )
       
   288 			{
       
   289 			UpdateToolbarIconsL();
       
   290 			}
       
   291 		else
       
   292 			{
       
   293 			UpdateActivePaletteItemsL();
       
   294 			}
       
   295         }
       
   296       break;
       
   297       }
       
   298     // -----------------------------------------------------
       
   299     case ECamEventSaveComplete:
       
   300     case ECamEventSnapshotReady:
       
   301       {
       
   302       if ( ECamEventSaveComplete == aEvent &&
       
   303            iWaitForImageSave &&
       
   304            !iController.IsTouchScreenSupported() )
       
   305         {
       
   306         UpdateActivePaletteItemsL();
       
   307         }
       
   308       static_cast<CCamContainerBase*>(iContainer)->CheckForFileName( EFalse );
       
   309       // Check that the file that has just completed is the one just taken
       
   310       if ( iController.SavedCurrentImage()
       
   311         && iController.IsAppUiAvailable()            
       
   312          )//&& iWaitForImageSave )
       
   313         {
       
   314         CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() );
       
   315         // check whether embedded or not
       
   316         if ( iEmbedded )
       
   317           {
       
   318           //Do not show postcapture softkeys if we are still capturing or
       
   319           //saving image
       
   320           if ( iController.CurrentOperation() != ECamCapturing && 
       
   321                   iController.CurrentOperation() != ECamCompleting )
       
   322               {
       
   323               if ( !appUi->IsSecondCameraEnabled() || appUi->IsQwerty2ndCamera() )  
       
   324                   {
       
   325                   SetSoftKeysL( R_CAM_SOFTKEYS_SELECT_DELETE__SELECT );
       
   326                   }
       
   327               else
       
   328                   {
       
   329                   SetSoftKeysL( R_CAM_SOFTKEYS_SELECT_DELETE__SELECT_SECONDARY );
       
   330                   }
       
   331               }
       
   332           else
       
   333               {
       
   334               SetSoftKeysL( R_CAM_SOFTKEYS_BLANK );
       
   335               }
       
   336           }
       
   337         else
       
   338           {
       
   339           appUi->RaisePostCaptureCourtesyUI();
       
   340           if ( appUi->IsSecondCameraEnabled() && !appUi->IsQwerty2ndCamera() )
       
   341               {
       
   342               SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_BACK_TOGGLETOOLBAR_PORTRAIT );
       
   343               }
       
   344           else if ( ECamViewStateBurstThumbnail == appUi ->CurrentViewState() )
       
   345               {
       
   346               SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_BACK_TOGGLETOOLBAR_BURST );
       
   347               }
       
   348           else
       
   349               {
       
   350               SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_BACK_TOGGLETOOLBAR );
       
   351               }
       
   352           
       
   353           // image processing complete, enable gallery button
       
   354           if( !iEmbedded )        
       
   355               {
       
   356               // fixed toolbar is used only with touch devices
       
   357               if ( iController.IsTouchScreenSupported() )
       
   358                   {
       
   359                   CAknToolbar* fixedToolbar = Toolbar();
       
   360                   if ( fixedToolbar )
       
   361                       {
       
   362                       /*fixedToolbar->SetItemDimmed( ECamCmdPhotos, EFalse, ETrue );
       
   363                       fixedToolbar->SetItemDimmed( ECamCmdEdit, EFalse, ETrue );
       
   364                       fixedToolbar->SetItemDimmed( ECamCmdDelete, EFalse, ETrue );
       
   365                       fixedToolbar->SetItemDimmed( ECamCmdOneClickUpload, EFalse, ETrue );
       
   366                       fixedToolbar->SetItemDimmed( ECamCmdSend, EFalse, ETrue );*/
       
   367                       fixedToolbar->SetDimmed(EFalse);
       
   368                       fixedToolbar->DrawNow();
       
   369                       }
       
   370                   }
       
   371               }
       
   372           }
       
   373         iWaitForImageSave = EFalse;
       
   374         }
       
   375       break;
       
   376       }
       
   377       
       
   378     case ECamEventSliderClosed:
       
   379       {
       
   380       // if embedded and the slider is closed, close the menu
       
   381       if( iEmbedded )
       
   382         {
       
   383         PRINT( _L("Camera => CCamPostCaptureViewBase -> ECamEventSliderClosed") );
       
   384         StopDisplayingMenuBar();
       
   385         }
       
   386       }
       
   387        
       
   388     // -----------------------------------------------------
       
   389     default:
       
   390       break;
       
   391     // -----------------------------------------------------
       
   392     } // switch
       
   393   PRINT( _L("Camera <= CCamPostCaptureViewBase::HandleControllerEventL") );        
       
   394   }
       
   395 
       
   396 // -----------------------------------------------------------------------------
       
   397 // CCamPostCaptureViewBase::HandleForegroundEventL
       
   398 // Handle foreground event
       
   399 // -----------------------------------------------------------------------------
       
   400 //
       
   401 void 
       
   402 CCamPostCaptureViewBase::HandleForegroundEventL( TBool aForeground )
       
   403   {    
       
   404   PRINT( _L("Camera => CCamPostCaptureViewBase::HandleForegroundEventL") )
       
   405   CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() );
       
   406   // -------------------------------------------------------
       
   407   // Coming to foreground
       
   408   if ( aForeground)
       
   409     {
       
   410     PRINT( _L("Camera <> CCamPostCaptureViewBase::HandleForegroundEventL: to foreground") )
       
   411     if ( static_cast<CCamAppUiBase*>( AppUi() )->IsInPretendExit() )
       
   412       {
       
   413       PRINT( _L("Camera <> CCamPostCaptureViewBase::HandleForegroundEventL: app in pretend exit so not grabbing the engine") )
       
   414       // The view can get a foreground event while the application is
       
   415       // actually in a pretend exit situation. This occurs when the view switch
       
   416       // was called before the exit event, but didn't complete until after the
       
   417       // exit event. In this case the view should not register an interest in
       
   418       // the engine as the application is really in the background and the resources
       
   419       // need to be released
       
   420       return;
       
   421       }
       
   422 
       
   423     // set embedded flag here
       
   424     iEmbedded = appUi->IsEmbedded();
       
   425     // need to update cba according to whether we are embedded or not
       
   426     if ( iEmbedded )
       
   427       {
       
   428       PRINT( _L("Camera <> CCamPostCaptureViewBase::HandleForegroundEventL: embedded mode") );
       
   429       //Do not show postcapture softkeys if we are still capturing or
       
   430       //saving image
       
   431       if ( iController.CurrentOperation() != ECamCapturing && 
       
   432               iController.CurrentOperation() != ECamCompleting )
       
   433           {
       
   434           if ( !appUi->IsSecondCameraEnabled() || appUi->IsQwerty2ndCamera() )  
       
   435               {
       
   436               SetSoftKeysL( R_CAM_SOFTKEYS_SELECT_DELETE__SELECT );
       
   437               }
       
   438           else
       
   439               {
       
   440               SetSoftKeysL( R_CAM_SOFTKEYS_SELECT_DELETE__SELECT_SECONDARY );
       
   441               }
       
   442           }
       
   443       else
       
   444           {
       
   445           SetSoftKeysL( R_CAM_SOFTKEYS_BLANK );
       
   446           }
       
   447       }
       
   448     else
       
   449       {
       
   450       // Update the one click, in case it was modified
       
   451       if ( iOneClickUploadUtility && iOneClickUploadUtility->OneClickUploadSupported() )
       
   452           {
       
   453           iOneClickUploadUtility->UpdateUploadIconL( Toolbar(), 
       
   454 						  ( Id().iUid == ECamViewIdVideoPostCapture ) ? 
       
   455         				    ECamControllerVideo : ECamControllerImage );
       
   456           }
       
   457 
       
   458       // ensure cba is reset if we're not embedded
       
   459       if ( !iWaitForImageSave )
       
   460         {
       
   461         if ( static_cast<CCamAppUiBase*>( AppUi() )->IsSecondCameraEnabled() && 
       
   462             !static_cast<CCamAppUiBase*>( AppUi() )->IsQwerty2ndCamera() )
       
   463             {
       
   464             SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_BACK_TOGGLETOOLBAR_PORTRAIT );
       
   465             }
       
   466         else if ( ECamViewStateBurstThumbnail == appUi ->CurrentViewState() )
       
   467             {
       
   468             SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_BACK_TOGGLETOOLBAR_BURST );
       
   469             }
       
   470         else
       
   471             {
       
   472             SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_BACK_TOGGLETOOLBAR );
       
   473             }
       
   474         }
       
   475       else
       
   476         {
       
   477         // still image not yet saved
       
   478         // disable Options softkey and cancel post capture timer
       
   479         // softkey will be re-enabled when image has been saved
       
   480         if(appUi->IsSecondCameraEnabled() && !appUi->IsQwerty2ndCamera())
       
   481             {
       
   482             SetSoftKeysL( R_CAM_SOFTKEYS_BACK_SECONDARY );
       
   483             }
       
   484         else
       
   485             {
       
   486             SetSoftKeysL( R_CAM_SOFTKEYS_BACK );
       
   487             }
       
   488         
       
   489         
       
   490         // disable gallery button until image is processed
       
   491         if( !iEmbedded )        
       
   492             {
       
   493             // fixed toolbar is used only with touch devices
       
   494             if ( iController.IsTouchScreenSupported() )
       
   495                 {
       
   496                 CAknToolbar* fixedToolbar = Toolbar();
       
   497                 if ( fixedToolbar )
       
   498                     {
       
   499                     /*fixedToolbar->SetItemDimmed( ECamCmdPhotos, ETrue, ETrue );
       
   500                     fixedToolbar->SetItemDimmed( ECamCmdDelete, ETrue, ETrue );
       
   501                     fixedToolbar->SetItemDimmed( ECamCmdOneClickUpload, ETrue, ETrue );
       
   502                     fixedToolbar->SetItemDimmed( ECamCmdEdit, ETrue, ETrue );
       
   503                     fixedToolbar->SetItemDimmed( ECamCmdSend, ETrue, ETrue );*/
       
   504                     }
       
   505                 }
       
   506             }
       
   507         }
       
   508       }
       
   509     // Register that we still want to use the engine (to receive final snap image)
       
   510     IncrementCameraUsers();
       
   511     
       
   512     iController.DeepSleepTimerStart();
       
   513     CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() );
       
   514 
       
   515     if ( appUi && !iSuppressAPUntilCameraReady )
       
   516       {
       
   517       if(!iPartialBackground)
       
   518           {
       
   519           appUi->RaisePostCaptureCourtesyUI();
       
   520           }
       
   521       }
       
   522     else if ( iSuppressAPUntilCameraReady ) 
       
   523       {
       
   524       iSuppressAPUntilCameraReady = EFalse;
       
   525       }
       
   526     iPartialBackground = EFalse;
       
   527     
       
   528     if ( appUi && iController.CameraSwitchQueued() )   
       
   529         {
       
   530         appUi->HandleCommandL( ECamCmdSwitchCamera );
       
   531         }
       
   532     }
       
   533   // -------------------------------------------------------
       
   534   // Going to background
       
   535   else
       
   536     {
       
   537     if( iController.IsAppUiAvailable() ) 
       
   538         {
       
   539         iPartialBackground = ( (appUi->AppInBackground(ETrue) ) && (!appUi->AppInBackground(EFalse) ) );
       
   540         }
       
   541     else
       
   542         {
       
   543         iPartialBackground = EFalse;
       
   544         }
       
   545     PRINT( _L("Camera <> CCamPostCaptureViewBase::HandleForegroundEventL: to background") )
       
   546     iController.DeepSleepTimerCancel();
       
   547     // Register that we nolonger need the engine.
       
   548     // Checks if we incremented the count.
       
   549     DecrementCameraUsers();
       
   550     }
       
   551   // -------------------------------------------------------
       
   552   PRINT( _L("Camera <= CCamPostCaptureViewBase::HandleForegroundEventL") )
       
   553   }
       
   554 
       
   555 
       
   556 // ---------------------------------------------------------------------------
       
   557 // CCamPostCaptureViewBase::DoActivateL
       
   558 // Activate this view
       
   559 // ---------------------------------------------------------------------------
       
   560 //
       
   561 void CCamPostCaptureViewBase::DoActivateL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId,
       
   562                                                     const TDesC8& aCustomMessage )
       
   563     {    
       
   564     PRINT( _L( "Camera => CCamPostCaptureViewBase::DoActivateL" ) );    
       
   565 
       
   566     CCamAppUi* appui = static_cast<CCamAppUi*>( AppUi() );
       
   567 
       
   568     iAiwServiceHandler->AttachL(R_CAM_AIW_EDIT_INTEREST);
       
   569     
       
   570     CCamViewBase::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage );
       
   571 
       
   572     // fixed toolbar is used only with touch devices
       
   573     if ( iController.IsTouchScreenSupported() )
       
   574         {
       
   575         CAknToolbar* fixedToolbar = Toolbar();
       
   576 
       
   577         if ( fixedToolbar )
       
   578             {
       
   579             if( iEmbedded )        
       
   580                 {
       
   581                 fixedToolbar->SetToolbarVisibility( EFalse );
       
   582                 }
       
   583             else
       
   584                 {
       
   585                 fixedToolbar->SetToolbarObserver( this );
       
   586                 UpdateToolbarIconsL();
       
   587                 if( Id().iUid != ECamViewIdVideoPostCapture && !appui->IsSelfTimedCapture() && 
       
   588                     !iController.SavedCurrentImage() )
       
   589                     {
       
   590                     fixedToolbar->SetDimmed(ETrue);
       
   591                     }
       
   592                 fixedToolbar->HideItemsAndDrawOnlyBackground( EFalse ); 
       
   593                 fixedToolbar->SetToolbarVisibility( ETrue );
       
   594                 }
       
   595             }
       
   596         }
       
   597     
       
   598 
       
   599     // show an empty pane
       
   600     appui->PushDefaultNaviPaneL();
       
   601 
       
   602     iController.AddControllerObserverL( this );
       
   603 
       
   604     // if we're embedded use ROID(R_CAM_SOFTKEYS_SELECT_DELETE_ID)softkey labels
       
   605     if ( iEmbedded )
       
   606         {
       
   607         //Do not show postcapture softkeys if we are still capturing or
       
   608         //saving image
       
   609         if ( iController.CurrentOperation() != ECamCapturing && 
       
   610                 iController.CurrentOperation() != ECamCompleting )
       
   611             {
       
   612             if ( !appui->IsSecondCameraEnabled() || appui->IsQwerty2ndCamera() )  
       
   613                 {
       
   614                 SetSoftKeysL( R_CAM_SOFTKEYS_SELECT_DELETE__SELECT );
       
   615                 }
       
   616             else
       
   617                 {
       
   618                 SetSoftKeysL( R_CAM_SOFTKEYS_SELECT_DELETE__SELECT_SECONDARY );
       
   619                 }
       
   620             }
       
   621         else
       
   622             {
       
   623             SetSoftKeysL( R_CAM_SOFTKEYS_BLANK );
       
   624             }
       
   625         }
       
   626     
       
   627     iPreviousViewStillPreCapture = ( aPrevViewId.iViewUid.iUid == ECamViewIdStillPreCapture );
       
   628     
       
   629     // set flag for still and timelapse post capture only
       
   630     // also check if the file has already been saved (possible if, for 
       
   631     // example, MMC removal note is displayed
       
   632     if ( iPreviousViewStillPreCapture && appui->CurrentBurstMode() != ECamImageCaptureBurst && 
       
   633          !iController.SavedCurrentImage() )
       
   634         {
       
   635         PRINT( _L( "Camera <> CCamPostCaptureViewBase::DoActivateL .. set iWaitForImageSave true" ) );    
       
   636         iWaitForImageSave = ETrue;
       
   637         }
       
   638     else
       
   639         {
       
   640         PRINT( _L( "Camera <> CCamPostCaptureViewBase::DoActivateL .. set iWaitForImageSave false" ) );    
       
   641         iWaitForImageSave = EFalse;
       
   642         if ( !iController.IsTouchScreenSupported() )
       
   643             {
       
   644             UpdateActivePaletteItemsL();
       
   645             }
       
   646         }
       
   647     
       
   648     // Make sure appuis CBA is not visible
       
   649     CEikButtonGroupContainer* cba = AppUi()->Cba();
       
   650     if( cba )
       
   651         {
       
   652         cba->MakeVisible( EFalse );
       
   653         }
       
   654 
       
   655     PRINT( _L( "Camera <= CCamPostCaptureViewBase::DoActivateL" ) );    
       
   656     }
       
   657 
       
   658 // ---------------------------------------------------------------------------
       
   659 // CCamPostCaptureViewBase::DoDeactivate
       
   660 // Deactivate this view
       
   661 // ---------------------------------------------------------------------------
       
   662 //
       
   663 void 
       
   664 CCamPostCaptureViewBase::DoDeactivate()
       
   665     {
       
   666     PRINT( _L( "Camera => CCamPostCaptureViewBase::DoDeactivate" ) );    
       
   667 
       
   668     CCamViewBase::DoDeactivate();
       
   669 
       
   670     iController.RemoveControllerObserver( this );
       
   671     CAknToolbar* fixedToolbar = Toolbar();
       
   672     if(fixedToolbar)
       
   673         {
       
   674         fixedToolbar->SetToolbarVisibility( EFalse );
       
   675         }
       
   676     
       
   677     PRINT( _L( "Camera <= CCamPostCaptureViewBase::DoDeactivate" ) );    
       
   678     }
       
   679 
       
   680 // ---------------------------------------------------------------------------
       
   681 // CCamPostCaptureViewBase::DynInitMenuPaneL
       
   682 // Called when the menu pane is displayed
       
   683 // ---------------------------------------------------------------------------
       
   684 //
       
   685 void CCamPostCaptureViewBase::DynInitMenuPaneL( TInt /*aResourceId*/,
       
   686                                                 CEikMenuPane* aMenuPane )
       
   687     {
       
   688     TInt itemPos = 0;
       
   689         
       
   690     if( !iController.IsTouchScreenSupported() )
       
   691         {
       
   692         if( aMenuPane->MenuItemExists(ECamCmdProperties, itemPos) )
       
   693             {
       
   694             aMenuPane->SetItemDimmed( ECamCmdProperties, ETrue );
       
   695             }
       
   696         if( aMenuPane->MenuItemExists(ECamCmdAddToAlbum, itemPos) )
       
   697             {
       
   698             aMenuPane->SetItemDimmed( ECamCmdAddToAlbum, ETrue );
       
   699             }
       
   700         }
       
   701     // SHARE_AIW: Hide menu item, if Share not available
       
   702     if ( !iOneClickUploadUtility->OneClickUploadSupported() && 
       
   703          aMenuPane->MenuItemExists( ECamCmdShareSettings, itemPos ) )
       
   704         {
       
   705         aMenuPane->SetItemDimmed( ECamCmdShareSettings, ETrue );
       
   706         }
       
   707     }
       
   708 
       
   709 // ---------------------------------------------------------------------------
       
   710 // CCamPostCaptureViewBase::CCamPostCaptureViewBase
       
   711 // C++ constructor
       
   712 // ---------------------------------------------------------------------------
       
   713 //
       
   714 CCamPostCaptureViewBase::CCamPostCaptureViewBase( CCamAppController& aController )
       
   715     : CCamViewBase( aController ),
       
   716       iSendingCapabilities( KCamSendUiBodySize, 
       
   717                             KCamSendUiMessageSize,
       
   718                             TSendingCapabilities::ESupportsAttachments )
       
   719     {
       
   720     }
       
   721 
       
   722 // ---------------------------------------------------------------------------
       
   723 // CCamPostCaptureViewBase::ConstructL
       
   724 // Symbian OS 2nd phase constructor
       
   725 // ---------------------------------------------------------------------------
       
   726 //
       
   727 void CCamPostCaptureViewBase::ConstructL()
       
   728     {
       
   729   
       
   730     // create SendAs
       
   731     iSendAppUi = CSendUi::NewL();
       
   732 
       
   733     iSendMtmsToDim = new (ELeave) CArrayFixFlat<TUid>( KCamSendAsArrayGranularity );
       
   734     iSendMtmsToDim->AppendL( KSenduiMtmIrUid );
       
   735 
       
   736     iCollectionManagerCallBack = new (ELeave) 
       
   737                                      CCamCollectionManagerAO( *this );
       
   738     iAddToAlbumRequestOngoing = EFalse;
       
   739 
       
   740 
       
   741 /*#ifndef __WINS__
       
   742     // Initialize SFIutils
       
   743     CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() );
       
   744     iSFIUtils = appUi->SFIUtility();    
       
   745 #endif*/
       
   746 
       
   747     iAiwServiceHandler = CAiwServiceHandler::NewL();
       
   748     
       
   749     // In touch screen devices, hide toolbar initially to prevent it from 
       
   750     // being briefly visible in embedded mode
       
   751     if ( iController.IsTouchScreenSupported() )
       
   752         {
       
   753         CAknToolbar* fixedToolbar = Toolbar();
       
   754         if ( fixedToolbar )
       
   755             {
       
   756             fixedToolbar->SetToolbarVisibility( EFalse );
       
   757             }
       
   758         }
       
   759 
       
   760     iOneClickUploadUtility = CCamOneClickUploadUtility::NewL();
       
   761     }
       
   762 
       
   763 // ---------------------------------------------------------------------------
       
   764 // CCamPostCaptureViewBase::CreateContainerL
       
   765 // Create container control
       
   766 // ---------------------------------------------------------------------------
       
   767 //
       
   768 void CCamPostCaptureViewBase::CreateContainerL()
       
   769     {
       
   770     TRect rect;
       
   771     
       
   772     CCamAppUiBase* appUi =  static_cast<CCamAppUiBase*>( AppUi() );
       
   773 	TCamOrientation orientation = appUi->CamOrientation();
       
   774 
       
   775     TRect screen;
       
   776     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen );
       
   777 
       
   778     iContainer = CCamPostCaptureContainer::NewL( iController,
       
   779                                                  *this,
       
   780                                                  screen );
       
   781 
       
   782     iContainer->SetMopParent( this );
       
   783     }
       
   784 
       
   785 // ---------------------------------------------------------------------------
       
   786 // CCamPostCaptureViewBase::DoSendAsL
       
   787 // Use SendUI to create a message containing current image\video clip
       
   788 // ---------------------------------------------------------------------------
       
   789 //
       
   790 void CCamPostCaptureViewBase::DoSendAsL() const
       
   791     {
       
   792     PRINT( _L("Camera => CCamPostCaptureViewBase::DoSendAsL") ) 
       
   793     CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( AppUi() );
       
   794     
       
   795     if( !appUi->SendAsInProgress() )
       
   796         {
       
   797         appUi->SetSendAsInProgressL( ETrue );
       
   798         CMessageData* messageData = CMessageData::NewLC();
       
   799         TRAP_IGNORE( 
       
   800             messageData->AppendAttachmentL( iController.CurrentFullFileName() );
       
   801             iSendAppUi->ShowQueryAndSendL( messageData,iSendingCapabilities ) 
       
   802             )
       
   803         PRINT( _L("Camera <> CCamPostCaptureViewBase::DoSendAsL - finished sending") )
       
   804         appUi->SetSendAsInProgressL( EFalse );        
       
   805         CleanupStack::PopAndDestroy( messageData );
       
   806         }
       
   807     
       
   808     PRINT( _L("Camera <= CCamPostCaptureViewBase::DoSendAsL") )
       
   809     }
       
   810     
       
   811 #ifndef __WINS__
       
   812 // ---------------------------------------------------------------------------
       
   813 // CCamPostCaptureViewBase::DoInCallSendL
       
   814 // Handle send to caller functionality
       
   815 // ---------------------------------------------------------------------------
       
   816 //
       
   817 void CCamPostCaptureViewBase::DoInCallSendL() const
       
   818     {
       
   819     PRINT( _L("Camera => CCamPostCaptureViewBase::DoInCallSendL()") ) 	
       
   820     CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( AppUi() );
       
   821     
       
   822     if( !appUi->SendAsInProgress() )
       
   823         {
       
   824         appUi->SetSendAsInProgressL( ETrue );
       
   825         CMessageData* messageData = CMessageData::NewLC();
       
   826         TRAP_IGNORE( 
       
   827             messageData->AppendAttachmentL( iController.CurrentFullFileName() );
       
   828             iSendAppUi->CreateAndSendMessageL( KSenduiMtmMmsUid, messageData, KNullUid, ETrue )
       
   829             )
       
   830         PRINT( _L("Camera <> CCamPostCaptureViewBase::DoInCallSendL() - finished sending") )
       
   831         appUi->SetSendAsInProgressL( EFalse );        
       
   832         CleanupStack::PopAndDestroy( messageData );
       
   833         }
       
   834             
       
   835     // SFIUtils replaced by using SendUI interface because 
       
   836     // it cannot handle > 600 kB images properly
       
   837     /*if ( iSFIUtils && iSFIUtils->IsCLIValidL() )
       
   838         {
       
   839         iSFIUtils->SendMediaFileL( iController.CurrentFullFileName() );
       
   840         }*/
       
   841     PRINT( _L("Camera <= CCamPostCaptureViewBase::DoInCallSendL()") ) 	    
       
   842     }
       
   843 #endif
       
   844 
       
   845 // ---------------------------------------------------------------------------
       
   846 // CCamPostCaptureViewBase::IsPostCapture
       
   847 // Returns whether the view is a postcapture view
       
   848 // ---------------------------------------------------------------------------
       
   849 //
       
   850 TBool CCamPostCaptureViewBase::IsPostCapture()
       
   851     {
       
   852     return ETrue;
       
   853     }
       
   854 
       
   855 // ---------------------------------------------------------------------------
       
   856 // CCamPostCaptureViewBase::ResetSendAvailabilityL
       
   857 // Hides or shows the 'Send' and 'SendAs' items in the active toolbar
       
   858  // ---------------------------------------------------------------------------
       
   859 //   
       
   860 void CCamPostCaptureViewBase::ResetSendAvailabilityL( CCamActivePaletteHandler* aApHandler )
       
   861     {
       
   862     PRINT( _L("Camera => CCamPostCaptureViewBase::ResetSendAvailabilityL") );
       
   863     // Hide Send or Send to caller
       
   864 //    TBool inCall = EFalse;
       
   865 /*#if !defined(__WINS__) && !defined(__WINSCW__)
       
   866     inCall = iSFIUtils->IsCLIValidL();
       
   867 #endif	*/
       
   868     if ( aApHandler )
       
   869         {
       
   870         //use both inCall and InCallOrRinging() conditions to make sure if it is in call state
       
   871         
       
   872         // In-Call-Send no longer used. Always use ECamCmdSend regardless of phone call state.
       
   873         //aApHandler->SetItemVisible( ECamCmdSend, !( /*inCall &&*/ iController.InCallOrRinging() ) );
       
   874         //aApHandler->SetItemVisible( ECamCmdSendToCallerMultimedia, ( /*inCall &&*/ iController.InCallOrRinging() ) );
       
   875         aApHandler->SetItemVisible( ECamCmdSend, ETrue );
       
   876         
       
   877         TBool uploadSupported = EFalse;
       
   878         if ( iOneClickUploadUtility &&
       
   879              iOneClickUploadUtility->OneClickUploadSupported() )
       
   880             {
       
   881             uploadSupported = ETrue;
       
   882             }
       
   883 
       
   884         aApHandler->SetItemVisible( ECamCmdOneClickUpload, uploadSupported );
       
   885         }
       
   886     PRINT( _L("Camera <= CCamPostCaptureViewBase::ResetSendAvailabilityL ") );	
       
   887     }
       
   888 
       
   889 
       
   890 // ---------------------------------------------------------------------------
       
   891 // CCamPostCaptureViewBase::StartAddToAlbumOperationL
       
   892 //
       
   893 // Starts calls to PostCapIdleCallBack during processor idle time. The calls
       
   894 // are continued until PostCapIdleCallBack is done.
       
   895 //    
       
   896 // ---------------------------------------------------------------------------
       
   897 void CCamPostCaptureViewBase::StartAddToAlbumOperationL()
       
   898     {
       
   899 
       
   900     //Currently we set multiple selection of albums
       
   901     TBool   allowMultipleSelection = ETrue;
       
   902     RArray<TUint32> selectedAlbumIds;
       
   903     CleanupClosePushL( selectedAlbumIds );
       
   904     // Launching the Pop-up menu with the list of albums
       
   905     TRAPD( err, TGlxCollectionSelectionPopup::ShowPopupL(
       
   906             selectedAlbumIds,
       
   907             KGlxCollectionTypeIdAlbum,
       
   908             allowMultipleSelection,
       
   909             ETrue ) );
       
   910         /*
       
   911         * Use Collection Manager to add the albums and 
       
   912         * before that check for the completion of the harvesting
       
   913         */
       
   914         if ( err == KErrNone && selectedAlbumIds.Count() > 0)
       
   915             {
       
   916             PRINT( _L("Camera => StartAddToAlbumOperationL: Before CCamCollectionManagerAO( *this ); ") );
       
   917             PRINT( _L("Camera => StartAddToAlbumOperationL: After CCamCollectionManagerAO( *this ); and before calling StartCallBackAddToAlbumL()") );
       
   918             if ( iCollectionManagerCallBack )
       
   919                 {
       
   920                 if ( !iAddToAlbumRequestOngoing )
       
   921                     {
       
   922                     // Checking if only one request is being processed
       
   923                     iAddToAlbumRequestOngoing = ETrue;
       
   924                     iCollectionManagerCallBack->StartCallBackAddToAlbumL(
       
   925                                                 selectedAlbumIds,
       
   926                                                 iController.CurrentFullFileName() );
       
   927                     }
       
   928                 }
       
   929             PRINT( _L("Camera => StartAddToAlbumOperationL: After StartCallBackAddToAlbumL() ") );
       
   930             }
       
   931         CleanupStack::PopAndDestroy( &selectedAlbumIds );
       
   932         }
       
   933 
       
   934     
       
   935 // ---------------------------------------------------------------------------
       
   936 // CCamPostCaptureViewBase::ShowAddToAlbumConfirmationQueryL
       
   937 //
       
   938 // Opens a radiobutton setting page with "Yes" or "No" options
       
   939 // to actually confirm if we want to add the photo/video
       
   940 // to the albums
       
   941 //    
       
   942 // --------------------------------------------------------------------------- 
       
   943 TInt CCamPostCaptureViewBase::ShowAddToAlbumConfirmationQueryL()
       
   944     {
       
   945     TInt selectedIndex = 1; // default selection is "No"
       
   946         // Add to Album setting page "Items"
       
   947         CDesCArrayFlat* items = 
       
   948                    iCoeEnv->ReadDesC16ArrayResourceL( 
       
   949                                     R_CAM_ADDTOALBUM_SETTING_PAGE_LBX );
       
   950         CleanupStack::PushL( items );  
       
   951                 
       
   952         CAknRadioButtonSettingPage* dlg = new (ELeave) 
       
   953                                     CAknRadioButtonSettingPage
       
   954                                           (
       
   955                                           R_CAM_ADDTOALBUM_SETTING_PAGE,
       
   956                                           selectedIndex,
       
   957                                           items 
       
   958                                           );
       
   959                 
       
   960         dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged );
       
   961         CleanupStack::PopAndDestroy( items );
       
   962     return selectedIndex;
       
   963     }
       
   964 
       
   965 /*
       
   966 * CCamPostCaptureViewBase::AddToAlbumIdOperationComplete()
       
   967 */
       
   968 void CCamPostCaptureViewBase::AddToAlbumIdOperationComplete()
       
   969     { 
       
   970     PRINT( _L("Camera => CCamPostCaptureViewBase::AddToAlbumIdOperationComplete() ... SUCCESS ") );
       
   971     iAddToAlbumRequestOngoing = EFalse;
       
   972     }
       
   973 
       
   974 
       
   975 // ---------------------------------------------------------------------------
       
   976 // CCamPostCaptureViewBase::UpdateToolbarIconsL
       
   977 // Update fixed toolbar icons according to current call state
       
   978 // ---------------------------------------------------------------------------
       
   979 //
       
   980 void CCamPostCaptureViewBase::UpdateToolbarIconsL()
       
   981     {
       
   982     PRINT( _L("Camera => CCamPostCaptureViewBase::UpdateToolbarIconsL") );
       
   983     // fixed toolbar is used only with touch devices
       
   984     if ( iController.IsTouchScreenSupported() )
       
   985         {
       
   986         CAknToolbar* toolbar = Toolbar();
       
   987         if ( toolbar )
       
   988             {
       
   989             CAknButton* button = dynamic_cast<CAknButton*>(
       
   990                     toolbar->ControlOrNull( ECamCmdSend ) );
       
   991             if ( button )
       
   992                 {
       
   993                 CAknButtonState* state = button->State();
       
   994                 if ( state )
       
   995                     {
       
   996                     HBufC* tooltipText = 
       
   997 							StringLoader::LoadLC( R_QTN_LCAM_TT_SEND );
       
   998                     state->SetHelpTextL( *tooltipText );
       
   999                     CleanupStack::PopAndDestroy( tooltipText );    
       
  1000                     }    
       
  1001                 }
       
  1002             button = dynamic_cast<CAknButton*>(
       
  1003                     toolbar->ControlOrNull( ECamCmdOneClickUpload ) );
       
  1004             if ( button && iOneClickUploadUtility->OneClickUploadSupported())
       
  1005                 {
       
  1006                CAknButtonState* state = button->State();
       
  1007                if ( state )
       
  1008                    {
       
  1009                    TRAP_IGNORE( state->SetHelpTextL( iOneClickUploadUtility->ButtonTooltipL() ) );
       
  1010                    iOneClickUploadUtility->UpdateUploadIconL( toolbar, iController.CurrentMode() );
       
  1011                    }
       
  1012                }
       
  1013             button = dynamic_cast<CAknButton*>(toolbar->ControlOrNull( ECamCmdEdit ));
       
  1014             if( button )
       
  1015                 {
       
  1016                 CAknButtonState* state = button->State();
       
  1017                 if( state )
       
  1018                     {
       
  1019                     TInt resource = (Id().iUid == ECamViewIdStillPostCapture)?
       
  1020                                     R_QTN_LCAM_TT_IMAGE_EDITOR:
       
  1021                                     R_QTN_LCAM_TT_VIDEO_EDITOR;
       
  1022                     HBufC* helpText = StringLoader::LoadLC( resource );
       
  1023                     state->SetHelpTextL(*helpText);
       
  1024                     CleanupStack::PopAndDestroy(helpText);
       
  1025                     }
       
  1026                 } 
       
  1027            }
       
  1028         }
       
  1029     PRINT( _L("Camera <= CCamPostCaptureViewBase::UpdateToolbarIconsL") );    
       
  1030     }
       
  1031     
       
  1032 // --------------------------------------------------------------------------- 
       
  1033 // CCamPostCaptureViewBase::OfferToolbarEventL
       
  1034 // Handle fixed toolbar events
       
  1035 // ---------------------------------------------------------------------------
       
  1036 //
       
  1037 void CCamPostCaptureViewBase::OfferToolbarEventL( TInt aCommand )
       
  1038     {
       
  1039     User::ResetInactivityTime();
       
  1040     HandleCommandL( aCommand );
       
  1041     }
       
  1042 
       
  1043 // ---------------------------------------------------------------------------
       
  1044 // CCamPostCaptureViewBase::UpdateActivePaletteItemsL
       
  1045 // ---------------------------------------------------------------------------
       
  1046 //
       
  1047 void CCamPostCaptureViewBase::UpdateActivePaletteItemsL()
       
  1048     {
       
  1049     PRINT( _L("Camera => CCamPostCaptureViewBase::UpdateActivePaletteItemsL ") );
       
  1050     CCamAppUi* appUi =  static_cast<CCamAppUi*>( AppUi() );
       
  1051     TInt resId = 0;
       
  1052     if ( appUi )
       
  1053         {
       
  1054         TCamOrientation orientation = appUi->CamOrientation();
       
  1055         CCamActivePaletteHandler* apHandler = appUi->APHandler();
       
  1056         if( apHandler && !iEmbedded && ( orientation == ECamOrientationCamcorder ||
       
  1057                             orientation == ECamOrientationCamcorderLeft ||
       
  1058                             orientation == ECamOrientationDefault ||
       
  1059                             orientation == ECamOrientationPortrait ) )
       
  1060             {
       
  1061             iContainer->CreateActivePaletteL();
       
  1062             MActivePalette2UI* activePalette =
       
  1063                 appUi->APHandler()->ActivePalette();
       
  1064 
       
  1065             if( activePalette )
       
  1066                 {
       
  1067                 activePalette->SetGc();
       
  1068                 }
       
  1069             // Install PostCapture AP items
       
  1070             if ( ECamControllerImage == iController.CurrentMode() ||
       
  1071                     iPreviousViewStillPreCapture )
       
  1072                 {
       
  1073                 PRINT( _L("Camera => ECamControllerImage == iController.CurrentMode() ") );
       
  1074                 if ( appUi->IsSecondCameraEnabled() )
       
  1075                     {
       
  1076                     resId = R_CAM_STILL_POST_CAPTURE_AP_ITEMS_SECONDARY;
       
  1077                     }
       
  1078                 else
       
  1079                     {     
       
  1080                     resId = R_CAM_STILL_POST_CAPTURE_AP_ITEMS;
       
  1081                     }
       
  1082                 }
       
  1083             else
       
  1084                 {
       
  1085                 PRINT( _L("Camera => resId = R_CAM_VIDEO_POST_CAPTURE_AP_ITEMS; ") );
       
  1086                 if ( appUi->IsSecondCameraEnabled() )
       
  1087                     {
       
  1088                     resId = R_CAM_VIDEO_POST_CAPTURE_AP_ITEMS_SECONDARY;
       
  1089 					}
       
  1090                 else
       
  1091 				    {
       
  1092                     resId = R_CAM_VIDEO_POST_CAPTURE_AP_ITEMS;
       
  1093 					}
       
  1094                 }
       
  1095 
       
  1096             if ( iOneClickUploadUtility &&
       
  1097                  iOneClickUploadUtility->OneClickUploadSupported() )
       
  1098                 {
       
  1099                 apHandler->SetOneClickUploadTooltipL(
       
  1100                         iOneClickUploadUtility->ButtonTooltipL() );
       
  1101                 }
       
  1102 
       
  1103             apHandler->InstallAPItemsL( resId );
       
  1104             // Hide Send or Send to caller
       
  1105             ResetSendAvailabilityL( apHandler );
       
  1106             apHandler->SetView( this );
       
  1107 
       
  1108             // Make AP visible.
       
  1109             appUi->SetAlwaysDrawPostCaptureCourtesyUI( ETrue );
       
  1110 
       
  1111             // if coming from background, in video as target mode
       
  1112             if ( iController.CurrentMode() != iController.TargetMode() &&
       
  1113                     ( ECamControllerVideo == iController.TargetMode() ) )
       
  1114                 {
       
  1115                 apHandler->SetVisibility( EFalse );
       
  1116                 iSuppressAPUntilCameraReady = ETrue;
       
  1117                 }
       
  1118             }
       
  1119         }
       
  1120     PRINT( _L("Camera <= CCamPostCaptureViewBase::UpdateActivePaletteItemsL ") );
       
  1121     }
       
  1122 
       
  1123 //  End of File