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