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 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 CPhoneTwoSinglesAndWaiting class. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
// INCLUDES |
|
20 |
#include <pevirtualengine.h> |
|
21 |
#include <StringLoader.h> |
|
22 |
#include <mpeengineinfo.h> |
|
23 |
#include <featmgr.h> |
|
24 |
#include "cphonetwosinglesandwaiting.h" |
|
25 |
#include "tphonecmdparamboolean.h" |
|
26 |
#include "mphonestatemachine.h" |
|
27 |
#include "tphonecmdparamboolean.h" |
|
28 |
#include "tphonecmdparaminteger.h" |
|
29 |
#include "tphonecmdparamcallheaderdata.h" |
|
30 |
#include "tphonecmdparamglobalnote.h" |
|
31 |
#include "tphonecmdparamstring.h" |
|
32 |
#include "tphonecmdparamcallstatedata.h" |
|
33 |
#include "phoneviewcommanddefinitions.h" |
|
34 |
#include "phoneui.hrh" |
|
35 |
#include "cphonemainresourceresolver.h" |
|
36 |
#include "phonerssbase.h" |
|
37 |
#include "phonestatedefinitionsgsm.h" |
|
38 |
#include "phonelogger.h" |
|
39 |
#include "mphonestorage.h" |
|
40 |
||
41 |
// ================= MEMBER FUNCTIONS ======================= |
|
42 |
||
43 |
// C++ default constructor can NOT contain any code, that |
|
44 |
// might leave. |
|
45 |
// |
|
46 |
CPhoneTwoSinglesAndWaiting::CPhoneTwoSinglesAndWaiting( |
|
47 |
MPhoneStateMachine* aStateMachine, |
|
48 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
49 |
MPhoneCustomization* aPhoneCustomization ) : |
|
50 |
CPhoneTwoSingles( aStateMachine, aViewCommandHandle, aPhoneCustomization ) |
|
51 |
{ |
|
52 |
} |
|
53 |
||
54 |
// ----------------------------------------------------------- |
|
55 |
// CPhoneTwoSinglesAndWaiting::~CPhoneTwoSinglesAndWaiting() |
|
56 |
// Destructor |
|
57 |
// (other items were commented in a header). |
|
58 |
// ----------------------------------------------------------- |
|
59 |
// |
|
60 |
CPhoneTwoSinglesAndWaiting::~CPhoneTwoSinglesAndWaiting() |
|
61 |
{ |
|
62 |
} |
|
63 |
||
64 |
// ----------------------------------------------------------- |
|
65 |
// CPhoneTwoSinglesAndWaiting::ConstructL() |
|
66 |
// Constructor |
|
67 |
// (other items were commented in a header). |
|
68 |
// ----------------------------------------------------------- |
|
69 |
// |
|
70 |
void CPhoneTwoSinglesAndWaiting::ConstructL() |
|
71 |
{ |
|
72 |
CPhoneTwoSingles::ConstructL(); |
|
73 |
||
74 |
TPhoneCmdParamCallStateData callStateData; |
|
75 |
callStateData.SetCallState( EPEStateRinging ); |
|
76 |
iViewCommandHandle->HandleCommandL( |
|
77 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
78 |
iRingingCallId = callStateData.CallId(); |
|
79 |
} |
|
80 |
||
81 |
// ----------------------------------------------------------- |
|
82 |
// CPhoneTwoSinglesAndWaiting::NewL() |
|
83 |
// Constructor |
|
84 |
// (other items were commented in a header). |
|
85 |
// ----------------------------------------------------------- |
|
86 |
// |
|
87 |
CPhoneTwoSinglesAndWaiting* CPhoneTwoSinglesAndWaiting::NewL( |
|
88 |
MPhoneStateMachine* aStateMachine, |
|
89 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
90 |
MPhoneCustomization* aPhoneCustomization ) |
|
91 |
{ |
|
92 |
CPhoneTwoSinglesAndWaiting* self = new( ELeave ) CPhoneTwoSinglesAndWaiting( |
|
93 |
aStateMachine, aViewCommandHandle, aPhoneCustomization ); |
|
94 |
||
95 |
CleanupStack::PushL( self ); |
|
96 |
self->ConstructL(); |
|
97 |
CleanupStack::Pop( self ); |
|
98 |
||
99 |
return self; |
|
100 |
} |
|
101 |
||
102 |
// ----------------------------------------------------------- |
|
103 |
// CPhoneTwoSinglesAndWaiting::HandleKeyMessageL |
|
104 |
// ----------------------------------------------------------- |
|
105 |
// |
|
106 |
void CPhoneTwoSinglesAndWaiting::HandleKeyMessageL( |
|
107 |
TPhoneKeyEventMessages aMessage, |
|
108 |
TKeyCode aCode ) |
|
109 |
{ |
|
110 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
111 |
"CPhoneTwoSinglesAndWaiting::HandleKeyMessageL()"); |
|
112 |
switch ( aCode ) |
|
113 |
{ |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
114 |
case EKeyYes: // send-key |
37 | 115 |
{ |
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
116 |
if( iNumberEntryManager->IsNumberEntryVisibleL() ) |
37 | 117 |
{ |
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
118 |
iNumberEntryManager->CallFromNumberEntryL(); |
37 | 119 |
} |
120 |
else |
|
121 |
{ |
|
122 |
// Waiting call bubble is over number entry |
|
123 |
// so display not allowed note because we |
|
124 |
// can't answer the call |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
125 |
SendGlobalWarningNoteL( EPhoneNoteTextCallNotAllowed, ETrue ); |
37 | 126 |
} |
127 |
break; |
|
128 |
} |
|
129 |
||
130 |
default: |
|
131 |
CPhoneTwoSingles::HandleKeyMessageL( aMessage, aCode ); |
|
132 |
break; |
|
133 |
} |
|
134 |
} |
|
135 |
||
136 |
// ----------------------------------------------------------- |
|
137 |
// CPhoneTwoSinglesAndWaiting::HandlePhoneEngineMessageL |
|
138 |
// ----------------------------------------------------------- |
|
139 |
// |
|
140 |
void CPhoneTwoSinglesAndWaiting::HandlePhoneEngineMessageL( |
|
141 |
const TInt aMessage, |
|
142 |
TInt aCallId ) |
|
143 |
{ |
|
144 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
145 |
"CPhoneTwoSinglesAndWaiting::HandlePhoneEngineMessageL()"); |
|
146 |
switch ( aMessage ) |
|
147 |
{ |
|
148 |
case MEngineMonitor::EPEMessageIdle: |
|
149 |
HandleIdleL( aCallId ); |
|
150 |
break; |
|
151 |
case MEngineMonitor::EPEMessageConnected: |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
152 |
UpdateUiCommands(); |
37 | 153 |
CPhoneTwoSingles::HandlePhoneEngineMessageL( aMessage, aCallId ); |
154 |
break; |
|
155 |
default: |
|
156 |
CPhoneTwoSingles::HandlePhoneEngineMessageL( aMessage, aCallId ); |
|
157 |
break; |
|
158 |
} |
|
159 |
} |
|
160 |
||
161 |
// ----------------------------------------------------------- |
|
162 |
// CPhoneTwoSinglesAndWaiting::HandleErrorL |
|
163 |
// ----------------------------------------------------------- |
|
164 |
// |
|
165 |
EXPORT_C void CPhoneTwoSinglesAndWaiting::HandleErrorL( |
|
166 |
const TPEErrorInfo& aErrorInfo ) |
|
167 |
{ |
|
168 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneTwoSinglesAndWaiting::HandleErrorL()"); |
|
169 |
||
170 |
if( aErrorInfo.iErrorCode == ECCPErrorCCUserAlertingNoAnswer ) |
|
171 |
{ |
|
172 |
// Should not shown "No Answer" note |
|
173 |
__PHONELOG1( EBasic, EPhoneUIStates, |
|
174 |
"PhoneUIControl: CPhoneTwoSinglesAndWaiting::HandleErrorL - aErrorInfo.iErrorCode =%d ", |
|
175 |
aErrorInfo.iErrorCode); |
|
176 |
} |
|
177 |
else |
|
178 |
{ |
|
179 |
CPhoneState::HandleErrorL( aErrorInfo ); |
|
180 |
} |
|
181 |
} |
|
182 |
||
183 |
// ----------------------------------------------------------- |
|
184 |
// CPhoneTwoSinglesAndWaiting::HandleIdleL |
|
185 |
// ----------------------------------------------------------- |
|
186 |
// |
|
187 |
void CPhoneTwoSinglesAndWaiting::HandleIdleL( TInt aCallId ) |
|
188 |
{ |
|
189 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
190 |
"CPhoneTwoSinglesAndWaiting::HandleIdleL()"); |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
191 |
BeginUiUpdateLC(); |
37 | 192 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
193 |
||
194 |
if ( iRingingCallId == aCallId ) |
|
195 |
{ |
|
196 |
StateTransitionToTwoSinglesL(); |
|
197 |
} |
|
198 |
else |
|
199 |
{ |
|
200 |
StateTransitionToSingleAndWaitingL(); |
|
201 |
} |
|
202 |
EndUiUpdate(); |
|
203 |
} |
|
204 |
||
205 |
// ----------------------------------------------------------- |
|
206 |
// CPhoneTwoSinglesAndWaiting::StateTransitionToTwoSinglesL |
|
207 |
// ----------------------------------------------------------- |
|
208 |
// |
|
209 |
void CPhoneTwoSinglesAndWaiting::StateTransitionToTwoSinglesL() |
|
210 |
{ |
|
211 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
212 |
"CPhoneTwoSinglesAndWaiting::StateTransitionToTwoSinglesL()"); |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
213 |
iNumberEntryManager->SetVisibilityIfNumberEntryUsedL(ETrue); |
37 | 214 |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
215 |
UpdateUiCommands(); |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
216 |
iStateMachine->ChangeState( EPhoneStateTwoSingles ); |
37 | 217 |
} |
218 |
||
219 |
// ----------------------------------------------------------- |
|
220 |
// CPhoneTwoSinglesAndWaiting::StateTransitionToSingleAndWaitingL |
|
221 |
// ----------------------------------------------------------- |
|
222 |
// |
|
223 |
void CPhoneTwoSinglesAndWaiting::StateTransitionToSingleAndWaitingL() |
|
224 |
{ |
|
225 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
226 |
"CPhoneTwoSinglesAndWaiting::StateTransitionToSingleAndWaitingL()") |
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
227 |
UpdateUiCommands(); |
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
228 |
iStateMachine->ChangeState( EPhoneStateWaitingInSingle ); |
37 | 229 |
} |
230 |
||
231 |
// ----------------------------------------------------------- |
|
232 |
// CPhoneTwoSinglesAndWaiting::HandleConnectedConferenceL |
|
233 |
// ----------------------------------------------------------- |
|
234 |
// |
|
235 |
void CPhoneTwoSinglesAndWaiting::HandleConnectedConferenceL( TInt aCallId ) |
|
236 |
{ |
|
237 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
238 |
"CPhoneTwoSinglesAndWaiting::HandleConnectedConferenceL()"); |
|
239 |
BeginUiUpdateLC(); |
|
240 |
||
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
241 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewCreateConference, aCallId ); |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
242 |
UpdateUiCommands(); |
37 | 243 |
EndUiUpdate(); |
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
244 |
iStateMachine->ChangeState( EPhoneStateConferenceAndWaiting ); |
37 | 245 |
} |
246 |
||
247 |
// ----------------------------------------------------------- |
|
248 |
// CPhoneTwoSinglesAndWaiting::HandleNumberEntryClearedL() |
|
249 |
// ----------------------------------------------------------- |
|
250 |
// |
|
251 |
void CPhoneTwoSinglesAndWaiting::HandleNumberEntryClearedL() |
|
252 |
{ |
|
253 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
254 |
"CPhoneTwoSinglesAndWaiting::HandleNumberEntryClearedL()"); |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
255 |
UpdateUiCommands(); |
37 | 256 |
} |
257 |
||
258 |
// ----------------------------------------------------------- |
|
259 |
// CPhoneTwoSinglesAndWaiting::HandleCommandL |
|
260 |
// ----------------------------------------------------------- |
|
261 |
// |
|
262 |
TBool CPhoneTwoSinglesAndWaiting::HandleCommandL( TInt aCommand ) |
|
263 |
{ |
|
264 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
265 |
"CPhoneTwoSinglesAndWaiting::HandleCommandL() "); |
|
266 |
TBool commandStatus = ETrue; |
|
267 |
switch( aCommand ) |
|
268 |
{ |
|
269 |
case EPhoneCmdUpdateUiControls: |
|
270 |
UpdateUiControlsL(); |
|
271 |
break; |
|
272 |
||
273 |
default: |
|
274 |
commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand ); |
|
275 |
break; |
|
276 |
} |
|
277 |
||
278 |
return commandStatus; |
|
279 |
} |
|
280 |
||
281 |
// ----------------------------------------------------------- |
|
282 |
// CPhoneTwoSinglesAndWaiting::UpdateUiControlsL |
|
283 |
// ----------------------------------------------------------- |
|
284 |
// |
|
285 |
void CPhoneTwoSinglesAndWaiting::UpdateUiControlsL() |
|
286 |
{ |
|
287 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndWaiting::UpdateUiControlsL( ) "); |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
288 |
UpdateUiCommands(); |
37 | 289 |
} |
290 |
||
291 |
// End of File |