author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 06 Jul 2010 14:15:47 +0300 | |
changeset 46 | bc5a64e5bc3c |
parent 45 | 6b911d05207e |
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 CPhoneConferenceAndSingle class. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
// INCLUDES |
|
20 |
#include <StringLoader.h> |
|
21 |
#include <cpephonemodelif.h> |
|
22 |
#include <mpeengineinfo.h> |
|
23 |
#include <featmgr.h> |
|
24 |
#include "cphoneconferenceandsingle.h" |
|
25 |
#include "mphonestatemachine.h" |
|
26 |
#include "phoneviewcommanddefinitions.h" |
|
27 |
#include "tphonecmdparamcallheaderdata.h" |
|
28 |
#include "tphonecmdparamstring.h" |
|
29 |
#include "phonestatedefinitionsgsm.h" |
|
30 |
#include "phonelogger.h" |
|
31 |
#include "tphonecmdparamboolean.h" |
|
32 |
#include "tphonecmdparaminteger.h" |
|
33 |
#include "tphonecmdparamcallstatedata.h" |
|
34 |
#include "cphonemainresourceresolver.h" |
|
35 |
#include "phonerssbase.h" |
|
36 |
#include "tphonecmdparamglobalnote.h" |
|
37 |
#include "phoneui.hrh" |
|
38 |
||
39 |
// ================= MEMBER FUNCTIONS ======================= |
|
40 |
||
41 |
// C++ default constructor can NOT contain any code, that |
|
42 |
// might leave. |
|
43 |
// |
|
44 |
CPhoneConferenceAndSingle::CPhoneConferenceAndSingle( |
|
45 |
MPhoneStateMachine* aStateMachine, |
|
46 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
47 |
MPhoneCustomization* aPhoneCustomization ) : |
|
48 |
CPhoneConference( aStateMachine, aViewCommandHandle, aPhoneCustomization ) |
|
49 |
{ |
|
50 |
} |
|
51 |
||
52 |
// ----------------------------------------------------------- |
|
53 |
// CPhoneConferenceAndSingle::~CPhoneConferenceAndSingle() |
|
54 |
// Destructor |
|
55 |
// (other items were commented in a header). |
|
56 |
// ----------------------------------------------------------- |
|
57 |
// |
|
58 |
CPhoneConferenceAndSingle::~CPhoneConferenceAndSingle() |
|
59 |
{ |
|
60 |
// Reset flag |
|
61 |
if ( iViewCommandHandle ) |
|
62 |
{ |
|
63 |
TPhoneCmdParamBoolean dtmfSendFlag; |
|
64 |
dtmfSendFlag.SetBoolean( EFalse ); |
|
65 |
iViewCommandHandle->ExecuteCommand( EPhoneViewSetDtmfOptionsFlag, |
|
66 |
&dtmfSendFlag ); |
|
67 |
} |
|
68 |
} |
|
69 |
||
70 |
// ----------------------------------------------------------- |
|
71 |
// CPhoneConferenceAndSingle::ConstructL() |
|
72 |
// Constructor |
|
73 |
// (other items were commented in a header). |
|
74 |
// ----------------------------------------------------------- |
|
75 |
// |
|
76 |
void CPhoneConferenceAndSingle::ConstructL() |
|
77 |
{ |
|
78 |
CPhoneConference::ConstructL(); |
|
79 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateMaxConfMemberFlag ); |
|
80 |
} |
|
81 |
||
82 |
// ----------------------------------------------------------- |
|
83 |
// CPhoneConferenceAndSingle::NewL() |
|
84 |
// Constructor |
|
85 |
// (other items were commented in a header). |
|
86 |
// ----------------------------------------------------------- |
|
87 |
// |
|
88 |
CPhoneConferenceAndSingle* CPhoneConferenceAndSingle::NewL( |
|
89 |
MPhoneStateMachine* aStateMachine, |
|
90 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
91 |
MPhoneCustomization* aPhoneCustomization ) |
|
92 |
{ |
|
93 |
CPhoneConferenceAndSingle* self = new( ELeave ) CPhoneConferenceAndSingle( |
|
94 |
aStateMachine, aViewCommandHandle, aPhoneCustomization ); |
|
95 |
||
96 |
CleanupStack::PushL( self ); |
|
97 |
self->ConstructL(); |
|
98 |
CleanupStack::Pop( self ); |
|
99 |
||
100 |
return self; |
|
101 |
} |
|
102 |
||
103 |
// ----------------------------------------------------------- |
|
104 |
// CPhoneConferenceAndSingle::HandlePhoneEngineMessageL |
|
105 |
// ----------------------------------------------------------- |
|
106 |
// |
|
107 |
void CPhoneConferenceAndSingle::HandlePhoneEngineMessageL( |
|
108 |
const TInt aMessage, |
|
109 |
TInt aCallId ) |
|
110 |
{ |
|
111 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndSingle::HandlePhoneEngineMessageL()"); |
|
112 |
switch ( aMessage ) |
|
113 |
{ |
|
114 |
case MEngineMonitor::EPEMessageConnectedConference: |
|
115 |
HandleConnectedConferenceL(); |
|
116 |
break; |
|
117 |
||
118 |
case MEngineMonitor::EPEMessageHeldConference: |
|
119 |
HandleHeldConferenceL(); |
|
120 |
break; |
|
121 |
||
122 |
case MEngineMonitor::EPEMessageConnected: |
|
123 |
HandleConnectedL( aCallId ); |
|
124 |
break; |
|
125 |
||
126 |
case MEngineMonitor::EPEMessageHeld: |
|
127 |
HandleHeldL( aCallId ); |
|
128 |
break; |
|
129 |
||
130 |
case MEngineMonitor::EPEMessageInValidEmergencyNumber: |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
131 |
SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed, ETrue ); |
37 | 132 |
break; |
133 |
||
134 |
case MEngineMonitor::EPEMessageValidEmergencyNumber: |
|
135 |
DialVoiceCallL(); |
|
136 |
break; |
|
137 |
||
138 |
case MEngineMonitor::EPEMessageAddedConferenceMember: |
|
139 |
HandleAddedConferenceMemberL( aCallId ); |
|
140 |
break; |
|
141 |
||
142 |
default: |
|
143 |
CPhoneConference::HandlePhoneEngineMessageL( aMessage, |
|
144 |
aCallId ); |
|
145 |
break; |
|
146 |
} |
|
147 |
} |
|
148 |
||
149 |
// ----------------------------------------------------------- |
|
150 |
// CPhoneConferenceAndSingle:HandleCommandL |
|
151 |
// ----------------------------------------------------------- |
|
152 |
// |
|
153 |
TBool CPhoneConferenceAndSingle::HandleCommandL( TInt aCommand ) |
|
154 |
{ |
|
155 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleCommandL"); |
|
156 |
TBool commandStatus = ETrue; |
|
157 |
||
158 |
switch( aCommand ) |
|
159 |
{ |
|
160 |
case EPhoneNumberAcqCmdCall: |
|
161 |
case EPhoneNumberAcqCmdSendCommand: |
|
162 |
HandleSendL(); |
|
163 |
break; |
|
164 |
||
165 |
case EAknSoftkeyCancel: |
|
166 |
commandStatus = CPhoneConference::HandleCommandL( aCommand ); |
|
167 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateMaxConfMemberFlag ); |
|
168 |
SetTouchPaneButtons( EPhoneConferenceAndHeldSingleButtons ); |
|
169 |
break; |
|
170 |
||
171 |
case EPhoneInCallCmdJoin: |
|
172 |
iStateMachine->SendPhoneEngineMessage( |
|
173 |
CPEPhoneModelIF::EPEMessageAddConferenceMember ); |
|
174 |
break; |
|
175 |
||
176 |
case EPhoneInCallCmdParticipants: |
|
177 |
commandStatus = CPhoneConference::HandleCommandL( aCommand ); |
|
178 |
SetTouchPaneButtonDisabled( EPhoneInCallCmdPrivate ); |
|
179 |
break; |
|
180 |
||
181 |
default: |
|
182 |
commandStatus = CPhoneConference::HandleCommandL( aCommand ); |
|
183 |
break; |
|
184 |
} |
|
185 |
||
186 |
return commandStatus; |
|
187 |
} |
|
188 |
||
189 |
// ----------------------------------------------------------- |
|
190 |
// CPhoneConferenceAndSingle::OpenMenuBarL |
|
191 |
// ----------------------------------------------------------- |
|
192 |
// |
|
193 |
void CPhoneConferenceAndSingle::OpenMenuBarL() |
|
194 |
{ |
|
195 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::OpenMenuBarL"); |
|
196 |
||
197 |
// Set Conference And Single specific flag to view |
|
198 |
TPhoneCmdParamBoolean conferenceAndSingleFlag; |
|
199 |
conferenceAndSingleFlag.SetBoolean( ETrue ); |
|
200 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetConferenceAndSingleFlag, |
|
201 |
&conferenceAndSingleFlag ); |
|
202 |
||
203 |
// Set specific flag to view so that DTMF menu item available |
|
204 |
TPhoneCmdParamBoolean dtmfSendFlag; |
|
205 |
dtmfSendFlag.SetBoolean( ETrue ); |
|
206 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetDtmfOptionsFlag, |
|
207 |
&dtmfSendFlag ); |
|
208 |
||
209 |
TPhoneViewResponseId response; |
|
210 |
TPhoneCmdParamCallStateData callStateData; |
|
211 |
TPhoneCmdParamBoolean booleaParam; |
|
212 |
TInt heldCallId( KErrNotFound ); |
|
213 |
TInt connectedCallId( KErrNotFound ); |
|
214 |
||
215 |
// Fetch active call's id from view |
|
216 |
callStateData.SetCallState( EPEStateConnected ); |
|
217 |
response = iViewCommandHandle->HandleCommandL( |
|
218 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
219 |
if( response != EPhoneViewResponseSuccess ) |
|
220 |
{ |
|
221 |
// Unsuccesfull fetch - do nothing |
|
222 |
return; |
|
223 |
} |
|
224 |
connectedCallId = callStateData.CallId(); |
|
225 |
||
226 |
// Fetch held call's id from view |
|
227 |
callStateData.SetCallState( EPEStateHeld ); |
|
228 |
response = iViewCommandHandle->HandleCommandL( |
|
229 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
230 |
if( response != EPhoneViewResponseSuccess ) |
|
231 |
{ |
|
232 |
// Unsuccesfull fetch - do nothing |
|
233 |
return; |
|
234 |
} |
|
235 |
heldCallId = callStateData.CallId(); |
|
236 |
||
237 |
// Open the correct menubar according which call is active |
|
238 |
TInt resourceId; |
|
239 |
if( connectedCallId == KConferenceCallId ) |
|
240 |
{ |
|
241 |
if ( IsNumberEntryVisibleL() ) |
|
242 |
{ |
|
243 |
resourceId = EPhoneConfAndHeldCallMenubarWithNumberEntry; |
|
244 |
} |
|
245 |
else if ( IsConferenceBubbleInSelectionMode() ) |
|
246 |
{ |
|
247 |
resourceId = EPhoneConfCallParticipantsDropMenubar; |
|
248 |
} |
|
249 |
else |
|
250 |
{ |
|
251 |
resourceId = EPhoneConfAndHeldCallMenubar; |
|
252 |
} |
|
253 |
} |
|
254 |
else |
|
255 |
{ |
|
256 |
if ( IsNumberEntryVisibleL() ) |
|
257 |
{ |
|
258 |
resourceId = EPhoneActiveAndHeldConfMenubarWithNumberEntry; |
|
259 |
} |
|
260 |
else if ( IsConferenceBubbleInSelectionMode() ) |
|
261 |
{ |
|
262 |
resourceId = EPhoneConfCallParticipantsDropMenubar; |
|
263 |
} |
|
264 |
else |
|
265 |
{ |
|
266 |
resourceId = EPhoneActiveAndHeldConfMenubar; |
|
267 |
} |
|
268 |
} |
|
269 |
||
270 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateMaxConfMemberFlag ); |
|
271 |
||
272 |
// Check that calls are the same type (f.ex. both are CS calls) |
|
273 |
booleaParam.SetBoolean( |
|
274 |
heldCallId != KErrNotFound && connectedCallId != KErrNotFound && |
|
275 |
iStateMachine->PhoneEngineInfo()->CallType( heldCallId ) != |
|
276 |
iStateMachine->PhoneEngineInfo()->CallType( connectedCallId )); |
|
277 |
||
278 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetConfrenceOptionsFlag, |
|
279 |
&booleaParam ); |
|
280 |
||
281 |
if ( iOnScreenDialer && IsDTMFEditorVisibleL() ) |
|
282 |
{ |
|
283 |
resourceId = EPhoneDtmfDialerMenubar; |
|
284 |
} |
|
285 |
else if ( iOnScreenDialer && IsCustomizedDialerVisibleL() ) |
|
286 |
{ |
|
287 |
resourceId = CustomizedDialerMenuResourceIdL(); |
|
288 |
} |
|
289 |
||
290 |
TPhoneCmdParamInteger integerParam; |
|
291 |
integerParam.SetInteger( |
|
292 |
CPhoneMainResourceResolver::Instance()-> |
|
293 |
ResolveResourceID( resourceId ) ); |
|
294 |
||
295 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, |
|
296 |
&integerParam ); |
|
297 |
} |
|
298 |
||
299 |
// ----------------------------------------------------------- |
|
300 |
// CPhoneConferenceAndSingle::HandleConnectedConferenceL |
|
301 |
// ----------------------------------------------------------- |
|
302 |
// |
|
303 |
void CPhoneConferenceAndSingle::HandleConnectedConferenceL() |
|
304 |
{ |
|
305 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleConnectedConferenceL"); |
|
306 |
// Update call state |
|
307 |
TPhoneCmdParamCallHeaderData callHeaderParam; |
|
308 |
callHeaderParam.SetCallState( EPEStateConnectedConference ); |
|
309 |
||
310 |
TBuf<KPhoneCallHeaderLabelMaxLength> conferenceText( KNullDesC ); |
|
311 |
TInt callLabelId = CPhoneMainResourceResolver::Instance()-> |
|
312 |
ResolveResourceID( EPhoneCLIConferenceCall ); |
|
313 |
||
314 |
StringLoader::Load( |
|
315 |
conferenceText, |
|
316 |
callLabelId, |
|
317 |
CCoeEnv::Static() ); |
|
318 |
callHeaderParam.SetLabelText( conferenceText ); |
|
319 |
||
320 |
// Conference call is no longer on hold |
|
321 |
TPhoneCmdParamBoolean holdFlag; |
|
322 |
holdFlag.SetBoolean( EFalse ); |
|
323 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); |
|
324 |
||
325 |
BeginUiUpdateLC(); |
|
326 |
iViewCommandHandle->ExecuteCommandL( |
|
327 |
EPhoneViewUpdateBubble, KConferenceCallId, &callHeaderParam ); |
|
328 |
||
329 |
SetTouchPaneButtons( EPhoneConferenceAndHeldSingleButtons ); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
330 |
UpdateInCallCbaL(); |
37 | 331 |
EndUiUpdate(); |
332 |
} |
|
333 |
||
334 |
||
335 |
// ----------------------------------------------------------- |
|
336 |
// CPhoneConferenceAndSingle::HandleHeldConferenceL |
|
337 |
// |
|
338 |
// one of the calls is on hold all the time, conference or single call |
|
339 |
// ----------------------------------------------------------- |
|
340 |
// |
|
341 |
void CPhoneConferenceAndSingle::HandleHeldConferenceL() |
|
342 |
{ |
|
343 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleHeldConferenceL"); |
|
344 |
TPhoneCmdParamCallHeaderData callHeaderParam; |
|
345 |
callHeaderParam.SetCallState( EPEStateHeldConference ); |
|
346 |
||
347 |
TInt callLabelId; |
|
348 |
TBuf<KPhoneCallHeaderLabelMaxLength> labelText( KNullDesC ); |
|
349 |
callLabelId = CPhoneMainResourceResolver::Instance()-> |
|
350 |
ResolveResourceID( EPhoneCallOnHold ); |
|
351 |
||
352 |
StringLoader::Load( |
|
353 |
labelText, |
|
354 |
callLabelId, |
|
355 |
CCoeEnv::Static() ); |
|
356 |
callHeaderParam.SetLabelText( labelText ); |
|
357 |
||
358 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateMaxConfMemberFlag ); |
|
359 |
||
360 |
BeginUiUpdateLC(); |
|
361 |
||
362 |
iViewCommandHandle->ExecuteCommandL( |
|
363 |
EPhoneViewUpdateBubble, KConferenceCallId, &callHeaderParam ); |
|
364 |
||
365 |
SetTouchPaneButtons( EPhoneConferenceAndSingleButtons ); |
|
366 |
EndUiUpdate(); |
|
367 |
} |
|
368 |
||
369 |
// ----------------------------------------------------------- |
|
370 |
// CPhoneConferenceAndSingle::HandleConnectedL |
|
371 |
// ----------------------------------------------------------- |
|
372 |
// |
|
373 |
void CPhoneConferenceAndSingle::HandleConnectedL( TInt aCallId ) |
|
374 |
{ |
|
375 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleConnectedL"); |
|
376 |
||
377 |
// Display connected bubble |
|
378 |
TPhoneCmdParamCallHeaderData callHeaderParam; |
|
379 |
callHeaderParam.SetCallState( EPEStateConnected ); |
|
380 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, |
|
381 |
&callHeaderParam ); |
|
382 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
383 |
UpdateInCallCbaL(); |
37 | 384 |
SetTouchPaneButtons( EPhoneConferenceButtons ); |
385 |
} |
|
386 |
||
387 |
// ----------------------------------------------------------- |
|
388 |
// CPhoneConferenceAndSingle::HandleHeldL |
|
389 |
// ----------------------------------------------------------- |
|
390 |
// |
|
391 |
void CPhoneConferenceAndSingle::HandleHeldL( TInt aCallId ) |
|
392 |
{ |
|
393 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleHeldL"); |
|
394 |
// Display hold bubble |
|
395 |
TPhoneCmdParamCallHeaderData callHeaderParam; |
|
396 |
callHeaderParam.SetCallState( EPEStateHeld ); |
|
397 |
||
398 |
TBuf<KPhoneCallHeaderLabelMaxLength> labelText( KNullDesC ); |
|
399 |
TInt callLabelId = CPhoneMainResourceResolver::Instance()-> |
|
400 |
ResolveResourceID( EPhoneCallOnHold ); |
|
401 |
||
402 |
StringLoader::Load( |
|
403 |
labelText, |
|
404 |
callLabelId, |
|
405 |
CCoeEnv::Static() ); |
|
406 |
callHeaderParam.SetLabelText( labelText ); |
|
407 |
||
408 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, |
|
409 |
&callHeaderParam ); |
|
410 |
||
411 |
SetTouchPaneButtons( EPhoneConferenceButtons ); |
|
412 |
} |
|
413 |
||
414 |
// ----------------------------------------------------------- |
|
415 |
// CPhoneConferenceAndSingle::HandleAddedConferenceMemberL |
|
416 |
// ----------------------------------------------------------- |
|
417 |
// |
|
418 |
void CPhoneConferenceAndSingle::HandleAddedConferenceMemberL( TInt aCallId ) |
|
419 |
{ |
|
420 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleAddedConferenceMemberL"); |
|
421 |
||
422 |
BeginUiUpdateLC(); |
|
423 |
||
424 |
// Update conference bubble |
|
425 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewAddToConference ); |
|
426 |
||
427 |
UpdateConferenceSecurityStatusL( aCallId ); |
|
428 |
||
429 |
SetTouchPaneButtons( EPhoneConferenceButtons ); |
|
430 |
SetTouchPaneButtonEnabled( EPhoneInCallCmdPrivate ); |
|
431 |
||
432 |
EndUiUpdate(); |
|
433 |
||
434 |
TPhoneCmdParamBoolean conferenceAndSingleFlag; |
|
435 |
conferenceAndSingleFlag.SetBoolean( EFalse ); |
|
436 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetConferenceAndSingleFlag, |
|
437 |
&conferenceAndSingleFlag ); |
|
438 |
||
439 |
UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
|
440 |
iStateMachine->ChangeState( EPhoneStateConference ); |
|
441 |
} |
|
442 |
||
443 |
// ----------------------------------------------------------- |
|
444 |
// CPhoneConferenceAndSingle::UpdateInCallCbaL |
|
445 |
// ----------------------------------------------------------- |
|
446 |
// |
|
447 |
void CPhoneConferenceAndSingle::UpdateInCallCbaL() |
|
448 |
{ |
|
449 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndSingle::UpdateInCallCbaL() "); |
|
450 |
||
451 |
UpdateCbaL ( EPhoneCallHandlingNewCallSwapCBA ); |
|
452 |
} |
|
453 |
||
454 |
// ----------------------------------------------------------- |
|
455 |
// CPhoneConferenceAndSingle::HandleIncomingL |
|
456 |
// ----------------------------------------------------------- |
|
457 |
// |
|
458 |
void CPhoneConferenceAndSingle::HandleIncomingL( TInt aCallId ) |
|
459 |
{ |
|
460 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
461 |
"CPhoneConferenceAndSingle::HandleIncomingL"); |
|
462 |
||
463 |
BeginUiUpdateLC(); |
|
464 |
||
465 |
TPhoneCmdParamBoolean dialerParam; |
|
466 |
dialerParam.SetBoolean( ETrue ); |
|
467 |
||
468 |
// Get allow waiting call header param value. |
|
469 |
AllowShowingOfWaitingCallHeaderL( dialerParam ); |
|
470 |
||
471 |
// Close conference list |
|
472 |
TPhoneCmdParamBoolean booleanParam; |
|
473 |
booleanParam.SetBoolean( EFalse ); |
|
474 |
iViewCommandHandle->ExecuteCommandL( |
|
475 |
EPhoneViewOpenConferenceList, &booleanParam ); |
|
476 |
||
477 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewCloseFSW ); |
|
478 |
||
479 |
// Check if HW Keys or Call UI should be disabled |
|
480 |
CheckDisableHWKeysAndCallUIL(); |
|
481 |
||
482 |
// Display incoming call |
|
483 |
DisplayIncomingCallL( aCallId, dialerParam ); |
|
484 |
||
485 |
// Set touch controls |
|
486 |
SetTouchPaneButtonDisabled( EPhoneCallComingCmdAnswer ); |
|
487 |
SetTouchPaneButtons( EPhoneWaitingCallButtons ); |
|
488 |
||
489 |
EndUiUpdate(); |
|
490 |
||
491 |
TPhoneCmdParamBoolean conferenceAndSingleFlag; |
|
492 |
conferenceAndSingleFlag.SetBoolean( EFalse ); |
|
493 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetConferenceAndSingleFlag, |
|
494 |
&conferenceAndSingleFlag ); |
|
495 |
||
496 |
// Go to Conference And Single And Waiting state |
|
497 |
UpdateCbaL( EPhoneCallHandlingIncomingRejectCBA ); |
|
498 |
iStateMachine->ChangeState( EPhoneStateConferenceAndSingleAndWaiting ); |
|
499 |
} |
|
500 |
||
501 |
// ----------------------------------------------------------- |
|
502 |
// CPhoneConferenceAndSingle::HandleIdleL |
|
503 |
// ----------------------------------------------------------- |
|
504 |
// |
|
505 |
void CPhoneConferenceAndSingle::HandleIdleL( TInt aCallId ) |
|
506 |
{ |
|
507 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
508 |
"CPhoneConferenceAndSingle::HandleIdleL"); |
|
509 |
||
510 |
// If dialler is not open then close menu bar. |
|
511 |
if ( !IsNumberEntryUsedL() ) |
|
512 |
{ |
|
513 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
|
514 |
} |
|
515 |
||
516 |
TPhoneCmdParamBoolean conferenceExistsForCallId; |
|
517 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCallExistsInConference, |
|
518 |
aCallId, &conferenceExistsForCallId ); |
|
519 |
||
520 |
if( conferenceExistsForCallId.Boolean() ) |
|
521 |
{ |
|
522 |
// Remove conference member from conference bubble |
|
523 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveFromConference, |
|
524 |
aCallId ); |
|
525 |
||
526 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateMaxConfMemberFlag ); |
|
527 |
} |
|
528 |
else |
|
529 |
{ |
|
530 |
// Remove call |
|
531 |
BeginUiUpdateLC(); |
|
532 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
|
533 |
||
534 |
TPhoneCmdParamBoolean conferenceAndSingleFlag; |
|
535 |
conferenceAndSingleFlag.SetBoolean( EFalse ); |
|
536 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetConferenceAndSingleFlag, |
|
537 |
&conferenceAndSingleFlag ); |
|
538 |
||
539 |
TPhoneCmdParamBoolean participantsVisibleFlag; |
|
540 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetConferenceListVisibleFlag, |
|
541 |
&participantsVisibleFlag ); |
|
542 |
||
543 |
// if participants list is visible - do not change buttons or cba |
|
544 |
if( !participantsVisibleFlag.Boolean() ) |
|
545 |
{ |
|
546 |
// Go to Conference state |
|
547 |
SetTouchPaneButtons( EPhoneConferenceButtons ); |
|
548 |
SetTouchPaneButtonEnabled( EPhoneInCallCmdPrivate ); |
|
549 |
||
550 |
UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
|
551 |
} |
|
552 |
||
553 |
||
554 |
EndUiUpdate(); |
|
555 |
||
556 |
iStateMachine->ChangeState( EPhoneStateConference ); |
|
557 |
} |
|
558 |
||
559 |
} |
|
560 |
||
561 |
// ----------------------------------------------------------- |
|
562 |
// CPhoneConferenceAndSingle::HandleConferenceIdleL |
|
563 |
// ----------------------------------------------------------- |
|
564 |
// |
|
565 |
void CPhoneConferenceAndSingle::HandleConferenceIdleL() |
|
566 |
{ |
|
567 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleConferenceIdleL"); |
|
568 |
||
569 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveConferenceBubble ); |
|
570 |
||
571 |
TPhoneCmdParamInteger intParam; |
|
572 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCountOfActiveCalls, |
|
573 |
&intParam ); |
|
574 |
||
575 |
switch( intParam.Integer() ) |
|
576 |
{ |
|
577 |
case EOneActiveCall: |
|
578 |
MakeStateTransitionToSingleL(); |
|
579 |
break; |
|
580 |
||
581 |
case ETwoActiveCalls: // Fall through |
|
582 |
default: |
|
583 |
MakeStateTransitionToTwoSinglesL(); |
|
584 |
break; |
|
585 |
} |
|
586 |
} |
|
587 |
||
588 |
// -------------------------------------------------------------- |
|
589 |
// CPhoneConferenceAndSingle::HandleKeyMessageL |
|
590 |
// -------------------------------------------------------------- |
|
591 |
// |
|
592 |
void CPhoneConferenceAndSingle::HandleKeyMessageL( |
|
593 |
TPhoneKeyEventMessages aMessage, |
|
594 |
TKeyCode aCode ) |
|
595 |
{ |
|
596 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
597 |
"CPhoneConferenceAndSingle::HandleKeyMessageL()"); |
|
598 |
switch ( aCode ) |
|
599 |
{ |
|
600 |
// send-key |
|
601 |
case EKeyYes: |
|
602 |
if( IsNumberEntryVisibleL() ) |
|
603 |
{ |
|
604 |
HandleSendL(); |
|
605 |
} |
|
606 |
else |
|
607 |
{ |
|
608 |
// Number entry is below so swap the call |
|
609 |
iStateMachine->SendPhoneEngineMessage( |
|
610 |
CPEPhoneModelIF::EPEMessageSwap ); |
|
611 |
} |
|
612 |
break; |
|
613 |
||
614 |
default: |
|
615 |
// do base operation |
|
616 |
CPhoneConference::HandleKeyMessageL( aMessage, aCode ); |
|
617 |
break; |
|
618 |
} |
|
619 |
} |
|
620 |
||
621 |
||
622 |
||
623 |
// -------------------------------------------------------------- |
|
624 |
// CPhoneConferenceAndSingle::HandleSendL |
|
625 |
// -------------------------------------------------------------- |
|
626 |
// |
|
627 |
void CPhoneConferenceAndSingle::HandleSendL() |
|
628 |
{ |
|
629 |
// Get the number entry contents |
|
630 |
HBufC *phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize ); |
|
631 |
TPtr ptr( phoneNumber->Des() ); |
|
632 |
TPhoneCmdParamString stringParam; |
|
633 |
stringParam.SetString( &ptr ); |
|
634 |
||
635 |
iViewCommandHandle->ExecuteCommand( |
|
636 |
EPhoneViewGetNumberFromEntry, |
|
637 |
&stringParam ); |
|
638 |
||
639 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( ptr ) ; |
|
640 |
||
641 |
if ( iStateMachine->PhoneEngineInfo()->PhoneNumberIsServiceCode() || |
|
642 |
phoneNumber->Des().Length() < KPhoneValidPhoneNumberLength ) |
|
643 |
{ |
|
644 |
// Send a manual control sequence by providing number |
|
645 |
// information with dial command |
|
646 |
CallFromNumberEntryL(); |
|
647 |
} |
|
648 |
else |
|
649 |
{ |
|
650 |
iStateMachine->SendPhoneEngineMessage( |
|
651 |
MPEPhoneModel::EPEMessageCheckEmergencyNumber ); |
|
652 |
} |
|
653 |
CleanupStack::PopAndDestroy( phoneNumber ); |
|
654 |
} |
|
655 |
||
656 |
// End of File |