34 #include "phoneui.hrh" |
34 #include "phoneui.hrh" |
35 #include "cphonemainresourceresolver.h" |
35 #include "cphonemainresourceresolver.h" |
36 #include "phonerssbase.h" |
36 #include "phonerssbase.h" |
37 #include "phonestatedefinitionsgsm.h" |
37 #include "phonestatedefinitionsgsm.h" |
38 #include "phonelogger.h" |
38 #include "phonelogger.h" |
39 #include "mphonestorage.h" |
|
40 |
39 |
41 // ================= MEMBER FUNCTIONS ======================= |
40 // ================= MEMBER FUNCTIONS ======================= |
42 |
41 |
43 // C++ default constructor can NOT contain any code, that |
42 // C++ default constructor can NOT contain any code, that |
44 // might leave. |
43 // might leave. |
112 "CPhoneTwoSinglesAndWaiting::HandleKeyMessageL()"); |
111 "CPhoneTwoSinglesAndWaiting::HandleKeyMessageL()"); |
113 switch ( aCode ) |
112 switch ( aCode ) |
114 { |
113 { |
115 // send-key |
114 // send-key |
116 case EKeyYes: |
115 case EKeyYes: |
117 { |
116 { |
118 if( IsNumberEntryVisibleL() ) |
117 if( IsNumberEntryVisibleL() ) |
119 { |
118 { |
120 CallFromNumberEntryL(); |
119 CallFromNumberEntryL(); |
121 } |
120 } |
122 else |
121 else |
123 { |
122 { |
124 // Waiting call bubble is over number entry |
123 // Waiting call bubble is over number entry |
125 // so display not allowed note because we |
124 // so display not allowed note because we |
126 // can't answer the call |
125 // can't answer the call |
127 SendGlobalWarningNoteL( EPhoneNoteTextCallNotAllowed, ETrue ); |
126 SendGlobalWarningNoteL( EPhoneNoteTextCallNotAllowed ); |
128 } |
127 } |
129 break; |
128 break; |
130 } |
129 } |
131 |
130 |
132 default: |
131 default: |
133 CPhoneTwoSingles::HandleKeyMessageL( aMessage, aCode ); |
132 CPhoneTwoSingles::HandleKeyMessageL( aMessage, aCode ); |
134 break; |
133 break; |
135 } |
134 } |
136 } |
135 } |
137 |
136 |
138 // ----------------------------------------------------------- |
137 // ----------------------------------------------------------- |
139 // CPhoneTwoSinglesAndWaiting::HandleKeyEventL |
|
140 // ----------------------------------------------------------- |
|
141 // |
|
142 void CPhoneTwoSinglesAndWaiting::HandleKeyEventL( |
|
143 const TKeyEvent& aKeyEvent, |
|
144 TEventCode /*aEventCode*/ ) |
|
145 { |
|
146 if( EKeyDeviceF == aKeyEvent.iCode ) |
|
147 { |
|
148 __PHONELOG( EBasic, EPhoneUIStates, |
|
149 "CPhoneTwoSinglesAndWaiting::HandleKeyMessageL-deviceF" ); |
|
150 HandleHoldSwitchL(); |
|
151 } |
|
152 } |
|
153 |
|
154 // ----------------------------------------------------------- |
|
155 // CPhoneTwoSinglesAndWaiting::HandlePhoneEngineMessageL |
138 // CPhoneTwoSinglesAndWaiting::HandlePhoneEngineMessageL |
156 // ----------------------------------------------------------- |
139 // ----------------------------------------------------------- |
157 // |
140 // |
158 void CPhoneTwoSinglesAndWaiting::HandlePhoneEngineMessageL( |
141 void CPhoneTwoSinglesAndWaiting::HandlePhoneEngineMessageL( |
159 const TInt aMessage, |
142 const TInt aMessage, |
197 CPhoneState::HandleErrorL( aErrorInfo ); |
177 CPhoneState::HandleErrorL( aErrorInfo ); |
198 } |
178 } |
199 } |
179 } |
200 |
180 |
201 // ----------------------------------------------------------- |
181 // ----------------------------------------------------------- |
|
182 // CPhoneTwoSinglesAndWaiting::OpenMenuBarL |
|
183 // ----------------------------------------------------------- |
|
184 // |
|
185 void CPhoneTwoSinglesAndWaiting::OpenMenuBarL() |
|
186 { |
|
187 __LOGMETHODSTARTEND( EPhoneUIStates, |
|
188 "CPhoneTwoSinglesAndWaiting::OpenMenuBarL()"); |
|
189 |
|
190 TInt resourceId ( EPhoneCallTwoSinglesWaitingLockMenubar ); |
|
191 |
|
192 if ( !IsAutoLockOn() ) |
|
193 { |
|
194 if ( IsNumberEntryVisibleL() ) |
|
195 { |
|
196 resourceId = EPhoneCallActiveHeldAndWaitingMenubarWithNumberEntry; |
|
197 } |
|
198 else |
|
199 { |
|
200 resourceId = EPhoneCallActiveHeldAndWaitingMenubar; |
|
201 } |
|
202 } |
|
203 |
|
204 TPhoneCmdParamInteger integerParam; |
|
205 integerParam.SetInteger( |
|
206 CPhoneMainResourceResolver::Instance()-> |
|
207 ResolveResourceID( resourceId ) ); |
|
208 iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, |
|
209 &integerParam ); |
|
210 } |
|
211 |
|
212 // ----------------------------------------------------------- |
202 // CPhoneTwoSinglesAndWaiting::HandleIdleL |
213 // CPhoneTwoSinglesAndWaiting::HandleIdleL |
203 // ----------------------------------------------------------- |
214 // ----------------------------------------------------------- |
204 // |
215 // |
205 void CPhoneTwoSinglesAndWaiting::HandleIdleL( TInt aCallId ) |
216 void CPhoneTwoSinglesAndWaiting::HandleIdleL( TInt aCallId ) |
206 { |
217 { |
207 __LOGMETHODSTARTEND( EPhoneUIStates, |
218 __LOGMETHODSTARTEND( EPhoneUIStates, |
208 "CPhoneTwoSinglesAndWaiting::HandleIdleL()"); |
219 "CPhoneTwoSinglesAndWaiting::HandleIdleL()"); |
209 |
220 BeginUiUpdateLC(); |
210 BeginUiUpdateLC(); |
221 if ( !IsNumberEntryUsedL() ) |
211 |
222 { |
212 // Remove call |
223 iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
|
224 } |
213 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
225 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
214 |
226 |
215 if ( iRingingCallId == aCallId ) |
227 if ( iRingingCallId == aCallId ) |
216 { |
228 { |
217 StateTransitionToTwoSinglesL(); |
229 StateTransitionToTwoSinglesL(); |
218 } |
230 } |
219 else |
231 else |
220 { |
232 { |
221 StateTransitionToSingleAndWaitingL(); |
233 StateTransitionToSingleAndWaitingL(); |
222 } |
234 } |
223 |
|
224 EndUiUpdate(); |
235 EndUiUpdate(); |
225 } |
236 } |
226 |
237 |
227 // ----------------------------------------------------------- |
238 // ----------------------------------------------------------- |
228 // CPhoneTwoSinglesAndWaiting::StateTransitionToTwoSinglesL |
239 // CPhoneTwoSinglesAndWaiting::StateTransitionToTwoSinglesL |
233 __LOGMETHODSTARTEND( EPhoneUIStates, |
244 __LOGMETHODSTARTEND( EPhoneUIStates, |
234 "CPhoneTwoSinglesAndWaiting::StateTransitionToTwoSinglesL()"); |
245 "CPhoneTwoSinglesAndWaiting::StateTransitionToTwoSinglesL()"); |
235 if ( IsNumberEntryUsedL() ) |
246 if ( IsNumberEntryUsedL() ) |
236 { |
247 { |
237 // Go to background if necessary |
248 // Go to background if necessary |
238 if ( NeedToSendToBackgroundL() ) |
249 if ( NeedToReturnToForegroundAppL() ) |
|
250 { |
|
251 // Return phone to the background if menu application is needed to foreground. |
|
252 iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground ); |
|
253 |
|
254 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility ); |
|
255 |
|
256 UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
|
257 } |
|
258 else |
|
259 { |
|
260 // Show the number entry if it exists. |
|
261 SetNumberEntryVisibilityL(ETrue); |
|
262 } |
|
263 } |
|
264 else |
|
265 { |
|
266 // Set Two singles softkeys |
|
267 UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA ); |
|
268 |
|
269 // If numberentry is not open just check NeedToReturnToForegroundAppL and |
|
270 // sendbackround if needed. |
|
271 if ( NeedToReturnToForegroundAppL() ) |
239 { |
272 { |
240 // Return phone to the background if send to background is needed. |
273 // Return phone to the background if send to background is needed. |
241 iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground ); |
274 iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground ); |
242 |
275 } |
243 UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
276 } |
244 } |
|
245 else |
|
246 { |
|
247 // Show the number entry if it exists. |
|
248 SetNumberEntryVisibilityL(ETrue); |
|
249 } |
|
250 } |
|
251 else |
|
252 { |
|
253 // Set Two singles softkeys |
|
254 UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA ); |
|
255 |
|
256 // If numberentry is not open just check NeedToSendToBackgroundL and |
|
257 // sendbackround if needed. |
|
258 if ( NeedToSendToBackgroundL() ) |
|
259 { |
|
260 // Return phone to the background if send to background is needed. |
|
261 iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground ); |
|
262 } |
|
263 } |
|
264 |
|
265 if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) |
|
266 && iStateMachine->PhoneStorage()->IsScreenLocked() ) |
|
267 { |
|
268 EnableCallUIL(); |
|
269 } |
|
270 |
|
271 // Reset blocked keys list |
|
272 iStateMachine->PhoneStorage()->ResetBlockedKeysList(); |
|
273 |
277 |
274 // Go to two singles state |
278 // Go to two singles state |
|
279 SetTouchPaneButtonEnabled( EPhoneCallComingCmdAnswer ); |
275 SetTouchPaneButtons( EPhoneTwoSinglesButtons ); |
280 SetTouchPaneButtons( EPhoneTwoSinglesButtons ); |
276 // CBA updates in above if-else conditions |
281 // CBA updates in above if-else conditions |
277 iStateMachine->ChangeState( EPhoneStateTwoSingles ); |
282 iStateMachine->ChangeState( EPhoneStateTwoSingles ); |
278 } |
283 } |
279 |
284 |
280 // ----------------------------------------------------------- |
285 // ----------------------------------------------------------- |
281 // CPhoneTwoSinglesAndWaiting::StateTransitionToSingleAndWaitingL |
286 // CPhoneTwoSinglesAndWaiting::StateTransitionToSingleAndWaitingL |
282 // ----------------------------------------------------------- |
287 // ----------------------------------------------------------- |
284 void CPhoneTwoSinglesAndWaiting::StateTransitionToSingleAndWaitingL() |
289 void CPhoneTwoSinglesAndWaiting::StateTransitionToSingleAndWaitingL() |
285 { |
290 { |
286 __LOGMETHODSTARTEND( EPhoneUIStates, |
291 __LOGMETHODSTARTEND( EPhoneUIStates, |
287 "CPhoneTwoSinglesAndWaiting::StateTransitionToSingleAndWaitingL()"); |
292 "CPhoneTwoSinglesAndWaiting::StateTransitionToSingleAndWaitingL()"); |
288 // Go to two singles state |
293 // Go to two singles state |
289 TPhoneCmdParamInteger callIdParam; |
294 UpdateCbaL( EPhoneCallHandlingCallWaitingCBA ); |
290 iViewCommandHandle->ExecuteCommandL( |
295 |
291 EPhoneViewGetExpandedBubbleCallId, &callIdParam ); |
296 // Set touch controls |
292 |
297 SetTouchPaneButtonEnabled( EPhoneCallComingCmdAnswer ); |
293 if ( callIdParam.Integer()!=iRingingCallId ) |
|
294 { |
|
295 CPhoneGsmInCall::UpdateInCallCbaL(); |
|
296 } |
|
297 else |
|
298 { |
|
299 iCbaManager->SetCbaL( EPhoneCallHandlingCallWaitingCBA ); |
|
300 } |
|
301 |
|
302 // Check if HW Keys or Call UI should be disabled |
|
303 CheckDisableHWKeysAndCallUIL(); |
|
304 |
298 |
305 SetTouchPaneButtons( EPhoneWaitingCallButtons ); |
299 SetTouchPaneButtons( EPhoneWaitingCallButtons ); |
306 |
300 |
307 iStateMachine->ChangeState( EPhoneStateWaitingInSingle ); |
301 iStateMachine->ChangeState( EPhoneStateWaitingInSingle ); |
308 } |
302 } |
340 |
332 |
341 // Service identifier must be given so that service specific settings |
333 // Service identifier must be given so that service specific settings |
342 // can be taken into account at phoneuiview. |
334 // can be taken into account at phoneuiview. |
343 callHeaderParam.SetServiceId( |
335 callHeaderParam.SetServiceId( |
344 iStateMachine->PhoneEngineInfo()->ServiceId( aCallId ) ); |
336 iStateMachine->PhoneEngineInfo()->ServiceId( aCallId ) ); |
345 |
337 |
346 // Check if HW Keys or Call UI should be disabled |
338 // Set touch controls |
347 CheckDisableHWKeysAndCallUIL(); |
339 SetTouchPaneButtonEnabled( EPhoneCallComingCmdAnswer ); |
348 |
340 |
|
341 SetTouchPaneButtons( EPhoneWaitingCallButtons ); |
349 |
342 |
350 iViewCommandHandle->ExecuteCommandL( EPhoneViewCreateConference, aCallId, |
343 iViewCommandHandle->ExecuteCommandL( EPhoneViewCreateConference, aCallId, |
351 &callHeaderParam ); |
344 &callHeaderParam ); |
352 |
345 |
353 // Clear the flag |
346 SetNeedToReturnToForegroundAppStatusL( EFalse ); |
354 TPhoneCmdParamBoolean booleanParam; |
347 |
355 booleanParam.SetBoolean( EFalse ); |
|
356 iViewCommandHandle->ExecuteCommandL( |
|
357 EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam ); |
|
358 |
|
359 // Set touch controls |
|
360 SetTouchPaneButtons( EPhoneWaitingCallButtons ); |
|
361 |
|
362 UpdateCbaL( EPhoneCallHandlingCallWaitingCBA ); |
|
363 |
|
364 EndUiUpdate(); |
348 EndUiUpdate(); |
365 // Go to Conference And Waiting state |
349 // Go to Conference And Waiting state |
366 // No need for CBA update |
350 // No need for CBA update |
367 iStateMachine->ChangeState( EPhoneStateConferenceAndWaiting ); |
351 iStateMachine->ChangeState( EPhoneStateConferenceAndWaiting ); |
368 } |
352 } |
373 // |
357 // |
374 void CPhoneTwoSinglesAndWaiting::UpdateInCallCbaL() |
358 void CPhoneTwoSinglesAndWaiting::UpdateInCallCbaL() |
375 { |
359 { |
376 __LOGMETHODSTARTEND( EPhoneUIStates, |
360 __LOGMETHODSTARTEND( EPhoneUIStates, |
377 "CPhoneTwoSinglesAndWaiting::UpdateInCallCbaL()"); |
361 "CPhoneTwoSinglesAndWaiting::UpdateInCallCbaL()"); |
378 |
362 UpdateCbaL ( EPhoneCallHandlingCallWaitingCBA ); |
379 TPhoneCmdParamInteger callIdParam; |
|
380 iViewCommandHandle->ExecuteCommandL( |
|
381 EPhoneViewGetExpandedBubbleCallId, &callIdParam ); |
|
382 |
|
383 if ( callIdParam.Integer()!=iRingingCallId ) |
|
384 { |
|
385 CPhoneGsmInCall::UpdateInCallCbaL(); |
|
386 } |
|
387 else |
|
388 { |
|
389 iCbaManager->SetCbaL( EPhoneCallHandlingIncomingRejectCBA ); |
|
390 } |
|
391 } |
363 } |
392 |
364 |
393 // ----------------------------------------------------------- |
365 // ----------------------------------------------------------- |
394 // CPhoneTwoSinglesAndWaiting::HandleNumberEntryClearedL() |
366 // CPhoneTwoSinglesAndWaiting::HandleNumberEntryClearedL() |
395 // ----------------------------------------------------------- |
367 // ----------------------------------------------------------- |
398 { |
370 { |
399 __LOGMETHODSTARTEND( EPhoneUIStates, |
371 __LOGMETHODSTARTEND( EPhoneUIStates, |
400 "CPhoneTwoSinglesAndWaiting::HandleNumberEntryClearedL()"); |
372 "CPhoneTwoSinglesAndWaiting::HandleNumberEntryClearedL()"); |
401 UpdateCbaL( EPhoneCallHandlingCallWaitingCBA ); |
373 UpdateCbaL( EPhoneCallHandlingCallWaitingCBA ); |
402 } |
374 } |
403 |
375 |
404 // ----------------------------------------------------------- |
|
405 // CPhoneTwoSinglesAndWaiting::HandleCommandL |
|
406 // ----------------------------------------------------------- |
|
407 // |
|
408 TBool CPhoneTwoSinglesAndWaiting::HandleCommandL( TInt aCommand ) |
|
409 { |
|
410 __LOGMETHODSTARTEND( EPhoneUIStates, |
|
411 "CPhoneTwoSinglesAndWaiting::HandleCommandL() "); |
|
412 TBool commandStatus = ETrue; |
|
413 |
|
414 switch( aCommand ) |
|
415 { |
|
416 case EPhoneCmdUpdateUiControls: |
|
417 UpdateUiControlsL(); |
|
418 break; |
|
419 |
|
420 default: |
|
421 commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand ); |
|
422 break; |
|
423 } |
|
424 |
|
425 return commandStatus; |
|
426 } |
|
427 |
|
428 // ----------------------------------------------------------- |
|
429 // CPhoneTwoSinglesAndWaiting::UpdateUiControlsL |
|
430 // ----------------------------------------------------------- |
|
431 // |
|
432 void CPhoneTwoSinglesAndWaiting::UpdateUiControlsL() |
|
433 { |
|
434 __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndWaiting::UpdateUiControlsL( ) "); |
|
435 UpdateInCallCbaL(); |
|
436 } |
|
437 |
|
438 // End of File |
376 // End of File |