Revision: 201019 RCL_3 PDK_3.0.0
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 25 May 2010 12:22:04 +0300
branchRCL_3
changeset 27 53c8aa5d97a3
parent 25 bf64cebf4673
child 31 8f559c47d7fd
Revision: 201019 Kit: 2010121
camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamcorderSettingsContainer.cpp
camerauis/cameraapp/generic/camerauiconfigmanager/bwins/camerauiconfigmanageru.def
camerauis/cameraapp/generic/camerauiconfigmanager/conf/camerauiconfigmanager.confml
camerauis/cameraapp/generic/camerauiconfigmanager/conf/camerauiconfigmanager_2001B29B.crml
camerauis/cameraapp/generic/camerauiconfigmanager/eabi/camerauiconfigmanageru.def
camerauis/cameraapp/generic/camerauiconfigmanager/inc/CameraConfigurationCrKeys.h
camerauis/cameraapp/generic/camerauiconfigmanager/inc/CameraDynamicSettings.hrh
camerauis/cameraapp/generic/camerauiconfigmanager/inc/CameraUiConfigManager.h
camerauis/cameraapp/generic/camerauiconfigmanager/src/CameraUiConfigManager.cpp
camerauis/cameraapp/generic/camerauiconfigmanager/src/CameraUiConfigManagerImp.cpp
camerauis/cameraapp/generic/common/inc/CamControllerObservers.h
camerauis/cameraapp/generic/common/inc/mcamsettingsmodel.h
camerauis/cameraapp/generic/common/src/CamCaptureSetupListBox.cpp
camerauis/cameraapp/generic/inc/CamAppController.h
camerauis/cameraapp/generic/inc/CamAppUi.h
camerauis/cameraapp/generic/inc/CamPreCaptureContainerBase.h
camerauis/cameraapp/generic/inc/CamSettingsModel.h
camerauis/cameraapp/generic/inc/CamSidePane.h
camerauis/cameraapp/generic/inc/CamUserSceneSetupViewBase.h
camerauis/cameraapp/generic/src/CamAppController.cpp
camerauis/cameraapp/generic/src/CamAppui.cpp
camerauis/cameraapp/generic/src/CamBurstCaptureArray.cpp
camerauis/cameraapp/generic/src/CamCaptureSetupContainer.cpp
camerauis/cameraapp/generic/src/CamContainerBase.cpp
camerauis/cameraapp/generic/src/CamDriveChangeNotifier.cpp
camerauis/cameraapp/generic/src/CamImageSaveActive.cpp
camerauis/cameraapp/generic/src/CamInfoListBoxContainer.cpp
camerauis/cameraapp/generic/src/CamNewFileService.cpp
camerauis/cameraapp/generic/src/CamPostCaptureContainer.cpp
camerauis/cameraapp/generic/src/CamPreCaptureContainerBase.cpp
camerauis/cameraapp/generic/src/CamPreCaptureViewBase.cpp
camerauis/cameraapp/generic/src/CamSettingsModel.cpp
camerauis/cameraapp/generic/src/CamShootingModeContainer.cpp
camerauis/cameraapp/generic/src/CamSidePane.cpp
camerauis/cameraapp/generic/src/CamStillPreCaptureContainer.cpp
camerauis/cameraapp/generic/src/CamStillPreCaptureView.cpp
camerauis/cameraapp/generic/src/CamUserSceneSetupContainer.cpp
camerauis/cameraapp/generic/src/CamUserSceneSetupViewBase.cpp
camerauis/cameraapp/generic/src/CamVideoPreCaptureContainer.cpp
camerauis/cameraapp/generic/src/CamVideoPreCaptureView.cpp
camerauis/cameraapp/generic/src/CamViewBase.cpp
camerauis/cameraapp/generic/src/cameracontroller/camcameracontroller.cpp
camerauis/cameraapp/generic/src/camsnapshotrotator.cpp
camerauis/cameraapp/generic/src/camtextitem.cpp
camerauis/cameraapp/loc/cam.loc
--- a/camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamcorderSettingsContainer.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamcorderSettingsContainer.cpp	Tue May 25 12:22:04 2010 +0300
@@ -208,31 +208,13 @@
             }        
         return EKeyWasNotConsumed;
         }
-
-    TKeyEvent newKeyEvent = aKeyEvent;
-    if ( !iLauchedFromGS )
+    if ( aKeyEvent.iCode == EKeyLeftArrow ||
+            aKeyEvent.iCode == EKeyRightArrow )
         {
-        if ( aKeyEvent.iCode == EKeyLeftArrow )
-    	    {
-    	    newKeyEvent.iCode = EKeyDownArrow;
-    	    }
-        else if ( aKeyEvent.iCode == EKeyRightArrow )
-            {
-            // Listbox takes all events even if it doesn't use them
-            //return EKeyWasNotConsumed; 
-            newKeyEvent.iCode = EKeyUpArrow;
-            }
+        // Listbox takes all events even if it doesn't use them
+        return EKeyWasNotConsumed; 
         }
-    else
-        {
-        if ( aKeyEvent.iCode == EKeyLeftArrow ||
-             aKeyEvent.iCode == EKeyRightArrow )
-            {
-            // Listbox takes all events even if it doesn't use them
-            return EKeyWasNotConsumed; 
-            }
-        }
-    return iSettingsList->OfferKeyEventL( newKeyEvent, aType );
+    return iSettingsList->OfferKeyEventL( aKeyEvent, aType );
     }
 
     
--- a/camerauis/cameraapp/generic/camerauiconfigmanager/bwins/camerauiconfigmanageru.def	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/camerauiconfigmanager/bwins/camerauiconfigmanageru.def	Tue May 25 12:22:04 2010 +0300
@@ -60,4 +60,5 @@
 	?IsDSAViewFinderSupported@CCameraUiConfigManager@@QBEHH@Z @ 59 NONAME ; int CCameraUiConfigManager::IsDSAViewFinderSupported(int) const
 	?CriticalLevelRamMemoryFocusGained@CCameraUiConfigManager@@QBEHXZ @ 60 NONAME ; int CCameraUiConfigManager::CriticalLevelRamMemoryFocusGained(void) const
 	?SupportedScreenModesL@CCameraUiConfigManager@@QAEXAAV?$RArray@H@@@Z @ 61 NONAME ; void CCameraUiConfigManager::SupportedScreenModesL(class RArray<int> &)
+	?IsCustomCaptureButtonSupported@CCameraUiConfigManager@@QBEHXZ @ 62 NONAME ; int CCameraUiConfigManager::IsCustomCaptureButtonSupported(void) const
 
Binary file camerauis/cameraapp/generic/camerauiconfigmanager/conf/camerauiconfigmanager.confml has changed
Binary file camerauis/cameraapp/generic/camerauiconfigmanager/conf/camerauiconfigmanager_2001B29B.crml has changed
--- a/camerauis/cameraapp/generic/camerauiconfigmanager/eabi/camerauiconfigmanageru.def	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/camerauiconfigmanager/eabi/camerauiconfigmanageru.def	Tue May 25 12:22:04 2010 +0300
@@ -64,4 +64,5 @@
 	_ZTV22CCameraUiConfigManager @ 63 NONAME
 	_ZTV25CCameraUiConfigManagerImp @ 64 NONAME
 	_ZN22CCameraUiConfigManager21SupportedScreenModesLER6RArrayIiE @ 65 NONAME
+	_ZNK22CCameraUiConfigManager30IsCustomCaptureButtonSupportedEv @ 66 NONAME
 
--- a/camerauis/cameraapp/generic/camerauiconfigmanager/inc/CameraConfigurationCrKeys.h	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/camerauiconfigmanager/inc/CameraConfigurationCrKeys.h	Tue May 25 12:22:04 2010 +0300
@@ -59,6 +59,7 @@
 const TUint32 KCamCrFeatureThumbnailManagerAPI              = 0x028;
 const TUint32 KCamCrFeatureBurstMode                        = 0x029;
 const TUint32 KCamCrFeatureContinuousAF                     = 0x01E;  
+const TUint32 KCamCrFeatureCustomCaptureButton              = 0x01F;
 // Cr keys reserved for future use 0x020 -- 0x029
 
 // Cr key for Settings which only have configured setting items
--- a/camerauis/cameraapp/generic/camerauiconfigmanager/inc/CameraDynamicSettings.hrh	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/camerauiconfigmanager/inc/CameraDynamicSettings.hrh	Tue May 25 12:22:04 2010 +0300
@@ -62,6 +62,8 @@
     ECamDynamicSettingThumbnailManagerAPI,
     ECamDynamicSettingBurstMode,
     ECamDynamicSettingContinuousAF, 
+    ECamDynamicSettingCustomCaptureButton,
+
     // Primary/secondary camera capture keys
     ECamDynamicSettingPCCaptureKeys,
     ECamDynamicSettingSCCaptureKeys,
--- a/camerauis/cameraapp/generic/camerauiconfigmanager/inc/CameraUiConfigManager.h	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/camerauiconfigmanager/inc/CameraUiConfigManager.h	Tue May 25 12:22:04 2010 +0300
@@ -460,6 +460,12 @@
         */
         IMPORT_C void SupportedScreenModesL( 
                                     RArray<TInt>& aSupportedValues );
+        
+		/*
+        * Custom capture button. 
+        * @return ETrue if custom capture button is enabled
+		*/
+        IMPORT_C TBool IsCustomCaptureButtonSupported() const;        
 
  private:
         void ConstructL();
--- a/camerauis/cameraapp/generic/camerauiconfigmanager/src/CameraUiConfigManager.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/camerauiconfigmanager/src/CameraUiConfigManager.cpp	Tue May 25 12:22:04 2010 +0300
@@ -758,4 +758,13 @@
     iConfigManagerImp->SupportedSettingItemsL( ECamDynamicSettingScreenModes,
                                                aSupportedValues );
     }	
+
+// ----------------------------------------------------------------------------------
+// CCameraUiConfigManager::IsCustomCaptureButtonSupported
+// ----------------------------------------------------------------------------------
+//
+EXPORT_C TBool CCameraUiConfigManager::IsCustomCaptureButtonSupported() const
+    {
+    return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingCustomCaptureButton );
+    }
 //End of File
--- a/camerauis/cameraapp/generic/camerauiconfigmanager/src/CameraUiConfigManagerImp.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/camerauiconfigmanager/src/CameraUiConfigManagerImp.cpp	Tue May 25 12:22:04 2010 +0300
@@ -258,6 +258,7 @@
             case ECamDynamicSettingBurstMode:
 			case ECamDynamicSettingContinuousAF: 
             case ECamDynamicSettingBurstFileSizeEstimateFactor:
+            case ECamDynamicSettingCustomCaptureButton:
                 {
                 PRINT1( _L("Camera <> CCameraUiConfigManagerImp::LoadAllDynamicSettingsL() append %d" ), settingId )
                 AppendToSettingsArrayL( settingId,
@@ -681,7 +682,10 @@
                 break;  
 	    case ECamDynamicSettingContinuousAF:
                 crKey = KCamCrFeatureContinuousAF;   
-                break;			        
+                break;
+	    case ECamDynamicSettingCustomCaptureButton:
+                crKey = KCamCrFeatureCustomCaptureButton;
+                break;
         default:
             PRINT( _L("Camera <> CCameraUiConfigManagerImp::MapSettingItemToCrFeatureKeyL, leave!!!" ) )	
             User::Leave( KErrNotSupported );
--- a/camerauis/cameraapp/generic/common/inc/CamControllerObservers.h	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/common/inc/CamControllerObservers.h	Tue May 25 12:22:04 2010 +0300
@@ -73,6 +73,7 @@
     ECamEventImageData,
     ECamEventFaceTrackingStateChanged,
     ECamEventInitReady,
+    ECamEventSnapshotRotated
     };
 
 // FORWARD DECLARATIONS
--- a/camerauis/cameraapp/generic/common/inc/mcamsettingsmodel.h	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/common/inc/mcamsettingsmodel.h	Tue May 25 12:22:04 2010 +0300
@@ -293,6 +293,25 @@
     virtual void StoreFaceTrackingValue() = 0;
     
     /**
+    * Returns the face tracking state as it was before the latest scene mode change
+    */     
+    virtual TCamSettingsOnOff GetPreviousFaceTrack() = 0;
+    
+    /**
+    * Sets the face tracking state as it was before the latest scene mode change
+    */       
+    virtual void SetPreviousFaceTrack( TCamSettingsOnOff aPreviousFaceTrack ) = 0;
+  
+    /**
+    * Returns the scene mode that was in use before the current scene mode was selected
+    */       
+    virtual TCamSceneId GetPreviousSceneMode() = 0;
+    /**
+    * Sets the scene mode that was in use before the current scene mode was selected
+    */         
+    virtual void SetPreviousSceneMode( TCamSceneId aPreviousSceneMode ) = 0;
+    
+    /**
     * Store UserScene settings
     * @since 5.1
     */
--- a/camerauis/cameraapp/generic/common/src/CamCaptureSetupListBox.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/common/src/CamCaptureSetupListBox.cpp	Tue May 25 12:22:04 2010 +0300
@@ -126,31 +126,35 @@
 TKeyResponse CCamCaptureSetupListBox::OfferKeyEventL( const TKeyEvent& aKeyEvent,TEventCode aType )
     {
     PRINT( _L("Camera => CCamCaptureSetupListBox::OfferKeyEventL" ))
-    // If the Select or navi key select button is pressed, select the current item
-    if ( ( aKeyEvent.iCode == EKeyOK && aKeyEvent.iRepeats == 0 && aType == EEventKey )
-        || aKeyEvent.iScanCode == EStdKeyDevice0 ) 
+
+    if ( !IsHighlightEnabled() &&
+            aKeyEvent.iCode != EKeyUpArrow &&
+            aKeyEvent.iCode != EKeyDownArrow )
         {
-        iView->ClearSelection();
-	    iView->SelectItemL( iView->CurrentItemIndex() );
-        }
-    //TInt oldCurrentItem = CurrentItemIndex();
-    //TKeyResponse response = CEikListBox::OfferKeyEventL( aKeyEvent, aType );
-    TKeyResponse response = EKeyWasConsumed;
-    /*TInt newCurrentItem = CurrentItemIndex();
+        PRINT( _L("Camera <= CCamCaptureSetupListBox::OfferKeyEventL highlight not visible" ))
+        return EKeyWasNotConsumed;
+        } 
+
+    TInt oldCurrentItem = CurrentItemIndex();
+    TKeyResponse response = CEikListBox::OfferKeyEventL( aKeyEvent, aType );
+    TInt newCurrentItem = CurrentItemIndex();
+    
     if ( newCurrentItem != oldCurrentItem )
         {
-        PRINT( _L("Camera => CCamCaptureSetupListBox::OfferKeyEventL set obs" ))
+        PRINT( _L("Camera <> CCamCaptureSetupListBox::OfferKeyEventL set obs" ))
         MCamListboxModel* model = static_cast<MCamListboxModel*>( iModel );
         iSettingObserver->HandleSettingValueUpdateL( model->ItemValue( newCurrentItem ) );
-        }*/
+        }
+    else
+        {
+        PRINT( _L("Camera <= CCamCaptureSetupListBox::OfferKeyEventL EKeyWasConsumed" ))
+        response = EKeyWasConsumed;
+        }
+    
+    PRINT( _L("Camera <= CCamCaptureSetupListBox::OfferKeyEventL" ))
     return response;
     }
 
