24 #include <UikonInternalPSKeys.h> |
24 #include <UikonInternalPSKeys.h> |
25 #include <mpeengineinfo.h> |
25 #include <mpeengineinfo.h> |
26 #include <videotelcontrolmediatorapi.h> |
26 #include <videotelcontrolmediatorapi.h> |
27 #include <MediatorDomainUIDs.h> |
27 #include <MediatorDomainUIDs.h> |
28 #include <bldvariant.hrh> |
28 #include <bldvariant.hrh> |
|
29 #include <coreapplicationuisdomainpskeys.h> |
29 |
30 |
30 #include "cphonestateincall.h" |
31 #include "cphonestateincall.h" |
31 #include "tphonecmdparamboolean.h" |
32 #include "tphonecmdparamboolean.h" |
32 #include "tphonecmdparaminteger.h" |
33 #include "tphonecmdparaminteger.h" |
33 #include "tphonecmdparamstring.h" |
34 #include "tphonecmdparamstring.h" |
34 #include "tphonecmdparamnote.h" |
35 #include "tphonecmdparamnote.h" |
35 #include "tphonecmdparamquery.h" |
36 #include "tphonecmdparamquery.h" |
|
37 #include "tphonecmdparamsingleitemfetch.h" |
36 #include "tphonecmdparamcallstatedata.h" |
38 #include "tphonecmdparamcallstatedata.h" |
37 #include "tphonecmdparamkeycapture.h" |
|
38 #include "tphonecmdparamsfidata.h" |
39 #include "tphonecmdparamsfidata.h" |
39 #include "mphonestatemachine.h" |
40 #include "mphonestatemachine.h" |
|
41 #include "mphonesecuritymodeobserver.h" |
40 #include "phonestatedefinitions.h" |
42 #include "phonestatedefinitions.h" |
41 #include "phoneviewcommanddefinitions.h" |
43 #include "phoneviewcommanddefinitions.h" |
42 #include "phoneui.hrh" |
44 #include "phoneui.hrh" |
43 #include "phonerssbase.h" |
45 #include "phonerssbase.h" |
44 #include "cphonemainresourceresolver.h" |
46 #include "cphonemainresourceresolver.h" |
265 EXPORT_C void CPhoneStateInCall::HandleIdleL( TInt aCallId ) |
304 EXPORT_C void CPhoneStateInCall::HandleIdleL( TInt aCallId ) |
266 { |
305 { |
267 __LOGMETHODSTARTEND(EPhoneControl, |
306 __LOGMETHODSTARTEND(EPhoneControl, |
268 "CPhoneStateInCall::HandleIdleL()" ); |
307 "CPhoneStateInCall::HandleIdleL()" ); |
269 __ASSERT_DEBUG( aCallId >= 0, Panic( EPhoneCtrlParameterNotInitialized ) ); |
308 __ASSERT_DEBUG( aCallId >= 0, Panic( EPhoneCtrlParameterNotInitialized ) ); |
270 |
|
271 TBool showDialer( EFalse ); |
|
272 HBufC *phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize ); |
|
273 TPtr ptr( phoneNumber->Des() ); |
|
274 TPhoneCmdParamString stringParam; |
|
275 stringParam.SetString( &ptr ); |
|
276 |
|
277 // Remove call |
|
278 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
309 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
279 |
|
280 //Make sure that toolbar is not shown |
|
281 iViewCommandHandle->ExecuteCommandL( EPhoneViewHideToolbar ); |
310 iViewCommandHandle->ExecuteCommandL( EPhoneViewHideToolbar ); |
|
311 if ( IsNumberEntryUsedL() ) |
|
312 { |
|
313 BeginTransEffectLC( ECallUiDisappear ); |
|
314 } |
|
315 else |
|
316 { |
|
317 BeginTransEffectLC( ENumberEntryClose ); |
|
318 } |
282 BeginUiUpdateLC(); |
319 BeginUiUpdateLC(); |
283 SetDefaultFlagsL(); |
320 SetDefaultFlagsL(); |
|
321 |
284 if ( IsNumberEntryUsedL() ) |
322 if ( IsNumberEntryUsedL() ) |
285 { |
323 { |
286 iViewCommandHandle->ExecuteCommand( |
324 // Show the number entry if it exists and update cba's. |
287 EPhoneViewGetNumberFromEntry, |
325 SetNumberEntryVisibilityL( ETrue ); |
288 &stringParam ); |
326 // Close dtmf dialer when call is disconnected. |
289 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
327 if ( IsDTMFEditorVisibleL() ) |
290 showDialer = ETrue; |
328 { |
291 } |
329 CloseDTMFEditorL(); |
292 |
330 // Display idle screen and update CBA's |
293 if ( !TopAppIsDisplayedL() || IsAutoLockOn() ) |
331 DisplayIdleScreenL(); |
294 { |
332 } |
295 // Continue displaying current app but set up the |
333 else if ( iOnScreenDialer && IsCustomizedDialerVisibleL() ) |
296 // idle screen in the background |
334 { |
297 SetupIdleScreenInBackgroundL(); |
335 CloseCustomizedDialerL(); |
298 } |
336 // Display idle screen and update CBA's |
299 else if ( showDialer ) |
337 DisplayIdleScreenL(); |
300 { |
338 } |
301 // Open dialer |
339 } |
302 iViewCommandHandle->ExecuteCommandL( EPhoneViewLaunchLogs, &stringParam ); |
340 else |
303 } |
341 { |
304 else |
342 iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
305 { |
343 if ( !TopAppIsDisplayedL() || IsAutoLockOn() || NeedToReturnToForegroundAppL() ) |
306 // Display idle screen and update CBAs |
344 { |
307 DisplayIdleScreenL(); |
345 // Continue displaying current app but set up the |
|
346 // idle screen in the background |
|
347 SetupIdleScreenInBackgroundL(); |
|
348 } |
|
349 else |
|
350 { |
|
351 // Display idle screen and update CBAs |
|
352 DisplayIdleScreenL(); |
|
353 } |
308 } |
354 } |
309 |
355 |
310 DeleteTouchPaneButtons(); |
356 DeleteTouchPaneButtons(); |
311 EndUiUpdate(); |
357 EndUiUpdate(); |
312 // Display call termination note, if necessary |
358 EndTransEffect(); |
313 DisplayCallTerminationNoteL(); |
359 DisplayCallTerminationNoteL(); |
314 |
|
315 TPhoneCmdParamKeyCapture captureParam; |
|
316 captureParam.SetKeyCode( EKeyNo ); |
|
317 iViewCommandHandle->ExecuteCommand( EPhoneViewStopCapturingKey, &captureParam ); |
|
318 |
|
319 CleanupStack::PopAndDestroy( phoneNumber ); |
|
320 // Go to idle state |
|
321 iStateMachine->ChangeState( EPhoneStateIdle ); |
360 iStateMachine->ChangeState( EPhoneStateIdle ); |
|
361 iViewCommandHandle->ExecuteCommandL( EPhoneViewHideToolbar ); |
322 } |
362 } |
323 |
363 |
324 // ----------------------------------------------------------- |
364 // ----------------------------------------------------------- |
325 // CPhoneStateInCall::UpdateInCallCbaL |
365 // CPhoneStateInCall::UpdateInCallCbaL |
326 // ----------------------------------------------------------- |
366 // ----------------------------------------------------------- |
336 // ----------------------------------------------------------- |
376 // ----------------------------------------------------------- |
337 // |
377 // |
338 EXPORT_C void CPhoneStateInCall::UpdateCbaL( TInt aResource ) |
378 EXPORT_C void CPhoneStateInCall::UpdateCbaL( TInt aResource ) |
339 { |
379 { |
340 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateInCall::UpdateCbaL() "); |
380 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateInCall::UpdateCbaL() "); |
341 iCbaManager->UpdateCbaL( aResource ); |
381 if ( iOnScreenDialer && IsNumberEntryVisibleL() && IsDTMFEditorVisibleL() ) |
|
382 { |
|
383 iCbaManager->SetCbaL( EPhoneDtmfDialerCBA ); |
|
384 } |
|
385 else if ( iOnScreenDialer && IsNumberEntryVisibleL() && IsCustomizedDialerVisibleL() ) |
|
386 { |
|
387 iCbaManager->SetCbaL( CustomizedDialerCbaResourceIdL() ); |
|
388 } |
|
389 else |
|
390 { |
|
391 iCbaManager->UpdateCbaL( aResource ); |
|
392 } |
342 } |
393 } |
343 |
394 |
344 // ----------------------------------------------------------- |
395 // ----------------------------------------------------------- |
345 // CPhoneStateInCall::HandleAudioMuteChangedL |
396 // CPhoneStateInCall::HandleAudioMuteChangedL |
346 // ----------------------------------------------------------- |
397 // ----------------------------------------------------------- |
356 if ( !IsNumberEntryUsedL() ) |
407 if ( !IsNumberEntryUsedL() ) |
357 { |
408 { |
358 // Go to current state implementation |
409 // Go to current state implementation |
359 UpdateInCallCbaL(); |
410 UpdateInCallCbaL(); |
360 } |
411 } |
|
412 TBool audioMute = iStateMachine->PhoneEngineInfo()->AudioMute(); |
|
413 TPhoneCmdParamCallStateData callStateData; |
|
414 callStateData.SetCallState( EPEStateConnected ); |
|
415 iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState, &callStateData ); |
|
416 TInt call = callStateData.CallId(); |
|
417 if ( call != KErrNotFound && iStateMachine->PhoneEngineInfo()->CallType( call ) == EPECallTypeVoIP |
|
418 && audioMute ) |
|
419 { |
|
420 TPhoneCmdParamBoolean dtmfSendFlag; |
|
421 dtmfSendFlag.SetBoolean( ETrue ); |
|
422 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetVoipCallDTMFVisibilityFlag, |
|
423 &dtmfSendFlag ); |
|
424 } |
|
425 else |
|
426 { |
|
427 TPhoneCmdParamBoolean dtmfSendFlag; |
|
428 dtmfSendFlag.SetBoolean( EFalse ); |
|
429 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetVoipCallDTMFVisibilityFlag, |
|
430 &dtmfSendFlag ); |
|
431 } |
361 } |
432 } |
362 |
433 |
363 // ----------------------------------------------------------- |
434 // ----------------------------------------------------------- |
364 // CPhoneStateInCall::HandleAudioOutputChangedL |
435 // CPhoneStateInCall::HandleAudioOutputChangedL |
365 // ----------------------------------------------------------- |
436 // ----------------------------------------------------------- |
497 // Remove the Sending... note |
566 // Remove the Sending... note |
498 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveDtmfNote ); |
567 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveDtmfNote ); |
499 } |
568 } |
500 |
569 |
501 // ----------------------------------------------------------- |
570 // ----------------------------------------------------------- |
|
571 // CPhoneStateInCall::HandleDtmfPromptSpeedDialL |
|
572 // ----------------------------------------------------------- |
|
573 // |
|
574 void CPhoneStateInCall::HandleDTMFPromptSpeedDialL() |
|
575 { |
|
576 __LOGMETHODSTARTEND(EPhoneControl, |
|
577 "CPhoneStateInCall::HandleDTMFPromptSpeedDialL()" ); |
|
578 // Remove the Sending... note |
|
579 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
|
580 |
|
581 // Prompt for speed dial number |
|
582 HBufC* emptyString = HBufC::NewLC( KPhoneNumberEntryBufferSize ); |
|
583 TPtr ptr( emptyString->Des() ); |
|
584 |
|
585 // If the Search softkey is selected before a speed dial number is entered, |
|
586 // revert back to the DTMF query |
|
587 ShowDtmfTextQueryL( |
|
588 CPhoneMainResourceResolver::Instance()-> |
|
589 ResolveResourceID( EPhoneDtmfSpeedDialNumberQuery ), |
|
590 CPhoneMainResourceResolver::Instance()-> |
|
591 ResolveResourceID( EPhoneSendDtmfEmptyEditBoxCBA ), |
|
592 CPhoneMainResourceResolver::Instance()-> |
|
593 ResolveResourceID( EPhoneDtmfSpeedDialNormalEditBoxCBA ), |
|
594 &ptr ); |
|
595 |
|
596 CleanupStack::PopAndDestroy( emptyString ); |
|
597 } |
|
598 |
|
599 // ----------------------------------------------------------- |
502 // CPhoneStateInCall::HandleCommandL |
600 // CPhoneStateInCall::HandleCommandL |
503 // ----------------------------------------------------------- |
601 // ----------------------------------------------------------- |
504 // |
602 // |
505 EXPORT_C TBool CPhoneStateInCall::HandleCommandL( TInt aCommand ) |
603 EXPORT_C TBool CPhoneStateInCall::HandleCommandL( TInt aCommand ) |
506 { |
604 { |
511 TBool commandStatus = ETrue; |
609 TBool commandStatus = ETrue; |
512 |
610 |
513 switch( aCommand ) |
611 switch( aCommand ) |
514 { |
612 { |
515 case EPhoneInCallCmdDialer: |
613 case EPhoneInCallCmdDialer: |
516 iViewCommandHandle->ExecuteCommandL( EPhoneViewOpenDialer ); |
614 BeginTransEffectLC( ECallUiDisappear ); |
517 break; |
615 if ( !IsNumberEntryUsedL() ) |
|
616 { |
|
617 CreateNumberEntryL(); |
|
618 } |
|
619 SetNumberEntryVisibilityL( ETrue ); |
|
620 EndTransEffect(); |
|
621 break; |
|
622 |
518 case EPhoneCmdOptions: |
623 case EPhoneCmdOptions: |
|
624 OpenMenuBarL(); |
519 break; |
625 break; |
520 |
626 |
521 case EPhoneDtmfDialerCancel: |
627 case EPhoneDtmfDialerCancel: |
522 { |
628 { |
|
629 CloseDTMFEditorL(); |
|
630 |
523 // Activate DTMF list query when cancel is pressed. |
631 // Activate DTMF list query when cancel is pressed. |
524 // Forwards command to the framework |
632 // Forwards command to the framework |
525 HandleCommandL( EPhoneInCallCmdDtmfListQuery ); |
633 if ( !iStateMachine->SecurityMode()->IsSecurityMode() ) |
|
634 { |
|
635 HandleCommandL( EPhoneInCallCmdDtmfListQuery ); |
|
636 } |
526 } |
637 } |
527 break; |
638 break; |
|
639 |
528 case EPhoneDtmfDialerExit: |
640 case EPhoneDtmfDialerExit: |
529 { |
641 { |
|
642 CloseDTMFEditorL(); |
530 } |
643 } |
531 break; |
644 break; |
532 |
645 |
533 case EPhoneInCallCmdEndThisActiveCall: |
646 case EPhoneInCallCmdEndThisActiveCall: |
534 CPhoneState::DisconnectCallL(); |
647 CPhoneState::DisconnectCallL(); |
547 iStateMachine->SendPhoneEngineMessage( |
660 iStateMachine->SendPhoneEngineMessage( |
548 MPEPhoneModel::EPEMessageSetAudioMute ); |
661 MPEPhoneModel::EPEMessageSetAudioMute ); |
549 break; |
662 break; |
550 //DTMF list query - dialog |
663 //DTMF list query - dialog |
551 case EPhoneInCallCmdDtmfListQuery: |
664 case EPhoneInCallCmdDtmfListQuery: |
552 LaunchDtmfListQueryL(); |
665 if ( iStateMachine->SecurityMode()->IsSecurityMode() ) |
|
666 { |
|
667 HandleCommandL( EPhoneInCallCmdDtmfManualQuery ); |
|
668 } |
|
669 else |
|
670 { |
|
671 LaunchDtmfListQueryL(); |
|
672 } |
553 break; |
673 break; |
554 |
674 |
555 //DTMF list query - Search |
675 //DTMF list query - Search |
556 case EPhoneInCallCmdDtmfListViewSearch: |
676 case EPhoneInCallCmdDtmfListViewSearch: |
|
677 LaunchDtmfListViewSearchDialogL(); |
557 break; |
678 break; |
558 |
679 |
559 //DTMF manual entry |
680 //DTMF manual entry |
560 case EPhoneInCallCmdDtmfManualQuery: |
681 case EPhoneInCallCmdDtmfManualQuery: |
|
682 if ( iOnScreenDialer ) |
|
683 { |
|
684 ShowDtmfDialerL(); |
|
685 } |
|
686 else |
|
687 { |
|
688 LaunchDtmfManualQueryL(); |
|
689 } |
561 break; |
690 break; |
562 |
691 |
563 // DTMF manual entry - Search |
692 // DTMF manual entry - Search |
564 case EPhoneCmdDtmfSearch: |
693 case EPhoneCmdDtmfSearch: |
|
694 LaunchDtmfSearchDialogL(); |
565 break; |
695 break; |
566 |
696 |
567 // DTMF entry - Ok |
697 // DTMF entry - Ok |
568 case EPhoneCmdDtmfOk: |
698 case EPhoneCmdDtmfOk: |
569 SendDtmfL(); |
699 SendDtmfL(); |
|
700 break; |
|
701 |
|
702 // DTMF Speed entry - Ok |
|
703 case EPhoneCmdDtmfSpeedDialOk: |
|
704 SendDtmfSpeedDialNumberL(); |
570 break; |
705 break; |
571 |
706 |
572 // DTMF sending - Cancel |
707 // DTMF sending - Cancel |
573 case EPhoneInCallCmdCancelSendingDtmfString: |
708 case EPhoneInCallCmdCancelSendingDtmfString: |
574 // Stop the asynchronous sending operation the |
709 // Stop the asynchronous sending operation the |
587 iDtmfWaitCharTimer = CPhoneDtmfWaitCharTimer::NewL( |
722 iDtmfWaitCharTimer = CPhoneDtmfWaitCharTimer::NewL( |
588 iStateMachine ); |
723 iStateMachine ); |
589 } |
724 } |
590 iDtmfWaitCharTimer->ButtonPressedL(); |
725 iDtmfWaitCharTimer->ButtonPressedL(); |
591 break; |
726 break; |
|
727 |
|
728 case EPhoneDialerCmdHelpDtmf: |
|
729 { |
|
730 if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) |
|
731 { |
|
732 TPtrC contextName( KDATA_DIALER_HLP_SEND_DTMF ); |
|
733 iViewCommandHandle->ExecuteCommandL( |
|
734 EPhoneViewLaunchHelpApplication, |
|
735 0, |
|
736 contextName ); |
|
737 } |
|
738 } |
|
739 break; |
592 |
740 |
593 // New Call - Search |
741 // New Call - Search |
594 case EPhoneInCallCmdNewCallFind: |
742 case EPhoneInCallCmdNewCallFind: |
|
743 LaunchNewCallSearchDialogL(); |
595 break; |
744 break; |
596 |
745 |
597 // New Call - Dialog |
746 // New Call - Dialog |
598 case EPhoneInCallCmdNewCall: |
747 case EPhoneInCallCmdNewCall: |
|
748 LaunchNewCallQueryL(); |
|
749 break; |
|
750 |
|
751 case EPhoneViewYesSingleItemFetch: |
|
752 HandleSuccessFetchedNumberL(); |
|
753 break; |
|
754 |
|
755 case EPhoneViewNoSingleItemFetch: |
|
756 if ( !iOnScreenDialer ) |
|
757 { |
|
758 HandleFailedFetchedNumberL(); |
|
759 } |
599 break; |
760 break; |
600 |
761 |
601 case EPhoneNumberAcqCmdCall: |
762 case EPhoneNumberAcqCmdCall: |
602 case EPhoneNumberAcqCmdSendCommand: |
763 case EPhoneNumberAcqCmdSendCommand: |
603 if ( IsVideoCallActiveL() ) |
764 if ( IsVideoCallActiveL() ) |
671 break; |
849 break; |
672 |
850 |
673 case EPhoneViewOpenCallHandling: |
851 case EPhoneViewOpenCallHandling: |
674 if ( iOnScreenDialer && IsNumberEntryUsedL() ) |
852 if ( iOnScreenDialer && IsNumberEntryUsedL() ) |
675 { |
853 { |
|
854 BeginTransEffectLC( ECallUiAppear ); |
676 // Remove number entry from screen |
855 // Remove number entry from screen |
677 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
856 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
857 EndTransEffect(); |
678 HandleNumberEntryClearedL(); |
858 HandleNumberEntryClearedL(); |
679 } |
859 } |
680 commandStatus = CPhoneState::HandleCommandL( aCommand ); |
860 commandStatus = CPhoneState::HandleCommandL( aCommand ); |
681 break; |
861 break; |
682 |
862 |
|
863 case EPhoneInCallCmdShareLiveVideo: |
|
864 iViewCommandHandle->ExecuteCommandL( EPhoneViewLaunchMultimediaSharing ); |
|
865 break; |
|
866 |
683 default: |
867 default: |
684 commandStatus = CPhoneState::HandleCommandL( aCommand ); |
868 commandStatus = CPhoneState::HandleCommandL( aCommand ); |
685 break; |
869 break; |
686 } |
870 } |
687 |
871 |
688 return commandStatus; |
872 return commandStatus; |
|
873 } |
|
874 |
|
875 // ----------------------------------------------------------- |
|
876 // CPhoneStateInCall::CreateNumberEntryL |
|
877 // ----------------------------------------------------------- |
|
878 // |
|
879 EXPORT_C void CPhoneStateInCall::CreateNumberEntryL() |
|
880 { |
|
881 __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateInCall::CreateNumberEntryL( ) "); |
|
882 iViewCommandHandle->ExecuteCommandL( EPhoneViewCreateNumberEntry ); |
|
883 } |
|
884 |
|
885 // ----------------------------------------------------------- |
|
886 // CPhoneStateInCall::OpenMenuBarL |
|
887 // ----------------------------------------------------------- |
|
888 // |
|
889 EXPORT_C void CPhoneStateInCall::OpenMenuBarL() |
|
890 { |
|
891 __LOGMETHODSTARTEND(EPhoneControl, |
|
892 "CPhoneStateInCall::OpenMenuBarL()" ); |
|
893 TInt resourceId; |
|
894 |
|
895 if ( iOnScreenDialer && IsDTMFEditorVisibleL() ) |
|
896 { |
|
897 resourceId = EPhoneDtmfDialerMenubar; |
|
898 } |
|
899 else if ( iOnScreenDialer && IsCustomizedDialerVisibleL() ) |
|
900 { |
|
901 resourceId = CustomizedDialerMenuResourceIdL(); |
|
902 } |
|
903 else if ( IsNumberEntryVisibleL() ) |
|
904 { |
|
905 resourceId = EPhoneCallHandlingMenubarWithNumberEntry; |
|
906 } |
|
907 else |
|
908 { |
|
909 resourceId = EPhoneCallHandlingMenubar; |
|
910 } |
|
911 |
|
912 TPhoneCmdParamInteger integerParam; |
|
913 integerParam.SetInteger( |
|
914 CPhoneMainResourceResolver::Instance()-> |
|
915 ResolveResourceID( resourceId ) ); |
|
916 iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, |
|
917 &integerParam ); |
|
918 } |
|
919 |
|
920 // ----------------------------------------------------------- |
|
921 // CPhoneStateInCall::LaunchNewCallQueryL |
|
922 // ----------------------------------------------------------- |
|
923 // |
|
924 EXPORT_C void CPhoneStateInCall::LaunchNewCallQueryL() |
|
925 { |
|
926 __LOGMETHODSTARTEND(EPhoneControl, |
|
927 "CPhoneStateInCall::LaunchNewCallQueryL()" ); |
|
928 |
|
929 if ( iOnScreenDialer ) |
|
930 { |
|
931 //In touch, just activate dialer |
|
932 BeginTransEffectLC( ECallUiDisappear ); |
|
933 if ( IsNumberEntryUsedL() ) |
|
934 { |
|
935 SetNumberEntryVisibilityL(ETrue); |
|
936 } |
|
937 else |
|
938 { |
|
939 CreateNumberEntryL(); |
|
940 SetNumberEntryVisibilityL(ETrue); |
|
941 } |
|
942 EndTransEffect(); |
|
943 } |
|
944 else |
|
945 { |
|
946 HBufC *text = HBufC::NewLC( KPhoneNumberEntryBufferSize ); |
|
947 TPtr ptr( text->Des() ); |
|
948 |
|
949 // Pre-populate the query with the number entry contents, |
|
950 // if it exists |
|
951 if ( IsNumberEntryUsedL() ) |
|
952 { |
|
953 // get the number entry contents |
|
954 TPhoneCmdParamString stringParam; |
|
955 stringParam.SetString( &ptr ); |
|
956 iViewCommandHandle->ExecuteCommandL( |
|
957 EPhoneViewGetLocalizedNumberFromEntry, |
|
958 &stringParam ); |
|
959 } |
|
960 |
|
961 // Show text query with send key enabled |
|
962 const TBool enableSendKey = ETrue; |
|
963 |
|
964 CPhoneState::ShowTextQueryL( |
|
965 CPhoneMainResourceResolver::Instance()-> |
|
966 ResolveResourceID( EPhoneNewCallPhoneNumberEditor ), |
|
967 CPhoneMainResourceResolver::Instance()-> |
|
968 ResolveResourceID( EPhoneCallHandlingNewCallFindCBA ), |
|
969 CPhoneMainResourceResolver::Instance()-> |
|
970 ResolveResourceID( EPhoneCallHandlingNewCallCallCBA ), |
|
971 &ptr, |
|
972 enableSendKey ); |
|
973 |
|
974 CleanupStack::PopAndDestroy( text ); |
|
975 } |
|
976 |
689 } |
977 } |
690 |
978 |
691 // ----------------------------------------------------------- |
979 // ----------------------------------------------------------- |
692 // CPhoneStateInCall::CallFetchedNumberL |
980 // CPhoneStateInCall::CallFetchedNumberL |
693 // ----------------------------------------------------------- |
981 // ----------------------------------------------------------- |
721 TPhoneCmdParamString dtmfSequence; |
1009 TPhoneCmdParamString dtmfSequence; |
722 HBufC *content = HBufC::NewLC( KPEDtmfMaxLength ); |
1010 HBufC *content = HBufC::NewLC( KPEDtmfMaxLength ); |
723 TPtr ptr( content->Des() ); |
1011 TPtr ptr( content->Des() ); |
724 dtmfSequence.SetString( &ptr ); |
1012 dtmfSequence.SetString( &ptr ); |
725 |
1013 |
726 if ( iOnScreenDialer ) |
1014 if ( iOnScreenDialer && IsDTMFEditorVisibleL() ) |
727 { |
1015 { |
728 iViewCommandHandle->ExecuteCommand( |
1016 iViewCommandHandle->ExecuteCommand( |
729 EPhoneViewGetNumberFromEntry, |
1017 EPhoneViewGetNumberFromEntry, |
730 &dtmfSequence ); |
1018 &dtmfSequence ); |
731 |
1019 |
732 } |
1020 CloseDTMFEditorL(); |
|
1021 } |
|
1022 else |
|
1023 { |
|
1024 iViewCommandHandle->ExecuteCommandL( EPhoneViewGetTextQueryContent, |
|
1025 &dtmfSequence ); |
|
1026 } |
733 |
1027 |
734 // Send the DTMF |
1028 // Send the DTMF |
735 if ( ptr.Length() ) |
1029 if ( ptr.Length() ) |
736 { |
1030 { |
737 iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( ptr ); |
1031 iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( ptr ); |
738 iStateMachine->SendPhoneEngineMessage( |
1032 iStateMachine->SendPhoneEngineMessage( |
739 MPEPhoneModel::EPEMessageSendDTMF ); |
1033 MPEPhoneModel::EPEMessageSendDTMF ); |
740 } |
1034 } |
741 |
1035 |
742 CleanupStack::PopAndDestroy( content ); |
1036 CleanupStack::PopAndDestroy( content ); |
|
1037 } |
|
1038 |
|
1039 // ----------------------------------------------------------- |
|
1040 // CPhoneStateInCall::SendDtmfSpeedDialNumberL |
|
1041 // ----------------------------------------------------------- |
|
1042 // |
|
1043 void CPhoneStateInCall::SendDtmfSpeedDialNumberL() |
|
1044 { |
|
1045 __LOGMETHODSTARTEND(EPhoneControl, |
|
1046 "CPhoneStateInCall::SendDtmfSpeedDialNumberL()" ); |
|
1047 // First get the DTMF sequence from dialog |
|
1048 TPhoneCmdParamString dtmfSequence; |
|
1049 HBufC *content = HBufC::NewLC( KPEDtmfMaxLength ); |
|
1050 TPtr ptr( content->Des() ); |
|
1051 dtmfSequence.SetString( &ptr ); |
|
1052 iViewCommandHandle->ExecuteCommandL( EPhoneViewGetTextQueryContent, |
|
1053 &dtmfSequence ); |
|
1054 |
|
1055 // Prefix the query content string with the speed dial character '+' |
|
1056 _LIT( KSpeedDialPrefix, "+" ); |
|
1057 ptr.Insert( 0, KSpeedDialPrefix ); |
|
1058 |
|
1059 // Send the DTMF |
|
1060 iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( ptr ); |
|
1061 iStateMachine->SendPhoneEngineMessage( |
|
1062 MPEPhoneModel::EPEMessageSendDTMF ); |
|
1063 |
|
1064 CleanupStack::PopAndDestroy( content ); |
|
1065 } |
|
1066 |
|
1067 // ----------------------------------------------------------- |
|
1068 // CPhoneStateInCall::LaunchDtmfManualQueryL |
|
1069 // ----------------------------------------------------------- |
|
1070 // |
|
1071 void CPhoneStateInCall::LaunchDtmfManualQueryL() |
|
1072 { |
|
1073 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateInCall::LaunchDtmfManualQueryL()" ); |
|
1074 |
|
1075 HBufC *text = HBufC::NewLC( KPhoneNumberEntryBufferSize ); |
|
1076 TPtr ptr( text->Des() ); |
|
1077 // Pre-populate the query with the number entry contents, if it exists |
|
1078 if ( IsNumberEntryUsedL() ) |
|
1079 { |
|
1080 // get the number entry contents |
|
1081 TPhoneCmdParamString stringParam; |
|
1082 stringParam.SetString( &ptr ); |
|
1083 iViewCommandHandle->ExecuteCommandL( |
|
1084 EPhoneViewGetLocalizedNumberFromEntry, |
|
1085 &stringParam ); |
|
1086 } |
|
1087 |
|
1088 ShowDtmfTextQueryL( |
|
1089 CPhoneMainResourceResolver::Instance()-> |
|
1090 ResolveResourceID( EPhoneDtmfNumberQuery ), |
|
1091 CPhoneMainResourceResolver::Instance()-> |
|
1092 ResolveResourceID( EPhoneSendDtmfEmptyEditBoxCBA ), |
|
1093 CPhoneMainResourceResolver::Instance()-> |
|
1094 ResolveResourceID( EPhoneSendDtmfNormalEditBoxCBA ), |
|
1095 &ptr ); |
|
1096 CleanupStack::PopAndDestroy( text ); |
743 } |
1097 } |
744 |
1098 |
745 // ----------------------------------------------------------- |
1099 // ----------------------------------------------------------- |
746 // CPhoneStateInCall::LaunchDtmfListQueryL |
1100 // CPhoneStateInCall::LaunchDtmfListQueryL |
747 // ----------------------------------------------------------- |
1101 // ----------------------------------------------------------- |
811 |
1165 |
812 // Display dialog |
1166 // Display dialog |
813 iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery, |
1167 iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery, |
814 &queryDialogParam ); |
1168 &queryDialogParam ); |
815 } |
1169 } |
816 } |
1170 } |
|
1171 |
|
1172 // ----------------------------------------------------------- |
|
1173 // CPhoneStateInCall::LaunchDtmfSearchDialogL |
|
1174 // ----------------------------------------------------------- |
|
1175 // |
|
1176 void CPhoneStateInCall::LaunchDtmfSearchDialogL() |
|
1177 { |
|
1178 __LOGMETHODSTARTEND(EPhoneControl, |
|
1179 "CPhoneStateInCall::LaunchDtmfSearchDialogL()" ); |
|
1180 |
|
1181 TPhoneCmdParamInteger integerParam; |
|
1182 integerParam.SetInteger( EPhoneDtmfNumberQuery ); |
|
1183 iViewCommandHandle->HandleCommandL( EPhoneViewOpenSingleItemFetchDialog, &integerParam ); |
|
1184 } |
|
1185 |
|
1186 // ----------------------------------------------------------- |
|
1187 // CPhoneStateInCall::LaunchDtmfListViewSearchDialogL |
|
1188 // ----------------------------------------------------------- |
|
1189 // |
|
1190 void CPhoneStateInCall::LaunchDtmfListViewSearchDialogL() |
|
1191 { |
|
1192 __LOGMETHODSTARTEND(EPhoneControl, |
|
1193 "CPhoneStateInCall::LaunchDtmfListViewSearchDialogL()" ); |
|
1194 |
|
1195 TPhoneCmdParamInteger integerParam; |
|
1196 integerParam.SetInteger( EPhoneDtmfFetchTitle ); |
|
1197 iViewCommandHandle->HandleCommandL( EPhoneViewOpenSingleItemFetchDialog, &integerParam ); |
|
1198 } |
|
1199 |
|
1200 // ----------------------------------------------------------- |
|
1201 // CPhoneStateInCall::LaunchNewCallSearchDialogL |
|
1202 // ----------------------------------------------------------- |
|
1203 // |
|
1204 void CPhoneStateInCall::LaunchNewCallSearchDialogL() |
|
1205 { |
|
1206 __LOGMETHODSTARTEND(EPhoneControl, |
|
1207 "CPhoneStateInCall::LaunchNewCallSearchDialogL()" ); |
|
1208 |
|
1209 TPhoneCmdParamBoolean blockingDialogStatus; |
|
1210 iViewCommandHandle->ExecuteCommandL( EPhoneViewGetBlockingDialogStatus, |
|
1211 &blockingDialogStatus ); |
|
1212 // Prevents unlegal use of singleitem fetch |
|
1213 if ( !blockingDialogStatus.Boolean() ) |
|
1214 { |
|
1215 |
|
1216 TPhoneCmdParamInteger integerParam; |
|
1217 integerParam.SetInteger( EPhoneNewCallFetchTitle ); |
|
1218 iViewCommandHandle->HandleCommandL( EPhoneViewOpenSingleItemFetchDialog, &integerParam ); |
|
1219 } |
|
1220 } |
817 |
1221 |
818 // --------------------------------------------------------- |
1222 // --------------------------------------------------------- |
819 // CPhoneStateInCall::IsVideoCallActiveL |
1223 // CPhoneStateInCall::IsVideoCallActiveL |
820 // --------------------------------------------------------- |
1224 // --------------------------------------------------------- |
821 // |
1225 // |
963 { |
1367 { |
964 iViewCommandHandle->ExecuteCommandL( |
1368 iViewCommandHandle->ExecuteCommandL( |
965 EPhoneViewEnableKeyLock ); |
1369 EPhoneViewEnableKeyLock ); |
966 } |
1370 } |
967 } |
1371 } |
|
1372 |
|
1373 // ----------------------------------------------------------------------------- |
|
1374 // CPhoneStateInCall::HandleSuccessFetchedNumberL |
|
1375 // ----------------------------------------------------------------------------- |
|
1376 // |
|
1377 void CPhoneStateInCall::HandleSuccessFetchedNumberL() |
|
1378 { |
|
1379 __LOGMETHODSTARTEND(EPhoneControl, |
|
1380 "CPhoneStateInCall::HandleSuccessFetchedNumberL()"); |
|
1381 TBuf<KPhoneNumberEntryBufferSize> fetchContent; |
|
1382 fetchContent = iViewCommandHandle->FetchContent(); |
|
1383 |
|
1384 TPhoneCmdParamInteger fetchTypeParam; |
|
1385 iViewCommandHandle->ExecuteCommand( EPhoneViewGetSingleItemFetchType, |
|
1386 &fetchTypeParam ); |
|
1387 TInt fetchType( fetchTypeParam.Integer() ); |
|
1388 |
|
1389 if ( fetchType == EPhoneNewCallFetchTitle ) |
|
1390 { |
|
1391 if ( iOnScreenDialer ) |
|
1392 { |
|
1393 iViewCommandHandle->ExecuteCommandL( |
|
1394 EPhoneViewSetNumberEntryContent, |
|
1395 0, |
|
1396 fetchContent ); |
|
1397 } |
|
1398 // Call the fetched number |
|
1399 CallFetchedNumberL( fetchContent ); |
|
1400 } |
|
1401 else if ( fetchType == EPhoneDtmfFetchTitle ) |
|
1402 { |
|
1403 // Send the DTMF |
|
1404 iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( fetchContent ); |
|
1405 iStateMachine->SendPhoneEngineMessage( |
|
1406 MPEPhoneModel::EPEMessageSendDTMF ); |
|
1407 } |
|
1408 else if( iCustomization && fetchType > EPhoneRssBaseLast ) |
|
1409 { |
|
1410 // Handle unattended transfer contact fetch |
|
1411 iCustomization->HandleCommandL( fetchType ); |
|
1412 } |
|
1413 else // EPhoneCmdDtmfSearch |
|
1414 { |
|
1415 // Send the DTMF |
|
1416 iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( fetchContent ); |
|
1417 iStateMachine->SendPhoneEngineMessage( |
|
1418 MPEPhoneModel::EPEMessageSendDTMF ); |
|
1419 } |
|
1420 } |
|
1421 |
|
1422 // ----------------------------------------------------------------------------- |
|
1423 // CPhoneStateInCall::HandleFailedFetchedNumberL |
|
1424 // ----------------------------------------------------------------------------- |
|
1425 // |
|
1426 void CPhoneStateInCall::HandleFailedFetchedNumberL() |
|
1427 { |
|
1428 __LOGMETHODSTARTEND(EPhoneControl, |
|
1429 "CPhoneStateInCall::HandleFailedFetchedNumberL()"); |
|
1430 |
|
1431 TPhoneCmdParamInteger fetchTypeParam; |
|
1432 iViewCommandHandle->ExecuteCommand( EPhoneViewGetSingleItemFetchType, |
|
1433 &fetchTypeParam ); |
|
1434 TInt fetchType( fetchTypeParam.Integer() ); |
|
1435 |
|
1436 if ( fetchType == EPhoneNewCallFetchTitle ) |
|
1437 { |
|
1438 HandleCommandL( EPhoneInCallCmdNewCall ); |
|
1439 } |
|
1440 else if ( fetchType == EPhoneDtmfFetchTitle ) |
|
1441 { |
|
1442 HandleCommandL( EPhoneInCallCmdDtmfListQuery ); |
|
1443 } |
|
1444 else // EPhoneCmdDtmfSearch |
|
1445 { |
|
1446 HandleCommandL( EPhoneDtmfFetchTitle ); |
|
1447 } |
|
1448 } |
|
1449 |
968 |
1450 |
969 // ----------------------------------------------------------------------------- |
1451 // ----------------------------------------------------------------------------- |
970 // CPhoneStateInCall::CloseDtmfQueryL |
1452 // CPhoneStateInCall::CloseDtmfQueryL |
971 // ----------------------------------------------------------------------------- |
1453 // ----------------------------------------------------------------------------- |
972 // |
1454 // |
973 EXPORT_C void CPhoneStateInCall::CloseDtmfQueryL() |
1455 EXPORT_C void CPhoneStateInCall::CloseDtmfQueryL() |
974 { |
1456 { |
|
1457 __LOGMETHODSTARTEND(EPhoneControl, |
|
1458 "CPhoneStateInCall::CloseDtmfQueryL()"); |
|
1459 TPhoneCmdParamInteger fetchTypeParam; |
|
1460 iViewCommandHandle->ExecuteCommand( EPhoneViewGetSingleItemFetchType, |
|
1461 &fetchTypeParam ); |
|
1462 TInt fetchType( fetchTypeParam.Integer() ); |
|
1463 |
|
1464 // If DTMF fetch is active then remove numberentry because it is considered |
|
1465 // to be a part of DTMF fetch operation. |
|
1466 if ( fetchType == EPhoneDtmfFetchTitle ) |
|
1467 { |
|
1468 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
1469 iViewCommandHandle->ExecuteCommand( EPhoneViewCloseSingleItemFetchDialog ); |
|
1470 } |
|
1471 |
|
1472 // Close dtmf dialer or dtmf query if exist. |
|
1473 if ( IsDTMFEditorVisibleL() ) |
|
1474 { |
|
1475 CloseDTMFEditorL(); |
|
1476 } |
975 } |
1477 } |
|
1478 |
|
1479 // ----------------------------------------------------------- |
|
1480 // CPhoneStateInCall::PhoneNumberAvailableInPhoneEngineL |
|
1481 // ----------------------------------------------------------- |
|
1482 // |
|
1483 EXPORT_C void CPhoneStateInCall::PhoneNumberAvailableInPhoneEngineL( TInt aCallId ) |
|
1484 { |
|
1485 __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateInCall::PhoneNumberAvailableInPhoneEngineL() "); |
|
1486 TPhoneCmdParamBoolean phoneNumberAvailable; |
|
1487 |
|
1488 const TBool contactInfoAvailable = |
|
1489 iStateMachine->PhoneEngineInfo()->RemoteName( aCallId ).Length() || |
|
1490 iStateMachine->PhoneEngineInfo()->RemoteCompanyName( aCallId ).Length(); |
|
1491 |
|
1492 if( iStateMachine->PhoneEngineInfo()->RemotePhoneNumber( aCallId ).Length() || |
|
1493 contactInfoAvailable ) |
|
1494 { |
|
1495 // Phone number is available straight or via contact info |
|
1496 // so switch to video/voice call is possible |
|
1497 __PHONELOG( EBasic, EPhoneControl, "CPhoneStateInCall::PhoneNumberAvailableInPhoneEngineL - Phonenumber is available" ); |
|
1498 phoneNumberAvailable.SetBoolean( ETrue ); |
|
1499 } |
|
1500 else |
|
1501 { |
|
1502 __PHONELOG( EBasic, EPhoneControl, "CPhoneStateInCall::PhoneNumberAvailableInPhoneEngineL - Phonenumber is not available" ); |
|
1503 phoneNumberAvailable.SetBoolean( EFalse ); |
|
1504 } |
|
1505 |
|
1506 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetPhoneNumberAvailableInPhoneEngine, |
|
1507 &phoneNumberAvailable ); |
|
1508 } |
976 |
1509 |
977 |
1510 |
978 // ----------------------------------------------------------------------------- |
1511 // ----------------------------------------------------------------------------- |
979 // CPhoneStateInCall::HandleEndKeyPressL |
1512 // CPhoneStateInCall::HandleEndKeyPressL |
980 // ----------------------------------------------------------------------------- |
1513 // ----------------------------------------------------------------------------- |
992 iViewCommandHandle->HandleCommandL( |
1525 iViewCommandHandle->HandleCommandL( |
993 EPhoneViewGetCallIdByState, &callStateData ); |
1526 EPhoneViewGetCallIdByState, &callStateData ); |
994 |
1527 |
995 if( IsVideoCall( callStateData.CallId() ) ) |
1528 if( IsVideoCall( callStateData.CallId() ) ) |
996 { |
1529 { |
997 // Video call can be released only after we get response to VT Shutdown Command |
1530 // Video call can be released only after we get response to VT Shutdown Command |
998 CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( |
1531 CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( |
999 KMediatorVideoTelephonyDomain, |
1532 KMediatorVideoTelephonyDomain, |
1000 KCatPhoneToVideotelCommands, |
1533 KCatPhoneToVideotelCommands, |
1001 EVtCmdReleaseDataport, |
1534 EVtCmdReleaseDataport, |
1002 TVersion( KPhoneToVideotelCmdVersionMajor, |
1535 TVersion( KPhoneToVideotelCmdVersionMajor, |