author | hgs |
Fri, 15 Oct 2010 12:58:46 +0300 | |
changeset 78 | baacf668fe89 |
parent 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 "phoneviewcommanddefinitions.h" |
|
33 |
#include "phoneui.hrh" |
|
34 |
#include "cphonemainresourceresolver.h" |
|
35 |
#include "phonerssbase.h" |
|
36 |
#include "phonestatedefinitionsgsm.h" |
|
37 |
#include "phonelogger.h" |
|
38 |
#include "mphonestorage.h" |
|
78 | 39 |
#include "phonecallutil.h" |
37 | 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 |
||
78 | 74 |
iRingingCallId = PhoneCallUtil::CallIdByState( EPEStateRinging ); |
37 | 75 |
} |
76 |
||
77 |
// ----------------------------------------------------------- |
|
78 |
// CPhoneTwoSinglesAndWaiting::NewL() |
|
79 |
// Constructor |
|
80 |
// (other items were commented in a header). |
|
81 |
// ----------------------------------------------------------- |
|
82 |
// |
|
83 |
CPhoneTwoSinglesAndWaiting* CPhoneTwoSinglesAndWaiting::NewL( |
|
84 |
MPhoneStateMachine* aStateMachine, |
|
85 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
86 |
MPhoneCustomization* aPhoneCustomization ) |
|
87 |
{ |
|
88 |
CPhoneTwoSinglesAndWaiting* self = new( ELeave ) CPhoneTwoSinglesAndWaiting( |
|
89 |
aStateMachine, aViewCommandHandle, aPhoneCustomization ); |
|
90 |
||
91 |
CleanupStack::PushL( self ); |
|
92 |
self->ConstructL(); |
|
93 |
CleanupStack::Pop( self ); |
|
94 |
||
95 |
return self; |
|
96 |
} |
|
97 |
||
98 |
// ----------------------------------------------------------- |
|
99 |
// CPhoneTwoSinglesAndWaiting::HandleKeyMessageL |
|
100 |
// ----------------------------------------------------------- |
|
101 |
// |
|
102 |
void CPhoneTwoSinglesAndWaiting::HandleKeyMessageL( |
|
103 |
TPhoneKeyEventMessages aMessage, |
|
104 |
TKeyCode aCode ) |
|
105 |
{ |
|
106 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
107 |
"CPhoneTwoSinglesAndWaiting::HandleKeyMessageL()"); |
|
108 |
switch ( aCode ) |
|
109 |
{ |
|
65 | 110 |
case EKeyYes: // send-key |
37 | 111 |
{ |
74 | 112 |
if( iNumberEntryManager->IsNumberEntryVisibleL() ) |
37 | 113 |
{ |
74 | 114 |
iNumberEntryManager->CallFromNumberEntryL(); |
37 | 115 |
} |
116 |
else |
|
117 |
{ |
|
118 |
// Waiting call bubble is over number entry |
|
119 |
// so display not allowed note because we |
|
120 |
// can't answer the call |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
121 |
SendGlobalWarningNoteL( EPhoneNoteTextCallNotAllowed, ETrue ); |
37 | 122 |
} |
123 |
break; |
|
124 |
} |
|
125 |
||
126 |
default: |
|
127 |
CPhoneTwoSingles::HandleKeyMessageL( aMessage, aCode ); |
|
128 |
break; |
|
129 |
} |
|
130 |
} |
|
131 |
||
132 |
// ----------------------------------------------------------- |
|
133 |
// CPhoneTwoSinglesAndWaiting::HandlePhoneEngineMessageL |
|
134 |
// ----------------------------------------------------------- |
|
135 |
// |
|
136 |
void CPhoneTwoSinglesAndWaiting::HandlePhoneEngineMessageL( |
|
137 |
const TInt aMessage, |
|
138 |
TInt aCallId ) |
|
139 |
{ |
|
140 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
141 |
"CPhoneTwoSinglesAndWaiting::HandlePhoneEngineMessageL()"); |
|
142 |
switch ( aMessage ) |
|
143 |
{ |
|
144 |
case MEngineMonitor::EPEMessageIdle: |
|
145 |
HandleIdleL( aCallId ); |
|
146 |
break; |
|
147 |
case MEngineMonitor::EPEMessageConnected: |
|
74 | 148 |
UpdateUiCommands(); |
37 | 149 |
CPhoneTwoSingles::HandlePhoneEngineMessageL( aMessage, aCallId ); |
150 |
break; |
|
151 |
default: |
|
152 |
CPhoneTwoSingles::HandlePhoneEngineMessageL( aMessage, aCallId ); |
|
153 |
break; |
|
154 |
} |
|
155 |
} |
|
156 |
||
157 |
// ----------------------------------------------------------- |
|
158 |
// CPhoneTwoSinglesAndWaiting::HandleErrorL |
|
159 |
// ----------------------------------------------------------- |
|
160 |
// |
|
161 |
EXPORT_C void CPhoneTwoSinglesAndWaiting::HandleErrorL( |
|
162 |
const TPEErrorInfo& aErrorInfo ) |
|
163 |
{ |
|
164 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneTwoSinglesAndWaiting::HandleErrorL()"); |
|
165 |
||
166 |
if( aErrorInfo.iErrorCode == ECCPErrorCCUserAlertingNoAnswer ) |
|
167 |
{ |
|
168 |
// Should not shown "No Answer" note |
|
169 |
__PHONELOG1( EBasic, EPhoneUIStates, |
|
170 |
"PhoneUIControl: CPhoneTwoSinglesAndWaiting::HandleErrorL - aErrorInfo.iErrorCode =%d ", |
|
171 |
aErrorInfo.iErrorCode); |
|
172 |
} |
|
173 |
else |
|
174 |
{ |
|
175 |
CPhoneState::HandleErrorL( aErrorInfo ); |
|
176 |
} |
|
177 |
} |
|
178 |
||
179 |
// ----------------------------------------------------------- |
|
180 |
// CPhoneTwoSinglesAndWaiting::HandleIdleL |
|
181 |
// ----------------------------------------------------------- |
|
182 |
// |
|
183 |
void CPhoneTwoSinglesAndWaiting::HandleIdleL( TInt aCallId ) |
|
184 |
{ |
|
185 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
186 |
"CPhoneTwoSinglesAndWaiting::HandleIdleL()"); |
|
65 | 187 |
BeginUiUpdateLC(); |
37 | 188 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
189 |
||
190 |
if ( iRingingCallId == aCallId ) |
|
191 |
{ |
|
192 |
StateTransitionToTwoSinglesL(); |
|
193 |
} |
|
194 |
else |
|
195 |
{ |
|
196 |
StateTransitionToSingleAndWaitingL(); |
|
197 |
} |
|
198 |
EndUiUpdate(); |
|
199 |
} |
|
200 |
||
201 |
// ----------------------------------------------------------- |
|
202 |
// CPhoneTwoSinglesAndWaiting::StateTransitionToTwoSinglesL |
|
203 |
// ----------------------------------------------------------- |
|
204 |
// |
|
205 |
void CPhoneTwoSinglesAndWaiting::StateTransitionToTwoSinglesL() |
|
206 |
{ |
|
207 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
208 |
"CPhoneTwoSinglesAndWaiting::StateTransitionToTwoSinglesL()"); |
|
74 | 209 |
iNumberEntryManager->SetVisibilityIfNumberEntryUsedL(ETrue); |
37 | 210 |
|
74 | 211 |
UpdateUiCommands(); |
212 |
iStateMachine->ChangeState( EPhoneStateTwoSingles ); |
|
37 | 213 |
} |
214 |
||
215 |
// ----------------------------------------------------------- |
|
216 |
// CPhoneTwoSinglesAndWaiting::StateTransitionToSingleAndWaitingL |
|
217 |
// ----------------------------------------------------------- |
|
218 |
// |
|
219 |
void CPhoneTwoSinglesAndWaiting::StateTransitionToSingleAndWaitingL() |
|
220 |
{ |
|
221 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
65 | 222 |
"CPhoneTwoSinglesAndWaiting::StateTransitionToSingleAndWaitingL()") |
74 | 223 |
UpdateUiCommands(); |
65 | 224 |
iStateMachine->ChangeState( EPhoneStateWaitingInSingle ); |
37 | 225 |
} |
226 |
||
227 |
// ----------------------------------------------------------- |
|
228 |
// CPhoneTwoSinglesAndWaiting::HandleConnectedConferenceL |
|
229 |
// ----------------------------------------------------------- |
|
230 |
// |
|
231 |
void CPhoneTwoSinglesAndWaiting::HandleConnectedConferenceL( TInt aCallId ) |
|
232 |
{ |
|
233 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
234 |
"CPhoneTwoSinglesAndWaiting::HandleConnectedConferenceL()"); |
|
235 |
BeginUiUpdateLC(); |
|
236 |
||
74 | 237 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewCreateConference, aCallId ); |
238 |
UpdateUiCommands(); |
|
37 | 239 |
EndUiUpdate(); |
65 | 240 |
iStateMachine->ChangeState( EPhoneStateConferenceAndWaiting ); |
37 | 241 |
} |
242 |
||
243 |
// ----------------------------------------------------------- |
|
244 |
// CPhoneTwoSinglesAndWaiting::HandleNumberEntryClearedL() |
|
245 |
// ----------------------------------------------------------- |
|
246 |
// |
|
247 |
void CPhoneTwoSinglesAndWaiting::HandleNumberEntryClearedL() |
|
248 |
{ |
|
249 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
250 |
"CPhoneTwoSinglesAndWaiting::HandleNumberEntryClearedL()"); |
|
74 | 251 |
UpdateUiCommands(); |
37 | 252 |
} |
253 |
||
254 |
// ----------------------------------------------------------- |
|
255 |
// CPhoneTwoSinglesAndWaiting::HandleCommandL |
|
256 |
// ----------------------------------------------------------- |
|
257 |
// |
|
258 |
TBool CPhoneTwoSinglesAndWaiting::HandleCommandL( TInt aCommand ) |
|
259 |
{ |
|
260 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
261 |
"CPhoneTwoSinglesAndWaiting::HandleCommandL() "); |
|
262 |
TBool commandStatus = ETrue; |
|
263 |
switch( aCommand ) |
|
264 |
{ |
|
265 |
case EPhoneCmdUpdateUiControls: |
|
76 | 266 |
UpdateUiCommands(); |
37 | 267 |
break; |
268 |
||
269 |
default: |
|
270 |
commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand ); |
|
271 |
break; |
|
272 |
} |
|
273 |
||
274 |
return commandStatus; |
|
275 |
} |
|
276 |
||
277 |
||
278 |
// End of File |