author | hgs |
Fri, 03 Sep 2010 13:33:36 +0300 | |
changeset 65 | 2a5d4ab426d3 |
parent 50 | 377c906a8701 |
child 74 | d1c62c765e48 |
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 CPhoneAlerting class. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
// INCLUDES |
|
20 |
#include <pevirtualengine.h> |
|
21 |
#include <mpeengineinfo.h> |
|
22 |
#include <mpeclientinformation.h> |
|
23 |
#include <MediatorDomainUIDs.h> |
|
24 |
#include "cphonealerting.h" |
|
25 |
#include "mphonestatemachine.h" |
|
26 |
#include "tphonecmdparamboolean.h" |
|
27 |
#include "tphonecmdparaminteger.h" |
|
28 |
#include "tphonecmdparamcallstatedata.h" |
|
29 |
#include "phoneviewcommanddefinitions.h" |
|
30 |
#include "phoneui.hrh" |
|
31 |
#include "cphonemainresourceresolver.h" |
|
32 |
#include "phonerssbase.h" |
|
33 |
#include "phonestatedefinitionsgsm.h" |
|
34 |
#include "phonelogger.h" |
|
35 |
#include "phoneconstants.h" |
|
36 |
#include "cphonemediatorfactory.h" |
|
37 |
#include "cphonemediatorsender.h" |
|
38 |
||
39 |
||
40 |
// ================= MEMBER FUNCTIONS ======================= |
|
41 |
||
42 |
// C++ default constructor can NOT contain any code, that |
|
43 |
// might leave. |
|
44 |
// |
|
45 |
EXPORT_C CPhoneAlerting::CPhoneAlerting( |
|
46 |
MPhoneStateMachine* aStateMachine, |
|
47 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
48 |
MPhoneCustomization* aPhoneCustomization ) : |
|
49 |
CPhoneGsmInCall( aStateMachine, aViewCommandHandle, aPhoneCustomization ), |
|
50 |
iIncomingCallId( KErrNotFound ) |
|
51 |
{ |
|
52 |
} |
|
53 |
||
54 |
// ----------------------------------------------------------- |
|
55 |
// CPhoneAlerting::~CPhoneAlerting() |
|
56 |
// Destructor |
|
57 |
// (other items were commented in a header). |
|
58 |
// ----------------------------------------------------------- |
|
59 |
// |
|
60 |
EXPORT_C CPhoneAlerting::~CPhoneAlerting() |
|
61 |
{ |
|
62 |
} |
|
63 |
||
64 |
// ----------------------------------------------------------- |
|
65 |
// CPhoneAlerting::ConstructL() |
|
66 |
// Constructor |
|
67 |
// (other items were commented in a header). |
|
68 |
// ----------------------------------------------------------- |
|
69 |
// |
|
70 |
EXPORT_C void CPhoneAlerting::ConstructL() |
|
71 |
{ |
|
72 |
CPhoneGsmInCall::ConstructL(); |
|
73 |
} |
|
74 |
||
75 |
// ----------------------------------------------------------- |
|
76 |
// CPhoneAlerting::NewL() |
|
77 |
// Constructor |
|
78 |
// (other items were commented in a header). |
|
79 |
// ----------------------------------------------------------- |
|
80 |
// |
|
81 |
CPhoneAlerting* CPhoneAlerting::NewL( |
|
82 |
MPhoneStateMachine* aStateMachine, |
|
83 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
84 |
MPhoneCustomization* aPhoneCustomization ) |
|
85 |
{ |
|
86 |
CPhoneAlerting* self = new( ELeave ) CPhoneAlerting( |
|
87 |
aStateMachine, aViewCommandHandle, aPhoneCustomization ); |
|
88 |
||
89 |
CleanupStack::PushL( self ); |
|
90 |
self->ConstructL(); |
|
91 |
CleanupStack::Pop( self ); |
|
92 |
||
93 |
return self; |
|
94 |
} |
|
95 |
||
96 |
// -------------------------------------------------------------- |
|
97 |
// CPhoneAlerting::HandleKeyMessageL |
|
98 |
// -------------------------------------------------------------- |
|
99 |
// |
|
100 |
EXPORT_C void CPhoneAlerting::HandleKeyMessageL( |
|
101 |
TPhoneKeyEventMessages aMessage, |
|
102 |
TKeyCode aCode ) |
|
103 |
{ |
|
104 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
105 |
"CPhoneAlerting::HandleKeyMessageL()"); |
|
106 |
switch ( aCode ) |
|
107 |
{ |
|
65 | 108 |
case EKeyYes: // send-key |
37 | 109 |
if ( IsNumberEntryUsedL() ) |
110 |
{ |
|
65 | 111 |
CallFromNumberEntryL(); |
37 | 112 |
} |
113 |
else |
|
114 |
{ |
|
115 |
SendGlobalErrorNoteL( |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
116 |
EPhoneNoteTextNotAllowed, ETrue ); |
37 | 117 |
} |
118 |
break; |
|
119 |
||
65 | 120 |
case EKeyNo: // end-key |
37 | 121 |
if ( aMessage == EPhoneKeyLongPress ) |
122 |
{ |
|
123 |
iStateMachine->SendPhoneEngineMessage( |
|
124 |
MPEPhoneModel::EPEMessageTerminateAllConnections ); |
|
125 |
if ( IsNumberEntryUsedL() ) |
|
126 |
{ |
|
127 |
iViewCommandHandle->ExecuteCommandL( |
|
128 |
EPhoneViewRemoveNumberEntry ); |
|
129 |
// Do state-specific operation when number entry is cleared |
|
130 |
HandleNumberEntryClearedL(); |
|
131 |
} |
|
132 |
if ( !TopAppIsDisplayedL() ) |
|
133 |
{ |
|
134 |
TPhoneCmdParamInteger uidParam; |
|
135 |
uidParam.SetInteger( KUidPhoneApplication.iUid ); |
|
136 |
iViewCommandHandle->ExecuteCommandL( |
|
137 |
EPhoneViewBringAppToForeground, &uidParam ); |
|
138 |
} |
|
139 |
} |
|
65 | 140 |
else // handle short end key |
37 | 141 |
{ |
142 |
DisconnectOutgoingCallL(); |
|
143 |
} |
|
144 |
break; |
|
145 |
||
146 |
default: |
|
147 |
CPhoneGsmInCall::HandleKeyMessageL( aMessage, aCode ); |
|
148 |
break; |
|
149 |
} |
|
150 |
} |
|
151 |
||
152 |
// ----------------------------------------------------------- |
|
153 |
// CPhoneAlerting::HandlePhoneEngineMessageL |
|
154 |
// ----------------------------------------------------------- |
|
155 |
// |
|
156 |
EXPORT_C void CPhoneAlerting::HandlePhoneEngineMessageL( |
|
157 |
const TInt aMessage, |
|
158 |
TInt aCallId ) |
|
159 |
{ |
|
160 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
161 |
"CPhoneAlerting::HandlePhoneEngineMessageL()"); |
|
162 |
switch ( aMessage ) |
|
163 |
{ |
|
164 |
case MEngineMonitor::EPEMessageConnected: |
|
165 |
HandleConnectedL( aCallId ); |
|
166 |
break; |
|
167 |
||
168 |
case MEngineMonitor::EPEMessageDisconnecting: |
|
169 |
HandleDisconnectingL( aCallId ); |
|
170 |
break; |
|
171 |
||
172 |
case MEngineMonitor::EPEMessageRemoteTerminated: |
|
173 |
iViewCommandHandle->ExecuteCommandL( |
|
174 |
EPhoneViewHideNaviPaneAudioVolume ); |
|
175 |
CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId ); |
|
176 |
break; |
|
177 |
||
178 |
case MEngineMonitor::EPEMessageIncoming: |
|
179 |
{ |
|
180 |
// If incoming message is received in alerting state, teardown of |
|
181 |
// alerting call must be ongoing. Handling of the incoming call is |
|
182 |
// buffered until first call teardown is completed. |
|
183 |
iIncomingCallId = aCallId; |
|
184 |
} |
|
185 |
break; |
|
186 |
||
187 |
case MEngineMonitor::EPEMessageIdle: |
|
188 |
{ |
|
189 |
if ( KErrNotFound < iIncomingCallId ) |
|
190 |
{ |
|
191 |
TInt incomingCallId = iIncomingCallId; |
|
192 |
iIncomingCallId = KErrNotFound; |
|
193 |
||
194 |
if ( aCallId != incomingCallId ) |
|
195 |
{ |
|
196 |
CPhoneGsmInCall::HandlePhoneEngineMessageL( |
|
197 |
aMessage, aCallId ); |
|
198 |
// Simulate incoming event which was received while |
|
199 |
// teardown of first call was ongoing. |
|
200 |
iStateMachine->State()->HandlePhoneEngineMessageL( |
|
201 |
MEngineMonitor::EPEMessageIncoming, incomingCallId ); |
|
202 |
} |
|
203 |
||
204 |
return; |
|
205 |
} |
|
206 |
} |
|
207 |
break; |
|
208 |
||
209 |
default: |
|
210 |
break; |
|
211 |
} |
|
212 |
CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId ); |
|
213 |
} |
|
214 |
||
215 |
// ----------------------------------------------------------- |
|
216 |
// CPhoneAlerting::HandleConnectedL |
|
217 |
// ----------------------------------------------------------- |
|
218 |
// |
|
219 |
EXPORT_C void CPhoneAlerting::HandleConnectedL( TInt aCallId ) |
|
220 |
{ |
|
221 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
222 |
"CPhoneAlerting::HandleConnectedL()"); |
|
223 |
TPhoneCmdParamBoolean booleanParam; |
|
224 |
booleanParam.SetBoolean( EFalse ); |
|
225 |
iViewCommandHandle->ExecuteCommandL( |
|
226 |
EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam ); |
|
227 |
BeginUiUpdateLC(); |
|
228 |
UpdateSingleActiveCallL( aCallId ); |
|
65 | 229 |
SetTouchPaneButtons( EPhoneIncallButtons ); |
37 | 230 |
EndUiUpdate(); |
65 | 231 |
UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
37 | 232 |
iStateMachine->ChangeState( EPhoneStateSingle ); |
233 |
} |
|
234 |
||
235 |
// ----------------------------------------------------------- |
|
236 |
// CPhoneAlerting::HandleCommandL |
|
237 |
// ----------------------------------------------------------- |
|
238 |
// |
|
239 |
EXPORT_C TBool CPhoneAlerting::HandleCommandL( TInt aCommand ) |
|
240 |
{ |
|
241 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
242 |
"CPhoneAlerting::HandleCommandL()" ); |
|
50 | 243 |
return CPhoneGsmInCall::HandleCommandL( aCommand ); |
37 | 244 |
} |
245 |
||
246 |
// ----------------------------------------------------------- |
|
247 |
// CPhoneAlerting::IsVideoCallAlertingL |
|
248 |
// ----------------------------------------------------------- |
|
249 |
// |
|
250 |
TBool CPhoneAlerting::IsVideoCallAlertingL() |
|
251 |
{ |
|
252 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
253 |
"CPhoneAlerting::IsVideoCallAlerting()" ); |
|
254 |
TBool retVal = EFalse; |
|
255 |
TPhoneCmdParamCallStateData callStateData; |
|
256 |
callStateData.SetCallState( EPEStateConnecting ); |
|
257 |
iViewCommandHandle->HandleCommandL( |
|
258 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
259 |
if ( callStateData.CallId() > KErrNotFound ) |
|
260 |
{ |
|
261 |
retVal = IsVideoCall( callStateData.CallId() ); |
|
262 |
} |
|
263 |
return retVal; |
|
264 |
} |
|
265 |
||
266 |
// ----------------------------------------------------------- |
|
267 |
// CPhoneAlerting::CheckIfShowTerminationNote |
|
268 |
// ----------------------------------------------------------- |
|
269 |
// |
|
270 |
EXPORT_C TBool CPhoneAlerting::CheckIfShowCallTerminationNote( ) |
|
271 |
{ |
|
272 |
// Alerting state does not need call termination since |
|
273 |
// call has not begun. |
|
274 |
return EFalse; |
|
275 |
} |
|
276 |
||
277 |
// ----------------------------------------------------------- |
|
278 |
// CPhoneAlerting::HandleDisconnectingL |
|
279 |
// ----------------------------------------------------------- |
|
280 |
// |
|
281 |
EXPORT_C void CPhoneAlerting::HandleDisconnectingL( TInt aCallId ) |
|
282 |
{ |
|
283 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
284 |
"CPhoneAlerting::HandleDisconnectingL()" ); |
|
285 |
CPhoneGsmInCall::HandleDisconnectingL( aCallId ); |
|
286 |
} |
|
287 |
||
288 |
// End of File |