author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Mon, 04 Oct 2010 00:16:48 +0300 | |
changeset 77 | 2be0b271d017 |
parent 72 | c76a0b1755b9 |
child 76 | cfea66083b62 |
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 CPhoneStateIncoming class. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
// INCLUDES |
|
20 |
#include <cntdef.h> |
|
21 |
#include <e32base.h> |
|
22 |
#include <eikenv.h> |
|
23 |
#include <featmgr.h> |
|
24 |
#include <StringLoader.h> |
|
25 |
#include <dundomainpskeys.h> |
|
26 |
#include <telephonyvariant.hrh> |
|
27 |
#include <mpeengineinfo.h> |
|
28 |
#include <MediatorDomainUIDs.h> |
|
29 |
#include <videotelcontrolmediatorapi.h> |
|
30 |
||
31 |
#include "cphonepubsubproxy.h" |
|
32 |
#include "phoneui.pan" |
|
33 |
#include "cphonestateincoming.h" |
|
34 |
#include "tphonecmdparamboolean.h" |
|
35 |
#include "tphonecmdparamcallheaderdata.h" |
|
36 |
#include "tphonecmdparaminteger.h" |
|
37 |
#include "tphonecmdparamcallstatedata.h" |
|
38 |
#include "tphonecmdparamringtone.h" |
|
39 |
#include "tphonecmdparamsfidata.h" |
|
40 |
#include "tphonecmdparamstring.h" |
|
41 |
#include "tphonecmdparamglobalnote.h" |
|
42 |
#include "tphonecmdparamdynmenu.h" |
|
43 |
#include "mphonestatemachine.h" |
|
44 |
#include "phonestatedefinitions.h" |
|
45 |
#include "phoneui.hrh" |
|
46 |
#include "phonerssbase.h" |
|
47 |
#include "cphonemainresourceresolver.h" |
|
48 |
#include "phonelogger.h" |
|
49 |
#include "cphonecenrepproxy.h" |
|
50 |
#include "cphonepubsubproxy.h" |
|
51 |
#include "tphonecmdparamquery.h" |
|
52 |
#include "cphonemediatorfactory.h" |
|
53 |
#include "cphonemediatorsender.h" |
|
54 |
#include "cphonereleasecommand.h" |
|
55 |
#include "mphonecustomization.h" |
|
56 |
#include "mphonestorage.h" |
|
57 |
||
58 |
// ================= MEMBER FUNCTIONS ======================= |
|
59 |
||
60 |
// C++ default constructor can NOT contain any code, that |
|
61 |
// might leave. |
|
62 |
// |
|
63 |
EXPORT_C CPhoneStateIncoming::CPhoneStateIncoming( |
|
64 |
MPhoneStateMachine* aStateMachine, |
|
65 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
66 |
MPhoneCustomization* aPhoneCustomization ) : |
|
67 |
CPhoneState( aStateMachine, aViewCommandHandle, aPhoneCustomization ) |
|
68 |
{ |
|
69 |
} |
|
70 |
||
71 |
// ----------------------------------------------------------- |
|
72 |
// CPhoneStateIncoming::~CPhoneStateIncoming() |
|
73 |
// Destructor |
|
74 |
// (other items were commented in a header). |
|
75 |
// ----------------------------------------------------------- |
|
76 |
// |
|
77 |
EXPORT_C CPhoneStateIncoming::~CPhoneStateIncoming() |
|
78 |
{ |
|
79 |
} |
|
80 |
||
81 |
// ----------------------------------------------------------- |
|
82 |
// CPhoneStateIncoming::ConstructL() |
|
83 |
// Constructor |
|
84 |
// (other items were commented in a header). |
|
85 |
// ----------------------------------------------------------- |
|
86 |
// |
|
87 |
EXPORT_C void CPhoneStateIncoming::ConstructL() |
|
88 |
{ |
|
89 |
CPhoneState::BaseConstructL(); |
|
90 |
||
91 |
// Fetch incoming call's id from view |
|
92 |
TPhoneCmdParamCallStateData callStateData; |
|
93 |
callStateData.SetCallState( EPEStateRinging ); |
|
94 |
iViewCommandHandle->HandleCommandL( |
|
95 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
96 |
if( callStateData.CallId() > KErrNotFound ) |
|
97 |
{ |
|
98 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveQuery ); |
|
99 |
iRingingCallId = callStateData.CallId(); |
|
100 |
} |
|
101 |
else |
|
102 |
{ |
|
103 |
__PHONELOG( EOnlyFatal, EPhoneControl, |
|
104 |
"CPhoneStateIncoming::ConstructL - incoming call already in disconnecting state!"); |
|
105 |
} |
|
106 |
} |
|
107 |
||
108 |
// ----------------------------------------------------------- |
|
109 |
// CPhoneStateIncoming::NewL() |
|
110 |
// Constructor |
|
111 |
// (other items were commented in a header). |
|
112 |
// ----------------------------------------------------------- |
|
113 |
// |
|
114 |
CPhoneStateIncoming* CPhoneStateIncoming::NewL( |
|
115 |
MPhoneStateMachine* aStateMachine, |
|
116 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
117 |
MPhoneCustomization* aPhoneCustomization ) |
|
118 |
{ |
|
119 |
CPhoneStateIncoming* self = new (ELeave) CPhoneStateIncoming( |
|
120 |
aStateMachine, aViewCommandHandle, aPhoneCustomization ); |
|
121 |
||
122 |
CleanupStack::PushL( self ); |
|
123 |
self->ConstructL(); |
|
124 |
CleanupStack::Pop( self ); |
|
125 |
||
126 |
return self; |
|
127 |
} |
|
128 |
||
129 |
// ----------------------------------------------------------- |
|
130 |
// CPhoneStateIncoming::HandleKeyEventL |
|
131 |
// ----------------------------------------------------------- |
|
132 |
// |
|
133 |
EXPORT_C void CPhoneStateIncoming::HandleKeyEventL( |
|
134 |
const TKeyEvent& aKeyEvent, |
|
135 |
TEventCode aEventCode ) |
|
136 |
{ |
|
137 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
138 |
"CPhoneStateIncoming::HandleKeyEventL ()" ); |
|
139 |
CPhoneState::HandleKeyEventL( aKeyEvent, aEventCode ); |
|
140 |
} |
|
141 |
||
142 |
// ----------------------------------------------------------- |
|
143 |
// CPhoneStateIncoming::HandleNumberEntryClearedL() |
|
144 |
// ----------------------------------------------------------- |
|
145 |
// |
|
146 |
EXPORT_C void CPhoneStateIncoming::HandleNumberEntryClearedL() |
|
147 |
{ |
|
148 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
149 |
"CPhoneStateIncoming::HandleNumberEntryClearedL ()" ); |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
150 |
UpdateUiCommands(); |
37 | 151 |
} |
152 |
||
153 |
// ----------------------------------------------------------- |
|
154 |
// CPhoneStateIncoming::HandleKeyMessageL |
|
155 |
// ----------------------------------------------------------- |
|
156 |
// |
|
157 |
EXPORT_C void CPhoneStateIncoming::HandleKeyMessageL( |
|
158 |
TPhoneKeyEventMessages aMessage, |
|
159 |
TKeyCode aCode ) |
|
160 |
{ |
|
161 |
__LOGMETHODSTARTEND( EPhoneControl, |
|
162 |
"CPhoneStateIncoming::HandleKeyMessageL ()" ); |
|
163 |
__ASSERT_DEBUG( iStateMachine->PhoneEngineInfo(), |
|
164 |
Panic( EPhoneCtrlInvariant ) ); |
|
165 |
switch ( aCode ) |
|
166 |
{ |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
167 |
case EKeyNo: // end-key |
37 | 168 |
{ |
169 |
if ( aMessage == EPhoneKeyLongPress ) |
|
170 |
{ |
|
171 |
iStateMachine->SendPhoneEngineMessage( |
|
172 |
MPEPhoneModel::EPEMessageTerminateAllConnections ); |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
173 |
if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
37 | 174 |
{ |
175 |
iViewCommandHandle->ExecuteCommandL( |
|
176 |
EPhoneViewRemoveNumberEntry ); |
|
177 |
// Do state-specific operation when number entry is cleared |
|
178 |
HandleNumberEntryClearedL(); |
|
179 |
} |
|
180 |
} |
|
181 |
else |
|
182 |
{ |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
183 |
// handle short end key |
37 | 184 |
DisconnectWaitingCallL(); |
185 |
} |
|
186 |
} |
|
187 |
break; |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
188 |
|
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
189 |
case EKeyYes: // send-key |
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
190 |
if( iNumberEntryManager->IsNumberEntryVisibleL() ) |
37 | 191 |
{ |
192 |
HandleSendL(); |
|
193 |
} |
|
194 |
else |
|
195 |
{ |
|
196 |
AnswerCallL(); |
|
197 |
} |
|
198 |
break; |
|
199 |
||
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
200 |
case EKeyDevice3: // OK key |
37 | 201 |
if ( aMessage == EPhoneKeyLongPress ) |
202 |
{ |
|
203 |
AnswerCallL(); |
|
204 |
} |
|
205 |
break; |
|
206 |
||
207 |
default: |
|
208 |
break; |
|
209 |
} |
|
210 |
} |
|
211 |
||
212 |
// ----------------------------------------------------------- |
|
213 |
// CPhoneStateIncoming::HandleSendL |
|
214 |
// ----------------------------------------------------------- |
|
215 |
// |
|
216 |
void CPhoneStateIncoming::HandleSendL() |
|
217 |
{ |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
218 |
HBufC* phoneNumber = iNumberEntryManager->PhoneNumberFromEntryLC(); |
37 | 219 |
TPtr ptr( phoneNumber->Des() ); |
220 |
||
221 |
iStateMachine->PhoneEngineInfo()->SetPhoneNumber( ptr ); |
|
222 |
iStateMachine->SendPhoneEngineMessage( |
|
223 |
MPEPhoneModel::EPEMessagePhoneNumberEdited ); |
|
224 |
||
225 |
if ( phoneNumber->Des().Length() < KPhoneValidPhoneNumberLength |
|
226 |
&& iStateMachine->PhoneEngineInfo()->PhoneNumberIsServiceCode() ) |
|
227 |
{ |
|
228 |
// Send a manual control sequence by providing number |
|
229 |
// information with dial command |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
230 |
iNumberEntryManager->CallFromNumberEntryL(); |
37 | 231 |
} |
232 |
else |
|
233 |
{ |
|
234 |
iStateMachine->SendPhoneEngineMessage( |
|
235 |
MPEPhoneModel::EPEMessageCheckEmergencyNumber ); |
|
236 |
} |
|
237 |
CleanupStack::PopAndDestroy( phoneNumber ); |
|
238 |
} |
|
239 |
||
240 |
// ----------------------------------------------------------- |
|
241 |
// CPhoneStateIncoming::HandlePhoneEngineMessageL |
|
242 |
// ----------------------------------------------------------- |
|
243 |
// |
|
244 |
EXPORT_C void CPhoneStateIncoming::HandlePhoneEngineMessageL( |
|
245 |
const TInt aMessage, |
|
246 |
TInt aCallId ) |
|
247 |
{ |
|
248 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
249 |
"CPhoneStateIncoming::HandlePhoneEngineMessageL ()" ); |
|
250 |
switch ( aMessage ) |
|
251 |
{ |
|
252 |
case MEngineMonitor::EPEMessageIdle: |
|
253 |
HandleIdleL( aCallId ); |
|
254 |
break; |
|
255 |
||
256 |
case MEngineMonitor::EPEMessageConnected: |
|
257 |
HandleConnectedL( aCallId ); |
|
258 |
break; |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
259 |
|
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
260 |
case MEngineMonitor::EPEMessageDisconnecting: |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
261 |
iCallDisconnected = ETrue; |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
262 |
CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId ); |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
263 |
break; |
37 | 264 |
|
265 |
case MEngineMonitor::EPEMessageInValidEmergencyNumber: |
|
266 |
AnswerCallL(); |
|
267 |
break; |
|
268 |
||
269 |
case MEngineMonitor::EPEMessageValidEmergencyNumber: |
|
270 |
DialVoiceCallL(); |
|
271 |
break; |
|
272 |
||
273 |
case MEngineMonitor::EPEMessageAnswering: |
|
274 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone ); |
|
275 |
break; |
|
276 |
||
277 |
case MEngineMonitor::EPEMessageAudioOutputChanged: |
|
278 |
HandleAudioOutputChangedL(); |
|
279 |
break; |
|
280 |
||
281 |
case MEngineMonitor::EPEMessageMuteRingingTone: |
|
282 |
// Silence the ringer. And stop vibrating, if it is active. |
|
283 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone ); |
|
284 |
HandleAudioPlayStoppedL(); |
|
285 |
iStateMachine->SendPhoneEngineMessage( |
|
286 |
MPEPhoneModel::EPEMessageStopTonePlay ); |
|
287 |
break; |
|
288 |
||
289 |
case MEngineMonitor::EPEMessageAvailableAudioOutputsChanged: |
|
290 |
HandleAudioAvailableOutputChangedL(); |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
291 |
// Do not update CBA's. |
37 | 292 |
break; |
293 |
||
294 |
case MEngineMonitor::EPEMessageRemotePartyInfoChanged: |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
295 |
if(!iCallDisconnected) |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
296 |
{ |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
297 |
UpdateRemoteInfoDataAndLabelL( aCallId ); |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
298 |
} |
37 | 299 |
break; |
300 |
||
301 |
default: |
|
302 |
CPhoneState::HandlePhoneEngineMessageL( aMessage, aCallId ); |
|
303 |
break; |
|
304 |
} |
|
305 |
} |
|
306 |
||
307 |
// ----------------------------------------------------------- |
|
308 |
// CPhoneStateIncoming::UpdateRemoteInfoDataAndLabelL |
|
309 |
// ----------------------------------------------------------- |
|
310 |
// |
|
311 |
void CPhoneStateIncoming::UpdateRemoteInfoDataAndLabelL( |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
312 |
TInt aCallId ) |
37 | 313 |
{ |
314 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
315 |
"CPhoneStateIncoming::UpdateRemoteInfoDataAndLabelL ()" ); |
|
316 |
iViewCommandHandle->ExecuteCommandL( |
|
317 |
EPhoneViewUpdateCallHeaderRemoteInfoDataAndLabel, |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
318 |
aCallId ); |
37 | 319 |
} |
320 |
||
321 |
// ----------------------------------------------------------- |
|
322 |
// CPhoneStateIncoming::HandleConnectedL |
|
323 |
// ----------------------------------------------------------- |
|
324 |
// |
|
325 |
void CPhoneStateIncoming::HandleConnectedL( TInt aCallId ) |
|
326 |
{ |
|
327 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
328 |
"CPhoneStateIncoming::HandleConnectedL ()" ); |
|
329 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
330 |
globalNotifierParam.SetBoolean( EFalse ); |
|
331 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
332 |
&globalNotifierParam ); |
|
333 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetEikonNotifiersDisabled, |
|
334 |
&globalNotifierParam ); |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
335 |
|
37 | 336 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone ); |
337 |
||
338 |
BeginUiUpdateLC(); |
|
339 |
UpdateSingleActiveCallL( aCallId ); |
|
340 |
||
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
341 |
UpdateUiCommands(); |
37 | 342 |
SetBackButtonActive(ETrue); |
343 |
EndUiUpdate(); |
|
344 |
||
345 |
iStateMachine->ChangeState( EPhoneStateSingle ); |
|
346 |
} |
|
347 |
||
348 |
// ----------------------------------------------------------- |
|
349 |
// CPhoneStateIncoming::HandleAudioPlayStoppedL |
|
350 |
// ----------------------------------------------------------- |
|
351 |
// |
|
352 |
EXPORT_C void CPhoneStateIncoming::HandleAudioPlayStoppedL() |
|
353 |
{ |
|
354 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
355 |
"CPhoneStateIncoming::HandleAudioPlayStoppedL ()" ); |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
356 |
UpdateUiCommands(); |
37 | 357 |
} |
358 |
||
359 |
// ----------------------------------------------------------- |
|
360 |
// CPhoneStateIncoming::HandleIdleL |
|
361 |
// ----------------------------------------------------------- |
|
362 |
// |
|
363 |
void CPhoneStateIncoming::HandleIdleL( TInt aCallId ) |
|
364 |
{ |
|
365 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
366 |
"CPhoneStateIncoming::HandleIdleL ()" ); |
|
367 |
BeginUiUpdateLC(); |
|
368 |
||
369 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
|
370 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone ); |
|
371 |
||
372 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
373 |
globalNotifierParam.SetBoolean( EFalse ); |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
374 |
iViewCommandHandle->ExecuteCommandL( |
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
375 |
EPhoneViewSetEikonNotifiersDisabled, |
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
376 |
&globalNotifierParam ); |
37 | 377 |
SetDefaultFlagsL(); |
378 |
||
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
379 |
if ( !iNumberEntryManager->SetVisibilityIfNumberEntryUsedL( ETrue ) ) |
37 | 380 |
{ |
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
381 |
RemoveDialogsAndSendPhoneToBackgroundL(); |
37 | 382 |
} |
383 |
||
384 |
DeleteTouchPaneButtons(); |
|
385 |
SetBackButtonActive(ETrue); |
|
386 |
||
387 |
EndUiUpdate(); |
|
388 |
iStateMachine->ChangeState( EPhoneStateIdle ); |
|
389 |
} |
|
390 |
||
391 |
// ----------------------------------------------------------- |
|
392 |
// CPhoneStateIncoming::HandleCommandL |
|
393 |
// ----------------------------------------------------------- |
|
394 |
// |
|
395 |
EXPORT_C TBool CPhoneStateIncoming::HandleCommandL( TInt aCommand ) |
|
396 |
{ |
|
397 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
398 |
"CPhoneStateIncoming::HandleCommandL ()" ); |
|
399 |
TBool commandStatus = ETrue; |
|
400 |
switch( aCommand ) |
|
401 |
{ |
|
402 |
case EPhoneCmdOptions: |
|
403 |
// Stop tone playing, if necessary. |
|
404 |
// And stop vibrating, if it is active. |
|
405 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone ); |
|
406 |
break; |
|
407 |
||
408 |
case EPhoneCallComingCmdAnswer: |
|
409 |
AnswerCallL(); |
|
410 |
break; |
|
411 |
||
412 |
case EPhoneCallComingCmdAnswerHandPortableVideo: |
|
413 |
case EPhoneCallComingCmdAnswerHandPortable: |
|
414 |
iStateMachine->PhoneEngineInfo()->SetAudioOutputCommand( |
|
415 |
EPEHandset, ETrue ); |
|
416 |
iStateMachine->SendPhoneEngineMessage( |
|
417 |
MPEPhoneModel::EPEMessageSetAudioOutput ); |
|
418 |
AnswerCallL(); |
|
419 |
break; |
|
420 |
||
421 |
case EPhoneCallComingCmdReject: |
|
422 |
DisconnectWaitingCallL(); |
|
423 |
break; |
|
424 |
||
425 |
case EPhoneCallComingCmdSilent: |
|
426 |
// Silence the ringer. And stop vibrating, if it is active. |
|
427 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewMuteRingTone ); |
|
428 |
HandleAudioPlayStoppedL(); |
|
429 |
iStateMachine->SendPhoneEngineMessage( |
|
430 |
MPEPhoneModel::EPEMessageStopTonePlay ); |
|
431 |
break; |
|
432 |
||
433 |
case EPhoneCallComingCmdSoftReject: |
|
434 |
OpenSoftRejectMessageL(); |
|
435 |
break; |
|
436 |
||
437 |
case EPhoneNumberAcqCmdSendCommand: |
|
438 |
HandleSendL(); |
|
439 |
break; |
|
440 |
||
441 |
default: |
|
442 |
commandStatus = CPhoneState::HandleCommandL( aCommand ); |
|
443 |
break; |
|
444 |
} |
|
445 |
return commandStatus; |
|
446 |
} |
|
447 |
||
448 |
// ----------------------------------------------------------- |
|
449 |
// CPhoneStateIncoming::AnswerCallL |
|
450 |
// ----------------------------------------------------------- |
|
451 |
// |
|
452 |
void CPhoneStateIncoming::AnswerCallL() |
|
453 |
{ |
|
454 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
455 |
"CPhoneStateIncoming::AnswerCallL ()" ); |
|
456 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewMuteRingToneOnAnswer ); |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
457 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageAnswer ); |
37 | 458 |
} |
459 |
||
460 |
// ----------------------------------------------------------- |
|
461 |
// CPhoneStateIncoming::DisconnectWaitingCallL |
|
462 |
// ----------------------------------------------------------- |
|
463 |
// |
|
464 |
void CPhoneStateIncoming::DisconnectWaitingCallL() |
|
465 |
{ |
|
466 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
467 |
"CPhoneStateIncoming::DisconnectWaitingCallL ()" ); |
|
468 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone ); |
|
469 |
||
470 |
// The ringing call might have changed |
|
471 |
TPhoneCmdParamCallStateData callStateData; |
|
472 |
callStateData.SetCallState( EPEStateRinging ); |
|
473 |
iViewCommandHandle->HandleCommandL( |
|
474 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
475 |
||
476 |
if ( callStateData.CallId() > KErrNotFound ) |
|
477 |
{ |
|
478 |
iRingingCallId = callStateData.CallId(); |
|
479 |
} |
|
480 |
||
481 |
iStateMachine->SetCallId( iRingingCallId ); |
|
482 |
||
483 |
if( IsVideoCall( iRingingCallId ) ) |
|
484 |
{ |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
485 |
// Video call can be released only after we get response |
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
486 |
// to VT Shutdown Command. |
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
487 |
CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( |
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
488 |
KMediatorVideoTelephonyDomain, |
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
489 |
KCatPhoneToVideotelCommands, |
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
490 |
EVtCmdReleaseDataport, |
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
491 |
TVersion( KPhoneToVideotelCmdVersionMajor, |
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
492 |
KPhoneToVideotelCmdVersionMinor, |
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
493 |
KPhoneToVideotelCmdVersionBuild ), |
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
494 |
KNullDesC8, |
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
495 |
CPhoneReleaseCommand::NewL( *iStateMachine ) ); |
37 | 496 |
} |
497 |
else |
|
498 |
{ |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
499 |
iStateMachine->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageRelease ); |
37 | 500 |
} |
501 |
ShowDisconnectingL( iRingingCallId ); |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
502 |
|
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
503 |
iCallDisconnected = ETrue; |
37 | 504 |
} |
505 |
||
506 |
// ----------------------------------------------------------- |
|
507 |
// CPhoneStateIncoming::OpenSoftRejectMessageEditorL |
|
508 |
// ----------------------------------------------------------- |
|
509 |
// |
|
510 |
void CPhoneStateIncoming::OpenSoftRejectMessageL() |
|
511 |
{ |
|
512 |
__LOGMETHODSTARTEND(EPhoneControl, |
|
513 |
"CPhoneStateIncoming::OpenSoftRejectMessageEditorL ()" ); |
|
514 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone ); |
|
515 |
iStateMachine->SendPhoneEngineMessage( |
|
516 |
MPEPhoneModel::EPEMessageStopTonePlay ); |
|
517 |
||
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
518 |
iUiCommandManager->SetSoftRejectStatus( EFalse ); |
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
519 |
|
37 | 520 |
// Re-enable global notes. Otherwise message editor is not opened. |
521 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
522 |
globalNotifierParam.SetBoolean( EFalse ); |
|
523 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetEikonNotifiersDisabled, |
|
524 |
&globalNotifierParam ); |
|
525 |
||
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
526 |
UpdateUiCommands(); |
37 | 527 |
|
528 |
TPhoneCmdParamSfiData sfiDataParam; |
|
529 |
if ( iStateMachine->PhoneEngineInfo()->RemoteName( iRingingCallId ).Length() ) |
|
530 |
{ |
|
531 |
// store both the name and the number |
|
532 |
sfiDataParam.SetNumber( iStateMachine->PhoneEngineInfo()->RemotePhoneNumber( iRingingCallId ) ); |
|
533 |
sfiDataParam.SetName( iStateMachine->PhoneEngineInfo()->RemoteName( iRingingCallId ) ); |
|
534 |
} |
|
535 |
else |
|
536 |
{ |
|
537 |
// store the number |
|
538 |
sfiDataParam.SetNumber( iStateMachine->PhoneEngineInfo()->RemotePhoneNumber( iRingingCallId ) ); |
|
539 |
} |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
540 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewOpenSoftRejectEditor, &sfiDataParam ); |
37 | 541 |
} |
542 |
||
543 |
||
544 |
// ----------------------------------------------------------- |
|
545 |
// CPhoneStateIncoming::GetNumberEntryVisibleMenuBar |
|
546 |
// ----------------------------------------------------------- |
|
547 |
// |
|
548 |
TInt CPhoneStateIncoming::GetNumberEntryVisibleMenuBar() |
|
549 |
{ |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
550 |
TInt resource(EPhoneIncomingCallMenubarWithNumberEntry); |
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
551 |
if( IsVideoCall ( iRingingCallId ) ) |
37 | 552 |
{ |
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
553 |
resource = EPhoneIncomingVideoCallMenubarWithNumberEntry; |
37 | 554 |
} |
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
555 |
return resource; |
37 | 556 |
} |
557 |
||
558 |
// ----------------------------------------------------------- |
|
559 |
// CPhoneStateIncoming::GetNumberEntryNotVisibleMenuBar |
|
560 |
// ----------------------------------------------------------- |
|
561 |
// |
|
562 |
TInt CPhoneStateIncoming::GetNumberEntryNotVisibleMenuBar() |
|
563 |
{ |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
564 |
TInt resource(EPhoneIncomingCallMenubar); |
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
565 |
if( IsVideoCall ( iRingingCallId ) ) |
37 | 566 |
{ |
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
567 |
resource = EPhoneIncomingVideoCallMenubar; |
37 | 568 |
} |
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
569 |
return resource; |
37 | 570 |
} |
571 |
||
572 |
// ----------------------------------------------------------- |
|
573 |
// CPhoneStateIncoming::ShowDisconnectingL |
|
574 |
// ----------------------------------------------------------- |
|
575 |
// |
|
576 |
void CPhoneStateIncoming::ShowDisconnectingL( TInt aCallId ) |
|
577 |
{ |
|
578 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIncoming::ShowDisconnectingL( ) "); |
|
579 |
||
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
580 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId); |
37 | 581 |
} |
582 |
||
583 |
||
584 |
// End of File |