vtuis/videotelui/src/CVtUiAppUi.cpp
branchRCL_3
changeset 11 50bbdc59f9c4
parent 10 f84a661cfc1d
child 12 3e521e99f813
equal deleted inserted replaced
10:f84a661cfc1d 11:50bbdc59f9c4
   834     {
   834     {
   835     VTLOGINIT
   835     VTLOGINIT
   836     __VTPRINTENTER( "VtUi.ConstructL" )
   836     __VTPRINTENTER( "VtUi.ConstructL" )
   837 
   837 
   838     FeatureManager::InitializeLibL();
   838     FeatureManager::InitializeLibL();
   839     BaseConstructL( EAknEnableSkin | EAknEnableMSK );
   839     BaseConstructL( EAknEnableSkin | EAknEnableMSK | EAknSingleClickCompatible );
   840     
   840     
   841     iIsLandScapeOrientation = VtUiLayout::IsLandscapeOrientation();
       
   842 
       
   843     iCba = Cba();
   841     iCba = Cba();
   844     // Must be done before creating features
   842     // Must be done before creating features
   845     iVTVariation.ReadL();
   843     iVTVariation.ReadL();
   846 
   844 
   847     iEventObserver = CEventObserver::NewL( *this );
   845     iEventObserver = CEventObserver::NewL( *this );
  1029         {
  1027         {
  1030         if ( isStatusPaneFlat && VtUiLayout::IsLandscapeOrientation() )
  1028         if ( isStatusPaneFlat && VtUiLayout::IsLandscapeOrientation() )
  1031             {
  1029             {
  1032             __VTPRINT( DEBUG_GEN,
  1030             __VTPRINT( DEBUG_GEN,
  1033                 "VtUi.SwitchLayoutToFlatStatusPaneL LAYOUT USUAL" );
  1031                 "VtUi.SwitchLayoutToFlatStatusPaneL LAYOUT USUAL" );
  1034             NaviPaneL()->Pop();
  1032 //            NaviPaneL()->Pop();
  1035             statusPane->SwitchLayoutL( idleResId );
  1033             statusPane->SwitchLayoutL( idleResId );
  1036             }
  1034             }
  1037         else if ( !isStatusPaneFlat && !VtUiLayout::IsLandscapeOrientation() )
  1035         else if ( !isStatusPaneFlat && !VtUiLayout::IsLandscapeOrientation() )
  1038             {
  1036             {
  1039             __VTPRINT( DEBUG_GEN,
  1037             __VTPRINT( DEBUG_GEN,
  1040                 "VtUi.SwitchLayoutToFlatStatusPaneL USUAL FLAT" );
  1038                 "VtUi.SwitchLayoutToFlatStatusPaneL USUAL FLAT" );
  1041             NaviPaneL()->PushDefaultL();
  1039 //            NaviPaneL()->PushDefaultL();
  1042             statusPane->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT );
  1040             statusPane->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT );
  1043             }
  1041             }
  1044         }
  1042         }
  1045     else
  1043     else
  1046         {
  1044         {
  1047         if ( isStatusPaneFlat )
  1045         if ( isStatusPaneFlat )
  1048             {
  1046             {
  1049             __VTPRINT( DEBUG_GEN,
  1047             __VTPRINT( DEBUG_GEN,
  1050                 "VtUi.SwitchLayoutToFlatStatusPaneL LAYOUT IDLE" );
  1048                 "VtUi.SwitchLayoutToFlatStatusPaneL LAYOUT IDLE" );
  1051             NaviPaneL()->Pop();
  1049 //            NaviPaneL()->Pop();
  1052             statusPane->SwitchLayoutL( idleResId );
  1050             statusPane->SwitchLayoutL( idleResId );
  1053             }
  1051             }
  1054         }
  1052         }
  1055     // ApplyCurrentSettingsL is called whenever statuspane
  1053     // ApplyCurrentSettingsL is called whenever statuspane
  1056     // visibility status or pane layout changes.
  1054     // visibility status or pane layout changes.
  3655             synch = ETrue;
  3653             synch = ETrue;
  3656             }
  3654             }
  3657             break;
  3655             break;
  3658 
  3656 
  3659         case EVtUiAppUiAnsweredQuerySetupStill:
  3657         case EVtUiAppUiAnsweredQuerySetupStill:
  3660             {
  3658             ActiveExecInitSetSourceL( MVtEngMedia::EMediaStillImage, aRequest );
  3661             if ( iIsLandScapeOrientation == VtUiLayout::IsLandscapeOrientation() )
       
  3662                 {
       
  3663                 ActiveExecInitSetSourceL( MVtEngMedia::EMediaStillImage, aRequest );
       
  3664                 }
       
  3665             aNextState = EVtUiAppUiAnsweredQuerySetupStart;
  3659             aNextState = EVtUiAppUiAnsweredQuerySetupStart;
  3666             }
       
  3667             break;
  3660             break;
  3668 
  3661 
  3669         case EVtUiAppUiAnsweredQuerySetupNone:
  3662         case EVtUiAppUiAnsweredQuerySetupNone:
  3670             {
  3663             ActiveExecInitSetSourceL( MVtEngMedia::EMediaNone, aRequest );
  3671             if ( iIsLandScapeOrientation == VtUiLayout::IsLandscapeOrientation() )
       
  3672                 {
       
  3673                 ActiveExecInitSetSourceL( MVtEngMedia::EMediaNone, aRequest );
       
  3674                 }
       
  3675             aNextState = EVtUiAppUiAnsweredQuerySetupStart;
  3664             aNextState = EVtUiAppUiAnsweredQuerySetupStart;
  3676             }
       
  3677             break;
  3665             break;
  3678 
  3666 
  3679         case EVtUiAppUiAnsweredQuerySetupStart:
  3667         case EVtUiAppUiAnsweredQuerySetupStart:
  3680             ActiveExecInitExecuteCommandL( KVtEngStartViewFinder, aRequest );
  3668             ActiveExecInitExecuteCommandL( KVtEngStartViewFinder, aRequest );
  3681             aNextState = EVtUiAppUiAnsweredQueryShow;
  3669             aNextState = EVtUiAppUiAnsweredQueryShow;
  3819         case EVtUiAppUiAnsweredFinish:
  3807         case EVtUiAppUiAnsweredFinish:
  3820             RefreshL();
  3808             RefreshL();
  3821             if ( iUiStates->IsExecShowCameraInUse() )
  3809             if ( iUiStates->IsExecShowCameraInUse() )
  3822                 {
  3810                 {
  3823                 ShowCameraInUseNoteL();
  3811                 ShowCameraInUseNoteL();
  3824                 }
       
  3825 
       
  3826             if ( iIsLandScapeOrientation != VtUiLayout::IsLandscapeOrientation() )
       
  3827                 {
       
  3828                 (void) HandleLayoutChanged();
       
  3829                 }
  3812                 }
  3830             
  3813             
  3831             if ( aState != EVtUiAppUiAnsweredQueryFinish )
  3814             if ( aState != EVtUiAppUiAnsweredQueryFinish )
  3832                 {
  3815                 {
  3833                 ChangeApplicationFocus( ETrue );
  3816                 ChangeApplicationFocus( ETrue );
  6292     now.HomeTime();
  6275     now.HomeTime();
  6293     // User can swap image places if the frequency is lower than maximum frequency. 
  6276     // User can swap image places if the frequency is lower than maximum frequency. 
  6294     if ( now.MicroSecondsFrom( iLastSwapTime ).Int64() >= KVtUiMaxSwapImagesFreq ) 
  6277     if ( now.MicroSecondsFrom( iLastSwapTime ).Int64() >= KVtUiMaxSwapImagesFreq ) 
  6295         {
  6278         {
  6296         __VTPRINT( DEBUG_GEN, "VtUi.Swap can swap image" )
  6279         __VTPRINT( DEBUG_GEN, "VtUi.Swap can swap image" )
  6297         iLastSwapTime = now;  
  6280         iLastSwapTime = now;
       
  6281         __VTPRINTEXIT( "VtUi.CanSwapImagePlaces" )
  6298         return ETrue;
  6282         return ETrue;
  6299         }
  6283         }
  6300     else
  6284     else
  6301         {
  6285         {
  6302         __VTPRINT( DEBUG_GEN, "VtUi.Swap can not swap image" )
  6286         __VTPRINT( DEBUG_GEN, "VtUi.Swap can not swap image" )
       
  6287         __VTPRINTEXIT( "VtUi.CanSwapImagePlaces" )
  6303         return EFalse;
  6288         return EFalse;
  6304         }
  6289         }
  6305     __VTPRINTEXIT( "VtUi.CanSwapImagePlaces" )
       
  6306     }
  6290     }
  6307 
  6291 
  6308 // Implementation of CVtUiAppUi::CInstance
  6292 // Implementation of CVtUiAppUi::CInstance
  6309 
  6293 
  6310 // -----------------------------------------------------------------------------
  6294 // -----------------------------------------------------------------------------
  6340     TRect parent;
  6324     TRect parent;
  6341     TAknWindowLineLayout control;
  6325     TAknWindowLineLayout control;
  6342 
  6326 
  6343     VtUiLayout::GetApplicationParentRect( parent );
  6327     VtUiLayout::GetApplicationParentRect( parent );
  6344     iMainControl = CVtUiMainControl::NewL( *iBitmapManager,
  6328     iMainControl = CVtUiMainControl::NewL( *iBitmapManager,
  6345          *iAppUi.iUiStates  );
  6329             iAppUi,
       
  6330             *iAppUi.iUiStates  );
  6346 
  6331 
  6347     VtUiLayout::GetMainPaneLayout( control );
  6332     VtUiLayout::GetMainPaneLayout( control );
  6348     AknLayoutUtils::LayoutControl( iMainControl, parent, control );
  6333     AknLayoutUtils::LayoutControl( iMainControl, parent, control );
  6349 
  6334 
  6350     iAppUi.AddToStackL( iMainControl );
  6335     iAppUi.AddToStackL( iMainControl );