-
-
-
-
-
 // ---------------------------------------------------------------------------
 // CCamCaptureSetupListBox::HandlePointerEventL
 // Handle pointer events
--- a/camerauis/cameraapp/generic/inc/CamAppController.h	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/inc/CamAppController.h	Tue May 25 12:22:04 2010 +0300
@@ -706,7 +706,7 @@
     * @since 2.8
     * @return the current snapshot image
     */
-    const CFbsBitmap* SnapshotImage() const;
+    const CFbsBitmap* SnapshotImage();
 
     /**
     * Sets the specified burst mode item as the current image, in 
@@ -2217,6 +2217,12 @@
          */
         void EmbeddedStartupSequence();
         
+        /**
+         * Called by the snapshotrotator to indicate when snapshot
+         * is rotated and ready for drawing
+         */
+        void SnapshotRotationComplete();
+
   private:
 
     // -----------------------------------------------------
@@ -2602,6 +2608,7 @@
     TCamImageOrientation  iCaptureOrientation;
     
     TBool iIssueModeChangeSequenceSucceeded;
+    TBool iSnapshotRedrawNeeded;
     
     };
 
--- a/camerauis/cameraapp/generic/inc/CamAppUi.h	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/inc/CamAppUi.h	Tue May 25 12:22:04 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -894,6 +894,12 @@
         * Hide the toolbar.
         */
         void SubmergeToolbar(); 
+        
+        /**
+        * Returns ETrue if the toolbar extension is visible,
+        * otherwise EFalse.
+        */
+        TBool IsToolBarExtensionVisible() const;
  
     public: // Functions from base classes
         /**
@@ -947,6 +953,13 @@
         */
         void StartAsServerAppL( MCamEmbeddedObserver *aEmbeddedObserver, 
         	               TInt aMode );
+        
+        /**
+        * Set application file server observer  
+        * @since 9.2
+        * @param aEmbeddedObserver service observer
+        */
+        void SetEmbeddedObserver( MCamEmbeddedObserver* aEmbeddedObserver );
 
         /**
         * Closes the application
--- a/camerauis/cameraapp/generic/inc/CamPreCaptureContainerBase.h	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/inc/CamPreCaptureContainerBase.h	Tue May 25 12:22:04 2010 +0300
@@ -270,6 +270,13 @@
      * calling the function with EFalse. 
      */
     void BlinkResolutionIndicatorOnChange( TBool aBlink=ETrue );
+    
+    /**
+     * From CCoeControl.
+	 * @since 5.1
+	 * @param aDrawNow Flag to indicate if the container should be drawn
+     */
+    void FocusChanged( TDrawNow aDrawNow );
 
   protected: 
 
@@ -381,14 +388,21 @@
     * @param aFrame pointer to the bitmap. 
     */
     void DrawFrameNow( CBitmapContext& aGc, const CFbsBitmap* aFrame ) const;
-        
+
   protected:
     /**
     * Autofocus indication layout from LAF
     *
     * @since S60 S60 v5.0
     */    
-    void SizeChanged();  
+    void SizeChanged();
+    
+    /**
+     * Checks whether the custom capture button should be shown 
+     * @since 5.1
+     * @return ETrue if capture button should be active, EFalse otherwise
+     */
+    TBool CaptureButtonActive() const;
     
   private:
     /**
@@ -586,14 +600,24 @@
     void TouchLayout();
 
     /**
-     * Callback to blink resolution indicator 
+     * Callback used by timer to blink resolution indicator
+     * @since 5.1
+     * @param aSelf Pointer to self (container)
      */
     static TInt IndicatorVisible( TAny *aSelf );
     
     /**
      * Draw resolution indicator (for blinking).
+     * @since 5.1
      */
     void DrawResolutionIndicator();
+    
+    /**
+     * Draws Capture/Record button
+     * @since 5.1
+     * @param aGc The context to draw with
+     */
+    void DrawCaptureButton( CBitmapContext& aGc ) const;
 
   // =========================================================================
   // Data
@@ -603,7 +627,7 @@
     CCamSidePane* iSidePane;
     
     // Pointer to the instance of the zoom pane
-    CCamZoomPane* iZoomPane;  
+    CCamZoomPane* iZoomPane;
     
     // Array of pointer to the resolution indicators
     RPointerArray<CCamIndicator> iResolutionIndicators;
@@ -643,6 +667,13 @@
     // Reticule location and size
     TRect iReticuleRect;
 
+    // Icons and rect for capturing image
+    CFbsBitmap *iCaptureIcon;
+    CFbsBitmap *iCaptureMask;
+    TRect iCaptureRect;
+    TBool iCaptureButtonShown;
+    TBool iCaptureIconPressed;
+
     /**
      * Autofocus indication icons array.  
      */
@@ -728,6 +759,7 @@
     
     // For blinking of resolution indicator
     TBool iBlinkResolutionIndicator;
+    TBool iBlinkModeIndicator;
     CPeriodic* iIndBlinkTimer;
     TBool iDrawIndicator;
     TInt iToggleCountdown;
--- a/camerauis/cameraapp/generic/inc/CamSettingsModel.h	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/inc/CamSettingsModel.h	Tue May 25 12:22:04 2010 +0300
@@ -88,6 +88,28 @@
     * @return None
     */
     void StoreFaceTrackingValue(); 
+    
+    
+    /**
+    * Returns the face tracking state as it was before the latest scene mode change
+    */  
+    TCamSettingsOnOff GetPreviousFaceTrack();
+    
+    /**
+    * Sets the face tracking state as it was before the latest scene mode change
+    */  
+    void SetPreviousFaceTrack( TCamSettingsOnOff aPreviousFaceTrack );
+    
+    /**
+    * Returns the scene mode that was in use before the current scene mode was selected
+    */ 
+    TCamSceneId GetPreviousSceneMode();
+
+    /**
+    * Sets the scene mode that was in use before the current scene mode was selected
+    */  
+    void SetPreviousSceneMode( TCamSceneId aPreviousSceneMode );
+    
 
   // -------------------------------------------------------------------------
   // From base class MCamSettingsModel
--- a/camerauis/cameraapp/generic/inc/CamSidePane.h	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/inc/CamSidePane.h	Tue May 25 12:22:04 2010 +0300
@@ -134,6 +134,27 @@
      */
     void UpdateLayout();    
 
