vtuis/videotelui/src/CVtUiAppUi.cpp
branchRCL_3
changeset 49 8e703580edd3
parent 40 7fb4a99d4b6b
equal deleted inserted replaced
40:7fb4a99d4b6b 49:8e703580edd3
  1006     REComSession::FinalClose();
  1006     REComSession::FinalClose();
  1007 
  1007 
  1008     FeatureManager::UnInitializeLib();
  1008     FeatureManager::UnInitializeLib();
  1009     __VTPRINTEXIT( "VtUi.~" )
  1009     __VTPRINTEXIT( "VtUi.~" )
  1010     VTLOGUNINIT
  1010     VTLOGUNINIT
  1011     
       
  1012 	// Directly exit with all allocated resources cleaned
       
  1013     User::Exit( EEikCmdExit );
       
  1014     }
  1011     }
  1015 
  1012 
  1016 // -----------------------------------------------------------
  1013 // -----------------------------------------------------------
  1017 // CVtUiAppUi::SwitchLayoutToFlatStatusPaneL
  1014 // CVtUiAppUi::SwitchLayoutToFlatStatusPaneL
  1018 // -----------------------------------------------------------
  1015 // -----------------------------------------------------------
  5066         }
  5063         }
  5067     // Fully update rendering parameters
  5064     // Fully update rendering parameters
  5068     UpdateRenderingParametersL();
  5065     UpdateRenderingParametersL();
  5069     // Notify engine about layout change
  5066     // Notify engine about layout change
  5070     iLayoutChg = ETrue;
  5067     iLayoutChg = ETrue;
  5071     if( iDisableVideoOngoing || iShareImageOngoing )
  5068     if( iDisableVideoOngoing )
  5072         {
  5069         {
  5073         error = KErrNotReady;
  5070         error = KErrNotReady;
  5074         }
  5071         }
  5075     else
  5072     else
  5076         {
  5073         {
  5101                 pendingCommand  == KVtEngSetAudioRouting ||
  5098                 pendingCommand  == KVtEngSetAudioRouting ||
  5102                 pendingCommand  == KVtEngSetAudioVolume ||
  5099                 pendingCommand  == KVtEngSetAudioVolume ||
  5103                 pendingCommand  == KVtEngSetSource ||
  5100                 pendingCommand  == KVtEngSetSource ||
  5104                 pendingCommand  == KVtEngPrepareCamera ||
  5101                 pendingCommand  == KVtEngPrepareCamera ||
  5105                 pendingCommand  == KVtEngUnfreeze ||
  5102                 pendingCommand  == KVtEngUnfreeze ||
  5106                 pendingCommand  == KVtEngStopShareImage ||
       
  5107                 invalidCommand  == KVtEngHandleLayoutChange )
  5103                 invalidCommand  == KVtEngHandleLayoutChange )
  5108             {
  5104             {
  5109             iPendingCmd = pendingCommand;
  5105             iPendingCmd = pendingCommand;
  5110             iUiStates->SetLayoutChangeNeeded( ETrue );
  5106             iUiStates->SetLayoutChangeNeeded( ETrue );
  5111             }
  5107             }
  5112         if( iDisableVideoOngoing && pendingCommand == KVtEngCommandNone )
  5108         if( iDisableVideoOngoing && pendingCommand == KVtEngCommandNone )
  5113             {
  5109             {
  5114             iPendingCmd = KVtEngSetSource;
  5110             iPendingCmd = KVtEngSetSource;
  5115             iUiStates->SetLayoutChangeNeeded( ETrue );
       
  5116             }
       
  5117         if( iShareImageOngoing && pendingCommand == KVtEngCommandNone )
       
  5118             {
       
  5119             iPendingCmd = KVtEngStartShareImage;
       
  5120             iUiStates->SetLayoutChangeNeeded( ETrue );
  5111             iUiStates->SetLayoutChangeNeeded( ETrue );
  5121             }
  5112             }
  5122         }
  5113         }
  5123     // Notify component manager
  5114     // Notify component manager
  5124     iComponentManager->HandleLayoutChangeL();
  5115     iComponentManager->HandleLayoutChangeL();
  7131         {
  7122         {
  7132         if ( iAppUi.iState &&
  7123         if ( iAppUi.iState &&
  7133              iAppUi.iState->HandleVTCommandPerformedL( aCommand, aError ) ==
  7124              iAppUi.iState->HandleVTCommandPerformedL( aCommand, aError ) ==
  7134              TVtUiAppStateBase::EEventHandled )
  7125              TVtUiAppStateBase::EEventHandled )
  7135             {
  7126             {
  7136             if( aCommand == KVtEngTerminateSession )//add for memory leak
       
  7137                 {
       
  7138                 const TInt count1 = iCommandObservers.Count();
       
  7139                 for ( TInt index = 0; index < count1; index++ )
       
  7140                     {
       
  7141                     MVtEngCommandObserver* obs = iCommandObservers[ index ];
       
  7142                     if ( obs )
       
  7143                         {
       
  7144                         TRAP_IGNORE( obs->HandleVTCommandPerformedL( aCommand, aError ) );
       
  7145                         }
       
  7146                     }
       
  7147                 }
       
  7148             // state didn't allow further processing of command completion
  7127             // state didn't allow further processing of command completion
  7149             __VTPRINTEXITR( "VtUiComms.HandleVTCommandPerformedL %d", 0 )
  7128             __VTPRINTEXITR( "VtUiComms.HandleVTCommandPerformedL %d", 0 )
  7150             return;
  7129             return;
  7151             }
  7130             }
  7152         }
  7131         }
  7196     else if ( ( aCommand == KVtEngInitializeShareImage ) ||
  7175     else if ( ( aCommand == KVtEngInitializeShareImage ) ||
  7197               ( aCommand == KVtEngStartShareImage ) )
  7176               ( aCommand == KVtEngStartShareImage ) )
  7198         {
  7177         {
  7199         __VTPRINT3( DEBUG_GEN,
  7178         __VTPRINT3( DEBUG_GEN,
  7200             "VtUi.HandleVTCommandPerformedL cmd=%d err=%d", aCommand, aError );
  7179             "VtUi.HandleVTCommandPerformedL cmd=%d err=%d", aCommand, aError );
  7201         
       
  7202         iAppUi.iShareImageOngoing = EFalse;
       
  7203         if( aError != KErrNone )
  7180         if( aError != KErrNone )
  7204             {
  7181             {
  7205             // stop toolbar feature to prevent drawing over error dialog
  7182             // stop toolbar feature to prevent drawing over error dialog
  7206            MVtUiFeature* tb = iAppUi.iFeatureManager->
  7183            MVtUiFeature* tb = iAppUi.iFeatureManager->
  7207            GetFeatureById( EVtUiFeatureIdToolbar );
  7184            GetFeatureById( EVtUiFeatureIdToolbar );
  7224                 {
  7201                 {
  7225                 iAppUi.iAsyncCallback->Set(
  7202                 iAppUi.iAsyncCallback->Set(
  7226                     TCallBack( &AsyncShare, &iAppUi ) );
  7203                     TCallBack( &AsyncShare, &iAppUi ) );
  7227                 }
  7204                 }
  7228             iAppUi.iAsyncCallback->CallBack();
  7205             iAppUi.iAsyncCallback->CallBack();
  7229             iAppUi.iShareImageOngoing = ETrue;
       
  7230             }
       
  7231         else if( iAppUi.iUiStates->IsLayoutChangeNeeded() && 
       
  7232                 aCommand == KVtEngStartShareImage && 
       
  7233                 aCommand == iAppUi.iPendingCmd )
       
  7234             {
       
  7235             iAppUi.iPendingCmd = KVtEngCommandNone;
       
  7236             iAppUi.iUiStates->SetLayoutChangeNeeded( EFalse );
       
  7237             iAppUi.DoHandleLayoutChangedL();
       
  7238             }
  7206             }
  7239         }
  7207         }
  7240     else if ( iAppUi.iUiStates->IsLayoutChangeNeeded() && 
  7208     else if ( iAppUi.iUiStates->IsLayoutChangeNeeded() && 
  7241             ( aCommand  == KVtEngSetSource ||
  7209             ( aCommand  == KVtEngSetSource ||
  7242             aCommand  == KVtEngPrepareCamera ||
  7210             aCommand  == KVtEngPrepareCamera ||
  7243             aCommand  == KVtEngStopShareImage ||
       
  7244             aCommand  == KVtEngUnfreeze ||
  7211             aCommand  == KVtEngUnfreeze ||
  7245             aCommand  == KVtEngHandleLayoutChange ) ||
  7212             aCommand  == KVtEngHandleLayoutChange ) ||
  7246             ( ( aCommand  == KVtEngMuteOutgoingAudio || 
  7213             ( ( aCommand  == KVtEngMuteOutgoingAudio || 
  7247               aCommand  == KVtEngUnmuteOutgoingAudio ||
  7214               aCommand  == KVtEngUnmuteOutgoingAudio ||
  7248               aCommand  == KVtEngSetAudioRouting ||
  7215               aCommand  == KVtEngSetAudioRouting ||