32 #include "tphonecmdparaminteger.h" |
32 #include "tphonecmdparaminteger.h" |
33 #include "tphonecmdparamstring.h" |
33 #include "tphonecmdparamstring.h" |
34 #include "tphonecmdparamnote.h" |
34 #include "tphonecmdparamnote.h" |
35 #include "tphonecmdparamquery.h" |
35 #include "tphonecmdparamquery.h" |
36 #include "tphonecmdparamcallstatedata.h" |
36 #include "tphonecmdparamcallstatedata.h" |
|
37 #include "tphonecmdparamkeycapture.h" |
37 #include "tphonecmdparamsfidata.h" |
38 #include "tphonecmdparamsfidata.h" |
38 #include "mphonestatemachine.h" |
39 #include "mphonestatemachine.h" |
39 #include "phonestatedefinitions.h" |
40 #include "phonestatedefinitions.h" |
40 #include "phoneviewcommanddefinitions.h" |
41 #include "phoneviewcommanddefinitions.h" |
41 #include "phoneui.hrh" |
42 #include "phoneui.hrh" |
202 |
203 |
203 case MEngineMonitor::EPEMessageSentDTMF: |
204 case MEngineMonitor::EPEMessageSentDTMF: |
204 case MEngineMonitor::EPEMessageDTMFSendingAborted: |
205 case MEngineMonitor::EPEMessageDTMFSendingAborted: |
205 CancelDTMFSendingL(); |
206 CancelDTMFSendingL(); |
206 break; |
207 break; |
207 |
|
208 case MEngineMonitor::EPEMessagePromptSpeedDial: |
|
209 HandleDTMFPromptSpeedDialL(); |
|
210 break; |
|
211 |
|
212 case MEngineMonitor::EPEMessageSpeedDialNotAssigned: |
|
213 CPhoneState::SendGlobalErrorNoteL( |
|
214 EPhoneDtmfSpeedDialNotAssigned ); |
|
215 break; |
|
216 |
|
217 case MEngineMonitor::EPEMessageInvalidSpeedDial: |
|
218 CPhoneState::SendGlobalErrorNoteL( EPhoneDtmfInvalidSpeedDial ); |
|
219 break; |
|
220 |
208 |
221 case MEngineMonitor::EPEMessageAudioVolumeChanged: |
209 case MEngineMonitor::EPEMessageAudioVolumeChanged: |
222 HandleAudioVolumeChangedL(); |
210 HandleAudioVolumeChangedL(); |
223 break; |
211 break; |
224 |
212 |
283 EXPORT_C void CPhoneStateInCall::HandleIdleL( TInt aCallId ) |
271 EXPORT_C void CPhoneStateInCall::HandleIdleL( TInt aCallId ) |
284 { |
272 { |
285 __LOGMETHODSTARTEND(EPhoneControl, |
273 __LOGMETHODSTARTEND(EPhoneControl, |
286 "CPhoneStateInCall::HandleIdleL()" ); |
274 "CPhoneStateInCall::HandleIdleL()" ); |
287 __ASSERT_DEBUG( aCallId >= 0, Panic( EPhoneCtrlParameterNotInitialized ) ); |
275 __ASSERT_DEBUG( aCallId >= 0, Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
276 |
|
277 TBool showDialer( EFalse ); |
|
278 HBufC *phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize ); |
|
279 TPtr ptr( phoneNumber->Des() ); |
|
280 TPhoneCmdParamString stringParam; |
|
281 stringParam.SetString( &ptr ); |
|
282 |
288 // Remove call |
283 // Remove call |
289 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
284 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
290 |
285 |
291 //Make sure that toolbar is not shown |
286 //Make sure that toolbar is not shown |
292 iViewCommandHandle->ExecuteCommandL( EPhoneViewHideToolbar ); |
287 iViewCommandHandle->ExecuteCommandL( EPhoneViewHideToolbar ); |
293 BeginTransEffectLC( ENumberEntryOpen ); |
288 BeginTransEffectLC( ENumberEntryOpen ); |
294 BeginUiUpdateLC(); |
289 BeginUiUpdateLC(); |
295 SetDefaultFlagsL(); |
290 SetDefaultFlagsL(); |
296 if ( IsNumberEntryUsedL() ) |
291 if ( IsNumberEntryUsedL() ) |
297 { |
292 { |
298 // Show the number entry if it exists and update cba's. |
293 if ( iOnScreenDialer && IsCustomizedDialerVisibleL() ) |
299 SetNumberEntryVisibilityL( ETrue ); |
|
300 |
|
301 // Close dtmf dialer when call is disconnected. |
|
302 if ( IsDTMFEditorVisibleL() ) |
|
303 { |
|
304 CloseDTMFEditorL(); |
|
305 |
|
306 // Display idle screen and update CBA's |
|
307 DisplayIdleScreenL(); |
|
308 } |
|
309 else if ( iOnScreenDialer && IsCustomizedDialerVisibleL() ) |
|
310 { |
294 { |
311 CloseCustomizedDialerL(); |
295 CloseCustomizedDialerL(); |
312 // Display idle screen and update CBA's |
296 } |
313 DisplayIdleScreenL(); |
297 else |
314 } |
298 { |
315 } |
299 iViewCommandHandle->ExecuteCommand( |
316 else |
300 EPhoneViewGetNumberFromEntry, |
317 { |
301 &stringParam ); |
318 // Close menu bar, if it is displayed |
302 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
319 iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
303 showDialer = ETrue; |
|
304 } |
|
305 } |
|
306 |
320 |
307 |
321 if ( !TopAppIsDisplayedL() || IsAutoLockOn() ) |
308 // Close menu bar, if it is displayed |
322 { |
309 iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
323 // Continue displaying current app but set up the |
310 |
324 // idle screen in the background |
311 if ( !TopAppIsDisplayedL() || IsAutoLockOn() ) |
325 SetupIdleScreenInBackgroundL(); |
312 { |
326 } |
313 // Continue displaying current app but set up the |
327 else |
314 // idle screen in the background |
328 { |
315 SetupIdleScreenInBackgroundL(); |
329 // Display idle screen and update CBAs |
316 } |
330 DisplayIdleScreenL(); |
317 else if ( showDialer ) |
331 } |
318 { |
|
319 // Open dialer |
|
320 iViewCommandHandle->ExecuteCommandL( EPhoneViewLaunchLogs, &stringParam ); |
|
321 } |
|
322 else |
|
323 { |
|
324 // Display idle screen and update CBAs |
|
325 DisplayIdleScreenL(); |
332 } |
326 } |
333 |
327 |
334 DeleteTouchPaneButtons(); |
328 DeleteTouchPaneButtons(); |
335 EndUiUpdate(); |
329 EndUiUpdate(); |
336 EndTransEffect(); |
330 EndTransEffect(); |
337 // Display call termination note, if necessary |
331 // Display call termination note, if necessary |
338 DisplayCallTerminationNoteL(); |
332 DisplayCallTerminationNoteL(); |
339 |
333 |
|
334 TPhoneCmdParamKeyCapture captureParam; |
|
335 captureParam.SetKeyCode( EKeyNo ); |
|
336 iViewCommandHandle->ExecuteCommand( EPhoneViewStopCapturingKey, &captureParam ); |
|
337 |
|
338 CleanupStack::PopAndDestroy( phoneNumber ); |
340 // Go to idle state |
339 // Go to idle state |
341 iStateMachine->ChangeState( EPhoneStateIdle ); |
340 iStateMachine->ChangeState( EPhoneStateIdle ); |
342 } |
341 } |
343 |
342 |
344 // ----------------------------------------------------------- |
343 // ----------------------------------------------------------- |
526 // Remove the Sending... note |
527 // Remove the Sending... note |
527 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveDtmfNote ); |
528 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveDtmfNote ); |
528 } |
529 } |
529 |
530 |
530 // ----------------------------------------------------------- |
531 // ----------------------------------------------------------- |
531 // CPhoneStateInCall::HandleDtmfPromptSpeedDialL |
|
532 // ----------------------------------------------------------- |
|
533 // |
|
534 void CPhoneStateInCall::HandleDTMFPromptSpeedDialL() |
|
535 { |
|
536 __LOGMETHODSTARTEND(EPhoneControl, |
|
537 "CPhoneStateInCall::HandleDTMFPromptSpeedDialL()" ); |
|
538 // Remove the Sending... note |
|
539 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
|
540 |
|
541 // Prompt for speed dial number |
|
542 HBufC* emptyString = HBufC::NewLC( KPhoneNumberEntryBufferSize ); |
|
543 TPtr ptr( emptyString->Des() ); |
|
544 |
|
545 // If the Search softkey is selected before a speed dial number is entered, |
|
546 // revert back to the DTMF query |
|
547 ShowDtmfTextQueryL( |
|
548 CPhoneMainResourceResolver::Instance()-> |
|
549 ResolveResourceID( EPhoneDtmfSpeedDialNumberQuery ), |
|
550 CPhoneMainResourceResolver::Instance()-> |
|
551 ResolveResourceID( EPhoneSendDtmfEmptyEditBoxCBA ), |
|
552 CPhoneMainResourceResolver::Instance()-> |
|
553 ResolveResourceID( EPhoneDtmfSpeedDialNormalEditBoxCBA ), |
|
554 &ptr ); |
|
555 |
|
556 CleanupStack::PopAndDestroy( emptyString ); |
|
557 } |
|
558 |
|
559 // ----------------------------------------------------------- |
|
560 // CPhoneStateInCall::HandleCommandL |
532 // CPhoneStateInCall::HandleCommandL |
561 // ----------------------------------------------------------- |
533 // ----------------------------------------------------------- |
562 // |
534 // |
563 EXPORT_C TBool CPhoneStateInCall::HandleCommandL( TInt aCommand ) |
535 EXPORT_C TBool CPhoneStateInCall::HandleCommandL( TInt aCommand ) |
564 { |
536 { |
969 MPEPhoneModel::EPEMessageSendDTMF ); |
936 MPEPhoneModel::EPEMessageSendDTMF ); |
970 } |
937 } |
971 |
938 |
972 CleanupStack::PopAndDestroy( content ); |
939 CleanupStack::PopAndDestroy( content ); |
973 } |
940 } |
974 |
|
975 // ----------------------------------------------------------- |
|
976 // CPhoneStateInCall::SendDtmfSpeedDialNumberL |
|
977 // ----------------------------------------------------------- |
|
978 // |
|
979 void CPhoneStateInCall::SendDtmfSpeedDialNumberL() |
|
980 { |
|
981 __LOGMETHODSTARTEND(EPhoneControl, |
|
982 "CPhoneStateInCall::SendDtmfSpeedDialNumberL()" ); |
|
983 // First get the DTMF sequence from dialog |
|
984 TPhoneCmdParamString dtmfSequence; |
|
985 HBufC *content = HBufC::NewLC( KPEDtmfMaxLength ); |
|
986 TPtr ptr( content->Des() ); |
|
987 dtmfSequence.SetString( &ptr ); |
|
988 iViewCommandHandle->ExecuteCommandL( EPhoneViewGetTextQueryContent, |
|
989 &dtmfSequence ); |
|
990 |
|
991 // Prefix the query content string with the speed dial character '+' |
|
992 _LIT( KSpeedDialPrefix, "+" ); |
|
993 ptr.Insert( 0, KSpeedDialPrefix ); |
|
994 |
|
995 // Send the DTMF |
|
996 iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( ptr ); |
|
997 iStateMachine->SendPhoneEngineMessage( |
|
998 MPEPhoneModel::EPEMessageSendDTMF ); |
|
999 |
|
1000 CleanupStack::PopAndDestroy( content ); |
|
1001 } |
|
1002 |
941 |
1003 // ----------------------------------------------------------- |
942 // ----------------------------------------------------------- |
1004 // CPhoneStateInCall::LaunchDtmfManualQueryL |
943 // CPhoneStateInCall::LaunchDtmfManualQueryL |
1005 // ----------------------------------------------------------- |
944 // ----------------------------------------------------------- |
1006 // |
945 // |