37
|
1 |
/*
|
|
2 |
* Copyright (c) 2005 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 CPhoneTwoSingles class.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
// INCLUDES
|
|
20 |
#include <eikmenub.h>
|
|
21 |
#include <eikenv.h>
|
|
22 |
#include <StringLoader.h>
|
|
23 |
#include <pevirtualengine.h>
|
|
24 |
#include <mpeengineinfo.h>
|
|
25 |
#include <cpephonemodelif.h>
|
|
26 |
#include <featmgr.h>
|
|
27 |
#include "cphonetwosingles.h"
|
|
28 |
#include "mphonestatemachine.h"
|
|
29 |
#include "phoneviewcommanddefinitions.h"
|
|
30 |
#include "phoneui.hrh"
|
|
31 |
#include "cphonemainresourceresolver.h"
|
|
32 |
#include "phonerssbase.h"
|
|
33 |
#include "phonestatedefinitions.h"
|
|
34 |
#include "tphonecmdparaminteger.h"
|
|
35 |
#include "tphonecmdparamappinfo.h"
|
|
36 |
#include "tphonecmdparamboolean.h"
|
|
37 |
#include "tphonecmdparamstring.h"
|
|
38 |
#include "tphonecmdparamcallheaderdata.h"
|
|
39 |
#include "tphonecmdparamcallstatedata.h"
|
|
40 |
#include "phonestatedefinitionsgsm.h"
|
|
41 |
#include "phonelogger.h"
|
|
42 |
|
|
43 |
// ================= MEMBER FUNCTIONS =======================
|
|
44 |
|
|
45 |
// C++ default constructor can NOT contain any code, that
|
|
46 |
// might leave.
|
|
47 |
//
|
|
48 |
EXPORT_C CPhoneTwoSingles::CPhoneTwoSingles(
|
|
49 |
MPhoneStateMachine* aStateMachine,
|
|
50 |
MPhoneViewCommandHandle* aViewCommandHandle,
|
|
51 |
MPhoneCustomization* aPhoneCustomization ) :
|
|
52 |
CPhoneGsmInCall( aStateMachine, aViewCommandHandle, aPhoneCustomization )
|
|
53 |
{
|
|
54 |
}
|
|
55 |
|
|
56 |
// -----------------------------------------------------------
|
|
57 |
// CPhoneTwoSingles::~CPhoneTwoSingles()
|
|
58 |
// Destructor
|
|
59 |
// (other items were commented in a header).
|
|
60 |
// -----------------------------------------------------------
|
|
61 |
//
|
|
62 |
EXPORT_C CPhoneTwoSingles::~CPhoneTwoSingles()
|
|
63 |
{
|
|
64 |
}
|
|
65 |
|
|
66 |
// -----------------------------------------------------------
|
|
67 |
// CPhoneTwoSingles::ConstructL()
|
|
68 |
// Constructor
|
|
69 |
// (other items were commented in a header).
|
|
70 |
// -----------------------------------------------------------
|
|
71 |
//
|
|
72 |
EXPORT_C void CPhoneTwoSingles::ConstructL()
|
|
73 |
{
|
|
74 |
CPhoneGsmInCall::ConstructL();
|
|
75 |
|
|
76 |
TPhoneCmdParamBoolean globalNotifierParam;
|
|
77 |
globalNotifierParam.SetBoolean( EFalse );
|
|
78 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
|
|
79 |
&globalNotifierParam );
|
|
80 |
}
|
|
81 |
|
|
82 |
// -----------------------------------------------------------
|
|
83 |
// CPhoneTwoSingles::NewL()
|
|
84 |
// Constructor
|
|
85 |
// (other items were commented in a header).
|
|
86 |
// -----------------------------------------------------------
|
|
87 |
//
|
|
88 |
CPhoneTwoSingles* CPhoneTwoSingles::NewL(
|
|
89 |
MPhoneStateMachine* aStateMachine,
|
|
90 |
MPhoneViewCommandHandle* aViewCommandHandle,
|
|
91 |
MPhoneCustomization* aPhoneCustomization )
|
|
92 |
{
|
|
93 |
CPhoneTwoSingles* self = new( ELeave ) CPhoneTwoSingles(
|
|
94 |
aStateMachine, aViewCommandHandle, aPhoneCustomization );
|
|
95 |
|
|
96 |
CleanupStack::PushL( self );
|
|
97 |
self->ConstructL();
|
|
98 |
CleanupStack::Pop( self );
|
|
99 |
|
|
100 |
return self;
|
|
101 |
}
|
|
102 |
|
|
103 |
// -----------------------------------------------------------
|
|
104 |
// CPhoneTwoSingles::HandlePhoneEngineMessageL
|
|
105 |
// -----------------------------------------------------------
|
|
106 |
//
|
|
107 |
EXPORT_C void CPhoneTwoSingles::HandlePhoneEngineMessageL(
|
|
108 |
const TInt aMessage,
|
|
109 |
TInt aCallId )
|
|
110 |
{
|
|
111 |
__LOGMETHODSTARTEND( EPhoneUIStates,
|
|
112 |
"CPhoneTwoSingles::HandlePhoneEngineMessageL()");
|
|
113 |
switch ( aMessage )
|
|
114 |
{
|
|
115 |
case MEngineMonitor::EPEMessageIdle:
|
|
116 |
HandleIdleL( aCallId );
|
|
117 |
break;
|
|
118 |
|
|
119 |
case MEngineMonitor::EPEMessageConnected:
|
|
120 |
HandleConnectedL( aCallId );
|
|
121 |
break;
|
|
122 |
|
|
123 |
case MEngineMonitor::EPEMessageHeld:
|
|
124 |
HandleHeldL( aCallId );
|
|
125 |
break;
|
|
126 |
|
|
127 |
case MEngineMonitor::EPEMessageConnectedConference:
|
|
128 |
HandleConnectedConferenceL( aCallId );
|
|
129 |
break;
|
|
130 |
|
|
131 |
case MEngineMonitor::EPEMessageIncoming:
|
|
132 |
HandleIncomingL( aCallId );
|
|
133 |
break;
|
|
134 |
|
|
135 |
default:
|
|
136 |
CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
|
|
137 |
break;
|
|
138 |
}
|
|
139 |
}
|
|
140 |
|
|
141 |
// -----------------------------------------------------------
|
|
142 |
// CPhoneTwoSingles:HandleIdleL
|
|
143 |
// -----------------------------------------------------------
|
|
144 |
//
|
|
145 |
void CPhoneTwoSingles::HandleIdleL( TInt aCallId )
|
|
146 |
{
|
|
147 |
__LOGMETHODSTARTEND( EPhoneUIStates,
|
|
148 |
"CPhoneTwoSingles::HandleIdleL()");
|
|
149 |
BeginUiUpdateLC();
|
|
150 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
|
|
151 |
|
|
152 |
TPhoneCmdParamInteger activeCallCount;
|
|
153 |
iViewCommandHandle->ExecuteCommandL(
|
|
154 |
EPhoneViewGetCountOfActiveCalls, &activeCallCount );
|
|
155 |
|
|
156 |
switch( activeCallCount.Integer() )
|
|
157 |
{
|
|
158 |
case EOneActiveCall:
|
|
159 |
{
|
|
160 |
if ( IsNumberEntryUsedL() )
|
|
161 |
{
|
|
162 |
SetNumberEntryVisibilityL(ETrue);
|
|
163 |
}
|
|
164 |
else
|
|
165 |
{
|
65
|
166 |
UpdateCbaL( EPhoneCallHandlingInCallCBA );
|
37
|
167 |
}
|
|
168 |
|
|
169 |
TPhoneCmdParamCallStateData callStateData;
|
|
170 |
callStateData.SetCallState( EPEStateHeld );
|
|
171 |
iViewCommandHandle->HandleCommandL(
|
|
172 |
EPhoneViewGetCallIdByState, &callStateData );
|
|
173 |
TInt holdCallId = callStateData.CallId();
|
|
174 |
|
|
175 |
TPhoneCmdParamBoolean holdFlag;
|
|
176 |
if ( holdCallId < 0 )
|
|
177 |
{
|
|
178 |
holdFlag.SetBoolean( EFalse );
|
|
179 |
}
|
|
180 |
else
|
|
181 |
{
|
|
182 |
holdFlag.SetBoolean( ETrue );
|
|
183 |
}
|
|
184 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
|
65
|
185 |
SetTouchPaneButtons( EPhoneIncallButtons );
|
37
|
186 |
iStateMachine->ChangeState( EPhoneStateSingle );
|
|
187 |
}
|
|
188 |
|
|
189 |
default:
|
|
190 |
break;
|
|
191 |
}
|
|
192 |
EndUiUpdate();
|
|
193 |
}
|
|
194 |
|
|
195 |
// -----------------------------------------------------------
|
|
196 |
// CPhoneTwoSingles::HandleKeyMessageL
|
|
197 |
// -----------------------------------------------------------
|
|
198 |
//
|
|
199 |
EXPORT_C void CPhoneTwoSingles::HandleKeyMessageL(
|
|
200 |
TPhoneKeyEventMessages aMessage,
|
|
201 |
TKeyCode aCode )
|
|
202 |
{
|
|
203 |
__LOGMETHODSTARTEND( EPhoneUIStates,
|
|
204 |
"CPhoneTwoSingles::HandleKeyMessageL()");
|
|
205 |
switch ( aCode )
|
|
206 |
{
|
65
|
207 |
case EKeyYes: // send-key
|
37
|
208 |
{
|
|
209 |
if ( !IsNumberEntryVisibleL() )
|
|
210 |
{
|
|
211 |
iStateMachine->SendPhoneEngineMessage(
|
|
212 |
CPEPhoneModelIF::EPEMessageSwap );
|
|
213 |
}
|
|
214 |
else
|
|
215 |
{
|
|
216 |
CallFromNumberEntryL();
|
|
217 |
}
|
|
218 |
break;
|
|
219 |
}
|
|
220 |
|
|
221 |
default:
|
|
222 |
CPhoneGsmInCall::HandleKeyMessageL( aMessage, aCode );
|
|
223 |
break;
|
|
224 |
}
|
|
225 |
}
|
|
226 |
|
|
227 |
// -----------------------------------------------------------
|
|
228 |
// CPhoneTwoSingles::HandleConnectedL
|
|
229 |
// -----------------------------------------------------------
|
|
230 |
//
|
|
231 |
void CPhoneTwoSingles::HandleConnectedL( TInt aCallId )
|
|
232 |
{
|
|
233 |
__LOGMETHODSTARTEND( EPhoneUIStates,
|
|
234 |
"CPhoneTwoSingles::HandleConnectedL()");
|
65
|
235 |
|
37
|
236 |
TPhoneCmdParamCallHeaderData callHeaderParam;
|
|
237 |
callHeaderParam.SetCallState( EPEStateConnected );
|
|
238 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId,
|
|
239 |
&callHeaderParam );
|
|
240 |
|
|
241 |
SetTouchPaneButtons( EPhoneIncallButtons );
|
|
242 |
}
|
|
243 |
|
|
244 |
// -----------------------------------------------------------
|
|
245 |
// CPhoneTwoSingles::HandleHeldL
|
|
246 |
// -----------------------------------------------------------
|
|
247 |
//
|
|
248 |
void CPhoneTwoSingles::HandleHeldL( TInt aCallId )
|
|
249 |
{
|
|
250 |
__LOGMETHODSTARTEND( EPhoneUIStates,
|
|
251 |
"CPhoneTwoSingles::HandleHeldL()");
|
|
252 |
TPhoneCmdParamCallHeaderData callHeaderParam;
|
|
253 |
callHeaderParam.SetCallState( EPEStateHeld );
|
|
254 |
|
|
255 |
TBuf<KPhoneCallHeaderLabelMaxLength> labelText( KNullDesC );
|
|
256 |
TInt callLabelId = CPhoneMainResourceResolver::Instance()->
|
|
257 |
ResolveResourceID( EPhoneCallOnHold );
|
|
258 |
|
|
259 |
StringLoader::Load(
|
|
260 |
labelText,
|
|
261 |
callLabelId,
|
|
262 |
CCoeEnv::Static() );
|
|
263 |
callHeaderParam.SetLabelText( labelText );
|
|
264 |
|
|
265 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId,
|
|
266 |
&callHeaderParam );
|
|
267 |
|
|
268 |
SetTouchPaneButtons( EPhoneIncallButtons );
|
|
269 |
}
|
|
270 |
|
|
271 |
// -----------------------------------------------------------
|
|
272 |
// CPhoneTwoSingles::HandleNumberEntryClearedL()
|
|
273 |
// -----------------------------------------------------------
|
|
274 |
//
|
|
275 |
EXPORT_C void CPhoneTwoSingles::HandleNumberEntryClearedL()
|
|
276 |
{
|
|
277 |
__LOGMETHODSTARTEND( EPhoneUIStates,
|
|
278 |
"CPhoneTwoSingles::HandleNumberEntryClearedL()");
|
|
279 |
UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA );
|
|
280 |
}
|
|
281 |
|
|
282 |
// -----------------------------------------------------------
|
|
283 |
// CPhoneTwoSingles::HandleConnectedConferenceL
|
|
284 |
// -----------------------------------------------------------
|
|
285 |
//
|
|
286 |
EXPORT_C void CPhoneTwoSingles::HandleConnectedConferenceL( TInt aCallId )
|
|
287 |
{
|
|
288 |
__LOGMETHODSTARTEND( EPhoneUIStates,
|
|
289 |
"CPhoneTwoSingles::HandleConnectedConferenceL()");
|
|
290 |
TPhoneCmdParamCallHeaderData callHeaderParam;
|
|
291 |
|
|
292 |
TInt callLabelId;
|
|
293 |
TBuf<KPhoneCallHeaderLabelMaxLength> conferenceText( KNullDesC );
|
|
294 |
callLabelId = CPhoneMainResourceResolver::Instance()->
|
|
295 |
ResolveResourceID( EPhoneCLIConferenceCall );
|
|
296 |
|
|
297 |
StringLoader::Load(
|
|
298 |
conferenceText,
|
|
299 |
callLabelId,
|
|
300 |
CCoeEnv::Static() );
|
|
301 |
callHeaderParam.SetCLIText( conferenceText, TPhoneCmdParamCallHeaderData::ERight );
|
|
302 |
|
|
303 |
callHeaderParam.SetCallState(EPEStateConnectedConference);
|
|
304 |
BeginUiUpdateLC();
|
|
305 |
|
|
306 |
callHeaderParam.SetCiphering(
|
|
307 |
iStateMachine->PhoneEngineInfo()->IsSecureCall( aCallId ) );
|
|
308 |
|
|
309 |
callHeaderParam.SetCipheringIndicatorAllowed(
|
|
310 |
iStateMachine->PhoneEngineInfo()->SecureSpecified() );
|
|
311 |
|
|
312 |
// Service identifier must be given so that service specific settings
|
|
313 |
// can be taken into account at phoneuiview.
|
|
314 |
callHeaderParam.SetServiceId(
|
|
315 |
iStateMachine->PhoneEngineInfo()->ServiceId( aCallId ) );
|
|
316 |
|
|
317 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewCreateConference, aCallId,
|
|
318 |
&callHeaderParam );
|
|
319 |
|
|
320 |
TPhoneCmdParamBoolean holdFlag;
|
|
321 |
holdFlag.SetBoolean( EFalse );
|
|
322 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
|
|
323 |
|
|
324 |
SetTouchPaneButtons( EPhoneConferenceButtons );
|
|
325 |
EndUiUpdate();
|
|
326 |
|
|
327 |
UpdateCbaL( EPhoneCallHandlingInCallCBA );
|
|
328 |
iStateMachine->ChangeState( EPhoneStateConference );
|
|
329 |
}
|
|
330 |
|
|
331 |
// -----------------------------------------------------------
|
|
332 |
// CPhoneTwoSingles::HandleIncomingL
|
|
333 |
// -----------------------------------------------------------
|
|
334 |
//
|
|
335 |
void CPhoneTwoSingles::HandleIncomingL( TInt aCallId )
|
|
336 |
{
|
|
337 |
__LOGMETHODSTARTEND( EPhoneUIStates,
|
|
338 |
"CPhoneTwoSingles::HandleIncomingL()");
|
|
339 |
BeginUiUpdateLC();
|
|
340 |
|
65
|
341 |
// Get allow waiting call header param value.
|
37
|
342 |
TPhoneCmdParamBoolean dialerParam;
|
|
343 |
dialerParam.SetBoolean( ETrue );
|
|
344 |
AllowShowingOfWaitingCallHeaderL( dialerParam );
|
|
345 |
|
|
346 |
// Close fast swap window if it's displayed
|
|
347 |
CEikonEnv::Static()->DismissTaskList();
|
65
|
348 |
|
37
|
349 |
DisplayIncomingCallL( aCallId, dialerParam );
|
|
350 |
CheckDisableHWKeysAndCallUIL();
|
|
351 |
SetTouchPaneButtons( EPhoneWaitingCallButtons );
|
|
352 |
EndUiUpdate();
|
65
|
353 |
|
37
|
354 |
iCbaManager->SetCbaL( EPhoneCallHandlingIncomingRejectCBA );
|
65
|
355 |
iStateMachine->ChangeState( EPhoneStateTwoSinglesAndWaiting );
|
37
|
356 |
}
|
|
357 |
|
|
358 |
// -----------------------------------------------------------
|
|
359 |
// CPhoneTwoSingles::DisplayIncomingCallL
|
|
360 |
// -----------------------------------------------------------
|
|
361 |
//
|
|
362 |
void CPhoneTwoSingles::DisplayIncomingCallL(
|
|
363 |
TInt aCallId,
|
|
364 |
const TPhoneCmdParamBoolean aCommandParam )
|
|
365 |
{
|
|
366 |
__LOGMETHODSTARTEND( EPhoneUIStates,
|
|
367 |
"CPhoneTwoSingles::DisplayIncomingCallL()");
|
|
368 |
// Cannot delete active note, e.g. New call query,
|
|
369 |
// but show waiting note with or without caller name
|
65
|
370 |
if ( IsAnyQueryActiveL() || !aCommandParam.Boolean() )
|
37
|
371 |
{
|
65
|
372 |
CallWaitingNoteL( aCallId );
|
37
|
373 |
}
|
|
374 |
else
|
|
375 |
{
|
|
376 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
|
|
377 |
}
|
|
378 |
|
|
379 |
// Indicate that the Phone needs to be sent to the background if
|
|
380 |
// an application other than the top application is in the foreground
|
|
381 |
TPhoneCmdParamBoolean booleanParam;
|
|
382 |
booleanParam.SetBoolean( !TopAppIsDisplayedL() );
|
|
383 |
iViewCommandHandle->ExecuteCommandL(
|
|
384 |
EPhoneViewSetNeedToSendToBackgroundStatus,
|
|
385 |
&booleanParam );
|
|
386 |
|
|
387 |
TPhoneCmdParamInteger uidParam;
|
|
388 |
uidParam.SetInteger( KUidPhoneApplication.iUid );
|
|
389 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
|
|
390 |
&uidParam );
|
|
391 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
|
|
392 |
&uidParam );
|
|
393 |
|
|
394 |
CPhoneState::DisplayHeaderForCallComingInL( aCallId, ETrue ); //waiting call
|
|
395 |
}
|
|
396 |
|
|
397 |
// -----------------------------------------------------------
|
|
398 |
// CPhoneTwoSingles::UpdateInCallCbaL
|
|
399 |
// -----------------------------------------------------------
|
|
400 |
//
|
|
401 |
EXPORT_C void CPhoneTwoSingles::UpdateInCallCbaL()
|
|
402 |
{
|
|
403 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneTwoSingles::UpdateInCallCbaL() ");
|
|
404 |
UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA );
|
|
405 |
}
|
|
406 |
|
|
407 |
// End of File
|