25 #include <aknnotedialog.h> // For CAknNoteDialog::EErrorTone |
25 #include <aknnotedialog.h> // For CAknNoteDialog::EErrorTone |
26 #include <apgcli.h> |
26 #include <apgcli.h> |
27 #include <telephonyvariant.hrh> |
27 #include <telephonyvariant.hrh> |
28 #include <featmgr.h> |
28 #include <featmgr.h> |
29 #include <settingsinternalcrkeys.h> |
29 #include <settingsinternalcrkeys.h> |
|
30 #include <ScreensaverInternalPSKeys.h> |
30 #include <mpeengineinfo.h> |
31 #include <mpeengineinfo.h> |
|
32 #include <activeidle2domainpskeys.h> |
31 #include <mpeclientinformation.h> |
33 #include <mpeclientinformation.h> |
32 #include <bldvariant.hrh> |
34 #include <bldvariant.hrh> |
|
35 #include <MProEngEngine.h> |
|
36 #include <ProEngFactory.h> |
33 |
37 |
34 #include "cphonepubsubproxy.h" |
38 #include "cphonepubsubproxy.h" |
35 #include "cphonecenrepproxy.h" |
39 #include "cphonecenrepproxy.h" |
36 #include "cphonestateidle.h" |
40 #include "cphonestateidle.h" |
37 #include "tphonecmdparaminteger.h" |
41 #include "tphonecmdparaminteger.h" |
38 #include "tphonecmdparamboolean.h" |
42 #include "tphonecmdparamboolean.h" |
39 #include "tphonecmdparamglobalnote.h" |
43 #include "tphonecmdparamglobalnote.h" |
40 #include "tphonecmdparamkeycapture.h" |
|
41 #include "tphonecmdparamstring.h" |
44 #include "tphonecmdparamstring.h" |
|
45 #include "tphonecmdparamspeeddial.h" |
42 #include "tphonecmdparamboolean.h" |
46 #include "tphonecmdparamboolean.h" |
43 #include "mphonestatemachine.h" |
47 #include "mphonestatemachine.h" |
44 #include "phonestatedefinitions.h" |
48 #include "phonestatedefinitions.h" |
45 #include "tphonecmdparamappinfo.h" |
49 #include "tphonecmdparamappinfo.h" |
46 #include "cphonekeys.h" |
50 #include "cphonekeys.h" |
47 |
51 |
48 #include "tphonecmdparamcallstatedata.h" |
52 #include "tphonecmdparamcallstatedata.h" |
|
53 #include "tphonecmdparamcallheaderdata.h" |
49 #include "phoneviewcommanddefinitions.h" |
54 #include "phoneviewcommanddefinitions.h" |
50 #include "phoneui.hrh" |
55 #include "phoneui.hrh" |
51 #include "phonerssbase.h" |
56 #include "phonerssbase.h" |
52 #include "cphonemainresourceresolver.h" |
57 #include "cphonemainresourceresolver.h" |
53 #include "cphonecenrepproxy.h" |
58 #include "cphonecenrepproxy.h" |
54 #include "cphonepubsubproxy.h" |
59 #include "cphonepubsubproxy.h" |
55 #include "phonelogger.h" |
60 #include "phonelogger.h" |
56 #include "phoneui.pan" |
61 #include "phoneui.pan" |
|
62 #include "phoneconstants.h" |
57 #include "mphonecustomization.h" |
63 #include "mphonecustomization.h" |
58 |
64 #include <easydialingcommands.hrh> |
|
65 #include "mphonesecuritymodeobserver.h" |
|
66 |
|
67 //CONSTANTS |
|
68 const TInt KMaxParamLength = 1024; |
59 |
69 |
60 // ================= MEMBER FUNCTIONS ======================= |
70 // ================= MEMBER FUNCTIONS ======================= |
61 |
71 |
62 // C++ default constructor can NOT contain any code, that |
72 // C++ default constructor can NOT contain any code, that |
63 // might leave. |
73 // might leave. |
64 // |
74 // |
65 EXPORT_C CPhoneStateIdle::CPhoneStateIdle( |
75 EXPORT_C CPhoneStateIdle::CPhoneStateIdle( |
66 MPhoneStateMachine* aStateMachine, |
76 MPhoneStateMachine* aStateMachine, |
67 MPhoneViewCommandHandle* aViewCommandHandle, |
77 MPhoneViewCommandHandle* aViewCommandHandle, |
68 MPhoneCustomization* aCustomization ) : |
78 MPhoneCustomization* aCustomization ) : |
69 CPhoneState( aStateMachine, aViewCommandHandle, aCustomization ) |
79 CPhoneState( aStateMachine, aViewCommandHandle, aCustomization ), |
|
80 iCallInitialized( EFalse ) |
70 { |
81 { |
71 } |
82 } |
72 |
83 |
73 // Destructor |
84 // Destructor |
74 EXPORT_C CPhoneStateIdle::~CPhoneStateIdle() |
85 EXPORT_C CPhoneStateIdle::~CPhoneStateIdle() |
81 // |
92 // |
82 EXPORT_C void CPhoneStateIdle::ConstructL() |
93 EXPORT_C void CPhoneStateIdle::ConstructL() |
83 { |
94 { |
84 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::ConstructL() "); |
95 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::ConstructL() "); |
85 CPhoneState::BaseConstructL(); |
96 CPhoneState::BaseConstructL(); |
|
97 |
|
98 // Set send key activation on. |
|
99 TPhoneCmdParamBoolean boolean; |
|
100 boolean.SetBoolean( ETrue ); |
|
101 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetSendKeyDialerActivationFlag, |
|
102 &boolean ); |
|
103 |
|
104 iViewCommandHandle->ExecuteCommandL( EPhoneViewCreatePhoneBookServices ); |
|
105 |
|
106 // If Sim is not ok and we are not at foreground, bring ourselves to foreground |
|
107 // so that the security note can be seen. |
|
108 TPhoneCmdParamInteger foregroundAppParam; |
|
109 iViewCommandHandle->ExecuteCommandL( EPhoneViewGetForegroundApplication, |
|
110 &foregroundAppParam ); |
|
111 |
|
112 if ( !IsSimOk() ) |
|
113 { |
|
114 TPhoneCmdParamInteger uidParam; |
|
115 // Bring Phone app in the foreground |
|
116 uidParam.SetInteger( KUidPhoneApplication.iUid ); |
|
117 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
|
118 &uidParam ); |
|
119 |
|
120 // Set Phone as the top application |
|
121 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication, |
|
122 &uidParam ); |
|
123 } |
86 } |
124 } |
87 |
125 |
88 // ----------------------------------------------------------- |
126 // ----------------------------------------------------------- |
89 // CPhoneStateIdle::NewL() |
127 // CPhoneStateIdle::NewL() |
90 // ----------------------------------------------------------- |
128 // ----------------------------------------------------------- |
111 EXPORT_C void CPhoneStateIdle::HandleKeyEventL( |
149 EXPORT_C void CPhoneStateIdle::HandleKeyEventL( |
112 const TKeyEvent& aKeyEvent, |
150 const TKeyEvent& aKeyEvent, |
113 TEventCode aEventCode ) |
151 TEventCode aEventCode ) |
114 { |
152 { |
115 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleKeyEventL( ) "); |
153 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleKeyEventL( ) "); |
116 // Security mode check |
154 |
117 TPhoneCmdParamBoolean isSecurityMode; |
|
118 iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode ); |
|
119 // Number entry is blocked, if active Query |
155 // Number entry is blocked, if active Query |
120 if ( !IsAnyQueryActiveL() ) |
156 if ( !IsAnyQueryActiveL() ) |
121 { |
157 { |
122 // Handle numeric keys when key events are received in idle state |
158 // Handle numeric keys when key events are received in idle state |
123 HandleNumericKeyEventL( aKeyEvent, aEventCode ); |
159 HandleNumericKeyEventL( aKeyEvent, aEventCode ); |
124 } |
160 } |
125 else if ( isSecurityMode.Boolean() && CPhoneKeys::IsNumericKey( |
161 else if ( iStateMachine->SecurityMode()->IsSecurityMode() |
126 aKeyEvent, aEventCode ) ) |
162 && CPhoneKeys::IsNumericKey( aKeyEvent, aEventCode ) ) |
127 { |
163 { |
128 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
164 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
129 // Handle numeric keys when key events are received in single state |
165 // Handle numeric keys when key events are received in single state |
130 HandleNumericKeyEventL( aKeyEvent, aEventCode ); |
166 HandleNumericKeyEventL( aKeyEvent, aEventCode ); |
131 } |
167 } |
170 TPhoneKeyEventMessages aMessage, |
206 TPhoneKeyEventMessages aMessage, |
171 TKeyCode aCode ) |
207 TKeyCode aCode ) |
172 { |
208 { |
173 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleKeyMessageL( ) "); |
209 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleKeyMessageL( ) "); |
174 |
210 |
|
211 if( aMessage == EPhoneKeyLongPress && CheckAppLaunchingL( aCode ) ) |
|
212 { |
|
213 return; |
|
214 } |
|
215 |
175 switch ( aCode ) |
216 switch ( aCode ) |
176 { |
217 { |
177 case EKeyEnd: |
218 case EKeyEnd: |
178 // This key even occur only in idle state, behaviour for this should |
219 // This key even occur only in idle state, behaviour for this should |
179 // be same as long end-key press. (Bug in window server) |
220 // be same as long end-key press. (Bug in window server) |
180 HandleEndKeyPressL( EPhoneKeyLongPress ); |
221 HandleEndKeyPressL( EPhoneKeyLongPress ); |
181 break; |
222 break; |
182 |
223 |
183 // end-key |
224 // end-key |
184 case EKeyNo: |
225 case EKeyNo: |
185 HandleEndKeyPressL( aMessage ); |
226 HandleEndKeyPressL( aMessage ); |
186 break; |
227 break; |
187 |
228 |
188 // send-key |
229 // send-key |
189 case EKeyYes: |
230 case EKeyYes: |
190 |
231 |
191 if ( iOnScreenDialer ) |
232 if ( iOnScreenDialer ) |
192 { |
233 { |
193 if ( IsNumberEntryUsedL() ) |
234 if ( IsNumberEntryUsedL() ) |
194 { |
235 { |
195 // Security mode check |
236 |
196 TPhoneCmdParamBoolean isSecurityMode; |
|
197 iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode ); |
|
198 |
|
199 TPhoneCmdParamInteger numberEntryCountParam; |
237 TPhoneCmdParamInteger numberEntryCountParam; |
200 iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount, |
238 iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount, |
201 &numberEntryCountParam ); |
239 &numberEntryCountParam ); |
202 TInt neLength( numberEntryCountParam.Integer() ); |
240 TInt neLength( numberEntryCountParam.Integer() ); |
203 |
241 |
204 // Query on top of dialer |
242 // Query on top of dialer |
205 if ( IsAnyQueryActiveL() ) |
243 if ( IsAnyQueryActiveL() ) |
206 { |
244 { |
207 return; |
245 return; |
208 } |
246 } |
|
247 else if ( IsMenuBarVisibleL() ) |
|
248 { |
|
249 iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
|
250 return; |
|
251 } |
209 |
252 |
210 else if ( neLength == 0 && !isSecurityMode.Boolean()) |
253 else if ( neLength == 0 && !iStateMachine->SecurityMode()->IsSecurityMode() ) |
211 { |
254 { |
212 // start logs |
255 // start logs |
213 iViewCommandHandle->HandleCommandL( |
256 iViewCommandHandle->HandleCommandL( |
214 EPhoneDialerCmdLog ); |
257 EPhoneDialerCmdLog ); |
215 return; |
258 return; |
239 break; |
277 break; |
240 |
278 |
241 case EKeyApplication0: |
279 case EKeyApplication0: |
242 { |
280 { |
243 // If dialer is not open but phone is in foreground and phone receives |
281 // If dialer is not open but phone is in foreground and phone receives |
244 // applicaion-key event we have to open emergency dialer. No need own |
282 // applicaion-key event we have to open emergency dialer. |
245 // securitymode check because Applicationkey only captured in securitymode. |
283 // Securitymode check because Applicationkey only open dialer in securitymode. |
246 if ( !IsNumberEntryUsedL() ) |
284 if ( iStateMachine->SecurityMode()->IsSecurityMode() && !IsNumberEntryUsedL() ) |
247 { |
285 { |
248 HandleCommandL(EPhoneNumberAcqSecurityDialer); |
286 iViewCommandHandle->HandleCommandL( EPhoneViewOpenNumberEntry ); |
249 } |
287 } |
250 } |
288 } |
251 break; |
289 break; |
252 |
290 |
|
291 // "O" key |
|
292 case KPhoneDtmf0Character: |
|
293 if ( aMessage == EPhoneKeyLongPress && IsSimOk() ) |
|
294 { |
|
295 LaunchApplicationL(); |
|
296 } |
|
297 break; |
|
298 |
|
299 // number key |
|
300 case KPhoneDtmf1Character: |
|
301 case KPhoneDtmf2Character: |
|
302 case KPhoneDtmf3Character: |
|
303 case KPhoneDtmf4Character: |
|
304 case KPhoneDtmf5Character: |
|
305 case KPhoneDtmf6Character: |
|
306 case KPhoneDtmf7Character: |
|
307 case KPhoneDtmf8Character: |
|
308 case KPhoneDtmf9Character: |
|
309 if ( aMessage == EPhoneKeyLongPress && IsSimOk() ) |
|
310 { |
|
311 HandleNumberLongKeyPressL(); |
|
312 } |
|
313 break; |
|
314 |
253 #ifdef RD_INTELLIGENT_TEXT_INPUT |
315 #ifdef RD_INTELLIGENT_TEXT_INPUT |
254 case EKeyEnter: |
316 case EKeyEnter: |
255 if ( IsNumberEntryVisibleL() ) |
317 if ( IsNumberEntryVisibleL() ) |
256 { |
318 { |
257 HandleCommandL( EPhoneCmdOptions ); |
319 if ( IsDialingExtensionInFocusL() ) |
|
320 { |
|
321 HandleCommandL( EEasyDialingEnterKeyAction ); |
|
322 } |
|
323 else |
|
324 { |
|
325 TPhoneCmdParamInteger numberEntryCountParam; |
|
326 iViewCommandHandle->ExecuteCommandL( |
|
327 EPhoneViewGetNumberEntryCount, |
|
328 &numberEntryCountParam ); |
|
329 |
|
330 TInt neLength( numberEntryCountParam.Integer() ); |
|
331 if ( neLength > 0 ) |
|
332 { |
|
333 HandleSendCommandL(); |
|
334 } |
|
335 } |
258 } |
336 } |
259 break; |
337 break; |
260 #endif |
338 #endif |
261 |
339 |
262 default: |
340 default: |
338 void CPhoneStateIdle::HandleIncomingL( TInt aCallId ) |
420 void CPhoneStateIdle::HandleIncomingL( TInt aCallId ) |
339 { |
421 { |
340 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIncomingL( ) "); |
422 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIncomingL( ) "); |
341 |
423 |
342 HandleAudioAvailableOutputChangedL(); |
424 HandleAudioAvailableOutputChangedL(); |
|
425 |
|
426 iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNaviPaneAudioVolume ); |
343 |
427 |
344 SetRingingTonePlaybackL( aCallId ); |
428 SetRingingTonePlaybackL( aCallId ); |
345 |
429 |
|
430 CPhonePubSubProxy::Instance()->ChangePropertyValue( |
|
431 KPSUidScreenSaver, |
|
432 KScreenSaverAllowScreenSaver, |
|
433 EPhoneScreensaverNotAllowed ); |
|
434 |
|
435 IsNumberEntryUsedL() ? |
|
436 BeginTransEffectLC( ECallUiAppear ) : |
|
437 BeginTransEffectLC( ENumberEntryOpen ); |
346 BeginUiUpdateLC(); |
438 BeginUiUpdateLC(); |
347 |
439 |
348 // Hide the number entry if it exists |
440 // Hide the number entry if it exists |
349 if ( IsNumberEntryUsedL() ) |
441 if ( IsNumberEntryUsedL() ) |
350 { |
442 { |
351 SetNumberEntryVisibilityL(EFalse); |
443 SetNumberEntryVisibilityL(EFalse); |
352 } |
444 } |
353 |
445 |
|
446 // Close fast swap window if it's displayed |
|
447 EikonEnv()->DismissTaskList(); |
|
448 |
|
449 // Show incoming call buttons |
|
450 SetTouchPaneButtons( EPhoneIncomingCallButtons ); |
|
451 SetTouchPaneButtonEnabled( EPhoneCallComingCmdSilent ); |
|
452 SetTouchPaneButtonEnabled( EPhoneInCallCmdHold ); |
|
453 |
354 // Display incoming call |
454 // Display incoming call |
355 DisplayIncomingCallL( aCallId ); |
455 DisplayIncomingCallL( aCallId ); |
356 |
456 |
357 // Show incoming call buttons |
|
358 SetTouchPaneButtons( EPhoneIncomingCallButtons ); |
|
359 |
|
360 // Disable HW keys and Call UI if needed |
|
361 CheckDisableHWKeysAndCallUIL(); |
|
362 |
|
363 SetBackButtonActive(EFalse); |
|
364 |
|
365 EndUiUpdate(); |
457 EndUiUpdate(); |
|
458 EndTransEffect(); |
366 |
459 |
367 // Go to incoming state |
460 // Go to incoming state |
368 iCbaManager->UpdateIncomingCbaL( aCallId ); |
461 iCbaManager->UpdateIncomingCbaL( aCallId ); |
369 |
462 UpdateSilenceButtonDimming(); |
|
463 UpdateIncomingContextMenuL( aCallId ); |
|
464 //Dim toolbar items |
|
465 SetToolbarDimming( ETrue ); |
370 //request that dimmed toolbar is visible. |
466 //request that dimmed toolbar is visible. |
371 iViewCommandHandle->HandleCommandL( EPhoneViewShowToolbar ); |
467 iViewCommandHandle->HandleCommandL( EPhoneViewShowToolbar ); |
372 iStateMachine->ChangeState( EPhoneStateIncoming ); |
468 |
373 |
469 ChangeTo( EPhoneStateIncoming ); |
374 // Reset divert indication |
470 } |
375 SetDivertIndication( EFalse ); |
471 |
376 } |
472 // ----------------------------------------------------------- |
377 |
473 // CPhoneStateIdle::HandleDialingL |
378 // ----------------------------------------------------------- |
|
379 // CPhoneStateIdle::HandleDiallingL |
|
380 // Default handling for dialling message |
474 // Default handling for dialling message |
381 // (other items were commented in a header). |
475 // (other items were commented in a header). |
382 // ----------------------------------------------------------- |
476 // ----------------------------------------------------------- |
383 // |
477 // |
384 EXPORT_C void CPhoneStateIdle::HandleDialingL( TInt aCallId ) |
478 EXPORT_C void CPhoneStateIdle::HandleDialingL( TInt aCallId ) |
385 { |
479 { |
386 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleDialingL( ) "); |
480 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleDialingL( ) "); |
387 BeginUiUpdateLC(); |
481 // Indicate that the Phone needs to be sent to the background if |
388 |
482 // an application other than phone or idle application is in the foreground |
389 // Display call setup |
483 SetNeedToReturnToForegroundAppStatusL( !TopAppIsDisplayedL() ); |
390 DisplayCallSetupL( aCallId ); |
484 |
391 |
485 DisplayCallSetupL( aCallId ); |
|
486 ChangeTo( EPhoneStateCallSetup ); |
|
487 } |
|
488 |
|
489 // ----------------------------------------------------------- |
|
490 // CPhoneStateIdle::DoStateSpecificCallSetUpDefinitionsL |
|
491 // ----------------------------------------------------------- |
|
492 // |
|
493 EXPORT_C void CPhoneStateIdle::DoStateSpecificCallSetUpDefinitionsL() |
|
494 { |
392 // Show call setup buttons |
495 // Show call setup buttons |
393 SetTouchPaneButtons( EPhoneCallSetupButtons ); |
496 SetTouchPaneButtons( EPhoneCallSetupButtons ); |
394 |
497 SetTouchPaneButtonDisabled( EPhoneInCallCmdHold ); |
395 EndUiUpdate(); |
498 |
396 |
499 SetToolbarDimming( ETrue ); |
397 // Remove any phone dialogs if they are displayed |
500 SetToolbarButtonLoudspeakerEnabled(); |
398 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
501 SetToolbarButtonHandsetEnabled(); |
399 |
502 SetToolbarButtonBTHFEnabled(); |
400 // Go to call setup state |
|
401 iCbaManager->UpdateCbaL( EPhoneCallHandlingCallSetupCBA ); |
|
402 |
|
403 iStateMachine->ChangeState( EPhoneStateCallSetup ); |
|
404 } |
503 } |
405 |
504 |
406 // ----------------------------------------------------------- |
505 // ----------------------------------------------------------- |
407 // CPhoneStateIdle::HandleConnectedL |
506 // CPhoneStateIdle::HandleConnectedL |
408 // Message Handling function for message EPEMessageConnected |
507 // Message Handling function for message EPEMessageConnected |
456 |
558 |
457 switch( aCommand ) |
559 switch( aCommand ) |
458 { |
560 { |
459 case EPhoneCmdOptions: |
561 case EPhoneCmdOptions: |
460 { |
562 { |
461 break; |
563 // Open number entry menubar |
462 } |
564 TInt menuId( GetNumberAcqMenuIdL() ); |
463 |
565 TPhoneCmdParamInteger integerParam; |
|
566 integerParam.SetInteger( menuId ); |
|
567 iViewCommandHandle->ExecuteCommandL( |
|
568 EPhoneViewMenuBarOpen, &integerParam ); |
|
569 } |
|
570 break; |
464 case EPhoneNumberAcqCmdCall: |
571 case EPhoneNumberAcqCmdCall: |
465 HandleVoiceCallCommandL(); |
572 HandleVoiceCallCommandL( EFalse ); |
466 break; |
573 break; |
467 case EPhoneNumberAcqCmdSendCommand: |
574 case EPhoneNumberAcqCmdSendCommand: |
468 HandleSendCommandL(); |
575 HandleSendCommandL(); |
469 break; |
576 break; |
470 |
577 |
471 case EPhoneNumberAcqCmdVideoCall: |
578 case EPhoneNumberAcqCmdVideoCall: |
472 DialVideoCallL(); |
579 DialVideoCallL(); |
473 break; |
580 break; |
474 |
581 |
475 case EPhoneCmdBack: |
582 case EPhoneCmdBack: |
476 break; |
583 BeginTransEffectLC( ENumberEntryClose ); |
|
584 HandleBackCommandL(); |
|
585 EndTransEffect(); |
|
586 break; |
|
587 |
|
588 case EPhoneViewOpenNumberEntry: |
|
589 BeginTransEffectLC( ENumberEntryOpen ); |
|
590 commandStatus = CPhoneState::HandleCommandL( aCommand ); |
|
591 EndTransEffect(); |
|
592 break; |
477 |
593 |
478 default: |
594 default: |
479 commandStatus = CPhoneState::HandleCommandL( aCommand ); |
595 commandStatus = CPhoneState::HandleCommandL( aCommand ); |
480 break; |
596 break; |
481 } |
597 } |
482 |
|
483 return commandStatus; |
598 return commandStatus; |
484 |
|
485 } |
599 } |
486 |
600 |
487 // ----------------------------------------------------------------------------- |
601 // ----------------------------------------------------------------------------- |
488 // CPhoneStateIdle::ProcessCommandL |
602 // CPhoneStateIdle::ProcessCommandL |
489 // ----------------------------------------------------------------------------- |
603 // ----------------------------------------------------------------------------- |
538 { |
659 { |
539 iCustomization->HandleDialL( aNumber ); |
660 iCustomization->HandleDialL( aNumber ); |
540 } |
661 } |
541 else |
662 else |
542 { |
663 { |
543 DialVoiceCallL(); |
664 DialVoiceCallL(); |
544 } |
665 } |
|
666 } |
|
667 |
|
668 // ----------------------------------------------------------- |
|
669 // CPhoneStateIdle::HandleBackCommandL |
|
670 // ----------------------------------------------------------- |
|
671 // |
|
672 void CPhoneStateIdle::HandleBackCommandL() |
|
673 { |
|
674 TBool previousApp(EFalse); |
|
675 |
|
676 // If previous app activation is true then open |
|
677 // previous application. |
|
678 if ( iOnScreenDialer && |
|
679 IsSimOk() ) |
|
680 { |
|
681 TPhoneCmdParamBoolean booleanParam; |
|
682 iViewCommandHandle->ExecuteCommandL( |
|
683 EPhoneViewGetActivatePreviousApp, &booleanParam ); |
|
684 |
|
685 |
|
686 if ( booleanParam.Boolean() ) |
|
687 { |
|
688 // Open previous app. |
|
689 iViewCommandHandle->ExecuteCommandL( |
|
690 EPhoneViewActivatePreviousApp ); |
|
691 |
|
692 // Remove number entry from screen |
|
693 iViewCommandHandle->ExecuteCommandL( |
|
694 EPhoneViewRemoveNumberEntry ); |
|
695 |
|
696 iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW ); |
|
697 previousApp = ETrue; |
|
698 } |
|
699 } |
|
700 |
|
701 if ( !previousApp ) |
|
702 { |
|
703 // Remove number entry from screen |
|
704 iViewCommandHandle->ExecuteCommandL( |
|
705 EPhoneViewRemoveNumberEntry ); |
|
706 |
|
707 // Do state-specific operation when number entry is cleared |
|
708 HandleNumberEntryClearedL(); |
|
709 } |
|
710 |
545 } |
711 } |
546 |
712 |
547 // ----------------------------------------------------------- |
713 // ----------------------------------------------------------- |
548 // CPhoneStateIdle::DialVideoCallL |
714 // CPhoneStateIdle::DialVideoCallL |
549 // ----------------------------------------------------------- |
715 // ----------------------------------------------------------- |
580 EXPORT_C void CPhoneStateIdle::DisplayIncomingCallL( TInt aCallId ) |
754 EXPORT_C void CPhoneStateIdle::DisplayIncomingCallL( TInt aCallId ) |
581 { |
755 { |
582 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DisplayIncomingCallL( ) "); |
756 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DisplayIncomingCallL( ) "); |
583 __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo() && aCallId >= 0, |
757 __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo() && aCallId >= 0, |
584 Panic( EPhoneCtrlInvariant ) ); |
758 Panic( EPhoneCtrlInvariant ) ); |
|
759 // Close menu bar, if it is displayed |
|
760 iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
585 |
761 |
586 // Remove any phone dialogs if they are displayed |
762 // Remove any phone dialogs if they are displayed |
587 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
763 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
588 |
764 |
589 TPhoneCmdParamKeyCapture captureParam; |
|
590 captureParam.SetKeyCode( EKeyNo ); |
|
591 iViewCommandHandle->ExecuteCommand( EPhoneViewStartCapturingKey, &captureParam ); |
|
592 |
|
593 // Capture keys when there is an incoming call |
765 // Capture keys when there is an incoming call |
594 CaptureKeysDuringCallNotificationL( ETrue ); |
766 CaptureKeysDuringCallNotificationL( ETrue ); |
595 |
767 |
596 // Indicate that the Phone needs to be sent to the background if |
768 // Indicate that the Foreground application needs to be sent to the foreground |
597 // an application other than the top application is in the foreground |
769 // after call is ended. |
598 TPhoneCmdParamBoolean booleanParam; |
770 SetNeedToReturnToForegroundAppStatusL( !TopAppIsDisplayedL() ); |
599 booleanParam.SetBoolean( !TopAppIsDisplayedL() ); |
771 |
600 iViewCommandHandle->ExecuteCommandL( |
|
601 EPhoneViewSetNeedToSendToBackgroundStatus, |
|
602 &booleanParam ); |
|
603 |
|
604 // Bring Phone app in the foreground |
772 // Bring Phone app in the foreground |
605 TPhoneCmdParamInteger uidParam; |
773 TPhoneCmdParamInteger uidParam; |
606 uidParam.SetInteger( KUidPhoneApplication.iUid ); |
774 uidParam.SetInteger( KUidPhoneApplication.iUid ); |
607 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
775 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
608 &uidParam ); |
776 &uidParam ); |
621 |
789 |
622 DisplayHeaderForCallComingInL( aCallId, EFalse ); //not waiting |
790 DisplayHeaderForCallComingInL( aCallId, EFalse ); //not waiting |
623 } |
791 } |
624 |
792 |
625 // ----------------------------------------------------------- |
793 // ----------------------------------------------------------- |
626 // CPhoneStateIdle::DisplayCallSetupL |
|
627 // ----------------------------------------------------------- |
|
628 // |
|
629 EXPORT_C void CPhoneStateIdle::DisplayCallSetupL( TInt aCallId ) |
|
630 { |
|
631 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DisplayCallSetupL( ) "); |
|
632 __ASSERT_DEBUG( aCallId > KErrNotFound, Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
633 |
|
634 TPhoneCmdParamKeyCapture captureParam; |
|
635 captureParam.SetKeyCode( EKeyNo ); |
|
636 iViewCommandHandle->ExecuteCommand( EPhoneViewStartCapturingKey, &captureParam ); |
|
637 |
|
638 // Capture keys when the phone is dialling |
|
639 CaptureKeysDuringCallNotificationL( ETrue ); |
|
640 |
|
641 // Indicate that the Phone needs to be sent to the background if |
|
642 // an application other than the top application is in the foreground |
|
643 TPhoneCmdParamBoolean booleanParam; |
|
644 booleanParam.SetBoolean( !TopAppIsDisplayedL() ); |
|
645 |
|
646 iViewCommandHandle->ExecuteCommandL( |
|
647 EPhoneViewSetNeedToSendToBackgroundStatus, |
|
648 &booleanParam ); |
|
649 |
|
650 // Bring Phone app in the foreground |
|
651 TPhoneCmdParamInteger uidParam; |
|
652 uidParam.SetInteger( KUidPhoneApplication.iUid ); |
|
653 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
|
654 &uidParam ); |
|
655 |
|
656 // Set Phone as the top application |
|
657 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication, |
|
658 &uidParam ); |
|
659 |
|
660 // Display call setup header |
|
661 DisplayHeaderForOutgoingCallL( aCallId ); |
|
662 } |
|
663 |
|
664 // ----------------------------------------------------------- |
|
665 // CPhoneStateIdle::HandleIdleForegroundEventL |
794 // CPhoneStateIdle::HandleIdleForegroundEventL |
666 // ----------------------------------------------------------- |
795 // ----------------------------------------------------------- |
667 // |
796 // |
668 EXPORT_C void CPhoneStateIdle::HandleIdleForegroundEventL() |
797 EXPORT_C void CPhoneStateIdle::HandleIdleForegroundEventL() |
669 { |
798 { |
670 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIdleForegroundEventL( ) "); |
799 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIdleForegroundEventL( ) "); |
671 |
800 |
672 if ( IsNumberEntryUsedL() ) |
801 if ( IsNumberEntryUsedL() ) |
673 { |
802 { |
674 if ( IsNumberEntryVisibleL() ) |
803 // If numberentry is used then we need to call EPhoneViewSetDialerControlVisible |
|
804 // to ensure that numberentry/dialler is drawn to UI. |
|
805 TPhoneViewResponseId respond = |
|
806 iViewCommandHandle->HandleCommandL( EPhoneViewSetDialerControlVisible ); |
|
807 |
|
808 if ( respond && IsNumberEntryVisibleL() ) |
675 { |
809 { |
676 // Set Number Entry CBA |
810 // Set Number Entry CBA |
677 iCbaManager->SetCbaL( EPhoneNumberAcqCBA ); |
811 iCbaManager->SetCbaL( EPhoneNumberAcqCBA ); |
678 } |
812 } |
679 } |
813 } |
680 else if ( !IsAnyQueryActiveL() ) |
814 else if ( !IsAnyQueryActiveL() ) |
681 { |
815 { |
682 // Set idle as top application |
816 // Set idle as top application |
683 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground ); |
817 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground ); |
684 } |
818 } |
685 } |
819 } |
686 |
820 |
687 // ----------------------------------------------------------- |
821 // ----------------------------------------------------------- |
688 // CPhoneStateIdle::HandlePhoneForegroundEventL |
822 // CPhoneStateIdle::HandlePhoneForegroundEventL |
689 // ----------------------------------------------------------- |
823 // ----------------------------------------------------------- |
690 |
824 |
691 EXPORT_C void CPhoneStateIdle::HandlePhoneForegroundEventL() |
825 EXPORT_C void CPhoneStateIdle::HandlePhoneForegroundEventL() |
692 { |
826 { |
|
827 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandlePhoneForegroundEventL( ) "); |
|
828 |
|
829 TBool activatePhone = CPhonePubSubProxy::Instance()->Value( |
|
830 KPSUidAiInformation, KActiveIdleState ) == EPSAiNumberEntry; |
|
831 |
|
832 if ( activatePhone ) |
|
833 { |
|
834 // If activatePhone is true then user has pressed some numeric |
|
835 // key and icon must be set to FSW. In this case number entry is not yet open so it |
|
836 // it is not enough to call EPhoneViewUpdateFSW. |
|
837 iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdatePhoneIconToFSW ); |
|
838 } |
|
839 // If number entry is used update FSW accordingly. |
|
840 else if ( IsNumberEntryUsedL() ) |
|
841 { |
|
842 // If numberentry is used then we need to call EPhoneViewSetDialerControlVisible |
|
843 // to ensure that numberentry/dialler is drawn to UI. |
|
844 TPhoneViewResponseId respond = |
|
845 iViewCommandHandle->HandleCommandL( EPhoneViewSetDialerControlVisible ); |
|
846 |
|
847 if ( respond && IsNumberEntryVisibleL() ) |
|
848 { |
|
849 // Set Number Entry CBA |
|
850 iCbaManager->SetCbaL( EPhoneNumberAcqCBA ); |
|
851 } |
|
852 |
|
853 // If dialer is open add icon to FSW list. |
|
854 iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW ); |
|
855 } |
|
856 /*iCallInitialized has to be checked because if it true then phoneapp |
|
857 is already initializing call bubble and we cant bring idle to screen. */ |
|
858 else if ( !IsNumberEntryUsedL() && |
|
859 !iStateMachine->SecurityMode()->IsSecurityMode() && |
|
860 !iCallInitialized ) |
|
861 { |
|
862 // Bring Idle app to the foreground |
|
863 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground ); |
|
864 } |
693 } |
865 } |
694 |
866 |
695 // ----------------------------------------------------------- |
867 // ----------------------------------------------------------- |
696 // CPhoneStateIdle::HandlePhoneFocusLostEventL |
868 // CPhoneStateIdle::HandlePhoneFocusLostEventL |
697 // ----------------------------------------------------------- |
869 // ----------------------------------------------------------- |
710 // CPhoneStateIdle::HandleIdleL |
882 // CPhoneStateIdle::HandleIdleL |
711 // ----------------------------------------------------------- |
883 // ----------------------------------------------------------- |
712 // |
884 // |
713 void CPhoneStateIdle::HandleIdleL( TInt /*aCallId*/ ) |
885 void CPhoneStateIdle::HandleIdleL( TInt /*aCallId*/ ) |
714 { |
886 { |
715 __LOGMETHODSTARTEND(EPhoneControl, |
887 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIdleL()" ); |
716 "CPhoneStateIdle::HandleIdleL()" ); |
888 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveAllCallHeaders ); |
|
889 CloseClearNumberEntryAndLoadEffectL( ECallUiDisappear ); |
|
890 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
891 // Reset flag. |
|
892 SetCallInitialized( EFalse ); |
|
893 } |
|
894 |
|
895 // ----------------------------------------------------------- |
|
896 // CPhoneStateIdle::SpeedDialL |
|
897 // ----------------------------------------------------------- |
|
898 // |
|
899 EXPORT_C void CPhoneStateIdle::SpeedDialL( const TUint& aDigit, |
|
900 TDialInitiationMethod aDialMethod ) |
|
901 { |
|
902 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::SpeedDialL( ) "); |
|
903 iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); |
|
904 |
|
905 TPhoneCmdParamSpeedDial speedDialParam; |
|
906 HBufC* phoneNumber = NumberForSpeedDialLocationL( aDigit, speedDialParam ); |
|
907 |
|
908 // Store serviceId received from vmbx handler |
|
909 iStateMachine->PhoneEngineInfo()->SetServiceIdCommand( speedDialParam.ServiceId() ); |
|
910 CleanupStack::PushL( phoneNumber ); |
|
911 |
|
912 if ( NULL != phoneNumber && KNullDesC() != *phoneNumber ) |
|
913 { |
|
914 DialL( *phoneNumber, speedDialParam.NumberType(), aDialMethod ); |
|
915 RemoveNumberEntryAndSetIdleToBackgroundIfNeededL(); |
|
916 } |
|
917 else |
|
918 { |
|
919 // User cancelled dialog or didn't give a valid number |
|
920 SpeedDialCanceledL( aDigit ); |
|
921 } |
|
922 CleanupStack::PopAndDestroy( phoneNumber ); |
|
923 } |
|
924 |
|
925 // ----------------------------------------------------------- |
|
926 // CPhoneStateIdle::RemoveNumberEntryAndSetIdleToBackgroundIfNeededL |
|
927 // ----------------------------------------------------------- |
|
928 // |
|
929 void CPhoneStateIdle::RemoveNumberEntryAndSetIdleToBackgroundIfNeededL() |
|
930 { |
|
931 __LOGMETHODSTARTEND(EPhoneControl, |
|
932 "CPhoneStateIdle::RemoveNumberEntryAndSetIdleToBackgroundIfNeededL( ) "); |
|
933 if ( IsNumberEntryUsedL() ) |
|
934 { |
|
935 BeginTransEffectLC( ECallUiAppear ); |
|
936 /*NE should be removed because if speeddial dial is interupted during |
|
937 call setup phone should not return to NE/Dialler view.*/ |
|
938 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
717 |
939 |
718 // Remove all call headers |
940 /*It might be possible that some async operation was ongoing and |
719 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveAllCallHeaders ); |
941 state has already in that case do not set idle to background.*/ |
720 |
942 if ( iStateMachine->State() == this ) |
721 // Close number entry |
943 { |
722 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
944 iCbaManager->UpdateCbaL( EPhoneEmptyCBA ); |
723 |
945 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetIdleTopApplication ); |
724 // Remove all notes and dialogs |
946 } |
725 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
947 EndTransEffect(); |
|
948 } |
|
949 } |
|
950 |
|
951 // ----------------------------------------------------------- |
|
952 // CPhoneStateIdle::SpeedDialCanceledL |
|
953 // ----------------------------------------------------------- |
|
954 // |
|
955 EXPORT_C void CPhoneStateIdle::SpeedDialCanceledL( const TUint& aDigit ) |
|
956 |
|
957 { |
|
958 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::SpeedDialCanceledL( ) "); |
|
959 if ( IsNumberEntryUsedL() ) |
|
960 { |
|
961 if ( aDigit == KPhoneDtmf1Character || |
|
962 ( aDigit == KPhoneDtmf2Character && |
|
963 iViewCommandHandle->HandleCommandL( |
|
964 EPhoneViewIsStraightCallToVideoMailBox ) == EPhoneViewResponseSuccess ) ) |
|
965 { |
|
966 // Remove number entry and set idle background on non-touch products |
|
967 if ( !FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
|
968 { |
|
969 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
970 |
|
971 // Set Idle background, if still idle ( f.e not incoming call arrived ) |
|
972 if ( iStateMachine->State() == this ) |
|
973 { |
|
974 // idle screen in the background |
|
975 SetupIdleScreenInBackgroundL(); |
|
976 } |
|
977 } |
|
978 } |
|
979 } |
|
980 } |
|
981 |
|
982 // ----------------------------------------------------------- |
|
983 // CPhoneStateIdle::HandleNumberLongKeyPressL() |
|
984 // ----------------------------------------------------------- |
|
985 // |
|
986 EXPORT_C void CPhoneStateIdle::HandleNumberLongKeyPressL() |
|
987 { |
|
988 __LOGMETHODSTARTEND(EPhoneControl, |
|
989 "CPhoneStateIdle::HandleNumberLongKeyPressL( ) "); |
|
990 |
|
991 HBufC* phoneNumber = PhoneNumberFromEntryLC(); |
|
992 |
|
993 if ( phoneNumber && IsSpeedDialNumber ( *phoneNumber ) ) |
|
994 { |
|
995 SpeedDialL( (*phoneNumber)[0], EDialMethodOneKeyDialing ); |
|
996 } |
|
997 |
|
998 CleanupStack::PopAndDestroy( phoneNumber ); |
|
999 } |
|
1000 |
|
1001 // ----------------------------------------------------------- |
|
1002 // CPhoneStateIdle::IsSpeedDialNumber() |
|
1003 // ----------------------------------------------------------- |
|
1004 // |
|
1005 EXPORT_C TBool CPhoneStateIdle::IsSpeedDialNumber( |
|
1006 const TDesC& aNumber ) const |
|
1007 { |
|
1008 return ( aNumber.Length() == KPhoneDtmfSpeedDialPrefixLength |
|
1009 && aNumber[0] >= KPhoneDtmf1Character |
|
1010 && aNumber[0] <= KPhoneDtmf9Character ); |
726 } |
1011 } |
727 |
1012 |
728 // ----------------------------------------------------------- |
1013 // ----------------------------------------------------------- |
729 // CPhoneStateIdle::HandleSendCommandL() |
1014 // CPhoneStateIdle::HandleSendCommandL() |
730 // ----------------------------------------------------------- |
1015 // ----------------------------------------------------------- |
732 EXPORT_C void CPhoneStateIdle::HandleSendCommandL() |
1017 EXPORT_C void CPhoneStateIdle::HandleSendCommandL() |
733 { |
1018 { |
734 __LOGMETHODSTARTEND( |
1019 __LOGMETHODSTARTEND( |
735 EPhoneControl, "CPhoneStateIdle::HandleSendCommandL()" ); |
1020 EPhoneControl, "CPhoneStateIdle::HandleSendCommandL()" ); |
736 |
1021 |
737 HandleVoiceCallCommandL(); |
1022 HandleVoiceCallCommandL( ETrue ); |
|
1023 } |
|
1024 |
|
1025 // ----------------------------------------------------------- |
|
1026 // CPhoneStateIdle::LaunchApplicationL() |
|
1027 // ----------------------------------------------------------- |
|
1028 // |
|
1029 void CPhoneStateIdle::LaunchApplicationL() |
|
1030 { |
|
1031 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::LaunchApplicationL( ) "); |
|
1032 // Check if only one number exists in the number |
|
1033 // entry |
|
1034 TPhoneCmdParamInteger numberEntryCountParam; |
|
1035 iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount, |
|
1036 &numberEntryCountParam ); |
|
1037 |
|
1038 if ( numberEntryCountParam.Integer() == 1 ) |
|
1039 { |
|
1040 // Remove the number entry window |
|
1041 iViewCommandHandle->ExecuteCommandL( EPhoneViewClearNumberEntryContent ); |
|
1042 |
|
1043 iStateMachine->SendPhoneEngineMessage( |
|
1044 MPEPhoneModel::EPEMessageEndDTMF ); |
|
1045 |
|
1046 // Launch application. |
|
1047 iViewCommandHandle->ExecuteCommandL( |
|
1048 EPhoneViewLaunchApplication ); |
|
1049 |
|
1050 } |
738 } |
1051 } |
739 |
1052 |
740 // ----------------------------------------------------------- |
1053 // ----------------------------------------------------------- |
741 // CPhoneStateIdle:SendExitCommandL |
1054 // CPhoneStateIdle:SendExitCommandL |
742 // ----------------------------------------------------------- |
1055 // ----------------------------------------------------------- |
743 // |
1056 // |
744 void CPhoneStateIdle::SendExitCommandL() |
1057 void CPhoneStateIdle::SendExitCommandL() |
745 { |
1058 { |
746 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::SendExitCommand( ) "); |
1059 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::SendExitCommand( ) "); |
747 // Remove number entry from screen |
1060 // Remove number entry from screen |
748 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
1061 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
749 |
1062 |
750 // Simulate exit command |
1063 // Simulate exit command |
751 CEikonEnv& eikEnv = *CEikonEnv::Static(); |
1064 RWsSession& wsSession = EikonEnv()->WsSession(); |
752 CCoeEnv& coeEnv = eikEnv; |
1065 TKeyEvent keyEvent; |
753 RWsSession& wsSession=coeEnv.WsSession(); |
1066 keyEvent.iCode = EEikCmdExit; |
754 TKeyEvent keyEvent; |
1067 keyEvent.iScanCode = EEikCmdExit; |
755 keyEvent.iCode = EEikCmdExit; |
1068 keyEvent.iModifiers = 0; |
756 keyEvent.iScanCode = EEikCmdExit; |
1069 keyEvent.iRepeats = 0; |
757 keyEvent.iModifiers = 0; |
1070 wsSession.SimulateKeyEvent( keyEvent ); |
758 keyEvent.iRepeats = 0; |
1071 wsSession.Flush(); |
759 wsSession.SimulateKeyEvent( keyEvent ); |
|
760 wsSession.Flush(); |
|
761 |
|
762 iViewCommandHandle->ExecuteCommandL( EPhoneAppShutDown ); |
|
763 } |
1072 } |
764 |
1073 |
765 // ----------------------------------------------------------- |
1074 // ----------------------------------------------------------- |
766 // CPhoneStateIdle::HandleEndKeyPressL |
1075 // CPhoneStateIdle::HandleEndKeyPressL |
767 // ----------------------------------------------------------- |
1076 // ----------------------------------------------------------- |
795 iStateMachine->SendPhoneEngineMessage( |
1105 iStateMachine->SendPhoneEngineMessage( |
796 MPEPhoneModel::EPEMessageTerminateAllConnections ); |
1106 MPEPhoneModel::EPEMessageTerminateAllConnections ); |
797 |
1107 |
798 if ( IsNumberEntryUsedL() ) |
1108 if ( IsNumberEntryUsedL() ) |
799 { |
1109 { |
800 // Remove number entry from screen |
1110 CloseClearNumberEntryAndLoadEffectL( ENumberEntryClose ); |
801 iViewCommandHandle->ExecuteCommandL( |
|
802 EPhoneViewRemoveNumberEntry ); |
|
803 // Do state-specific operation when number entry is cleared |
|
804 HandleNumberEntryClearedL(); |
|
805 |
|
806 // If long end key event occures then all calls are terminated and |
1111 // If long end key event occures then all calls are terminated and |
807 // dialer is closed, therefore tel.icon must be removed from FSW. |
1112 // dialer is closed, therefore tel.icon must be removed from FSW. |
808 iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW ); |
1113 iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW ); |
809 } |
1114 } |
810 if ( !TopAppIsDisplayedL() ) |
1115 if ( !TopAppIsDisplayedL() ) |
813 DisplayIdleScreenL(); |
1118 DisplayIdleScreenL(); |
814 } |
1119 } |
815 } |
1120 } |
816 else if ( IsNumberEntryUsedL() && TopAppIsDisplayedL() ) |
1121 else if ( IsNumberEntryUsedL() && TopAppIsDisplayedL() ) |
817 { |
1122 { |
818 // Remove number entry from screen |
1123 CloseClearNumberEntryAndLoadEffectL( ENumberEntryClose ); |
819 iViewCommandHandle->ExecuteCommandL( |
|
820 EPhoneViewRemoveNumberEntry ); |
|
821 // Do state-specific operation when number entry is cleared |
|
822 HandleNumberEntryClearedL(); |
|
823 } |
1124 } |
824 else if ( !TopAppIsDisplayedL() ) |
1125 else if ( !TopAppIsDisplayedL() ) |
825 { |
1126 { |
826 // Phone might not be the topmost app since it has |
1127 // Phone might not be the topmost app since it has |
827 // some dialog/query open therefore we need to check this |
1128 // some dialog/query open therefore we need to remove dialog/phone. |
828 // and remove dialog/phone. |
1129 if ( !IsSimStateNotPresentWithSecurityModeEnabled() ) |
829 if ( IsAnyQueryActiveL() ) |
|
830 { |
1130 { |
831 if ( !IsSimStateNotPresentWithSecurityModeEnabled() ) |
1131 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
832 { |
1132 } |
833 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
1133 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
834 } |
|
835 |
|
836 // Remove number entry from screen |
|
837 iViewCommandHandle->ExecuteCommandL( |
|
838 EPhoneViewRemoveNumberEntry ); |
|
839 } |
|
840 // Bring Idle app to the foreground |
|
841 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground ); |
1134 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground ); |
|
1135 iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW ); |
842 } |
1136 } |
843 } |
1137 } |
844 else if ( IsNumberEntryUsedL() ) |
1138 else if ( IsNumberEntryUsedL() ) |
845 { |
1139 { |
846 // Remove number entry from screen |
1140 // Remove number entry from screen |
856 // --------------------------------------------------------- |
1150 // --------------------------------------------------------- |
857 // |
1151 // |
858 EXPORT_C void CPhoneStateIdle::OnlyHashInNumberEntryL() |
1152 EXPORT_C void CPhoneStateIdle::OnlyHashInNumberEntryL() |
859 { |
1153 { |
860 __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::OnlyHashInNumberEntryL( ) "); |
1154 __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::OnlyHashInNumberEntryL( ) "); |
861 |
1155 if ( CPhoneCenRepProxy::Instance()->IsTelephonyFeatureSupported( |
|
1156 KTelephonyLVFlagMannerMode ) ) |
|
1157 { |
|
1158 ChangeMannerModeL(); |
|
1159 } |
|
1160 else |
|
1161 { |
|
1162 StartAlsLineChangeTimerL(); |
|
1163 } |
|
1164 // Check if any application launch functionality |
|
1165 // is configured for pressing hash for a long time |
|
1166 // the return value of CheckAppLaunchingL ignored. |
|
1167 CheckAppLaunchingL( TKeyCode( KPhoneDtmfHashCharacter ) ); |
862 } |
1168 } |
863 |
1169 |
864 // --------------------------------------------------------- |
1170 // --------------------------------------------------------- |
865 // CPhoneStateIdle::ChangeMannerModeL |
1171 // CPhoneStateIdle::ChangeMannerModeL |
866 // --------------------------------------------------------- |
1172 // --------------------------------------------------------- |
867 // |
1173 // |
868 void CPhoneStateIdle::ChangeMannerModeL() |
1174 void CPhoneStateIdle::ChangeMannerModeL() |
869 { |
1175 { |
870 __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::ChangeMannerModeL( ) "); |
1176 __LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::ChangeMannerModeL( ) "); |
|
1177 |
|
1178 // Get the profile information |
|
1179 MProEngEngine* profileEngine = ProEngFactory::NewEngineLC(); |
|
1180 const TInt profileId = |
|
1181 profileEngine->ActiveProfileId(); |
|
1182 |
|
1183 TInt newProfile; |
|
1184 |
|
1185 if ( profileId == EProfileSilentId ) |
|
1186 { |
|
1187 newProfile = EProfileGeneralId; |
|
1188 } |
|
1189 else |
|
1190 { |
|
1191 newProfile = EProfileSilentId; |
|
1192 } |
|
1193 |
|
1194 profileEngine->SetActiveProfileL( newProfile ); |
|
1195 |
|
1196 CleanupStack::Pop(); // profileEngine |
|
1197 profileEngine->Release(); |
|
1198 |
|
1199 // Stop playing DTMF tone |
|
1200 iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); |
|
1201 |
|
1202 if ( !iOnScreenDialer ) |
|
1203 { |
|
1204 // Remove the number entry |
|
1205 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
1206 } |
|
1207 else |
|
1208 { |
|
1209 NumberEntryClearL(); |
|
1210 } |
|
1211 |
|
1212 iCbaManager->UpdateCbaL( EPhoneEmptyCBA ); |
|
1213 |
|
1214 // Bring Idle app to the top app |
|
1215 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetIdleTopApplication ); |
871 } |
1216 } |
872 |
1217 |
873 // ----------------------------------------------------------- |
1218 // ----------------------------------------------------------- |
874 // CPhoneStateIdle::DialMultimediaCallL |
1219 // CPhoneStateIdle::DialMultimediaCallL |
875 // ----------------------------------------------------------- |
1220 // ----------------------------------------------------------- |
895 // ----------------------------------------------------------- |
1240 // ----------------------------------------------------------- |
896 // |
1241 // |
897 EXPORT_C void CPhoneStateIdle::DialVoiceCallL() |
1242 EXPORT_C void CPhoneStateIdle::DialVoiceCallL() |
898 { |
1243 { |
899 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DialVoiceCallL() "); |
1244 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DialVoiceCallL() "); |
900 __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
1245 __ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) ); |
901 Panic( EPhoneCtrlInvariant ) ); |
|
902 |
|
903 // Disable global notes |
|
904 TPhoneCmdParamBoolean globalNotifierParam; |
|
905 globalNotifierParam.SetBoolean( ETrue ); |
|
906 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
907 &globalNotifierParam ); |
|
908 |
|
909 CPhoneState::DialVoiceCallL(); |
1246 CPhoneState::DialVoiceCallL(); |
910 |
|
911 } |
1247 } |
912 |
1248 |
913 // ----------------------------------------------------------------------------- |
1249 // ----------------------------------------------------------------------------- |
914 // CPhoneStateIdle::RestoreOngoing |
1250 // CPhoneStateIdle::RestoreOngoing |
915 // ----------------------------------------------------------------------------- |
1251 // ----------------------------------------------------------------------------- |
923 restoreValue ); |
1259 restoreValue ); |
924 |
1260 |
925 return ( restoreValue & ( conn::EBURRestoreFull | conn::EBURRestorePartial )); |
1261 return ( restoreValue & ( conn::EBURRestoreFull | conn::EBURRestorePartial )); |
926 } |
1262 } |
927 |
1263 |
|
1264 // ----------------------------------------------------------------------------- |
|
1265 // CPhoneStateIdle::CheckAppLaunchingL |
|
1266 // ----------------------------------------------------------------------------- |
|
1267 // |
|
1268 TBool CPhoneStateIdle::CheckAppLaunchingL( const TKeyCode aCode ) |
|
1269 { |
|
1270 TBool valuesFetched( EFalse ); |
|
1271 |
|
1272 if( !IsSimOk() ) |
|
1273 { |
|
1274 return valuesFetched; |
|
1275 } |
|
1276 |
|
1277 TPhoneCmdParamAppInfo appInfo; |
|
1278 HBufC8* appParam = HBufC8::NewL( KMaxParamLength ); |
|
1279 CleanupStack::PushL( appParam ); |
|
1280 |
|
1281 TBool isValidAppLaunchingKeyEvent = ETrue; |
|
1282 |
|
1283 // By-pass checking of number entry length in case of #-character. |
|
1284 // #-character is handled differently from other keys, and number |
|
1285 // entry length has been checked earlier. Checking number entry length |
|
1286 // for #-character is difficult here, because we cannot know if FEP |
|
1287 // has removed the long-# from number entry or not. |
|
1288 if ( TKeyCode( KPhoneDtmfHashCharacter ) != aCode ) |
|
1289 { |
|
1290 TPhoneCmdParamInteger numberEntryCount; |
|
1291 iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount, |
|
1292 &numberEntryCount ); |
|
1293 |
|
1294 isValidAppLaunchingKeyEvent = ( numberEntryCount.Integer() == 1 ); |
|
1295 } |
|
1296 |
|
1297 if ( isValidAppLaunchingKeyEvent ) |
|
1298 { |
|
1299 TRAPD( err, |
|
1300 CPhoneCenRepProxy::Instance()->FetchValuesFromCenRepL( |
|
1301 appInfo, aCode, appParam, valuesFetched ) ); |
|
1302 |
|
1303 if ( KErrNone == err && valuesFetched ) |
|
1304 { |
|
1305 // Remove the number entry window |
|
1306 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
1307 |
|
1308 // Stop playing DTMF tone |
|
1309 iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageEndDTMF ); |
|
1310 |
|
1311 TPhoneCommandParam* phoneCommandParam = |
|
1312 static_cast<TPhoneCommandParam*>( &appInfo ); |
|
1313 iViewCommandHandle->ExecuteCommandL( |
|
1314 EPhoneViewActivateAppViewConventional, |
|
1315 phoneCommandParam ); |
|
1316 |
|
1317 // Continue displaying current app but set up the |
|
1318 // idle screen in the background |
|
1319 SetupIdleScreenInBackgroundL(); |
|
1320 } |
|
1321 } |
|
1322 CleanupStack::PopAndDestroy( appParam ); |
|
1323 return valuesFetched; |
|
1324 } |
|
1325 |
|
1326 // ----------------------------------------------------------- |
|
1327 // CPhoneStateIdle::NumberForSpeedDialLocationL |
|
1328 // ----------------------------------------------------------- |
|
1329 // |
|
1330 HBufC* CPhoneStateIdle::NumberForSpeedDialLocationL( |
|
1331 const TUint& aDigit, |
|
1332 TPhoneCmdParamSpeedDial& aSpeedDialParam ) const |
|
1333 { |
|
1334 // Set the speed dial location from the digit in buffer. Character |
|
1335 // '1' means location 1, and so on. |
|
1336 const TInt location = aDigit - KPhoneDtmf1Character + 1; |
|
1337 aSpeedDialParam.SetLocation( location ); |
|
1338 |
|
1339 // Get the number and type from the speed dial location. |
|
1340 HBufC* phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize ); |
|
1341 |
|
1342 TPtr ptr( phoneNumber->Des() ); |
|
1343 aSpeedDialParam.SetPhoneNumber( &ptr ); |
|
1344 iViewCommandHandle->HandleCommandL( |
|
1345 EPhoneViewGetNumberFromSpeedDialLocation, &aSpeedDialParam ); |
|
1346 |
|
1347 CleanupStack::Pop( phoneNumber ); |
|
1348 return phoneNumber; |
|
1349 } |
|
1350 |
928 // ----------------------------------------------------------- |
1351 // ----------------------------------------------------------- |
929 // CPhoneStateIdle::HandleVoiceCallCommandL() |
1352 // CPhoneStateIdle::HandleVoiceCallCommandL() |
930 // ----------------------------------------------------------- |
1353 // ----------------------------------------------------------- |
931 // |
1354 // |
932 void CPhoneStateIdle::HandleVoiceCallCommandL() |
1355 void CPhoneStateIdle::HandleVoiceCallCommandL( TBool aSendKey ) |
933 { |
1356 { |
934 __LOGMETHODSTARTEND( |
1357 __LOGMETHODSTARTEND( |
935 EPhoneControl, "CPhoneStateIdle::HandleVoiceCallCommandL()" ); |
1358 EPhoneControl, "CPhoneStateIdle::HandleVoiceCallCommandL()" ); |
936 |
1359 |
937 if ( IsNumberEntryUsedL() ) |
1360 if ( IsNumberEntryUsedL() ) |
955 SendExitCommandL(); |
1378 SendExitCommandL(); |
956 } |
1379 } |
957 else |
1380 else |
958 #endif // _DEBUG |
1381 #endif // _DEBUG |
959 { |
1382 { |
960 // call the number |
1383 if ( IsDialingExtensionInFocusL() ) |
961 iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ); |
1384 { |
962 DialVoiceCallL(); |
1385 CPhoneState::HandleCommandL( EEasyDialingVoiceCall ); |
|
1386 } |
|
1387 |
|
1388 else if ( IsSpeedDialNumber( *phoneNumber ) ) |
|
1389 { |
|
1390 // Handle speed dial |
|
1391 SpeedDialL( (*phoneNumber)[0], aSendKey ? EDialMethodSendCommand : EDialMethodMenuSelection ); |
|
1392 } |
|
1393 else |
|
1394 { |
|
1395 // call the number |
|
1396 iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ); |
|
1397 DialVoiceCallL(); |
|
1398 } |
|
1399 |
963 CleanupStack::PopAndDestroy( phoneNumber ); |
1400 CleanupStack::PopAndDestroy( phoneNumber ); |
964 } |
1401 } |
965 } |
1402 } |
966 } |
1403 } |
967 |
1404 |
|
1405 // ----------------------------------------------------------- |
|
1406 // CPhoneStateIdle::GetNumberAcqMenuIdL() |
|
1407 // ----------------------------------------------------------- |
|
1408 // |
|
1409 TInt CPhoneStateIdle::GetNumberAcqMenuIdL() |
|
1410 { |
|
1411 TInt menuId = CPhoneMainResourceResolver::Instance()-> |
|
1412 ResolveResourceID( EPhoneNumberAcqMenubar ); |
|
1413 |
|
1414 // Use easy dialing menu id, if easydialing is in focus. |
|
1415 // Otherwise use number acquisition menu id. |
|
1416 if ( IsDialingExtensionInFocusL() ) |
|
1417 { |
|
1418 // Fetch easydialing menu id, check its validity and assign to menuId |
|
1419 TPhoneCmdParamInteger integerParam; |
|
1420 iViewCommandHandle->ExecuteCommandL( |
|
1421 EPhoneViewGetEasyDialingMenuId, &integerParam ); |
|
1422 if ( integerParam.Integer() ) |
|
1423 { |
|
1424 menuId = integerParam.Integer(); |
|
1425 } |
|
1426 } |
|
1427 return menuId; |
|
1428 } |
|
1429 |
|
1430 // ----------------------------------------------------------- |
|
1431 // CPhoneStateIdle::HandleErrorL |
|
1432 // ----------------------------------------------------------- |
|
1433 // |
|
1434 EXPORT_C void CPhoneStateIdle::HandleErrorL( const TPEErrorInfo& aErrorInfo ) |
|
1435 { |
|
1436 __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneStateIdle::HandleErrorL() "); |
|
1437 if( KErrNotFound < aErrorInfo.iCallId ) |
|
1438 { |
|
1439 SetCallInitialized( EFalse ); |
|
1440 } |
|
1441 CPhoneState::HandleErrorL( aErrorInfo ); |
|
1442 } |
|
1443 |
|
1444 // ----------------------------------------------------------- |
|
1445 // CPhoneStateIdle::ChangeTo |
|
1446 // ----------------------------------------------------------- |
|
1447 // |
|
1448 void CPhoneStateIdle::ChangeTo( TInt aState ) |
|
1449 { |
|
1450 __PHONELOG1( EBasic, EPhoneControl, |
|
1451 "PhoneUIControl: CPhoneStateIdle::ChangeTo - aState =%d ", |
|
1452 aState ); |
|
1453 SetCallInitialized( EFalse ); |
|
1454 iStateMachine->ChangeState( aState ); |
|
1455 } |
|
1456 |
|
1457 // ----------------------------------------------------------- |
|
1458 // CPhoneStateIdle::SetBubbleInitialized |
|
1459 // ----------------------------------------------------------- |
|
1460 // |
|
1461 void CPhoneStateIdle::SetCallInitialized( TBool aValue ) |
|
1462 { |
|
1463 __PHONELOG1( EBasic, EPhoneControl, |
|
1464 "PhoneUIControl: CPhoneStateIdle::SetCallInitialized - iCallInitialized =%d ", |
|
1465 aValue ); |
|
1466 iCallInitialized = aValue; |
|
1467 } |
|
1468 |
|
1469 // ----------------------------------------------------------- |
|
1470 // CPhoneStateIdle::IsBubbleInitialized |
|
1471 // ----------------------------------------------------------- |
|
1472 // |
|
1473 TBool CPhoneStateIdle::IsCallInitialized() |
|
1474 { |
|
1475 __PHONELOG1( EBasic, EPhoneControl, |
|
1476 "PhoneUIControl: CPhoneStateIdle::IsCallInitialized - iCallInitialized =%d ", |
|
1477 iCallInitialized ); |
|
1478 return iCallInitialized; |
|
1479 } |
|
1480 |
968 // End of File |
1481 // End of File |