+    /**
+     * Draw's/Clear's mode indicator. Used for blinking mode indicator.
+     * @since S60 5.1
+     * @param aGc Graphics context to draw the indicator
+     * @param aDrawIcon Whether the indicator should be drawn or cleared
+     */
+    void DrawModeIndicator( CWindowGc& aGc, TBool aDrawIcon );
+    
+    /**
+     * Returns mode indicator layout rect. Used for blinking mode indicator.
+     * @since S60 5.1
+     */
+    TRect ModeIndicatorLayoutRect();
+    
+    /**
+     * Updates scene indicator with the provided bitmap.
+     * @since S60 5.1
+     * @param aBitmapId, aMask  Id of the indicator bitmap and mask 
+     */
+    void UpdateSceneIndicatorL( TInt32 aBitmapId, TInt32 aMaskId );    
+    
   protected: // Functions from base classes
 
     /**
--- a/camerauis/cameraapp/generic/inc/CamUserSceneSetupViewBase.h	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/inc/CamUserSceneSetupViewBase.h	Tue May 25 12:22:04 2010 +0300
@@ -217,6 +217,9 @@
         // Indicates that Viewfinder start has been requested. View switch
         // should not occur until viewfinder start has completed.
         TBool iVFRequested;
+        
+        //Boolean to check if a popup is whats generating a background event
+        TBool iNotifierPopupShowing;
     };
 
 #endif      // CAMUSERSCENESETUPVIEWBASE_H 
--- a/camerauis/cameraapp/generic/src/CamAppController.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/src/CamAppController.cpp	Tue May 25 12:22:04 2010 +0300
@@ -1636,11 +1636,11 @@
        iAutoFocusRequested || IsAfNeeded() )
     {
     PRINT( _L("Camera <> Focusing going on, cannot start capture - setting iCaptureRequested" ) );
+    iCaptureRequested = ETrue;
     if( !IsAfNeeded() )
         {
         CancelAFNow();
-        }
-    iCaptureRequested = ETrue;    
+        }        
     } 
   // -------------------------------------------------------
   //Quick pressed capture key after backing to precapture from postcapture in burst mode
@@ -2231,7 +2231,7 @@
    && ECamCompleting  != CurrentOperation() )
     {  
     // If we are currently focused, cancel autofocus
-    if ( IsViewFinding() && CurrentOperation() != ECamCapturing && !InCallOrRinging() ) // Cannot do AF operations if VF not on. AF is anyway cancelled on VF start event.
+    if ( IsViewFinding() && CurrentOperation() != ECamCapturing ) // Cannot do AF operations if VF not on. AF is anyway cancelled on VF start event.
       {
       if( ECamFocusing == CurrentOperation() )
         {
@@ -2266,18 +2266,22 @@
 // ---------------------------------------------------------------------------
 //
 const CFbsBitmap* 
-CCamAppController::SnapshotImage() const
+CCamAppController::SnapshotImage()
   {
   PRINT ( _L("Camera => CCamAppController::SnapshotImage") ); 
   PRINT1( _L("Camera <> CCamAppController::SnapshotImage .. current image index: %d"), iCurrentImageIndex ); 
   PRINT1( _L("Camera => CCamAppController::SnapshotImage .. saved current image: %d"), SavedCurrentImage() ); 
 
+  PRINT1( _L("Camera <> CCamAppController::SnapshotImage - iSnapshotRedrawNeeded:%d"), iSnapshotRedrawNeeded );
   if ( iSnapShotRotator->IsActive() )
     {
     // Avoid flickering. Do not show original snapshot, if it needs to be rotated
+    // Snapshot might need a separate draw if rotation takes long time 
+    iSnapshotRedrawNeeded = ETrue;
     PRINT( _L("Camera <= CCamAppController::SnapshotImage - return null") );
     return NULL;
     }
+  iSnapshotRedrawNeeded = EFalse;
 
   //Sometime burst capture array includes more than one image in single capture mode, 
   //so just display the latest image here.
@@ -2800,14 +2804,8 @@
         appUi->SetAssumePostCaptureView( EFalse ); 
         } 
       }
-      
-    TBool cancelingAutoFocus = ( ECamControllerImage == CurrentMode() && 
-                                           iInfo.iActiveCamera == ECamActiveCameraPrimary &&
-                                           iConfigManager && 
-                                           iConfigManager->IsAutoFocusSupported() && 
-                                           iAFCancelInProgress );                                           
-                                                                                      
-    if ( Busy() || cancelingAutoFocus )
+                                                                                         
+    if ( Busy() )
       {
       PRINT( _L("Camera <> CCamAppController::ReleaseCamera: set release pending") );
       iPendingRelease = ETrue;
@@ -2986,12 +2984,15 @@
   if( !aStartup )
     {
     CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() );
+    TVwsViewId activeView;
+    (void) appUi->GetActiveViewId( activeView ); // ignore error
     
     if(IntegerSettingValue(ECamSettingItemRemovePhoneMemoryUsage) &&
             !IsMemoryAvailable(ECamMediaStorageMassStorage) &&
             !IsMemoryAvailable(ECamMediaStorageCard) &&
             ( appUi->PreCaptureMode() == ECamPreCapViewfinder ||
-              appUi->PreCaptureMode() == ECamPreCapGenericSetting ) )
+              appUi->PreCaptureMode() == ECamPreCapGenericSetting ) &&
+              activeView.iViewUid.iUid != ECamViewIdPhotoUserSceneSetup )
         {
         TBool usbPersonality = 0;
         #ifndef __WINSCW__
@@ -3015,6 +3016,7 @@
             }
         
         iIssueModeChangeSequenceSucceeded = EFalse;
+        ClearSequenceBusyFlag( &iBusyFlags );
         }
     else
         {
@@ -5102,7 +5104,6 @@
   if( !Busy() )
     {
     OstTrace0( CAMERAAPP_PERFORMANCE, CCAMAPPCONTROLLER_STARTVIEWFINDER, "e_CAM_APP_VF_INIT 0" );   //CCORAPP_APP_VF_INIT_END
-    OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMAPPCONTROLLER_STARTVIEWFINDER, "e_CAM_APP_OVERLAY_INIT 0" ); //CCORAPP_APP_OVERLAY_INIT_END
     
     TRAPD( error, IssueDirectRequestL( ECamRequestVfStart ) );
     if ( KErrNone    != error
@@ -7413,11 +7414,26 @@
   SetIntegerSettingValueL( ECamSettingItemVideoQuality,
                            iConfiguration->SecondaryCameraVideoQuality() );  
 
-    
-
+
+  // Remember the previous state of face tracking,
+  // current state of face tracking and
+  // the previous scene mode
+  TCamSettingsOnOff previousFaceTrack = iSettingsModel->GetPreviousFaceTrack();
+  TCamSettingsOnOff faceTracking = static_cast<TCamSettingsOnOff>( IntegerSettingValue( ECamSettingItemFaceTracking ) );
+  TCamSceneId previousSceneMode = iSettingsModel->GetPreviousSceneMode();
+  
   PRINT( _L("Camera <> CCamAppController::LoadSecondaryCameraSettingsL E" ))
   SetIntegerSettingValueL( ECamSettingItemDynamicPhotoScene, ECamSceneAuto );
   SetIntegerSettingValueL( ECamSettingItemDynamicVideoScene, ECamSceneNormal );
+  
+
+  // Restore the previous state of face tracking,
+  // current state of face tracking and
+  // the previous scene mode
+  iSettingsModel->SetPreviousFaceTrack( previousFaceTrack );
+  SetIntegerSettingValueL( ECamSettingItemFaceTracking, faceTracking );
+  iSettingsModel->SetPreviousSceneMode( previousSceneMode );
+  
   PRINT( _L("Camera <> CCamAppController::LoadSecondaryCameraSettingsL F" ))
 
   PRINT( _L("Camera <= CCamAppController::LoadSecondaryCameraSettingsL" ))
@@ -9582,9 +9598,9 @@
 
   if( iInfo.iMode != iInfo.iTargetMode )
     {
-    if ( !IsInShutdownMode() && !iSaving && iInfo.iOperation != ECamCapturing ) 
-        {
-        PRINT( _L("Camera <> CCamAppController: not in target mode, need to issue requests") );
+    if ( !IsInShutdownMode() && !iSaving && iInfo.iOperation != ECamCapturing && iInfo.iOperation != ECamStandby ) 
+        {
+        PRINT1( _L("Camera <> CCamAppController: not in target mode, need to issue requests iInfo.iOperation=%d"), iInfo.iOperation );
         IssueModeChangeSequenceL();
         }
     }
@@ -11154,13 +11170,6 @@
     PRINT( _L("Camera <> CCamAppController - viewfinder on, stop vf / re-prepare / start vf..") );
     TRAPD( status, 
       {
-      // Synchronous items
-      // IssueDirectRequestL( ECamRequestVfStop    );
-      // IssueDirectRequestL( ECamRequestSsRelease );
-      // IssueRequestL( ECamRequestVideoInit );
-      // IssueDirectRequestL( ECamRequestSsStart   );
-      // IssueDirectRequestL( ECamRequestVfStart   );
-
       // Generate the request sequence and issue to Camera Controller.
       RCamRequestArray sequence;
       CleanupClosePushL( sequence );
@@ -11336,5 +11345,24 @@
     TRAP_IGNORE( IssueModeChangeSequenceL( ETrue ) );
     }
 
+// ---------------------------------------------------------------------------
+// CCamAppController::SnapshotRotationComplete
+// 
+// ---------------------------------------------------------------------------
+//
+void CCamAppController::SnapshotRotationComplete()
+    {
+    PRINT( _L( "Camera => CCamAppController::SnapshotRotationComplete" ) );          
+    // If snapshot rotation takes too long, it might not be drawn
+    // unless specifically requested
+    if( iSnapshotRedrawNeeded )
+        {
+        iSnapshotRedrawNeeded = EFalse;
+        NotifyControllerObservers( ECamEventSnapshotRotated );    
+        }
+    PRINT( _L( "Camera <= CCamAppController::SnapshotRotationComplete" ) );    
+    }
+
+ 
 //  End of File  
 
--- a/camerauis/cameraapp/generic/src/CamAppui.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/src/CamAppui.cpp	Tue May 25 12:22:04 2010 +0300
@@ -135,6 +135,9 @@
 // events saying Eikon Server has gained focus.
 _LIT( KEikonServer, "EikonServer" );
 
+_LIT8(K3gpVideoMimeType, "video/3gpp");
+_LIT8(KMp4VideoMimeType, "video/mp4");
+
 //const TCamMediaStorage KCamInternalStorage = ECamMediaStoragePhone;
 
 const TUint KCameraEventInterest = ( ECamCameraEventClassBasicControl
@@ -1699,9 +1702,18 @@
       
       if ( !iVideoClipPlayInProgress)
         {
-        TDataType dataType;
         TInt           err;
-         
+        TDataType dataType( K3gpVideoMimeType );
+#ifndef __WINS__
+        TCamVideoFileType fileType = static_cast< TCamVideoFileType > 
+            ( iController.IntegerSettingValue( ECamSettingItemVideoFileType ) );
+        if ( fileType == ECamVideoMpeg4 )
+            {
+            PRINT(_L("Camera <> CCamAppUi::HandleCommandL. case ECamCmdPlay D"));
+            dataType=TDataType( KMp4VideoMimeType );
+            }
+#endif                
+
         SetEmbedding( ETrue );
         
         err = iDocHandler->OpenFileEmbeddedL( iController.CurrentFullFileName(),  dataType );
@@ -2014,7 +2026,12 @@
           {
           //load settings in case they were changed via GS	
           iController.LoadStaticSettingsL( IsEmbedded() );
-          iStillCaptureView->UpdateToolbarIconsL(); 
+          if ( iController.CurrentMode() == ECamControllerImage 
+                  || iController.TargetMode() == ECamControllerImage )
+              {
+              iStillCaptureView->UpdateToolbarIconsL();
+              }
+     
           // and check the availability of the memory to be used
           iController.CheckMemoryToUseL();
           }    
@@ -2827,7 +2844,7 @@
   PRINT1( _L("Camera => CCamAppUi::HandleWsEventL (type: %d)"), type )
   // In case we receive an enter key event, we should map it to MSK
   if ( aEvent.Type() == EEventKey && aEvent.Key()->iRepeats == 0 && 
-       aEvent.Key()->iScanCode == EStdKeyEnter &&
+       aEvent.Key()->iScanCode == EStdKeyEnter && iViewState != ECamViewStateUserSceneSetup &&
        !( iMode == ECamControllerVideo && iViewState == ECamViewStatePreCapture && iController.IsDemandKeyRelease() ) ) 
     {
     PRINT( _L("Camera <> CCamAppUi::HandleWsEventL: mapping enter to MSK") );
@@ -3376,7 +3393,8 @@
           //We hiden toolbar when keylock was set to on in pre-capture view and camera lost focus, 
           //so we need to display toolbar when keylock is set to off and camera gain focus again.
           if ( ECamViewStatePreCapture == iViewState &&
-               ECamPreCapViewfinder == iPreCaptureMode )  
+               ECamPreCapViewfinder == iPreCaptureMode && 
+               iController.CurrentOperation() != ECamCapturing )  
             {
             SetToolbarVisibility(); 
             }          
@@ -6326,6 +6344,17 @@
     PRINT( _L("Camera <= CCamAppUi::StartAsServerAppL") );
     }
            
+// ---------------------------------------------------------
+// CCamAppUi::SetEmbeddedObserver
+// ---------------------------------------------------------
+//
+void CCamAppUi::SetEmbeddedObserver( MCamEmbeddedObserver* aEmbeddedObserver )
+    {       
+    PRINT1( _L("Camera <> CCamAppUi::SetEmbeddedObserver %x"), aEmbeddedObserver );  
+    iEmbeddedObserver = aEmbeddedObserver;
+    }
+
+
 
 // ---------------------------------------------------------------------------
 // CCamAppUi::CamOrientation
@@ -8373,6 +8402,31 @@
     return iToolbarVisibility;
     }
 
+// -----------------------------------------------------------------------------
+// CCamAppUi::IsToolBarExtensionVisible
+// Returns ETrue if the toolbar extension is visible,
+// otherwise EFalse.
+// -----------------------------------------------------------------------------
+//
+TBool CCamAppUi::IsToolBarExtensionVisible() const
+    {
+    if ( iController.IsTouchScreenSupported() )
+        {
+        CAknToolbar* toolbar = CurrentFixedToolbar();
+        if ( toolbar )
+            {
+            CAknToolbarExtension* toolbarextension =
+                toolbar->ToolbarExtension();
+            if ( toolbarextension && toolbarextension->IsShown() )
+                {
+                PRINT( _L("Camera <> CCamAppUi::IsToolBarExtensionVisible ETrue" ) )
+                return ETrue;
+                }
+            }
+        }
+    PRINT( _L("Camera <> CCamAppUi::IsToolBarExtensionVisible EFalse" ) )
+    return EFalse;
+    }
 
 // -----------------------------------------------------------------------------
 // CCamAppUi::SetAssumePostCaptureView
--- a/camerauis/cameraapp/generic/src/CamBurstCaptureArray.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/src/CamBurstCaptureArray.cpp	Tue May 25 12:22:04 2010 +0300
@@ -133,10 +133,7 @@
       {
       return KNullDesC;
       }
-    else
-      {  
-      return *iFileName;
-      }
+    return *iFileName;
     }
 
 // ---------------------------------------------------------------------------
@@ -146,6 +143,10 @@
 //
 const TDesC& CCamBurstCaptureArray::CCamBurstCaptureItem::ImageName() const
     {
+    if( !iImageName )
+        {
+        return KNullDesC;
+        }
     return *iImageName;
     }
 
--- a/camerauis/cameraapp/generic/src/CamCaptureSetupContainer.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/src/CamCaptureSetupContainer.cpp	Tue May 25 12:22:04 2010 +0300
@@ -399,7 +399,7 @@
          ( IsCaptureKeyL( aKeyEvent, aType ) || IsShutterKeyL( aKeyEvent, aType ) ) ) )  
         {
         TKeyResponse response = iCaptureSetupControl->OfferKeyEventL( aKeyEvent, aType );
-        if ( aType == EEventKeyDown && IsShutterKeyL( aKeyEvent, aType ) && 
+        if ( aType == EEventKeyDown && response == EKeyWasNotConsumed &&
             ( ECamSettingItemDynamicPhotoFlash == iControlHandler.SettingType() ||
             ECamSettingItemDynamicSelfTimer == iControlHandler.SettingType() ) )
             {
@@ -409,8 +409,7 @@
             {
             iView.HandleCommandL( EAknSoftkeyOk );
             }
-        
-        return response;
+        return EKeyWasConsumed;
         }
     return iCaptureSetupControl->OfferKeyEventL( aKeyEvent, aType );
     }
@@ -713,7 +712,6 @@
     switch( aEventType )
         {
         
-        case EEventEnterKeyPressed:
         case EEventItemDoubleClicked:
               {
               iView.HandleCommandL(EAknSoftkeyOk);
--- a/camerauis/cameraapp/generic/src/CamContainerBase.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/src/CamContainerBase.cpp	Tue May 25 12:22:04 2010 +0300
@@ -104,6 +104,7 @@
 void CCamContainerBase::BaseConstructL( const TRect& aRect )
   {
   CreateWindowL();
+  Window().SetBackgroundColor( KRgbBlack );
   SetRect( aRect );
   EnableDragEvents(); 
 
@@ -835,10 +836,11 @@
     if ( appUi 
          && ( !appUi->IsToolBarVisible() || !appUi->DrawPreCaptureCourtesyUI() )
          && ( aKeyEvent.iScanCode == EStdKeyDevice3
-              || aKeyEvent.iScanCode == EStdKeyEnter )
-         && !static_cast<CCamViewBase*>(&iView)->IsPostCapture() ) {
+              || aKeyEvent.iScanCode == EStdKeyEnter
+              || aKeyEvent.iScanCode == EStdKeyNkpEnter ) )
+        {
         isCapturekey = ETrue;
-    }
+        }
     return isCapturekey;
     }
 
@@ -853,10 +855,11 @@
     if ( appUi 
          && !appUi->IsToolBarVisible()
          && ( aKeyEvent.iScanCode == EStdKeyDevice3
-              || aKeyEvent.iScanCode == EStdKeyEnter )
-         && !static_cast<CCamViewBase*>(&iView)->IsPostCapture() ) {
+              || aKeyEvent.iScanCode == EStdKeyEnter
+              || aKeyEvent.iScanCode == EStdKeyNkpEnter ))
+        {
         isCapturekey = ETrue;
-    }
+        }
     return isCapturekey;            
     }
 
--- a/camerauis/cameraapp/generic/src/CamDriveChangeNotifier.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/src/CamDriveChangeNotifier.cpp	Tue May 25 12:22:04 2010 +0300
@@ -359,6 +359,14 @@
     iUSBTimer = CCamTimer::NewL( KUSBTimeout, TCallBack(USBTimerCallBack, this));
     CleanupStack::Pop(); // listener
     CleanupStack::Pop(); // listener 2
+    //if USB has been inserted as Mass Storage, USB timer need to start
+    TInt value = 0;
+    iUsbMSWatcher->Get( value );
+    if( iUSBTimer && KUsbPersonalityIdMS == value ) 
+        {
+        iUSBTimer->Cancel();
+        iUSBTimer->StartTimer();
+        }
     
     StartMonitoring();
 
--- a/camerauis/cameraapp/generic/src/CamImageSaveActive.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/src/CamImageSaveActive.cpp	Tue May 25 12:22:04 2010 +0300
@@ -737,7 +737,12 @@
   
   TPtrC filename = iSaveArray->MdcaPoint( 0 );
 
-  PRINT1( _L( "Camera <> CCamImageSaveActive: trying to save file:[%S]"), &filename );     
+  PRINT1( _L( "Camera <> CCamImageSaveActive: trying to save file:[%S]"), &filename );
+  if( filename.Length() == 0 )
+      {
+      PRINT( _L( "Camera <= CCamImageSaveActive: DoSaveL Leaving...not a valid filename") );
+      User::Leave( KErrNotReady );
+      }
 
   // Check disk space
   TInt drive = 0;
--- a/camerauis/cameraapp/generic/src/CamInfoListBoxContainer.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/src/CamInfoListBoxContainer.cpp	Tue May 25 12:22:04 2010 +0300
@@ -300,8 +300,9 @@
 // Handles a change to the setting value of the slider
 // -----------------------------------------------------------------------------
 //
-void CCamInfoListBoxContainer::HandleSettingValueUpdateL( TInt /*aNewValue*/ )
-    {   
+void CCamInfoListBoxContainer::HandleSettingValueUpdateL( TInt aNewValue )
+    {
+    iController.PreviewSettingChangeL( ECamSettingItemDynamicPhotoLightSensitivity, aNewValue );
     }
     
 // ---------------------------------------------------------
@@ -420,16 +421,10 @@
     
     TKeyResponse returnvalue = iListBox->OfferKeyEventL( aKeyEvent, aType );
 
-    if ( CamUtility::IsNhdDevice() )
+    if ( EStdKeyUpArrow == aKeyEvent.iScanCode ||
+           EStdKeyDownArrow == aKeyEvent.iScanCode )
         {
-        // for non touch, we use key presses to scroll thru the scene modes
-        // for touch with keyboard, key pressing can also scroll thru the scene modes            
-        // after every up and down key presses we display the tool tip
-        if ( EStdKeyUpArrow == aKeyEvent.iScanCode ||
-             EStdKeyDownArrow == aKeyEvent.iScanCode )
-            {
-            ShowTooltipL();
-            }
+        ShowTooltipL();
         }
     else // No tooltip
         {
@@ -592,7 +587,6 @@
     {
     switch( aEventType )
         {
-        case EEventEnterKeyPressed:
         case EEventItemDoubleClicked:
               {
               iView.HandleCommandL( EAknSoftkeySelect ); 
--- a/camerauis/cameraapp/generic/src/CamNewFileService.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/src/CamNewFileService.cpp	Tue May 25 12:22:04 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -69,6 +69,12 @@
   if ( !iCompleted && iObserver )
     {	    
     TRAP_IGNORE( iObserver->HandleCompletedNewServiceL( EFalse ) );
+    CCamAppUi* appUi = static_cast< CCamAppUi* >( CEikonEnv::Static()->EikAppUi() );
+    if ( appUi )
+        {
+        // Tell appui 'this' is not valid MCamEmbeddedObserver pointer anymore
+        appUi->SetEmbeddedObserver( NULL );
+        }
     }
   PRINT( _L("Camera <= ~CCamNewFileService") );
   }
@@ -153,7 +159,7 @@
   CCamAppUi * appUi =
       static_cast< CCamAppUi* >( CEikonEnv::Static()->EikAppUi() );
   appUi->SetRequestedNewFileResolution(requestedResolution);
-  appUi->StartAsServerAppL( this, mode );          
+  appUi->StartAsServerAppL( this, mode ); // 'this' is used for MCamEmbeddedObserver pointer          
   }
     	
 // ---------------------------------------------------------------------------
--- a/camerauis/cameraapp/generic/src/CamPostCaptureContainer.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/src/CamPostCaptureContainer.cpp	Tue May 25 12:22:04 2010 +0300
@@ -529,15 +529,13 @@
                                        TInt /*aError*/ )
   {
   PRINT( _L("Camera => CCamPostCaptureContainer::HandleControllerEventL") );
-  // If this is a capture complete event
-  if ( aEvent == ECamEventCaptureComplete )
+  // If this is a capture complete event, or snapshot needs to be drawn
+  if ( aEvent == ECamEventCaptureComplete ||
+       aEvent == ECamEventSnapshotReady ||
+       aEvent == ECamEventSnapshotRotated )
     {
     DrawNow();
     }
-  else if ( aEvent == ECamEventSnapshotReady )
-    {
-    DrawNow();
-    }    
   PRINT( _L("Camera <= CCamPostCaptureContainer::HandleControllerEventL") );
   }
 
--- a/camerauis/cameraapp/generic/src/CamPreCaptureContainerBase.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/src/CamPreCaptureContainerBase.cpp	Tue May 25 12:22:04 2010 +0300
@@ -34,7 +34,9 @@
 #include <cameraapp.mbg>
 #include <cameraapp.rsg>
 #include <vgacamsettings.rsg>
-
+#include <touchfeedback.h>
+#include <akntoolbar.h>
+#include <akntoolbarextension.h>
 
 #include "CamAppUiBase.h"
 #include "CamPreCaptureContainerBase.h"
@@ -62,7 +64,8 @@
 #include "camconfiguration.h"
 #include "CameraUiConfigManager.h"
 #include "camstartuplogo.h"
-
+#include "camvfgridinterface.h"
+#include "camlinevfgriddrawer.h"
 
 // CONSTANTS
 const TInt KZoomPanelTimeout = 4000000;     // 4s 
@@ -73,8 +76,13 @@
 const TInt KNumberOfBlinks = 3;
 const TInt KNumberOfBlinksVideo = 8;
 
-#include "camvfgridinterface.h"
-#include "camlinevfgriddrawer.h"
+const TRect KIconRect(0, 0, 40, 40);
+const TInt32 KCaptureButtonWidth( 50 );
+const TInt32 KCaptureButtonYDelta( 35 );
+const TInt32 KCaptureIconDelta( 7 );
+const TUint32 KToolbarExtensionBgColor = 0x00000000;
+const TInt KToolBarExtensionBgAlpha = 0x7F;
+
 
 // Snapshot data is needed in timelapse mode
 const TUint KCameraEventInterest = ( ECamCameraEventClassVfControl      
@@ -303,6 +311,15 @@
     TRAP_IGNORE(iStartupLogo = CCamStartupLogo::NewL(*appUi->StartupLogoController(), aRect));
     }
 
+  // Capture icon rectangle
+  TRect containerRect = Rect();
+  TPoint center( containerRect.Center() );
+
+  iCaptureRect.SetRect( center.iX - KCaptureButtonWidth/2, 
+                        containerRect.iBr.iY - KCaptureButtonWidth - KCaptureButtonYDelta, 
+                        center.iX + KCaptureButtonWidth/2, 
+                        containerRect.iBr.iY - KCaptureButtonYDelta  );
+
   PRINT( _L("Camera <= CCamPreCaptureContainerBase::BaseConstructL ") );
   }
 
@@ -484,11 +501,13 @@
     // so will be processed by the container.
 
     // Handle Zoom in key if we are not saving video
+    // and if toolbar extension is not visible
     PRINT( _L("Camera <> CCamPreCaptureContainerBase::OfferKeyEventL B") )
     if ( IsZoomKeyL( aKeyEvent, aType ) 
             && ECamCompleting != iController.CurrentOperation() 
             && !iController.CurrentlySavingVideo()
-            && !appUi->IsSecondCameraEnabled() )
+            && !appUi->IsSecondCameraEnabled()
+            && !appUi->IsToolBarExtensionVisible() )
         {       
         // Offer the key event to the zoom pane/model
         TKeyResponse resp = iZoomPane->OfferKeyEventL( aKeyEvent, aType );
@@ -550,6 +569,13 @@
             PRINT( _L("Camera <> CCamPreCaptureContainerBase::OfferKeyEventL calling StopZoom()") );
             zoom_pane->StopZoom();
             }
