author | hgs |
Fri, 17 Sep 2010 17:09:12 +0300 | |
changeset 74 | d1c62c765e48 |
parent 65 | 2a5d4ab426d3 |
child 78 | baacf668fe89 |
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 |
74 | 109 |
if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
37 | 110 |
{ |
74 | 111 |
iNumberEntryManager->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 ); |
|
74 | 125 |
if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
37 | 126 |
{ |
127 |
iViewCommandHandle->ExecuteCommandL( |
|
128 |
EPhoneViewRemoveNumberEntry ); |
|
129 |
// Do state-specific operation when number entry is cleared |
|
130 |
HandleNumberEntryClearedL(); |
|
131 |
} |
|
132 |
} |
|
65 | 133 |
else // handle short end key |
37 | 134 |
{ |
135 |
DisconnectOutgoingCallL(); |
|
136 |
} |
|
137 |
break; |
|
138 |
||
139 |
default: |
|
140 |
CPhoneGsmInCall::HandleKeyMessageL( aMessage, aCode ); |
|
141 |
break; |
|
142 |
} |
|
143 |
} |
|
144 |
||
145 |
// ----------------------------------------------------------- |
|
146 |
// CPhoneAlerting::HandlePhoneEngineMessageL |
|
147 |
// ----------------------------------------------------------- |
|
148 |
// |
|
149 |
EXPORT_C void CPhoneAlerting::HandlePhoneEngineMessageL( |
|
150 |
const TInt aMessage, |
|
151 |
TInt aCallId ) |
|
152 |
{ |
|
153 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
154 |
"CPhoneAlerting::HandlePhoneEngineMessageL()"); |
|
155 |
switch ( aMessage ) |
|
156 |
{ |
|
157 |
case MEngineMonitor::EPEMessageConnected: |
|
158 |
HandleConnectedL( aCallId ); |
|
159 |
break; |
|
160 |
||
161 |
case MEngineMonitor::EPEMessageDisconnecting: |
|
162 |
HandleDisconnectingL( aCallId ); |
|
163 |
break; |
|
164 |
||
165 |
case MEngineMonitor::EPEMessageRemoteTerminated: |
|
166 |
iViewCommandHandle->ExecuteCommandL( |
|
167 |
EPhoneViewHideNaviPaneAudioVolume ); |
|
168 |
CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId ); |
|
169 |
break; |
|
170 |
||
171 |
case MEngineMonitor::EPEMessageIncoming: |
|
172 |
{ |
|
173 |
// If incoming message is received in alerting state, teardown of |
|
174 |
// alerting call must be ongoing. Handling of the incoming call is |
|
175 |
// buffered until first call teardown is completed. |
|
176 |
iIncomingCallId = aCallId; |
|
177 |
} |
|
178 |
break; |
|
179 |
||
180 |
case MEngineMonitor::EPEMessageIdle: |
|
181 |
{ |
|
182 |
if ( KErrNotFound < iIncomingCallId ) |
|
183 |
{ |
|
184 |
TInt incomingCallId = iIncomingCallId; |
|
185 |
iIncomingCallId = KErrNotFound; |
|
186 |
||
187 |
if ( aCallId != incomingCallId ) |
|
188 |
{ |
|
189 |
CPhoneGsmInCall::HandlePhoneEngineMessageL( |
|
190 |
aMessage, aCallId ); |
|
191 |
// Simulate incoming event which was received while |
|
192 |
// teardown of first call was ongoing. |
|
193 |
iStateMachine->State()->HandlePhoneEngineMessageL( |
|
194 |
MEngineMonitor::EPEMessageIncoming, incomingCallId ); |
|
195 |
} |
|
196 |
||
197 |
return; |
|
198 |
} |
|
199 |
} |
|
200 |
break; |
|
201 |
||
202 |
default: |
|
203 |
break; |
|
204 |
} |
|
205 |
CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId ); |
|
206 |
} |
|
207 |
||
208 |
// ----------------------------------------------------------- |
|
209 |
// CPhoneAlerting::HandleConnectedL |
|
210 |
// ----------------------------------------------------------- |
|
211 |
// |
|
212 |
EXPORT_C void CPhoneAlerting::HandleConnectedL( TInt aCallId ) |
|
213 |
{ |
|
214 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
215 |
"CPhoneAlerting::HandleConnectedL()"); |
|
216 |
BeginUiUpdateLC(); |
|
217 |
UpdateSingleActiveCallL( aCallId ); |
|
74 | 218 |
UpdateUiCommands(); |
37 | 219 |
EndUiUpdate(); |
220 |
iStateMachine->ChangeState( EPhoneStateSingle ); |
|
221 |
} |
|
222 |
||
223 |
// ----------------------------------------------------------- |
|
224 |
// CPhoneAlerting::HandleCommandL |
|
225 |
// ----------------------------------------------------------- |
|
226 |
// |
|
227 |
EXPORT_C TBool CPhoneAlerting::HandleCommandL( TInt aCommand ) |
|
228 |
{ |
|
229 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
230 |
"CPhoneAlerting::HandleCommandL()" ); |
|
50 | 231 |
return CPhoneGsmInCall::HandleCommandL( aCommand ); |
37 | 232 |
} |
233 |
||
234 |
// ----------------------------------------------------------- |
|
235 |
// CPhoneAlerting::IsVideoCallAlertingL |
|
236 |
// ----------------------------------------------------------- |
|
237 |
// |
|
238 |
TBool CPhoneAlerting::IsVideoCallAlertingL() |
|
239 |
{ |
|
240 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
241 |
"CPhoneAlerting::IsVideoCallAlerting()" ); |
|
242 |
TBool retVal = EFalse; |
|
243 |
TPhoneCmdParamCallStateData callStateData; |
|
244 |
callStateData.SetCallState( EPEStateConnecting ); |
|
245 |
iViewCommandHandle->HandleCommandL( |
|
246 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
247 |
if ( callStateData.CallId() > KErrNotFound ) |
|
248 |
{ |
|
249 |
retVal = IsVideoCall( callStateData.CallId() ); |
|
250 |
} |
|
251 |
return retVal; |
|
252 |
} |
|
253 |
||
254 |
// ----------------------------------------------------------- |
|
255 |
// CPhoneAlerting::CheckIfShowTerminationNote |
|
256 |
// ----------------------------------------------------------- |
|
257 |
// |
|
258 |
EXPORT_C TBool CPhoneAlerting::CheckIfShowCallTerminationNote( ) |
|
259 |
{ |
|
260 |
// Alerting state does not need call termination since |
|
261 |
// call has not begun. |
|
262 |
return EFalse; |
|
263 |
} |
|
264 |
||
265 |
// ----------------------------------------------------------- |
|
266 |
// CPhoneAlerting::HandleDisconnectingL |
|
267 |
// ----------------------------------------------------------- |
|
268 |
// |
|
269 |
EXPORT_C void CPhoneAlerting::HandleDisconnectingL( TInt aCallId ) |
|
270 |
{ |
|
271 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
272 |
"CPhoneAlerting::HandleDisconnectingL()" ); |
|
273 |
CPhoneGsmInCall::HandleDisconnectingL( aCallId ); |
|
274 |
} |
|
275 |
||
276 |
// End of File |