17 |
17 |
18 |
18 |
19 // INCLUDES |
19 // INCLUDES |
20 #include <featmgr.h> |
20 #include <featmgr.h> |
21 #include <StringLoader.h> |
21 #include <StringLoader.h> |
22 #include <AknUtils.h> |
|
23 #include <mpeengineinfo.h> |
22 #include <mpeengineinfo.h> |
24 #include <mpeclientinformation.h> |
23 #include <mpeclientinformation.h> |
25 |
24 |
26 #include "cphonepubsubproxy.h" |
25 #include "cphonepubsubproxy.h" |
27 #include "cphonestatecallsetup.h" |
26 #include "cphonestatecallsetup.h" |
189 // ----------------------------------------------------------- |
188 // ----------------------------------------------------------- |
190 // |
189 // |
191 EXPORT_C void CPhoneStateCallSetup::HandleNumberEntryClearedL() |
190 EXPORT_C void CPhoneStateCallSetup::HandleNumberEntryClearedL() |
192 { |
191 { |
193 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandleNumberEntryClearedL()" ); |
192 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandleNumberEntryClearedL()" ); |
194 UpdateInCallCbaL(); |
193 UpdateUiCommands(); |
195 } |
|
196 |
|
197 // ----------------------------------------------------------- |
|
198 // CPhoneStateCallSetup::UpdateInCallCbaL |
|
199 // ----------------------------------------------------------- |
|
200 // |
|
201 EXPORT_C void CPhoneStateCallSetup::UpdateInCallCbaL() |
|
202 { |
|
203 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::UpdateInCallCbaL() "); |
|
204 UpdateCbaL( EPhoneCallHandlingCallSetupCBA ); |
|
205 } |
|
206 |
|
207 // ----------------------------------------------------------- |
|
208 // CPhoneStateCallSetup::UpdateCbaL |
|
209 // ----------------------------------------------------------- |
|
210 // |
|
211 EXPORT_C void CPhoneStateCallSetup::UpdateCbaL( TInt aResource ) |
|
212 { |
|
213 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::UpdateCbaL() "); |
|
214 iCbaManager->UpdateCbaL( aResource ); |
|
215 } |
194 } |
216 |
195 |
217 // ----------------------------------------------------------- |
196 // ----------------------------------------------------------- |
218 // CPhoneStateCallSetup::HandleKeyEventL |
197 // CPhoneStateCallSetup::HandleKeyEventL |
219 // ----------------------------------------------------------- |
198 // ----------------------------------------------------------- |
220 // |
199 // |
221 EXPORT_C void CPhoneStateCallSetup::HandleKeyEventL( |
200 EXPORT_C void CPhoneStateCallSetup::HandleKeyEventL( |
222 const TKeyEvent& aKeyEvent, TEventCode aEventCode ) |
201 const TKeyEvent& aKeyEvent, TEventCode aEventCode ) |
223 { |
202 { |
224 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandleKeyEventL( ) "); |
203 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandleKeyEventL( ) "); |
225 if ( !IsNumberEntryVisibleL() ) |
204 if ( !iNumberEntryManager->IsNumberEntryVisibleL() ) |
226 { |
205 { |
227 // Send the key events to the phone engine |
206 // Send the key events to the phone engine |
228 switch( aEventCode ) |
207 switch( aEventCode ) |
229 { |
208 { |
230 case EEventKey: |
209 case EEventKey: |
265 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::PlayKeySpecificDTMF( ) "); |
244 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::PlayKeySpecificDTMF( ) "); |
266 TBuf<1> buffer; // one character |
245 TBuf<1> buffer; // one character |
267 buffer.Append( aCode ); |
246 buffer.Append( aCode ); |
268 __PHONELOG1( EBasic, EPhoneControl, "HandleKeyEventL(%S)", &buffer ); |
247 __PHONELOG1( EBasic, EPhoneControl, "HandleKeyEventL(%S)", &buffer ); |
269 // Convert key code to western. |
248 // Convert key code to western. |
270 AknTextUtils::ConvertDigitsTo( buffer, EDigitTypeWestern ); |
|
271 __PHONELOG1( EBasic, EPhoneControl, "ConvertDigitsTo(%S)", &buffer ); |
|
272 TLex code( buffer ); |
249 TLex code( buffer ); |
273 // Send the key press to the phone engine, if applicable |
250 // Send the key press to the phone engine, if applicable |
274 iStateMachine->PhoneEngineInfo()->SetKeyCode( code.Peek() ); |
251 iStateMachine->PhoneEngineInfo()->SetKeyCode( code.Peek() ); |
275 iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessagePlayDTMF ); |
252 iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessagePlayDTMF ); |
276 } |
253 } |
293 // Close all connections |
270 // Close all connections |
294 iStateMachine->SendPhoneEngineMessage( |
271 iStateMachine->SendPhoneEngineMessage( |
295 MPEPhoneModel::EPEMessageTerminateAllConnections ); |
272 MPEPhoneModel::EPEMessageTerminateAllConnections ); |
296 |
273 |
297 // Remove number entry if long press |
274 // Remove number entry if long press |
298 if ( IsNumberEntryUsedL() ) |
275 if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
299 { |
276 { |
300 iViewCommandHandle->ExecuteCommandL( |
277 iViewCommandHandle->ExecuteCommandL( |
301 EPhoneViewRemoveNumberEntry ); |
278 EPhoneViewRemoveNumberEntry ); |
302 } |
279 } |
303 } |
280 } |
469 // ----------------------------------------------------------- |
446 // ----------------------------------------------------------- |
470 // |
447 // |
471 void CPhoneStateCallSetup::HandleConnectedL( TInt aCallId ) |
448 void CPhoneStateCallSetup::HandleConnectedL( TInt aCallId ) |
472 { |
449 { |
473 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandleConnectedL()"); |
450 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandleConnectedL()"); |
474 TPhoneCmdParamBoolean booleanParam; |
|
475 booleanParam.SetBoolean( EFalse ); |
|
476 iViewCommandHandle->ExecuteCommandL( |
|
477 EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam ); |
|
478 BeginUiUpdateLC(); |
451 BeginUiUpdateLC(); |
479 CPhoneState::UpdateSingleActiveCallL( aCallId ); |
452 CPhoneState::UpdateSingleActiveCallL( aCallId ); |
480 SetTouchPaneButtons( EPhoneIncallButtons ); |
453 UpdateUiCommands(); |
481 EndUiUpdate(); |
454 EndUiUpdate(); |
482 UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
|
483 iStateMachine->ChangeState( EPhoneStateSingle ); |
455 iStateMachine->ChangeState( EPhoneStateSingle ); |
484 } |
456 } |
485 |
457 |
486 // ----------------------------------------------------------- |
458 // ----------------------------------------------------------- |
487 // CPhoneStateCallSetup::HandleIdleL |
459 // CPhoneStateCallSetup::HandleIdleL |
498 BeginUiUpdateLC (); |
470 BeginUiUpdateLC (); |
499 iViewCommandHandle->ExecuteCommandL( EPhoneViewHideNaviPaneAudioVolume ); |
471 iViewCommandHandle->ExecuteCommandL( EPhoneViewHideNaviPaneAudioVolume ); |
500 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
472 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
501 SetDefaultFlagsL(); |
473 SetDefaultFlagsL(); |
502 |
474 |
503 if ( IsNumberEntryUsedL() ) |
475 if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
504 { |
476 { |
505 iViewCommandHandle->ExecuteCommand( |
477 iViewCommandHandle->ExecuteCommand( |
506 EPhoneViewGetNumberFromEntry, |
478 EPhoneViewGetNumberFromEntry, |
507 &stringParam ); |
479 &stringParam ); |
508 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
480 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
509 iViewCommandHandle->ExecuteCommandL( EPhoneViewLaunchLogs, &stringParam ); |
481 iViewCommandHandle->ExecuteCommandL( EPhoneViewLaunchLogs, &stringParam ); |
510 } |
482 } |
511 else |
483 else |
512 { |
484 { |
513 DisplayIdleScreenL(); |
485 RemoveDialogsAndSendPhoneToBackgroundL(); |
514 } |
486 } |
515 EndUiUpdate(); |
487 EndUiUpdate(); |
516 CleanupStack::PopAndDestroy( phoneNumber ); |
488 CleanupStack::PopAndDestroy( phoneNumber ); |
517 iStateMachine->ChangeState( EPhoneStateIdle ); |
489 iStateMachine->ChangeState( EPhoneStateIdle ); |
518 } |
490 } |
524 void CPhoneStateCallSetup::HandleAudioOutputChangedL() |
496 void CPhoneStateCallSetup::HandleAudioOutputChangedL() |
525 { |
497 { |
526 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandleAudioOutputChangedL( ) "); |
498 __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandleAudioOutputChangedL( ) "); |
527 CPhoneState::HandleAudioOutputChangedL(); |
499 CPhoneState::HandleAudioOutputChangedL(); |
528 // Update the call setup CBA |
500 // Update the call setup CBA |
529 UpdateInCallCbaL(); |
501 UpdateUiCommands(); |
530 SetTouchPaneButtons(0); |
|
531 } |
502 } |
532 |
503 |
533 // ----------------------------------------------------------- |
504 // ----------------------------------------------------------- |
534 // CPhoneStateCallSetup::SendDtmfL |
505 // CPhoneStateCallSetup::SendDtmfL |
535 // ----------------------------------------------------------- |
506 // ----------------------------------------------------------- |