camerauis/cameraapp/generic/src/CamPreCaptureViewBase.cpp
branchRCL_3
changeset 11 792dfc98fb3b
parent 7 dbec5787fa68
child 12 8c55c525d5d7
equal deleted inserted replaced
7:dbec5787fa68 11:792dfc98fb3b
    73 // -----------------------------------------------------------------------------
    73 // -----------------------------------------------------------------------------
    74 //
    74 //
    75 void CCamPreCaptureViewBase::HandleCommandL( TInt aCommand )
    75 void CCamPreCaptureViewBase::HandleCommandL( TInt aCommand )
    76     {
    76     {
    77     PRINT( _L("Camera => CCamPreCaptureViewBase::HandleCommandL") );
    77     PRINT( _L("Camera => CCamPreCaptureViewBase::HandleCommandL") );
    78                   
    78 
       
    79     iLastMovement = 0;
    79     switch ( aCommand )
    80     switch ( aCommand )
    80         {              
    81         {              
    81         case ECamCmdShootSetup:
    82         case ECamCmdShootSetup:
    82             {
    83             {
    83             CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( AppUi() );
    84             CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( AppUi() );
   256 //
   257 //
   257 void CCamPreCaptureViewBase::HandleForegroundEventL( TBool aForeground )
   258 void CCamPreCaptureViewBase::HandleForegroundEventL( TBool aForeground )
   258   {
   259   {
   259   PRINT1( _L( "Camera => CCamPreCaptureViewBase::HandleForegroundEventL %d" ), aForeground );    
   260   PRINT1( _L( "Camera => CCamPreCaptureViewBase::HandleForegroundEventL %d" ), aForeground );    
   260 
   261 
       
   262   iLastMovement = 0;
   261   CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() );                
   263   CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() );                
   262   __ASSERT_DEBUG(appUi, CamPanic(ECamPanicNullPointer));
   264   __ASSERT_DEBUG(appUi, CamPanic(ECamPanicNullPointer));
   263 
   265 
   264   // -----------------------------------------------------
   266   // -----------------------------------------------------
   265   // coming to the foreground
   267   // coming to the foreground
   587                                           const TDesC8& aCustomMessage )                                                                                    
   589                                           const TDesC8& aCustomMessage )                                                                                    
   588     {
   590     {
   589     OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMPRECAPTUREVIEWBASE_DOACTIVATEL, "e_CCamPreCaptureViewBase_DoActivateL 1" );
   591     OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMPRECAPTUREVIEWBASE_DOACTIVATEL, "e_CCamPreCaptureViewBase_DoActivateL 1" );
   590     PRINT( _L( "Camera => CCamPreCaptureViewBase::DoActivateL" ) );
   592     PRINT( _L( "Camera => CCamPreCaptureViewBase::DoActivateL" ) );
   591     iAssumePostCaptureView = EFalse;
   593     iAssumePostCaptureView = EFalse;
       
   594     iLastMovement = 0;
   592 
   595 
   593     ShowToolbarOnViewActivation( EFalse );
   596     ShowToolbarOnViewActivation( EFalse );
   594     /*if ( iController.UiConfigManagerPtr() && 
   597     /*if ( iController.UiConfigManagerPtr() && 
   595          iController.UiConfigManagerPtr()->IsLocationSupported() )
   598          iController.UiConfigManagerPtr()->IsLocationSupported() )
   596         {
   599         {
  1366         }
  1369         }
  1367     else
  1370     else
  1368         {    
  1371         {    
  1369         appUi->RaisePreCaptureCourtesyUI(ETrue);
  1372         appUi->RaisePreCaptureCourtesyUI(ETrue);
  1370         }
  1373         }
  1371     
       
  1372     if ( iController.UiConfigManagerPtr() && 
       
  1373                 iController.UiConfigManagerPtr()->IsLocationSupported() )
       
  1374 	   {
       
  1375 	   if( ECamLocationOn == iController.IntegerSettingValue( ECamSettingItemRecLocation ) )
       
  1376 		   {
       
  1377 		   if( ECamActiveCameraPrimary == iController.ActiveCamera() )
       
  1378 			   {
       
  1379 			   PRINT( _L("Camera: CCamPreCaptureViewBase::ExitStandbyModeL - primary camera, start location/gps") )
       
  1380 			   iController.StartLocationTrailL();
       
  1381 			   }
       
  1382 		   }
       
  1383 	   }
       
  1384     PRINT( _L("Camera <= CCamPreCaptureViewBase::ExitStandbyModeL" ) )
  1374     PRINT( _L("Camera <= CCamPreCaptureViewBase::ExitStandbyModeL" ) )
  1385     }
  1375     }
  1386 
  1376 
  1387 // ---------------------------------------------------------------------------
  1377 // ---------------------------------------------------------------------------
  1388 // CCamPreCaptureViewBase::IsOkOptionsMenuAllowed
  1378 // CCamPreCaptureViewBase::IsOkOptionsMenuAllowed
  1594 //
  1584 //
  1595 void 
  1585 void 
  1596 CCamPreCaptureViewBase::HandleAppEvent( const TCamAppEvent& aEvent )
  1586 CCamPreCaptureViewBase::HandleAppEvent( const TCamAppEvent& aEvent )
  1597     {
  1587     {
  1598     PRINT1( _L("Camera => CCamPreCaptureViewBase::HandleAppEvent, event:%d"), aEvent );
  1588     PRINT1( _L("Camera => CCamPreCaptureViewBase::HandleAppEvent, event:%d"), aEvent );
       
  1589     // Reset last pinch movement direction
       
  1590     iLastMovement = 0;
  1599     CCamViewBase::HandleAppEvent( aEvent );
  1591     CCamViewBase::HandleAppEvent( aEvent );
  1600 
  1592 
  1601     if ( aEvent == ECamAppEventFocusGained && iController.InVideocallOrRinging() )
  1593     if ( aEvent == ECamAppEventFocusGained && iController.InVideocallOrRinging() )
  1602         {
  1594         {
  1603         TRAP_IGNORE( BlankSoftkeysL() );
  1595         TRAP_IGNORE( BlankSoftkeysL() );
  1755 //
  1747 //
  1756 void CCamPreCaptureViewBase::RedrawToolBar()
  1748 void CCamPreCaptureViewBase::RedrawToolBar()
  1757 	{
  1749 	{
  1758 	CEikonEnv::Static()->WsSession().ClearAllRedrawStores();
  1750 	CEikonEnv::Static()->WsSession().ClearAllRedrawStores();
  1759 	}
  1751 	}
       
  1752 
       
  1753 // ---------------------------------------------------------------------------
       
  1754 // CCamPreCaptureViewBase::CreateContainerL
       
  1755 //
       
  1756 // ---------------------------------------------------------------------------
       
  1757 //
       
  1758 void CCamPreCaptureViewBase::CreateContainerL()
       
  1759     {
       
  1760     PRINT( _L("Camera => CCamPreCaptureViewBase::CreateContainerL") );
       
  1761 
       
  1762     // Create gesture fw object, set observer and gesture interest
       
  1763     iGestureFw = CAknTouchGestureFw::NewL( *this, *iContainer );
       
  1764     iGestureFw->SetGestureInterestL( EAknTouchGestureFwGroupPinch );
       
  1765 
       
  1766     PRINT( _L("Camera <= CCamPreCaptureViewBase::CreateContainerL") );            
       
  1767     }
       
  1768 
       
  1769 // ---------------------------------------------------------------------------
       
  1770 // CCamPreCaptureViewBase::HandleTouchGestureL
       
  1771 //
       
  1772 // ---------------------------------------------------------------------------
       
  1773 //
       
  1774 void CCamPreCaptureViewBase::HandleTouchGestureL( MAknTouchGestureFwEvent& aEvent )
       
  1775     {
       
  1776     PRINT( _L("Camera => CCamPreCaptureViewBase::HandleTouchGestureL") );
       
  1777     
       
  1778     // Skipped modes here
       
  1779     if ( iController.ActiveCamera() == ECamActiveCameraSecondary )
       
  1780         {
       
  1781         PRINT( _L("Camera <= CCamPreCaptureViewBase::HandleTouchGestureL") );
       
  1782         return;
       
  1783         }
       
  1784 
       
  1785     MAknTouchGestureFwPinchEvent *pinch = AknTouchGestureFwEventPinch( aEvent );
       
  1786     if ( pinch )
       
  1787         {
       
  1788         // Determine the direction of pinch: +ve -> pinch outward / zoom / widen VF
       
  1789         TInt currMove = pinch->Movement();
       
  1790         TBool wide = (currMove > 0) ? ETrue : EFalse;  
       
  1791         PRINT1( _L("Camera <> CCamPreCaptureViewBase::HandleTouchGestureL - pinch, movement:%d"), currMove );
       
  1792 
       
  1793         if ( ( iLastMovement >= 0 && currMove < 0 ) || 
       
  1794              ( iLastMovement <= 0 && currMove > 0 ) )
       
  1795             {
       
  1796             // Enable the blinking for resolution indicators and toggle image/video quality
       
  1797             // level between top widescreen and vga levels
       
  1798             CCamPreCaptureContainerBase* container = static_cast<CCamPreCaptureContainerBase*>( iContainer );
       
  1799             container->BlinkResolutionIndicatorOnChange( ETrue );
       
  1800             if ( iController.ToggleWideScreenQuality( wide ) )
       
  1801                 {
       
  1802                 iLastMovement = currMove;
       
  1803                 }
       
  1804             else
       
  1805                 {
       
  1806                 // if the quality level wasn't changed, then disable the blinking
       
  1807                 container->BlinkResolutionIndicatorOnChange( EFalse );
       
  1808                 }
       
  1809             }
       
  1810         }
       
  1811 
       
  1812     PRINT( _L("Camera <= CCamPreCaptureViewBase::HandleTouchGestureL") );
       
  1813     }
       
  1814 
  1760 //  End of File  
  1815 //  End of File