camerauis/cameraapp/generic/src/CamAppui.cpp
branchRCL_3
changeset 16 53c8aa5d97a3
parent 15 bf64cebf4673
child 17 8f559c47d7fd
equal deleted inserted replaced
15:bf64cebf4673 16:53c8aa5d97a3
   133 // This is used to find the window group id for Eikon Server.
   133 // This is used to find the window group id for Eikon Server.
   134 // The Eikon Server window group id is later used to ignore all window server
   134 // The Eikon Server window group id is later used to ignore all window server
   135 // events saying Eikon Server has gained focus.
   135 // events saying Eikon Server has gained focus.
   136 _LIT( KEikonServer, "EikonServer" );
   136 _LIT( KEikonServer, "EikonServer" );
   137 
   137 
       
   138 _LIT8(K3gpVideoMimeType, "video/3gpp");
       
   139 _LIT8(KMp4VideoMimeType, "video/mp4");
       
   140 
   138 //const TCamMediaStorage KCamInternalStorage = ECamMediaStoragePhone;
   141 //const TCamMediaStorage KCamInternalStorage = ECamMediaStoragePhone;
   139 
   142 
   140 const TUint KCameraEventInterest = ( ECamCameraEventClassBasicControl
   143 const TUint KCameraEventInterest = ( ECamCameraEventClassBasicControl
   141                                    | ECamCameraEventClassImage
   144                                    | ECamCameraEventClassImage
   142                                    | ECamCameraEventClassVideo
   145                                    | ECamCameraEventClassVideo
  1697       {
  1700       {
  1698       PRINT1(_L("Camera <=> CCamAppUi::HandleCommandL. case ECamCmdPlay, iVideoClipPlayInProgress:%d"), iVideoClipPlayInProgress);
  1701       PRINT1(_L("Camera <=> CCamAppUi::HandleCommandL. case ECamCmdPlay, iVideoClipPlayInProgress:%d"), iVideoClipPlayInProgress);
  1699       
  1702       
  1700       if ( !iVideoClipPlayInProgress)
  1703       if ( !iVideoClipPlayInProgress)
  1701         {
  1704         {
  1702         TDataType dataType;
       
  1703         TInt           err;
  1705         TInt           err;
  1704          
  1706         TDataType dataType( K3gpVideoMimeType );
       
  1707 #ifndef __WINS__
       
  1708         TCamVideoFileType fileType = static_cast< TCamVideoFileType > 
       
  1709             ( iController.IntegerSettingValue( ECamSettingItemVideoFileType ) );
       
  1710         if ( fileType == ECamVideoMpeg4 )
       
  1711             {
       
  1712             PRINT(_L("Camera <> CCamAppUi::HandleCommandL. case ECamCmdPlay D"));
       
  1713             dataType=TDataType( KMp4VideoMimeType );
       
  1714             }
       
  1715 #endif                
       
  1716 
  1705         SetEmbedding( ETrue );
  1717         SetEmbedding( ETrue );
  1706         
  1718         
  1707         err = iDocHandler->OpenFileEmbeddedL( iController.CurrentFullFileName(),  dataType );
  1719         err = iDocHandler->OpenFileEmbeddedL( iController.CurrentFullFileName(),  dataType );
  1708         PRINT1(_L("Camera <=> CCamAppUi::HandleCommandL. iDocHandler ->OpenFileEmbeddedL err:%d"), err);
  1720         PRINT1(_L("Camera <=> CCamAppUi::HandleCommandL. iDocHandler ->OpenFileEmbeddedL err:%d"), err);
  1709         
  1721         
  2012           }
  2024           }
  2013       else
  2025       else
  2014           {
  2026           {
  2015           //load settings in case they were changed via GS	
  2027           //load settings in case they were changed via GS	
  2016           iController.LoadStaticSettingsL( IsEmbedded() );
  2028           iController.LoadStaticSettingsL( IsEmbedded() );
  2017           iStillCaptureView->UpdateToolbarIconsL(); 
  2029           if ( iController.CurrentMode() == ECamControllerImage 
       
  2030                   || iController.TargetMode() == ECamControllerImage )
       
  2031               {
       
  2032               iStillCaptureView->UpdateToolbarIconsL();
       
  2033               }
       
  2034      
  2018           // and check the availability of the memory to be used
  2035           // and check the availability of the memory to be used
  2019           iController.CheckMemoryToUseL();
  2036           iController.CheckMemoryToUseL();
  2020           }    
  2037           }    
  2021       break;  
  2038       break;  
  2022       }
  2039       }
  2825   TInt type = aEvent.Type();
  2842   TInt type = aEvent.Type();
  2826   
  2843   
  2827   PRINT1( _L("Camera => CCamAppUi::HandleWsEventL (type: %d)"), type )
  2844   PRINT1( _L("Camera => CCamAppUi::HandleWsEventL (type: %d)"), type )
  2828   // In case we receive an enter key event, we should map it to MSK
  2845   // In case we receive an enter key event, we should map it to MSK
  2829   if ( aEvent.Type() == EEventKey && aEvent.Key()->iRepeats == 0 && 
  2846   if ( aEvent.Type() == EEventKey && aEvent.Key()->iRepeats == 0 && 
  2830        aEvent.Key()->iScanCode == EStdKeyEnter &&
  2847        aEvent.Key()->iScanCode == EStdKeyEnter && iViewState != ECamViewStateUserSceneSetup &&
  2831        !( iMode == ECamControllerVideo && iViewState == ECamViewStatePreCapture && iController.IsDemandKeyRelease() ) ) 
  2848        !( iMode == ECamControllerVideo && iViewState == ECamViewStatePreCapture && iController.IsDemandKeyRelease() ) ) 
  2832     {
  2849     {
  2833     PRINT( _L("Camera <> CCamAppUi::HandleWsEventL: mapping enter to MSK") );
  2850     PRINT( _L("Camera <> CCamAppUi::HandleWsEventL: mapping enter to MSK") );
  2834     // Gets the window group id of the app in foreground
  2851     // Gets the window group id of the app in foreground
  2835     TInt windowGroupId = iCoeEnv->WsSession().GetFocusWindowGroup();
  2852     TInt windowGroupId = iCoeEnv->WsSession().GetFocusWindowGroup();
  3374               }
  3391               }
  3375           
  3392           
  3376           //We hiden toolbar when keylock was set to on in pre-capture view and camera lost focus, 
  3393           //We hiden toolbar when keylock was set to on in pre-capture view and camera lost focus, 
  3377           //so we need to display toolbar when keylock is set to off and camera gain focus again.
  3394           //so we need to display toolbar when keylock is set to off and camera gain focus again.
  3378           if ( ECamViewStatePreCapture == iViewState &&
  3395           if ( ECamViewStatePreCapture == iViewState &&
  3379                ECamPreCapViewfinder == iPreCaptureMode )  
  3396                ECamPreCapViewfinder == iPreCaptureMode && 
       
  3397                iController.CurrentOperation() != ECamCapturing )  
  3380             {
  3398             {
  3381             SetToolbarVisibility(); 
  3399             SetToolbarVisibility(); 
  3382             }          
  3400             }          
  3383           
  3401           
  3384           // If keylock is set on when recording is starting up but not yet 
  3402           // If keylock is set on when recording is starting up but not yet 
  6324     iController.EmbeddedStartupSequence();
  6342     iController.EmbeddedStartupSequence();
  6325 
  6343 
  6326     PRINT( _L("Camera <= CCamAppUi::StartAsServerAppL") );
  6344     PRINT( _L("Camera <= CCamAppUi::StartAsServerAppL") );
  6327     }
  6345     }
  6328            
  6346            
       
  6347 // ---------------------------------------------------------
       
  6348 // CCamAppUi::SetEmbeddedObserver
       
  6349 // ---------------------------------------------------------
       
  6350 //
       
  6351 void CCamAppUi::SetEmbeddedObserver( MCamEmbeddedObserver* aEmbeddedObserver )
       
  6352     {       
       
  6353     PRINT1( _L("Camera <> CCamAppUi::SetEmbeddedObserver %x"), aEmbeddedObserver );  
       
  6354     iEmbeddedObserver = aEmbeddedObserver;
       
  6355     }
       
  6356 
       
  6357 
  6329 
  6358 
  6330 // ---------------------------------------------------------------------------
  6359 // ---------------------------------------------------------------------------
  6331 // CCamAppUi::CamOrientation
  6360 // CCamAppUi::CamOrientation
  6332 // Returns the current orientation of the app
  6361 // Returns the current orientation of the app
  6333 // ---------------------------------------------------------------------------
  6362 // ---------------------------------------------------------------------------
  8371     {
  8400     {
  8372     PRINT1( _L("Camera => CCamAppUi::IsToolBarVisible %d" ), iToolbarVisibility )
  8401     PRINT1( _L("Camera => CCamAppUi::IsToolBarVisible %d" ), iToolbarVisibility )
  8373     return iToolbarVisibility;
  8402     return iToolbarVisibility;
  8374     }
  8403     }
  8375 
  8404 
       
  8405 // -----------------------------------------------------------------------------
       
  8406 // CCamAppUi::IsToolBarExtensionVisible
       
  8407 // Returns ETrue if the toolbar extension is visible,
       
  8408 // otherwise EFalse.
       
  8409 // -----------------------------------------------------------------------------
       
  8410 //
       
  8411 TBool CCamAppUi::IsToolBarExtensionVisible() const
       
  8412     {
       
  8413     if ( iController.IsTouchScreenSupported() )
       
  8414         {
       
  8415         CAknToolbar* toolbar = CurrentFixedToolbar();
       
  8416         if ( toolbar )
       
  8417             {
       
  8418             CAknToolbarExtension* toolbarextension =
       
  8419                 toolbar->ToolbarExtension();
       
  8420             if ( toolbarextension && toolbarextension->IsShown() )
       
  8421                 {
       
  8422                 PRINT( _L("Camera <> CCamAppUi::IsToolBarExtensionVisible ETrue" ) )
       
  8423                 return ETrue;
       
  8424                 }
       
  8425             }
       
  8426         }
       
  8427     PRINT( _L("Camera <> CCamAppUi::IsToolBarExtensionVisible EFalse" ) )
       
  8428     return EFalse;
       
  8429     }
  8376 
  8430 
  8377 // -----------------------------------------------------------------------------
  8431 // -----------------------------------------------------------------------------
  8378 // CCamAppUi::SetAssumePostCaptureView
  8432 // CCamAppUi::SetAssumePostCaptureView
  8379 // Sets iAssumePostCapture flag according to aValue
  8433 // Sets iAssumePostCapture flag according to aValue
  8380 // -----------------------------------------------------------------------------
  8434 // -----------------------------------------------------------------------------