+        
+        // Stop blinking icon when capture is initiated
+        if ( iIndBlinkTimer && iIndBlinkTimer->IsActive() )
+            {
+            iIndBlinkTimer->Cancel();
+            iDrawIndicator = ETrue;
+            }
         }
     TBool viewFinderRunning = iReceivedVfFrame;
     if ( iController.UiConfigManagerPtr() &&
@@ -725,11 +751,42 @@
             iPhotoSceneUsesReticule = !iController.CurrentSceneHasForcedFocus();
             HandleOperationStateChangeEventL();
             }
-       
         }
+      iCaptureButtonShown = CaptureButtonActive();
       break;
       }
     // ---------------------------------------------------
+    case ECamEventEngineStateChanged:
+        {
+        PRINT1( _L("Camera <> Start mode indi blinking, op:%d"), iController.CurrentOperation() );
+
+        if ( !iController.UiConfigManagerPtr()->IsCustomCaptureButtonSupported() 
+                && !iController.EngineRequestsPending()
+                && iController.TargetMode() == iController.CurrentMode()
+                && iController.CurrentOperation() == ECamNoOperation 
+                && !iBlinkResolutionIndicator )
+            {
+            PRINT( _L("Camera <> mode indi blinking - starting timers") );
+            if ( !iIndBlinkTimer )
+                {
+                iIndBlinkTimer = CPeriodic::NewL( EPriorityLess );
+                }
+            else 
+                {
+                iIndBlinkTimer->Cancel();            
+                }
+            
+            iToggleCountdown = 2 * KNumberOfBlinks;
+            iBlinkModeIndicator = ETrue;          
+            iIndBlinkTimer->Start( KIndicatorBlinkDelay,
+                                   KIndicatorBlinkDelay,
+                                   TCallBack( IndicatorVisible, this) );
+            
+            iDrawIndicator = ETrue;
+            }
+        break;
+        }
+    // ---------------------------------------------------
     case ECamEventExitRequested:
       {
       iShuttingDown = ETrue;                        
@@ -798,6 +855,8 @@
     case ECamEventVideoQualityChanged:
         if ( iBlinkResolutionIndicator ) 
             {
+            iBlinkModeIndicator = EFalse;
+        
             // Force the first blink to occur right away 
             iDrawIndicator = EFalse;
             DrawResolutionIndicator();
@@ -892,7 +951,7 @@
         ResetVFGridVisibility();
         }
     else    
-        {
+        { // Background
         if ( iIndBlinkTimer )
             {
             iIndBlinkTimer->Cancel();
@@ -914,7 +973,7 @@
         
         // Update the view ID for when we come back.
         TCamAppViewIds viewId = static_cast<TCamAppViewIds>( iView.Id().iUid );
-        SetPreviousViewId( viewId );      
+        SetPreviousViewId( viewId );
         }
     PRINT( _L( "Camera <= CCamPreCaptureContainerBase::HandleForegroundEventL" ) );        
     }
@@ -1061,6 +1120,13 @@
        }
    DrawScreenFurniture( gc );
    DrawNaviControls( gc );
+   
+   // Draw capture button
+   if( iCaptureButtonShown )
+       {
+       DrawCaptureButton( gc );   
+       }
+
    PRINT( _L( "Camera <= CCamPreCaptureContainerBase::Draw" ) );        
    }
 
@@ -2383,37 +2449,105 @@
 //
 void CCamPreCaptureContainerBase::HandlePointerEventL( const TPointerEvent& aPointerEvent )
     {
-    PRINT3( _L("CCamPreCaptureContainerBase::HandlePointerEventL iType=%d iPosition=(%d, %d)"),
+    PRINT3( _L("Camera => CCamPreCaptureContainerBase::HandlePointerEventL iType=%d iPosition=(%d, %d)"),
         aPointerEvent.iType,
         aPointerEvent.iPosition.iX,
         aPointerEvent.iPosition.iY );
    CCamAppUi* appUi = static_cast<CCamAppUi*>( iEikonEnv->AppUi() );
    
-   if ( !appUi->IsSecondCameraEnabled() )
+   // Capture button
+   TRect captureRect( iCaptureRect );
+   captureRect.Grow( 30, 30 );
+   
+   if ( iCaptureButtonShown && captureRect.Contains( aPointerEvent.iPosition ) )
        {
-       // don't let zoom pane be used when capturing image
-       if ( iController.CurrentMode() != ECamControllerImage ||
-            (iController.CurrentOperation() != ECamCapturing &&
-            iController.CurrentOperation() != ECamCompleting) )
+       if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
+           {
+           MTouchFeedback* feedback = MTouchFeedback::Instance(); 
+           if ( !iCaptureIconPressed && feedback )
+               {
+               feedback->InstantFeedback( ETouchFeedbackBasicButton );        
+               }
+           iCaptureIconPressed = ETrue;           
+           DrawNow( captureRect );
+           }
+       else if ( aPointerEvent.iType == TPointerEvent::EButton1Up
+                 && iCaptureIconPressed )
            {
-           if ( iZoomPane )  
-                {
-                if ( iZoomPane->HandlePointerEventL( aPointerEvent ) )
+           iCaptureIconPressed = EFalse;
+
+           // Give feedback on button release
+           MTouchFeedback* feedback = MTouchFeedback::Instance(); 
+           if ( feedback )
+               {
+               feedback->InstantFeedback( ETouchFeedbackBasicButton );        
+               }
+
+           // About to start capture ... hide stop zoom etc.
+           if ( iZoomPane )
+               {
+               PRINT( _L("Camera <> CCamPreCaptureContainerBase::HandlePointerEventL - StopZoom()") );
+               iZoomPane->StopZoom();
+               iZoomPane->MakeVisible( EFalse, ETrue );
+               }
+           // Stop blinking icon when capture is initiated
+           if ( iIndBlinkTimer && iIndBlinkTimer->IsActive() )
+               {
+               iIndBlinkTimer->Cancel();
+               iDrawIndicator = ETrue;
+               }
+
+           if ( iController.CurrentMode() == ECamControllerVideo ) 
+               {
+               iView.HandleCommandL( ECamCmdRecord );
+               }
+           else
+               {
+               iView.HandleCommandL( ECamCmdCaptureImage );
+               }
+           }
+       else
+           {
+		   // Avoid compiler warning
+           }
+       }
+   else 
+       {
+       PRINT( _L("Camera <> CCamPreCaptureContainerBase::HandlePointerEventL - outside button region") );
+       // Drags can potentially start from inside button area
+       if ( iCaptureIconPressed && aPointerEvent.iType != TPointerEvent::EDrag )
+           {
+           iCaptureIconPressed = EFalse;
+           DrawNow( captureRect );
+           }
+          
+       if ( !appUi->IsSecondCameraEnabled() )
+           {
+           // don't let zoom pane be used when capturing image
+           if ( iController.CurrentMode() != ECamControllerImage ||
+                ( iController.CurrentOperation() != ECamCapturing &&
+                  iController.CurrentOperation() != ECamCompleting &&
+                  iController.CurrentOperation() != ECamFocusing ) )
+               {
+               if ( iZoomPane )  
                     {
-                    ShowZoomPaneWithTimer(); 
-                    return;
+                    if ( iZoomPane->HandlePointerEventL( aPointerEvent ) )
+                        {
+                        ShowZoomPaneWithTimer(); 
+                        return;
+                        }
                     }
+               }
+    
+            if ( aPointerEvent.iType == TPointerEvent::EButton1Down &&
+                  !appUi->DrawPreCaptureCourtesyUI() )
+                {
+                appUi->HandleCommandL( ECamCmdRaiseCourtesyUI );
                 }
+           CCamContainerBase::HandlePointerEventL( aPointerEvent );
            }
+       }
 
-        if ( aPointerEvent.iType == TPointerEvent::EButton1Down &&
-              !appUi->DrawPreCaptureCourtesyUI() )
-            {
-            appUi->HandleCommandL( ECamCmdRaiseCourtesyUI );
-            }
-
-        CCamContainerBase::HandlePointerEventL( aPointerEvent );
-    }    
     PRINT( _L("Camera <= CCamPreCaptureContainerBase::HandlePointerEventL") );
     }
 
@@ -2675,33 +2809,30 @@
     return resolutionIconLayout.Rect();
     }
 
