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-2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: Implementation of CPhoneStateCallSetup class. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
// INCLUDES |
|
20 |
#include <featmgr.h> |
|
21 |
#include <StringLoader.h> |
|
22 |
#include <AknUtils.h> |
|
23 |
#include <mpeengineinfo.h> |
|
24 |
#include <mpeclientinformation.h> |
|
25 |
||
26 |
#include "cphonepubsubproxy.h" |
|
27 |
#include "cphonestatecallsetup.h" |
|
28 |
#include "cphonestateincall.h" |
|
29 |
#include "mphonestatemachine.h" |
|
30 |
#include "tphonecmdparamboolean.h" |
|
31 |
#include "tphonecmdparaminteger.h" |
|
32 |
#include "tphonecmdparamcallstatedata.h" |
|
33 |
#include "tphonecmdparamcallheaderdata.h" |
|
34 |
#include "tphonecmdparamglobalnote.h" |
|
35 |
#include "tphonecmdparamstring.h" |
|
36 |
#include "tphonecmdparamkeyevent.h" |
|
37 |
#include "tphonecmdparamnote.h" |
|
38 |
#include "tphonecmdparamquery.h" |
|
39 |
#include "phonestatedefinitions.h" |
|
40 |
#include "phoneui.hrh" |
|
41 |
#include "phonerssbase.h" |
|
42 |
#include "cphonemainresourceresolver.h" |
|
43 |
#include "phonelogger.h" |
|
44 |
#include "phoneui.pan" |
|
45 |
#include "cphonedtmfwaitchartimer.h" |
|
46 |
#include "tphonecmdparamaudiooutput.h" |
|
47 |
#include "cphonekeys.h" |
|
48 |
||
49 |
// ================= MEMBER FUNCTIONS ======================= |
|
50 |
||
51 |
// C++ default constructor can NOT contain any code, that |
|
52 |
// might leave. |
|
53 |
// |
|
54 |
EXPORT_C CPhoneStateCallSetup::CPhoneStateCallSetup( |
|
55 |
MPhoneStateMachine* aStateMachine, |
|
56 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
57 |
MPhoneCustomization* aCustomization ) : |
|
58 |
CPhoneState( aStateMachine, aViewCommandHandle, aCustomization ) |
|
59 |
{ |
|
60 |
} |
|
61 |
||
62 |
// ----------------------------------------------------------- |
|
63 |
// CPhoneStateCallSetup::~CPhoneStateCallSetup() |
|
64 |
// Destructor |
|
65 |
// (other items were commented in a header). |
|
66 |
// ----------------------------------------------------------- |
|
67 |
// |
|
68 |
EXPORT_C CPhoneStateCallSetup::~CPhoneStateCallSetup() |
|
69 |
{ |
|
70 |
delete iDtmfWaitCharTimer; |
|
71 |
} |
|
72 |
||
73 |
// ----------------------------------------------------------- |
|
74 |
// CPhoneStateCallSetup::ConstructL() |
|
75 |
// Constructor |
|
76 |
// (other items were commented in a header). |
|
77 |
// ----------------------------------------------------------- |
|
78 |
// |
|
79 |
EXPORT_C void CPhoneStateCallSetup::ConstructL() |
|
80 |
{ |
|
81 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
82 |
Panic( EPhoneCtrlInvariant ) ); |
|
83 |
||
84 |
CPhoneState::BaseConstructL(); |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
85 |
|
37 | 86 |
HandleAudioOutputChangedL(); |
87 |
} |
|
88 |
||
89 |
// ----------------------------------------------------------- |
|
90 |
// CPhoneStateCallSetup::NewL() |
|
91 |
// Constructor |
|
92 |
// (other items were commented in a header). |
|
93 |
// ----------------------------------------------------------- |
|
94 |
// |
|
95 |
CPhoneStateCallSetup* CPhoneStateCallSetup::NewL( |
|
96 |
MPhoneStateMachine* aStateMachine, |
|
97 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
98 |
MPhoneCustomization* aPhoneCustomization ) |
|
99 |
{ |
|
100 |
CPhoneStateCallSetup* self = new (ELeave) CPhoneStateCallSetup( |
|
101 |
aStateMachine, aViewCommandHandle, aPhoneCustomization ); |
|
102 |
||
103 |
CleanupStack::PushL( self ); |
|
104 |
self->ConstructL(); |
|
105 |
CleanupStack::Pop( self ); |
|
106 |
||
107 |
return self; |
|
108 |
} |
|
109 |
||
110 |
// ----------------------------------------------------------- |
|
111 |
// CPhoneStateCallSetup::HandleCommandL() |
|
112 |
// ----------------------------------------------------------- |
|
113 |
// |
|
114 |
EXPORT_C TBool CPhoneStateCallSetup::HandleCommandL( TInt aCommand ) |
|
115 |
{ |
|
116 |
__LOGMETHODSTARTEND( EPhoneControl, |
|
117 |
"CPhoneStateCallSetup::HandleCommandL()" ); |
|
118 |
TBool commandStatus = ETrue; |
|
119 |
||
120 |
switch( aCommand ) |
|
121 |
{ |
|
122 |
case EPhoneInCallCmdDialer: |
|
123 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewOpenDialer ); |
|
124 |
break; |
|
125 |
||
126 |
case EPhoneNumberAcqCmdAddToContacts: |
|
127 |
{ |
|
128 |
// If call setup is ongoing then add to contacts query should |
|
129 |
// not be opened -> do nothing here. |
|
130 |
} |
|
131 |
break; |
|
132 |
||
133 |
// DTMF entry - Ok |
|
134 |
case EPhoneCmdDtmfOk: |
|
135 |
SendDtmfL(); |
|
136 |
break; |
|
137 |
||
138 |
// DTMF sending - Cancel |
|
139 |
case EPhoneInCallCmdCancelSendingDtmfString: |
|
140 |
// Stop the asynchronous sending operation the |
|
141 |
// PhoneEngine may be performing. |
|
142 |
iStateMachine->SendPhoneEngineMessage( |
|
143 |
MPEPhoneModel::EPEMessageStopDTMFSending ); |
|
144 |
// Remove DTMF sending from screen |
|
145 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
|
146 |
break; |
|
147 |
||
148 |
// DTMF wait - Ok |
|
149 |
case EPhoneInCallCmdContinueSendingDtmfString: |
|
150 |
// Continue sending the DTMF string |
|
151 |
if( !iDtmfWaitCharTimer ) |
|
152 |
{ |
|
153 |
iDtmfWaitCharTimer = CPhoneDtmfWaitCharTimer::NewL( |
|
154 |
iStateMachine ); |
|
155 |
} |
|
156 |
iDtmfWaitCharTimer->ButtonPressedL(); |
|
157 |
break; |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
158 |
|
37 | 159 |
|
160 |
case EPhoneCmdOptions: |
|
161 |
break; |
|
162 |
||
163 |
case EPhoneInCallCmdDtmfManualQuery: |
|
164 |
break; |
|
165 |
||
166 |
case EPhoneDtmfDialerExit: // fall through |
|
167 |
case EPhoneDtmfDialerCancel: |
|
168 |
break; |
|
169 |
||
170 |
case EPhoneInCallCmdMute: // fall through |
|
171 |
case EPhoneInCallCmdUnmute: |
|
172 |
iStateMachine->PhoneEngineInfo()->SetAudioMuteCommand( |
|
173 |
( aCommand == EPhoneInCallCmdMute ) ); |
|
174 |
iStateMachine->SendPhoneEngineMessage( |
|
175 |
MPEPhoneModel::EPEMessageSetAudioMute ); |
|
176 |
break; |
|
177 |
||
178 |
default: |
|
179 |
commandStatus = CPhoneState::HandleCommandL( aCommand ); |
|
180 |
break; |
|
181 |
} |
|
182 |
||
183 |
return commandStatus; |
|
184 |
} |
|
185 |
||
186 |
||
187 |
// ----------------------------------------------------------- |
|
188 |
// CPhoneStateCallSetup::HandleNumberEntryClearedL() |
|
189 |
// ----------------------------------------------------------- |
|
190 |
// |
|
191 |
EXPORT_C void CPhoneStateCallSetup::HandleNumberEntryClearedL() |
|
192 |
{ |
|
193 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
194 |
"CPhoneStateCallSetup::HandleNumberEntryClearedL()" ); |
|
195 |
||
196 |
// Update call setup CBA when number entry is cleared |
|
197 |
UpdateInCallCbaL(); |
|
198 |
} |
|
199 |
||
200 |
// ----------------------------------------------------------- |
|
201 |
// CPhoneStateCallSetup::UpdateInCallCbaL |
|
202 |
// ----------------------------------------------------------- |
|
203 |
// |
|
204 |
EXPORT_C void CPhoneStateCallSetup::UpdateInCallCbaL() |
|
205 |
{ |
|
206 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::UpdateInCallCbaL() "); |
|
207 |
UpdateCbaL( EPhoneCallHandlingCallSetupCBA ); |
|
208 |
} |
|
209 |
||
210 |
// ----------------------------------------------------------- |
|
211 |
// CPhoneStateCallSetup::UpdateCbaL |
|
212 |
// ----------------------------------------------------------- |
|
213 |
// |
|
214 |
EXPORT_C void CPhoneStateCallSetup::UpdateCbaL( TInt aResource ) |
|
215 |
{ |
|
216 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::UpdateCbaL() "); |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
217 |
iCbaManager->UpdateCbaL( aResource ); |
37 | 218 |
} |
219 |
||
220 |
// ----------------------------------------------------------- |
|
221 |
// CPhoneStateCallSetup::HandleKeyEventL |
|
222 |
// ----------------------------------------------------------- |
|
223 |
// |
|
224 |
EXPORT_C void CPhoneStateCallSetup::HandleKeyEventL( |
|
225 |
const TKeyEvent& aKeyEvent, |
|
226 |
TEventCode aEventCode ) |
|
227 |
{ |
|
228 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandleKeyEventL( ) "); |
|
229 |
||
230 |
if ( iOnScreenDialer && IsNumberEntryVisibleL() ) |
|
231 |
{ |
|
232 |
HandleNumericKeyEventL( aKeyEvent, aEventCode ); |
|
233 |
} |
|
234 |
else |
|
235 |
{ |
|
236 |
// Send the key events to the phone engine |
|
237 |
switch( aEventCode ) |
|
238 |
{ |
|
239 |
case EEventKey: |
|
240 |
{ |
|
241 |
PlayKeySpecificDTMF( aKeyEvent.iCode ); |
|
242 |
||
243 |
if ( aKeyEvent.iScanCode == EStdKeyUpArrow && |
|
244 |
!OnlySideVolumeKeySupported() ) |
|
245 |
{ |
|
246 |
// Increace audio volume |
|
247 |
CPhoneState::IncreaseAudioVolumeL(); |
|
248 |
} |
|
249 |
else if ( aKeyEvent.iScanCode == EStdKeyDownArrow && |
|
250 |
!OnlySideVolumeKeySupported() ) |
|
251 |
{ |
|
252 |
// Decreace audio volume |
|
253 |
CPhoneState::DecreaseAudioVolumeL(); |
|
254 |
} |
|
255 |
} |
|
256 |
break; |
|
257 |
||
258 |
case EEventKeyUp: |
|
259 |
// Send a key up event for the last key code sent to |
|
260 |
// the phone engine |
|
261 |
iStateMachine->SendPhoneEngineMessage( |
|
262 |
MPEPhoneModel::EPEMessageEndDTMF ); |
|
263 |
break; |
|
264 |
||
265 |
default: |
|
266 |
break; |
|
267 |
} |
|
268 |
} |
|
269 |
} |
|
270 |
||
271 |
// ----------------------------------------------------------- |
|
272 |
// CPhoneStateCallSetup::PlayKeySpecificDTMF |
|
273 |
// ----------------------------------------------------------- |
|
274 |
// |
|
275 |
void CPhoneStateCallSetup::PlayKeySpecificDTMF( const TUint aCode ) |
|
276 |
{ |
|
277 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::PlayKeySpecificDTMF( ) "); |
|
278 |
TBuf<1> buffer; // one character |
|
279 |
buffer.Append( aCode ); |
|
280 |
__PHONELOG1( EBasic, EPhoneControl, "HandleKeyEventL(%S)", &buffer ); |
|
281 |
// Convert key code to western. |
|
282 |
AknTextUtils::ConvertDigitsTo( buffer, EDigitTypeWestern ); |
|
283 |
__PHONELOG1( EBasic, EPhoneControl, "ConvertDigitsTo(%S)", &buffer ); |
|
284 |
TLex code( buffer ); |
|
285 |
// Send the key press to the phone engine, if applicable |
|
286 |
iStateMachine->PhoneEngineInfo()->SetKeyCode( code.Peek() ); |
|
287 |
iStateMachine->SendPhoneEngineMessage( |
|
288 |
MPEPhoneModel::EPEMessagePlayDTMF ); |
|
289 |
} |
|
290 |
||
291 |
// ----------------------------------------------------------- |
|
292 |
// CPhoneStateCallSetup::HandleKeyMessageL |
|
293 |
// ----------------------------------------------------------- |
|
294 |
// |
|
295 |
EXPORT_C void CPhoneStateCallSetup::HandleKeyMessageL( |
|
296 |
TPhoneKeyEventMessages aMessage, |
|
297 |
TKeyCode aCode ) |
|
298 |
{ |
|
299 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandleKeyMessageL()"); |
|
300 |
switch ( aCode ) |
|
301 |
{ |
|
302 |
// end-key |
|
303 |
case EKeyNo: |
|
304 |
if ( aMessage == EPhoneKeyLongPress ) |
|
305 |
{ |
|
306 |
// Close all connections |
|
307 |
iStateMachine->SendPhoneEngineMessage( |
|
308 |
MPEPhoneModel::EPEMessageTerminateAllConnections ); |
|
309 |
||
310 |
// Remove number entry if long press |
|
311 |
if ( IsNumberEntryUsedL() ) |
|
312 |
{ |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
313 |
iViewCommandHandle->ExecuteCommandL( |
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
314 |
EPhoneViewRemoveNumberEntry ); |
37 | 315 |
} |
316 |
} |
|
317 |
else |
|
318 |
{ |
|
319 |
// handle end key |
|
320 |
CPhoneState::DisconnectCallL(); |
|
321 |
} |
|
322 |
break; |
|
323 |
||
324 |
// Voice key |
|
325 |
case EKeyDevice6: |
|
326 |
if ( aMessage == EPhoneKeyShortPress ) |
|
327 |
{ |
|
328 |
// Toggle the handsfree mode |
|
329 |
const TBool handsfreeMode = |
|
330 |
iStateMachine->PhoneEngineInfo()->AudioOutput() == |
|
331 |
EPELoudspeaker; |
|
332 |
CPhoneState::SetHandsfreeModeL( !handsfreeMode ); |
|
333 |
} |
|
334 |
else // aMessage == EPhoneKeyLongPress |
|
335 |
{ |
|
336 |
// Display call in progress information note |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
337 |
CPhoneState::SendGlobalInfoNoteL( EPhoneCallInProgress, ETrue ); |
37 | 338 |
} |
339 |
break; |
|
340 |
||
341 |
default: |
|
342 |
break; |
|
343 |
} |
|
344 |
} |
|
345 |
||
346 |
// ----------------------------------------------------------- |
|
347 |
// CPhoneStateCallSetup::HandlePhoneEngineMessageL |
|
348 |
// ----------------------------------------------------------- |
|
349 |
// |
|
350 |
EXPORT_C void CPhoneStateCallSetup::HandlePhoneEngineMessageL( |
|
351 |
const TInt aMessage, |
|
352 |
TInt aCallId ) |
|
353 |
{ |
|
354 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandlePhoneEngineMessageL()"); |
|
355 |
||
356 |
switch ( aMessage ) |
|
357 |
{ |
|
358 |
case MEngineMonitor::EPEMessageConnected: |
|
359 |
HandleConnectedL( aCallId ); |
|
360 |
break; |
|
361 |
||
362 |
case MEngineMonitor::EPEMessageRemoteTerminated: |
|
363 |
if ( IsVideoCall( aCallId ) ) |
|
364 |
{ |
|
365 |
HandleRemoteTerminatedL( aCallId ); |
|
366 |
} |
|
367 |
break; |
|
368 |
||
369 |
case MEngineMonitor::EPEMessageIdle: |
|
370 |
HandleIdleL( aCallId ); |
|
371 |
break; |
|
372 |
||
373 |
case MEngineMonitor::EPEMessageAudioOutputChanged: |
|
374 |
HandleAudioOutputChangedL(); |
|
375 |
break; |
|
376 |
||
377 |
case MEngineMonitor::EPEMessageSendingDTMF: // fall through |
|
378 |
case MEngineMonitor::EPEMessageContinuingDTMFSending: |
|
379 |
HandleSendingDTMFL(); |
|
380 |
break; |
|
381 |
||
382 |
case MEngineMonitor::EPEMessageStoppedDTMF: |
|
383 |
HandleStoppedDTMFL(); |
|
384 |
break; |
|
385 |
||
386 |
case MEngineMonitor::EPEMessageSentDTMF: // fall through |
|
387 |
case MEngineMonitor::EPEMessageDTMFSendingAborted: |
|
388 |
CancelDTMFSendingL(); |
|
389 |
break; |
|
390 |
||
391 |
default: |
|
392 |
CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId ); |
|
393 |
break; |
|
394 |
} |
|
395 |
} |
|
396 |
||
397 |
// ----------------------------------------------------------- |
|
398 |
// CPhoneStateCallSetup::HandleSendingDTMFL |
|
399 |
// ----------------------------------------------------------- |
|
400 |
// |
|
401 |
void CPhoneStateCallSetup::HandleSendingDTMFL() |
|
402 |
{ |
|
403 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
404 |
"CPhoneStateCallSetup::HandleSendingDTMFL()" ); |
|
405 |
TPhoneCmdParamNote noteParam; |
|
406 |
noteParam.SetType( EPhoneNoteDtmfSending ); |
|
407 |
noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()-> |
|
408 |
ResolveResourceID( EPhoneSendingDtmfWaitNote ) ); |
|
409 |
||
410 |
// Show the "Sending..." Wait Note, and pre-populate it |
|
411 |
// with the PhoneEngine's current DTMF String. |
|
412 |
// Set the text for the wait-note. |
|
413 |
TPEDtmfString dtmfString = iStateMachine->PhoneEngineInfo()->DtmfString(); |
|
414 |
HBufC* noteText = StringLoader::LoadLC( |
|
415 |
CPhoneMainResourceResolver::Instance()-> |
|
416 |
ResolveResourceID( EPhoneSendingDtmfWaitNoteText ), |
|
417 |
dtmfString ); |
|
418 |
noteParam.SetText( *noteText ); |
|
419 |
||
420 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowNote, ¬eParam ); |
|
421 |
||
422 |
CleanupStack::PopAndDestroy( noteText ); |
|
423 |
} |
|
424 |
||
425 |
// ----------------------------------------------------------- |
|
426 |
// CPhoneStateCallSetup::HandleStoppedDTMFL |
|
427 |
// ----------------------------------------------------------- |
|
428 |
// |
|
429 |
void CPhoneStateCallSetup::HandleStoppedDTMFL() |
|
430 |
{ |
|
431 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
432 |
"CPhoneStateCallSetup::HandleStoppedDTMFL()" ); |
|
433 |
// Remove the Sending... note |
|
434 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote ); |
|
435 |
||
436 |
// Fetch the remaining (unparsed) portion of the DTMF String |
|
437 |
// from PhoneEngine |
|
438 |
TPEDtmfString dtmfString = iStateMachine->PhoneEngineInfo()->DtmfString(); |
|
439 |
||
440 |
if ( dtmfString.Length() ) |
|
441 |
{ |
|
442 |
// Show the DTMF Wait Character confirmation query |
|
443 |
TPhoneCmdParamQuery queryParam; |
|
444 |
queryParam.SetQueryType( EPhoneQueryDialog ); |
|
445 |
queryParam.SetQueryResourceId( |
|
446 |
CPhoneMainResourceResolver::Instance()->ResolveResourceID( |
|
447 |
EPhoneDtmfWaitCharacterConfirmationQuery ) ); |
|
448 |
||
449 |
// Append the PhoneEngine's current DTMF String to the query's prompt |
|
450 |
HBufC* queryPrompt = StringLoader::LoadLC( |
|
451 |
CPhoneMainResourceResolver::Instance()->ResolveResourceID( |
|
452 |
EPhoneDtmfWaitCharacterConfirmationQueryText ), |
|
453 |
dtmfString ); |
|
454 |
queryParam.SetQueryPrompt( *queryPrompt ); |
|
455 |
||
456 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewShowQuery, |
|
457 |
&queryParam ); |
|
458 |
||
459 |
CleanupStack::PopAndDestroy( queryPrompt ); |
|
460 |
} |
|
461 |
else |
|
462 |
{ |
|
463 |
// Stop the asynchronous sending operation the |
|
464 |
// PhoneEngine may be performing. |
|
465 |
iStateMachine->SendPhoneEngineMessage( |
|
466 |
MPEPhoneModel::EPEMessageStopDTMFSending ); |
|
467 |
||
468 |
// Prompt for more characters by showing DTMF query with empty string |
|
469 |
HBufC* emptyString = HBufC::NewLC( KPhoneNumberEntryBufferSize ); |
|
470 |
TPtr ptr( emptyString->Des() ); |
|
471 |
||
472 |
CPhoneState::ShowTextQueryL( |
|
473 |
CPhoneMainResourceResolver::Instance()-> |
|
474 |
ResolveResourceID( EPhoneDtmfNumberQuery ), |
|
475 |
CPhoneMainResourceResolver::Instance()-> |
|
476 |
ResolveResourceID( EPhoneSendDtmfEmptyEditBoxCBA ), |
|
477 |
CPhoneMainResourceResolver::Instance()-> |
|
478 |
ResolveResourceID( EPhoneSendDtmfNormalEditBoxCBA ), |
|
479 |
&ptr ); |
|
480 |
||
481 |
CleanupStack::PopAndDestroy( emptyString ); |
|
482 |
} |
|
483 |
} |
|
484 |
||
485 |
// ----------------------------------------------------------- |
|
486 |
// CPhoneStateCallSetup::CancelDTMFSendingL |
|
487 |
// ----------------------------------------------------------- |
|
488 |
// |
|
489 |
void CPhoneStateCallSetup::CancelDTMFSendingL() |
|
490 |
{ |
|
491 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
492 |
"CPhoneStateCallSetup::CancelDTMFSendingL()" ); |
|
493 |
// Remove the Sending... note |
|
494 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveDtmfNote ); |
|
495 |
} |
|
496 |
||
497 |
// ----------------------------------------------------------- |
|
498 |
// CPhoneStateCallSetup::HandleConnectedL |
|
499 |
// ----------------------------------------------------------- |
|
500 |
// |
|
501 |
void CPhoneStateCallSetup::HandleConnectedL( TInt aCallId ) |
|
502 |
{ |
|
503 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandleConnectedL()"); |
|
504 |
// Keep Phone in the foreground |
|
505 |
TPhoneCmdParamBoolean booleanParam; |
|
506 |
booleanParam.SetBoolean( EFalse ); |
|
507 |
iViewCommandHandle->ExecuteCommandL( |
|
508 |
EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam ); |
|
509 |
||
510 |
BeginUiUpdateLC(); |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
511 |
|
37 | 512 |
// Update the single call |
513 |
CPhoneState::UpdateSingleActiveCallL( aCallId ); |
|
514 |
||
515 |
// Update touch buttons |
|
516 |
SetTouchPaneButtons( EPhoneIncallButtons ); |
|
517 |
||
518 |
EndUiUpdate(); |
|
519 |
||
520 |
// Go to single state |
|
521 |
UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
|
522 |
||
523 |
iStateMachine->ChangeState( EPhoneStateSingle ); |
|
524 |
} |
|
525 |
||
526 |
// ----------------------------------------------------------- |
|
527 |
// CPhoneStateCallSetup::HandleIdleL |
|
528 |
// ----------------------------------------------------------- |
|
529 |
// |
|
530 |
void CPhoneStateCallSetup::HandleIdleL( TInt aCallId ) |
|
531 |
{ |
|
532 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandleIdleL()"); |
|
533 |
||
534 |
BeginUiUpdateLC (); |
|
535 |
||
536 |
// Disable the volume display |
|
537 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewHideNaviPaneAudioVolume ); |
|
538 |
||
539 |
// Remove call |
|
540 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
|
541 |
SetDefaultFlagsL(); |
|
542 |
||
543 |
CheckIfRestoreNEContentAfterDtmfDialer(); |
|
544 |
||
545 |
if ( IsNumberEntryUsedL() ) |
|
546 |
{ |
|
547 |
// Show the number entry if it exists |
|
548 |
SetNumberEntryVisibilityL(ETrue); |
|
549 |
} |
|
550 |
else if ( NeedToSendToBackgroundL() ) |
|
551 |
{ |
|
552 |
__PHONELOG( EBasic,EPhoneControl,"CPhoneStateCallSetup::elseif1"); |
|
553 |
// Continue displaying current app but set up the |
|
554 |
// idle screen in the background |
|
555 |
SetupIdleScreenInBackgroundL(); |
|
556 |
} |
|
557 |
else |
|
558 |
{ |
|
559 |
__PHONELOG( EBasic,EPhoneControl,"CPhoneStateCallSetup::elseif2"); |
|
560 |
// Display idle screen |
|
561 |
DisplayIdleScreenL(); |
|
562 |
} |
|
563 |
||
564 |
EndUiUpdate(); |
|
565 |
// Go to idle state |
|
566 |
// No need update cba |
|
567 |
iStateMachine->ChangeState( EPhoneStateIdle ); |
|
568 |
} |
|
569 |
||
570 |
// ----------------------------------------------------------------------------- |
|
571 |
// CPhoneStateCallSetup::HandleRemoteTerminatedL |
|
572 |
// ----------------------------------------------------------------------------- |
|
573 |
// |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
574 |
void CPhoneStateCallSetup::HandleRemoteTerminatedL( TInt /*aCallId*/ ) |
37 | 575 |
{ |
576 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandleRemoteTerminatedL( ) "); |
|
577 |
||
578 |
// Remove call header |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
579 |
/*iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
37 | 580 |
|
581 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
582 |
globalNotifierParam.SetBoolean( EFalse ); |
|
583 |
iViewCommandHandle->ExecuteCommandL( |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
584 |
EPhoneViewSetGlobalNotifiersDisabled, &globalNotifierParam );*/ |
37 | 585 |
|
586 |
// Video call not possible note is shown by |
|
587 |
// CPhoneErrorMessagesHandler::ShowErrorSpecificNoteL method, |
|
588 |
// if error ECCPErrorCCResourceNotAvailable occured. |
|
589 |
} |
|
590 |
||
591 |
// ----------------------------------------------------------------------------- |
|
592 |
// CPhoneStateCallSetup::HandleAudioOutputChangedL |
|
593 |
// ----------------------------------------------------------------------------- |
|
594 |
// |
|
595 |
void CPhoneStateCallSetup::HandleAudioOutputChangedL() |
|
596 |
{ |
|
597 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateCallSetup::HandleAudioOutputChangedL( ) "); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
598 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
599 |
CPhoneState::HandleAudioOutputChangedL(); |
37 | 600 |
// Update the call setup CBA |
601 |
UpdateInCallCbaL(); |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
602 |
SetTouchPaneButtons(0); |
37 | 603 |
} |
604 |
||
605 |
// ----------------------------------------------------------- |
|
606 |
// CPhoneStateCallSetup::SendDtmfL |
|
607 |
// ----------------------------------------------------------- |
|
608 |
// |
|
609 |
void CPhoneStateCallSetup::SendDtmfL() |
|
610 |
{ |
|
611 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
612 |
"CPhoneStateCallSetup::SendDtmfL()" ); |
|
613 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
614 |
Panic( EPhoneCtrlInvariant ) ); |
|
615 |
||
616 |
// First get the DTMF sequence from dialog |
|
617 |
TPhoneCmdParamString dtmfSequence; |
|
618 |
HBufC *content = HBufC::NewLC( KPEDtmfMaxLength ); |
|
619 |
TPtr ptr( content->Des() ); |
|
620 |
dtmfSequence.SetString( &ptr ); |
|
621 |
||
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
622 |
if ( iOnScreenDialer ) |
37 | 623 |
{ |
624 |
iViewCommandHandle->ExecuteCommand( |
|
625 |
EPhoneViewGetNumberFromEntry, |
|
626 |
&dtmfSequence ); |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
627 |
} |
37 | 628 |
|
629 |
// Send the DTMF |
|
630 |
if ( ptr.Length() ) |
|
631 |
{ |
|
632 |
iStateMachine->PhoneEngineInfo()->SetDtmfStringCommand( ptr ); |
|
633 |
iStateMachine->SendPhoneEngineMessage( |
|
634 |
MPEPhoneModel::EPEMessageSendDTMF ); |
|
635 |
} |
|
636 |
||
637 |
CleanupStack::PopAndDestroy( content ); |
|
638 |
} |
|
639 |
||
640 |
// End of File |