author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Mon, 04 Oct 2010 00:16:48 +0300 | |
changeset 77 | 2be0b271d017 |
parent 72 | c76a0b1755b9 |
child 76 | cfea66083b62 |
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 |
} |
|
61 |
||
62 |
// ----------------------------------------------------------- |
|
63 |
// CPhoneConferenceAndSingle::ConstructL() |
|
64 |
// Constructor |
|
65 |
// (other items were commented in a header). |
|
66 |
// ----------------------------------------------------------- |
|
67 |
// |
|
68 |
void CPhoneConferenceAndSingle::ConstructL() |
|
69 |
{ |
|
70 |
CPhoneConference::ConstructL(); |
|
71 |
} |
|
72 |
||
73 |
// ----------------------------------------------------------- |
|
74 |
// CPhoneConferenceAndSingle::NewL() |
|
75 |
// Constructor |
|
76 |
// (other items were commented in a header). |
|
77 |
// ----------------------------------------------------------- |
|
78 |
// |
|
79 |
CPhoneConferenceAndSingle* CPhoneConferenceAndSingle::NewL( |
|
80 |
MPhoneStateMachine* aStateMachine, |
|
81 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
82 |
MPhoneCustomization* aPhoneCustomization ) |
|
83 |
{ |
|
84 |
CPhoneConferenceAndSingle* self = new( ELeave ) CPhoneConferenceAndSingle( |
|
85 |
aStateMachine, aViewCommandHandle, aPhoneCustomization ); |
|
86 |
||
87 |
CleanupStack::PushL( self ); |
|
88 |
self->ConstructL(); |
|
89 |
CleanupStack::Pop( self ); |
|
90 |
||
91 |
return self; |
|
92 |
} |
|
93 |
||
94 |
// ----------------------------------------------------------- |
|
95 |
// CPhoneConferenceAndSingle::HandlePhoneEngineMessageL |
|
96 |
// ----------------------------------------------------------- |
|
97 |
// |
|
98 |
void CPhoneConferenceAndSingle::HandlePhoneEngineMessageL( |
|
99 |
const TInt aMessage, |
|
100 |
TInt aCallId ) |
|
101 |
{ |
|
102 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndSingle::HandlePhoneEngineMessageL()"); |
|
103 |
switch ( aMessage ) |
|
104 |
{ |
|
105 |
case MEngineMonitor::EPEMessageConnectedConference: |
|
106 |
HandleConnectedConferenceL(); |
|
107 |
break; |
|
108 |
||
109 |
case MEngineMonitor::EPEMessageHeldConference: |
|
110 |
HandleHeldConferenceL(); |
|
111 |
break; |
|
112 |
||
113 |
case MEngineMonitor::EPEMessageConnected: |
|
114 |
HandleConnectedL( aCallId ); |
|
115 |
break; |
|
116 |
||
117 |
case MEngineMonitor::EPEMessageHeld: |
|
118 |
HandleHeldL( aCallId ); |
|
119 |
break; |
|
120 |
||
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
121 |
case MEngineMonitor::EPEMessageInValidEmergencyNumber: |
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
122 |
SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed, ETrue ); |
37 | 123 |
break; |
124 |
||
125 |
case MEngineMonitor::EPEMessageValidEmergencyNumber: |
|
126 |
DialVoiceCallL(); |
|
127 |
break; |
|
128 |
||
129 |
case MEngineMonitor::EPEMessageAddedConferenceMember: |
|
130 |
HandleAddedConferenceMemberL( aCallId ); |
|
131 |
break; |
|
132 |
||
133 |
default: |
|
134 |
CPhoneConference::HandlePhoneEngineMessageL( aMessage, |
|
135 |
aCallId ); |
|
136 |
break; |
|
137 |
} |
|
138 |
} |
|
139 |
||
140 |
// ----------------------------------------------------------- |
|
141 |
// CPhoneConferenceAndSingle:HandleCommandL |
|
142 |
// ----------------------------------------------------------- |
|
143 |
// |
|
144 |
TBool CPhoneConferenceAndSingle::HandleCommandL( TInt aCommand ) |
|
145 |
{ |
|
146 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleCommandL"); |
|
147 |
TBool commandStatus = ETrue; |
|
148 |
switch( aCommand ) |
|
149 |
{ |
|
150 |
case EPhoneNumberAcqCmdCall: |
|
151 |
case EPhoneNumberAcqCmdSendCommand: |
|
152 |
HandleSendL(); |
|
153 |
break; |
|
154 |
||
155 |
case EAknSoftkeyCancel: |
|
156 |
commandStatus = CPhoneConference::HandleCommandL( aCommand ); |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
157 |
UpdateUiCommands(); |
37 | 158 |
break; |
159 |
||
160 |
case EPhoneInCallCmdJoin: |
|
161 |
iStateMachine->SendPhoneEngineMessage( |
|
162 |
CPEPhoneModelIF::EPEMessageAddConferenceMember ); |
|
163 |
break; |
|
164 |
||
165 |
case EPhoneInCallCmdParticipants: |
|
166 |
break; |
|
167 |
||
168 |
default: |
|
169 |
commandStatus = CPhoneConference::HandleCommandL( aCommand ); |
|
170 |
break; |
|
171 |
} |
|
172 |
return commandStatus; |
|
173 |
} |
|
174 |
||
175 |
// ----------------------------------------------------------- |
|
176 |
// CPhoneConferenceAndSingle::HandleConnectedConferenceL |
|
177 |
// ----------------------------------------------------------- |
|
178 |
// |
|
179 |
void CPhoneConferenceAndSingle::HandleConnectedConferenceL() |
|
180 |
{ |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
181 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
182 |
"CPhoneConferenceAndSingle::HandleConnectedConferenceL"); |
37 | 183 |
BeginUiUpdateLC(); |
184 |
iViewCommandHandle->ExecuteCommandL( |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
185 |
EPhoneViewUpdateBubble, |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
186 |
KConferenceCallId ); |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
187 |
UpdateUiCommands(); |
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
188 |
EndUiUpdate(); |
37 | 189 |
} |
190 |
||
191 |
// ----------------------------------------------------------- |
|
192 |
// CPhoneConferenceAndSingle::HandleHeldConferenceL |
|
193 |
// |
|
194 |
// one of the calls is on hold all the time, conference or single call |
|
195 |
// ----------------------------------------------------------- |
|
196 |
// |
|
197 |
void CPhoneConferenceAndSingle::HandleHeldConferenceL() |
|
198 |
{ |
|
199 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleHeldConferenceL"); |
|
200 |
BeginUiUpdateLC(); |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
201 |
|
37 | 202 |
iViewCommandHandle->ExecuteCommandL( |
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
203 |
EPhoneViewUpdateBubble, KConferenceCallId ); |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
204 |
UpdateUiCommands(); |
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
205 |
EndUiUpdate(); |
37 | 206 |
} |
207 |
||
208 |
// ----------------------------------------------------------- |
|
209 |
// CPhoneConferenceAndSingle::HandleConnectedL |
|
210 |
// ----------------------------------------------------------- |
|
211 |
// |
|
212 |
void CPhoneConferenceAndSingle::HandleConnectedL( TInt aCallId ) |
|
213 |
{ |
|
214 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleConnectedL"); |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
215 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId ); |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
216 |
UpdateUiCommands(); |
37 | 217 |
} |
218 |
||
219 |
// ----------------------------------------------------------- |
|
220 |
// CPhoneConferenceAndSingle::HandleHeldL |
|
221 |
// ----------------------------------------------------------- |
|
222 |
// |
|
223 |
void CPhoneConferenceAndSingle::HandleHeldL( TInt aCallId ) |
|
224 |
{ |
|
225 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleHeldL"); |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
226 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId ); |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
227 |
UpdateUiCommands(); |
37 | 228 |
} |
229 |
||
230 |
// ----------------------------------------------------------- |
|
231 |
// CPhoneConferenceAndSingle::HandleAddedConferenceMemberL |
|
232 |
// ----------------------------------------------------------- |
|
233 |
// |
|
234 |
void CPhoneConferenceAndSingle::HandleAddedConferenceMemberL( TInt aCallId ) |
|
235 |
{ |
|
236 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleAddedConferenceMemberL"); |
|
237 |
BeginUiUpdateLC(); |
|
238 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewAddToConference ); |
|
239 |
UpdateConferenceSecurityStatusL( aCallId ); |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
240 |
UpdateUiCommands(); |
37 | 241 |
EndUiUpdate(); |
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
242 |
iStateMachine->ChangeState( EPhoneStateConference ); |
37 | 243 |
} |
244 |
||
245 |
// ----------------------------------------------------------- |
|
246 |
// CPhoneConferenceAndSingle::HandleIncomingL |
|
247 |
// ----------------------------------------------------------- |
|
248 |
// |
|
249 |
void CPhoneConferenceAndSingle::HandleIncomingL( TInt aCallId ) |
|
250 |
{ |
|
251 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
252 |
"CPhoneConferenceAndSingle::HandleIncomingL"); |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
253 |
DisplayCallHeaderL( aCallId, ECheckIfNEUsedBeforeSettingVisibilityFalse ); |
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
254 |
iStateMachine->ChangeState( EPhoneStateConferenceAndSingleAndWaiting ); |
37 | 255 |
} |
256 |
||
257 |
// ----------------------------------------------------------- |
|
258 |
// CPhoneConferenceAndSingle::HandleIdleL |
|
259 |
// ----------------------------------------------------------- |
|
260 |
// |
|
261 |
void CPhoneConferenceAndSingle::HandleIdleL( TInt aCallId ) |
|
262 |
{ |
|
263 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
264 |
"CPhoneConferenceAndSingle::HandleIdleL"); |
|
265 |
TPhoneCmdParamBoolean conferenceExistsForCallId; |
|
266 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCallExistsInConference, |
|
267 |
aCallId, &conferenceExistsForCallId ); |
|
268 |
||
269 |
if( conferenceExistsForCallId.Boolean() ) |
|
270 |
{ |
|
271 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveFromConference, |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
272 |
aCallId ); |
37 | 273 |
} |
274 |
else |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
275 |
{ |
37 | 276 |
BeginUiUpdateLC(); |
277 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
278 |
UpdateUiCommands(); |
37 | 279 |
EndUiUpdate(); |
280 |
iStateMachine->ChangeState( EPhoneStateConference ); |
|
281 |
} |
|
282 |
} |
|
283 |
||
284 |
// ----------------------------------------------------------- |
|
285 |
// CPhoneConferenceAndSingle::HandleConferenceIdleL |
|
286 |
// ----------------------------------------------------------- |
|
287 |
// |
|
288 |
void CPhoneConferenceAndSingle::HandleConferenceIdleL() |
|
289 |
{ |
|
290 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneConferenceAndSingle::HandleConferenceIdleL"); |
|
291 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveConferenceBubble ); |
|
292 |
TPhoneCmdParamInteger intParam; |
|
293 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCountOfActiveCalls, |
|
294 |
&intParam ); |
|
295 |
||
296 |
switch( intParam.Integer() ) |
|
297 |
{ |
|
298 |
case EOneActiveCall: |
|
299 |
MakeStateTransitionToSingleL(); |
|
300 |
break; |
|
301 |
||
302 |
case ETwoActiveCalls: // Fall through |
|
303 |
default: |
|
304 |
MakeStateTransitionToTwoSinglesL(); |
|
305 |
break; |
|
306 |
} |
|
307 |
} |
|
308 |
||
309 |
// -------------------------------------------------------------- |
|
310 |
// CPhoneConferenceAndSingle::HandleKeyMessageL |
|
311 |
// -------------------------------------------------------------- |
|
312 |
// |
|
313 |
void CPhoneConferenceAndSingle::HandleKeyMessageL( |
|
314 |
TPhoneKeyEventMessages aMessage, |
|
315 |
TKeyCode aCode ) |
|
316 |
{ |
|
317 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
318 |
"CPhoneConferenceAndSingle::HandleKeyMessageL()"); |
|
319 |
switch ( aCode ) |
|
320 |
{ |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
321 |
case EKeyYes: // send-key |
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
322 |
if( iNumberEntryManager->IsNumberEntryVisibleL() ) |
37 | 323 |
{ |
324 |
HandleSendL(); |
|
325 |
} |
|
326 |
else |
|
327 |
{ |
|
328 |
iStateMachine->SendPhoneEngineMessage( |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
329 |
CPEPhoneModelIF::EPEMessageSwap ); |
37 | 330 |
} |
331 |
break; |
|
332 |
||
333 |
default: |
|
334 |
CPhoneConference::HandleKeyMessageL( aMessage, aCode ); |
|
335 |
break; |
|
336 |
} |
|
337 |
} |
|
338 |
||
339 |
// -------------------------------------------------------------- |
|
340 |
// CPhoneConferenceAndSingle::HandleSendL |
|
341 |
// -------------------------------------------------------------- |
|
342 |
// |
|
343 |
void CPhoneConferenceAndSingle::HandleSendL() |
|
344 |
{ |
|
345 |
HBufC *phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize ); |
|
346 |
TPtr ptr( phoneNumber->Des() ); |
|
347 |
TPhoneCmdParamString stringParam; |
|
348 |
stringParam.SetString( &ptr ); |
|
349 |
iViewCommandHandle->ExecuteCommand( |
|
350 |
EPhoneViewGetNumberFromEntry, |
|
351 |
&stringParam ); |
|
352 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( ptr ) ; |
|
353 |
||
354 |
if ( iStateMachine->PhoneEngineInfo()->PhoneNumberIsServiceCode() || |
|
355 |
phoneNumber->Des().Length() < KPhoneValidPhoneNumberLength ) |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
356 |
{ |
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
357 |
iNumberEntryManager->CallFromNumberEntryL(); |
37 | 358 |
} |
359 |
else |
|
360 |
{ |
|
361 |
iStateMachine->SendPhoneEngineMessage( |
|
362 |
MPEPhoneModel::EPEMessageCheckEmergencyNumber ); |
|
363 |
} |
|
364 |
CleanupStack::PopAndDestroy( phoneNumber ); |
|
365 |
} |
|
366 |
||
367 |
// End of File |