+// -------------------------------------------------------------
+// CCamPreCaptureContainerBase::BlinkResolutionIndicatorOnChange
+// -------------------------------------------------------------
+//
 void CCamPreCaptureContainerBase::BlinkResolutionIndicatorOnChange( TBool aBlink )
     {
     iBlinkResolutionIndicator = aBlink;
     }
 
+// -------------------------------------------------------------
+// CCamPreCaptureContainerBase::DrawResolutionIndicator
+// -------------------------------------------------------------
+//
 void CCamPreCaptureContainerBase::DrawResolutionIndicator()
     {
     PRINT( _L("Camera => CCamPreCaptureContainerBase::DrawResolutionIndicator") );
     iToggleCountdown--;
 
-    // Stop immediately the periodic timer for showing correctly 
-    // the text "Processing image" when capturing a still image. 
-    TBool stillCapturing = ECamControllerImage == iController.CurrentMode() && 
-                           ECamImageCaptureSingle == iController.CurrentImageMode() &&
-                           iController.IsProcessingCapture();
-    if ( stillCapturing )
-      {        
-      iBlinkResolutionIndicator = EFalse;
-      iIndBlinkTimer->Cancel();
-      return;
-      }  
-      
     // State changed, need to redraw
     ActivateGc();
 
     // Invalidate the flash icon area
-    TRect rect( iResolutionIndicators[iCurrentIndicator]->LayoutRect() );
+    TRect rect( (iBlinkModeIndicator) ? iSidePane->ModeIndicatorLayoutRect()
+                                      : iResolutionIndicators[iCurrentIndicator]->LayoutRect() );
     RWindow window = Window();
     window.Invalidate( rect  );
     window.BeginRedraw( rect );
@@ -2709,17 +2840,35 @@
     // Redraw the background in that area
     Redraw( rect );
 
-    // Draw the flash icon itself
+    // Draw the icon 
     CWindowGc& gc = SystemGc();
-    if( iDrawIndicator )
+    if ( iBlinkModeIndicator )
         {
-        iResolutionIndicators[iCurrentIndicator]->DisplayIcon();
+        iSidePane->DrawModeIndicator( gc, iDrawIndicator );
         }
     else
         {
-        iResolutionIndicators[iCurrentIndicator]->ClearIcon();
+        // Mode indicator should be visible, while the resolution indicator blinks
+        if ( !iController.UiConfigManagerPtr()->IsCustomCaptureButtonSupported() )
+            {
+            iSidePane->DrawModeIndicator( gc, ETrue );
+            }
+
+        if( iDrawIndicator )
+            {
+            iResolutionIndicators[iCurrentIndicator]->DisplayIcon();
+            }
+        else
+            {
+            iResolutionIndicators[iCurrentIndicator]->ClearIcon();
+            }
+        iResolutionIndicators[iCurrentIndicator]->Draw( gc );
+        
+        // If blink timer is canceled abruptly(like capture image) at some places, resolution indicator may go missing in pre-capture mode.
+        // So alway set resolution clear flag to EFlase after drawing resolution indicator to avoiding missing indicator.
+        // This do not affect indicator blink function because this just set the flag, do not draw the indicator.        
+        iResolutionIndicators[iCurrentIndicator]->DisplayIcon();
         }
-    iResolutionIndicators[iCurrentIndicator]->Draw( gc );
 
     // Tell the window redraw is finished and deactivate Gc
     window.EndRedraw();
@@ -2729,12 +2878,17 @@
     if ( iDrawIndicator && iToggleCountdown <= 0 )
         {
         iBlinkResolutionIndicator = EFalse;
+        iBlinkModeIndicator = EFalse;        
         iIndBlinkTimer->Cancel();
         }
 
     PRINT( _L("Camera <= CCamPreCaptureContainerBase::DrawResolutionIndicator") );
     }
 
+// -------------------------------------------------------------
+// CCamPreCaptureContainerBase::IndicatorVisible
+// -------------------------------------------------------------
+//
 TInt CCamPreCaptureContainerBase::IndicatorVisible( TAny *aSelf )
     {
     PRINT( _L("Camera => CCamPreCaptureContainerBase::IndicatorVisible") );
@@ -2749,5 +2903,65 @@
     return KErrNone;
     }
 
+// -------------------------------------------------------------
+// CCamPreCaptureContainerBase::DrawCaptureButton
+// -------------------------------------------------------------
+//
+void CCamPreCaptureContainerBase::DrawCaptureButton( CBitmapContext& aGc ) const
+    {
+    TRect containerRect = Rect();
+    TPoint iconTl( containerRect.Center().iX - KCaptureButtonWidth/2 + KCaptureIconDelta, 
+                   containerRect.iBr.iY - KCaptureButtonYDelta - KCaptureButtonWidth + KCaptureIconDelta );
+
+    aGc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
+    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
+    aGc.SetPenStyle( CGraphicsContext::ENullPen );
+   
+    if ( iCaptureIconPressed )
+        {
+        aGc.SetBrushColor( KRgbBlack );
+        }
+    else
+        {
+        aGc.SetBrushColor( TRgb( KToolbarExtensionBgColor, KToolBarExtensionBgAlpha ) );
+        }
+    aGc.DrawEllipse( iCaptureRect );    
+
+    aGc.SetBrushStyle( CGraphicsContext::ENullBrush );
+    aGc.SetPenStyle( CGraphicsContext::ESolidPen );
+    aGc.BitBltMasked( iconTl, iCaptureIcon, KIconRect, iCaptureMask, EFalse );
+    }
+
+// -------------------------------------------------------------
+// CCamPreCaptureContainerBase::FocusChanged
+// -------------------------------------------------------------
+//
+void CCamPreCaptureContainerBase::FocusChanged( TDrawNow aDrawNow )
+    {
+    PRINT2( _L("Camera <> CCamPreCaptureContainerBase::FocusChanged, draw:%d, focused:%d"), aDrawNow, 
+                IsFocused() );
+    iCaptureButtonShown = CaptureButtonActive();
+    if ( aDrawNow )
+        {
+        DrawNow();
+        }
+    }
+
+// -------------------------------------------------------------
+// CCamPreCaptureContainerBase::CaptureButtonActive
+// -------------------------------------------------------------
+//
+TBool CCamPreCaptureContainerBase::CaptureButtonActive() const
+    {
+    TBool buttonActive = EFalse;
+    if ( iController.UiConfigManagerPtr()->IsCustomCaptureButtonSupported() 
+            && iController.IsTouchScreenSupported() )
+        {
+        buttonActive = IsFocused() && iController.CurrentOperation() == ECamNoOperation;
+        PRINT1( _L("Camera <> capture button active:%d"), buttonActive );
+        }
+    return buttonActive;
+    }
+
 // End of File  
 
--- a/camerauis/cameraapp/generic/src/CamPreCaptureViewBase.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/src/CamPreCaptureViewBase.cpp	Tue May 25 12:22:04 2010 +0300
@@ -1033,7 +1033,9 @@
         PRINT( _L("Camera <> CCamPreCaptureViewBase::ExitAllModesL ##" )) 
         ExitCaptureSetupMenuModeL();
         }
-	  if(Id() == TUid::Uid(ECamViewIdVideoPreCapture))
+	  if( Id() == TUid::Uid( ECamViewIdVideoPreCapture ) &&
+          iController.UiConfigManagerPtr() &&
+          iController.UiConfigManagerPtr()->IsXenonFlashSupported() )
 		{
 		iToolbarExtensionInvisible = ETrue;
 		}
@@ -1086,14 +1088,13 @@
       CAknToolbar* fixedToolbar = Toolbar();
       CAknToolbarExtension* extension = fixedToolbar->ToolbarExtension();
       
-      //Only active view will set toolbar extension visibility.
-
-      if(this->IsForeground())
+      // Only active view will set toolbar extension visibility.
+      if( this->IsForeground() )
           {
           if ( extension && iToolbarExtensionInvisible == EFalse )
               {
               extension->SetShown( ETrue );
-              } 
+              }
           else if( extension )
               {
               extension->SetShown( EFalse );
@@ -1822,7 +1823,8 @@
 
     MAknTouchGestureFwPinchEvent *pinch = AknTouchGestureFwEventPinch( aEvent );
     CCamAppUi* appUi = static_cast<CCamAppUi*>( iEikonEnv->AppUi() );
-    if ( pinch && (ECamNoOperation == iController.CurrentOperation()) && appUi && !appUi->ZoomPane()->IsVisible() )
+    if ( pinch && (ECamNoOperation == iController.CurrentOperation()) && appUi 
+               && !appUi->ZoomPane()->IsCurrentlyZooming() )
         {
         // Determine the direction of pinch: +ve -> pinch outward / zoom / widen VF
         TInt currMove = pinch->Movement();
@@ -1852,26 +1854,29 @@
                 }
             }
         }
-    else if ( EAknTouchGestureFwDoubleTap == aEvent.Type() )
+    else if ( EAknTouchGestureFwDoubleTap == aEvent.Type() 
+              && ( ECamNoOperation == iController.CurrentOperation() 
+                   || ( ECamCapturing   == iController.CurrentOperation() 
+                        && iController.CurrentMode() == ECamControllerVideo ) ) )
         {
-        PRINT( _L("Camera <> *** double tap event") );
+        PRINT( _L("Camera <> double tap event") );
         CCamAppUi* appUi = static_cast<CCamAppUi*>( iEikonEnv->AppUi() );
         CCamZoomPane *zoomPane = appUi->ZoomPane();
         
         CCamPreCaptureContainerBase* container = static_cast<CCamPreCaptureContainerBase*>( iContainer );
         container->ShowZoomPaneWithTimer();
 
-        // Zoom to max (if not already at max) zoom level, otherwise zoom out to min level
-        if ( !zoomPane->IsZoomAtMaximum() )
+        // Zoom to min (if not already at min) zoom level, otherwise zoom in to max level
+        if ( !zoomPane->IsZoomAtMinimum() )
+            {
+            PRINT( _L("Camera <> Zooming out to min level") );
+            zoomPane->ZoomToMinimum();
+            }
+        else
             {
             PRINT( _L("Camera <> Zooming to max level") );
             zoomPane->ZoomToMaximum();
             }
-        else
-            {
-            PRINT( _L("Camera <> Zooming out to min level") );
-            zoomPane->ZoomToMinimum();
-            }
         }
     else
         {
--- a/camerauis/cameraapp/generic/src/CamSettingsModel.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/src/CamSettingsModel.cpp	Tue May 25 12:22:04 2010 +0300
@@ -1221,6 +1221,7 @@
 //
 void CCamSettingsModel::PhotoSceneHasChangedL( TInt aSceneId )
     {
+    PRINT( _L("Camera => CCamSettingsModel::PhotoSceneHasChangedL") )
     // If the scene has changed to a scene other than the "User" scene
     // set capture setup values to defaults and the flash to scene flash.
     if ( aSceneId != ECamSceneUser )
@@ -1255,32 +1256,6 @@
         // Set the user setup contrast to that of the new scene
         TInt contrast = DefaultSettingValueForScene( aSceneId, ECamSettingItemSceneContrast );
         SetIntegerSettingValueL( ECamSettingItemDynamicPhotoBrightness, contrast );
-                 
-	    if ( iUiConfigManager->IsFaceTrackingSupported() ) // FT supported
-         {      
-         if ( ECamSceneScenery == aSceneId ||
-              ECamSceneSports == aSceneId ||
-              ECamSceneMacro == aSceneId)
-            {
-            if ( ECamSceneScenery != iPreviousSceneMode && 
-                 ECamSceneSports != iPreviousSceneMode &&
-                 ECamSceneMacro != iPreviousSceneMode )
-               {	
-               iPreviousFaceTrack = TCamSettingsOnOff( IntegerSettingValue( ECamSettingItemFaceTracking ) );	
-               }
-            SetIntegerSettingValueL( ECamSettingItemFaceTracking, ECamSettOff );	
-            }
-         else if ( ( ECamSceneScenery == iPreviousSceneMode ||
-                     ECamSceneSports == iPreviousSceneMode ||
-                     ECamSceneMacro == iPreviousSceneMode ) &&
-                   ( ECamSettOff == TCamSettingsOnOff( IntegerSettingValue( ECamSettingItemFaceTracking ) ) ) )
-             {
-             SetIntegerSettingValueL( ECamSettingItemFaceTracking, iPreviousFaceTrack );
-             iPreviousFaceTrack = TCamSettingsOnOff( IntegerSettingValue( ECamSettingItemFaceTracking ) );
-             CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( iEnv->AppUi() );
-             TRAP_IGNORE( appUi->APHandler()->UpdateActivePaletteL() );
-             }
-         }              
 
         // Update the engine with the scene settings.
         //UpdateEngineWithSceneSettingsL( iPhotoScenes, aSceneId );
@@ -1291,7 +1266,44 @@
         {
         ActivateUserSceneSettingsL();
         }
+        
+      
+	  if ( iUiConfigManager->IsFaceTrackingSupported() ) // FT supported
+        {
+        PRINT( _L("Camera <> Face tracking supported") ) 
+        if ( ECamSceneScenery == aSceneId ||
+             ECamSceneSports == aSceneId ||
+             ECamSceneMacro == aSceneId)
+            {
+            PRINT( _L("Camera <> New scene mode is scenery, sports or macro") )
+            if ( ECamSceneScenery != iPreviousSceneMode && 
+                 ECamSceneSports != iPreviousSceneMode &&
+                 ECamSceneMacro != iPreviousSceneMode )
+                {	
+                PRINT( _L("Camera <> Previous scene mode is not scenery, sports or macro -> Set iPreviousFaceTrack to current value") )
+                iPreviousFaceTrack = TCamSettingsOnOff( IntegerSettingValue( ECamSettingItemFaceTracking ) );	
+                }
+            PRINT( _L("Camera <> Switch face tracking OFF") )
+            SetIntegerSettingValueL( ECamSettingItemFaceTracking, ECamSettOff );	
+            }
+        else if ( ( ECamSceneScenery == iPreviousSceneMode ||
+                     ECamSceneSports == iPreviousSceneMode ||
+                     ECamSceneMacro == iPreviousSceneMode ) &&
+                   ( ECamSettOff == TCamSettingsOnOff( IntegerSettingValue( ECamSettingItemFaceTracking ) ) ) )
+            {
+            PRINT( _L("Camera <> Previous scene mode was scenery, sports or macro AND face tracking is OFF") )
+            PRINT( _L("Camera <> Set face tracking to iPreviousFaceTrack") )
+            SetIntegerSettingValueL( ECamSettingItemFaceTracking, iPreviousFaceTrack );
+            PRINT( _L("Camera <> Set iPreviousFaceTrack to current face tracking state") )
+            iPreviousFaceTrack = TCamSettingsOnOff( IntegerSettingValue( ECamSettingItemFaceTracking ) );
+            CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( iEnv->AppUi() );
+            TRAP_IGNORE( appUi->APHandler()->UpdateActivePaletteL() );
+            }
+        }              
+          
+
     iPreviousSceneMode = TCamSceneId( aSceneId ); // store scene mode setting
+    PRINT( _L("Camera <= CCamSettingsModel::PhotoSceneHasChangedL()") )
     }
 
 // ---------------------------------------------------------------------------
@@ -1603,6 +1615,7 @@
     iStaticModel->StorePrimaryCameraSettingsL();
     CopySettingsL(iDynamicPhotoIntSettings, iDynamicPhotoIntSettingsBackup);
     CopySettingsL(iDynamicVideoIntSettings, iDynamicVideoIntSettingsBackup);
+    PRINT( _L("Camera <= CCamSettingsModel::StorePrimaryCameraSettingsL"))
     }
 
 // ---------------------------------------------------------------------------
