phoneapp/phoneuistates/src/cphonesinglecall.cpp
branchRCL_3
changeset 24 41a7f70b3818
parent 23 40a3f856b14d
child 25 5266b1f337bd
equal deleted inserted replaced
23:40a3f856b14d 24:41a7f70b3818
    25 #include <mpeengineinfo.h>
    25 #include <mpeengineinfo.h>
    26 #include <cpephonemodelif.h>
    26 #include <cpephonemodelif.h>
    27 #include <connect/sbdefs.h>
    27 #include <connect/sbdefs.h>
    28 #include <videotelcontrolmediatorapi.h>
    28 #include <videotelcontrolmediatorapi.h>
    29 #include <MediatorDomainUIDs.h>
    29 #include <MediatorDomainUIDs.h>
    30 #include <ScreensaverInternalPSKeys.h>
    30 #include <telephonyvariant.hrh>
    31 
    31 
    32 #include "cphonesinglecall.h"
    32 #include "cphonesinglecall.h"
    33 #include "tphonecmdparamstring.h"
    33 #include "tphonecmdparamstring.h"
    34 #include "tphonecmdparamboolean.h"
    34 #include "tphonecmdparamboolean.h"
    35 #include "tphonecmdparamcallheaderdata.h"
    35 #include "tphonecmdparamcallheaderdata.h"
    45 #include "phonelogger.h"
    45 #include "phonelogger.h"
    46 #include "cphonepubsubproxy.h"
    46 #include "cphonepubsubproxy.h"
    47 #include "cphonemediatorfactory.h"
    47 #include "cphonemediatorfactory.h"
    48 #include "cphonemediatorsender.h"
    48 #include "cphonemediatorsender.h"
    49 #include "cphoneswitchtovideoorvoicecommand.h"
    49 #include "cphoneswitchtovideoorvoicecommand.h"
       
    50 #include "mphonestorage.h"
       
    51 #include "cphonecenrepproxy.h"
    50 
    52 
    51 // ================= MEMBER FUNCTIONS =======================
    53 // ================= MEMBER FUNCTIONS =======================
    52 
    54 
    53 // C++ default constructor can NOT contain any code, that
    55 // C++ default constructor can NOT contain any code, that
    54 // might leave.
    56 // might leave.
   112             }
   114             }
   113         }
   115         }
   114 
   116 
   115     iCallId = callStateData.CallId();
   117     iCallId = callStateData.CallId();
   116     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
   118     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
   117 
   119       
   118     CPhonePubSubProxy::Instance()->ChangePropertyValue(
       
   119                     KPSUidScreenSaver,
       
   120                     KScreenSaverAllowScreenSaver,
       
   121                     EPhoneScreensaverAllowed );
       
   122     
       
   123     // Update phone number availability for menu use
       
   124     PhoneNumberAvailableInPhoneEngineL( callStateData.CallId() );
       
   125     }
   120     }
   126 
   121 
   127 // -----------------------------------------------------------
   122 // -----------------------------------------------------------
   128 // CPhoneSingleCall::NewL()
   123 // CPhoneSingleCall::NewL()
   129 // Constructor
   124 // Constructor
   226         case MEngineMonitor::EPEMessageIncoming:
   221         case MEngineMonitor::EPEMessageIncoming:
   227             HandleIncomingL( aCallId );
   222             HandleIncomingL( aCallId );
   228             break;
   223             break;
   229                 
   224                 
   230         case MEngineMonitor::EPEMessageDialing:
   225         case MEngineMonitor::EPEMessageDialing:
   231             HandleDialingL( aCallId );
   226             HandleDiallingL( aCallId );
   232             break;
   227             break;
   233         
   228         
   234         /* Flow through */ 
   229         /* Flow through */ 
   235         case MEngineMonitor::EPEMessageRemoteTerminated:  
   230         case MEngineMonitor::EPEMessageRemoteTerminated:  
   236         case MEngineMonitor::EPEMessageDisconnecting:
   231         case MEngineMonitor::EPEMessageDisconnecting:
   237             iViewCommandHandle->ExecuteCommandL( EPhoneViewHideNaviPaneAudioVolume );
   232             iViewCommandHandle->ExecuteCommandL( EPhoneViewHideNaviPaneAudioVolume );
   238             CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
   233             CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
   239             break;
   234             break;
   240         
   235         
   241         case MEngineMonitor::EPEMessageInValidEmergencyNumber:
   236         case MEngineMonitor::EPEMessageInValidEmergencyNumber:
   242             SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed );
   237             SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed, ETrue );
   243             break;
   238             break;
   244             
   239             
   245         case MEngineMonitor::EPEMessageValidEmergencyNumber:
   240         case MEngineMonitor::EPEMessageValidEmergencyNumber:
   246             DialVoiceCallL();
   241             DialVoiceCallL();
   247             break;
   242             break;
   268         case EPhoneInCallCmdUnhold:
   263         case EPhoneInCallCmdUnhold:
   269             ToggleHoldL();
   264             ToggleHoldL();
   270             break;
   265             break;
   271             
   266             
   272         case EPhoneInCallCmdNewCall:
   267         case EPhoneInCallCmdNewCall:
   273             LaunchNewCallQueryL();
       
   274             break;
   268             break;
   275             
   269             
   276         case EPhoneInCallCmdNewCallCall:
   270         case EPhoneInCallCmdNewCallCall:
   277             CallFromNewCallQueryL();
       
   278             break;
   271             break;
   279 
   272 
   280         case EPhoneInCallCmdSwitchToVideo:
   273         case EPhoneInCallCmdSwitchToVideo:
   281             SwitchToVideoL();
   274             SwitchToVideoL();
   282             break;
   275             break;
   293             break;
   286             break;
   294         
   287         
   295         /* Flow through */ 
   288         /* Flow through */ 
   296         case EPhoneCmdNoSwitchToVideo:
   289         case EPhoneCmdNoSwitchToVideo:
   297         case EPhoneCmdNoSwitchToVoice:
   290         case EPhoneCmdNoSwitchToVoice:
   298             // Sets touch buttons to correct status if 'No' command has occured.    
       
   299             iViewCommandHandle->ExecuteCommand( EPhoneResetTouchButtons );    
       
   300             break;        
   291             break;        
   301                 
   292                 
   302         case EPhoneCmdYesSwitchToVoice:
   293         case EPhoneCmdYesSwitchToVoice:
   303             // Set current call id
   294             // Set current call id
   304             iStateMachine->SetCallId( iCallId );
   295             iStateMachine->SetCallId( iCallId );
   305 						if( IsVideoCall( iCallId ) )
   296                         if( IsVideoCall( iCallId ) )
   306 						{
   297                         {
   307 						   // Video call can be released only after we get response to VT Shutdown Command
   298                            // Video call can be released only after we get response to VT Shutdown Command
   308 						   CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( KMediatorVideoTelephonyDomain,
   299                            CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( KMediatorVideoTelephonyDomain,
   309 						                                                              KCatPhoneToVideotelCommands, 
   300                                                                                       KCatPhoneToVideotelCommands, 
   310 						                                                              EVtCmdReleaseDataport,
   301                                                                                       EVtCmdReleaseDataport,
   311 						                                                              TVersion( KPhoneToVideotelCmdVersionMajor,
   302                                                                                       TVersion( KPhoneToVideotelCmdVersionMajor,
   312 						            	                                                    KPhoneToVideotelCmdVersionMinor, 
   303                                                                                             KPhoneToVideotelCmdVersionMinor, 
   313 						            	                                                    KPhoneToVideotelCmdVersionBuild ),
   304                                                                                             KPhoneToVideotelCmdVersionBuild ),
   314 						                                                              KNullDesC8,
   305                                                                                       KNullDesC8,
   315 						                                                              CPhoneSwitchToVideoOrVoiceCommand::NewL( *iStateMachine ) );
   306                                                                                       CPhoneSwitchToVideoOrVoiceCommand::NewL( *iStateMachine ) );
   316 						}
   307                         }
   317 						else
   308                         else
   318 						{
   309                         {
   319 						  iStateMachine->SendPhoneEngineMessage(
   310                           iStateMachine->SendPhoneEngineMessage(
   320 						      CPEPhoneModelIF::EPEMessageSwitchToVideoOrVoice );					
   311                               CPEPhoneModelIF::EPEMessageSwitchToVideoOrVoice );                    
   321 						}
   312                         }
   322             break;
   313             break;
   323 
   314 
   324         case EPhoneVideoSharing:
   315         case EPhoneVideoSharing:
   325         case EPhoneVideoSharingOpt2:
   316         case EPhoneVideoSharingOpt2:
   326         case EPhoneVideoSharingOpt3:
   317         case EPhoneVideoSharingOpt3:
   339 
   330 
   340     return commandStatus;
   331     return commandStatus;
   341     }
   332     }
   342 
   333 
   343 // -----------------------------------------------------------
   334 // -----------------------------------------------------------
   344 // CPhoneSingleCall::OpenMenuBarL
       
   345 // -----------------------------------------------------------
       
   346 //
       
   347 EXPORT_C void CPhoneSingleCall::OpenMenuBarL()
       
   348     {
       
   349     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleCall::OpenMenuBarL()");
       
   350 
       
   351     if ( IsVideoCall ( iCallId ))
       
   352         {
       
   353         OpenVideoCallMenuBarL();
       
   354         }
       
   355     else
       
   356         {
       
   357         CPhoneGsmInCall::OpenMenuBarL();            
       
   358         }
       
   359     }
       
   360 
       
   361 // -----------------------------------------------------------
       
   362 // CPhoneSingleCall::CallId
   335 // CPhoneSingleCall::CallId
   363 // -----------------------------------------------------------
   336 // -----------------------------------------------------------
   364 //
   337 //
   365 EXPORT_C TInt CPhoneSingleCall::CallId() const
   338 EXPORT_C TInt CPhoneSingleCall::CallId() const
   366     {
   339     {
   372 // -----------------------------------------------------------
   345 // -----------------------------------------------------------
   373 //
   346 //
   374 void CPhoneSingleCall::OpenVideoCallMenuBarL()
   347 void CPhoneSingleCall::OpenVideoCallMenuBarL()
   375     {
   348     {
   376     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleCall::OpenVideoCallMenuBarL()");
   349     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleCall::OpenVideoCallMenuBarL()");
   377     if( FeatureManager::FeatureSupported( KFeatureIdCsVideoTelephony ) )
   350                    
   378         {
       
   379         TInt resourceId;
       
   380 
       
   381         if ( IsNumberEntryUsedL() )
       
   382             {
       
   383             resourceId = EPhoneVideoCallMenubarWithNumberEntry;
       
   384             }
       
   385         else
       
   386             {
       
   387             resourceId = EPhoneVideoCallMenubar;
       
   388             }
       
   389         
       
   390         TPhoneCmdParamInteger integerParam;
       
   391         integerParam.SetInteger( 
       
   392             CPhoneMainResourceResolver::Instance()->
       
   393             ResolveResourceID( resourceId ) );
       
   394         iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, 
       
   395             &integerParam );
       
   396         }                    
       
   397     }
   351     }
   398     
   352     
   399 // -----------------------------------------------------------
   353 // -----------------------------------------------------------
   400 // CPhoneSingleCall::HandleHeldL
   354 // CPhoneSingleCall::HandleHeldL
   401 // -----------------------------------------------------------
   355 // -----------------------------------------------------------
   430         { 
   384         { 
   431         HandleHoldNoteL( aCallId , ETrue );
   385         HandleHoldNoteL( aCallId , ETrue );
   432         }
   386         }
   433 
   387 
   434     UpdateInCallCbaL();
   388     UpdateInCallCbaL();
       
   389     SetTouchPaneButtons( EPhoneIncallHeldButtons );
   435     }
   390     }
   436     
   391     
   437 // -----------------------------------------------------------
   392 // -----------------------------------------------------------
   438 // CPhoneSingleCall::HandleConnectedL
   393 // CPhoneSingleCall::HandleConnectedL
   439 // -----------------------------------------------------------
   394 // -----------------------------------------------------------
   464             HandleHoldNoteL( aCallId , EFalse );
   419             HandleHoldNoteL( aCallId , EFalse );
   465             }
   420             }
   466         }
   421         }
   467 
   422 
   468     UpdateInCallCbaL();  
   423     UpdateInCallCbaL();  
       
   424     SetTouchPaneButtons( EPhoneIncallButtons );
   469     }
   425     }
   470     
   426     
   471 // -----------------------------------------------------------
   427 // -----------------------------------------------------------
   472 // CPhoneSingleCall::ToggleHold
   428 // CPhoneSingleCall::ToggleHold
   473 // -----------------------------------------------------------
   429 // -----------------------------------------------------------
   474 //
   430 //
   475 void CPhoneSingleCall::ToggleHoldL()
   431 void CPhoneSingleCall::ToggleHoldL()
   476     {
   432     {
   477     __LOGMETHODSTARTEND( EPhoneUIStates, 
   433     __LOGMETHODSTARTEND( EPhoneUIStates, 
   478         "CPhoneSingleCall::ToggleHoldL()");
   434         "CPhoneSingleCall::ToggleHoldL()");
   479     TPhoneCmdParamBoolean hold;
   435 
   480     iViewCommandHandle->ExecuteCommandL( EPhoneViewGetHoldFlag, &hold );
   436     TPECallControlCaps callControlCaps =
   481    
   437         iStateMachine->PhoneEngineInfo()->CallControlCaps( iCallId );
   482     if( hold.Boolean() )
   438     
   483         {
   439     if ( callControlCaps & MCCECallObserver::ECCECapsHold  )
   484         SetCallResumeL();
   440         {
       
   441         iStateMachine->SetCallId( iCallId );         
       
   442         iStateMachine->SendPhoneEngineMessage( 
       
   443             CPEPhoneModelIF::EPEMessageHold );    
       
   444         }
       
   445     else if ( callControlCaps & MCCECallObserver::ECCECapsResume )
       
   446         {
       
   447         iStateMachine->SetCallId( iCallId );         
       
   448         iStateMachine->SendPhoneEngineMessage( 
       
   449             CPEPhoneModelIF::EPEMessageResume );    
   485         }
   450         }
   486     else
   451     else
   487         {
   452         {
   488         SetCallHoldL();
   453         SendGlobalInfoNoteL( EPhoneNoteTextNotAllowed, ETrue );    
   489         }
   454         }
   490     }
   455     }
   491         
   456         
   492 // -----------------------------------------------------------
   457 // -----------------------------------------------------------
   493 // CPhoneSingleCall::HandleIncomingL
   458 // CPhoneSingleCall::HandleIncomingL
   496 void CPhoneSingleCall::HandleIncomingL( TInt aCallId )
   461 void CPhoneSingleCall::HandleIncomingL( TInt aCallId )
   497     {
   462     {
   498     __LOGMETHODSTARTEND( EPhoneUIStates, 
   463     __LOGMETHODSTARTEND( EPhoneUIStates, 
   499         "CPhoneSingleCall::HandleIncomingL()");
   464         "CPhoneSingleCall::HandleIncomingL()");
   500     
   465     
   501     CPhonePubSubProxy::Instance()->ChangePropertyValue(
       
   502                     KPSUidScreenSaver,
       
   503                     KScreenSaverAllowScreenSaver,
       
   504                     EPhoneScreensaverNotAllowed );
       
   505     IsNumberEntryUsedL() ? 
       
   506         BeginTransEffectLC( ECallUiAppear ) :
       
   507         BeginTransEffectLC( ENumberEntryOpen );
       
   508     BeginUiUpdateLC();
   466     BeginUiUpdateLC();
   509     
       
   510     // Hide the number entry if it exists
       
   511     if ( IsNumberEntryUsedL() )
       
   512         {
       
   513         SetNumberEntryVisibilityL( EFalse );    
       
   514         }
       
   515     
   467     
   516     TPhoneCmdParamBoolean dialerParam;
   468     TPhoneCmdParamBoolean dialerParam;
   517     dialerParam.SetBoolean( ETrue );
   469     dialerParam.SetBoolean( ETrue );
   518     
   470     
   519     // Get allow waiting call header param value.
   471     // Get allow waiting call header param value.
   520     AllowShowingOfWaitingCallHeaderL( dialerParam );    
   472     AllowShowingOfWaitingCallHeaderL( dialerParam );    
   521 
   473 
   522     // Close fast swap window if it's displayed
       
   523     EikonEnv()->DismissTaskList();
       
   524 
       
   525     // Show incoming call buttons
       
   526     SetTouchPaneButtons( EPhoneWaitingCallButtons );    
       
   527 
       
   528     // Display incoming call
   474     // Display incoming call
   529     DisplayIncomingCallL( aCallId, dialerParam );
   475     DisplayIncomingCallL( aCallId, dialerParam );
   530 
   476     
       
   477     // Show incoming call buttons
       
   478     SetTouchPaneButtons( EPhoneWaitingCallButtons ); 
       
   479     
       
   480     if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) 
       
   481             && !CPhoneCenRepProxy::Instance()->
       
   482             IsTelephonyFeatureSupported( KTelephonyLVFlagAllowUnlockOnIncoming ) 
       
   483             && ( IsKeyLockOn() || IsAutoLockOn() ) )
       
   484         {
       
   485         DisableCallUIL();
       
   486         }
       
   487     else
       
   488         {
       
   489         // if keys have been locked, disable keylock without information note
       
   490         if ( IsKeyLockOn() )
       
   491             {
       
   492             iViewCommandHandle->ExecuteCommandL( EPhoneViewDisableKeyLockWithoutNote );
       
   493             }
       
   494         }
       
   495     
       
   496     if( CPhoneCenRepProxy::Instance()->
       
   497             IsTelephonyFeatureSupported( KTelephonyLVFlagDisableCallControlHardKeysWhileLocked ) 
       
   498             && ( IsKeyLockOn() || IsAutoLockOn() ) )
       
   499         {
       
   500         DisableHWKeysL();
       
   501         }
       
   502         
   531     EndUiUpdate();
   503     EndUiUpdate();
   532     EndTransEffect();
   504 
   533     // This query is required to dismiss
   505     // This query is required to dismiss
   534     // Operation cannot be completed in waiting and single state
   506     // Operation cannot be completed in waiting and single state
   535     if ( iSwitchToVideoQuery )
   507     if ( iSwitchToVideoQuery )
   536         {
   508         {
   537         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery );
   509         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery );
   538         }
   510         }
       
   511     
       
   512     // Go to incoming state
   539     UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
   513     UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
   540     iStateMachine->ChangeState( EPhoneStateWaitingInSingle );        
   514     iStateMachine->ChangeState( EPhoneStateWaitingInSingle );        
   541     }
   515     }
   542     
   516     
   543 // -----------------------------------------------------------
   517 // -----------------------------------------------------------
   544 // CPhoneSingleCall::DisplayIncomingCallL
   518 // CPhoneSingleCall::DisplayIncomingCallL
   545 // -----------------------------------------------------------
   519 // -----------------------------------------------------------
   546 //
   520 //
   547 void CPhoneSingleCall::DisplayIncomingCallL( 
   521 void CPhoneSingleCall::DisplayIncomingCallL( 
   548     TInt aCallId, 
   522     TInt aCallId, 
   549     const TPhoneCmdParamBoolean /*aCommandParam*/ )
   523     const TPhoneCmdParamBoolean aCommandParam )
   550     {
   524     {
   551     __LOGMETHODSTARTEND( EPhoneUIStates, 
   525     __LOGMETHODSTARTEND( EPhoneUIStates, 
   552         "CPhoneSingleCall::DisplayIncomingCallL()");
   526         "CPhoneSingleCall::DisplayIncomingCallL()");
   553     // Close menu bar, if it is displayed
   527 
   554     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
   528     // Cannot delete active note, e.g. New call query, 
   555 
   529     // but show waiting note with or without caller name
   556     // Remove any phone dialogs if they are displayed
   530     if ( IsAnyQueryActiveL() || 
   557     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
   531         ( !aCommandParam.Boolean() && iOnScreenDialer ) )
   558 
   532         {
   559     // if keys have been locked, disable keylock without information note
   533         CallWaitingNoteL( aCallId );        
   560     if ( IsKeyLockOn() )
   534         }
   561         {
   535     else
   562         iViewCommandHandle->ExecuteCommandL( EPhoneViewDisableKeyLockWithoutNote );
   536         {
       
   537         // Remove any phone dialogs if they are displayed
       
   538         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
   563         }
   539         }
   564     
   540     
   565     // Indicate that the Phone needs to be sent to the background if
   541     // Indicate that the Phone needs to be sent to the background if
   566     // an application other than the top application is in the foreground
   542     // an application other than the top application is in the foreground
   567     SetNeedToReturnToForegroundAppStatusL( !TopAppIsDisplayedL() );
   543     TPhoneCmdParamBoolean booleanParam;
   568     
   544     booleanParam.SetBoolean( !TopAppIsDisplayedL() );
       
   545     iViewCommandHandle->ExecuteCommandL( 
       
   546         EPhoneViewSetNeedToSendToBackgroundStatus,
       
   547         &booleanParam );
       
   548 
   569     // Bring Phone app in the foreground
   549     // Bring Phone app in the foreground
   570     TPhoneCmdParamInteger uidParam;
   550     TPhoneCmdParamInteger uidParam;
   571     uidParam.SetInteger( KUidPhoneApplication.iUid );
   551     uidParam.SetInteger( KUidPhoneApplication.iUid );
   572     iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
   552     iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
   573         &uidParam );
   553         &uidParam );
   576     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
   556     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
   577         &uidParam );
   557         &uidParam );
   578 
   558 
   579     DisplayHeaderForCallComingInL( aCallId, ETrue ); //waiting call 
   559     DisplayHeaderForCallComingInL( aCallId, ETrue ); //waiting call 
   580     }    
   560     }    
   581     
   561 // -----------------------------------------------------------
   582 // ---------------------------------------------------------
   562 // CPhoneSingleCall::HandleDiallingL
   583 // CPhoneSingleCall::CallFromNewCallQueryL
   563 // -----------------------------------------------------------
   584 // ---------------------------------------------------------
   564 //
   585 //
   565 void CPhoneSingleCall::HandleDiallingL( TInt aCallId )
   586 void CPhoneSingleCall::CallFromNewCallQueryL()
   566     {
   587     {
   567     __LOGMETHODSTARTEND( EPhoneUIStates, 
   588     __LOGMETHODSTARTEND( EPhoneUIStates, 
   568         "CPhoneSingleCall::HandleDiallingL()");
   589         "CPhoneSingleCall::CallFromNewCallQueryL()");
   569     BeginUiUpdateLC();
   590     // First get the phone number from the dialog
   570     
   591     TPhoneCmdParamString phoneNumberParam;
   571     SetNumberEntryVisibilityL(EFalse);
   592     HBufC *content = HBufC::NewLC( KPhoneNumberEntryBufferSize );
   572 
   593     TPtr ptr( content->Des() );
       
   594     phoneNumberParam.SetString( &ptr );
       
   595     iViewCommandHandle->ExecuteCommandL( EPhoneViewGetTextQueryContent,
       
   596         &phoneNumberParam );
       
   597 
       
   598     // Store the phone number
       
   599     iStateMachine->PhoneEngineInfo()->SetPhoneNumber( ptr );
       
   600 
       
   601     // clean up stack
       
   602     CleanupStack::PopAndDestroy( content );
       
   603     
       
   604     DialVoiceCallL();
       
   605     }
       
   606 
       
   607 // -----------------------------------------------------------
       
   608 // CPhoneSingleCall::HandleDialingL
       
   609 // -----------------------------------------------------------
       
   610 //
       
   611 void CPhoneSingleCall::HandleDialingL( TInt aCallId )
       
   612     {
       
   613     __LOGMETHODSTARTEND( EPhoneUIStates, 
       
   614         "CPhoneSingleCall::HandleDialingL()");
       
   615     
       
   616     CPhonePubSubProxy::Instance()->ChangePropertyValue(
       
   617                     KPSUidScreenSaver,
       
   618                     KScreenSaverAllowScreenSaver,
       
   619                     EPhoneScreensaverNotAllowed );
       
   620     // Display call setup 
   573     // Display call setup 
   621     DisplayCallSetupL( aCallId );
   574     DisplayCallSetupL( aCallId );
   622     iStateMachine->ChangeState( EPhoneStateCallSetupInSingle );
   575     
   623     }
       
   624 
       
   625 // -----------------------------------------------------------
       
   626 // CPhoneSingleCall::DoStateSpecificCallSetUpDefinitionsL
       
   627 // -----------------------------------------------------------
       
   628 //
       
   629 EXPORT_C void CPhoneSingleCall::DoStateSpecificCallSetUpDefinitionsL()
       
   630     {
       
   631     // Show incoming call buttons
   576     // Show incoming call buttons
   632     SetTouchPaneButtons( EPhoneCallSetupAndSingleButtons );
   577     SetTouchPaneButtons( EPhoneCallSetupAndSingleButtons );
   633     }
   578 
   634 
   579     EndUiUpdate();
   635 // -----------------------------------------------------------
   580 
   636 // CPhoneSingleCall::SetCallHoldL
   581     // Go to call setup state
   637 // -----------------------------------------------------------
   582     UpdateCbaL( EPhoneCallHandlingCallSetupCBA );
   638 //
   583     iStateMachine->ChangeState( EPhoneStateCallSetupInSingle );
   639 void CPhoneSingleCall::SetCallHoldL()
   584     }
   640     {
   585     
   641     __LOGMETHODSTARTEND( EPhoneUIStates, 
   586 // -----------------------------------------------------------
   642         "CPhoneSingleCall::SetCallHold()");
   587 // CPhoneSingleCall::DisplayCallSetupL
   643     
   588 // -----------------------------------------------------------
   644     TPhoneCmdParamCallStateData callStateData;
   589 //
   645     callStateData.SetCallId( iCallId );
   590 void CPhoneSingleCall::DisplayCallSetupL( TInt aCallId )
   646     iViewCommandHandle->HandleCommandL( EPhoneViewGetCallState,
   591     {
   647         &callStateData );
   592     __LOGMETHODSTARTEND( EPhoneUIStates, 
   648     
   593         "CPhoneSingleCall::DisplayCallSetupL()");
   649     if( callStateData.CallState() == EPEStateConnected && !IsVideoCallActiveL() )
   594 
   650         {
   595     // Remove dialogs if necessary
   651         iStateMachine->SetCallId( iCallId );         
   596     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
   652         iStateMachine->SendPhoneEngineMessage( 
   597 
   653             CPEPhoneModelIF::EPEMessageHold );    
   598     // Capture keys when the phone is dialling
   654         }
   599     CaptureKeysDuringCallNotificationL( ETrue );
   655     else
   600 
   656         {
   601     // Force telephony to the foreground
   657         // Show not allowed note
   602     TPhoneCmdParamInteger uidParam;
   658         SendGlobalInfoNoteL( EPhoneNoteTextNotAllowed );    
   603     uidParam.SetInteger( KUidPhoneApplication.iUid );
   659         }
   604     iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
   660     }
   605         &uidParam );
   661     
   606 
   662 // -----------------------------------------------------------
   607     // Display call setup header
   663 // CPhoneSingleCall::SetCallResumeL
   608     DisplayHeaderForOutgoingCallL( aCallId );
   664 // -----------------------------------------------------------
       
   665 //
       
   666 void CPhoneSingleCall::SetCallResumeL()
       
   667     {
       
   668     __LOGMETHODSTARTEND( EPhoneUIStates, 
       
   669         "CPhoneSingleCall::SetCallHold()");
       
   670 
       
   671     TPhoneCmdParamCallStateData callStateData;
       
   672     callStateData.SetCallId( iCallId );
       
   673     iViewCommandHandle->HandleCommandL( EPhoneViewGetCallState,
       
   674         &callStateData );
       
   675     
       
   676     if( callStateData.CallState() == EPEStateHeld )
       
   677         {
       
   678         iStateMachine->SetCallId( iCallId );
       
   679         iStateMachine->SendPhoneEngineMessage(
       
   680             CPEPhoneModelIF::EPEMessageResume );
       
   681         }
       
   682     else
       
   683         {
       
   684         // Show not allowed note
       
   685         SendGlobalInfoNoteL( EPhoneNoteTextNotAllowed );    
       
   686         }                
       
   687     }
   609     }
   688 
   610 
   689 // -----------------------------------------------------------
   611 // -----------------------------------------------------------
   690 // CPhoneSingleCall::SwitchToVideoL
   612 // CPhoneSingleCall::SwitchToVideoL
   691 // -----------------------------------------------------------
   613 // -----------------------------------------------------------
   694     {
   616     {
   695     __LOGMETHODSTARTEND( EPhoneUIStates, 
   617     __LOGMETHODSTARTEND( EPhoneUIStates, 
   696         "CPhoneSingleCall::SwitchToVideoL()");
   618         "CPhoneSingleCall::SwitchToVideoL()");
   697 
   619 
   698     if( FeatureManager::FeatureSupported( KFeatureIdCsVideoTelephony ) )
   620     if( FeatureManager::FeatureSupported( KFeatureIdCsVideoTelephony ) )
   699     	{        
   621         {        
   700         TInt networkMode( CPhonePubSubProxy::Instance()->Value( KPSUidNetworkInfo,
   622         TInt networkMode( CPhonePubSubProxy::Instance()->Value( KPSUidNetworkInfo,
   701             KNWTelephonyNetworkMode ) );
   623             KNWTelephonyNetworkMode ) );
   702         TBool restoreOngoing( CPhonePubSubProxy::Instance()->Value( KUidSystemCategory,
   624         TBool restoreOngoing( CPhonePubSubProxy::Instance()->Value( KUidSystemCategory,
   703             conn::KUidBackupRestoreKey ));
   625             conn::KUidBackupRestoreKey ));
   704     
       
   705         TBool resetTouchButtons = EFalse;
       
   706         
   626         
   707         if ( networkMode != ENWNetworkModeWcdma )
   627         if ( networkMode != ENWNetworkModeWcdma )
   708             {
   628             {
   709             // We aren't in 3G, video call not possible
   629             // We aren't in 3G, video call not possible
   710             SendGlobalInfoNoteL( EPhoneInformationNoNetworkSupportForVideoCallNote );    
   630             SendGlobalInfoNoteL( EPhoneInformationNoNetworkSupportForVideoCallNote );    
   711             resetTouchButtons = ETrue;
       
   712             }
   631             }
   713         else if ( restoreOngoing & ( conn::EBURRestoreFull | conn::EBURRestorePartial ))
   632         else if ( restoreOngoing & ( conn::EBURRestoreFull | conn::EBURRestorePartial ))
   714             {
   633             {
   715             // MC restore ongoing
   634             // MC restore ongoing
   716             SendGlobalInfoNoteL( EPhoneInformationVideoCallNotAllowedDuringRestoreNote );
   635             SendGlobalInfoNoteL( EPhoneInformationVideoCallNotAllowedDuringRestoreNote );
   717             resetTouchButtons = ETrue;    
       
   718             }
   636             }
   719         else
   637         else
   720             {
   638             {
   721         iSwitchToVideoQuery = ETrue;
   639             iSwitchToVideoQuery = ETrue;
   722         ShowQueryL( EPhoneSwitchToVideoQuery );
   640             //ShowQueryL( EPhoneSwitchToVideoQuery );
   723         iSwitchToVideoQuery = EFalse;
   641             iSwitchToVideoQuery = EFalse;
   724         }    
   642             }    
   725     
       
   726         if( resetTouchButtons )
       
   727             {
       
   728             // Sets touch buttons to correct status if error has occured.    
       
   729             iViewCommandHandle->ExecuteCommand( EPhoneResetTouchButtons ); 
       
   730             }
       
   731         }
   643         }
   732     }
   644     }
   733 
   645 
   734 // -----------------------------------------------------------
   646 // -----------------------------------------------------------
   735 // CPhoneSingleCall::SwitchToVoiceL
   647 // CPhoneSingleCall::SwitchToVoiceL
   738 void CPhoneSingleCall::SwitchToVoiceL()
   650 void CPhoneSingleCall::SwitchToVoiceL()
   739     {
   651     {
   740     __LOGMETHODSTARTEND( EPhoneUIStates, 
   652     __LOGMETHODSTARTEND( EPhoneUIStates, 
   741         "CPhoneSingleCall::SwitchToVoiceL()");
   653         "CPhoneSingleCall::SwitchToVoiceL()");
   742     
   654     
   743     ShowQueryL( EPhoneSwitchToVoiceQuery );
   655     //ShowQueryL( EPhoneSwitchToVoiceQuery );
   744     }
   656     }
   745 
   657 
   746 // End of File
   658 // End of File