37
|
1 |
/*
|
|
2 |
* Copyright (c) 2005-2009 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 CPhoneStateInCall class.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
// INCLUDES
|
|
20 |
#include <featmgr.h>
|
|
21 |
#include <StringLoader.h>
|
|
22 |
#include <PSVariables.h>
|
|
23 |
#include <hwrmdomainpskeys.h>
|
|
24 |
#include <UikonInternalPSKeys.h>
|
|
25 |
#include <mpeengineinfo.h>
|
|
26 |
#include <videotelcontrolmediatorapi.h>
|
|
27 |
#include <MediatorDomainUIDs.h>
|
|
28 |
#include <bldvariant.hrh>
|
|
29 |
|
|
30 |
#include "cphonestateincall.h"
|
|
31 |
#include "tphonecmdparamboolean.h"
|
|
32 |
#include "tphonecmdparaminteger.h"
|
|
33 |
#include "tphonecmdparamstring.h"
|
|
34 |
#include "tphonecmdparamnote.h"
|
|
35 |
#include "tphonecmdparamquery.h"
|
|
36 |
#include "tphonecmdparamcallstatedata.h"
|
|
37 |
#include "tphonecmdparamsfidata.h"
|
|
38 |
#include "mphonestatemachine.h"
|
|
39 |
#include "phonestatedefinitions.h"
|
|
40 |
#include "phoneviewcommanddefinitions.h"
|
|
41 |
#include "phoneui.hrh"
|
|
42 |
#include "phonerssbase.h"
|
|
43 |
#include "cphonemainresourceresolver.h"
|
|
44 |
#include "phonelogger.h"
|
|
45 |
#include "phoneui.pan"
|
|
46 |
#include "cphonepubsubproxy.h"
|
|
47 |
#include "cphonedtmfwaitchartimer.h"
|
|
48 |
#include "tphonecmdparamcallheaderdata.h"
|
|
49 |
#include "cphonemediatorfactory.h"
|
|
50 |
#include "cphonemediatorsender.h"
|
|
51 |
#include "cphoneterminateallconnectionscommand.h"
|
|
52 |
#include "mphonecustomization.h"
|
|
53 |
|
|
54 |
// ================= MEMBER FUNCTIONS =======================
|
|
55 |
|
|
56 |
// C++ default constructor can NOT contain any code, that
|
|
57 |
// might leave.
|
|
58 |
//
|
|
59 |
EXPORT_C CPhoneStateInCall::CPhoneStateInCall(
|
|
60 |
MPhoneStateMachine* aStateMachine,
|
|
61 |
MPhoneViewCommandHandle* aViewCommandHandle,
|
|
62 |
MPhoneCustomization* aCustomization ) :
|
|
63 |
CPhoneState( aStateMachine, aViewCommandHandle, aCustomization ),
|
|
64 |
iDtmfWaitCharTimer( NULL )
|
|
65 |
{
|
|
66 |
}
|
|
67 |
|
|
68 |
// -----------------------------------------------------------
|
|
69 |
// CPhoneStateInCall::~CPhoneStateInCall()
|
|
70 |
// Destructor
|
|
71 |
// (other items were commented in a header).
|
|
72 |
// -----------------------------------------------------------
|
|
73 |
//
|
|
74 |
EXPORT_C CPhoneStateInCall::~CPhoneStateInCall()
|
|
75 |
{
|
|
76 |
if( iDtmfWaitCharTimer )
|
|
77 |
{
|
|
78 |
delete iDtmfWaitCharTimer;
|
|
79 |
}
|
|
80 |
}
|
|
81 |
|
|
82 |
// -----------------------------------------------------------
|
|
83 |
// CPhoneStateInCall::ConstructL()
|
|
84 |
// Constructor
|
|
85 |
// (other items were commented in a header).
|
|
86 |
// -----------------------------------------------------------
|
|
87 |
//
|
|
88 |
EXPORT_C void CPhoneStateInCall::ConstructL()
|
|
89 |
{
|
|
90 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
|
|
91 |
Panic( EPhoneCtrlInvariant ) );
|
|
92 |
CPhoneState::BaseConstructL();
|
|
93 |
// Enable the volume display
|
|
94 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNaviPaneAudioVolume );
|
|
95 |
}
|
|
96 |
|
|
97 |
// -----------------------------------------------------------
|
|
98 |
// CPhoneStateInCall::NewL()
|
|
99 |
// Constructor
|
|
100 |
// (other items were commented in a header).
|
|
101 |
// -----------------------------------------------------------
|
|
102 |
//
|
|
103 |
CPhoneStateInCall* CPhoneStateInCall::NewL(
|
|
104 |
MPhoneStateMachine* aStateMachine,
|
|
105 |
MPhoneViewCommandHandle* aViewCommandHandle,
|
|
106 |
MPhoneCustomization* aPhoneCustomization )
|
|
107 |
{
|
|
108 |
CPhoneStateInCall* self = new (ELeave) CPhoneStateInCall(
|
|
109 |
aStateMachine, aViewCommandHandle, aPhoneCustomization );
|
|
110 |
|
|
111 |
CleanupStack::PushL( self );
|
|
112 |
self->ConstructL();
|
|
113 |
CleanupStack::Pop( self );
|
|
114 |
|
|
115 |
return self;
|
|
116 |
}
|
|
117 |
|
|
118 |
// -----------------------------------------------------------
|
|
119 |
// CPhoneStateInCall::HandleKeyMessageL
|
|
120 |
// -----------------------------------------------------------
|
|
121 |
//
|
|
122 |
EXPORT_C void CPhoneStateInCall::HandleKeyMessageL(
|
|
123 |
TPhoneKeyEventMessages aMessage,
|
|
124 |
TKeyCode aCode )
|
|
125 |
{
|
|
126 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
127 |
"CPhoneStateInCall::HandleKeyMessageL()" );
|
|
128 |
switch ( aCode )
|
|
129 |
{
|
|
130 |
// end-key
|
|
131 |
case EKeyNo:
|
|
132 |
HandleEndKeyPressL( aMessage );
|
|
133 |
break;
|
|
134 |
|
|
135 |
// Voice key
|
|
136 |
case EKeyDevice6:
|
|
137 |
HandleVoiceKeyPressL( aMessage );
|
|
138 |
break;
|
|
139 |
|
|
140 |
#ifdef RD_INTELLIGENT_TEXT_INPUT
|
|
141 |
case EKeyEnter:
|
|
142 |
if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
|
|
143 |
{
|
|
144 |
SendDtmfL();
|
|
145 |
}
|
|
146 |
else if ( IsNumberEntryVisibleL() )
|
|
147 |
{
|
|
148 |
HandleCommandL( EPhoneCmdOptions );
|
|
149 |
}
|
|
150 |
break;
|
|
151 |
#endif
|
|
152 |
|
|
153 |
default:
|
|
154 |
break;
|
|
155 |
}
|
|
156 |
}
|
|
157 |
|
|
158 |
// -----------------------------------------------------------
|
|
159 |
// CPhoneStateInCall::HandleNumberEntryClearedL()
|
|
160 |
// -----------------------------------------------------------
|
|
161 |
//
|
|
162 |
EXPORT_C void CPhoneStateInCall::HandleNumberEntryClearedL()
|
|
163 |
{
|
|
164 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
165 |
"CPhoneStateInCall::HandleNumberEntryClearedL()" );
|
|
166 |
// Update single call CBA when number entry is cleared
|
|
167 |
UpdateInCallCbaL();
|
|
168 |
}
|
|
169 |
|
|
170 |
// -----------------------------------------------------------
|
|
171 |
// CPhoneStateInCall::HandlePhoneEngineMessageL
|
|
172 |
// -----------------------------------------------------------
|
|
173 |
//
|
|
174 |
EXPORT_C void CPhoneStateInCall::HandlePhoneEngineMessageL(
|
|
175 |
const TInt aMessage,
|
|
176 |
TInt aCallId )
|
|
177 |
{
|
|
178 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
179 |
"CPhoneStateInCall::HandlePhoneEngineMessageL()" );
|
|
180 |
switch ( aMessage )
|
|
181 |
{
|
|
182 |
case MEngineMonitor::EPEMessageIdle:
|
|
183 |
HandleIdleL( aCallId );
|
|
184 |
break;
|
|
185 |
|
|
186 |
case MEngineMonitor::EPEMessageAudioMuteChanged:
|
|
187 |
HandleAudioMuteChangedL();
|
|
188 |
break;
|
|
189 |
|
|
190 |
case MEngineMonitor::EPEMessageAudioOutputChanged:
|
|
191 |
HandleAudioOutputChangedL();
|
|
192 |
break;
|
|
193 |
|
|
194 |
case MEngineMonitor::EPEMessageSendingDTMF:
|
|
195 |
case MEngineMonitor::EPEMessageContinuingDTMFSending:
|
|
196 |
HandleSendingDTMFL();
|
|
197 |
break;
|
|
198 |
|
|
199 |
case MEngineMonitor::EPEMessageStoppedDTMF:
|
|
200 |
HandleStoppedDTMFL();
|
|
201 |
break;
|
|
202 |
|
|
203 |
case MEngineMonitor::EPEMessageSentDTMF:
|
|
204 |
case MEngineMonitor::EPEMessageDTMFSendingAborted:
|
|
205 |
CancelDTMFSendingL();
|
|
206 |
break;
|
|
207 |
|
|
208 |
case MEngineMonitor::EPEMessagePromptSpeedDial:
|
|
209 |
HandleDTMFPromptSpeedDialL();
|
|
210 |
break;
|
|
211 |
|
|
212 |
case MEngineMonitor::EPEMessageSpeedDialNotAssigned:
|
|
213 |
CPhoneState::SendGlobalErrorNoteL(
|
|
214 |
EPhoneDtmfSpeedDialNotAssigned );
|
|
215 |
break;
|
|
216 |
|
|
217 |
case MEngineMonitor::EPEMessageInvalidSpeedDial:
|
|
218 |
CPhoneState::SendGlobalErrorNoteL( EPhoneDtmfInvalidSpeedDial );
|
|
219 |
break;
|
|
220 |
|
|
221 |
case MEngineMonitor::EPEMessageAudioVolumeChanged:
|
|
222 |
HandleAudioVolumeChangedL();
|
|
223 |
break;
|
|
224 |
|
|
225 |
case MEngineMonitor::EPEMessageDisconnecting:
|
|
226 |
CancelDTMFSendingL();
|
|
227 |
if ( !CPhoneState::IsAnyConnectedCalls() )
|
|
228 |
{
|
|
229 |
CloseDtmfQueryL();
|
|
230 |
}
|
|
231 |
CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId );
|
|
232 |
break;
|
|
233 |
|
|
234 |
case MEngineMonitor::EPEMessageInValidEmergencyNumber:
|
|
235 |
SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed );
|
|
236 |
break;
|
|
237 |
|
|
238 |
case MEngineMonitor::EPEMessageValidEmergencyNumber:
|
|
239 |
DialVoiceCallL();
|
|
240 |
break;
|
|
241 |
|
|
242 |
case MEngineMonitor::EPEMessageRemotePartyInfoChanged:
|
|
243 |
// If there is a waiting call then update header and label
|
|
244 |
// else forward message to CPhoneState.
|
|
245 |
if ( IsWaitingCallL( aCallId ) )
|
|
246 |
{
|
|
247 |
// Update remote info data and label.
|
|
248 |
UpdateRemoteInfoDataAndLabelL( aCallId, UpdateCallHeaderInfoL( aCallId ) );
|
|
249 |
}
|
|
250 |
else
|
|
251 |
{
|
|
252 |
CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId );
|
|
253 |
}
|
|
254 |
break;
|
|
255 |
|
|
256 |
default:
|
|
257 |
CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId );
|
|
258 |
break;
|
|
259 |
}
|
|
260 |
}
|
|
261 |
|
|
262 |
// -----------------------------------------------------------
|
|
263 |
// CPhoneStateInCall::UpdateRemoteInfoDataAndLabelL
|
|
264 |
// -----------------------------------------------------------
|
|
265 |
//
|
|
266 |
void CPhoneStateInCall::UpdateRemoteInfoDataAndLabelL(
|
|
267 |
TInt aCallId,
|
|
268 |
TPhoneCmdParamCallHeaderData aCallHeaderParam )
|
|
269 |
{
|
|
270 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
271 |
"CPhoneStateInCall::UpdateRemoteInfoDataAndLabelL ()" );
|
|
272 |
// Update the remote info data in the call header
|
|
273 |
iViewCommandHandle->ExecuteCommandL(
|
|
274 |
EPhoneViewUpdateCallHeaderRemoteInfoDataAndLabel,
|
|
275 |
aCallId,
|
|
276 |
&aCallHeaderParam );
|
|
277 |
}
|
|
278 |
|
|
279 |
// -----------------------------------------------------------
|
|
280 |
// CPhoneStateInCall::HandleIdleL
|
|
281 |
// -----------------------------------------------------------
|
|
282 |
//
|
|
283 |
EXPORT_C void CPhoneStateInCall::HandleIdleL( TInt aCallId )
|
|
284 |
{
|
|
285 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
286 |
"CPhoneStateInCall::HandleIdleL()" );
|
|
287 |
__ASSERT_DEBUG( aCallId >= 0, Panic( EPhoneCtrlParameterNotInitialized ) );
|
|
288 |
// Remove call
|
|
289 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
|
|
290 |
|
|
291 |
//Make sure that toolbar is not shown
|
|
292 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewHideToolbar );
|
|
293 |
BeginTransEffectLC( ENumberEntryOpen );
|
|
294 |
BeginUiUpdateLC();
|
|
295 |
SetDefaultFlagsL();
|
|
296 |
if ( IsNumberEntryUsedL() )
|
|
297 |
{
|
|
298 |
// Show the number entry if it exists and update cba's.
|
|
299 |
SetNumberEntryVisibilityL( ETrue );
|
|
300 |
|
|
301 |
// Close dtmf dialer when call is disconnected.
|
|
302 |
if ( IsDTMFEditorVisibleL() )
|
|
303 |
{
|
|
304 |
CloseDTMFEditorL();
|
|
305 |
|
|
306 |
// Display idle screen and update CBA's
|
|
307 |
DisplayIdleScreenL();
|
|
308 |
}
|
|
309 |
else if ( iOnScreenDialer && IsCustomizedDialerVisibleL() )
|
|
310 |
{
|
|
311 |
CloseCustomizedDialerL();
|
|
312 |
// Display idle screen and update CBA's
|
|
313 |
DisplayIdleScreenL();
|
|
314 |
}
|
|
315 |
}
|
|
316 |
else
|
|
317 |
{
|
|
318 |
// Close menu bar, if it is displayed
|
|
319 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
|
|
320 |
|
|
321 |
if ( !TopAppIsDisplayedL() || IsAutoLockOn() )
|
|
322 |
{
|
|
323 |
// Continue displaying current app but set up the
|
|
324 |
// idle screen in the background
|
|
325 |
SetupIdleScreenInBackgroundL();
|
|
326 |
}
|
|
327 |
else
|
|
328 |
{
|
|
329 |
// Display idle screen and update CBAs
|
|
330 |
DisplayIdleScreenL();
|
|
331 |
}
|
|
332 |
}
|
|
333 |
|
|
334 |
DeleteTouchPaneButtons();
|
|
335 |
EndUiUpdate();
|
|
336 |
EndTransEffect();
|
|
337 |
// Display call termination note, if necessary
|
|
338 |
DisplayCallTerminationNoteL();
|
|
339 |
|
|
340 |
// Go to idle state
|
|
341 |
iStateMachine->ChangeState( EPhoneStateIdle );
|
|
342 |
}
|
|
343 |
|
|
344 |
// -----------------------------------------------------------
|
|
345 |
// CPhoneStateInCall::UpdateInCallCbaL
|
|
346 |
// -----------------------------------------------------------
|
|
347 |
//
|
|
348 |
EXPORT_C void CPhoneStateInCall::UpdateInCallCbaL()
|
|
349 |
{
|
|
350 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateInCall::UpdateInCallCbaL() ");
|
|
351 |
UpdateCbaL( EPhoneCallHandlingInCallCBA );
|
|
352 |
}
|
|
353 |
|
|
354 |
// -----------------------------------------------------------
|
|
355 |
// CPhoneStateInCall::UpdateCbaL
|
|
356 |
// -----------------------------------------------------------
|
|
357 |
//
|
|
358 |
EXPORT_C void CPhoneStateInCall::UpdateCbaL( TInt aResource )
|
|
359 |
{
|
|
360 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateInCall::UpdateCbaL() ");
|
|
361 |
if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
|
|
362 |
{
|
|
363 |
iCbaManager->SetCbaL( EPhoneDtmfDialerCBA );
|
|
364 |
}
|
|
365 |
else if ( iOnScreenDialer && IsCustomizedDialerVisibleL() )
|
|
366 |
{
|
|
367 |
iCbaManager->SetCbaL( CustomizedDialerCbaResourceIdL() );
|
|
368 |
}
|
|
369 |
else
|
|
370 |
{
|
|
371 |
iCbaManager->UpdateCbaL( aResource );
|
|
372 |
}
|
|
373 |
}
|
|
374 |
|
|
375 |
// -----------------------------------------------------------
|
|
376 |
// CPhoneStateInCall::HandleAudioMuteChangedL
|
|
377 |
// -----------------------------------------------------------
|
|
378 |
//
|
|
379 |
void CPhoneStateInCall::HandleAudioMuteChangedL()
|
|
380 |
{
|
|
381 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
382 |
"CPhoneStateInCall::HandleAudioMuteChangedL()" );
|
|
383 |
CPhoneState::HandleAudioMuteChangedL();
|
|
384 |
|
|
385 |
// Update the single call CBA only if the number entry is not
|
|
386 |
// used
|
|
387 |
if ( !IsNumberEntryUsedL() )
|
|
388 |
{
|
|
389 |
// Go to current state implementation
|
|
390 |
UpdateInCallCbaL();
|
|
391 |
}
|
|
392 |
}
|
|
393 |
|
|
394 |
// -----------------------------------------------------------
|
|
395 |
// CPhoneStateInCall::HandleAudioOutputChangedL
|
|
396 |
// -----------------------------------------------------------
|
|
397 |
//
|
|
398 |
void CPhoneStateInCall::HandleAudioOutputChangedL()
|
|
399 |
{
|
|
400 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
401 |
"CPhoneStateInCall::HandleAudioOutputChangedL()" );
|
|
402 |
// Handle the handsfree mode change
|
|
403 |
CPhoneState::HandleAudioOutputChangedL();
|
|
404 |
|
|
405 |
// Update the single call CBA only if the number entry is not
|
|
406 |
// used
|
|
407 |
if ( !IsNumberEntryVisibleL() )
|
|
408 |
{
|
|
409 |
// Go to current state implementation
|
|
410 |
UpdateInCallCbaL();
|
|
411 |
}
|
|
412 |
}
|
|
413 |
|
|
414 |
// -----------------------------------------------------------
|
|
415 |
// CPhoneStateInCall::HandleAudioVolumeChangedL
|
|
416 |
// -----------------------------------------------------------
|
|
417 |
//
|
|
418 |
void CPhoneStateInCall::HandleAudioVolumeChangedL()
|
|
419 |
{
|
|
420 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
421 |
"CPhoneStateInCall::HandleAudioVolumeChangedL()" );
|
|
422 |
// Update the volume display
|
|
423 |
TInt audioVolume = iStateMachine->PhoneEngineInfo()->AudioVolume();
|
|
424 |
TPhoneCmdParamInteger volumeParam;
|
|
425 |
volumeParam.SetInteger( audioVolume );
|
|
426 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetNaviPaneAudioVolume,
|
|
427 |
&volumeParam );
|
|
428 |
}
|
|
429 |
|
|
430 |
// -----------------------------------------------------------
|
|
431 |
// CPhoneStateInCall::HandleSendingDTMFL
|
|
432 |
// -----------------------------------------------------------
|
|
433 |
//
|
|
434 |
void CPhoneStateInCall::HandleSendingDTMFL()
|
|
435 |
{
|
|
436 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
437 |
"CPhoneStateInCall::HandleSendingDTMFL()" );
|
|
438 |
TPhoneCmdParamNote noteParam;
|
|
439 |
noteParam.SetType( EPhoneNoteDtmfSending );
|
|
440 |
noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()->
|
|
441 |
ResolveResourceID( EPhoneSendingDtmfWaitNote ) );
|
|
442 |
|
|
443 |
// Show the "Sending..." Wait Note, and pre-populate it
|
|
444 |
// with the PhoneEngine's current DTMF String.
|
|
445 |
// Set the text for the wait-note.
|
|
446 |
TPEDtmfString dtmfString = iStateMachine->PhoneEngineInfo()->DtmfString();
|
|
447 |
HBufC* noteText = StringLoader::LoadLC(
|
|
448 |
CPhoneMainResourceResolver::Instance()->
|
|
449 |
ResolveResourceID( EPhoneSendingDtmfWaitNoteText ),
|
|
450 |
dtmfString );
|
|
451 |
noteParam.SetText( *noteText );
|
|
452 |
|
|
453 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, ¬eParam );
|
|
454 |
|
|
455 |
CleanupStack::PopAndDestroy( noteText );
|
|
456 |
}
|
|
457 |
|
|
458 |
// -----------------------------------------------------------
|
|
459 |
// CPhoneStateInCall::HandleStoppedDTMFL
|
|
460 |
// -----------------------------------------------------------
|
|
461 |
//
|
|
462 |
void CPhoneStateInCall::HandleStoppedDTMFL()
|
|
463 |
{
|
|
464 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
465 |
"CPhoneStateInCall::HandleStoppedDTMFL()" );
|
|
466 |
// Remove the Sending... note
|
|
467 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
|
|
468 |
|
|
469 |
// Fetch the remaining (unparsed) portion of the DTMF String
|
|
470 |
// from PhoneEngine
|
|
471 |
TPEDtmfString dtmfString = iStateMachine->PhoneEngineInfo()->DtmfString();
|
|
472 |
|
|
473 |
if ( dtmfString.Length() )
|
|
474 |
{
|
|
475 |
// Show the DTMF Wait Character confirmation query
|
|
476 |
TPhoneCmdParamQuery queryParam;
|
|
477 |
queryParam.SetQueryType( EPhoneQueryDialog );
|
|
478 |
queryParam.SetQueryResourceId(
|
|
479 |
CPhoneMainResourceResolver::Instance()->ResolveResourceID(
|
|
480 |
EPhoneDtmfWaitCharacterConfirmationQuery ) );
|
|
481 |
|
|
482 |
// Append the PhoneEngine's current DTMF String to the query's prompt
|
|
483 |
HBufC* queryPrompt = StringLoader::LoadLC(
|
|
484 |
CPhoneMainResourceResolver::Instance()->ResolveResourceID(
|
|
485 |
EPhoneDtmfWaitCharacterConfirmationQueryText ),
|
|
486 |
dtmfString );
|
|
487 |
queryParam.SetQueryPrompt( *queryPrompt );
|
|
488 |
|
|
489 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery,
|
|
490 |
&queryParam );
|
|
491 |
|
|
492 |
CleanupStack::PopAndDestroy( queryPrompt );
|
|
493 |
}
|
|
494 |
else
|
|
495 |
{
|
|
496 |
// Stop the asynchronous sending operation the
|
|
497 |
// PhoneEngine may be performing.
|
|
498 |
iStateMachine->SendPhoneEngineMessage(
|
|
499 |
MPEPhoneModel::EPEMessageStopDTMFSending );
|
|
500 |
|
|
501 |
// Prompt for more characters by showing DTMF query with empty string
|
|
502 |
HBufC* emptyString = HBufC::NewLC( KPhoneNumberEntryBufferSize );
|
|
503 |
TPtr ptr( emptyString->Des() );
|
|
504 |
|
|
505 |
ShowDtmfTextQueryL(
|
|
506 |
CPhoneMainResourceResolver::Instance()->
|
|
507 |
ResolveResourceID( EPhoneDtmfNumberQuery ),
|
|
508 |
CPhoneMainResourceResolver::Instance()->
|
|
509 |
ResolveResourceID( EPhoneSendDtmfEmptyEditBoxCBA ),
|
|
510 |
CPhoneMainResourceResolver::Instance()->
|
|
511 |
ResolveResourceID( EPhoneSendDtmfNormalEditBoxCBA ),
|
|
512 |
&ptr );
|
|
513 |
|
|
514 |
CleanupStack::PopAndDestroy( emptyString );
|
|
515 |
}
|
|
516 |
}
|
|
517 |
|
|
518 |
// -----------------------------------------------------------
|
|
519 |
// CPhoneStateInCall::CancelDTMFSendingL
|
|
520 |
// -----------------------------------------------------------
|
|
521 |
//
|
|
522 |
void CPhoneStateInCall::CancelDTMFSendingL()
|
|
523 |
{
|
|
524 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
525 |
"CPhoneStateInCall::CancelDTMFSendingL()" );
|
|
526 |
// Remove the Sending... note
|
|
527 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveDtmfNote );
|
|
528 |
}
|
|
529 |
|
|
530 |
// -----------------------------------------------------------
|
|
531 |
// CPhoneStateInCall::HandleDtmfPromptSpeedDialL
|
|
532 |
// -----------------------------------------------------------
|
|
533 |
//
|
|
534 |
void CPhoneStateInCall::HandleDTMFPromptSpeedDialL()
|
|
535 |
{
|
|
536 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
537 |
"CPhoneStateInCall::HandleDTMFPromptSpeedDialL()" );
|
|
538 |
// Remove the Sending... note
|
|
539 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
|
|
540 |
|
|
541 |
// Prompt for speed dial number
|
|
542 |
HBufC* emptyString = HBufC::NewLC( KPhoneNumberEntryBufferSize );
|
|
543 |
TPtr ptr( emptyString->Des() );
|
|
544 |
|
|
545 |
// If the Search softkey is selected before a speed dial number is entered,
|
|
546 |
// revert back to the DTMF query
|
|
547 |
ShowDtmfTextQueryL(
|
|
548 |
CPhoneMainResourceResolver::Instance()->
|
|
549 |
ResolveResourceID( EPhoneDtmfSpeedDialNumberQuery ),
|
|
550 |
CPhoneMainResourceResolver::Instance()->
|
|
551 |
ResolveResourceID( EPhoneSendDtmfEmptyEditBoxCBA ),
|
|
552 |
CPhoneMainResourceResolver::Instance()->
|
|
553 |
ResolveResourceID( EPhoneDtmfSpeedDialNormalEditBoxCBA ),
|
|
554 |
&ptr );
|
|
555 |
|
|
556 |
CleanupStack::PopAndDestroy( emptyString );
|
|
557 |
}
|
|
558 |
|
|
559 |
// -----------------------------------------------------------
|
|
560 |
// CPhoneStateInCall::HandleCommandL
|
|
561 |
// -----------------------------------------------------------
|
|
562 |
//
|
|
563 |
EXPORT_C TBool CPhoneStateInCall::HandleCommandL( TInt aCommand )
|
|
564 |
{
|
|
565 |
__LOGMETHODSTARTEND( EPhoneControl,
|
|
566 |
"CPhoneStateInCall::HandleCommandL()" );
|
|
567 |
__PHONELOG1 ( EBasic, EPhoneControl,
|
|
568 |
"CPhoneStateInCall::HandleCommandL() - aCommand = %d ", aCommand );
|
|
569 |
TBool commandStatus = ETrue;
|
|
570 |
|
|
571 |
switch( aCommand )
|
|
572 |
{
|
|
573 |
case EPhoneInCallCmdDialer:
|
|
574 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewOpenDialer );
|
|
575 |
break;
|
|
576 |
case EPhoneCmdOptions:
|
|
577 |
OpenMenuBarL();
|
|
578 |
break;
|
|
579 |
|
|
580 |
case EPhoneDtmfDialerCancel:
|
|
581 |
{
|
|
582 |
CloseDTMFEditorL();
|
|
583 |
|
|
584 |
// Activate DTMF list query when cancel is pressed.
|
|
585 |
// Forwards command to the framework
|
|
586 |
HandleCommandL( EPhoneInCallCmdDtmfListQuery );
|
|
587 |
}
|
|
588 |
break;
|
|
589 |
case EPhoneDtmfDialerExit:
|
|
590 |
{
|
|
591 |
CloseDTMFEditorL();
|
|
592 |
}
|
|
593 |
break;
|
|
594 |
|
|
595 |
case EPhoneInCallCmdEndThisActiveCall:
|
|
596 |
CPhoneState::DisconnectCallL();
|
|
597 |
break;
|
|
598 |
|
|
599 |
case EPhoneCallComingCmdReject: // fall through
|
|
600 |
case EPhoneInCallCmdReject:
|
|
601 |
iStateMachine->SendPhoneEngineMessage(
|
|
602 |
MPEPhoneModel::EPEMessageReject );
|
|
603 |
break;
|
|
604 |
|
|
605 |
case EPhoneInCallCmdMute: // fall through
|
|
606 |
case EPhoneInCallCmdUnmute:
|
|
607 |
iStateMachine->PhoneEngineInfo()->SetAudioMuteCommand(
|
|
608 |
( aCommand == EPhoneInCallCmdMute ) );
|
|
609 |
iStateMachine->SendPhoneEngineMessage(
|
|
610 |
MPEPhoneModel::EPEMessageSetAudioMute );
|
|
611 |
break;
|
|
612 |
//DTMF list query - dialog
|
|
613 |
case EPhoneInCallCmdDtmfListQuery:
|
|
614 |
LaunchDtmfListQueryL();
|
|
615 |
break;
|
|
616 |
|
|
617 |
//DTMF list query - Search
|
|
618 |
case EPhoneInCallCmdDtmfListViewSearch:
|
|
619 |
LaunchDtmfListViewSearchDialogL();
|
|
620 |
break;
|
|
621 |
|
|
622 |
//DTMF manual entry
|
|
623 |
case EPhoneInCallCmdDtmfManualQuery:
|
|
624 |
if ( iOnScreenDialer )
|
|
625 |
{
|
|
626 |
ShowDtmfDialerL();
|
|
627 |
}
|
|
628 |
else
|
|
629 |
{
|
|
630 |
LaunchDtmfManualQueryL();
|
|
631 |
}
|
|
632 |
break;
|
|
633 |
|
|
634 |
// DTMF manual entry - Search
|
|
635 |
case EPhoneCmdDtmfSearch:
|
|
636 |
LaunchDtmfSearchDialogL();
|
|
637 |
break;
|
|
638 |
|
|
639 |
// DTMF entry - Ok
|
|
640 |
case EPhoneCmdDtmfOk:
|
|
641 |
SendDtmfL();
|
|
642 |
break;
|
|
643 |
|
|
644 |
// DTMF Speed entry - Ok
|
|
645 |
case EPhoneCmdDtmfSpeedDialOk:
|
|
646 |
SendDtmfSpeedDialNumberL();
|
|
647 |
break;
|
|
648 |
|
|
649 |
// DTMF sending - Cancel
|
|
650 |
case EPhoneInCallCmdCancelSendingDtmfString:
|
|
651 |
// Stop the asynchronous sending operation the
|
|
652 |
// PhoneEngine may be performing.
|
|
653 |
iStateMachine->SendPhoneEngineMessage(
|
|
654 |
MPEPhoneModel::EPEMessageStopDTMFSending );
|
|
655 |
// Remove DTMF sending from screen
|
|
656 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
|
|
657 |
break;
|
|
658 |
|
|
659 |
// DTMF wait - Ok
|
|
660 |
case EPhoneInCallCmdContinueSendingDtmfString:
|
|
661 |
// Continue sending the DTMF string
|
|
662 |
if( !iDtmfWaitCharTimer )
|
|
663 |
{
|
|
664 |
iDtmfWaitCharTimer = CPhoneDtmfWaitCharTimer::NewL(
|
|
665 |
iStateMachine );
|
|
666 |
}
|
|
667 |
iDtmfWaitCharTimer->ButtonPressedL();
|
|
668 |
break;
|
|
669 |
|
|
670 |
case EPhoneDialerCmdHelpDtmf:
|
|
671 |
{
|
|
672 |
if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
|
|
673 |
{
|
|
674 |
TPtrC contextName( KDATA_DIALER_HLP_SEND_DTMF );
|
|
675 |
iViewCommandHandle->ExecuteCommandL(
|
|
676 |
EPhoneViewLaunchHelpApplication,
|
|
677 |
0,
|
|
678 |
contextName );
|
|
679 |
}
|
|
680 |
}
|
|
681 |
break;
|
|
682 |
|
|
683 |
// New Call - Search
|
|
684 |
case EPhoneInCallCmdNewCallFind:
|
|
685 |
LaunchNewCallSearchDialogL();
|
|
686 |
break;
|
|
687 |
|
|
688 |
// New Call - Dialog
|
|
689 |
case EPhoneInCallCmdNewCall:
|
|
690 |
LaunchNewCallQueryL();
|
|
691 |
break;
|
|
692 |
|
|
693 |
case EPhoneViewYesSingleItemFetch:
|
|
694 |
HandleSuccessFetchedNumberL();
|
|
695 |
break;
|
|
696 |
|
|
697 |
case EPhoneViewNoSingleItemFetch:
|
|
698 |
if ( !iOnScreenDialer )
|
|
699 |
{
|
|
700 |
HandleFailedFetchedNumberL();
|
|
701 |
}
|
|
702 |
break;
|
|
703 |
|
|
704 |
case EPhoneNumberAcqCmdCall:
|
|
705 |
case EPhoneNumberAcqCmdSendCommand:
|
|
706 |
if ( IsVideoCallActiveL() )
|
|
707 |
{
|
|
708 |
// Get the number entry contents
|
|
709 |
HBufC *phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize );
|
|
710 |
TPtr ptr( phoneNumber->Des() );
|
|
711 |
TPhoneCmdParamString stringParam;
|
|
712 |
stringParam.SetString( &ptr );
|
|
713 |
iViewCommandHandle->ExecuteCommand(
|
|
714 |
EPhoneViewGetNumberFromEntry,
|
|
715 |
&stringParam );
|
|
716 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( ptr );
|
|
717 |
|
|
718 |
if ( iStateMachine->PhoneEngineInfo()->PhoneNumberIsServiceCode() ||
|
|
719 |
phoneNumber->Des().Length() < KPhoneValidPhoneNumberLength )
|
|
720 |
{
|
|
721 |
// Send a manual control sequence by providing number
|
|
722 |
// information with dial command
|
|
723 |
CallFromNumberEntryL();
|
|
724 |
}
|
|
725 |
else
|
|
726 |
{
|
|
727 |
iStateMachine->SendPhoneEngineMessage(
|
|
728 |
MPEPhoneModel::EPEMessageCheckEmergencyNumber );
|
|
729 |
}
|
|
730 |
CleanupStack::PopAndDestroy( phoneNumber );
|
|
731 |
}
|
|
732 |
else
|
|
733 |
{
|
|
734 |
// Provide number information with dial command
|
|
735 |
CallFromNumberEntryL();
|
|
736 |
}
|
|
737 |
break;
|
|
738 |
|
|
739 |
case EPhoneInCallCmdHelp:
|
|
740 |
if ( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
|
|
741 |
{
|
|
742 |
TPtrC contextName;
|
|
743 |
if ( IsVideoCallActiveL() )
|
|
744 |
{
|
|
745 |
contextName.Set( KINCAL_HLP_VIDEOCALL() );
|
|
746 |
}
|
|
747 |
else
|
|
748 |
{
|
|
749 |
contextName.Set( KINCAL_HLP_CALL_HANDLING() );
|
|
750 |
}
|
|
751 |
iViewCommandHandle->ExecuteCommandL(
|
|
752 |
EPhoneViewLaunchHelpApplication, 0, contextName );
|
|
753 |
}
|
|
754 |
break;
|
|
755 |
|
|
756 |
case EPhoneCmdEnd:
|
|
757 |
CloseDtmfQueryL();
|
|
758 |
CPhoneState::DisconnectCallL();
|
|
759 |
break;
|
|
760 |
|
|
761 |
// 'End all calls' from menu
|
|
762 |
case EPhoneInCallCmdEndAllCalls:
|
|
763 |
iStateMachine->SendPhoneEngineMessage(
|
|
764 |
MPEPhoneModel::EPEMessageReleaseAll );
|
|
765 |
break;
|
|
766 |
|
|
767 |
case EPhoneInCallCmdEndThisOutgoingCall:
|
|
768 |
DisconnectOutgoingCallL();
|
|
769 |
break;
|
|
770 |
|
|
771 |
case EPhoneInCallCmdGoToIdle:
|
|
772 |
{
|
|
773 |
// Bring Idle app to foreground
|
|
774 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground );
|
|
775 |
break;
|
|
776 |
}
|
|
777 |
|
|
778 |
case EPhoneNumberAcqCmdVideoCall:
|
|
779 |
{// Create normal voice call, if number is emergency number.
|
|
780 |
// Get the number entry contents
|
|
781 |
HBufC* phoneNumber = PhoneNumberFromEntryLC();
|
|
782 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber );
|
|
783 |
iStateMachine->SendPhoneEngineMessage(
|
|
784 |
MPEPhoneModel::EPEMessageCheckEmergencyNumber );
|
|
785 |
CleanupStack::PopAndDestroy( phoneNumber );}
|
|
786 |
break;
|
|
787 |
|
|
788 |
case EPhoneInCallCmdLockKeypad:
|
|
789 |
case EPhoneInCallCmdLockScreen:
|
|
790 |
LockKeypadL();
|
|
791 |
break;
|
|
792 |
|
|
793 |
case EPhoneViewOpenCallHandling:
|
|
794 |
if ( iOnScreenDialer && IsNumberEntryUsedL() )
|
|
795 |
{
|
|
796 |
// Remove number entry from screen
|
|
797 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
|
|
798 |
HandleNumberEntryClearedL();
|
|
799 |
}
|
|
800 |
commandStatus = CPhoneState::HandleCommandL( aCommand );
|
|
801 |
break;
|
|
802 |
|
|
803 |
default:
|
|
804 |
commandStatus = CPhoneState::HandleCommandL( aCommand );
|
|
805 |
break;
|
|
806 |
}
|
|
807 |
|
|
808 |
return commandStatus;
|
|
809 |
}
|
|
810 |
|
|
811 |
// -----------------------------------------------------------
|
|
812 |
// CPhoneStateInCall::CreateNumberEntryL
|
|
813 |
// -----------------------------------------------------------
|
|
814 |
//
|
|
815 |
EXPORT_C void CPhoneStateInCall::CreateNumberEntryL()
|
|
816 |
{
|
|
817 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateInCall::CreateNumberEntryL( ) ");
|
|
818 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewCreateNumberEntry );
|
|
819 |
}
|
|
820 |
|
|
821 |
// -----------------------------------------------------------
|
|
822 |
// CPhoneStateInCall::OpenMenuBarL
|
|
823 |
// -----------------------------------------------------------
|
|
824 |
//
|
|
825 |
EXPORT_C void CPhoneStateInCall::OpenMenuBarL()
|
|
826 |
{
|
|
827 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
828 |
"CPhoneStateInCall::OpenMenuBarL()" );
|
|
829 |
TInt resourceId;
|
|
830 |
|
|
831 |
if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
|
|
832 |
{
|
|
833 |
resourceId = EPhoneDtmfDialerMenubar;
|
|
834 |
}
|
|
835 |
else if ( iOnScreenDialer && IsCustomizedDialerVisibleL() )
|
|
836 |
{
|
|
837 |
resourceId = CustomizedDialerMenuResourceIdL();
|
|
838 |
}
|
|
839 |
else if ( IsNumberEntryVisibleL() )
|
|
840 |
{
|
|
841 |
resourceId = EPhoneCallHandlingMenubarWithNumberEntry;
|
|
842 |
}
|
|
843 |
else
|
|
844 |
{
|
|
845 |
resourceId = EPhoneCallHandlingMenubar;
|
|
846 |
}
|
|
847 |
|
|
848 |
TPhoneCmdParamInteger integerParam;
|
|
849 |
integerParam.SetInteger(
|
|
850 |
CPhoneMainResourceResolver::Instance()->
|
|
851 |
ResolveResourceID( resourceId ) );
|
|
852 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen,
|
|
853 |
&integerParam );
|
|
854 |
}
|
|
855 |
|
|
856 |
// -----------------------------------------------------------
|
|
857 |
// CPhoneStateInCall::LaunchNewCallQueryL
|
|
858 |
// -----------------------------------------------------------
|
|
859 |
//
|
|
860 |
EXPORT_C void CPhoneStateInCall::LaunchNewCallQueryL()
|
|
861 |
{
|
|
862 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
863 |
"CPhoneStateInCall::LaunchNewCallQueryL()" );
|
|
864 |
|
|
865 |
if ( iOnScreenDialer )
|
|
866 |
{
|
|
867 |
//In touch, just activate dialer
|
|
868 |
BeginTransEffectLC( ENumberEntryCreate );
|
|
869 |
if ( IsNumberEntryUsedL() )
|
|
870 |
{
|
|
871 |
SetNumberEntryVisibilityL(ETrue);
|
|
872 |
}
|
|
873 |
else
|
|
874 |
{
|
|
875 |
CreateNumberEntryL();
|
|
876 |
SetNumberEntryVisibilityL(ETrue);
|
|
877 |
}
|
|
878 |
EndTransEffect();
|
|
879 |
}
|
|
880 |
else
|
|
881 |
{
|
|
882 |
HBufC *text = HBufC::NewLC( KPhoneNumberEntryBufferSize );
|
|
883 |
TPtr ptr( text->Des() );
|
|
884 |
|
|
885 |
// Pre-populate the query with the number entry contents,
|
|
886 |
// if it exists
|
|
887 |
if ( IsNumberEntryUsedL() )
|
|
888 |
{
|
|
889 |
// get the number entry contents
|
|
890 |
TPhoneCmdParamString stringParam;
|
|
891 |
stringParam.SetString( &ptr );
|
|
892 |
iViewCommandHandle->ExecuteCommandL(
|
|
893 |
EPhoneViewGetLocalizedNumberFromEntry,
|
|
894 |
&stringParam );
|
|
895 |
}
|
|
896 |
|
|
897 |
// Show text query with send key enabled
|
|
898 |
const TBool enableSendKey = ETrue;
|
|
899 |
|
|
900 |
CPhoneState::ShowTextQueryL(
|
|
901 |
CPhoneMainResourceResolver::Instance()->
|
|
902 |
ResolveResourceID( EPhoneNewCallPhoneNumberEditor ),
|
|
903 |
CPhoneMainResourceResolver::Instance()->
|
|
904 |
ResolveResourceID( EPhoneCallHandlingNewCallFindCBA ),
|
|
905 |
CPhoneMainResourceResolver::Instance()->
|
|
906 |
ResolveResourceID( EPhoneCallHandlingNewCallCallCBA ),
|
|
907 |
&ptr,
|
|
908 |
enableSendKey );
|
|
909 |
|
|
910 |
CleanupStack::PopAndDestroy( text );
|
|
911 |
}
|
|
912 |
|
|
913 |
}
|
|
914 |
|
|
915 |
// -----------------------------------------------------------
|
|
916 |
// CPhoneStateInCall::CallFetchedNumberL
|
|
917 |
// -----------------------------------------------------------
|
|
918 |
//
|
|
919 |
EXPORT_C void CPhoneStateInCall::CallFetchedNumberL(
|
|
920 |
const TDesC& aFetchedNumber )
|
|
921 |
{
|
|
922 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
923 |
"CPhoneStateInCall::CallFetchedNumberL()" );
|
|
924 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
|
|
925 |
Panic( EPhoneCtrlInvariant ) );
|
|
926 |
|
|
927 |
// Store the phone number
|
|
928 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( aFetchedNumber );
|
|
929 |
|
|
930 |
DialVoiceCallL();
|
|
931 |
}
|
|
932 |
|
|
933 |
// -----------------------------------------------------------
|
|
934 |
// CPhoneStateInCall::SendDtmfL
|
|
935 |
// -----------------------------------------------------------
|
|
936 |
//
|
|
937 |
void CPhoneStateInCall::SendDtmfL()
|
|
938 |
{
|
|
939 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
940 |
"CPhoneStateInCall::SendDtmfL()" );
|
|
941 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(),
|
|
942 |
Panic( EPhoneCtrlInvariant ) );
|
|
943 |
|
|
944 |
// First get the DTMF sequence from dialog
|
|
945 |
TPhoneCmdParamString dtmfSequence;
|
|
946 |
HBufC *content = HBufC::NewLC( KPEDtmfMaxLength );
|
|
947 |
TPtr ptr( content->Des() );
|
|
948 |
dtmfSequence.SetString( &ptr );
|
|
949 |
|
|
950 |
if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
|
|
951 |
{
|
|
952 |
iViewCommandHandle->ExecuteCommand(
|
|
953 |
EPhoneViewGetNumberFromEntry,
|
|
954 |
&dtmfSequence );
|
|
955 |
|
|
956 |
CloseDTMFEditorL();
|
|
957 |
}
|
|
958 |
else
|
|
959 |
{
|
|
960 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetTextQueryContent,
|
|
961 |
&dtmfSequence );
|
|
962 |
}
|
|
963 |
|
|
964 |
// Send the DTMF
|
|
965 |
if ( ptr.Length() )
|
|
966 |
{
|
|
967 |
iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( ptr );
|
|
968 |
iStateMachine->SendPhoneEngineMessage(
|
|
969 |
MPEPhoneModel::EPEMessageSendDTMF );
|
|
970 |
}
|
|
971 |
|
|
972 |
CleanupStack::PopAndDestroy( content );
|
|
973 |
}
|
|
974 |
|
|
975 |
// -----------------------------------------------------------
|
|
976 |
// CPhoneStateInCall::SendDtmfSpeedDialNumberL
|
|
977 |
// -----------------------------------------------------------
|
|
978 |
//
|
|
979 |
void CPhoneStateInCall::SendDtmfSpeedDialNumberL()
|
|
980 |
{
|
|
981 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
982 |
"CPhoneStateInCall::SendDtmfSpeedDialNumberL()" );
|
|
983 |
// First get the DTMF sequence from dialog
|
|
984 |
TPhoneCmdParamString dtmfSequence;
|
|
985 |
HBufC *content = HBufC::NewLC( KPEDtmfMaxLength );
|
|
986 |
TPtr ptr( content->Des() );
|
|
987 |
dtmfSequence.SetString( &ptr );
|
|
988 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetTextQueryContent,
|
|
989 |
&dtmfSequence );
|
|
990 |
|
|
991 |
// Prefix the query content string with the speed dial character '+'
|
|
992 |
_LIT( KSpeedDialPrefix, "+" );
|
|
993 |
ptr.Insert( 0, KSpeedDialPrefix );
|
|
994 |
|
|
995 |
// Send the DTMF
|
|
996 |
iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( ptr );
|
|
997 |
iStateMachine->SendPhoneEngineMessage(
|
|
998 |
MPEPhoneModel::EPEMessageSendDTMF );
|
|
999 |
|
|
1000 |
CleanupStack::PopAndDestroy( content );
|
|
1001 |
}
|
|
1002 |
|
|
1003 |
// -----------------------------------------------------------
|
|
1004 |
// CPhoneStateInCall::LaunchDtmfManualQueryL
|
|
1005 |
// -----------------------------------------------------------
|
|
1006 |
//
|
|
1007 |
void CPhoneStateInCall::LaunchDtmfManualQueryL()
|
|
1008 |
{
|
|
1009 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateInCall::LaunchDtmfManualQueryL()" );
|
|
1010 |
|
|
1011 |
HBufC *text = HBufC::NewLC( KPhoneNumberEntryBufferSize );
|
|
1012 |
TPtr ptr( text->Des() );
|
|
1013 |
// Pre-populate the query with the number entry contents, if it exists
|
|
1014 |
if ( IsNumberEntryUsedL() )
|
|
1015 |
{
|
|
1016 |
// get the number entry contents
|
|
1017 |
TPhoneCmdParamString stringParam;
|
|
1018 |
stringParam.SetString( &ptr );
|
|
1019 |
iViewCommandHandle->ExecuteCommandL(
|
|
1020 |
EPhoneViewGetLocalizedNumberFromEntry,
|
|
1021 |
&stringParam );
|
|
1022 |
}
|
|
1023 |
|
|
1024 |
ShowDtmfTextQueryL(
|
|
1025 |
CPhoneMainResourceResolver::Instance()->
|
|
1026 |
ResolveResourceID( EPhoneDtmfNumberQuery ),
|
|
1027 |
CPhoneMainResourceResolver::Instance()->
|
|
1028 |
ResolveResourceID( EPhoneSendDtmfEmptyEditBoxCBA ),
|
|
1029 |
CPhoneMainResourceResolver::Instance()->
|
|
1030 |
ResolveResourceID( EPhoneSendDtmfNormalEditBoxCBA ),
|
|
1031 |
&ptr );
|
|
1032 |
CleanupStack::PopAndDestroy( text );
|
|
1033 |
}
|
|
1034 |
|
|
1035 |
// -----------------------------------------------------------
|
|
1036 |
// CPhoneStateInCall::LaunchDtmfListQueryL
|
|
1037 |
// -----------------------------------------------------------
|
|
1038 |
//
|
|
1039 |
void CPhoneStateInCall::LaunchDtmfListQueryL()
|
|
1040 |
{
|
|
1041 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
1042 |
"CPhoneStateInCall::LaunchDtmfListQueryL()" );
|
|
1043 |
|
|
1044 |
// Fetch active call's id from view
|
|
1045 |
TPhoneCmdParamCallStateData callStateData;
|
|
1046 |
callStateData.SetCallState( EPEStateConnected );
|
|
1047 |
iViewCommandHandle->HandleCommandL(
|
|
1048 |
EPhoneViewGetCallIdByState, &callStateData );
|
|
1049 |
|
|
1050 |
if ( callStateData.CallId() == KErrNotFound )
|
|
1051 |
{
|
|
1052 |
callStateData.SetCallState( EPEStateConnecting );
|
|
1053 |
iViewCommandHandle->HandleCommandL(
|
|
1054 |
EPhoneViewGetCallIdByState, &callStateData );
|
|
1055 |
}
|
|
1056 |
|
|
1057 |
if ( callStateData.CallId() > KErrNotFound )
|
|
1058 |
{
|
|
1059 |
//Get Array of DTMF strings from PhoneEngine
|
|
1060 |
const CDesCArray& dtmfArray =
|
|
1061 |
iStateMachine->PhoneEngineInfo()->
|
|
1062 |
RemotePredefinedDtmfStrings( callStateData.CallId() );
|
|
1063 |
|
|
1064 |
TInt itemCount = dtmfArray.Count();
|
|
1065 |
if ( itemCount )
|
|
1066 |
{
|
|
1067 |
|
|
1068 |
TPhoneCmdParamString stringParam;
|
|
1069 |
//Go through the array and send each dtmf string
|
|
1070 |
//to view.
|
|
1071 |
for ( TInt i=0; i<itemCount; i++ )
|
|
1072 |
{
|
|
1073 |
TPtrC16 ptrC16 = dtmfArray.MdcaPoint( i );
|
|
1074 |
HBufC* string = ptrC16.AllocL();
|
|
1075 |
CleanupStack::PushL( string );
|
|
1076 |
TPtr ptr( string->Des() );
|
|
1077 |
|
|
1078 |
stringParam.SetString( &ptr );
|
|
1079 |
iViewCommandHandle->ExecuteCommandL(
|
|
1080 |
EPhoneViewSetListQueryString,
|
|
1081 |
&stringParam );
|
|
1082 |
CleanupStack::PopAndDestroy( string );
|
|
1083 |
string = NULL;
|
|
1084 |
}
|
|
1085 |
}
|
|
1086 |
}
|
|
1087 |
else
|
|
1088 |
{
|
|
1089 |
__PHONELOG( EOnlyFatal, EPhoneControl,
|
|
1090 |
"CPhoneStateInCall::LaunchDtmfListQueryL() No found valid call id" );
|
|
1091 |
}
|
|
1092 |
|
|
1093 |
// if there is a connected call only then open DtmfListQuery.
|
|
1094 |
if ( IsAnyConnectedCalls() )
|
|
1095 |
{
|
|
1096 |
TPhoneCmdParamQuery queryDialogParam;
|
|
1097 |
queryDialogParam.SetQueryType( EPhoneDtmfListQueryDialog );
|
|
1098 |
queryDialogParam.SetQueryResourceId(
|
|
1099 |
CPhoneMainResourceResolver::Instance()->
|
|
1100 |
ResolveResourceID( EPhoneDtmfNumberListQuery ) );
|
|
1101 |
|
|
1102 |
// Display dialog
|
|
1103 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery,
|
|
1104 |
&queryDialogParam );
|
|
1105 |
}
|
|
1106 |
}
|
|
1107 |
|
|
1108 |
// -----------------------------------------------------------
|
|
1109 |
// CPhoneStateInCall::LaunchDtmfSearchDialogL
|
|
1110 |
// -----------------------------------------------------------
|
|
1111 |
//
|
|
1112 |
void CPhoneStateInCall::LaunchDtmfSearchDialogL()
|
|
1113 |
{
|
|
1114 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
1115 |
"CPhoneStateInCall::LaunchDtmfSearchDialogL()" );
|
|
1116 |
|
|
1117 |
TPhoneCmdParamInteger integerParam;
|
|
1118 |
integerParam.SetInteger( EPhoneDtmfNumberQuery );
|
|
1119 |
iViewCommandHandle->HandleCommandL( EPhoneViewOpenSingleItemFetchDialog, &integerParam );
|
|
1120 |
}
|
|
1121 |
|
|
1122 |
// -----------------------------------------------------------
|
|
1123 |
// CPhoneStateInCall::LaunchDtmfListViewSearchDialogL
|
|
1124 |
// -----------------------------------------------------------
|
|
1125 |
//
|
|
1126 |
void CPhoneStateInCall::LaunchDtmfListViewSearchDialogL()
|
|
1127 |
{
|
|
1128 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
1129 |
"CPhoneStateInCall::LaunchDtmfListViewSearchDialogL()" );
|
|
1130 |
|
|
1131 |
TPhoneCmdParamInteger integerParam;
|
|
1132 |
integerParam.SetInteger( EPhoneDtmfFetchTitle );
|
|
1133 |
iViewCommandHandle->HandleCommandL( EPhoneViewOpenSingleItemFetchDialog, &integerParam );
|
|
1134 |
}
|
|
1135 |
|
|
1136 |
// -----------------------------------------------------------
|
|
1137 |
// CPhoneStateInCall::LaunchNewCallSearchDialogL
|
|
1138 |
// -----------------------------------------------------------
|
|
1139 |
//
|
|
1140 |
void CPhoneStateInCall::LaunchNewCallSearchDialogL()
|
|
1141 |
{
|
|
1142 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
1143 |
"CPhoneStateInCall::LaunchNewCallSearchDialogL()" );
|
|
1144 |
|
|
1145 |
TPhoneCmdParamBoolean blockingDialogStatus;
|
|
1146 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetBlockingDialogStatus,
|
|
1147 |
&blockingDialogStatus );
|
|
1148 |
// Prevents unlegal use of singleitem fetch
|
|
1149 |
if ( !blockingDialogStatus.Boolean() )
|
|
1150 |
{
|
|
1151 |
|
|
1152 |
TPhoneCmdParamInteger integerParam;
|
|
1153 |
integerParam.SetInteger( EPhoneNewCallFetchTitle );
|
|
1154 |
iViewCommandHandle->HandleCommandL( EPhoneViewOpenSingleItemFetchDialog, &integerParam );
|
|
1155 |
}
|
|
1156 |
}
|
|
1157 |
|
|
1158 |
// ---------------------------------------------------------
|
|
1159 |
// CPhoneStateInCall::IsVideoCallActiveL
|
|
1160 |
// ---------------------------------------------------------
|
|
1161 |
//
|
|
1162 |
EXPORT_C TBool CPhoneStateInCall::IsVideoCallActiveL()
|
|
1163 |
{
|
|
1164 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
1165 |
"CPhoneStateInCall::IsVideoCallActive()" );
|
|
1166 |
TBool retVal = EFalse;
|
|
1167 |
// Fetch active call's id from view
|
|
1168 |
TPhoneCmdParamCallStateData callStateData;
|
|
1169 |
callStateData.SetCallState( EPEStateConnected );
|
|
1170 |
iViewCommandHandle->HandleCommandL(
|
|
1171 |
EPhoneViewGetCallIdByState, &callStateData );
|
|
1172 |
|
|
1173 |
if ( callStateData.CallId() > KErrNotFound )
|
|
1174 |
{
|
|
1175 |
retVal = IsVideoCall( callStateData.CallId() );
|
|
1176 |
}
|
|
1177 |
|
|
1178 |
return retVal;
|
|
1179 |
}
|
|
1180 |
|
|
1181 |
// ---------------------------------------------------------
|
|
1182 |
// CPhoneStateInCall::IsVideoCallRingingL
|
|
1183 |
// ---------------------------------------------------------
|
|
1184 |
//
|
|
1185 |
|
|
1186 |
EXPORT_C TBool CPhoneStateInCall::IsVideoCallRingingL()
|
|
1187 |
{
|
|
1188 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
1189 |
"CPhoneStateInCall::IsVideoCallRingingL()" );
|
|
1190 |
TBool retVal = EFalse;
|
|
1191 |
// Fetch ringing call id from view
|
|
1192 |
TPhoneCmdParamCallStateData callStateData;
|
|
1193 |
callStateData.SetCallState( EPEStateRinging );
|
|
1194 |
iViewCommandHandle->HandleCommandL(
|
|
1195 |
EPhoneViewGetCallIdByState, &callStateData );
|
|
1196 |
|
|
1197 |
if ( callStateData.CallId() > KErrNotFound )
|
|
1198 |
{
|
|
1199 |
retVal = IsVideoCall( callStateData.CallId() );
|
|
1200 |
}
|
|
1201 |
|
|
1202 |
return retVal;
|
|
1203 |
}
|
|
1204 |
|
|
1205 |
// ---------------------------------------------------------
|
|
1206 |
// CPhoneStateInCall::GetRingingCallL
|
|
1207 |
// ---------------------------------------------------------
|
|
1208 |
//
|
|
1209 |
|
|
1210 |
EXPORT_C TInt CPhoneStateInCall::GetRingingCallL()
|
|
1211 |
{
|
|
1212 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
1213 |
"CPhoneStateInCall::GetRingingCallL()" );
|
|
1214 |
|
|
1215 |
// Fetch ringing call id from view
|
|
1216 |
TPhoneCmdParamCallStateData callStateData;
|
|
1217 |
callStateData.SetCallState( EPEStateRinging );
|
|
1218 |
iViewCommandHandle->HandleCommandL(
|
|
1219 |
EPhoneViewGetCallIdByState, &callStateData );
|
|
1220 |
|
|
1221 |
return callStateData.CallId();
|
|
1222 |
}
|
|
1223 |
|
|
1224 |
// -----------------------------------------------------------
|
|
1225 |
// CPhoneStateInCall::DisconnectOutgoingCallL
|
|
1226 |
// -----------------------------------------------------------
|
|
1227 |
//
|
|
1228 |
EXPORT_C void CPhoneStateInCall::DisconnectOutgoingCallL()
|
|
1229 |
{
|
|
1230 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
1231 |
"CPhoneStateInCall::DisconnectOutgoingCallL()");
|
|
1232 |
// Fetch alerting call's id from view
|
|
1233 |
TPhoneCmdParamCallStateData callStateData;
|
|
1234 |
callStateData.SetCallState( EPEStateConnecting );
|
|
1235 |
iViewCommandHandle->HandleCommandL(
|
|
1236 |
EPhoneViewGetCallIdByState, &callStateData );
|
|
1237 |
|
|
1238 |
if( callStateData.CallId() == KErrNotFound )
|
|
1239 |
{
|
|
1240 |
// No connecting call, find the dialing call
|
|
1241 |
callStateData.SetCallState( EPEStateDialing );
|
|
1242 |
iViewCommandHandle->HandleCommandL(
|
|
1243 |
EPhoneViewGetCallIdByState, &callStateData );
|
|
1244 |
|
|
1245 |
if( callStateData.CallId() == KErrNotFound )
|
|
1246 |
{
|
|
1247 |
// No dialing call, find the disconnectinging call
|
|
1248 |
callStateData.SetCallState( EPEStateDisconnecting );
|
|
1249 |
iViewCommandHandle->HandleCommandL(
|
|
1250 |
EPhoneViewGetCallIdByState, &callStateData );
|
|
1251 |
}
|
|
1252 |
else
|
|
1253 |
{
|
|
1254 |
if ( IsNumberEntryUsedL() )
|
|
1255 |
{
|
|
1256 |
SetNumberEntryVisibilityL(ETrue);
|
|
1257 |
}
|
|
1258 |
}
|
|
1259 |
}
|
|
1260 |
|
|
1261 |
if( callStateData.CallId() > KErrNotFound )
|
|
1262 |
{
|
|
1263 |
// Release the call
|
|
1264 |
iStateMachine->SetCallId( callStateData.CallId() );
|
|
1265 |
iStateMachine->SendPhoneEngineMessage(
|
|
1266 |
MPEPhoneModel::EPEMessageRelease );
|
|
1267 |
}
|
|
1268 |
else
|
|
1269 |
{
|
|
1270 |
__PHONELOG( EOnlyFatal, EPhoneControl,
|
|
1271 |
"CPhoneStateInCall::DisconnectOutgoingCallL() has negative call id!" );
|
|
1272 |
__ASSERT_DEBUG( EFalse, Panic( EPhoneCtrlIndexOutOfBounds ) );
|
|
1273 |
}
|
|
1274 |
}
|
|
1275 |
|
|
1276 |
// -----------------------------------------------------------------------------
|
|
1277 |
// CPhoneStateInCall::LockKeysL
|
|
1278 |
// -----------------------------------------------------------------------------
|
|
1279 |
//
|
|
1280 |
void CPhoneStateInCall::LockKeypadL()
|
|
1281 |
{
|
|
1282 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
1283 |
"CPhoneStateInCall::LockKeypadL()");
|
|
1284 |
|
|
1285 |
if ( !FeatureManager::FeatureSupported( KFeatureIdKeypadNoSlider ) )
|
|
1286 |
{
|
|
1287 |
TInt state = KErrNone;
|
|
1288 |
TInt err = RProperty::Get(
|
|
1289 |
KPSUidHWRM,
|
|
1290 |
KHWRMGripStatus,
|
|
1291 |
state );
|
|
1292 |
if ( state == EPSHWRMGripOpen )
|
|
1293 |
{
|
|
1294 |
SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed );
|
|
1295 |
}
|
|
1296 |
else
|
|
1297 |
{
|
|
1298 |
iViewCommandHandle->ExecuteCommandL(
|
|
1299 |
EPhoneViewEnableKeyLock );
|
|
1300 |
}
|
|
1301 |
}
|
|
1302 |
else
|
|
1303 |
{
|
|
1304 |
iViewCommandHandle->ExecuteCommandL(
|
|
1305 |
EPhoneViewEnableKeyLock );
|
|
1306 |
}
|
|
1307 |
}
|
|
1308 |
|
|
1309 |
// -----------------------------------------------------------------------------
|
|
1310 |
// CPhoneStateInCall::HandleSuccessFetchedNumberL
|
|
1311 |
// -----------------------------------------------------------------------------
|
|
1312 |
//
|
|
1313 |
void CPhoneStateInCall::HandleSuccessFetchedNumberL()
|
|
1314 |
{
|
|
1315 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
1316 |
"CPhoneStateInCall::HandleSuccessFetchedNumberL()");
|
|
1317 |
TBuf<KPhoneNumberEntryBufferSize> fetchContent;
|
|
1318 |
fetchContent = iViewCommandHandle->FetchContent();
|
|
1319 |
|
|
1320 |
TPhoneCmdParamInteger fetchTypeParam;
|
|
1321 |
iViewCommandHandle->ExecuteCommand( EPhoneViewGetSingleItemFetchType,
|
|
1322 |
&fetchTypeParam );
|
|
1323 |
TInt fetchType( fetchTypeParam.Integer() );
|
|
1324 |
|
|
1325 |
if ( fetchType == EPhoneNewCallFetchTitle )
|
|
1326 |
{
|
|
1327 |
if ( iOnScreenDialer )
|
|
1328 |
{
|
|
1329 |
iViewCommandHandle->ExecuteCommandL(
|
|
1330 |
EPhoneViewSetNumberEntryContent,
|
|
1331 |
0,
|
|
1332 |
fetchContent );
|
|
1333 |
}
|
|
1334 |
// Call the fetched number
|
|
1335 |
CallFetchedNumberL( fetchContent );
|
|
1336 |
}
|
|
1337 |
else if ( fetchType == EPhoneDtmfFetchTitle )
|
|
1338 |
{
|
|
1339 |
// Send the DTMF
|
|
1340 |
iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( fetchContent );
|
|
1341 |
iStateMachine->SendPhoneEngineMessage(
|
|
1342 |
MPEPhoneModel::EPEMessageSendDTMF );
|
|
1343 |
}
|
|
1344 |
else if( iCustomization && fetchType > EPhoneRssBaseLast )
|
|
1345 |
{
|
|
1346 |
// Handle unattended transfer contact fetch
|
|
1347 |
iCustomization->HandleCommandL( fetchType );
|
|
1348 |
}
|
|
1349 |
else // EPhoneCmdDtmfSearch
|
|
1350 |
{
|
|
1351 |
// Send the DTMF
|
|
1352 |
iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( fetchContent );
|
|
1353 |
iStateMachine->SendPhoneEngineMessage(
|
|
1354 |
MPEPhoneModel::EPEMessageSendDTMF );
|
|
1355 |
}
|
|
1356 |
}
|
|
1357 |
|
|
1358 |
// -----------------------------------------------------------------------------
|
|
1359 |
// CPhoneStateInCall::HandleFailedFetchedNumberL
|
|
1360 |
// -----------------------------------------------------------------------------
|
|
1361 |
//
|
|
1362 |
void CPhoneStateInCall::HandleFailedFetchedNumberL()
|
|
1363 |
{
|
|
1364 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
1365 |
"CPhoneStateInCall::HandleFailedFetchedNumberL()");
|
|
1366 |
|
|
1367 |
TPhoneCmdParamInteger fetchTypeParam;
|
|
1368 |
iViewCommandHandle->ExecuteCommand( EPhoneViewGetSingleItemFetchType,
|
|
1369 |
&fetchTypeParam );
|
|
1370 |
TInt fetchType( fetchTypeParam.Integer() );
|
|
1371 |
|
|
1372 |
if ( fetchType == EPhoneNewCallFetchTitle )
|
|
1373 |
{
|
|
1374 |
HandleCommandL( EPhoneInCallCmdNewCall );
|
|
1375 |
}
|
|
1376 |
else if ( fetchType == EPhoneDtmfFetchTitle )
|
|
1377 |
{
|
|
1378 |
HandleCommandL( EPhoneInCallCmdDtmfListQuery );
|
|
1379 |
}
|
|
1380 |
else // EPhoneCmdDtmfSearch
|
|
1381 |
{
|
|
1382 |
HandleCommandL( EPhoneDtmfFetchTitle );
|
|
1383 |
}
|
|
1384 |
}
|
|
1385 |
|
|
1386 |
|
|
1387 |
// -----------------------------------------------------------------------------
|
|
1388 |
// CPhoneStateInCall::CloseDtmfQueryL
|
|
1389 |
// -----------------------------------------------------------------------------
|
|
1390 |
//
|
|
1391 |
EXPORT_C void CPhoneStateInCall::CloseDtmfQueryL()
|
|
1392 |
{
|
|
1393 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
1394 |
"CPhoneStateInCall::CloseDtmfQueryL()");
|
|
1395 |
TPhoneCmdParamInteger fetchTypeParam;
|
|
1396 |
iViewCommandHandle->ExecuteCommand( EPhoneViewGetSingleItemFetchType,
|
|
1397 |
&fetchTypeParam );
|
|
1398 |
TInt fetchType( fetchTypeParam.Integer() );
|
|
1399 |
|
|
1400 |
// If DTMF fetch is active then remove numberentry because it is considered
|
|
1401 |
// to be a part of DTMF fetch operation.
|
|
1402 |
if ( fetchType == EPhoneDtmfFetchTitle )
|
|
1403 |
{
|
|
1404 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
|
|
1405 |
iViewCommandHandle->ExecuteCommand( EPhoneViewCloseSingleItemFetchDialog );
|
|
1406 |
}
|
|
1407 |
|
|
1408 |
// Close dtmf dialer or dtmf query if exist.
|
|
1409 |
if ( IsDTMFEditorVisibleL() )
|
|
1410 |
{
|
|
1411 |
CloseDTMFEditorL();
|
|
1412 |
}
|
|
1413 |
}
|
|
1414 |
|
|
1415 |
// -----------------------------------------------------------
|
|
1416 |
// CPhoneStateInCall::PhoneNumberAvailableInPhoneEngineL
|
|
1417 |
// -----------------------------------------------------------
|
|
1418 |
//
|
|
1419 |
EXPORT_C void CPhoneStateInCall::PhoneNumberAvailableInPhoneEngineL( TInt aCallId )
|
|
1420 |
{
|
|
1421 |
__LOGMETHODSTARTEND( EPhoneControl, "CPhoneStateInCall::PhoneNumberAvailableInPhoneEngineL() ");
|
|
1422 |
TPhoneCmdParamBoolean phoneNumberAvailable;
|
|
1423 |
|
|
1424 |
const TBool contactInfoAvailable =
|
|
1425 |
iStateMachine->PhoneEngineInfo()->RemoteName( aCallId ).Length() ||
|
|
1426 |
iStateMachine->PhoneEngineInfo()->RemoteCompanyName( aCallId ).Length();
|
|
1427 |
|
|
1428 |
if( iStateMachine->PhoneEngineInfo()->RemotePhoneNumber( aCallId ).Length() ||
|
|
1429 |
contactInfoAvailable )
|
|
1430 |
{
|
|
1431 |
// Phone number is available straight or via contact info
|
|
1432 |
// so switch to video/voice call is possible
|
|
1433 |
__PHONELOG( EBasic, EPhoneControl, "CPhoneStateInCall::PhoneNumberAvailableInPhoneEngineL - Phonenumber is available" );
|
|
1434 |
phoneNumberAvailable.SetBoolean( ETrue );
|
|
1435 |
}
|
|
1436 |
else
|
|
1437 |
{
|
|
1438 |
__PHONELOG( EBasic, EPhoneControl, "CPhoneStateInCall::PhoneNumberAvailableInPhoneEngineL - Phonenumber is not available" );
|
|
1439 |
phoneNumberAvailable.SetBoolean( EFalse );
|
|
1440 |
}
|
|
1441 |
|
|
1442 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetPhoneNumberAvailableInPhoneEngine,
|
|
1443 |
&phoneNumberAvailable );
|
|
1444 |
}
|
|
1445 |
|
|
1446 |
|
|
1447 |
// -----------------------------------------------------------------------------
|
|
1448 |
// CPhoneStateInCall::HandleEndKeyPressL
|
|
1449 |
// -----------------------------------------------------------------------------
|
|
1450 |
//
|
|
1451 |
void CPhoneStateInCall::HandleEndKeyPressL( TPhoneKeyEventMessages aMessage )
|
|
1452 |
{
|
|
1453 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
1454 |
"CPhoneStateInCall::HandleEndKeyPressL()");
|
|
1455 |
// handle long press of end key
|
|
1456 |
if ( aMessage == EPhoneKeyLongPress )
|
|
1457 |
{
|
|
1458 |
// Fetch active call's id from view
|
|
1459 |
TPhoneCmdParamCallStateData callStateData;
|
|
1460 |
callStateData.SetCallState( EPEStateConnected );
|
|
1461 |
iViewCommandHandle->HandleCommandL(
|
|
1462 |
EPhoneViewGetCallIdByState, &callStateData );
|
|
1463 |
|
|
1464 |
if( IsVideoCall( callStateData.CallId() ) )
|
|
1465 |
{
|
|
1466 |
// Video call can be released only after we get response to VT Shutdown Command
|
|
1467 |
CPhoneMediatorFactory::Instance()->Sender()->IssueCommand(
|
|
1468 |
KMediatorVideoTelephonyDomain,
|
|
1469 |
KCatPhoneToVideotelCommands,
|
|
1470 |
EVtCmdReleaseDataport,
|
|
1471 |
TVersion( KPhoneToVideotelCmdVersionMajor,
|
|
1472 |
KPhoneToVideotelCmdVersionMinor,
|
|
1473 |
KPhoneToVideotelCmdVersionBuild ),
|
|
1474 |
KNullDesC8,
|
|
1475 |
CPhoneTerminateAllConnectionsCommand::NewL( *iStateMachine ) );
|
|
1476 |
}
|
|
1477 |
else
|
|
1478 |
{
|
|
1479 |
// Close all connections
|
|
1480 |
iStateMachine->SendPhoneEngineMessage(
|
|
1481 |
MPEPhoneModel::EPEMessageTerminateAllConnections );
|
|
1482 |
|
|
1483 |
if ( IsNumberEntryContentStored() )
|
|
1484 |
{
|
|
1485 |
ClearNumberEntryContentCache();
|
|
1486 |
}
|
|
1487 |
}
|
|
1488 |
|
|
1489 |
if ( IsNumberEntryUsedL() )
|
|
1490 |
{
|
|
1491 |
if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
|
|
1492 |
{
|
|
1493 |
CloseDTMFEditorL();
|
|
1494 |
}
|
|
1495 |
else
|
|
1496 |
{
|
|
1497 |
BeginTransEffectLC( ENumberEntryClose );
|
|
1498 |
// Remove number entry from screen
|
|
1499 |
iViewCommandHandle->ExecuteCommandL(
|
|
1500 |
EPhoneViewRemoveNumberEntry );
|
|
1501 |
EndTransEffect();
|
|
1502 |
// Do state-specific operation when number entry is cleared
|
|
1503 |
HandleNumberEntryClearedL();
|
|
1504 |
}
|
|
1505 |
}
|
|
1506 |
|
|
1507 |
if ( !TopAppIsDisplayedL() )
|
|
1508 |
{
|
|
1509 |
// Bring app to foreground
|
|
1510 |
TPhoneCmdParamInteger uidParam;
|
|
1511 |
uidParam.SetInteger( KUidPhoneApplication.iUid );
|
|
1512 |
iViewCommandHandle->ExecuteCommandL(
|
|
1513 |
EPhoneViewBringAppToForeground, &uidParam );
|
|
1514 |
}
|
|
1515 |
}
|
|
1516 |
else
|
|
1517 |
{
|
|
1518 |
if ( IsNumberEntryUsedL() )
|
|
1519 |
{
|
|
1520 |
if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
|
|
1521 |
{
|
|
1522 |
CloseDTMFEditorL();
|
|
1523 |
}
|
|
1524 |
}
|
|
1525 |
|
|
1526 |
// handle short end key
|
|
1527 |
CPhoneState::DisconnectCallL();
|
|
1528 |
}
|
|
1529 |
}
|
|
1530 |
|
|
1531 |
// -----------------------------------------------------------------------------
|
|
1532 |
// CPhoneStateInCall::HandleVoiceKeyPressL
|
|
1533 |
// -----------------------------------------------------------------------------
|
|
1534 |
//
|
|
1535 |
void CPhoneStateInCall::HandleVoiceKeyPressL( TPhoneKeyEventMessages aMessage )
|
|
1536 |
{
|
|
1537 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
1538 |
"CPhoneStateInCall::HandleVoiceKeyPressL()");
|
|
1539 |
if ( aMessage == EPhoneKeyShortPress )
|
|
1540 |
{
|
|
1541 |
// Toggle the handsfree mode
|
|
1542 |
const TBool handsfreeMode =
|
|
1543 |
iStateMachine->PhoneEngineInfo()->AudioOutput() ==
|
|
1544 |
EPELoudspeaker;
|
|
1545 |
SetHandsfreeModeL( !handsfreeMode );
|
|
1546 |
}
|
|
1547 |
else // aMessage == EPhoneKeyLongPress
|
|
1548 |
{
|
|
1549 |
// Display call in progress information note
|
|
1550 |
SendGlobalInfoNoteL( EPhoneCallInProgress );
|
|
1551 |
}
|
|
1552 |
}
|
|
1553 |
|
|
1554 |
// -----------------------------------------------------------
|
|
1555 |
// CPhoneStateInCall::ShowDtmfTextQueryL
|
|
1556 |
// -----------------------------------------------------------
|
|
1557 |
//
|
|
1558 |
void CPhoneStateInCall::ShowDtmfTextQueryL(
|
|
1559 |
TInt aDialogResourceId,
|
|
1560 |
TInt aDefaultCbaResourceId,
|
|
1561 |
TInt aContentCbaResourceId,
|
|
1562 |
TDes* aDataText,
|
|
1563 |
TBool aSendKeyEnabled )
|
|
1564 |
{
|
|
1565 |
__LOGMETHODSTARTEND(EPhoneControl,
|
|
1566 |
"CPhoneStateInCall::ShowDtmfTextQueryL()");
|
|
1567 |
|
|
1568 |
__ASSERT_DEBUG( aDialogResourceId &&
|
|
1569 |
aDefaultCbaResourceId &&
|
|
1570 |
aContentCbaResourceId &&
|
|
1571 |
aDataText,
|
|
1572 |
Panic( EPhoneCtrlParameterNotInitialized ) );
|
|
1573 |
TPhoneCmdParamQuery queryDialogParam;
|
|
1574 |
queryDialogParam.SetQueryType( EPhoneDtmfTextQuery );
|
|
1575 |
queryDialogParam.SetQueryResourceId( aDialogResourceId );
|
|
1576 |
queryDialogParam.SetDefaultCba( aDefaultCbaResourceId );
|
|
1577 |
queryDialogParam.SetContentCba( aContentCbaResourceId );
|
|
1578 |
queryDialogParam.SetDataText( aDataText );
|
|
1579 |
queryDialogParam.SetSendKeyEnabled( aSendKeyEnabled );
|
|
1580 |
|
|
1581 |
// Display dialog
|
|
1582 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery,
|
|
1583 |
&queryDialogParam );
|
|
1584 |
}
|
|
1585 |
|
|
1586 |
// End of File
|