@@ -2284,12 +2297,11 @@
         ECamSceneMacro == activeScene) 	
       {
       PRINT( _L("Camera <> CCamSettingsModel::StoreFaceTrackingValue(), Scenery or Sports mode" ) )		      	      	
-      if ( iPreviousFaceTrack != TCamSettingsOnOff( IntegerSettingValue( ECamSettingItemFaceTracking ) ) )
-         {	
-         PRINT1( _L("Camera <> CCamSettingsModel::StoreFaceTrackingValue(), iPreviousFaceTrack [%d]" ), iPreviousFaceTrack )		      	      		
-         SetIntegerSettingValueL( ECamSettingItemFaceTracking, iPreviousFaceTrack );
-         }      	      	      
+      SetIntegerSettingValueL( ECamSettingItemFaceTracking, iPreviousFaceTrack );   
       }
+      
+      
+      
    PRINT( _L("Camera <= CamSettingsModel::StoreFaceTrackingValue()" ) )	
    }
 
@@ -2385,5 +2397,47 @@
     
     PRINT( _L("Camera <= CCamSettingsModel::SetUserSceneDefault ") );
     }
+
+// ---------------------------------------------------------------------------
+// CCamSettingsModel::GetPreviousFaceTrack
+//
+// Returns the face tracking state as it was before the latest scene mode change
+// ---------------------------------------------------------------------------
+//
+TCamSettingsOnOff CCamSettingsModel::GetPreviousFaceTrack()
+    {
+    return iPreviousFaceTrack;
+    }
+    
+// ---------------------------------------------------------------------------
+// CCamSettingsModel::SetPreviousFaceTrack
+// ---------------------------------------------------------------------------    
+//
+void CCamSettingsModel::SetPreviousFaceTrack( TCamSettingsOnOff aPreviousFaceTrack )
+    {
+    iPreviousFaceTrack = aPreviousFaceTrack;
+    }  
+    
+// ---------------------------------------------------------------------------
+// CCamSettingsModel::GetPreviousSceneMode
+//
+// Returns the scene mode that was in use before the current scene mode was selected
+// ---------------------------------------------------------------------------    
+//
+TCamSceneId CCamSettingsModel::GetPreviousSceneMode()
+    {
+    return iPreviousSceneMode;
+    }
+    
+// ---------------------------------------------------------------------------
+// CCamSettingsModel::SetPreviousSceneMode
+// ---------------------------------------------------------------------------    
+//
+void CCamSettingsModel::SetPreviousSceneMode( TCamSceneId aPreviousSceneMode )
+    {
+    iPreviousSceneMode = aPreviousSceneMode;
+    }      
+    
+    
 // ===========================================================================
 // end of File  
--- a/camerauis/cameraapp/generic/src/CamShootingModeContainer.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/src/CamShootingModeContainer.cpp	Tue May 25 12:22:04 2010 +0300
@@ -592,7 +592,7 @@
             TKeyResponse response = iListBox->OfferKeyEventL( aKeyEvent, aType );
             if( UserSceneHighlighted() )
                 {
-                iView.HandleCommandL( ECamCmdSelect );
+                iView.HandleCommandL( ECamCmdUserSceneSelected );
                 }
                 else
                 {
@@ -606,7 +606,7 @@
         TKeyResponse response = iListBox->OfferKeyEventL( aKeyEvent, aType );
         if( UserSceneHighlighted() )
             {
-            iView.HandleCommandL( ECamCmdSelect );
+            iView.HandleCommandL( ECamCmdUserSceneSelected );
             }
             else
             {
@@ -1114,7 +1114,6 @@
     {
     switch( aEventType )
         {
-        case EEventEnterKeyPressed:
         case EEventItemDoubleClicked:
         case EEventItemSingleClicked:
               {
--- a/camerauis/cameraapp/generic/src/CamSidePane.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/src/CamSidePane.cpp	Tue May 25 12:22:04 2010 +0300
@@ -83,6 +83,7 @@
 //
 void CCamSidePane::ConstructL()
     {
+    PRINT( _L("Camera => CCamSidePane::ConstructL") );
     LoadResourceDataL();
 
     // side pane is a controller, self timer and burst mode observer
@@ -90,6 +91,7 @@
     iVisible = ETrue;
 
     UpdateLayout();
+    PRINT( _L("Camera <= CCamSidePane::ConstructL") );
     }
 
 // -----------------------------------------------------------------------------
@@ -546,19 +548,33 @@
           {
           if( appUi && !appUi->IsSecondCameraEnabled() || 
               appUi &&  appUi->IsQwerty2ndCamera() )  
-            {
-            if ( ECamControllerVideo == iMode ) 
-                {
-                iIndicators[ECamIndicatorCaptureMode]->SetIcon( 2 );
-                }
-            else
-              iIndicators[ECamIndicatorCaptureMode]->SetIcon( 0 );
-            }
+              {
+              if ( ECamControllerVideo == iMode ) 
+                  {
+                  iIndicators[ECamIndicatorCaptureMode]->SetIcon( 2 );
+                  }
+              else
+                  iIndicators[ECamIndicatorCaptureMode]->SetIcon( 0 );
+              }
           else
             iIndicators[ECamIndicatorCaptureMode]->ClearIcon();
+			
+          if ( iController.UiConfigManagerPtr()->IsCustomCaptureButtonSupported() )
+              {
+              iIndicators[ECamIndicatorCaptureMode]->ClearIcon();
+              }
           break;
           }
         // -------------------------------------------------
+        case ECamIndicatorTotal:
+            {
+            if ( iController.UiConfigManagerPtr()->IsCustomCaptureButtonSupported() )
+                {
+                iIndicators[ECamIndicatorTotal]->DisplayIcon();
+                }
+            break;
+            }
+        // -------------------------------------------------
         // other indicators
         default:
           {
@@ -998,6 +1014,7 @@
             switch ( i )
                 {
                 case ECamIndicatorCaptureMode:
+                case ECamIndicatorTotal:
                     {
                     if ( ECamControllerVideo == iMode )
                         {
@@ -1010,6 +1027,11 @@
                            AknLayoutScalable_Apps::main_camera4_pane_g1( variant ) );
                         }
                     iIndicators[i]->SetRect( l.Rect() );
+                    if ( i == ECamIndicatorCaptureMode 
+					     && iController.UiConfigManagerPtr()->IsCustomCaptureButtonSupported() )
+                        {
+                        iIndicators[i]->ClearIcon();
+                        }
                     break;
                     }
                 case ECamIndicatorBurstMode:
@@ -1048,5 +1070,85 @@
             }
         }
     }
-   
+
+// ---------------------------------------------------------------------------
+// CCamSidePane::ModeIndicatorLayoutRect
+// ---------------------------------------------------------------------------
+//
+TRect CCamSidePane::ModeIndicatorLayoutRect()
+    {
+    // Mode and scene indicators use the same layout rect. 
+    // Only one of these can be used at a give time.  
+    return iIndicators[ECamIndicatorCaptureMode]->LayoutRect();
+    }
+
+// ---------------------------------------------------------------------------
+// CCamSidePane::DrawModeIndicator
+// ---------------------------------------------------------------------------
+//
+void CCamSidePane::DrawModeIndicator( CWindowGc& aGc, TBool aDrawIcon )
+    {
+    PRINT( _L("Camera => CCamSidePane::DrawModeIndicator") );
+
+    if ( iController.UiConfigManagerPtr()->IsCustomCaptureButtonSupported() )
+        {
+        PRINT( _L("Camera <= CCamSidePane::DrawSceneIndicator - mode indicator not used") );
+        return;
+        }
+
+    CCamIndicator *indicator = iIndicators[ECamIndicatorCaptureMode];
+    if ( indicator )
+        {
+        if( aDrawIcon )
+            {
+            indicator->DisplayIcon();
+            }
+        else
+            {
+            indicator->ClearIcon();
+            }
+        indicator->Draw( aGc );
+        }
+    PRINT( _L("Camera <= CCamSidePane::DrawModeIndicator") );
+    }
+
+// ---------------------------------------------------------------------------
+// CCamSidePane::UpdateSceneIndicatorL
+// ---------------------------------------------------------------------------
+//
+void CCamSidePane::UpdateSceneIndicatorL( TInt32 aBitmapId, TInt32 aMaskId )
+    {
+    PRINT1( _L("Camera => CCamSidePane::UpdateSceneIndicatorL - count:%d"), iIndicators.Count() );
+
+    if ( !iIndicators.Count() )
+        {
+        PRINT( _L("Camera <= CCamSidePane::UpdateSceneIndicatorL - indi not initialized") );
+        return;    
+        }
+
+    // Remove previous scene icon, if present
+    if ( iIndicators.Count() == ECamIndicatorTotal + 1 )
+        {
+        CCamIndicator *indi = iIndicators[ECamIndicatorTotal];
+        iIndicators.Remove( ECamIndicatorTotal );
+        delete indi;
+        }
+
+    // Construct and append new indicator to the indicator list
+    TRect rect( iIndicators[ECamIndicatorCaptureMode]->LayoutRect() );
+    CCamIndicator *indicator = CCamIndicator::NewL( rect );
+
+    CleanupStack::PushL( indicator );
+    indicator->AddIconL( aBitmapId, aMaskId );
+    indicator->SetRect( rect );
+    iIndicators.Append( indicator );
+    CleanupStack::Pop( indicator );
+    
+    // Mode indicator disabled and 
+    iIndicators[ECamIndicatorCaptureMode]->ClearIcon();
+    iIndicators[ECamIndicatorTotal]->DisplayIcon();
+
+    PRINT( _L("Camera <= CCamSidePane::UpdateSceneIndicatorL") );
+    }
+
 // End of File
--- a/camerauis/cameraapp/generic/src/CamStillPreCaptureContainer.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/src/CamStillPreCaptureContainer.cpp	Tue May 25 12:22:04 2010 +0300
@@ -51,6 +51,8 @@
 const TRgb KGridColor     = KRgbGray;
 const CGraphicsContext::TPenStyle KGridStyle = CGraphicsContext::ESolidPen;
 
+_LIT(KCamBitmapFile, "z:\\resource\\apps\\cameraapp.mif");
+const TSize KIconSize(35, 35);
 
 // ================= MEMBER FUNCTIONS =======================
 
@@ -99,6 +101,13 @@
       delete iFlashBitmap;
       delete iFlashBitmapMask;
       }
+  
+  if ( iCaptureIcon )
+      {
+      delete iCaptureIcon;
+      delete iCaptureMask;
+      }
+  
   PRINT( _L("Camera <= ~CCamStillPreCaptureContainer" ))
   }
 
@@ -151,6 +160,17 @@
           ->SetupActivePaletteL( static_cast<CCamViewBase*>(&iView) );
       OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMSTILLPRECAPTURECONTAINER_CONSTRUCTL, "e_CAM_APP_AP_SETUP 0" );
       }
+  
+  // Load capture icon
+  AknIconUtils::CreateIconL(
+           iCaptureIcon,
+           iCaptureMask,
+           KCamBitmapFile(),
+           EMbmCameraappQgn_indi_cam4_capture,
+           EMbmCameraappQgn_indi_cam4_capture_mask );
+  AknIconUtils::SetSize( iCaptureIcon, KIconSize, EAspectRatioPreserved );
+  AknIconUtils::SetSize( iCaptureMask, KIconSize, EAspectRatioPreserved );
+
   PRINT( _L("Camera <= CCamStillPreCaptureContainer::ConstructL" ))
   }
 
