author | hgs |
Mon, 04 Oct 2010 16:06:10 +0300 | |
changeset 76 | cfea66083b62 |
parent 74 | d1c62c765e48 |
child 78 | baacf668fe89 |
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 |
{ |
|
74 | 142 |
RemoveDialogsAndSendPhoneToBackgroundL(); |
37 | 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: |
|
74 | 174 |
if ( iNumberEntryManager->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() ); |
|
74 | 184 |
if ( neLength == 0 && !isSecurityMode.Boolean()) |
37 | 185 |
{ |
65 | 186 |
// start logs |
187 |
iViewCommandHandle->HandleCommandL( |
|
188 |
EPhoneDialerCmdLog ); |
|
189 |
return; |
|
37 | 190 |
} |
65 | 191 |
HandleSendCommandL(); |
192 |
} |
|
193 |
// If dialer is not open but phone is in foreground and phone receives |
|
194 |
// send-key event we have to check if security mode is true and if it |
|
195 |
// is then open emergency dialer. |
|
74 | 196 |
else |
65 | 197 |
{ |
198 |
TPhoneCmdParamBoolean isSecurityMode; |
|
199 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode ); |
|
200 |
if ( isSecurityMode.Boolean()) |
|
37 | 201 |
{ |
65 | 202 |
// launch dialer. |
203 |
HandleCommandL(EPhoneNumberAcqSecurityDialer); |
|
204 |
} |
|
37 | 205 |
} |
206 |
break; |
|
207 |
||
208 |
case EKeyApplication0: |
|
209 |
{ |
|
210 |
// If dialer is not open but phone is in foreground and phone receives |
|
211 |
// applicaion-key event we have to open emergency dialer. No need own |
|
212 |
// securitymode check because Applicationkey only captured in securitymode. |
|
74 | 213 |
if ( !iNumberEntryManager->IsNumberEntryUsedL() ) |
37 | 214 |
{ |
215 |
HandleCommandL(EPhoneNumberAcqSecurityDialer); |
|
65 | 216 |
} |
37 | 217 |
} |
218 |
break; |
|
65 | 219 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
37 | 220 |
case EKeyEnter: |
74 | 221 |
if ( iNumberEntryManager->IsNumberEntryVisibleL() ) |
37 | 222 |
{ |
223 |
HandleCommandL( EPhoneCmdOptions ); |
|
224 |
} |
|
225 |
break; |
|
226 |
#endif |
|
227 |
default: |
|
228 |
break; |
|
229 |
} |
|
230 |
} |
|
231 |
||
232 |
// ----------------------------------------------------------- |
|
233 |
// CPhoneStateIdle::HandlePhoneEngineMessageL |
|
234 |
// ----------------------------------------------------------- |
|
235 |
// |
|
236 |
EXPORT_C void CPhoneStateIdle::HandlePhoneEngineMessageL( |
|
237 |
const TInt aMessage, |
|
238 |
TInt aCallId ) |
|
239 |
{ |
|
240 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandlePhoneEngineMessageL( ) "); |
|
241 |
switch ( aMessage ) |
|
242 |
{ |
|
243 |
case MEngineMonitor::EPEMessageIncoming: |
|
244 |
HandleIncomingL( aCallId ); |
|
245 |
break; |
|
246 |
||
247 |
case MEngineMonitor::EPEMessageDialing: |
|
248 |
HandleDialingL( aCallId ); |
|
249 |
break; |
|
250 |
||
251 |
case MEngineMonitor::EPEMessageConnected: |
|
252 |
HandleConnectedL( aCallId ); |
|
253 |
break; |
|
254 |
||
255 |
case MEngineMonitor::EPEMessageIssuedUSSDRequest: |
|
256 |
// Note that after the sending of SS |
|
257 |
// strings the view stays in Dialer. |
|
74 | 258 |
if ( !iNumberEntryManager->SetVisibilityIfNumberEntryUsedL( ETrue ) ) |
37 | 259 |
{ |
74 | 260 |
RemoveDialogsAndSendPhoneToBackgroundL(); |
37 | 261 |
} |
262 |
break; |
|
263 |
||
264 |
case MEngineMonitor::EPEMessageIdle: |
|
265 |
HandleIdleL( aCallId ); |
|
266 |
break; |
|
267 |
||
65 | 268 |
case MEngineMonitor::EPEMessageInValidEmergencyNumber: |
269 |
SendGlobalWarningNoteL( EPhoneEmergencyCallsOnly, ETrue ); |
|
37 | 270 |
break; |
271 |
||
272 |
case MEngineMonitor::EPEMessageValidEmergencyNumber: |
|
273 |
DialVoiceCallL(); |
|
274 |
break; |
|
275 |
||
276 |
default: |
|
277 |
CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId ); |
|
278 |
break; |
|
279 |
} |
|
280 |
} |
|
281 |
||
282 |
// ----------------------------------------------------------- |
|
283 |
// CPhoneStateIdle::HandleIncomingL( TInt aCallId ) |
|
284 |
// Default handling for incoming message |
|
285 |
// (other items were commented in a header). |
|
286 |
// ----------------------------------------------------------- |
|
287 |
// |
|
288 |
void CPhoneStateIdle::HandleIncomingL( TInt aCallId ) |
|
289 |
{ |
|
290 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIncomingL( ) "); |
|
291 |
HandleAudioAvailableOutputChangedL(); |
|
292 |
SetRingingTonePlaybackL( aCallId ); |
|
74 | 293 |
|
37 | 294 |
BeginUiUpdateLC(); |
74 | 295 |
iNumberEntryManager->SetVisibilityIfNumberEntryUsedL(EFalse); |
37 | 296 |
DisplayIncomingCallL( aCallId ); |
297 |
SetBackButtonActive(EFalse); |
|
74 | 298 |
UpdateUiCommands(); |
37 | 299 |
EndUiUpdate(); |
300 |
||
74 | 301 |
ChangeTo( EPhoneStateIncoming ); |
37 | 302 |
} |
303 |
||
304 |
// ----------------------------------------------------------- |
|
74 | 305 |
// CPhoneStateIdle::HandleDialingL |
37 | 306 |
// Default handling for dialling message |
307 |
// (other items were commented in a header). |
|
308 |
// ----------------------------------------------------------- |
|
309 |
// |
|
310 |
EXPORT_C void CPhoneStateIdle::HandleDialingL( TInt aCallId ) |
|
311 |
{ |
|
74 | 312 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleDialingL( ) "); |
313 |
TPhoneCmdParamKeyCapture captureParam; |
|
314 |
captureParam.SetKeyCode( EKeyNo ); |
|
315 |
iViewCommandHandle->ExecuteCommand( EPhoneViewStartCapturingKey, &captureParam ); |
|
316 |
DisplayCallHeaderL( aCallId, ESetNEVisibilityFalse ); |
|
317 |
SetToolbarButtonLoudspeakerEnabled(); |
|
318 |
ChangeTo( EPhoneStateCallSetup ); |
|
37 | 319 |
} |
320 |
||
321 |
// ----------------------------------------------------------- |
|
322 |
// CPhoneStateIdle::HandleConnectedL |
|
323 |
// Message Handling function for message EPEMessageConnected |
|
324 |
// This could happen during transaction from Emergency mode |
|
325 |
// to Normal mode where a network status change is received |
|
326 |
// from PE after PE initiates an MO call. Since PE messages |
|
327 |
// are asynchronous, this sequence can occur in any order. |
|
328 |
// (other items were commented in a header). |
|
329 |
// ----------------------------------------------------------- |
|
330 |
// |
|
331 |
void CPhoneStateIdle::HandleConnectedL( TInt aCallId ) |
|
332 |
{ |
|
333 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleConnectedL( ) "); |
|
334 |
BeginUiUpdateLC(); |
|
335 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
74 | 336 |
DisplayCallHeaderL( aCallId, ESetNEVisibilityFalse ); |
37 | 337 |
UpdateSingleActiveCallL( aCallId ); |
74 | 338 |
UpdateUiCommands(); |
65 | 339 |
EndUiUpdate(); |
74 | 340 |
ChangeTo( EPhoneStateSingle ); |
37 | 341 |
} |
342 |
||
343 |
// ----------------------------------------------------------- |
|
344 |
// CPhoneStateIdle::HandleCommandL |
|
345 |
// ----------------------------------------------------------- |
|
346 |
// |
|
347 |
EXPORT_C TBool CPhoneStateIdle::HandleCommandL( TInt aCommand ) |
|
348 |
{ |
|
349 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleCommandL( ) "); |
|
350 |
TBool commandStatus = ETrue; |
|
351 |
switch( aCommand ) |
|
352 |
{ |
|
353 |
case EPhoneCmdOptions: |
|
65 | 354 |
case EPhoneCmdBack: |
37 | 355 |
break; |
356 |
||
357 |
case EPhoneNumberAcqCmdCall: |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
358 |
HandleVoiceCallCommandL(); |
37 | 359 |
break; |
65 | 360 |
|
37 | 361 |
case EPhoneNumberAcqCmdSendCommand: |
362 |
HandleSendCommandL(); |
|
363 |
break; |
|
364 |
||
365 |
case EPhoneNumberAcqCmdVideoCall: |
|
366 |
DialVideoCallL(); |
|
367 |
break; |
|
368 |
||
369 |
default: |
|
370 |
commandStatus = CPhoneState::HandleCommandL( aCommand ); |
|
371 |
break; |
|
372 |
} |
|
373 |
return commandStatus; |
|
374 |
} |
|
375 |
||
376 |
// ----------------------------------------------------------------------------- |
|
377 |
// CPhoneStateIdle::ProcessCommandL |
|
378 |
// ----------------------------------------------------------------------------- |
|
379 |
// |
|
380 |
EXPORT_C TBool CPhoneStateIdle::ProcessCommandL( TInt aCommand ) |
|
381 |
{ |
|
382 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::ProcessCommandL( ) "); |
|
383 |
TBool commandStatus = EFalse; |
|
384 |
switch( aCommand ) |
|
385 |
{ |
|
386 |
case EAknSoftkeyContextOptions: |
|
65 | 387 |
break; |
37 | 388 |
|
389 |
default: |
|
390 |
commandStatus = CPhoneState::ProcessCommandL( aCommand ); |
|
391 |
break; |
|
392 |
} |
|
393 |
return commandStatus; |
|
394 |
} |
|
395 |
||
396 |
// ----------------------------------------------------------------------------- |
|
397 |
// CPhoneStateIdle::HandleRemConCommandL |
|
398 |
// ----------------------------------------------------------------------------- |
|
399 |
// |
|
400 |
EXPORT_C TBool CPhoneStateIdle::HandleRemConCommandL( |
|
401 |
TRemConCoreApiOperationId /*aOperationId */, |
|
402 |
TRemConCoreApiButtonAction /*aButtonAct*/ ) |
|
403 |
{ |
|
404 |
return EFalse; |
|
405 |
} |
|
406 |
||
407 |
// ----------------------------------------------------------- |
|
408 |
// CPhoneStateIdle::DialL |
|
409 |
// ----------------------------------------------------------- |
|
410 |
// |
|
411 |
EXPORT_C void CPhoneStateIdle::DialL( |
|
412 |
const TDesC& aNumber, |
|
413 |
TPhoneNumberType aNumberType, |
|
414 |
TDialInitiationMethod /*aDialMethod*/ ) |
|
415 |
{ |
|
416 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( aNumber ); |
|
417 |
if ( aNumberType == EPhoneNumberTypeVideo && |
|
418 |
FeatureManager::FeatureSupported( KFeatureIdCsVideoTelephony ) ) |
|
419 |
{ |
|
420 |
DialMultimediaCallL(); |
|
421 |
} |
|
422 |
else if ( EPhoneNumberTypeVoip == aNumberType && |
|
423 |
iCustomization ) |
|
424 |
{ |
|
425 |
iCustomization->HandleDialL( aNumber ); |
|
426 |
} |
|
427 |
else |
|
428 |
{ |
|
65 | 429 |
DialVoiceCallL(); |
37 | 430 |
} |
431 |
} |
|
432 |
||
433 |
// ----------------------------------------------------------- |
|
434 |
// CPhoneStateIdle::DialVideoCallL |
|
435 |
// ----------------------------------------------------------- |
|
436 |
// |
|
437 |
void CPhoneStateIdle::DialVideoCallL() |
|
438 |
{ |
|
439 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DialVideoCallL( ) "); |
|
74 | 440 |
if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
37 | 441 |
{ |
442 |
// get the number entry contents |
|
74 | 443 |
HBufC* phoneNumber = iNumberEntryManager->PhoneNumberFromEntryLC(); |
37 | 444 |
#ifdef _DEBUG |
445 |
if ( (*phoneNumber).Compare( KExit ) == 0 ) |
|
446 |
{ |
|
447 |
CleanupStack::PopAndDestroy( phoneNumber ); |
|
448 |
SendExitCommandL(); |
|
449 |
} |
|
450 |
else |
|
451 |
#endif // _DEBUG |
|
452 |
{ |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
453 |
// call the number |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
454 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
455 |
DialMultimediaCallL(); |
37 | 456 |
CleanupStack::PopAndDestroy( phoneNumber ); |
457 |
} |
|
65 | 458 |
} |
37 | 459 |
} |
460 |
||
461 |
// ----------------------------------------------------------- |
|
462 |
// CPhoneStateIdle::DisplayIncomingCallL |
|
463 |
// ----------------------------------------------------------- |
|
464 |
// |
|
465 |
EXPORT_C void CPhoneStateIdle::DisplayIncomingCallL( TInt aCallId ) |
|
466 |
{ |
|
467 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DisplayIncomingCallL( ) "); |
|
468 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo() && aCallId >= 0, |
|
469 |
Panic( EPhoneCtrlInvariant ) ); |
|
65 | 470 |
|
37 | 471 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
472 |
TPhoneCmdParamKeyCapture captureParam; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
473 |
captureParam.SetKeyCode( EKeyNo ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
474 |
iViewCommandHandle->ExecuteCommand( EPhoneViewStartCapturingKey, &captureParam ); |
74 | 475 |
|
476 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringPhoneAppToForeground ); |
|
477 |
||
37 | 478 |
// Disable global notes when there is an incoming call |
479 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
480 |
globalNotifierParam.SetBoolean( ETrue ); |
|
481 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
482 |
&globalNotifierParam ); |
|
74 | 483 |
iViewCommandHandle->ExecuteCommandL(EPhoneViewCreateCallHeader, aCallId); |
37 | 484 |
} |
485 |
||
486 |
// ----------------------------------------------------------- |
|
487 |
// CPhoneStateIdle::HandlePhoneFocusLostEventL |
|
488 |
// ----------------------------------------------------------- |
|
489 |
// |
|
490 |
EXPORT_C void CPhoneStateIdle::HandlePhoneFocusLostEventL() |
|
491 |
{ |
|
492 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandlePhoneFocusLostEventL( ) "); |
|
74 | 493 |
if ( !iNumberEntryManager->IsNumberEntryUsedL() ) |
37 | 494 |
{ |
65 | 495 |
// If dialer is open add icon to FSW list. |
37 | 496 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW ); |
497 |
} |
|
498 |
} |
|
499 |
||
500 |
// ----------------------------------------------------------- |
|
501 |
// CPhoneStateIdle::HandleIdleL |
|
502 |
// ----------------------------------------------------------- |
|
503 |
// |
|
504 |
void CPhoneStateIdle::HandleIdleL( TInt /*aCallId*/ ) |
|
505 |
{ |
|
65 | 506 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIdleL()" ); |
37 | 507 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveAllCallHeaders ); |
65 | 508 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
509 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
37 | 510 |
} |
511 |
||
512 |
// ----------------------------------------------------------- |
|
513 |
// CPhoneStateIdle::HandleSendCommandL() |
|
514 |
// ----------------------------------------------------------- |
|
515 |
// |
|
516 |
EXPORT_C void CPhoneStateIdle::HandleSendCommandL() |
|
517 |
{ |
|
518 |
__LOGMETHODSTARTEND( |
|
519 |
EPhoneControl, "CPhoneStateIdle::HandleSendCommandL()" ); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
520 |
HandleVoiceCallCommandL(); |
37 | 521 |
} |
522 |
||
523 |
// ----------------------------------------------------------- |
|
524 |
// CPhoneStateIdle:SendExitCommandL |
|
525 |
// ----------------------------------------------------------- |
|
526 |
// |
|
527 |
void CPhoneStateIdle::SendExitCommandL() |
|
528 |
{ |
|
529 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::SendExitCommand( ) "); |
|
74 | 530 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
531 |
// Simulate exit command |
|
532 |
RWsSession& wsSession = EikonEnv()->WsSession(); |
|
533 |
TKeyEvent keyEvent; |
|
534 |
keyEvent.iCode = EEikCmdExit; |
|
535 |
keyEvent.iScanCode = EEikCmdExit; |
|
536 |
keyEvent.iModifiers = 0; |
|
537 |
keyEvent.iRepeats = 0; |
|
538 |
wsSession.SimulateKeyEvent( keyEvent ); |
|
539 |
wsSession.Flush(); |
|
37 | 540 |
|
541 |
iViewCommandHandle->ExecuteCommandL( EPhoneAppShutDown ); |
|
542 |
} |
|
543 |
||
544 |
// ----------------------------------------------------------- |
|
545 |
// CPhoneStateIdle::HandleEndKeyPressL |
|
546 |
// ----------------------------------------------------------- |
|
547 |
// |
|
548 |
void CPhoneStateIdle::HandleEndKeyPressL( TPhoneKeyEventMessages aMessage ) |
|
549 |
{ |
|
550 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::HandleEndKeyPressL( ) "); |
|
551 |
// End key not handled also in phone startup when pressed during country/time/date query |
|
552 |
RWsSession sess = CCoeEnv::Static()->WsSession(); |
|
553 |
TApaTaskList appList( sess ); |
|
554 |
TApaTask startup = appList.FindApp( KUidStartupApplication ); |
|
74 | 555 |
if ( !IsAutoLockOn() && !startup.Exists() ) |
37 | 556 |
{ |
557 |
//Cancels e.g. USB notifier and Audio notifier. |
|
558 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewCancelAllNotications ); |
|
559 |
// If KFeatureIdFfSimlessOfflineSupport is undef and security note is shown then do not |
|
560 |
// remove security note from screen. |
|
561 |
if ( !( IsSimStateNotPresentWithSecurityModeEnabled() && |
|
562 |
!FeatureManager::FeatureSupported( KFeatureIdFfSimlessOfflineSupport ) ) ) |
|
563 |
{ |
|
564 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
565 |
} |
|
566 |
||
567 |
if ( IsSimOk() ) |
|
568 |
{ |
|
569 |
if ( aMessage == EPhoneKeyLongPress ) |
|
570 |
{ |
|
571 |
iStateMachine->SendPhoneEngineMessage( |
|
65 | 572 |
MPEPhoneModel::EPEMessageTerminateAllConnections ); |
74 | 573 |
if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
37 | 574 |
{ |
65 | 575 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
37 | 576 |
// Do state-specific operation when number entry is cleared |
577 |
HandleNumberEntryClearedL(); |
|
578 |
// If long end key event occures then all calls are terminated and |
|
579 |
// dialer is closed, therefore tel.icon must be removed from FSW. |
|
580 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateFSW ); |
|
581 |
} |
|
582 |
} |
|
74 | 583 |
else if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
37 | 584 |
{ |
65 | 585 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
37 | 586 |
// Do state-specific operation when number entry is cleared |
587 |
HandleNumberEntryClearedL(); |
|
588 |
} |
|
589 |
} |
|
74 | 590 |
else if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
37 | 591 |
{ |
65 | 592 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
593 |
StartShowSecurityNoteL(); |
|
37 | 594 |
} |
595 |
} |
|
596 |
} |
|
597 |
||
598 |
// ----------------------------------------------------------- |
|
599 |
// CPhoneStateIdle::DialMultimediaCallL |
|
600 |
// ----------------------------------------------------------- |
|
601 |
// |
|
602 |
EXPORT_C void CPhoneStateIdle::DialMultimediaCallL() |
|
603 |
{ |
|
604 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateIdle::DialMultimediaCall() "); |
|
65 | 605 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) ); |
37 | 606 |
if ( RestoreOngoing() ) |
607 |
{ |
|
608 |
CPhoneState::SendGlobalInfoNoteL( EPhoneInformationVideoCallNotAllowedDuringRestoreNote ); |
|
609 |
} |
|
610 |
else |
|
611 |
{ |
|
612 |
CPhoneState::DialMultimediaCallL(); |
|
613 |
} |
|
614 |
} |
|
615 |
||
616 |
// ----------------------------------------------------------- |
|
617 |
// CPhoneStateIdle::DialVoiceCallL |
|
618 |
// ----------------------------------------------------------- |
|
619 |
// |
|
620 |
EXPORT_C void CPhoneStateIdle::DialVoiceCallL() |
|
621 |
{ |
|
622 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::DialVoiceCallL() "); |
|
65 | 623 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) ); |
37 | 624 |
TPhoneCmdParamBoolean globalNotifierParam; |
625 |
globalNotifierParam.SetBoolean( ETrue ); |
|
626 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
627 |
&globalNotifierParam ); |
|
628 |
CPhoneState::DialVoiceCallL(); |
|
629 |
} |
|
630 |
||
631 |
// ----------------------------------------------------------------------------- |
|
632 |
// CPhoneStateIdle::RestoreOngoing |
|
633 |
// ----------------------------------------------------------------------------- |
|
634 |
// |
|
635 |
TBool CPhoneStateIdle::RestoreOngoing() |
|
636 |
{ |
|
637 |
TInt restoreValue; |
|
638 |
RProperty::Get( KUidSystemCategory, |
|
639 |
conn::KUidBackupRestoreKey, |
|
640 |
restoreValue ); |
|
641 |
return ( restoreValue & ( conn::EBURRestoreFull | conn::EBURRestorePartial )); |
|
642 |
} |
|
643 |
||
644 |
// ----------------------------------------------------------- |
|
645 |
// CPhoneStateIdle::HandleVoiceCallCommandL() |
|
646 |
// ----------------------------------------------------------- |
|
647 |
// |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
648 |
void CPhoneStateIdle::HandleVoiceCallCommandL() |
37 | 649 |
{ |
650 |
__LOGMETHODSTARTEND( |
|
651 |
EPhoneControl, "CPhoneStateIdle::HandleVoiceCallCommandL()" ); |
|
74 | 652 |
if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
37 | 653 |
{ |
74 | 654 |
HBufC* phoneNumber = iNumberEntryManager->PhoneNumberFromEntryLC(); |
37 | 655 |
if ( !IsSimOk() ) |
656 |
{ |
|
657 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ) ; |
|
658 |
iStateMachine->SendPhoneEngineMessage( |
|
659 |
MPEPhoneModel::EPEMessageCheckEmergencyNumber ); |
|
660 |
CleanupStack::PopAndDestroy( phoneNumber ); |
|
661 |
return; |
|
662 |
} |
|
663 |
||
664 |
#ifdef _DEBUG |
|
665 |
if ( (*phoneNumber).Compare( KExit ) == 0 ) |
|
666 |
{ |
|
667 |
CleanupStack::PopAndDestroy( phoneNumber ); |
|
668 |
SendExitCommandL(); |
|
669 |
} |
|
670 |
else |
|
671 |
#endif // _DEBUG |
|
672 |
{ |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
673 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
674 |
DialVoiceCallL(); |
37 | 675 |
CleanupStack::PopAndDestroy( phoneNumber ); |
676 |
} |
|
677 |
} |
|
678 |
} |
|
679 |
||
74 | 680 |
// ----------------------------------------------------------- |
681 |
// CPhoneStateIdle::ChangeTo |
|
682 |
// ----------------------------------------------------------- |
|
683 |
// |
|
684 |
void CPhoneStateIdle::ChangeTo( TInt aState ) |
|
685 |
{ |
|
686 |
__PHONELOG1( EBasic, EPhoneControl, |
|
687 |
"PhoneUIControl: CPhoneStateIdle::ChangeTo - aState =%d ", |
|
688 |
aState ); |
|
689 |
iStateMachine->ChangeState( aState ); |
|
690 |
} |
|
691 |
||
37 | 692 |
// End of File |