author | William Roberts <williamr@symbian.org> |
Wed, 15 Sep 2010 17:56:16 +0100 | |
changeset 68 | 82f96d64ae88 |
parent 56 | 5bcb308bd24d |
child 65 | 2a5d4ab426d3 |
permissions | -rw-r--r-- |
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" |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
37 |
#include "tphonecmdparamkeycapture.h" |
37 | 38 |
#include "tphonecmdparamsfidata.h" |
39 |
#include "mphonestatemachine.h" |
|
40 |
#include "phonestatedefinitions.h" |
|
41 |
#include "phoneviewcommanddefinitions.h" |
|
42 |
#include "phoneui.hrh" |
|
43 |
#include "phonerssbase.h" |
|
44 |
#include "cphonemainresourceresolver.h" |
|
45 |
#include "phonelogger.h" |
|
46 |
#include "phoneui.pan" |
|
47 |
#include "cphonepubsubproxy.h" |
|
48 |
#include "cphonedtmfwaitchartimer.h" |
|
49 |
#include "tphonecmdparamcallheaderdata.h" |
|
50 |
#include "cphonemediatorfactory.h" |
|
51 |
#include "cphonemediatorsender.h" |
|
52 |
#include "cphoneterminateallconnectionscommand.h" |
|
53 |
#include "mphonecustomization.h" |
|
54 |
||
55 |
// ================= MEMBER FUNCTIONS ======================= |
|
56 |
||
57 |
// C++ default constructor can NOT contain any code, that |
|
58 |
// might leave. |
|
59 |
// |
|
60 |
EXPORT_C CPhoneStateInCall::CPhoneStateInCall( |
|
61 |
MPhoneStateMachine* aStateMachine, |
|
62 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
63 |
MPhoneCustomization* aCustomization ) : |
|
64 |
CPhoneState( aStateMachine, aViewCommandHandle, aCustomization ), |
|
65 |
iDtmfWaitCharTimer( NULL ) |
|
66 |
{ |
|
67 |
} |
|
68 |
||
69 |
// ----------------------------------------------------------- |
|
70 |
// CPhoneStateInCall::~CPhoneStateInCall() |
|
71 |
// Destructor |
|
72 |
// (other items were commented in a header). |
|
73 |
// ----------------------------------------------------------- |
|
74 |
// |
|
75 |
EXPORT_C CPhoneStateInCall::~CPhoneStateInCall() |
|
76 |
{ |
|
77 |
if( iDtmfWaitCharTimer ) |
|
78 |
{ |
|
79 |
delete iDtmfWaitCharTimer; |
|
80 |
} |
|
81 |
} |
|
82 |
||
83 |
// ----------------------------------------------------------- |
|
84 |
// CPhoneStateInCall::ConstructL() |
|
85 |
// Constructor |
|
86 |
// (other items were commented in a header). |
|
87 |
// ----------------------------------------------------------- |
|
88 |
// |
|
89 |
EXPORT_C void CPhoneStateInCall::ConstructL() |
|
90 |
{ |
|
91 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
92 |
Panic( EPhoneCtrlInvariant ) ); |
|
93 |
CPhoneState::BaseConstructL(); |
|
94 |
} |
|
95 |
||
96 |
// ----------------------------------------------------------- |
|
97 |
// CPhoneStateInCall::NewL() |
|
98 |
// Constructor |
|
99 |
// (other items were commented in a header). |
|
100 |
// ----------------------------------------------------------- |
|
101 |
// |
|
102 |
CPhoneStateInCall* CPhoneStateInCall::NewL( |
|
103 |
MPhoneStateMachine* aStateMachine, |
|
104 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
105 |
MPhoneCustomization* aPhoneCustomization ) |
|
106 |
{ |
|
107 |
CPhoneStateInCall* self = new (ELeave) CPhoneStateInCall( |
|
108 |
aStateMachine, aViewCommandHandle, aPhoneCustomization ); |
|
109 |
||
110 |
CleanupStack::PushL( self ); |
|
111 |
self->ConstructL(); |
|
112 |
CleanupStack::Pop( self ); |
|
113 |
||
114 |
return self; |
|
115 |
} |
|
116 |
||
117 |
// ----------------------------------------------------------- |
|
118 |
// CPhoneStateInCall::HandleKeyMessageL |
|
119 |
// ----------------------------------------------------------- |
|
120 |
// |
|
121 |
EXPORT_C void CPhoneStateInCall::HandleKeyMessageL( |
|
122 |
TPhoneKeyEventMessages aMessage, |
|
123 |
TKeyCode aCode ) |
|
124 |
{ |
|
125 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
126 |
"CPhoneStateInCall::HandleKeyMessageL()" ); |
|
127 |
switch ( aCode ) |
|
128 |
{ |
|
129 |
// end-key |
|
130 |
case EKeyNo: |
|
131 |
HandleEndKeyPressL( aMessage ); |
|
132 |
break; |
|
133 |
||
134 |
// Voice key |
|
135 |
case EKeyDevice6: |
|
136 |
HandleVoiceKeyPressL( aMessage ); |
|
137 |
break; |
|
138 |
||
139 |
#ifdef RD_INTELLIGENT_TEXT_INPUT |
|
140 |
case EKeyEnter: |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
141 |
if ( IsNumberEntryVisibleL() ) |
37 | 142 |
{ |
143 |
HandleCommandL( EPhoneCmdOptions ); |
|
144 |
} |
|
145 |
break; |
|
146 |
#endif |
|
147 |
||
148 |
default: |
|
149 |
break; |
|
150 |
} |
|
151 |
} |
|
152 |
||
153 |
// ----------------------------------------------------------- |
|
154 |
// CPhoneStateInCall::HandleNumberEntryClearedL() |
|
155 |
// ----------------------------------------------------------- |
|
156 |
// |
|
157 |
EXPORT_C void CPhoneStateInCall::HandleNumberEntryClearedL() |
|
158 |
{ |
|
159 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
160 |
"CPhoneStateInCall::HandleNumberEntryClearedL()" ); |
|
161 |
// Update single call CBA when number entry is cleared |
|
162 |
UpdateInCallCbaL(); |
|
163 |
} |
|
164 |
||
165 |
// ----------------------------------------------------------- |
|
166 |
// CPhoneStateInCall::HandlePhoneEngineMessageL |
|
167 |
// ----------------------------------------------------------- |
|
168 |
// |
|
169 |
EXPORT_C void CPhoneStateInCall::HandlePhoneEngineMessageL( |
|
170 |
const TInt aMessage, |
|
171 |
TInt aCallId ) |
|
172 |
{ |
|
173 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
174 |
"CPhoneStateInCall::HandlePhoneEngineMessageL()" ); |
|
175 |
switch ( aMessage ) |
|
176 |
{ |
|
177 |
case MEngineMonitor::EPEMessageIdle: |
|
178 |
HandleIdleL( aCallId ); |
|
179 |
break; |
|
180 |
||
181 |
case MEngineMonitor::EPEMessageAudioMuteChanged: |
|
182 |
HandleAudioMuteChangedL(); |
|
183 |
break; |
|
184 |
||
185 |
case MEngineMonitor::EPEMessageAudioOutputChanged: |
|
186 |
HandleAudioOutputChangedL(); |
|
187 |
break; |
|
188 |
||
189 |
case MEngineMonitor::EPEMessageSendingDTMF: |
|
190 |
case MEngineMonitor::EPEMessageContinuingDTMFSending: |
|
191 |
HandleSendingDTMFL(); |
|
192 |
break; |
|
193 |
||
194 |
case MEngineMonitor::EPEMessageStoppedDTMF: |
|
195 |
HandleStoppedDTMFL(); |
|
196 |
break; |
|
197 |
||
198 |
case MEngineMonitor::EPEMessageSentDTMF: |
|
199 |
case MEngineMonitor::EPEMessageDTMFSendingAborted: |
|
200 |
CancelDTMFSendingL(); |
|
201 |
break; |
|
202 |
||
203 |
case MEngineMonitor::EPEMessageAudioVolumeChanged: |
|
204 |
HandleAudioVolumeChangedL(); |
|
205 |
break; |
|
206 |
||
207 |
case MEngineMonitor::EPEMessageDisconnecting: |
|
208 |
CancelDTMFSendingL(); |
|
209 |
if ( !CPhoneState::IsAnyConnectedCalls() ) |
|
210 |
{ |
|
211 |
CloseDtmfQueryL(); |
|
212 |
} |
|
213 |
CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId ); |
|
214 |
break; |
|
215 |
||
216 |
case MEngineMonitor::EPEMessageInValidEmergencyNumber: |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
217 |
SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed, ETrue ); |
37 | 218 |
break; |
219 |
||
220 |
case MEngineMonitor::EPEMessageValidEmergencyNumber: |
|
221 |
DialVoiceCallL(); |
|
222 |
break; |
|
223 |
||
224 |
case MEngineMonitor::EPEMessageRemotePartyInfoChanged: |
|
225 |
// If there is a waiting call then update header and label |
|
226 |
// else forward message to CPhoneState. |
|
227 |
if ( IsWaitingCallL( aCallId ) ) |
|
228 |
{ |
|
229 |
// Update remote info data and label. |
|
230 |
UpdateRemoteInfoDataAndLabelL( aCallId, UpdateCallHeaderInfoL( aCallId ) ); |
|
231 |
} |
|
232 |
else |
|
233 |
{ |
|
234 |
CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId ); |
|
235 |
} |
|
236 |
break; |
|
237 |
||
238 |
default: |
|
239 |
CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId ); |
|
240 |
break; |
|
241 |
} |
|
242 |
} |
|
243 |
||
244 |
// ----------------------------------------------------------- |
|
245 |
// CPhoneStateInCall::UpdateRemoteInfoDataAndLabelL |
|
246 |
// ----------------------------------------------------------- |
|
247 |
// |
|
248 |
void CPhoneStateInCall::UpdateRemoteInfoDataAndLabelL( |
|
249 |
TInt aCallId, |
|
250 |
TPhoneCmdParamCallHeaderData aCallHeaderParam ) |
|
251 |
{ |
|
252 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
253 |
"CPhoneStateInCall::UpdateRemoteInfoDataAndLabelL ()" ); |
|
254 |
// Update the remote info data in the call header |
|
255 |
iViewCommandHandle->ExecuteCommandL( |
|
256 |
EPhoneViewUpdateCallHeaderRemoteInfoDataAndLabel, |
|
257 |
aCallId, |
|
258 |
&aCallHeaderParam ); |
|
259 |
} |
|
260 |
||
261 |
// ----------------------------------------------------------- |
|
262 |
// CPhoneStateInCall::HandleIdleL |
|
263 |
// ----------------------------------------------------------- |
|
264 |
// |
|
265 |
EXPORT_C void CPhoneStateInCall::HandleIdleL( TInt aCallId ) |
|
266 |
{ |
|
267 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
268 |
"CPhoneStateInCall::HandleIdleL()" ); |
|
269 |
__ASSERT_DEBUG( aCallId >= 0, Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
270 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
271 |
TBool showDialer( EFalse ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
272 |
HBufC *phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
273 |
TPtr ptr( phoneNumber->Des() ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
274 |
TPhoneCmdParamString stringParam; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
275 |
stringParam.SetString( &ptr ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
276 |
|
37 | 277 |
// Remove call |
278 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
|
279 |
||
280 |
//Make sure that toolbar is not shown |
|
281 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewHideToolbar ); |
|
282 |
BeginUiUpdateLC(); |
|
283 |
SetDefaultFlagsL(); |
|
284 |
if ( IsNumberEntryUsedL() ) |
|
285 |
{ |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
286 |
iViewCommandHandle->ExecuteCommand( |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
287 |
EPhoneViewGetNumberFromEntry, |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
288 |
&stringParam ); |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
289 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
290 |
showDialer = ETrue; |
37 | 291 |
} |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
292 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
293 |
if ( !TopAppIsDisplayedL() || IsAutoLockOn() ) |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
294 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
295 |
// Continue displaying current app but set up the |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
296 |
// idle screen in the background |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
297 |
SetupIdleScreenInBackgroundL(); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
298 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
299 |
else if ( showDialer ) |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
300 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
301 |
// Open dialer |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
302 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewLaunchLogs, &stringParam ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
303 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
304 |
else |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
305 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
306 |
// Display idle screen and update CBAs |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
307 |
DisplayIdleScreenL(); |
37 | 308 |
} |
309 |
||
310 |
DeleteTouchPaneButtons(); |
|
311 |
EndUiUpdate(); |
|
312 |
// Display call termination note, if necessary |
|
313 |
DisplayCallTerminationNoteL(); |
|
314 |
||
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
315 |
TPhoneCmdParamKeyCapture captureParam; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
316 |
captureParam.SetKeyCode( EKeyNo ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
317 |
iViewCommandHandle->ExecuteCommand( EPhoneViewStopCapturingKey, &captureParam ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
318 |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
319 |
CleanupStack::PopAndDestroy( phoneNumber ); |
37 | 320 |
// Go to idle state |
321 |
iStateMachine->ChangeState( EPhoneStateIdle ); |
|
322 |
} |
|
323 |
||
324 |
// ----------------------------------------------------------- |
|
325 |
// CPhoneStateInCall::UpdateInCallCbaL |
|
326 |
// ----------------------------------------------------------- |
|
327 |
// |
|
328 |
EXPORT_C void CPhoneStateInCall::UpdateInCallCbaL() |
|
329 |
{ |
|
330 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateInCall::UpdateInCallCbaL() "); |
|
331 |
UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
|
332 |
} |
|
333 |
||
334 |
// ----------------------------------------------------------- |
|
335 |
// CPhoneStateInCall::UpdateCbaL |
|
336 |
// ----------------------------------------------------------- |
|
337 |
// |
|
338 |
EXPORT_C void CPhoneStateInCall::UpdateCbaL( TInt aResource ) |
|
339 |
{ |
|
340 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateInCall::UpdateCbaL() "); |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
341 |
iCbaManager->UpdateCbaL( aResource ); |
37 | 342 |
} |
343 |
||
344 |
// ----------------------------------------------------------- |
|
345 |
// CPhoneStateInCall::HandleAudioMuteChangedL |
|
346 |
// ----------------------------------------------------------- |
|
347 |
// |
|
348 |
void CPhoneStateInCall::HandleAudioMuteChangedL() |
|
349 |
{ |
|
350 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
351 |
"CPhoneStateInCall::HandleAudioMuteChangedL()" ); |
|
352 |
CPhoneState::HandleAudioMuteChangedL(); |
|
353 |
||
354 |
// Update the single call CBA only if the number entry is not |
|
355 |
// used |
|
356 |
if ( !IsNumberEntryUsedL() ) |
|
357 |
{ |
|
358 |
// Go to current state implementation |
|
359 |
UpdateInCallCbaL(); |
|
360 |
} |
|
361 |
} |
|
362 |
||
363 |
// ----------------------------------------------------------- |
|
364 |
// CPhoneStateInCall::HandleAudioOutputChangedL |
|
365 |
// ----------------------------------------------------------- |
|
366 |
// |
|
367 |
void CPhoneStateInCall::HandleAudioOutputChangedL() |
|
368 |
{ |
|
369 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
370 |
"CPhoneStateInCall::HandleAudioOutputChangedL()" ); |
|
371 |
// Handle the handsfree mode change |
|
372 |
CPhoneState::HandleAudioOutputChangedL(); |
|
373 |
||
374 |
// Update the single call CBA only if the number entry is not |
|
375 |
// used |
|
376 |
if ( !IsNumberEntryVisibleL() ) |
|
377 |
{ |
|
378 |
// Go to current state implementation |
|
379 |
UpdateInCallCbaL(); |
|
380 |
} |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
381 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
382 |
SetTouchPaneButtons(0); |
37 | 383 |
} |
384 |
||
385 |
// ----------------------------------------------------------- |
|
386 |
// CPhoneStateInCall::HandleAudioVolumeChangedL |
|
387 |
// ----------------------------------------------------------- |
|
388 |
// |
|
389 |
void CPhoneStateInCall::HandleAudioVolumeChangedL() |
|
390 |
{ |
|
391 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
392 |
"CPhoneStateInCall::HandleAudioVolumeChangedL()" ); |
|
393 |
// Update the volume display |
|
394 |
TInt audioVolume = iStateMachine->PhoneEngineInfo()->AudioVolume(); |
|
395 |
TPhoneCmdParamInteger volumeParam; |
|
396 |
volumeParam.SetInteger( audioVolume ); |
|
397 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetNaviPaneAudioVolume, |
|
398 |
&volumeParam ); |
|
399 |
} |
|
400 |
||
401 |
// ----------------------------------------------------------- |
|
402 |
// CPhoneStateInCall::HandleSendingDTMFL |
|
403 |
// ----------------------------------------------------------- |
|
404 |
// |
|
405 |
void CPhoneStateInCall::HandleSendingDTMFL() |
|
406 |
{ |
|
407 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
408 |
"CPhoneStateInCall::HandleSendingDTMFL()" ); |
|
409 |
TPhoneCmdParamNote noteParam; |
|
410 |
noteParam.SetType( EPhoneNoteDtmfSending ); |
|
411 |
noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()-> |
|
412 |
ResolveResourceID( EPhoneSendingDtmfWaitNote ) ); |
|
413 |
||
414 |
// Show the "Sending..." Wait Note, and pre-populate it |
|
415 |
// with the PhoneEngine's current DTMF String. |
|
416 |
// Set the text for the wait-note. |
|
417 |
TPEDtmfString dtmfString = iStateMachine->PhoneEngineInfo()->DtmfString(); |
|
418 |
HBufC* noteText = StringLoader::LoadLC( |
|
419 |
CPhoneMainResourceResolver::Instance()-> |
|
420 |
ResolveResourceID( EPhoneSendingDtmfWaitNoteText ), |
|
421 |
dtmfString ); |
|
422 |
noteParam.SetText( *noteText ); |
|
423 |
||
424 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, ¬eParam ); |
|
425 |
||
426 |
CleanupStack::PopAndDestroy( noteText ); |
|
427 |
} |
|
428 |
||
429 |
// ----------------------------------------------------------- |
|
430 |
// CPhoneStateInCall::HandleStoppedDTMFL |
|
431 |
// ----------------------------------------------------------- |
|
432 |
// |
|
433 |
void CPhoneStateInCall::HandleStoppedDTMFL() |
|
434 |
{ |
|
435 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
436 |
"CPhoneStateInCall::HandleStoppedDTMFL()" ); |
|
437 |
// Remove the Sending... note |
|
438 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
|
439 |
||
440 |
// Fetch the remaining (unparsed) portion of the DTMF String |
|
441 |
// from PhoneEngine |
|
442 |
TPEDtmfString dtmfString = iStateMachine->PhoneEngineInfo()->DtmfString(); |
|
443 |
||
444 |
if ( dtmfString.Length() ) |
|
445 |
{ |
|
446 |
// Show the DTMF Wait Character confirmation query |
|
447 |
TPhoneCmdParamQuery queryParam; |
|
448 |
queryParam.SetQueryType( EPhoneQueryDialog ); |
|
449 |
queryParam.SetQueryResourceId( |
|
450 |
CPhoneMainResourceResolver::Instance()->ResolveResourceID( |
|
451 |
EPhoneDtmfWaitCharacterConfirmationQuery ) ); |
|
452 |
||
453 |
// Append the PhoneEngine's current DTMF String to the query's prompt |
|
454 |
HBufC* queryPrompt = StringLoader::LoadLC( |
|
455 |
CPhoneMainResourceResolver::Instance()->ResolveResourceID( |
|
456 |
EPhoneDtmfWaitCharacterConfirmationQueryText ), |
|
457 |
dtmfString ); |
|
458 |
queryParam.SetQueryPrompt( *queryPrompt ); |
|
459 |
||
460 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery, |
|
461 |
&queryParam ); |
|
462 |
||
463 |
CleanupStack::PopAndDestroy( queryPrompt ); |
|
464 |
} |
|
465 |
else |
|
466 |
{ |
|
467 |
// Stop the asynchronous sending operation the |
|
468 |
// PhoneEngine may be performing. |
|
469 |
iStateMachine->SendPhoneEngineMessage( |
|
470 |
MPEPhoneModel::EPEMessageStopDTMFSending ); |
|
471 |
||
472 |
// Prompt for more characters by showing DTMF query with empty string |
|
473 |
HBufC* emptyString = HBufC::NewLC( KPhoneNumberEntryBufferSize ); |
|
474 |
TPtr ptr( emptyString->Des() ); |
|
475 |
||
476 |
ShowDtmfTextQueryL( |
|
477 |
CPhoneMainResourceResolver::Instance()-> |
|
478 |
ResolveResourceID( EPhoneDtmfNumberQuery ), |
|
479 |
CPhoneMainResourceResolver::Instance()-> |
|
480 |
ResolveResourceID( EPhoneSendDtmfEmptyEditBoxCBA ), |
|
481 |
CPhoneMainResourceResolver::Instance()-> |
|
482 |
ResolveResourceID( EPhoneSendDtmfNormalEditBoxCBA ), |
|
483 |
&ptr ); |
|
484 |
||
485 |
CleanupStack::PopAndDestroy( emptyString ); |
|
486 |
} |
|
487 |
} |
|
488 |
||
489 |
// ----------------------------------------------------------- |
|
490 |
// CPhoneStateInCall::CancelDTMFSendingL |
|
491 |
// ----------------------------------------------------------- |
|
492 |
// |
|
493 |
void CPhoneStateInCall::CancelDTMFSendingL() |
|
494 |
{ |
|
495 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
496 |
"CPhoneStateInCall::CancelDTMFSendingL()" ); |
|
497 |
// Remove the Sending... note |
|
498 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveDtmfNote ); |
|
499 |
} |
|
500 |
||
501 |
// ----------------------------------------------------------- |
|
502 |
// CPhoneStateInCall::HandleCommandL |
|
503 |
// ----------------------------------------------------------- |
|
504 |
// |
|
505 |
EXPORT_C TBool CPhoneStateInCall::HandleCommandL( TInt aCommand ) |
|
506 |
{ |
|
507 |
__LOGMETHODSTARTEND( EPhoneControl, |
|
508 |
"CPhoneStateInCall::HandleCommandL()" ); |
|
509 |
__PHONELOG1 ( EBasic, EPhoneControl, |
|
510 |
"CPhoneStateInCall::HandleCommandL() - aCommand = %d ", aCommand ); |
|
511 |
TBool commandStatus = ETrue; |
|
512 |
||
513 |
switch( aCommand ) |
|
514 |
{ |
|
515 |
case EPhoneInCallCmdDialer: |
|
516 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewOpenDialer ); |
|
517 |
break; |
|
518 |
case EPhoneCmdOptions: |
|
519 |
break; |
|
520 |
||
521 |
case EPhoneDtmfDialerCancel: |
|
522 |
{ |
|
523 |
// Activate DTMF list query when cancel is pressed. |
|
524 |
// Forwards command to the framework |
|
525 |
HandleCommandL( EPhoneInCallCmdDtmfListQuery ); |
|
526 |
} |
|
527 |
break; |
|
528 |
case EPhoneDtmfDialerExit: |
|
529 |
{ |
|
530 |
} |
|
531 |
break; |
|
532 |
||
533 |
case EPhoneInCallCmdEndThisActiveCall: |
|
534 |
CPhoneState::DisconnectCallL(); |
|
535 |
break; |
|
536 |
||
537 |
case EPhoneCallComingCmdReject: // fall through |
|
538 |
case EPhoneInCallCmdReject: |
|
539 |
iStateMachine->SendPhoneEngineMessage( |
|
540 |
MPEPhoneModel::EPEMessageReject ); |
|
541 |
break; |
|
542 |
||
543 |
case EPhoneInCallCmdMute: // fall through |
|
544 |
case EPhoneInCallCmdUnmute: |
|
545 |
iStateMachine->PhoneEngineInfo()->SetAudioMuteCommand( |
|
546 |
( aCommand == EPhoneInCallCmdMute ) ); |
|
547 |
iStateMachine->SendPhoneEngineMessage( |
|
548 |
MPEPhoneModel::EPEMessageSetAudioMute ); |
|
549 |
break; |
|
550 |
//DTMF list query - dialog |
|
551 |
case EPhoneInCallCmdDtmfListQuery: |
|
552 |
LaunchDtmfListQueryL(); |
|
553 |
break; |
|
554 |
||
555 |
//DTMF list query - Search |
|
556 |
case EPhoneInCallCmdDtmfListViewSearch: |
|
557 |
break; |
|
558 |
||
559 |
//DTMF manual entry |
|
560 |
case EPhoneInCallCmdDtmfManualQuery: |
|
561 |
break; |
|
562 |
||
563 |
// DTMF manual entry - Search |
|
564 |
case EPhoneCmdDtmfSearch: |
|
565 |
break; |
|
566 |
||
567 |
// DTMF entry - Ok |
|
568 |
case EPhoneCmdDtmfOk: |
|
569 |
SendDtmfL(); |
|
570 |
break; |
|
571 |
||
572 |
// DTMF sending - Cancel |
|
573 |
case EPhoneInCallCmdCancelSendingDtmfString: |
|
574 |
// Stop the asynchronous sending operation the |
|
575 |
// PhoneEngine may be performing. |
|
576 |
iStateMachine->SendPhoneEngineMessage( |
|
577 |
MPEPhoneModel::EPEMessageStopDTMFSending ); |
|
578 |
// Remove DTMF sending from screen |
|
579 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
|
580 |
break; |
|
581 |
||
582 |
// DTMF wait - Ok |
|
583 |
case EPhoneInCallCmdContinueSendingDtmfString: |
|
584 |
// Continue sending the DTMF string |
|
585 |
if( !iDtmfWaitCharTimer ) |
|
586 |
{ |
|
587 |
iDtmfWaitCharTimer = CPhoneDtmfWaitCharTimer::NewL( |
|
588 |
iStateMachine ); |
|
589 |
} |
|
590 |
iDtmfWaitCharTimer->ButtonPressedL(); |
|
591 |
break; |
|
592 |
||
593 |
// New Call - Search |
|
594 |
case EPhoneInCallCmdNewCallFind: |
|
595 |
break; |
|
596 |
||
597 |
// New Call - Dialog |
|
598 |
case EPhoneInCallCmdNewCall: |
|
599 |
break; |
|
600 |
||
601 |
case EPhoneNumberAcqCmdCall: |
|
602 |
case EPhoneNumberAcqCmdSendCommand: |
|
603 |
if ( IsVideoCallActiveL() ) |
|
604 |
{ |
|
605 |
// Get the number entry contents |
|
606 |
HBufC *phoneNumber = HBufC::NewLC( KPhoneNumberEntryBufferSize ); |
|
607 |
TPtr ptr( phoneNumber->Des() ); |
|
608 |
TPhoneCmdParamString stringParam; |
|
609 |
stringParam.SetString( &ptr ); |
|
610 |
iViewCommandHandle->ExecuteCommand( |
|
611 |
EPhoneViewGetNumberFromEntry, |
|
612 |
&stringParam ); |
|
613 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( ptr ); |
|
614 |
||
615 |
if ( iStateMachine->PhoneEngineInfo()->PhoneNumberIsServiceCode() || |
|
616 |
phoneNumber->Des().Length() < KPhoneValidPhoneNumberLength ) |
|
617 |
{ |
|
618 |
// Send a manual control sequence by providing number |
|
619 |
// information with dial command |
|
620 |
CallFromNumberEntryL(); |
|
621 |
} |
|
622 |
else |
|
623 |
{ |
|
624 |
iStateMachine->SendPhoneEngineMessage( |
|
625 |
MPEPhoneModel::EPEMessageCheckEmergencyNumber ); |
|
626 |
} |
|
627 |
CleanupStack::PopAndDestroy( phoneNumber ); |
|
628 |
} |
|
629 |
else |
|
630 |
{ |
|
631 |
// Provide number information with dial command |
|
632 |
CallFromNumberEntryL(); |
|
633 |
} |
|
634 |
break; |
|
635 |
||
636 |
case EPhoneCmdEnd: |
|
637 |
CloseDtmfQueryL(); |
|
638 |
CPhoneState::DisconnectCallL(); |
|
639 |
break; |
|
640 |
||
641 |
// 'End all calls' from menu |
|
642 |
case EPhoneInCallCmdEndAllCalls: |
|
643 |
iStateMachine->SendPhoneEngineMessage( |
|
644 |
MPEPhoneModel::EPEMessageReleaseAll ); |
|
645 |
break; |
|
646 |
||
647 |
case EPhoneInCallCmdEndThisOutgoingCall: |
|
648 |
DisconnectOutgoingCallL(); |
|
649 |
break; |
|
650 |
||
651 |
case EPhoneInCallCmdGoToIdle: |
|
652 |
{ |
|
653 |
// Bring Idle app to foreground |
|
654 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground ); |
|
655 |
break; |
|
656 |
} |
|
657 |
||
658 |
case EPhoneNumberAcqCmdVideoCall: |
|
659 |
{// Create normal voice call, if number is emergency number. |
|
660 |
// Get the number entry contents |
|
661 |
HBufC* phoneNumber = PhoneNumberFromEntryLC(); |
|
662 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber ); |
|
663 |
iStateMachine->SendPhoneEngineMessage( |
|
664 |
MPEPhoneModel::EPEMessageCheckEmergencyNumber ); |
|
665 |
CleanupStack::PopAndDestroy( phoneNumber );} |
|
666 |
break; |
|
667 |
||
668 |
case EPhoneInCallCmdLockKeypad: |
|
669 |
case EPhoneInCallCmdLockScreen: |
|
670 |
LockKeypadL(); |
|
671 |
break; |
|
672 |
||
673 |
case EPhoneViewOpenCallHandling: |
|
674 |
if ( iOnScreenDialer && IsNumberEntryUsedL() ) |
|
675 |
{ |
|
676 |
// Remove number entry from screen |
|
677 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry ); |
|
678 |
HandleNumberEntryClearedL(); |
|
679 |
} |
|
680 |
commandStatus = CPhoneState::HandleCommandL( aCommand ); |
|
681 |
break; |
|
682 |
||
683 |
default: |
|
684 |
commandStatus = CPhoneState::HandleCommandL( aCommand ); |
|
685 |
break; |
|
686 |
} |
|
687 |
||
688 |
return commandStatus; |
|
689 |
} |
|
690 |
||
691 |
// ----------------------------------------------------------- |
|
692 |
// CPhoneStateInCall::CallFetchedNumberL |
|
693 |
// ----------------------------------------------------------- |
|
694 |
// |
|
695 |
EXPORT_C void CPhoneStateInCall::CallFetchedNumberL( |
|
696 |
const TDesC& aFetchedNumber ) |
|
697 |
{ |
|
698 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
699 |
"CPhoneStateInCall::CallFetchedNumberL()" ); |
|
700 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
701 |
Panic( EPhoneCtrlInvariant ) ); |
|
702 |
||
703 |
// Store the phone number |
|
704 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( aFetchedNumber ); |
|
705 |
||
706 |
DialVoiceCallL(); |
|
707 |
} |
|
708 |
||
709 |
// ----------------------------------------------------------- |
|
710 |
// CPhoneStateInCall::SendDtmfL |
|
711 |
// ----------------------------------------------------------- |
|
712 |
// |
|
713 |
void CPhoneStateInCall::SendDtmfL() |
|
714 |
{ |
|
715 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
716 |
"CPhoneStateInCall::SendDtmfL()" ); |
|
717 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
718 |
Panic( EPhoneCtrlInvariant ) ); |
|
719 |
||
720 |
// First get the DTMF sequence from dialog |
|
721 |
TPhoneCmdParamString dtmfSequence; |
|
722 |
HBufC *content = HBufC::NewLC( KPEDtmfMaxLength ); |
|
723 |
TPtr ptr( content->Des() ); |
|
724 |
dtmfSequence.SetString( &ptr ); |
|
725 |
||
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
726 |
if ( iOnScreenDialer ) |
37 | 727 |
{ |
728 |
iViewCommandHandle->ExecuteCommand( |
|
729 |
EPhoneViewGetNumberFromEntry, |
|
730 |
&dtmfSequence ); |
|
731 |
||
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
732 |
} |
37 | 733 |
|
734 |
// Send the DTMF |
|
735 |
if ( ptr.Length() ) |
|
736 |
{ |
|
737 |
iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( ptr ); |
|
738 |
iStateMachine->SendPhoneEngineMessage( |
|
739 |
MPEPhoneModel::EPEMessageSendDTMF ); |
|
740 |
} |
|
741 |
||
742 |
CleanupStack::PopAndDestroy( content ); |
|
743 |
} |
|
744 |
||
745 |
// ----------------------------------------------------------- |
|
746 |
// CPhoneStateInCall::LaunchDtmfListQueryL |
|
747 |
// ----------------------------------------------------------- |
|
748 |
// |
|
749 |
void CPhoneStateInCall::LaunchDtmfListQueryL() |
|
750 |
{ |
|
751 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
752 |
"CPhoneStateInCall::LaunchDtmfListQueryL()" ); |
|
753 |
||
754 |
// Fetch active call's id from view |
|
755 |
TPhoneCmdParamCallStateData callStateData; |
|
756 |
callStateData.SetCallState( EPEStateConnected ); |
|
757 |
iViewCommandHandle->HandleCommandL( |
|
758 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
759 |
||
760 |
if ( callStateData.CallId() == KErrNotFound ) |
|
761 |
{ |
|
762 |
callStateData.SetCallState( EPEStateConnecting ); |
|
763 |
iViewCommandHandle->HandleCommandL( |
|
764 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
765 |
} |
|
766 |
||
767 |
if ( callStateData.CallId() > KErrNotFound ) |
|
768 |
{ |
|
769 |
//Get Array of DTMF strings from PhoneEngine |
|
770 |
const CDesCArray& dtmfArray = |
|
771 |
iStateMachine->PhoneEngineInfo()-> |
|
772 |
RemotePredefinedDtmfStrings( callStateData.CallId() ); |
|
773 |
||
774 |
TInt itemCount = dtmfArray.Count(); |
|
775 |
if ( itemCount ) |
|
776 |
{ |
|
777 |
||
778 |
TPhoneCmdParamString stringParam; |
|
779 |
//Go through the array and send each dtmf string |
|
780 |
//to view. |
|
781 |
for ( TInt i=0; i<itemCount; i++ ) |
|
782 |
{ |
|
783 |
TPtrC16 ptrC16 = dtmfArray.MdcaPoint( i ); |
|
784 |
HBufC* string = ptrC16.AllocL(); |
|
785 |
CleanupStack::PushL( string ); |
|
786 |
TPtr ptr( string->Des() ); |
|
787 |
||
788 |
stringParam.SetString( &ptr ); |
|
789 |
iViewCommandHandle->ExecuteCommandL( |
|
790 |
EPhoneViewSetListQueryString, |
|
791 |
&stringParam ); |
|
792 |
CleanupStack::PopAndDestroy( string ); |
|
793 |
string = NULL; |
|
794 |
} |
|
795 |
} |
|
796 |
} |
|
797 |
else |
|
798 |
{ |
|
799 |
__PHONELOG( EOnlyFatal, EPhoneControl, |
|
800 |
"CPhoneStateInCall::LaunchDtmfListQueryL() No found valid call id" ); |
|
801 |
} |
|
802 |
||
803 |
// if there is a connected call only then open DtmfListQuery. |
|
804 |
if ( IsAnyConnectedCalls() ) |
|
805 |
{ |
|
806 |
TPhoneCmdParamQuery queryDialogParam; |
|
807 |
queryDialogParam.SetQueryType( EPhoneDtmfListQueryDialog ); |
|
808 |
queryDialogParam.SetQueryResourceId( |
|
809 |
CPhoneMainResourceResolver::Instance()-> |
|
810 |
ResolveResourceID( EPhoneDtmfNumberListQuery ) ); |
|
811 |
||
812 |
// Display dialog |
|
813 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery, |
|
814 |
&queryDialogParam ); |
|
815 |
} |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
816 |
} |
37 | 817 |
|
818 |
// --------------------------------------------------------- |
|
819 |
// CPhoneStateInCall::IsVideoCallActiveL |
|
820 |
// --------------------------------------------------------- |
|
821 |
// |
|
822 |
EXPORT_C TBool CPhoneStateInCall::IsVideoCallActiveL() |
|
823 |
{ |
|
824 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
825 |
"CPhoneStateInCall::IsVideoCallActive()" ); |
|
826 |
TBool retVal = EFalse; |
|
827 |
// Fetch active call's id from view |
|
828 |
TPhoneCmdParamCallStateData callStateData; |
|
829 |
callStateData.SetCallState( EPEStateConnected ); |
|
830 |
iViewCommandHandle->HandleCommandL( |
|
831 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
832 |
||
833 |
if ( callStateData.CallId() > KErrNotFound ) |
|
834 |
{ |
|
835 |
retVal = IsVideoCall( callStateData.CallId() ); |
|
836 |
} |
|
837 |
||
838 |
return retVal; |
|
839 |
} |
|
840 |
||
841 |
// --------------------------------------------------------- |
|
842 |
// CPhoneStateInCall::IsVideoCallRingingL |
|
843 |
// --------------------------------------------------------- |
|
844 |
// |
|
845 |
||
846 |
EXPORT_C TBool CPhoneStateInCall::IsVideoCallRingingL() |
|
847 |
{ |
|
848 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
849 |
"CPhoneStateInCall::IsVideoCallRingingL()" ); |
|
850 |
TBool retVal = EFalse; |
|
851 |
// Fetch ringing call id from view |
|
852 |
TPhoneCmdParamCallStateData callStateData; |
|
853 |
callStateData.SetCallState( EPEStateRinging ); |
|
854 |
iViewCommandHandle->HandleCommandL( |
|
855 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
856 |
||
857 |
if ( callStateData.CallId() > KErrNotFound ) |
|
858 |
{ |
|
859 |
retVal = IsVideoCall( callStateData.CallId() ); |
|
860 |
} |
|
861 |
||
862 |
return retVal; |
|
863 |
} |
|
864 |
||
865 |
// --------------------------------------------------------- |
|
866 |
// CPhoneStateInCall::GetRingingCallL |
|
867 |
// --------------------------------------------------------- |
|
868 |
// |
|
869 |
||
870 |
EXPORT_C TInt CPhoneStateInCall::GetRingingCallL() |
|
871 |
{ |
|
872 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
873 |
"CPhoneStateInCall::GetRingingCallL()" ); |
|
874 |
||
875 |
// Fetch ringing call id from view |
|
876 |
TPhoneCmdParamCallStateData callStateData; |
|
877 |
callStateData.SetCallState( EPEStateRinging ); |
|
878 |
iViewCommandHandle->HandleCommandL( |
|
879 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
880 |
||
881 |
return callStateData.CallId(); |
|
882 |
} |
|
883 |
||
884 |
// ----------------------------------------------------------- |
|
885 |
// CPhoneStateInCall::DisconnectOutgoingCallL |
|
886 |
// ----------------------------------------------------------- |
|
887 |
// |
|
888 |
EXPORT_C void CPhoneStateInCall::DisconnectOutgoingCallL() |
|
889 |
{ |
|
890 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
891 |
"CPhoneStateInCall::DisconnectOutgoingCallL()"); |
|
892 |
// Fetch alerting call's id from view |
|
893 |
TPhoneCmdParamCallStateData callStateData; |
|
894 |
callStateData.SetCallState( EPEStateConnecting ); |
|
895 |
iViewCommandHandle->HandleCommandL( |
|
896 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
897 |
||
898 |
if( callStateData.CallId() == KErrNotFound ) |
|
899 |
{ |
|
900 |
// No connecting call, find the dialing call |
|
901 |
callStateData.SetCallState( EPEStateDialing ); |
|
902 |
iViewCommandHandle->HandleCommandL( |
|
903 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
904 |
||
905 |
if( callStateData.CallId() == KErrNotFound ) |
|
906 |
{ |
|
907 |
// No dialing call, find the disconnectinging call |
|
908 |
callStateData.SetCallState( EPEStateDisconnecting ); |
|
909 |
iViewCommandHandle->HandleCommandL( |
|
910 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
911 |
} |
|
912 |
else |
|
913 |
{ |
|
914 |
if ( IsNumberEntryUsedL() ) |
|
915 |
{ |
|
916 |
SetNumberEntryVisibilityL(ETrue); |
|
917 |
} |
|
918 |
} |
|
919 |
} |
|
920 |
||
921 |
if( callStateData.CallId() > KErrNotFound ) |
|
922 |
{ |
|
923 |
// Release the call |
|
924 |
iStateMachine->SetCallId( callStateData.CallId() ); |
|
925 |
iStateMachine->SendPhoneEngineMessage( |
|
926 |
MPEPhoneModel::EPEMessageRelease ); |
|
927 |
} |
|
928 |
else |
|
929 |
{ |
|
930 |
__PHONELOG( EOnlyFatal, EPhoneControl, |
|
931 |
"CPhoneStateInCall::DisconnectOutgoingCallL() has negative call id!" ); |
|
932 |
__ASSERT_DEBUG( EFalse, Panic( EPhoneCtrlIndexOutOfBounds ) ); |
|
933 |
} |
|
934 |
} |
|
935 |
||
936 |
// ----------------------------------------------------------------------------- |
|
937 |
// CPhoneStateInCall::LockKeysL |
|
938 |
// ----------------------------------------------------------------------------- |
|
939 |
// |
|
940 |
void CPhoneStateInCall::LockKeypadL() |
|
941 |
{ |
|
942 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
943 |
"CPhoneStateInCall::LockKeypadL()"); |
|
944 |
||
945 |
if ( !FeatureManager::FeatureSupported( KFeatureIdKeypadNoSlider ) ) |
|
946 |
{ |
|
947 |
TInt state = KErrNone; |
|
948 |
TInt err = RProperty::Get( |
|
949 |
KPSUidHWRM, |
|
950 |
KHWRMGripStatus, |
|
951 |
state ); |
|
952 |
if ( state == EPSHWRMGripOpen ) |
|
953 |
{ |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
954 |
SendGlobalErrorNoteL( EPhoneNoteTextNotAllowed, ETrue ); |
37 | 955 |
} |
956 |
else |
|
957 |
{ |
|
958 |
iViewCommandHandle->ExecuteCommandL( |
|
959 |
EPhoneViewEnableKeyLock ); |
|
960 |
} |
|
961 |
} |
|
962 |
else |
|
963 |
{ |
|
964 |
iViewCommandHandle->ExecuteCommandL( |
|
965 |
EPhoneViewEnableKeyLock ); |
|
966 |
} |
|
967 |
} |
|
968 |
||
969 |
// ----------------------------------------------------------------------------- |
|
970 |
// CPhoneStateInCall::CloseDtmfQueryL |
|
971 |
// ----------------------------------------------------------------------------- |
|
972 |
// |
|
973 |
EXPORT_C void CPhoneStateInCall::CloseDtmfQueryL() |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
974 |
{ |
37 | 975 |
} |
976 |
||
977 |
||
978 |
// ----------------------------------------------------------------------------- |
|
979 |
// CPhoneStateInCall::HandleEndKeyPressL |
|
980 |
// ----------------------------------------------------------------------------- |
|
981 |
// |
|
982 |
void CPhoneStateInCall::HandleEndKeyPressL( TPhoneKeyEventMessages aMessage ) |
|
983 |
{ |
|
984 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
985 |
"CPhoneStateInCall::HandleEndKeyPressL()"); |
|
986 |
// handle long press of end key |
|
987 |
if ( aMessage == EPhoneKeyLongPress ) |
|
988 |
{ |
|
989 |
// Fetch active call's id from view |
|
990 |
TPhoneCmdParamCallStateData callStateData; |
|
991 |
callStateData.SetCallState( EPEStateConnected ); |
|
992 |
iViewCommandHandle->HandleCommandL( |
|
993 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
994 |
||
995 |
if( IsVideoCall( callStateData.CallId() ) ) |
|
996 |
{ |
|
997 |
// Video call can be released only after we get response to VT Shutdown Command |
|
998 |
CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( |
|
999 |
KMediatorVideoTelephonyDomain, |
|
1000 |
KCatPhoneToVideotelCommands, |
|
1001 |
EVtCmdReleaseDataport, |
|
1002 |
TVersion( KPhoneToVideotelCmdVersionMajor, |
|
1003 |
KPhoneToVideotelCmdVersionMinor, |
|
1004 |
KPhoneToVideotelCmdVersionBuild ), |
|
1005 |
KNullDesC8, |
|
1006 |
CPhoneTerminateAllConnectionsCommand::NewL( *iStateMachine ) ); |
|
1007 |
} |
|
1008 |
else |
|
1009 |
{ |
|
1010 |
// Close all connections |
|
1011 |
iStateMachine->SendPhoneEngineMessage( |
|
1012 |
MPEPhoneModel::EPEMessageTerminateAllConnections ); |
|
1013 |
||
1014 |
if ( IsNumberEntryContentStored() ) |
|
1015 |
{ |
|
1016 |
ClearNumberEntryContentCache(); |
|
1017 |
} |
|
1018 |
} |
|
1019 |
||
1020 |
if ( IsNumberEntryUsedL() ) |
|
1021 |
{ |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
1022 |
// Remove number entry from screen |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
1023 |
iViewCommandHandle->ExecuteCommandL( |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
1024 |
EPhoneViewRemoveNumberEntry ); |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
1025 |
// Do state-specific operation when number entry is cleared |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
1026 |
HandleNumberEntryClearedL(); |
37 | 1027 |
} |
1028 |
||
1029 |
if ( !TopAppIsDisplayedL() ) |
|
1030 |
{ |
|
1031 |
// Bring app to foreground |
|
1032 |
TPhoneCmdParamInteger uidParam; |
|
1033 |
uidParam.SetInteger( KUidPhoneApplication.iUid ); |
|
1034 |
iViewCommandHandle->ExecuteCommandL( |
|
1035 |
EPhoneViewBringAppToForeground, &uidParam ); |
|
1036 |
} |
|
1037 |
} |
|
1038 |
else |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
1039 |
{ |
37 | 1040 |
// handle short end key |
1041 |
CPhoneState::DisconnectCallL(); |
|
1042 |
} |
|
1043 |
} |
|
1044 |
||
1045 |
// ----------------------------------------------------------------------------- |
|
1046 |
// CPhoneStateInCall::HandleVoiceKeyPressL |
|
1047 |
// ----------------------------------------------------------------------------- |
|
1048 |
// |
|
1049 |
void CPhoneStateInCall::HandleVoiceKeyPressL( TPhoneKeyEventMessages aMessage ) |
|
1050 |
{ |
|
1051 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
1052 |
"CPhoneStateInCall::HandleVoiceKeyPressL()"); |
|
1053 |
if ( aMessage == EPhoneKeyShortPress ) |
|
1054 |
{ |
|
1055 |
// Toggle the handsfree mode |
|
1056 |
const TBool handsfreeMode = |
|
1057 |
iStateMachine->PhoneEngineInfo()->AudioOutput() == |
|
1058 |
EPELoudspeaker; |
|
1059 |
SetHandsfreeModeL( !handsfreeMode ); |
|
1060 |
} |
|
1061 |
else // aMessage == EPhoneKeyLongPress |
|
1062 |
{ |
|
1063 |
// Display call in progress information note |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1064 |
SendGlobalInfoNoteL( EPhoneCallInProgress, ETrue ); |
37 | 1065 |
} |
1066 |
} |
|
1067 |
||
1068 |
// ----------------------------------------------------------- |
|
1069 |
// CPhoneStateInCall::ShowDtmfTextQueryL |
|
1070 |
// ----------------------------------------------------------- |
|
1071 |
// |
|
1072 |
void CPhoneStateInCall::ShowDtmfTextQueryL( |
|
1073 |
TInt aDialogResourceId, |
|
1074 |
TInt aDefaultCbaResourceId, |
|
1075 |
TInt aContentCbaResourceId, |
|
1076 |
TDes* aDataText, |
|
1077 |
TBool aSendKeyEnabled ) |
|
1078 |
{ |
|
1079 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
1080 |
"CPhoneStateInCall::ShowDtmfTextQueryL()"); |
|
1081 |
||
1082 |
__ASSERT_DEBUG( aDialogResourceId && |
|
1083 |
aDefaultCbaResourceId && |
|
1084 |
aContentCbaResourceId && |
|
1085 |
aDataText, |
|
1086 |
Panic( EPhoneCtrlParameterNotInitialized ) ); |
|
1087 |
TPhoneCmdParamQuery queryDialogParam; |
|
1088 |
queryDialogParam.SetQueryType( EPhoneDtmfTextQuery ); |
|
1089 |
queryDialogParam.SetQueryResourceId( aDialogResourceId ); |
|
1090 |
queryDialogParam.SetDefaultCba( aDefaultCbaResourceId ); |
|
1091 |
queryDialogParam.SetContentCba( aContentCbaResourceId ); |
|
1092 |
queryDialogParam.SetDataText( aDataText ); |
|
1093 |
queryDialogParam.SetSendKeyEnabled( aSendKeyEnabled ); |
|
1094 |
||
1095 |
// Display dialog |
|
1096 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery, |
|
1097 |
&queryDialogParam ); |
|
1098 |
} |
|
1099 |
||
1100 |
// End of File |