@@ -511,7 +531,8 @@
   // First handle middle softkey and enter key capture event
   if ( !appui->IsToolBarVisible()
        && ( aKeyEvent.iScanCode == EStdKeyDevice3
-            || aKeyEvent.iScanCode == EStdKeyEnter ) )
+            || aKeyEvent.iScanCode == EStdKeyEnter
+            || aKeyEvent.iScanCode == EStdKeyNkpEnter ) )
     {
     if ( iController.UiConfigManagerPtr() )
         {
--- a/camerauis/cameraapp/generic/src/CamStillPreCaptureView.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/src/CamStillPreCaptureView.cpp	Tue May 25 12:22:04 2010 +0300
@@ -45,11 +45,13 @@
 #include <AknsUtils.h>
 #include <cameraapp.mbg>
 #include <AknIconUtils.h>
+#include <gulicon.h>
 
 
 #include "StringLoader.h"
 #include "camactivepalettehandler.h"
 #include "CameraUiConfigManager.h"
+#include "CamSidePane.h"
 
 #include "CamLocalViewIds.h"
 #include "OstTraceDefinitions.h"
@@ -119,6 +121,7 @@
 //
 void CCamStillPreCaptureView::HandleCommandL( TInt aCommand )
     {
+    PRINT( _L("Camera => CCamStillPreCaptureView::HandleCommandL") );
     CCamAppUi* appUi = static_cast<CCamAppUi*>( iEikonEnv->AppUi() );
     TCamOrientation orientation = appUi->CamOrientation();
     switch ( aCommand )
@@ -286,6 +289,7 @@
             CCamPreCaptureViewBase::HandleCommandL( aCommand ); 
             }
         }
+    PRINT( _L("Camera <= CCamStillPreCaptureView::HandleCommandL") );
     }   
 
 // -----------------------------------------------------------------------------
@@ -429,7 +433,7 @@
             }
         }
     CCamPreCaptureViewBase::HandleFocusLossL();
-    PRINT( _L( "Camera <= CCamVideoPreCaptureView::HandleFocusLossL" ) );    
+    PRINT( _L( "Camera <= CCamStillPreCaptureView::HandleFocusLossL" ) );    
     }    
 
 // -----------------------------------------------------------------------------
@@ -747,7 +751,6 @@
     {
     
     SetSoftKeysL( R_CAM_SOFTKEYS_BLANK_STOP );
-    
     }
   // If "Burst" capture is completing
   else if ( burstEnabled && operation == ECamCompleting )   
@@ -1987,7 +1990,11 @@
         MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
         TFileName iconFileName;
         CamUtility::ResourceFileName( iconFileName );     
-  
+
+        // For use with scene indicator
+        TInt32 iconId = EMbmCameraappQgn_indi_cam4_mode_auto;
+        TInt32 maskId = EMbmCameraappQgn_indi_cam4_mode_auto_mask;
+
         switch ( scene )
             {
             case ECamSceneAuto:
@@ -1999,6 +2006,8 @@
                     EMbmCameraappQgn_indi_cam4_mode_auto_mask,
                     skinInstance,
                     KAknsIIDQgnIndiCam4ModeAuto );
+                iconId = EMbmCameraappQgn_indi_cam4_mode_auto;
+                maskId = EMbmCameraappQgn_indi_cam4_mode_auto_mask;
                 break;
                 }
             case ECamSceneUser:
@@ -2010,6 +2019,8 @@
                     EMbmCameraappQgn_indi_cam4_mode_userscene_mask,
                     skinInstance,
                     KAknsIIDQgnIndiCam4ModeUserscene );
+                iconId = EMbmCameraappQgn_indi_cam4_mode_userscene;
+                maskId = EMbmCameraappQgn_indi_cam4_mode_userscene_mask;
                 break;
                 }                    
             case ECamSceneMacro:
@@ -2021,6 +2032,8 @@
                     EMbmCameraappQgn_indi_cam4_mode_closeup_mask,
                     skinInstance,
                     KAknsIIDQgnIndiCam4ModeCloseup );
+                iconId = EMbmCameraappQgn_indi_cam4_mode_closeup;
+                maskId = EMbmCameraappQgn_indi_cam4_mode_closeup_mask;
                 break;
                 }          
             case ECamScenePortrait:
@@ -2032,6 +2045,8 @@
                     EMbmCameraappQgn_indi_cam4_mode_portrait_mask,
                     skinInstance,
                     KAknsIIDQgnIndiCam4ModePortrait );
+                iconId = EMbmCameraappQgn_indi_cam4_mode_portrait;
+                maskId = EMbmCameraappQgn_indi_cam4_mode_portrait_mask;
                 break;
                 }
             case ECamSceneScenery:
@@ -2043,6 +2058,8 @@
                     EMbmCameraappQgn_indi_cam4_mode_landscape_mask,
                     skinInstance,
                     KAknsIIDQgnIndiCam4ModeLandscape );
+                iconId = EMbmCameraappQgn_indi_cam4_mode_landscape;
+                maskId = EMbmCameraappQgn_indi_cam4_mode_landscape_mask;
                 break;
                 }
             case ECamSceneNight:
@@ -2054,6 +2071,8 @@
                     EMbmCameraappQgn_indi_cam4_mode_night_mask,
                     skinInstance,
                     KAknsIIDQgnIndiCam4ModeNight );
+                iconId = EMbmCameraappQgn_indi_cam4_mode_night;
+                maskId = EMbmCameraappQgn_indi_cam4_mode_night_mask;
                 break;
                 }
             case ECamSceneSports:
@@ -2065,6 +2084,8 @@
                     EMbmCameraappQgn_indi_cam4_mode_sport_mask,
                     skinInstance,
                     KAknsIIDQgnIndiCam4ModeSport );
+                iconId = EMbmCameraappQgn_indi_cam4_mode_sport;
+                maskId = EMbmCameraappQgn_indi_cam4_mode_sport_mask;
                 break;
                 }
             case ECamSceneNightScenery:
@@ -2077,14 +2098,28 @@
                     EMbmCameraappQgn_indi_cam4_mode_portrait_night_mask, 
                     skinInstance,
                     KAknsIIDQgnIndiCam4ModePortraitNight );
+                iconId = EMbmCameraappQgn_indi_cam4_mode_portrait_night;
+                maskId = EMbmCameraappQgn_indi_cam4_mode_portrait_night_mask;
                 break;
                 }
             case ECamSceneCandlelight:
             default:
                 break;
             }
+        
+        // Update the icon in the side pane
+        if ( iController.UiConfigManagerPtr()->IsCustomCaptureButtonSupported() )
+            {
+            CCamAppUi* appUi = static_cast<CCamAppUi*>( iEikonEnv->AppUi() );
+            CCamSidePane* sidePane = appUi->SidePane();
+    
+            if ( sidePane )
+                {
+                PRINT( _L("Camera <> CCamStillPreCaptureView::UpdateSceneModeIconsL - Updating side pane indicator") );
+                sidePane->UpdateSceneIndicatorL( iconId, maskId );
+                }
+            }
         }
-    
     }
 
 // ---------------------------------------------------------------------------
--- a/camerauis/cameraapp/generic/src/CamUserSceneSetupContainer.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/src/CamUserSceneSetupContainer.cpp	Tue May 25 12:22:04 2010 +0300
@@ -445,24 +445,22 @@
     const TKeyEvent& aKeyEvent,
     TEventCode aType )
     {
-    if ( iController.UiConfigManagerPtr()
-         && iController.UiConfigManagerPtr()->IsAutoFocusSupported() )
+    if ( aType == EEventKeyDown &&
+           ( aKeyEvent.iScanCode == EStdKeyEnter || 
+               aKeyEvent.iScanCode == EStdKeyNkpEnter ) )
         {
-        if( aType == EEventKeyDown && IsShutterKeyL( aKeyEvent, aType ) )
-            {
-            TKeyResponse response = iUserSceneSetupList->OfferKeyEventL( aKeyEvent, aType );
-            iView.HandleCommandL( EAknSoftkeyBack );
-            return response;
-            }
+        HandleSelectionL();
+        return EKeyWasConsumed;
         }
-    else if( aType == EEventKeyDown && IsCaptureKeyL( aKeyEvent, aType ) )
+    else if ( aKeyEvent.iScanCode == EStdKeyUpArrow || 
+                aKeyEvent.iScanCode == EStdKeyDownArrow )
         {
-        TKeyResponse response = iUserSceneSetupList->OfferKeyEventL( aKeyEvent, aType );
-        iView.HandleCommandL( EAknSoftkeyBack );
-        return response;
+        return iUserSceneSetupList->OfferKeyEventL( aKeyEvent, aType );
         }
-       
-	return iUserSceneSetupList->OfferKeyEventL( aKeyEvent, aType );
+    else
+        {
+        return EKeyWasConsumed;    
+        }
     }
 
 // ---------------------------------------------------------------------------
--- a/camerauis/cameraapp/generic/src/CamUserSceneSetupViewBase.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/src/CamUserSceneSetupViewBase.cpp	Tue May 25 12:22:04 2010 +0300
@@ -255,7 +255,7 @@
             appUi->HandleCommandL( ECamCmdGoToStandby );
             return;
             }
-        else if ( !appUi->IsInPretendExit() )
+        else if ( !appUi->IsInPretendExit()  && !iNotifierPopupShowing )
             {
             // Register that we want to use the engine
             IncrementCameraUsers();
@@ -290,9 +290,11 @@
     // To background
     else if( !aForeground )
         {
+        iNotifierPopupShowing = appUi->AppInBackground( ETrue );
         PRINT( _L("Camera <> CCamUserSceneSetupViewBase::HandleForegroundEventL dec engine count") );
         // Register that we nolonger need the engine
-        DecrementCameraUsers();
+        if( !iNotifierPopupShowing )
+            DecrementCameraUsers();
         }
     PRINT( _L("Camera <= CCamUserSceneSetupViewBase::HandleForegroundEventL ") );
     }
@@ -593,6 +595,8 @@
 void CCamUserSceneSetupViewBase::ExitInfoListBoxL()
 	{
 	PRINT( _L("Camera => CCamUserSceneSetupViewBase::ExitInfoListBoxL()") );  	   				
+	StopViewFinder(); 
+		   				
 	CCamCaptureSetupViewBase::ExitInfoListBoxL();
 	SwitchToUserSceneSetupModeL();
 	
--- a/camerauis/cameraapp/generic/src/CamVideoPreCaptureContainer.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/src/CamVideoPreCaptureContainer.cpp	Tue May 25 12:22:04 2010 +0300
@@ -48,6 +48,11 @@
 #endif
 
 
+// CONSTANTS
+_LIT(KCamBitmapFile, "z:\\resource\\apps\\cameraapp.mif");
+const TSize KIconSize(35, 35);
+
+
 // ================= MEMBER FUNCTIONS =======================
 
 // ---------------------------------------------------------------------------
@@ -79,6 +84,12 @@
       iFeedback->RemoveFeedbackForControl( this );
       }
   delete iFileTypeIndicator;
+  
+  if ( iCaptureIcon )
+      {
+      delete iCaptureIcon;
+      delete iCaptureMask;
+      }
   PRINT( _L("Camera <= ~CCamVideoPreCaptureContainer") );
   }
 
@@ -150,6 +161,16 @@
         if ( !iFeedback )
             iFeedback = MTouchFeedback::CreateInstanceL();
         }
+    
+    // Load record icon
+    AknIconUtils::CreateIconL(
+             iCaptureIcon,
+             iCaptureMask,
+             KCamBitmapFile(),
+             EMbmCameraappQgn_indi_cam4_video,
+             EMbmCameraappQgn_indi_cam4_video_mask );
+    AknIconUtils::SetSize( iCaptureIcon, KIconSize, EAspectRatioPreserved );
+    AknIconUtils::SetSize( iCaptureMask, KIconSize, EAspectRatioPreserved );
     }
 
 // ---------------------------------------------------------------------------
@@ -187,7 +208,7 @@
             {
             if ( iController.IsTouchScreenSupported() && iFeedback )
                 {
-                iFeedback->EnableFeedbackForControl( this, EFalse );
+                iFeedback->SetFeedbackEnabledForThisApp( EFalse );              
                 }
             iRecordState = ECamRecording;
             iResolutionIndicators[iCurrentIndicator]->SetRect(iResolutionIndicatorVidcapPosition);
@@ -240,7 +261,7 @@
         iFileTypeIndicator->SetRect( iFileTypeIndicatorPosition );
         if ( iController.IsTouchScreenSupported() && iFeedback )
             {
-            iFeedback->EnableFeedbackForControl( this, ETrue );
+            iFeedback->SetFeedbackEnabledForThisApp( ETrue, ETrue );
             }
         break;
         }
@@ -415,12 +436,6 @@
     }
   else
     {
-    // Blank out the softkeys if we are capturing
-    if ( EKeyWasConsumed == keyResponse )
-      {
-      BlankSoftkeysL();
-      }
-
     CCamAppUi* appUi = static_cast<CCamAppUi*>( iEikonEnv->AppUi() );
     
     // neither recording nor paused
@@ -430,12 +445,16 @@
 
     // Hide the toolbar if we are capturing
     if( EKeyWasConsumed == keyResponse )
-      {
-      // Repeated key events (MSK) are ignored.
-      iController.SetDemandKeyRelease( ETrue );  
+        {
+        // Hide capture button if we are capturing
+        iCaptureButtonShown = CaptureButtonActive();    
+        DrawNow( iCaptureRect );
 
-      // fixed toolbar is used only with touch devices
-      if ( iController.IsTouchScreenSupported() )
+        // Repeated key events (MSK) are ignored.
+        iController.SetDemandKeyRelease( ETrue );  
+        
+        // fixed toolbar is used only with touch devices
+        if ( iController.IsTouchScreenSupported() )
           {
           CAknToolbar* fixedToolbar = appUi->CurrentFixedToolbar();
           if ( fixedToolbar )
@@ -443,8 +462,8 @@
             fixedToolbar->SetToolbarVisibility( EFalse );
             }
           }
-      }
-     } 
+        }
+    } 
   PRINT( _L("Camera <= CCamVideoPreCaptureContainer::HandleCaptureKeyEventL") );
   return keyResponse;
   }
