camerauis/cameraapp/generic/src/CamCaptureSetupContainer.cpp
branchRCL_3
changeset 12 8c55c525d5d7
parent 7 dbec5787fa68
child 18 51dda465e618
--- a/camerauis/cameraapp/generic/src/CamCaptureSetupContainer.cpp	Fri Mar 12 15:41:04 2010 +0200
+++ b/camerauis/cameraapp/generic/src/CamCaptureSetupContainer.cpp	Mon Mar 15 12:39:00 2010 +0200
@@ -47,6 +47,8 @@
 // CONSTANTS
 
 const TUint KCameraEventInterest = ECamCameraEventClassVfData;
+const TUint32 KToolbarExtensionBgColor = 0x00000000;
+const TInt KToolBarExtensionBgAlpha = 0x7F;
 
 // ===========================================================================
 // MEMBER FUNCTIONS 
@@ -60,12 +62,13 @@
                               CCamAppController& aController, 
                               CAknView& aView,
                               CCamCaptureSetupControlHandler& aControlHandler,
-                              const TRect& aRect )
+                              const TRect& aRect, TBool aFullScreenVF )
     {
     CCamCaptureSetupContainer* self = new( ELeave ) CCamCaptureSetupContainer( 
                                                              aController, 
                                                              aView,
-                                                             aControlHandler );
+                                                             aControlHandler,
+                                                             aFullScreenVF );
     CleanupStack::PushL( self );
     self->ConstructL( aRect );
     CleanupStack::Pop( self );
@@ -116,10 +119,17 @@
             fixedToolbar->SetToolbarVisibility( EFalse );
             }
         }
+    iViewFinding = iControlHandler.ControlUsesViewFinder();
     
-    iCaptureSetupControl = iControlHandler.CreateCaptureSetupControlL( this );
+    if( iViewFinding )
+        {
+        iCaptureSetupControl = iControlHandler.CreateCaptureSetupControlL( this, !iFullScreenVF );
+        }
+    else
+        {
+        iCaptureSetupControl = iControlHandler.CreateCaptureSetupControlL( this, ETrue );        
+        }
     iCaptureSetupControl->SetContainerWindowL( *this );
-    iViewFinding = iControlHandler.ControlUsesViewFinder();
 
     // If the control requires a viewfinder then add it
     if ( iViewFinding )
@@ -251,10 +261,12 @@
 CCamCaptureSetupContainer::CCamCaptureSetupContainer( 
                              CCamAppController& aController, 
                              CAknView& aView,
-                             CCamCaptureSetupControlHandler& aControlHandler )
+                             CCamCaptureSetupControlHandler& aControlHandler,
+                             TBool aFullScreenVF )
 : CCamContainerBase( aController, aView ), 
 iControlHandler( aControlHandler ),
-iActivateOnTouchRelease(EFalse)
+iActivateOnTouchRelease(EFalse),
+iFullScreenVF(aFullScreenVF)
     {
     }
 
@@ -303,7 +315,14 @@
         gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
         gc.SetBrushColor( TRgb::Color16MA( 0 ) );
         gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
+        if( iFullScreenVF )
+            {
+            gc.DrawRect( aRect );
+            }
+        else
+            {
         gc.DrawRect( iViewFinderRectLayout.Rect() );
+            }
         
         // Reset the brush after use (otherwise anything drawn
         // after the viewfinder will also show viewfinder frames)
@@ -316,7 +335,25 @@
                                             EAknsCIQsnTextColorsCG6 );
     if ( CamUtility::IsNhdDevice() )
         {
-        iTitleTextRectLayout.DrawText( gc, *iTitleText, ETrue, color );
+        if( appUi->IsDirectViewfinderActive() &&
+            iViewFinding && iFullScreenVF )
+            {
+            gc.SetBrushColor( TRgb( KToolbarExtensionBgColor, KToolBarExtensionBgAlpha ) );            
+            gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
+            gc.DrawRect( TRect( iLayoutAreaRect.iTl.iX,
+                                iLayoutAreaRect.iTl.iY,
+                                iLayoutAreaRect.iBr.iX,
+                                iTitleTextRectLayout.TextRect().iBr.iY ) );
+            
+            gc.SetBrushStyle( CGraphicsContext::ENullBrush );
+            
+            color=TRgb( KRgbWhite );
+            iTitleTextRectLayout.DrawText( gc, *iTitleText, ETrue, color );
+            }
+        else
+            {
+            iTitleTextRectLayout.DrawText( gc, *iTitleText, ETrue, color );
+            }
         }
     else
         { 
@@ -732,51 +769,6 @@
     }
 */
 
-// ---------------------------------------------------------
-// CCamCaptureSetupContainer::ReserveAndStartVF
-// ---------------------------------------------------------
-//
-void CCamCaptureSetupContainer::ReserveAndStartVF()
-    {
-    PRINT ( _L("Camera => CCamCaptureSetupContainer::ReserveAndStartVF") );
-    TCamCameraMode mode = iController.CurrentMode();
-    if(iController.IsAppUiAvailable())
-        {
-        TVwsViewId currentViewId;
-        CCamAppUi* appUi = static_cast<CCamAppUi*>( iEikonEnv->AppUi() );
-        appUi->GetActiveViewId( currentViewId );
-        switch ( currentViewId.iViewUid.iUid )
-            {
-            case ECamViewIdPhotoUserSceneSetup:
-            case ECamViewIdStillPreCapture:
-                {
-                mode = ECamControllerImage;
-                }
-                break;
-            case ECamViewIdVideoPreCapture:
-                {
-                mode = ECamControllerVideo;
-                }
-                break;
-            default:
-                {
-                //Assume imagemode if view cannot be determined.
-                if(mode==ECamControllerIdle)
-                    {
-                    mode = ECamControllerImage;                
-                    }
-                }
-                break;
-            }
-        }
-    //Don't reserve camera and start viewfinder if shutting down.
-    if(mode!=ECamControllerShutdown)
-        {
-        iController.EnterViewfinderMode( mode );
-        iController.StartIdleTimer();
-        }
-    PRINT ( _L("Camera <= CCamCaptureSetupContainer::ReserveAndStartVF") );        
-    }
 // </CAMERAAPP_CAPI_V2_MIGRATION>
 
 // End of File