author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 06 Jul 2010 14:15:47 +0300 | |
changeset 46 | bc5a64e5bc3c |
parent 37 | ba76fc04e6c2 |
child 50 | 377c906a8701 |
child 51 | f39ed5e045e0 |
permissions | -rw-r--r-- |
37 | 1 |
/* |
2 |
* Copyright (c) 2005-2008 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 CPhoneSingleCall class. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
// INCLUDES |
|
20 |
#include <eikmenub.h> |
|
21 |
#include <eikenv.h> |
|
22 |
#include <StringLoader.h> |
|
23 |
#include <featmgr.h> |
|
24 |
#include <pevirtualengine.h> |
|
25 |
#include <mpeengineinfo.h> |
|
26 |
#include <cpephonemodelif.h> |
|
27 |
#include <connect/sbdefs.h> |
|
28 |
#include <videotelcontrolmediatorapi.h> |
|
29 |
#include <MediatorDomainUIDs.h> |
|
30 |
#include <telephonyvariant.hrh> |
|
31 |
||
32 |
#include "cphonesinglecall.h" |
|
33 |
#include "tphonecmdparamstring.h" |
|
34 |
#include "tphonecmdparamboolean.h" |
|
35 |
#include "tphonecmdparamcallheaderdata.h" |
|
36 |
#include "mphonestatemachine.h" |
|
37 |
#include "tphonecmdparaminteger.h" |
|
38 |
#include "phoneviewcommanddefinitions.h" |
|
39 |
#include "phoneui.hrh" |
|
40 |
#include "cphonemainresourceresolver.h" |
|
41 |
#include "phonerssbase.h" |
|
42 |
#include "phonestatedefinitionsgsm.h" |
|
43 |
#include "tphonecmdparamglobalnote.h" |
|
44 |
#include "tphonecmdparamcallstatedata.h" |
|
45 |
#include "phonelogger.h" |
|
46 |
#include "cphonepubsubproxy.h" |
|
47 |
#include "cphonemediatorfactory.h" |
|
48 |
#include "cphonemediatorsender.h" |
|
49 |
#include "cphoneswitchtovideoorvoicecommand.h" |
|
50 |
#include "mphonestorage.h" |
|
51 |
#include "cphonecenrepproxy.h" |
|
52 |
||
53 |
// ================= MEMBER FUNCTIONS ======================= |
|
54 |
||
55 |
// C++ default constructor can NOT contain any code, that |
|
56 |
// might leave. |
|
57 |
// |
|
58 |
EXPORT_C CPhoneSingleCall::CPhoneSingleCall( |
|
59 |
MPhoneStateMachine* aStateMachine, |
|
60 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
61 |
MPhoneCustomization* aPhoneCustomization ) : |
|
62 |
CPhoneGsmInCall( aStateMachine, aViewCommandHandle, aPhoneCustomization ) |
|
63 |
{ |
|
64 |
} |
|
65 |
||
66 |
// ----------------------------------------------------------- |
|
67 |
// CPhoneSingleCall::~CPhoneSingleCall() |
|
68 |
// Destructor |
|
69 |
// (other items were commented in a header). |
|
70 |
// ----------------------------------------------------------- |
|
71 |
// |
|
72 |
EXPORT_C CPhoneSingleCall::~CPhoneSingleCall() |
|
73 |
{ |
|
74 |
} |
|
75 |
||
76 |
// ----------------------------------------------------------- |
|
77 |
// CPhoneSingleCall::ConstructL() |
|
78 |
// Constructor |
|
79 |
// (other items were commented in a header). |
|
80 |
// ----------------------------------------------------------- |
|
81 |
// |
|
82 |
EXPORT_C void CPhoneSingleCall::ConstructL() |
|
83 |
{ |
|
84 |
CPhoneGsmInCall::ConstructL(); |
|
85 |
||
86 |
// Re-enable global notes |
|
87 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
88 |
globalNotifierParam.SetBoolean( EFalse ); |
|
89 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
90 |
&globalNotifierParam ); |
|
91 |
||
92 |
TPhoneCmdParamBoolean holdFlag; |
|
93 |
holdFlag.SetBoolean( EFalse ); |
|
94 |
// Fetch active call's id from view |
|
95 |
TPhoneCmdParamCallStateData callStateData; |
|
96 |
callStateData.SetCallState( EPEStateConnected ); |
|
97 |
iViewCommandHandle->HandleCommandL( |
|
98 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
99 |
||
100 |
if( callStateData.CallId() == KErrNotFound ) |
|
101 |
{ |
|
102 |
holdFlag.SetBoolean( ETrue ); |
|
103 |
// No connected call, find the hold call |
|
104 |
callStateData.SetCallState( EPEStateHeld ); |
|
105 |
iViewCommandHandle->HandleCommandL( |
|
106 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
107 |
||
108 |
if ( callStateData.CallId() == KErrNotFound ) |
|
109 |
{ |
|
110 |
// No hold call, find the disconnected call |
|
111 |
callStateData.SetCallState( EPEStateDisconnecting ); |
|
112 |
iViewCommandHandle->HandleCommandL( |
|
113 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
114 |
} |
|
115 |
} |
|
116 |
||
117 |
iCallId = callStateData.CallId(); |
|
118 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); |
|
119 |
||
120 |
||
121 |
// Update phone number availability for menu use |
|
122 |
PhoneNumberAvailableInPhoneEngineL( callStateData.CallId() ); |
|
123 |
||
124 |
} |
|
125 |
||
126 |
// ----------------------------------------------------------- |
|
127 |
// CPhoneSingleCall::NewL() |
|
128 |
// Constructor |
|
129 |
// (other items were commented in a header). |
|
130 |
// ----------------------------------------------------------- |
|
131 |
// |
|
132 |
CPhoneSingleCall* CPhoneSingleCall::NewL( |
|
133 |
MPhoneStateMachine* aStateMachine, |
|
134 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
135 |
MPhoneCustomization* aPhoneCustomization ) |
|
136 |
{ |
|
137 |
CPhoneSingleCall* self = new( ELeave ) CPhoneSingleCall( |
|
138 |
aStateMachine, aViewCommandHandle, aPhoneCustomization ); |
|
139 |
||
140 |
CleanupStack::PushL( self ); |
|
141 |
self->ConstructL(); |
|
142 |
CleanupStack::Pop( self ); |
|
143 |
||
144 |
return self; |
|
145 |
} |
|
146 |
||
147 |
// -------------------------------------------------------------- |
|
148 |
// CPhoneSingleCall::HandleKeyMessageL |
|
149 |
// -------------------------------------------------------------- |
|
150 |
// |
|
151 |
EXPORT_C void CPhoneSingleCall::HandleKeyMessageL( |
|
152 |
TPhoneKeyEventMessages aMessage, |
|
153 |
TKeyCode aCode ) |
|
154 |
{ |
|
155 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleCall::HandleKeyMessageL()"); |
|
156 |
switch ( aCode ) |
|
157 |
{ |
|
158 |
// send-key |
|
159 |
case EKeyYes: |
|
160 |
if( IsNumberEntryUsedL() ) |
|
161 |
{ |
|
162 |
if ( IsVideoCallActiveL() ) |
|
163 |
{ |
|
164 |
HBufC *phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize ); |
|
165 |
TPtr ptr( phoneNumber->Des() ); |
|
166 |
TPhoneCmdParamString stringParam; |
|
167 |
stringParam.SetString( &ptr ); |
|
168 |
iViewCommandHandle->ExecuteCommand( |
|
169 |
EPhoneViewGetNumberFromEntry, |
|
170 |
&stringParam ); |
|
171 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( ptr ) ; |
|
172 |
||
173 |
if ( iStateMachine->PhoneEngineInfo()->PhoneNumberIsServiceCode() || |
|
174 |
phoneNumber->Des().Length() < KPhoneValidPhoneNumberLength ) |
|
175 |
{ |
|
176 |
// Send a manual control sequence by providing number |
|
177 |
// information with dial command |
|
178 |
CallFromNumberEntryL(); |
|
179 |
} |
|
180 |
else |
|
181 |
{ |
|
182 |
iStateMachine->SendPhoneEngineMessage( |
|
183 |
MPEPhoneModel::EPEMessageCheckEmergencyNumber ); |
|
184 |
} |
|
185 |
CleanupStack::PopAndDestroy( phoneNumber ); |
|
186 |
} |
|
187 |
else |
|
188 |
{ |
|
189 |
// Provide number information with dial command |
|
190 |
CallFromNumberEntryL(); |
|
191 |
} |
|
192 |
} |
|
193 |
else |
|
194 |
{ |
|
195 |
ToggleHoldL(); |
|
196 |
} |
|
197 |
break; |
|
198 |
||
199 |
default: |
|
200 |
// do base operation |
|
201 |
CPhoneGsmInCall::HandleKeyMessageL( aMessage, aCode ); |
|
202 |
break; |
|
203 |
} |
|
204 |
} |
|
205 |
||
206 |
// ----------------------------------------------------------- |
|
207 |
// CPhoneSingleCall::HandlePhoneEngineMessageL |
|
208 |
// ----------------------------------------------------------- |
|
209 |
// |
|
210 |
EXPORT_C void CPhoneSingleCall::HandlePhoneEngineMessageL( |
|
211 |
const TInt aMessage, |
|
212 |
TInt aCallId ) |
|
213 |
{ |
|
214 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleCall::HandlePhoneEngineMessageL()"); |
|
215 |
switch ( aMessage ) |
|
216 |
{ |
|
217 |
case MEngineMonitor::EPEMessageHeld: |
|
218 |
HandleHeldL( aCallId ); |
|
219 |
break; |
|
220 |
||
221 |
case MEngineMonitor::EPEMessageConnected: |
|
222 |
HandleConnectedL( aCallId ); |
|
223 |
break; |
|
224 |
||
225 |
case MEngineMonitor::EPEMessageIncoming: |
|
226 |
HandleIncomingL( aCallId ); |
|
227 |
break; |
|
228 |
||
229 |
case MEngineMonitor::EPEMessageDialing: |
|
230 |
HandleDiallingL( aCallId ); |
|
231 |
break; |
|
232 |
||
233 |
/* Flow through */ |
|
234 |
case MEngineMonitor::EPEMessageRemoteTerminated: |
|
235 |
case MEngineMonitor::EPEMessageDisconnecting: |
|
236 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewHideNaviPaneAudioVolume ); |
|
237 |
CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId ); |
|
238 |
break; |
|
239 |
||
240 |
case MEngineMonitor::EPEMessageInValidEmergencyNumber: |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
241 |
SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed, ETrue ); |
37 | 242 |
break; |
243 |
||
244 |
case MEngineMonitor::EPEMessageValidEmergencyNumber: |
|
245 |
DialVoiceCallL(); |
|
246 |
break; |
|
247 |
||
248 |
default: |
|
249 |
CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId ); |
|
250 |
break; |
|
251 |
} |
|
252 |
} |
|
253 |
||
254 |
// ----------------------------------------------------------- |
|
255 |
// CPhoneSingleCall::HandleCommandL |
|
256 |
// ----------------------------------------------------------- |
|
257 |
// |
|
258 |
EXPORT_C TBool CPhoneSingleCall::HandleCommandL( TInt aCommand ) |
|
259 |
{ |
|
260 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleCall::HandleCommandL()"); |
|
261 |
TBool commandStatus = ETrue; |
|
262 |
||
263 |
switch( aCommand ) |
|
264 |
{ |
|
265 |
/* Flow through */ |
|
266 |
case EPhoneInCallCmdHold: |
|
267 |
case EPhoneInCallCmdUnhold: |
|
268 |
ToggleHoldL(); |
|
269 |
break; |
|
270 |
||
271 |
case EPhoneInCallCmdNewCall: |
|
272 |
LaunchNewCallQueryL(); |
|
273 |
break; |
|
274 |
||
275 |
case EPhoneInCallCmdNewCallCall: |
|
276 |
CallFromNewCallQueryL(); |
|
277 |
break; |
|
278 |
||
279 |
case EPhoneInCallCmdSwitchToVideo: |
|
280 |
SwitchToVideoL(); |
|
281 |
break; |
|
282 |
||
283 |
case EPhoneInCallCmdSwitchToVoice: |
|
284 |
SwitchToVoiceL(); |
|
285 |
break; |
|
286 |
||
287 |
case EPhoneCmdYesSwitchToVideo: |
|
288 |
// Set current call id |
|
289 |
iStateMachine->SetCallId( iCallId ); |
|
290 |
iStateMachine->SendPhoneEngineMessage( |
|
291 |
CPEPhoneModelIF::EPEMessageSwitchToVideoOrVoice ); |
|
292 |
break; |
|
293 |
||
294 |
/* Flow through */ |
|
295 |
case EPhoneCmdNoSwitchToVideo: |
|
296 |
case EPhoneCmdNoSwitchToVoice: |
|
297 |
// Sets touch buttons to correct status if 'No' command has occured. |
|
298 |
iViewCommandHandle->ExecuteCommand( EPhoneResetTouchButtons ); |
|
299 |
break; |
|
300 |
||
301 |
case EPhoneCmdYesSwitchToVoice: |
|
302 |
// Set current call id |
|
303 |
iStateMachine->SetCallId( iCallId ); |
|
304 |
if( IsVideoCall( iCallId ) ) |
|
305 |
{ |
|
306 |
// Video call can be released only after we get response to VT Shutdown Command |
|
307 |
CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( KMediatorVideoTelephonyDomain, |
|
308 |
KCatPhoneToVideotelCommands, |
|
309 |
EVtCmdReleaseDataport, |
|
310 |
TVersion( KPhoneToVideotelCmdVersionMajor, |
|
311 |
KPhoneToVideotelCmdVersionMinor, |
|
312 |
KPhoneToVideotelCmdVersionBuild ), |
|
313 |
KNullDesC8, |
|
314 |
CPhoneSwitchToVideoOrVoiceCommand::NewL( *iStateMachine ) ); |
|
315 |
} |
|
316 |
else |
|
317 |
{ |
|
318 |
iStateMachine->SendPhoneEngineMessage( |
|
319 |
CPEPhoneModelIF::EPEMessageSwitchToVideoOrVoice ); |
|
320 |
} |
|
321 |
break; |
|
322 |
||
323 |
case EPhoneVideoSharing: |
|
324 |
case EPhoneVideoSharingOpt2: |
|
325 |
case EPhoneVideoSharingOpt3: |
|
326 |
{ |
|
327 |
TPhoneCmdParamInteger command; |
|
328 |
command.SetInteger( aCommand ); |
|
329 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSendAiwCommand, |
|
330 |
&command ); |
|
331 |
} |
|
332 |
break; |
|
333 |
||
334 |
default: |
|
335 |
commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand ); |
|
336 |
break; |
|
337 |
} |
|
338 |
||
339 |
return commandStatus; |
|
340 |
} |
|
341 |
||
342 |
// ----------------------------------------------------------- |
|
343 |
// CPhoneSingleCall::OpenMenuBarL |
|
344 |
// ----------------------------------------------------------- |
|
345 |
// |
|
346 |
EXPORT_C void CPhoneSingleCall::OpenMenuBarL() |
|
347 |
{ |
|
348 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleCall::OpenMenuBarL()"); |
|
349 |
||
350 |
if ( IsVideoCall ( iCallId )) |
|
351 |
{ |
|
352 |
OpenVideoCallMenuBarL(); |
|
353 |
} |
|
354 |
else |
|
355 |
{ |
|
356 |
CPhoneGsmInCall::OpenMenuBarL(); |
|
357 |
} |
|
358 |
} |
|
359 |
||
360 |
// ----------------------------------------------------------- |
|
361 |
// CPhoneSingleCall::CallId |
|
362 |
// ----------------------------------------------------------- |
|
363 |
// |
|
364 |
EXPORT_C TInt CPhoneSingleCall::CallId() const |
|
365 |
{ |
|
366 |
return iCallId; |
|
367 |
} |
|
368 |
||
369 |
// ----------------------------------------------------------- |
|
370 |
// CPhoneSingleCall::OpenVideoCallMenuBarL |
|
371 |
// ----------------------------------------------------------- |
|
372 |
// |
|
373 |
void CPhoneSingleCall::OpenVideoCallMenuBarL() |
|
374 |
{ |
|
375 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleCall::OpenVideoCallMenuBarL()"); |
|
376 |
if( FeatureManager::FeatureSupported( KFeatureIdCsVideoTelephony ) ) |
|
377 |
{ |
|
378 |
TInt resourceId; |
|
379 |
||
380 |
if ( IsNumberEntryUsedL() ) |
|
381 |
{ |
|
382 |
resourceId = EPhoneVideoCallMenubarWithNumberEntry; |
|
383 |
} |
|
384 |
else |
|
385 |
{ |
|
386 |
resourceId = EPhoneVideoCallMenubar; |
|
387 |
} |
|
388 |
||
389 |
TPhoneCmdParamInteger integerParam; |
|
390 |
integerParam.SetInteger( |
|
391 |
CPhoneMainResourceResolver::Instance()-> |
|
392 |
ResolveResourceID( resourceId ) ); |
|
393 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, |
|
394 |
&integerParam ); |
|
395 |
} |
|
396 |
} |
|
397 |
||
398 |
// ----------------------------------------------------------- |
|
399 |
// CPhoneSingleCall::HandleHeldL |
|
400 |
// ----------------------------------------------------------- |
|
401 |
// |
|
402 |
void CPhoneSingleCall::HandleHeldL( TInt aCallId ) |
|
403 |
{ |
|
404 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
405 |
"CPhoneSingleCall::HandleHeldL()"); |
|
406 |
TPhoneCmdParamCallHeaderData callHeaderParam; |
|
407 |
callHeaderParam.SetCallState( EPEStateHeld ); |
|
408 |
||
409 |
TInt callLabelId; |
|
410 |
TBuf<KPhoneCallHeaderLabelMaxLength> labelText( KNullDesC ); |
|
411 |
callLabelId = CPhoneMainResourceResolver::Instance()-> |
|
412 |
ResolveResourceID( EPhoneCallOnHold ); |
|
413 |
||
414 |
StringLoader::Load( |
|
415 |
labelText, |
|
416 |
callLabelId, |
|
417 |
CCoeEnv::Static() ); |
|
418 |
callHeaderParam.SetLabelText( labelText ); |
|
419 |
||
420 |
iViewCommandHandle->ExecuteCommandL( |
|
421 |
EPhoneViewUpdateBubble, aCallId, &callHeaderParam ); |
|
422 |
||
423 |
// Set Hold flag to view |
|
424 |
TPhoneCmdParamBoolean holdFlag; |
|
425 |
holdFlag.SetBoolean( ETrue ); |
|
426 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); |
|
427 |
||
428 |
if ( !FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
|
429 |
{ |
|
430 |
HandleHoldNoteL( aCallId , ETrue ); |
|
431 |
} |
|
432 |
||
433 |
UpdateInCallCbaL(); |
|
434 |
SetTouchPaneButtons( EPhoneIncallHeldButtons ); |
|
435 |
} |
|
436 |
||
437 |
// ----------------------------------------------------------- |
|
438 |
// CPhoneSingleCall::HandleConnectedL |
|
439 |
// ----------------------------------------------------------- |
|
440 |
// |
|
441 |
void CPhoneSingleCall::HandleConnectedL( TInt aCallId ) |
|
442 |
{ |
|
443 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
444 |
"CPhoneSingleCall::HandleConnectedL()"); |
|
445 |
||
446 |
// Show bubble |
|
447 |
TPhoneCmdParamCallHeaderData callHeaderParam; |
|
448 |
callHeaderParam.SetCallState( EPEStateConnected ); |
|
449 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, |
|
450 |
&callHeaderParam ); |
|
451 |
||
452 |
// Get initial hold flag from view. |
|
453 |
TPhoneCmdParamBoolean holdFlag; |
|
454 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetHoldFlag, &holdFlag ); |
|
455 |
||
456 |
if ( holdFlag.Boolean() ) |
|
457 |
{ |
|
458 |
// Update hold flag to view |
|
459 |
holdFlag.SetBoolean( EFalse ); |
|
460 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); |
|
461 |
||
462 |
if ( !FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) ) |
|
463 |
{ |
|
464 |
HandleHoldNoteL( aCallId , EFalse ); |
|
465 |
} |
|
466 |
} |
|
467 |
||
468 |
UpdateInCallCbaL(); |
|
469 |
SetTouchPaneButtons( EPhoneIncallButtons ); |
|
470 |
} |
|
471 |
||
472 |
// ----------------------------------------------------------- |
|
473 |
// CPhoneSingleCall::ToggleHold |
|
474 |
// ----------------------------------------------------------- |
|
475 |
// |
|
476 |
void CPhoneSingleCall::ToggleHoldL() |
|
477 |
{ |
|
478 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
479 |
"CPhoneSingleCall::ToggleHoldL()"); |
|
480 |
||
481 |
TPECallControlCaps callControlCaps = |
|
482 |
iStateMachine->PhoneEngineInfo()->CallControlCaps( iCallId ); |
|
483 |
||
484 |
if ( callControlCaps & MCCECallObserver::ECCECapsHold ) |
|
485 |
{ |
|
486 |
iStateMachine->SetCallId( iCallId ); |
|
487 |
iStateMachine->SendPhoneEngineMessage( |
|
488 |
CPEPhoneModelIF::EPEMessageHold ); |
|
489 |
} |
|
490 |
else if ( callControlCaps & MCCECallObserver::ECCECapsResume ) |
|
491 |
{ |
|
492 |
iStateMachine->SetCallId( iCallId ); |
|
493 |
iStateMachine->SendPhoneEngineMessage( |
|
494 |
CPEPhoneModelIF::EPEMessageResume ); |
|
495 |
} |
|
496 |
else |
|
497 |
{ |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
498 |
SendGlobalInfoNoteL( EPhoneNoteTextNotAllowed, ETrue ); |
37 | 499 |
} |
500 |
} |
|
501 |
||
502 |
// ----------------------------------------------------------- |
|
503 |
// CPhoneSingleCall::HandleIncomingL |
|
504 |
// ----------------------------------------------------------- |
|
505 |
// |
|
506 |
void CPhoneSingleCall::HandleIncomingL( TInt aCallId ) |
|
507 |
{ |
|
508 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
509 |
"CPhoneSingleCall::HandleIncomingL()"); |
|
510 |
||
511 |
BeginUiUpdateLC(); |
|
512 |
||
513 |
TPhoneCmdParamBoolean dialerParam; |
|
514 |
dialerParam.SetBoolean( ETrue ); |
|
515 |
||
516 |
// Get allow waiting call header param value. |
|
517 |
AllowShowingOfWaitingCallHeaderL( dialerParam ); |
|
518 |
||
519 |
// Display incoming call |
|
520 |
DisplayIncomingCallL( aCallId, dialerParam ); |
|
521 |
||
522 |
// Show incoming call buttons |
|
523 |
SetTouchPaneButtons( EPhoneWaitingCallButtons ); |
|
524 |
||
525 |
if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) |
|
526 |
&& !CPhoneCenRepProxy::Instance()-> |
|
527 |
IsTelephonyFeatureSupported( KTelephonyLVFlagAllowUnlockOnIncoming ) |
|
528 |
&& ( IsKeyLockOn() || IsAutoLockOn() ) ) |
|
529 |
{ |
|
530 |
DisableCallUIL(); |
|
531 |
} |
|
532 |
else |
|
533 |
{ |
|
534 |
// if keys have been locked, disable keylock without information note |
|
535 |
if ( IsKeyLockOn() ) |
|
536 |
{ |
|
537 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewDisableKeyLockWithoutNote ); |
|
538 |
} |
|
539 |
} |
|
540 |
||
541 |
if( CPhoneCenRepProxy::Instance()-> |
|
542 |
IsTelephonyFeatureSupported( KTelephonyLVFlagDisableCallControlHardKeysWhileLocked ) |
|
543 |
&& ( IsKeyLockOn() || IsAutoLockOn() ) ) |
|
544 |
{ |
|
545 |
DisableHWKeysL(); |
|
546 |
} |
|
547 |
||
548 |
EndUiUpdate(); |
|
549 |
||
550 |
// This query is required to dismiss |
|
551 |
// Operation cannot be completed in waiting and single state |
|
552 |
if ( iSwitchToVideoQuery ) |
|
553 |
{ |
|
554 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery ); |
|
555 |
} |
|
556 |
||
557 |
// Go to incoming state |
|
558 |
UpdateCbaL( EPhoneCallHandlingCallWaitingCBA ); |
|
559 |
iStateMachine->ChangeState( EPhoneStateWaitingInSingle ); |
|
560 |
} |
|
561 |
||
562 |
// ----------------------------------------------------------- |
|
563 |
// CPhoneSingleCall::DisplayIncomingCallL |
|
564 |
// ----------------------------------------------------------- |
|
565 |
// |
|
566 |
void CPhoneSingleCall::DisplayIncomingCallL( |
|
567 |
TInt aCallId, |
|
568 |
const TPhoneCmdParamBoolean aCommandParam ) |
|
569 |
{ |
|
570 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
571 |
"CPhoneSingleCall::DisplayIncomingCallL()"); |
|
572 |
// Close menu bar, if it is displayed |
|
573 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
|
574 |
||
575 |
// Cannot delete active note, e.g. New call query, |
|
576 |
// but show waiting note with or without caller name |
|
577 |
if ( IsAnyQueryActiveL() || |
|
578 |
( !aCommandParam.Boolean() && iOnScreenDialer ) ) |
|
579 |
{ |
|
580 |
CallWaitingNoteL( aCallId ); |
|
581 |
} |
|
582 |
else |
|
583 |
{ |
|
584 |
// Remove any phone dialogs if they are displayed |
|
585 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
586 |
} |
|
587 |
||
588 |
// Indicate that the Phone needs to be sent to the background if |
|
589 |
// an application other than the top application is in the foreground |
|
590 |
TPhoneCmdParamBoolean booleanParam; |
|
591 |
booleanParam.SetBoolean( !TopAppIsDisplayedL() ); |
|
592 |
iViewCommandHandle->ExecuteCommandL( |
|
593 |
EPhoneViewSetNeedToSendToBackgroundStatus, |
|
594 |
&booleanParam ); |
|
595 |
||
596 |
// Bring Phone app in the foreground |
|
597 |
TPhoneCmdParamInteger uidParam; |
|
598 |
uidParam.SetInteger( KUidPhoneApplication.iUid ); |
|
599 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
|
600 |
&uidParam ); |
|
601 |
||
602 |
// Set Phone as the top application |
|
603 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication, |
|
604 |
&uidParam ); |
|
605 |
||
606 |
DisplayHeaderForCallComingInL( aCallId, ETrue ); //waiting call |
|
607 |
} |
|
608 |
||
609 |
// --------------------------------------------------------- |
|
610 |
// CPhoneSingleCall::CallFromNewCallQueryL |
|
611 |
// --------------------------------------------------------- |
|
612 |
// |
|
613 |
void CPhoneSingleCall::CallFromNewCallQueryL() |
|
614 |
{ |
|
615 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
616 |
"CPhoneSingleCall::CallFromNewCallQueryL()"); |
|
617 |
// First get the phone number from the dialog |
|
618 |
TPhoneCmdParamString phoneNumberParam; |
|
619 |
HBufC *content = HBufC::NewLC( KPhoneNumberEntryBufferSize ); |
|
620 |
TPtr ptr( content->Des() ); |
|
621 |
phoneNumberParam.SetString( &ptr ); |
|
622 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetTextQueryContent, |
|
623 |
&phoneNumberParam ); |
|
624 |
||
625 |
// Store the phone number |
|
626 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( ptr ); |
|
627 |
||
628 |
// clean up stack |
|
629 |
CleanupStack::PopAndDestroy( content ); |
|
630 |
||
631 |
DialVoiceCallL(); |
|
632 |
} |
|
633 |
||
634 |
// ----------------------------------------------------------- |
|
635 |
// CPhoneSingleCall::HandleDiallingL |
|
636 |
// ----------------------------------------------------------- |
|
637 |
// |
|
638 |
void CPhoneSingleCall::HandleDiallingL( TInt aCallId ) |
|
639 |
{ |
|
640 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
641 |
"CPhoneSingleCall::HandleDiallingL()"); |
|
642 |
||
643 |
BeginTransEffectLC( ENumberEntryClose ); |
|
644 |
BeginUiUpdateLC(); |
|
645 |
||
646 |
SetNumberEntryVisibilityL(EFalse); |
|
647 |
||
648 |
// Display call setup |
|
649 |
DisplayCallSetupL( aCallId ); |
|
650 |
||
651 |
// Show incoming call buttons |
|
652 |
SetTouchPaneButtons( EPhoneCallSetupAndSingleButtons ); |
|
653 |
||
654 |
EndUiUpdate(); |
|
655 |
||
656 |
EndTransEffect(); |
|
657 |
||
658 |
// Go to call setup state |
|
659 |
UpdateCbaL( EPhoneCallHandlingCallSetupCBA ); |
|
660 |
iStateMachine->ChangeState( EPhoneStateCallSetupInSingle ); |
|
661 |
} |
|
662 |
||
663 |
// ----------------------------------------------------------- |
|
664 |
// CPhoneSingleCall::DisplayCallSetupL |
|
665 |
// ----------------------------------------------------------- |
|
666 |
// |
|
667 |
void CPhoneSingleCall::DisplayCallSetupL( TInt aCallId ) |
|
668 |
{ |
|
669 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
670 |
"CPhoneSingleCall::DisplayCallSetupL()"); |
|
671 |
// Close menu bar, if it is displayed |
|
672 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
|
673 |
||
674 |
// Remove dialogs if necessary |
|
675 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
676 |
||
677 |
// Capture keys when the phone is dialling |
|
678 |
CaptureKeysDuringCallNotificationL( ETrue ); |
|
679 |
||
680 |
// Force telephony to the foreground |
|
681 |
TPhoneCmdParamInteger uidParam; |
|
682 |
uidParam.SetInteger( KUidPhoneApplication.iUid ); |
|
683 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground, |
|
684 |
&uidParam ); |
|
685 |
||
686 |
// Display call setup header |
|
687 |
DisplayHeaderForOutgoingCallL( aCallId ); |
|
688 |
} |
|
689 |
||
690 |
// ----------------------------------------------------------- |
|
691 |
// CPhoneSingleCall::SetCallHoldL |
|
692 |
// ----------------------------------------------------------- |
|
693 |
// |
|
694 |
void CPhoneSingleCall::SetCallHoldL() |
|
695 |
{ |
|
696 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
697 |
"CPhoneSingleCall::SetCallHold()"); |
|
698 |
||
699 |
TPhoneCmdParamCallStateData callStateData; |
|
700 |
callStateData.SetCallId( iCallId ); |
|
701 |
iViewCommandHandle->HandleCommandL( EPhoneViewGetCallState, |
|
702 |
&callStateData ); |
|
703 |
||
704 |
if( callStateData.CallState() == EPEStateConnected && !IsVideoCallActiveL() ) |
|
705 |
{ |
|
706 |
iStateMachine->SetCallId( iCallId ); |
|
707 |
iStateMachine->SendPhoneEngineMessage( |
|
708 |
CPEPhoneModelIF::EPEMessageHold ); |
|
709 |
} |
|
710 |
else |
|
711 |
{ |
|
712 |
// Show not allowed note |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
713 |
SendGlobalInfoNoteL( EPhoneNoteTextNotAllowed, ETrue ); |
37 | 714 |
} |
715 |
} |
|
716 |
||
717 |
// ----------------------------------------------------------- |
|
718 |
// CPhoneSingleCall::SetCallResumeL |
|
719 |
// ----------------------------------------------------------- |
|
720 |
// |
|
721 |
void CPhoneSingleCall::SetCallResumeL() |
|
722 |
{ |
|
723 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
724 |
"CPhoneSingleCall::SetCallHold()"); |
|
725 |
||
726 |
TPhoneCmdParamCallStateData callStateData; |
|
727 |
callStateData.SetCallId( iCallId ); |
|
728 |
iViewCommandHandle->HandleCommandL( EPhoneViewGetCallState, |
|
729 |
&callStateData ); |
|
730 |
||
731 |
if( callStateData.CallState() == EPEStateHeld ) |
|
732 |
{ |
|
733 |
iStateMachine->SetCallId( iCallId ); |
|
734 |
iStateMachine->SendPhoneEngineMessage( |
|
735 |
CPEPhoneModelIF::EPEMessageResume ); |
|
736 |
} |
|
737 |
else |
|
738 |
{ |
|
739 |
// Show not allowed note |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
740 |
SendGlobalInfoNoteL( EPhoneNoteTextNotAllowed, ETrue ); |
37 | 741 |
} |
742 |
} |
|
743 |
||
744 |
// ----------------------------------------------------------- |
|
745 |
// CPhoneSingleCall::SwitchToVideoL |
|
746 |
// ----------------------------------------------------------- |
|
747 |
// |
|
748 |
void CPhoneSingleCall::SwitchToVideoL() |
|
749 |
{ |
|
750 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
751 |
"CPhoneSingleCall::SwitchToVideoL()"); |
|
752 |
||
753 |
if( FeatureManager::FeatureSupported( KFeatureIdCsVideoTelephony ) ) |
|
754 |
{ |
|
755 |
TInt networkMode( CPhonePubSubProxy::Instance()->Value( KPSUidNetworkInfo, |
|
756 |
KNWTelephonyNetworkMode ) ); |
|
757 |
TBool restoreOngoing( CPhonePubSubProxy::Instance()->Value( KUidSystemCategory, |
|
758 |
conn::KUidBackupRestoreKey )); |
|
759 |
||
760 |
TBool resetTouchButtons = EFalse; |
|
761 |
||
762 |
if ( networkMode != ENWNetworkModeWcdma ) |
|
763 |
{ |
|
764 |
// We aren't in 3G, video call not possible |
|
765 |
SendGlobalInfoNoteL( EPhoneInformationNoNetworkSupportForVideoCallNote ); |
|
766 |
resetTouchButtons = ETrue; |
|
767 |
} |
|
768 |
else if ( restoreOngoing & ( conn::EBURRestoreFull | conn::EBURRestorePartial )) |
|
769 |
{ |
|
770 |
// MC restore ongoing |
|
771 |
SendGlobalInfoNoteL( EPhoneInformationVideoCallNotAllowedDuringRestoreNote ); |
|
772 |
resetTouchButtons = ETrue; |
|
773 |
} |
|
774 |
else |
|
775 |
{ |
|
776 |
iSwitchToVideoQuery = ETrue; |
|
777 |
ShowQueryL( EPhoneSwitchToVideoQuery ); |
|
778 |
iSwitchToVideoQuery = EFalse; |
|
779 |
} |
|
780 |
||
781 |
if( resetTouchButtons ) |
|
782 |
{ |
|
783 |
// Sets touch buttons to correct status if error has occured. |
|
784 |
iViewCommandHandle->ExecuteCommand( EPhoneResetTouchButtons ); |
|
785 |
} |
|
786 |
} |
|
787 |
} |
|
788 |
||
789 |
// ----------------------------------------------------------- |
|
790 |
// CPhoneSingleCall::SwitchToVoiceL |
|
791 |
// ----------------------------------------------------------- |
|
792 |
// |
|
793 |
void CPhoneSingleCall::SwitchToVoiceL() |
|
794 |
{ |
|
795 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
796 |
"CPhoneSingleCall::SwitchToVoiceL()"); |
|
797 |
||
798 |
ShowQueryL( EPhoneSwitchToVoiceQuery ); |
|
799 |
} |
|
800 |
||
801 |
// End of File |