--- a/camerauis/cameraapp/generic/src/CamVideoPreCaptureView.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/src/CamVideoPreCaptureView.cpp	Tue May 25 12:22:04 2010 +0300
@@ -40,6 +40,7 @@
 #include <cameraapp.mbg>
 #include "CamCaptureSetupMenu.h"
 #include "CamPanic.h"
+#include "CamSidePane.h"
 
 #include "CamShootingModeContainer.h"
 #include "CamVideoPreCaptureContainer.h"
@@ -668,7 +669,7 @@
         }
     else
         {
-        SetSoftKeysL( R_CAM_SOFTKEYS_SELECT_CANCEL );
+        SetSoftKeysL( R_AVKON_SOFTKEYS_SELECT_CANCEL  );
         }
     }
   else if ( iStandbyModeActive )
@@ -1243,6 +1244,7 @@
 //
 void CCamVideoPreCaptureView::UpdateToolbarIconsL()
     {
+    PRINT( _L("Camera => CCamVideoPreCaptureView::UpdateToolbarIconsL") );
     // fixed toolbar is used only with touch devices
     if (!iController.IsTouchScreenSupported() )
         return;
@@ -1251,6 +1253,7 @@
      UpdateVideoColorToneIconsL();
      UpdateVideoWhitebalanceIconsL();
 	 RedrawToolBar();
+	PRINT( _L("Camera <= CCamVideoPreCaptureView::UpdateToolbarIconsL") );
     }
 
 // ---------------------------------------------------------------------------
@@ -1407,6 +1410,11 @@
      CamUtility::ResourceFileName( iconFileName );
      TCamSceneId scene = static_cast< TCamSceneId > ( 
          iController.IntegerSettingValue( ECamSettingItemDynamicVideoScene ) );
+     
+     // For use with scene indicator
+     TInt32 iconId = EMbmCameraappQgn_indi_cam4_mode_auto;
+     TInt32 maskId = EMbmCameraappQgn_indi_cam4_mode_auto_mask;
+
      switch ( scene )
          {
          case ECamSceneAuto:
@@ -1419,6 +1427,8 @@
                  EMbmCameraappQgn_indi_cam4_mode_auto_mask,
                  skinInstance,
                  KAknsIIDQgnIndiCam4ModeAuto );
+             iconId = EMbmCameraappQgn_indi_cam4_mode_auto;
+             maskId = EMbmCameraappQgn_indi_cam4_mode_auto_mask;
              break;
              }
          case ECamSceneNight:
@@ -1430,6 +1440,8 @@
                  EMbmCameraappQgn_indi_cam4_mode_night_mask,
                  skinInstance,
                  KAknsIIDQgnIndiCam4ModeNight );
+             iconId = EMbmCameraappQgn_indi_cam4_mode_night;
+             maskId = EMbmCameraappQgn_indi_cam4_mode_night_mask;
              break;
              }
          case ECamSceneLowLight: 
@@ -1441,6 +1453,8 @@
                  EMbmCameraappQgn_indi_cam4_wb_tungsten_mask,
                  skinInstance,
                  KAknsIIDQgnIndiCam4WbTungsten );
+             iconId = EMbmCameraappQgn_indi_cam4_wb_tungsten;
+             maskId = EMbmCameraappQgn_indi_cam4_wb_tungsten_mask;
              break;
              }
          default:
@@ -1449,6 +1463,19 @@
              }
              break;
          }
+
+     // Update the icon in the side pane
+     if ( iController.UiConfigManagerPtr()->IsCustomCaptureButtonSupported() )
+         {
+         CCamAppUi* appUi = static_cast<CCamAppUi*>( iEikonEnv->AppUi() );
+         CCamSidePane* sidePane = appUi->SidePane();
+    
+         if ( sidePane )
+             {
+             PRINT( _L("Camera <> CCamVideoPreCaptureView::UpdateVideoSceneModeIconsL - Updating side pane indicator") );
+             sidePane->UpdateSceneIndicatorL( iconId, maskId );
+             }
+         }
      }
 
  // ---------------------------------------------------------------------------
--- a/camerauis/cameraapp/generic/src/CamViewBase.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/src/CamViewBase.cpp	Tue May 25 12:22:04 2010 +0300
@@ -862,6 +862,8 @@
 //
 void CCamViewBase::SetSoftKeysL(TInt aResource)
 	{
+    PRINT1( _L("Camera => CCamViewBase::SetSoftKeysL SoftKeys:0x%x"), aResource );
+
     CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() );	  
     // If courtesy softkeys are enabled, check whether the UI can be drawn without being explicitly raised
     // (rare, but possible: e.g. when video recording starts
@@ -902,6 +904,8 @@
         Cba()->DrawDeferred();
 
         }
+
+    PRINT( _L("Camera <= CCamViewBase::SetSoftKeysL") );
 	}
 
 
--- a/camerauis/cameraapp/generic/src/cameracontroller/camcameracontroller.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/src/cameracontroller/camcameracontroller.cpp	Tue May 25 12:22:04 2010 +0300
@@ -2913,7 +2913,6 @@
               CEikonEnv* env = CEikonEnv::Static();
 
               OstTrace0( CAMERAAPP_PERFORMANCE, CCAMCAMERACONTROLLER_PROCESSVFSTARTREQUESTL, "e_CAM_APP_VF_INIT 0" ); //CCORAPP_APP_VF_INIT_END
-              OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMCAMERACONTROLLER_PROCESSVFSTARTREQUESTL, "e_CAM_APP_OVERLAY_INIT 0" ); //CCORAPP_APP_OVERLAY_INIT_END
 
               TInt orgPos = SetVfWindowOrdinal(); // Set visible
               iCamera->StartViewFinderDirectL(
@@ -2970,16 +2969,14 @@
             {
             PRINT( _L("Camera <> Call CCaeEngine::StartViewFinderBitmapsL..") );
 
-            OstTrace0( CAMERAAPP_PERFORMANCE, DUP2_CCAMCAMERACONTROLLER_PROCESSVFSTARTREQUESTL, "e_CAM_APP_VF_INIT 0" ); //CCORAPP_APP_VF_INIT_END
-            OstTrace0( CAMERAAPP_PERFORMANCE, DUP3_CCAMCAMERACONTROLLER_PROCESSVFSTARTREQUESTL, "e_CAM_APP_OVERLAY_INIT 0" ); //CCORAPP_APP_OVERLAY_INIT_END
+            OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMCAMERACONTROLLER_PROCESSVFSTARTREQUESTL, "e_CAM_APP_VF_INIT 0" ); //CCORAPP_APP_VF_INIT_END
             iCaeEngine->StartViewFinderBitmapsL( iInfo.iViewfinderSize );
             }
           else
 #endif // CAMERAAPP_CAE_FIX
             {
             PRINT( _L("Camera <> Call CCamera::StartViewFinderBitmapsL..") );
-            OstTrace0( CAMERAAPP_PERFORMANCE, DUP4_CCAMCAMERACONTROLLER_PROCESSVFSTARTREQUESTL, "e_CAM_APP_VF_INIT 0" );  //CCORAPP_APP_VF_INIT_END
-            OstTrace0( CAMERAAPP_PERFORMANCE, DUP5_CCAMCAMERACONTROLLER_PROCESSVFSTARTREQUESTL, "e_CAM_APP_OVERLAY_INIT 0" ); //CCORAPP_APP_OVERLAY_INIT_END
+            OstTrace0( CAMERAAPP_PERFORMANCE, DUP2_CCAMCAMERACONTROLLER_PROCESSVFSTARTREQUESTL, "e_CAM_APP_VF_INIT 0" );  //CCORAPP_APP_VF_INIT_END
             iCamera->StartViewFinderBitmapsL( iInfo.iViewfinderSize );
 
   		  if ( params().iMirrorImage )
@@ -3233,7 +3230,6 @@
       OstTrace0( CAMERAAPP_PERFORMANCE, CCAMCAMERACONTROLLER_PROCESSIMAGEREQUESTL, "e_CAM_APP_CONFIGURATIONS 0" );  //CCORAPP_APP_CONFIGS_END
       iCamera->PrepareImageCaptureL( format, index );
       OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMCAMERACONTROLLER_PROCESSIMAGEREQUESTL, "e_CAM_APP_STILL_INIT 0" ); //CCORAPP_APP_STILL_INIT_END
-      OstTrace0( CAMERAAPP_PERFORMANCE, DUP2_CCAMCAMERACONTROLLER_PROCESSIMAGEREQUESTL, "e_CAM_APP_OVERLAY_INIT 1" );   //CCORAPP_APP_OVERLAY_INIT_START
 
       iCamera->SetJpegQuality( params().iQualityFactor );
 
@@ -3257,7 +3253,7 @@
       {
       CheckFlagOnL( iInfo.iState,        ECamImageOn,    KErrNotReady );
       CheckEqualsL( iInfo.iCaptureState, ECamCaptureOff, KErrInUse    );
-      OstTrace0( CAMERAAPP_PERFORMANCE, DUP3_CCAMCAMERACONTROLLER_PROCESSIMAGEREQUESTL, "e_CAM_APP_CAPTURE_START 0" );  //CCORAPP_CAPTURE_START_END
+      OstTrace0( CAMERAAPP_PERFORMANCE, DUP2_CCAMCAMERACONTROLLER_PROCESSIMAGEREQUESTL, "e_CAM_APP_CAPTURE_START 0" );  //CCORAPP_CAPTURE_START_END
 
       // New capture starts, reset capture and snapshot counters.
       iInfo.iCaptureCount  = 0;
@@ -3588,6 +3584,7 @@
           {
           PRINT( _L("Camera <> ECamTriInactive") );
           iSnapshotProvider->StartSnapshot();
+          OstTrace0( CAMERAAPP_PERFORMANCE, DUP2_CCAMCAMERACONTROLLER_PROCESSSNAPSHOTREQUESTL, "e_CAM_APP_OVERLAY_INIT 0" );   //CCORAPP_APP_OVERLAY_INIT_END
           break;
           }
         case ECamTriActive: // Already active, no action
@@ -3611,6 +3608,7 @@
     case ECamRequestSsRelease:
       {
       PRINT( _L("Camera <> case ECamRequestSsRelease") );
+      OstTrace0( CAMERAAPP_PERFORMANCE, DUP3_CCAMCAMERACONTROLLER_PROCESSSNAPSHOTREQUESTL, "e_CAM_APP_OVERLAY_INIT 1" );   //CCORAPP_APP_OVERLAY_INIT_START
       ProcessSsReleaseRequest();
       break;
       }
--- a/camerauis/cameraapp/generic/src/camsnapshotrotator.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/src/camsnapshotrotator.cpp	Tue May 25 12:22:04 2010 +0300
@@ -107,6 +107,7 @@
         PRINT( _L( "Camera => CCamSnapShotRotator::RotationCompleteL - delete iRotatedSnapshot" ) );
         delete iRotatedSnapshot;
         iRotatedSnapshot = NULL;
+        iController.SnapshotRotationComplete();
         }
             
     PRINT( _L( "Camera <= CCamSnapShotRotator::RotationCompleteL" ) );         
--- a/camerauis/cameraapp/generic/src/camtextitem.cpp	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/generic/src/camtextitem.cpp	Tue May 25 12:22:04 2010 +0300
@@ -98,6 +98,7 @@
     if ( iText )
         {
         aBitmapContext.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
+        aBitmapContext.SetBrushColor( KRgbWhite );
         iLayout.DrawText(
                 aBitmapContext,
                 *iText,
--- a/camerauis/cameraapp/loc/cam.loc	Tue May 11 15:56:11 2010 +0300
+++ b/camerauis/cameraapp/loc/cam.loc	Tue May 25 12:22:04 2010 +0300
@@ -1496,7 +1496,7 @@
 //d:In video scene settings list
 //l:popup_preview_text_window/opt5
 //
-#define qtn_lcam_scene_vid_night_ex     "Ideal for filming in low light"
+#define qtn_lcam_scene_vid_night_ex     "Ideal for filming in dark"
 
 //d:Sport scene descriptive text
 //d:In image scene settings list
@@ -3798,7 +3798,7 @@
 //d:In video scene settings list
 //l:main_cset_text2_pane_t1_copy1
 //
-#define qtn_lcam_scene_vid_night_ex_v2     "Ideal for filming in low light"
+#define qtn_lcam_scene_vid_night_ex_v2     "Ideal for filming in dark"
 
 //d:Sport scene descriptive text
 //d:In image scene settings list
@@ -4253,5 +4253,31 @@
 //l: popup_note_window
 #define qtn_lcam_storage_inaccessible_note "All storage inaccessible at the moment. Please try again later"
 
+//d: This popup note is displayed when HDMI cable is plugged to the device
+//d: while video recording is ongoing. Video recording is not allowed
+//d: with HDMI connection.
+//l: popup_note_window
+#define qtn_lcam_hdmi_cable_detected "Recording finished, because HDMI cable detected" 
+
+//d: This popup note is displayed when user tries to start 
+//d: video recording while HDMI cable is plugged. 
+//d: Video recording is not allowed with HDMI connection.
+//l: popup_note_window
+#define qtn_lcam_hdmi_remove_cable "Remove HDMI cable before recording video"
+
+//d: Icon text for 'Grid' button in touch toolbar extension in still mode
+//d: pre-capture view. Pressing the button will enable or disable
+//d: a 3x3 grid layout on top of the viewfinder image to help the user
+//d: to compose the image.
+//l: cell_tb_ext_pane_t1/opt1
+#define qtn_lcam_tb_grid "Grid"
+
+//d: Icon text for 'switching to secondary camera' button in touch toolbar 
+//d: toolbar extension in video and still mode. Pressing the button will 
+//d: switch to secondary camera video or still mode.
+//l: cell_tb_ext_pane_t1/opt1
+#define qtn_lcam_tb_switch "Switch"
+
+
 // end of file