author | hgs |
Fri, 03 Sep 2010 13:33:36 +0300 | |
changeset 65 | 2a5d4ab426d3 |
parent 50 | 377c906a8701 |
child 74 | d1c62c765e48 |
permissions | -rw-r--r-- |
37 | 1 |
/* |
2 |
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: Implementation of CPhoneStateIdle class. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
// INCLUDES |
|
20 |
#include <eikenv.h> |
|
21 |
#include <e32property.h> |
|
22 |
#include <connect/sbdefs.h> |
|
23 |
#include <w32std.h> |
|
24 |
#include <StringLoader.h> |
|
25 |
#include <aknnotedialog.h> // For CAknNoteDialog::EErrorTone |
|
26 |
#include <apgcli.h> |
|
27 |
#include <telephonyvariant.hrh> |
|
28 |
#include <featmgr.h> |
|
29 |
#include <settingsinternalcrkeys.h> |
|
30 |
#include <mpeengineinfo.h> |
|
31 |
#include <mpeclientinformation.h> |
|
32 |
#include <bldvariant.hrh> |
|
33 |
||
34 |
#include "cphonepubsubproxy.h" |
|
35 |
#include "cphonecenrepproxy.h" |
|
36 |
#include "cphonestateidle.h" |
|
37 |
#include "tphonecmdparaminteger.h" |
|
38 |
#include "tphonecmdparamboolean.h" |
|
39 |
#include "tphonecmdparamglobalnote.h" |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
40 |
#include "tphonecmdparamkeycapture.h" |
37 | 41 |
#include "tphonecmdparamstring.h" |
42 |
#include "tphonecmdparamboolean.h" |
|
43 |
#include "mphonestatemachine.h" |
|
44 |
#include "phonestatedefinitions.h" |
|
45 |
#include "tphonecmdparamappinfo.h" |
|
46 |
#include "cphonekeys.h" |
|
47 |
||
48 |
#include "tphonecmdparamcallstatedata.h" |
|
49 |
#include "phoneviewcommanddefinitions.h" |
|
50 |
#include "phoneui.hrh" |
|
51 |
#include "phonerssbase.h" |
|
52 |
#include "cphonemainresourceresolver.h" |
|
53 |
#include "phonelogger.h" |
|
54 |
#include "phoneui.pan" |
|
55 |
#include "mphonecustomization.h" |
|
56 |
||
57 |
||
58 |
// ================= MEMBER FUNCTIONS ======================= |
|
59 |
||
60 |
// C++ default constructor can NOT contain any code, that |
|
61 |
// might leave. |
|
62 |
// |
|
63 |
EXPORT_C CPhoneStateIdle::CPhoneStateIdle( |
|
64 |
MPhoneStateMachine* aStateMachine, |
|
65 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
66 |
MPhoneCustomization* aCustomization ) : |
|
67 |
CPhoneState( aStateMachine, aViewCommandHandle, aCustomization ) |
|
68 |
{ |
|
69 |
} |
|
70 |
||
71 |
// Destructor |
|
72 |
EXPORT_C CPhoneStateIdle::~CPhoneStateIdle() |
|
73 |
{ |
|
74 |
} |
|
75 |
||
76 |
// ----------------------------------------------------------- |
|
77 |
// CPhoneStateIdle::ConstructL() |
|
78 |
// ----------------------------------------------------------- |
|
79 |
// |
|
80 |
EXPORT_C void CPhoneStateIdle::ConstructL() |
|
81 |
{ |
|
82 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::ConstructL() "); |
|
83 |
CPhoneState::BaseConstructL(); |
|
84 |
} |
|
85 |
||
86 |
// ----------------------------------------------------------- |
|
87 |
// CPhoneStateIdle::NewL() |
|
88 |
// ----------------------------------------------------------- |
|
89 |
// |
|
90 |
CPhoneStateIdle* CPhoneStateIdle::NewL( |
|
91 |
MPhoneStateMachine* aStateMachine, |
|
92 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
93 |
MPhoneCustomization* aPhoneCustomization ) |
|
94 |
{ |
|
95 |
CPhoneStateIdle* self = new (ELeave) CPhoneStateIdle( |
|
96 |
aStateMachine, aViewCommandHandle, aPhoneCustomization ); |
|
97 |
CleanupStack::PushL( self ); |
|
98 |
self->ConstructL(); |
|
99 |
CleanupStack::Pop( self ); |
|
100 |
return self; |
|
101 |
} |
|
102 |
||
103 |
// ----------------------------------------------------------- |
|
104 |
// CPhoneStateIdle::HandleKeyEventL |
|
105 |
// ----------------------------------------------------------- |
|
106 |
// |
|
107 |
EXPORT_C void CPhoneStateIdle::HandleKeyEventL( |
|
108 |
const TKeyEvent& aKeyEvent, |
|
109 |
TEventCode aEventCode ) |
|
110 |
{ |
|
111 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleKeyEventL( ) "); |
|
65 | 112 |
TPhoneCmdParamBoolean isSecurityMode; |
113 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode ); |
|
114 |
if ( isSecurityMode.Boolean() && CPhoneKeys::IsNumericKey( |
|
37 | 115 |
aKeyEvent, aEventCode ) ) |
116 |
{ |
|
117 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
|
118 |
} |
|
119 |
else if ( aEventCode == EEventKeyUp ) |
|
120 |
{ |
|
121 |
// Provide up event to engine. |
|
122 |
// Otherwise DTMF tone keeps playing. |
|
123 |
iStateMachine->SendPhoneEngineMessage( |
|
124 |
MPEPhoneModel::EPEMessageEndDTMF ); |
|
125 |
__PHONELOG( EBasic, EPhoneControl, |
|
126 |
"PhoneUIControl: CPhoneStateIdle::HandleKeyEventL" ); |
|
127 |
} |
|
128 |
} |
|
129 |
||
130 |
// ----------------------------------------------------------- |
|
131 |
// CPhoneStateIdle::HandleNumberEntryClearedL() |
|
132 |
// ----------------------------------------------------------- |
|
133 |
// |
|
134 |
EXPORT_C void CPhoneStateIdle::HandleNumberEntryClearedL() |
|
135 |
{ |
|
136 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleNumberEntryClearedL( ) "); |
|
137 |
if ( IsSimOk() && !IsSimStateNotPresentWithSecurityModeEnabled() ) |
|
138 |
{ |
|
139 |
// if still idle ( f.e not incoming call arrived when rfs ) |
|
140 |
if ( iStateMachine->State() == this ) |
|
141 |
{ |
|
142 |
DisplayIdleScreenL(); |
|
143 |
} |
|
144 |
} |
|
145 |
else |
|
146 |
{ |
|
147 |
StartShowSecurityNoteL(); |
|
148 |
} |
|
149 |
} |
|
150 |
||
151 |
// ----------------------------------------------------------- |
|
152 |
// CPhoneStateIdle::HandleKeyMessageL |
|
153 |
// ----------------------------------------------------------- |
|
154 |
// |
|
155 |
EXPORT_C void CPhoneStateIdle::HandleKeyMessageL( |
|
156 |
TPhoneKeyEventMessages aMessage, |
|
157 |
TKeyCode aCode ) |
|
158 |
{ |
|
159 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleKeyMessageL( ) "); |
|
160 |
switch ( aCode ) |
|
161 |
{ |
|
162 |
case EKeyEnd: |
|
163 |
// This key even occur only in idle state, behaviour for this should |
|
164 |
// be same as long end-key press. (Bug in window server) |
|
165 |
HandleEndKeyPressL( EPhoneKeyLongPress ); |
|
166 |
break; |
|
167 |
||
168 |
// end-key |
|
169 |
case EKeyNo: |
|
65 | 170 |
HandleEndKeyPressL( aMessage ); |
37 | 171 |
break; |
172 |
// send-key |
|
173 |
case EKeyYes: |
|
65 | 174 |
if ( IsNumberEntryUsedL() ) |
37 | 175 |
{ |
65 | 176 |
TPhoneCmdParamBoolean isSecurityMode; |
177 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode ); |
|
178 |
||
179 |
TPhoneCmdParamInteger numberEntryCountParam; |
|
180 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetNumberEntryCount, |
|
181 |
&numberEntryCountParam ); |
|
182 |
||
183 |
TInt neLength( numberEntryCountParam.Integer() ); |
|
184 |
if ( IsAnyQueryActiveL() ) |
|
185 |
{ |
|
186 |
return; |
|
187 |
} |
|
188 |
else if ( neLength == 0 && !isSecurityMode.Boolean()) |
|
37 | 189 |
{ |
65 | 190 |
// start logs |
191 |
iViewCommandHandle->HandleCommandL( |
|
192 |
EPhoneDialerCmdLog ); |
|
193 |
return; |
|
37 | 194 |
} |
65 | 195 |
HandleSendCommandL(); |
196 |
} |
|
197 |
// If dialer is not open but phone is in foreground and phone receives |
|
198 |
// send-key event we have to check if security mode is true and if it |
|
199 |
// is then open emergency dialer. |
|
200 |
else if ( !IsNumberEntryUsedL() ) |
|
201 |
{ |
|
202 |
TPhoneCmdParamBoolean isSecurityMode; |
|
203 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode ); |
|
204 |
if ( isSecurityMode.Boolean()) |
|
37 | 205 |
{ |
65 | 206 |
// launch dialer. |
207 |
HandleCommandL(EPhoneNumberAcqSecurityDialer); |
|
208 |
} |
|
37 | 209 |
} |
210 |
break; |
|
211 |
||
212 |
case EKeyApplication0: |
|
213 |
{ |
|
214 |
// If dialer is not open but phone is in foreground and phone receives |
|
215 |
// applicaion-key event we have to open emergency dialer. No need own |
|
216 |
// securitymode check because Applicationkey only captured in securitymode. |
|
217 |
if ( !IsNumberEntryUsedL() ) |
|
218 |
{ |
|
219 |
HandleCommandL(EPhoneNumberAcqSecurityDialer); |
|
65 | 220 |
} |
37 | 221 |
} |
222 |
break; |
|
65 | 223 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
37 | 224 |
case EKeyEnter: |
225 |
if ( IsNumberEntryVisibleL() ) |
|
226 |
{ |
|
227 |
HandleCommandL( EPhoneCmdOptions ); |
|
228 |
} |
|
229 |
break; |
|
230 |
#endif |
|
231 |
default: |
|
232 |
break; |
|
233 |
} |
|
234 |
} |
|
235 |
||
236 |
// ----------------------------------------------------------- |
|
237 |
// CPhoneStateIdle::HandlePhoneEngineMessageL |
|
238 |
// ----------------------------------------------------------- |
|
239 |
// |
|
240 |
EXPORT_C void CPhoneStateIdle::HandlePhoneEngineMessageL( |
|
241 |
const TInt aMessage, |
|
242 |
TInt aCallId ) |
|
243 |
{ |
|
244 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandlePhoneEngineMessageL( ) "); |
|
245 |
switch ( aMessage ) |
|
246 |
{ |
|
247 |
case MEngineMonitor::EPEMessageIncoming: |
|
248 |
HandleIncomingL( aCallId ); |
|
249 |
break; |
|
250 |
||
251 |
case MEngineMonitor::EPEMessageDialing: |
|
252 |
HandleDialingL( aCallId ); |
|
253 |
break; |
|
254 |
||
255 |
case MEngineMonitor::EPEMessageConnected: |
|
256 |
HandleConnectedL( aCallId ); |
|
257 |
break; |
|
258 |
||
259 |
case MEngineMonitor::EPEMessageIssuedUSSDRequest: |
|
260 |
// Note that after the sending of SS |
|
261 |
// strings the view stays in Dialer. |
|
65 | 262 |
if ( IsNumberEntryUsedL() ) |
263 |
{ |
|
264 |
// Show the number entry if it exists |
|
265 |
SetNumberEntryVisibilityL(ETrue); |
|
266 |
} |
|
267 |
else if ( NeedToSendToBackgroundL() ) |
|
37 | 268 |
{ |
65 | 269 |
// Continue displaying current app but set up the |
270 |
// idle screen in the background |
|
271 |
SetupIdleScreenInBackgroundL(); |
|
272 |
} |
|
273 |
else |
|
274 |
{ |
|
275 |
// Display idle screen |
|
276 |
DisplayIdleScreenL(); |
|
37 | 277 |
} |
278 |
break; |
|
279 |
||
280 |
case MEngineMonitor::EPEMessageIdle: |
|
281 |
HandleIdleL( aCallId ); |
|
282 |
break; |
|
283 |
||
65 | 284 |
case MEngineMonitor::EPEMessageInValidEmergencyNumber: |
285 |
SendGlobalWarningNoteL( EPhoneEmergencyCallsOnly, ETrue ); |
|
37 | 286 |
break; |
287 |
||
288 |
case MEngineMonitor::EPEMessageValidEmergencyNumber: |
|
289 |
DialVoiceCallL(); |
|
290 |
break; |
|
291 |
||
292 |
default: |
|
293 |
CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId ); |
|
294 |
break; |
|
295 |
} |
|
296 |
} |
|
297 |
||
298 |
// ----------------------------------------------------------- |
|
299 |
// CPhoneStateIdle::HandleIncomingL( TInt aCallId ) |
|
300 |
// Default handling for incoming message |
|
301 |
// (other items were commented in a header). |
|
302 |
// ----------------------------------------------------------- |
|
303 |
// |
|
304 |
void CPhoneStateIdle::HandleIncomingL( TInt aCallId ) |
|
305 |
{ |
|
306 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIncomingL( ) "); |
|
307 |
HandleAudioAvailableOutputChangedL(); |
|
308 |
SetRingingTonePlaybackL( aCallId ); |
|
309 |
BeginUiUpdateLC(); |
|
310 |
||
311 |
if ( IsNumberEntryUsedL() ) |
|
312 |
{ |
|
65 | 313 |
SetNumberEntryVisibilityL(EFalse); |
37 | 314 |
} |
315 |
||
316 |
DisplayIncomingCallL( aCallId ); |
|
317 |
SetTouchPaneButtons( EPhoneIncomingCallButtons ); |
|
318 |
CheckDisableHWKeysAndCallUIL(); |
|
319 |
SetBackButtonActive(EFalse); |
|
320 |
EndUiUpdate(); |
|
321 |
||
322 |
iCbaManager->UpdateIncomingCbaL( aCallId ); |
|
323 |
iViewCommandHandle->HandleCommandL( EPhoneViewShowToolbar ); |
|
324 |
iStateMachine->ChangeState( EPhoneStateIncoming ); |
|
325 |
SetDivertIndication( EFalse ); |
|
326 |
} |
|
327 |
||
328 |
// ----------------------------------------------------------- |
|
329 |
// CPhoneStateIdle::HandleDiallingL |
|
330 |
// Default handling for dialling message |
|
331 |
// (other items were commented in a header). |
|
332 |
// ----------------------------------------------------------- |
|
333 |
// |
|
334 |
EXPORT_C void CPhoneStateIdle::HandleDialingL( TInt aCallId ) |
|
335 |
{ |
|
336 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleDialingL( ) "); |
|
337 |
BeginUiUpdateLC(); |
|
65 | 338 |
DisplayCallSetupL( aCallId ); |
339 |
SetTouchPaneButtons( EPhoneCallSetupButtons ); |
|
37 | 340 |
EndUiUpdate(); |
341 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
342 |
iCbaManager->UpdateCbaL( EPhoneCallHandlingCallSetupCBA ); |
|
343 |
iStateMachine->ChangeState( EPhoneStateCallSetup ); |
|
344 |
} |
|
345 |
||
346 |
// ----------------------------------------------------------- |
|
347 |
// CPhoneStateIdle::HandleConnectedL |
|
348 |
// Message Handling function for message EPEMessageConnected |
|
349 |
// This could happen during transaction from Emergency mode |
|
350 |
// to Normal mode where a network status change is received |
|
351 |
// from PE after PE initiates an MO call. Since PE messages |
|
352 |
// are asynchronous, this sequence can occur in any order. |
|
353 |
// (other items were commented in a header). |
|
354 |
// ----------------------------------------------------------- |
|
355 |
// |
|
356 |
void CPhoneStateIdle::HandleConnectedL( TInt aCallId ) |
|
357 |
{ |
|
358 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleConnectedL( ) "); |
|
359 |
// Keep Phone app in the foreground if it is external |
|
360 |
if ( !TopAppIsDisplayedL() ) |
|
361 |
{ |
|
362 |
TPhoneCmdParamInteger uidParam; |
|
363 |
uidParam.SetInteger( KUidPhoneApplication.iUid ); |
|
364 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
|
365 |
&uidParam ); |
|
366 |
} |
|
367 |
BeginUiUpdateLC(); |
|
368 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
369 |
DisplayCallSetupL( aCallId ); |
|
370 |
UpdateSingleActiveCallL( aCallId ); |
|
65 | 371 |
SetTouchPaneButtons( EPhoneIncallButtons ); |
372 |
EndUiUpdate(); |
|
37 | 373 |
|
374 |
iCbaManager->UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
|
375 |
iStateMachine->ChangeState( EPhoneStateSingle ); |
|
376 |
} |
|
377 |
||
378 |
// ----------------------------------------------------------- |
|
379 |
// CPhoneStateIdle::HandleCommandL |
|
380 |
// ----------------------------------------------------------- |
|
381 |
// |
|
382 |
EXPORT_C TBool CPhoneStateIdle::HandleCommandL( TInt aCommand ) |
|
383 |
{ |
|
384 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleCommandL( ) "); |
|
385 |
TBool commandStatus = ETrue; |
|
386 |
switch( aCommand ) |
|
387 |
{ |
|
388 |
case EPhoneCmdOptions: |
|
65 | 389 |
case EPhoneCmdBack: |
37 | 390 |
break; |
391 |
||
392 |
case EPhoneNumberAcqCmdCall: |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
393 |
HandleVoiceCallCommandL(); |
37 | 394 |
break; |
65 | 395 |
|
37 | 396 |
case EPhoneNumberAcqCmdSendCommand: |
397 |
HandleSendCommandL(); |
|
398 |
break; |
|
399 |
||
400 |
case EPhoneNumberAcqCmdVideoCall: |
|
401 |
DialVideoCallL(); |
|
402 |
break; |
|
403 |
||
404 |
default: |
|
405 |
commandStatus = CPhoneState::HandleCommandL( aCommand ); |
|
406 |
break; |
|
407 |
} |
|
408 |
return commandStatus; |
|
409 |
} |
|
410 |
||
411 |
// ----------------------------------------------------------------------------- |
|
412 |
// CPhoneStateIdle::ProcessCommandL |
|
413 |
// ----------------------------------------------------------------------------- |
|
414 |
// |
|
415 |
EXPORT_C TBool CPhoneStateIdle::ProcessCommandL( TInt aCommand ) |
|
416 |
{ |
|
417 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::ProcessCommandL( ) "); |
|
418 |
TBool commandStatus = EFalse; |
|
419 |
switch( aCommand ) |
|
420 |
{ |
|
421 |
case EAknSoftkeyContextOptions: |
|
65 | 422 |
break; |
37 | 423 |
|
424 |
default: |
|
425 |
commandStatus = CPhoneState::ProcessCommandL( aCommand ); |
|
426 |
break; |
|
427 |
} |
|
428 |
return commandStatus; |
|
429 |
} |
|
430 |
||
431 |
// ----------------------------------------------------------------------------- |
|
432 |
// CPhoneStateIdle::HandleRemConCommandL |
|
433 |
// ----------------------------------------------------------------------------- |
|
434 |
// |
|
435 |
EXPORT_C TBool CPhoneStateIdle::HandleRemConCommandL( |
|
436 |
TRemConCoreApiOperationId /*aOperationId */, |
|
437 |
TRemConCoreApiButtonAction /*aButtonAct*/ ) |
|
438 |
{ |
|
439 |
return EFalse; |
|
440 |
} |
|
441 |
||
442 |
// ----------------------------------------------------------- |
|
443 |
// CPhoneStateIdle::DialL |
|
444 |
// ----------------------------------------------------------- |
|
445 |
// |
|
446 |
EXPORT_C void CPhoneStateIdle::DialL( |
|
447 |
const TDesC& aNumber, |
|
448 |
TPhoneNumberType aNumberType, |
|
449 |
TDialInitiationMethod /*aDialMethod*/ ) |
|
450 |
{ |
|
451 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( aNumber ); |
|
452 |
if ( aNumberType == EPhoneNumberTypeVideo && |
|
453 |
FeatureManager::FeatureSupported( KFeatureIdCsVideoTelephony ) ) |
|
454 |
{ |
|
455 |
DialMultimediaCallL(); |
|
456 |
} |
|
457 |
else if ( EPhoneNumberTypeVoip == aNumberType && |
|
458 |
iCustomization ) |
|
459 |
{ |
|
460 |
iCustomization->HandleDialL( aNumber ); |
|
461 |
} |
|
462 |
else |
|
463 |
{ |
|
65 | 464 |
DialVoiceCallL(); |
37 | 465 |
} |
466 |
} |
|
467 |
||
468 |
// ----------------------------------------------------------- |
|
469 |
// CPhoneStateIdle::DialVideoCallL |
|
470 |
// ----------------------------------------------------------- |
|
471 |
// |
|
472 |
void CPhoneStateIdle::DialVideoCallL() |
|
473 |
{ |
|
474 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DialVideoCallL( ) "); |
|
475 |
if ( IsNumberEntryUsedL() ) |
|
476 |
{ |
|
477 |
// get the number entry contents |
|
478 |
HBufC* phoneNumber = PhoneNumberFromEntryLC(); |
|
479 |
#ifdef _DEBUG |
|
480 |
if ( (*phoneNumber).Compare( KExit ) == 0 ) |
|
481 |
{ |
|
482 |
CleanupStack::PopAndDestroy( phoneNumber ); |
|
483 |
SendExitCommandL(); |
|
484 |
} |
|
485 |
else |
|
486 |
#endif // _DEBUG |
|
487 |
{ |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
488 |
// call the number |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
489 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
490 |
DialMultimediaCallL(); |
37 | 491 |
CleanupStack::PopAndDestroy( phoneNumber ); |
492 |
} |
|
65 | 493 |
} |
37 | 494 |
} |
495 |
||
496 |
// ----------------------------------------------------------- |
|
497 |
// CPhoneStateIdle::DisplayIncomingCallL |
|
498 |
// ----------------------------------------------------------- |
|
499 |
// |
|
500 |
EXPORT_C void CPhoneStateIdle::DisplayIncomingCallL( TInt aCallId ) |
|
501 |
{ |
|
502 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DisplayIncomingCallL( ) "); |
|
503 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo() && aCallId >= 0, |
|
504 |
Panic( EPhoneCtrlInvariant ) ); |
|
65 | 505 |
|
37 | 506 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
507 |
TPhoneCmdParamKeyCapture captureParam; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
508 |
captureParam.SetKeyCode( EKeyNo ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
509 |
iViewCommandHandle->ExecuteCommand( EPhoneViewStartCapturingKey, &captureParam ); |
37 | 510 |
|
511 |
// Indicate that the Phone needs to be sent to the background if |
|
512 |
// an application other than the top application is in the foreground |
|
513 |
TPhoneCmdParamBoolean booleanParam; |
|
514 |
booleanParam.SetBoolean( !TopAppIsDisplayedL() ); |
|
515 |
iViewCommandHandle->ExecuteCommandL( |
|
516 |
EPhoneViewSetNeedToSendToBackgroundStatus, |
|
517 |
&booleanParam ); |
|
518 |
||
519 |
TPhoneCmdParamInteger uidParam; |
|
520 |
uidParam.SetInteger( KUidPhoneApplication.iUid ); |
|
521 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
|
522 |
&uidParam ); |
|
523 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication, |
|
524 |
&uidParam ); |
|
525 |
||
526 |
// Disable global notes when there is an incoming call |
|
527 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
528 |
globalNotifierParam.SetBoolean( ETrue ); |
|
529 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
530 |
&globalNotifierParam ); |
|
531 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetEikonNotifiersDisabled, |
|
532 |
&globalNotifierParam ); |
|
533 |
DisplayHeaderForCallComingInL( aCallId, EFalse ); //not waiting |
|
534 |
} |
|
535 |
||
536 |
// ----------------------------------------------------------- |
|
537 |
// CPhoneStateIdle::DisplayCallSetupL |
|
538 |
// ----------------------------------------------------------- |
|
539 |
// |
|
540 |
EXPORT_C void CPhoneStateIdle::DisplayCallSetupL( TInt aCallId ) |
|
541 |
{ |
|
542 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DisplayCallSetupL( ) "); |
|
543 |
__ASSERT_DEBUG( aCallId > KErrNotFound, Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
544 |
||
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
545 |
TPhoneCmdParamKeyCapture captureParam; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
546 |
captureParam.SetKeyCode( EKeyNo ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
547 |
iViewCommandHandle->ExecuteCommand( EPhoneViewStartCapturingKey, &captureParam ); |
37 | 548 |
|
549 |
// Indicate that the Phone needs to be sent to the background if |
|
550 |
// an application other than the top application is in the foreground |
|
551 |
TPhoneCmdParamBoolean booleanParam; |
|
552 |
booleanParam.SetBoolean( !TopAppIsDisplayedL() ); |
|
553 |
iViewCommandHandle->ExecuteCommandL( |
|
554 |
EPhoneViewSetNeedToSendToBackgroundStatus, |
|
555 |
&booleanParam ); |
|
556 |
||
557 |
// Bring Phone app in the foreground |
|
558 |
TPhoneCmdParamInteger uidParam; |
|
559 |
uidParam.SetInteger( KUidPhoneApplication.iUid ); |
|
560 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
|
561 |
&uidParam ); |
|
562 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication, |
|
563 |
&uidParam ); |
|
564 |
||
565 |
DisplayHeaderForOutgoingCallL( aCallId ); |
|
566 |
} |
|
567 |
||
568 |
// ----------------------------------------------------------- |
|
569 |
// CPhoneStateIdle::HandleIdleForegroundEventL |
|
570 |
// ----------------------------------------------------------- |
|
571 |
// |
|
572 |
EXPORT_C void CPhoneStateIdle::HandleIdleForegroundEventL() |
|
573 |
{ |
|
574 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIdleForegroundEventL( ) "); |
|
575 |
if ( IsNumberEntryUsedL() ) |
|
65 | 576 |
{ |
50 | 577 |
if ( IsNumberEntryVisibleL() ) |
37 | 578 |
{ |
579 |
iCbaManager->SetCbaL( EPhoneNumberAcqCBA ); |
|
580 |
} |
|
581 |
} |
|
582 |
else if ( !IsAnyQueryActiveL() ) |
|
583 |
{ |
|
65 | 584 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground ); |
37 | 585 |
} |
586 |
} |
|
587 |
||
588 |
// ----------------------------------------------------------- |
|
589 |
// CPhoneStateIdle::HandlePhoneForegroundEventL |
|
590 |
// ----------------------------------------------------------- |
|
591 |
||
592 |
EXPORT_C void CPhoneStateIdle::HandlePhoneForegroundEventL() |
|
593 |
{ |
|
594 |
} |
|
595 |
||
596 |
// ----------------------------------------------------------- |
|
597 |
// CPhoneStateIdle::HandlePhoneFocusLostEventL |
|
598 |
// ----------------------------------------------------------- |
|
599 |
// |
|
600 |
EXPORT_C void CPhoneStateIdle::HandlePhoneFocusLostEventL() |
|
601 |
{ |
|
602 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandlePhoneFocusLostEventL( ) "); |
|
603 |
if ( !IsNumberEntryUsedL() ) |
|
604 |
{ |
|
65 | 605 |
// If dialer is open add icon to FSW list. |
37 | 606 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW ); |
607 |
} |
|
608 |
} |
|
609 |
||
610 |
// ----------------------------------------------------------- |
|
611 |
// CPhoneStateIdle::HandleIdleL |
|
612 |
// ----------------------------------------------------------- |
|
613 |
// |
|
614 |
void CPhoneStateIdle::HandleIdleL( TInt /*aCallId*/ ) |
|
615 |
{ |
|
65 | 616 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIdleL()" ); |
37 | 617 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveAllCallHeaders ); |
65 | 618 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
619 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
37 | 620 |
} |
621 |
||
622 |
// ----------------------------------------------------------- |
|
623 |
// CPhoneStateIdle::HandleSendCommandL() |
|
624 |
// ----------------------------------------------------------- |
|
625 |
// |
|
626 |
EXPORT_C void CPhoneStateIdle::HandleSendCommandL() |
|
627 |
{ |
|
628 |
__LOGMETHODSTARTEND( |
|
629 |
EPhoneControl, "CPhoneStateIdle::HandleSendCommandL()" ); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
630 |
HandleVoiceCallCommandL(); |
37 | 631 |
} |
632 |
||
633 |
// ----------------------------------------------------------- |
|
634 |
// CPhoneStateIdle:SendExitCommandL |
|
635 |
// ----------------------------------------------------------- |
|
636 |
// |
|
637 |
void CPhoneStateIdle::SendExitCommandL() |
|
638 |
{ |
|
639 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::SendExitCommand( ) "); |
|
640 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
641 |
||
642 |
// Simulate exit command |
|
643 |
CEikonEnv& eikEnv = *CEikonEnv::Static(); |
|
644 |
CCoeEnv& coeEnv = eikEnv; |
|
645 |
RWsSession& wsSession=coeEnv.WsSession(); |
|
646 |
TKeyEvent keyEvent; |
|
647 |
keyEvent.iCode = EEikCmdExit; |
|
648 |
keyEvent.iScanCode = EEikCmdExit; |
|
649 |
keyEvent.iModifiers = 0; |
|
650 |
keyEvent.iRepeats = 0; |
|
651 |
wsSession.SimulateKeyEvent( keyEvent ); |
|
652 |
wsSession.Flush(); |
|
653 |
||
654 |
iViewCommandHandle->ExecuteCommandL( EPhoneAppShutDown ); |
|
655 |
} |
|
656 |
||
657 |
// ----------------------------------------------------------- |
|
658 |
// CPhoneStateIdle::HandleEndKeyPressL |
|
659 |
// ----------------------------------------------------------- |
|
660 |
// |
|
661 |
void CPhoneStateIdle::HandleEndKeyPressL( TPhoneKeyEventMessages aMessage ) |
|
662 |
{ |
|
663 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::HandleEndKeyPressL( ) "); |
|
664 |
// End key not handled also in phone startup when pressed during country/time/date query |
|
665 |
RWsSession sess = CCoeEnv::Static()->WsSession(); |
|
666 |
TApaTaskList appList( sess ); |
|
667 |
TApaTask startup = appList.FindApp( KUidStartupApplication ); |
|
668 |
if ( !IsAutoLockOn() && !IsKeyLockOn() && !startup.Exists() ) |
|
669 |
{ |
|
670 |
//Cancels e.g. USB notifier and Audio notifier. |
|
671 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewCancelAllNotications ); |
|
672 |
// If KFeatureIdFfSimlessOfflineSupport is undef and security note is shown then do not |
|
673 |
// remove security note from screen. |
|
674 |
if ( !( IsSimStateNotPresentWithSecurityModeEnabled() && |
|
675 |
!FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) ) ) |
|
676 |
{ |
|
677 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
678 |
} |
|
679 |
||
680 |
if ( IsSimOk() ) |
|
681 |
{ |
|
682 |
if ( aMessage == EPhoneKeyLongPress ) |
|
683 |
{ |
|
684 |
iStateMachine->SendPhoneEngineMessage( |
|
65 | 685 |
MPEPhoneModel::EPEMessageTerminateAllConnections ); |
37 | 686 |
if ( IsNumberEntryUsedL() ) |
687 |
{ |
|
65 | 688 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
37 | 689 |
// Do state-specific operation when number entry is cleared |
690 |
HandleNumberEntryClearedL(); |
|
691 |
// If long end key event occures then all calls are terminated and |
|
692 |
// dialer is closed, therefore tel.icon must be removed from FSW. |
|
693 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW ); |
|
694 |
} |
|
695 |
if ( !TopAppIsDisplayedL() ) |
|
696 |
{ |
|
697 |
DisplayIdleScreenL(); |
|
698 |
} |
|
699 |
} |
|
700 |
else if ( IsNumberEntryUsedL() && TopAppIsDisplayedL() ) |
|
701 |
{ |
|
65 | 702 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
37 | 703 |
// Do state-specific operation when number entry is cleared |
704 |
HandleNumberEntryClearedL(); |
|
705 |
} |
|
706 |
else if ( !TopAppIsDisplayedL() ) |
|
707 |
{ |
|
708 |
// Phone might not be the topmost app since it has |
|
709 |
// some dialog/query open therefore we need to check this |
|
710 |
// and remove dialog/phone. |
|
711 |
if ( IsAnyQueryActiveL() ) |
|
712 |
{ |
|
713 |
if ( !IsSimStateNotPresentWithSecurityModeEnabled() ) |
|
714 |
{ |
|
715 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
716 |
} |
|
65 | 717 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
718 |
} |
|
37 | 719 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground ); |
720 |
} |
|
721 |
} |
|
722 |
else if ( IsNumberEntryUsedL() ) |
|
723 |
{ |
|
65 | 724 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
725 |
StartShowSecurityNoteL(); |
|
37 | 726 |
} |
727 |
} |
|
728 |
} |
|
729 |
||
730 |
// ----------------------------------------------------------- |
|
731 |
// CPhoneStateIdle::DialMultimediaCallL |
|
732 |
// ----------------------------------------------------------- |
|
733 |
// |
|
734 |
EXPORT_C void CPhoneStateIdle::DialMultimediaCallL() |
|
735 |
{ |
|
736 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::DialMultimediaCall() "); |
|
65 | 737 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) ); |
37 | 738 |
if ( RestoreOngoing() ) |
739 |
{ |
|
740 |
CPhoneState::SendGlobalInfoNoteL( EPhoneInformationVideoCallNotAllowedDuringRestoreNote ); |
|
741 |
} |
|
742 |
else |
|
743 |
{ |
|
744 |
CPhoneState::DialMultimediaCallL(); |
|
745 |
} |
|
746 |
} |
|
747 |
||
748 |
// ----------------------------------------------------------- |
|
749 |
// CPhoneStateIdle::DialVoiceCallL |
|
750 |
// ----------------------------------------------------------- |
|
751 |
// |
|
752 |
EXPORT_C void CPhoneStateIdle::DialVoiceCallL() |
|
753 |
{ |
|
754 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DialVoiceCallL() "); |
|
65 | 755 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) ); |
37 | 756 |
TPhoneCmdParamBoolean globalNotifierParam; |
757 |
globalNotifierParam.SetBoolean( ETrue ); |
|
758 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
759 |
&globalNotifierParam ); |
|
760 |
CPhoneState::DialVoiceCallL(); |
|
761 |
} |
|
762 |
||
763 |
// ----------------------------------------------------------------------------- |
|
764 |
// CPhoneStateIdle::RestoreOngoing |
|
765 |
// ----------------------------------------------------------------------------- |
|
766 |
// |
|
767 |
TBool CPhoneStateIdle::RestoreOngoing() |
|
768 |
{ |
|
769 |
TInt restoreValue; |
|
770 |
RProperty::Get( KUidSystemCategory, |
|
771 |
conn::KUidBackupRestoreKey, |
|
772 |
restoreValue ); |
|
773 |
return ( restoreValue & ( conn::EBURRestoreFull | conn::EBURRestorePartial )); |
|
774 |
} |
|
775 |
||
776 |
// ----------------------------------------------------------- |
|
777 |
// CPhoneStateIdle::HandleVoiceCallCommandL() |
|
778 |
// ----------------------------------------------------------- |
|
779 |
// |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
780 |
void CPhoneStateIdle::HandleVoiceCallCommandL() |
37 | 781 |
{ |
782 |
__LOGMETHODSTARTEND( |
|
783 |
EPhoneControl, "CPhoneStateIdle::HandleVoiceCallCommandL()" ); |
|
784 |
if ( IsNumberEntryUsedL() ) |
|
785 |
{ |
|
786 |
HBufC* phoneNumber = PhoneNumberFromEntryLC(); |
|
787 |
if ( !IsSimOk() ) |
|
788 |
{ |
|
789 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ) ; |
|
790 |
iStateMachine->SendPhoneEngineMessage( |
|
791 |
MPEPhoneModel::EPEMessageCheckEmergencyNumber ); |
|
792 |
CleanupStack::PopAndDestroy( phoneNumber ); |
|
793 |
return; |
|
794 |
} |
|
795 |
||
796 |
#ifdef _DEBUG |
|
797 |
if ( (*phoneNumber).Compare( KExit ) == 0 ) |
|
798 |
{ |
|
799 |
CleanupStack::PopAndDestroy( phoneNumber ); |
|
800 |
SendExitCommandL(); |
|
801 |
} |
|
802 |
else |
|
803 |
#endif // _DEBUG |
|
804 |
{ |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
805 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
806 |
DialVoiceCallL(); |
37 | 807 |
CleanupStack::PopAndDestroy( phoneNumber ); |
808 |
} |
|
809 |
} |
|
810 |
} |
|
811 |
||
812 |
// End of File |