author | hgs |
Fri, 09 Jul 2010 15:40:55 +0300 | |
changeset 50 | 377c906a8701 |
parent 45 | 6b911d05207e |
child 65 | 2a5d4ab426d3 |
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 CPhoneConferenceAndCallSetup class. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
// INCLUDES |
|
20 |
#include "cphoneconferenceandcallsetup.h" |
|
21 |
#include "mphonestatemachine.h" |
|
22 |
#include "phoneviewcommanddefinitions.h" |
|
23 |
#include "tphonecmdparamcallheaderdata.h" |
|
24 |
#include "tphonecmdparamcallstatedata.h" |
|
25 |
#include "phonestatedefinitionsgsm.h" |
|
26 |
#include "phonelogger.h" |
|
27 |
#include "tphonecmdparamboolean.h" |
|
28 |
#include "tphonecmdparaminteger.h" |
|
29 |
#include "cphonemainresourceresolver.h" |
|
30 |
#include "phonerssbase.h" |
|
31 |
#include "tphonecmdparamglobalnote.h" |
|
32 |
#include "phoneui.hrh" |
|
33 |
||
34 |
// ================= MEMBER FUNCTIONS ======================= |
|
35 |
||
36 |
// C++ default constructor can NOT contain any code, that |
|
37 |
// might leave. |
|
38 |
// |
|
39 |
CPhoneConferenceAndCallSetup::CPhoneConferenceAndCallSetup( |
|
40 |
MPhoneStateMachine* aStateMachine, |
|
41 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
42 |
MPhoneCustomization* aPhoneCustomization ) : |
|
43 |
CPhoneConference( aStateMachine, aViewCommandHandle, aPhoneCustomization ) |
|
44 |
{ |
|
45 |
} |
|
46 |
||
47 |
// ----------------------------------------------------------- |
|
48 |
// CPhoneConferenceAndCallSetup::~CPhoneConferenceAndCallSetup() |
|
49 |
// Destructor |
|
50 |
// (other items were commented in a header). |
|
51 |
// ----------------------------------------------------------- |
|
52 |
// |
|
53 |
CPhoneConferenceAndCallSetup::~CPhoneConferenceAndCallSetup() |
|
54 |
{ |
|
55 |
} |
|
56 |
||
57 |
// ----------------------------------------------------------- |
|
58 |
// CPhoneConferenceAndCallSetup::ConstructL() |
|
59 |
// Constructor |
|
60 |
// (other items were commented in a header). |
|
61 |
// ----------------------------------------------------------- |
|
62 |
// |
|
63 |
void CPhoneConferenceAndCallSetup::ConstructL() |
|
64 |
{ |
|
65 |
CPhoneConference::ConstructL(); |
|
66 |
||
67 |
} |
|
68 |
||
69 |
// ----------------------------------------------------------- |
|
70 |
// CPhoneConferenceAndCallSetup::NewL() |
|
71 |
// Constructor |
|
72 |
// (other items were commented in a header). |
|
73 |
// ----------------------------------------------------------- |
|
74 |
// |
|
75 |
CPhoneConferenceAndCallSetup* CPhoneConferenceAndCallSetup::NewL( |
|
76 |
MPhoneStateMachine* aStateMachine, |
|
77 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
78 |
MPhoneCustomization* aPhoneCustomization ) |
|
79 |
{ |
|
80 |
CPhoneConferenceAndCallSetup* self = new( ELeave ) CPhoneConferenceAndCallSetup( |
|
81 |
aStateMachine, aViewCommandHandle, aPhoneCustomization ); |
|
82 |
||
83 |
CleanupStack::PushL( self ); |
|
84 |
self->ConstructL(); |
|
85 |
CleanupStack::Pop( self ); |
|
86 |
||
87 |
return self; |
|
88 |
} |
|
89 |
||
90 |
// ----------------------------------------------------------- |
|
91 |
// CPhoneConferenceAndCallSetup::HandlePhoneEngineMessageL |
|
92 |
// ----------------------------------------------------------- |
|
93 |
// |
|
94 |
void CPhoneConferenceAndCallSetup::HandlePhoneEngineMessageL( |
|
95 |
const TInt aMessage, |
|
96 |
TInt aCallId ) |
|
97 |
{ |
|
98 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndCallSetup::HandlePhoneEngineMessageL()"); |
|
99 |
switch ( aMessage ) |
|
100 |
{ |
|
101 |
case MEngineMonitor::EPEMessageConnecting: |
|
102 |
iAlerting = ETrue; |
|
103 |
HandleConnectingL( aCallId ); |
|
104 |
break; |
|
105 |
||
106 |
case MEngineMonitor::EPEMessageConnected: |
|
107 |
HandleConnectedL( aCallId ); |
|
108 |
break; |
|
109 |
||
110 |
case MEngineMonitor::EPEMessageIdle: |
|
111 |
HandleIdleL( aCallId ); |
|
112 |
break; |
|
113 |
||
114 |
case MEngineMonitor::EPEMessageConferenceIdle: |
|
115 |
HandleConferenceIdleL(); |
|
116 |
break; |
|
117 |
||
118 |
default: |
|
119 |
CPhoneConference::HandlePhoneEngineMessageL( aMessage, |
|
120 |
aCallId ); |
|
121 |
break; |
|
122 |
} |
|
123 |
} |
|
124 |
||
125 |
// ----------------------------------------------------------- |
|
126 |
// CPhoneConferenceAndCallSetup::HandleCommandL |
|
127 |
// ----------------------------------------------------------- |
|
128 |
// |
|
129 |
TBool CPhoneConferenceAndCallSetup::HandleCommandL( TInt aCommand ) |
|
130 |
{ |
|
131 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
132 |
"CPhoneConferenceAndCallSetup::HandleCommandL()"); |
|
133 |
TBool commandStatus = ETrue; |
|
134 |
||
135 |
switch( aCommand ) |
|
136 |
{ |
|
137 |
case EPhoneDtmfDialerCancel: |
|
138 |
{ |
|
139 |
} |
|
140 |
break; |
|
141 |
||
142 |
default: |
|
143 |
commandStatus = CPhoneConference::HandleCommandL( aCommand ); |
|
144 |
break; |
|
145 |
} |
|
146 |
||
147 |
return commandStatus; |
|
148 |
} |
|
149 |
||
150 |
// -------------------------------------------------------------- |
|
151 |
// CPhoneConferenceAndCallSetup::HandleKeyMessageL |
|
152 |
// -------------------------------------------------------------- |
|
153 |
// |
|
154 |
void CPhoneConferenceAndCallSetup::HandleKeyMessageL( |
|
155 |
TPhoneKeyEventMessages aMessage, |
|
156 |
TKeyCode aCode ) |
|
157 |
{ |
|
158 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
159 |
"CPhoneConferenceAndCallSetup::HandleKeyMessageL()"); |
|
160 |
switch ( aCode ) |
|
161 |
{ |
|
162 |
// End-key |
|
163 |
case EKeyNo: |
|
164 |
if ( aMessage == EPhoneKeyLongPress ) |
|
165 |
{ |
|
166 |
iStateMachine->SendPhoneEngineMessage( |
|
167 |
MPEPhoneModel::EPEMessageTerminateAllConnections ); |
|
168 |
} |
|
169 |
else |
|
170 |
{ |
|
171 |
DisconnectOutgoingCallL(); |
|
172 |
} |
|
173 |
break; |
|
174 |
||
175 |
default: |
|
176 |
// do base operation |
|
177 |
CPhoneConference::HandleKeyMessageL( aMessage, aCode ); |
|
178 |
break; |
|
179 |
} |
|
180 |
} |
|
181 |
||
182 |
// ----------------------------------------------------------- |
|
183 |
// CPhoneConferenceAndCallSetup::HandleConnectingL |
|
184 |
// ----------------------------------------------------------- |
|
185 |
// |
|
186 |
void CPhoneConferenceAndCallSetup::HandleConnectingL( TInt aCallId ) |
|
187 |
{ |
|
188 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndCallSetup::HandleConnectingL()"); |
|
189 |
||
190 |
BeginUiUpdateLC(); |
|
191 |
||
192 |
UpdateRemoteInfoDataL ( aCallId ); |
|
193 |
||
194 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote ); |
|
195 |
||
196 |
// Re-enable global notes |
|
197 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
198 |
globalNotifierParam.SetBoolean( EFalse ); |
|
199 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
200 |
&globalNotifierParam ); |
|
201 |
||
202 |
// Stop capturing keys |
|
203 |
CaptureKeysDuringCallNotificationL( EFalse ); |
|
204 |
||
205 |
// Remove the number entry if it isn't DTMF dialer |
|
50 | 206 |
if ( !iOnScreenDialer || !IsNumberEntryVisibleL() ) |
37 | 207 |
{ |
208 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
209 |
} |
|
210 |
||
211 |
// Set Hold flag to view EFalse that IHF is on RSK not unhold |
|
212 |
TPhoneCmdParamBoolean holdFlag; |
|
213 |
holdFlag.SetBoolean( EFalse ); |
|
214 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); |
|
215 |
||
216 |
// Updated connecting cba's |
|
217 |
UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
|
218 |
||
219 |
TPhoneCmdParamCallHeaderData callHeaderParam; |
|
220 |
callHeaderParam.SetCallState( EPEStateConnecting ); |
|
221 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, |
|
222 |
&callHeaderParam ); |
|
223 |
||
224 |
EndUiUpdate(); |
|
225 |
} |
|
226 |
||
227 |
// ----------------------------------------------------------- |
|
228 |
// CPhoneConferenceAndCallSetup::HandleConnectedL |
|
229 |
// ----------------------------------------------------------- |
|
230 |
// |
|
231 |
void CPhoneConferenceAndCallSetup::HandleConnectedL( TInt aCallId ) |
|
232 |
{ |
|
233 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndCallSetup::HandleConnectedL()"); |
|
234 |
||
235 |
// Keep Phone in the foreground |
|
236 |
TPhoneCmdParamBoolean booleanParam; |
|
237 |
booleanParam.SetBoolean( EFalse ); |
|
238 |
iViewCommandHandle->ExecuteCommandL( |
|
239 |
EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam ); |
|
240 |
||
241 |
BeginUiUpdateLC(); |
|
242 |
||
243 |
// Show bubble |
|
244 |
TPhoneCmdParamCallHeaderData callHeaderParam; |
|
245 |
callHeaderParam.SetCallState( EPEStateConnected ); |
|
246 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, |
|
247 |
&callHeaderParam ); |
|
248 |
||
249 |
// Capturing keys and number entry must be removed because some |
|
250 |
// networks jump over connecting state directly to connected state. |
|
251 |
CaptureKeysDuringCallNotificationL( EFalse ); |
|
252 |
||
253 |
// Remove the number entry if it isn't DTMF dialer |
|
50 | 254 |
if ( !iOnScreenDialer || !IsNumberEntryVisibleL() ) |
37 | 255 |
{ |
256 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
257 |
} |
|
258 |
||
259 |
SetTouchPaneButtons( EPhoneConferenceAndSingleButtons ); |
|
260 |
EndUiUpdate(); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
261 |
|
37 | 262 |
UpdateCbaL ( EPhoneCallHandlingNewCallSwapCBA ); |
263 |
||
264 |
iStateMachine->ChangeState( EPhoneStateConferenceAndSingle ); |
|
265 |
} |
|
266 |
||
267 |
// ----------------------------------------------------------- |
|
268 |
// CPhoneConferenceAndCallSetup:HandleIdleL |
|
269 |
// ----------------------------------------------------------- |
|
270 |
// |
|
271 |
void CPhoneConferenceAndCallSetup::HandleIdleL( TInt aCallId ) |
|
272 |
{ |
|
273 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
274 |
"CPhoneConferenceAndCallSetup::HandleIdleL()"); |
|
275 |
// Re-enable global notes |
|
276 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
277 |
globalNotifierParam.SetBoolean( EFalse ); |
|
278 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
279 |
&globalNotifierParam ); |
|
280 |
||
281 |
// Stop capturing keys |
|
282 |
CaptureKeysDuringCallNotificationL( EFalse ); |
|
283 |
||
284 |
TPhoneCmdParamBoolean conferenceExistsForCallId; |
|
285 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCallExistsInConference, |
|
286 |
aCallId, &conferenceExistsForCallId ); |
|
287 |
||
288 |
if( conferenceExistsForCallId.Boolean() ) |
|
289 |
{ |
|
290 |
// Remove 'Conference on hold' global note |
|
291 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote ); |
|
292 |
||
293 |
// Remove conference member from conference bubble |
|
294 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveFromConference, |
|
295 |
aCallId ); |
|
296 |
||
297 |
//Check if removed call was last one to be able to be in conference mode |
|
298 |
//If there is no confrence call, go to single and call setup state |
|
299 |
TPhoneCmdParamBoolean conferenceExists; |
|
300 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetIsConference, |
|
301 |
&conferenceExists ); |
|
302 |
||
303 |
__PHONELOG1( EBasic, EPhoneControl, |
|
304 |
"CPhoneConferenceAndCallSetup::HandleIdleL - conferenceExists =%d ", |
|
305 |
conferenceExists.Boolean() ); |
|
306 |
||
307 |
if( !conferenceExists.Boolean() ) |
|
308 |
{ |
|
309 |
if( iAlerting ) |
|
310 |
{ |
|
311 |
iStateMachine->ChangeState( EPhoneStateAlertingInSingle ); |
|
312 |
} |
|
313 |
else |
|
314 |
{ |
|
315 |
iStateMachine->ChangeState( EPhoneStateCallSetupInSingle ); |
|
316 |
} |
|
317 |
} |
|
318 |
} |
|
319 |
else |
|
320 |
{ |
|
321 |
// Remove outgoing call |
|
322 |
BeginUiUpdateLC(); |
|
323 |
||
324 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
|
325 |
||
326 |
CheckIfRestoreNEContentAfterDtmfDialer(); |
|
327 |
||
328 |
if ( IsNumberEntryUsedL() ) |
|
329 |
{ |
|
330 |
// Show the number entry if it exists |
|
331 |
SetNumberEntryVisibilityL(ETrue); |
|
332 |
} |
|
333 |
||
334 |
SetTouchPaneButtons( EPhoneConferenceButtons ); |
|
335 |
EndUiUpdate(); |
|
336 |
||
337 |
// Go to conference state |
|
338 |
UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
|
339 |
iStateMachine->ChangeState( EPhoneStateConference ); |
|
340 |
} |
|
341 |
||
342 |
} |
|
343 |
||
344 |
||
345 |
// ----------------------------------------------------------- |
|
346 |
// CPhoneConferenceAndCallSetup::UpdateInCallCbaL |
|
347 |
// ----------------------------------------------------------- |
|
348 |
// |
|
349 |
void CPhoneConferenceAndCallSetup::UpdateInCallCbaL() |
|
350 |
{ |
|
351 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndCallSetup::UpdateInCallCbaL() "); |
|
352 |
||
353 |
if ( iAlerting ) |
|
354 |
{ |
|
355 |
UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
|
356 |
} |
|
357 |
else |
|
358 |
{ |
|
359 |
UpdateCbaL( EPhoneCallHandlingCallSetupCBA ); |
|
360 |
} |
|
361 |
} |
|
362 |
||
363 |
// ----------------------------------------------------------- |
|
364 |
// CPhoneConferenceAndCallSetup:HandleConferenceIdleL |
|
365 |
// ----------------------------------------------------------- |
|
366 |
// |
|
367 |
void CPhoneConferenceAndCallSetup::HandleConferenceIdleL() |
|
368 |
{ |
|
369 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
370 |
"CPhoneConferenceAndCallSetup::HandleConferenceIdleL()"); |
|
371 |
||
372 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveConferenceBubble ); |
|
373 |
||
374 |
// Fetch alerting call's id from view |
|
375 |
TPhoneCmdParamCallStateData callStateData; |
|
376 |
callStateData.SetCallState( EPEStateConnecting ); |
|
377 |
iViewCommandHandle->HandleCommandL( |
|
378 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
379 |
||
380 |
if ( callStateData.CallId() > KErrNotFound ) |
|
381 |
{ |
|
382 |
// Set Hold flag to view EFalse that dtmf menu item not delete |
|
383 |
TPhoneCmdParamBoolean holdFlag; |
|
384 |
holdFlag.SetBoolean( EFalse ); |
|
385 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); |
|
386 |
// Go to alerting and single state |
|
387 |
UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
|
388 |
iStateMachine->ChangeState( EPhoneStateAlertingInSingle ); |
|
389 |
} |
|
390 |
else |
|
391 |
{ |
|
392 |
// Go to callsetup and single state |
|
393 |
UpdateCbaL( EPhoneCallHandlingCallSetupCBA ); |
|
394 |
iStateMachine->ChangeState( EPhoneStateCallSetupInSingle ); |
|
395 |
} |
|
396 |
} |
|
397 |
||
398 |
// End of File |