35 #include "tphonecmdparaminteger.h" |
35 #include "tphonecmdparaminteger.h" |
36 #include "tphonecmdparamboolean.h" |
36 #include "tphonecmdparamboolean.h" |
37 #include "tphonecmdparamstring.h" |
37 #include "tphonecmdparamstring.h" |
38 #include "tphonecmdparamcallheaderdata.h" |
38 #include "tphonecmdparamcallheaderdata.h" |
39 #include "tphonecmdparamglobalnote.h" |
39 #include "tphonecmdparamglobalnote.h" |
40 #include "tphonecmdparamcallstatedata.h" |
|
41 #include "phonestatedefinitionsgsm.h" |
40 #include "phonestatedefinitionsgsm.h" |
42 #include "phonelogger.h" |
41 #include "phonelogger.h" |
43 #include "cphonecenrepproxy.h" |
42 #include "cphonecenrepproxy.h" |
44 #include "cphonepubsubproxy.h" |
43 #include "cphonepubsubproxy.h" |
45 #include "mphonestorage.h" |
44 #include "mphonestorage.h" |
|
45 #include "phonecallutil.h" |
46 |
46 |
47 // ================= MEMBER FUNCTIONS ======================= |
47 // ================= MEMBER FUNCTIONS ======================= |
48 |
48 |
49 // C++ default constructor can NOT contain any code, that |
49 // C++ default constructor can NOT contain any code, that |
50 // might leave. |
50 // might leave. |
71 // ----------------------------------------------------------- |
71 // ----------------------------------------------------------- |
72 // |
72 // |
73 void CPhoneSingleAndWaiting::ConstructL() |
73 void CPhoneSingleAndWaiting::ConstructL() |
74 { |
74 { |
75 CPhoneGsmInCall::ConstructL(); |
75 CPhoneGsmInCall::ConstructL(); |
76 |
76 |
77 TPhoneCmdParamCallStateData callStateData; |
77 iSingleCallId = PhoneCallUtil::CallIdByState( EPEStateConnected ); |
78 callStateData.SetCallState( EPEStateConnected ); |
78 if ( iSingleCallId == KErrNotFound ) |
79 iViewCommandHandle->HandleCommandL( |
79 { |
80 EPhoneViewGetCallIdByState, &callStateData ); |
80 iSingleCallId = PhoneCallUtil::CallIdByState( EPEStateHeld ); |
81 |
81 } |
82 if ( callStateData.CallId() == KErrNotFound ) |
82 |
83 { |
|
84 callStateData.SetCallState( EPEStateHeld ); |
|
85 iViewCommandHandle->HandleCommandL( |
|
86 EPhoneViewGetCallIdByState, &callStateData ); |
|
87 } |
|
88 iSingleCallId = callStateData.CallId(); |
|
89 __PHONELOG1( EBasic, EPhoneUIStates, |
83 __PHONELOG1( EBasic, EPhoneUIStates, |
90 "CPhoneSingleAndWaiting::ConstructL() (iSingleCallId=%d)", iSingleCallId); |
84 "CPhoneSingleAndWaiting::ConstructL() (iSingleCallId=%d)", iSingleCallId); |
91 } |
85 } |
92 |
86 |
93 // ----------------------------------------------------------- |
87 // ----------------------------------------------------------- |
177 case EPhoneInCallCmdNewCall: |
171 case EPhoneInCallCmdNewCall: |
178 break; |
172 break; |
179 |
173 |
180 case EPhoneCallComingCmdReject: // fall through |
174 case EPhoneCallComingCmdReject: // fall through |
181 { |
175 { |
182 // Get waiting callid |
176 iStateMachine->SetCallId( |
183 TPhoneCmdParamCallStateData callStateData; |
177 PhoneCallUtil::CallIdByState( EPEStateRinging ) ); |
184 callStateData.SetCallState( EPEStateRinging ); |
|
185 iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState, |
|
186 &callStateData ); |
|
187 iStateMachine->SetCallId( callStateData.CallId() ); |
|
188 iStateMachine->SendPhoneEngineMessage( |
178 iStateMachine->SendPhoneEngineMessage( |
189 MPEPhoneModel::EPEMessageReject ); |
179 MPEPhoneModel::EPEMessageReject ); |
190 break; |
180 break; |
191 } |
181 } |
192 |
182 |
250 __LOGMETHODSTARTEND( EPhoneUIStates, |
240 __LOGMETHODSTARTEND( EPhoneUIStates, |
251 "CPhoneSingleAndWaiting::HandleIdleL() "); |
241 "CPhoneSingleAndWaiting::HandleIdleL() "); |
252 |
242 |
253 if ( iSingleCallId == KErrNotFound ) |
243 if ( iSingleCallId == KErrNotFound ) |
254 { |
244 { |
255 TPhoneCmdParamCallStateData callStateData; |
245 iSingleCallId = PhoneCallUtil::CallIdByState( EPEStateDisconnecting ); |
256 callStateData.SetCallState( EPEStateDisconnecting ); |
246 if ( iSingleCallId == KErrNotFound ) |
257 iViewCommandHandle->HandleCommandL( |
247 { |
258 EPhoneViewGetCallIdByState, &callStateData ); |
248 iSingleCallId = PhoneCallUtil::CallIdByState( EPEStateConnected ); |
259 |
249 if ( iSingleCallId == KErrNotFound ) |
260 if ( callStateData.CallId() == KErrNotFound ) |
|
261 { |
|
262 callStateData.SetCallState( EPEStateConnected ); |
|
263 iViewCommandHandle->HandleCommandL( |
|
264 EPhoneViewGetCallIdByState, &callStateData ); |
|
265 |
|
266 if ( callStateData.CallId() == KErrNotFound ) |
|
267 { |
250 { |
268 callStateData.SetCallState( EPEStateHeld ); |
251 iSingleCallId = PhoneCallUtil::CallIdByState( EPEStateHeld ); |
269 iViewCommandHandle->HandleCommandL( |
|
270 EPhoneViewGetCallIdByState, &callStateData ); |
|
271 } |
252 } |
272 } |
253 } |
273 iSingleCallId = callStateData.CallId(); |
|
274 } |
254 } |
275 |
255 |
276 __PHONELOG1( EBasic, EPhoneControl, |
256 __PHONELOG1( EBasic, EPhoneControl, |
277 "CPhoneSingleAndWaiting::HandleIdleL iSingleCallId(%d)", |
257 "CPhoneSingleAndWaiting::HandleIdleL iSingleCallId(%d)", |
278 iSingleCallId ); |
258 iSingleCallId ); |
285 { |
265 { |
286 BeginUiUpdateLC(); |
266 BeginUiUpdateLC(); |
287 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
267 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
288 |
268 |
289 // Get waiting callId |
269 // Get waiting callId |
290 TPhoneCmdParamCallStateData callStateData; |
270 TInt callId = PhoneCallUtil::CallIdByState( EPEStateRinging ); |
291 callStateData.SetCallState( EPEStateRinging ); |
|
292 iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState, |
|
293 &callStateData ); |
|
294 |
271 |
295 __PHONELOG1( EBasic, EPhoneControl, |
272 __PHONELOG1( EBasic, EPhoneControl, |
296 "CPhoneSingleAndWaiting::HandleIdleL EPEStateRinging CallId(%d)", |
273 "CPhoneSingleAndWaiting::HandleIdleL EPEStateRinging CallId(%d)", |
297 callStateData.CallId() ); |
274 callId ); |
298 |
275 |
299 // Display ringing bubble |
276 // Display ringing bubble |
300 if ( callStateData.CallId() > KErrNotFound ) |
277 if ( callId > KErrNotFound ) |
301 { |
278 { |
302 UpdateCallHeaderAndUiCommandsL( callStateData.CallId() ); |
279 SetRingingTonePlaybackL( callId ); |
|
280 UpdateCallHeaderAndUiCommandsL( callId ); |
303 |
281 |
304 if ( iNumberEntryManager->IsNumberEntryVisibleL() ) |
282 if ( iNumberEntryManager->IsNumberEntryVisibleL() ) |
305 { |
283 { |
306 iNumberEntryManager->SetNumberEntryVisibilityL(EFalse); |
284 iNumberEntryManager->SetNumberEntryVisibilityL(EFalse); |
307 } |
285 } |
308 |
286 |
309 SetRingingTonePlaybackL( callStateData.CallId() ); |
|
310 BringIncomingToForegroundL(); |
287 BringIncomingToForegroundL(); |
311 } |
288 } |
312 SetBackButtonActive(EFalse); |
289 SetBackButtonActive(EFalse); |
313 EndUiUpdate(); |
290 EndUiUpdate(); |
314 iStateMachine->ChangeState( EPhoneStateIncoming ); |
291 iStateMachine->ChangeState( EPhoneStateIncoming ); |
320 |
297 |
321 // Idle message came for waiting call |
298 // Idle message came for waiting call |
322 if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
299 if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
323 { |
300 { |
324 iNumberEntryManager->SetNumberEntryVisibilityL(ETrue); |
301 iNumberEntryManager->SetNumberEntryVisibilityL(ETrue); |
|
302 } |
|
303 |
|
304 if ( PhoneCallUtil::IsVideoCall( iSingleCallId ) ) |
|
305 { |
|
306 iViewCommandHandle->ExecuteCommand( EPhoneViewSetVideoCallOnTop ); |
325 } |
307 } |
326 |
308 |
327 UpdateUiCommands(); |
309 UpdateUiCommands(); |
328 EndUiUpdate(); |
310 EndUiUpdate(); |
329 iStateMachine->ChangeState( EPhoneStateSingle ); |
311 iStateMachine->ChangeState( EPhoneStateSingle ); |