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 CPhoneConferenceAndCallSetup class.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
// INCLUDES
|
|
20 |
#include "cphoneconferenceandcallsetup.h"
|
|
21 |
#include "mphonestatemachine.h"
|
|
22 |
#include "phoneviewcommanddefinitions.h"
|
|
23 |
#include "tphonecmdparamcallheaderdata.h"
|
|
24 |
#include "tphonecmdparamcallstatedata.h"
|
|
25 |
#include "phonestatedefinitionsgsm.h"
|
|
26 |
#include "phonelogger.h"
|
|
27 |
#include "tphonecmdparamboolean.h"
|
|
28 |
#include "tphonecmdparaminteger.h"
|
|
29 |
#include "cphonemainresourceresolver.h"
|
|
30 |
#include "phonerssbase.h"
|
|
31 |
#include "tphonecmdparamglobalnote.h"
|
|
32 |
#include "phoneui.hrh"
|
|
33 |
|
|
34 |
// ================= MEMBER FUNCTIONS =======================
|
|
35 |
|
|
36 |
// C++ default constructor can NOT contain any code, that
|
|
37 |
// might leave.
|
|
38 |
//
|
|
39 |
CPhoneConferenceAndCallSetup::CPhoneConferenceAndCallSetup(
|
|
40 |
MPhoneStateMachine* aStateMachine,
|
|
41 |
MPhoneViewCommandHandle* aViewCommandHandle,
|
|
42 |
MPhoneCustomization* aPhoneCustomization ) :
|
|
43 |
CPhoneConference( aStateMachine, aViewCommandHandle, aPhoneCustomization )
|
|
44 |
{
|
|
45 |
}
|
|
46 |
|
|
47 |
// -----------------------------------------------------------
|
|
48 |
// CPhoneConferenceAndCallSetup::~CPhoneConferenceAndCallSetup()
|
|
49 |
// Destructor
|
|
50 |
// (other items were commented in a header).
|
|
51 |
// -----------------------------------------------------------
|
|
52 |
//
|
|
53 |
CPhoneConferenceAndCallSetup::~CPhoneConferenceAndCallSetup()
|
|
54 |
{
|
|
55 |
}
|
|
56 |
|
|
57 |
// -----------------------------------------------------------
|
|
58 |
// CPhoneConferenceAndCallSetup::ConstructL()
|
|
59 |
// Constructor
|
|
60 |
// (other items were commented in a header).
|
|
61 |
// -----------------------------------------------------------
|
|
62 |
//
|
|
63 |
void CPhoneConferenceAndCallSetup::ConstructL()
|
|
64 |
{
|
|
65 |
CPhoneConference::ConstructL();
|
|
66 |
}
|
|
67 |
|
|
68 |
// -----------------------------------------------------------
|
|
69 |
// CPhoneConferenceAndCallSetup::NewL()
|
|
70 |
// Constructor
|
|
71 |
// (other items were commented in a header).
|
|
72 |
// -----------------------------------------------------------
|
|
73 |
//
|
|
74 |
CPhoneConferenceAndCallSetup* CPhoneConferenceAndCallSetup::NewL(
|
|
75 |
MPhoneStateMachine* aStateMachine,
|
|
76 |
MPhoneViewCommandHandle* aViewCommandHandle,
|
|
77 |
MPhoneCustomization* aPhoneCustomization )
|
|
78 |
{
|
|
79 |
CPhoneConferenceAndCallSetup* self = new( ELeave ) CPhoneConferenceAndCallSetup(
|
|
80 |
aStateMachine, aViewCommandHandle, aPhoneCustomization );
|
|
81 |
|
|
82 |
CleanupStack::PushL( self );
|
|
83 |
self->ConstructL();
|
|
84 |
CleanupStack::Pop( self );
|
|
85 |
|
|
86 |
return self;
|
|
87 |
}
|
|
88 |
|
|
89 |
// -----------------------------------------------------------
|
|
90 |
// CPhoneConferenceAndCallSetup::HandlePhoneEngineMessageL
|
|
91 |
// -----------------------------------------------------------
|
|
92 |
//
|
|
93 |
void CPhoneConferenceAndCallSetup::HandlePhoneEngineMessageL(
|
|
94 |
const TInt aMessage,
|
|
95 |
TInt aCallId )
|
|
96 |
{
|
|
97 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndCallSetup::HandlePhoneEngineMessageL()");
|
|
98 |
switch ( aMessage )
|
|
99 |
{
|
|
100 |
case MEngineMonitor::EPEMessageConnecting:
|
|
101 |
iAlerting = ETrue;
|
|
102 |
HandleConnectingL( aCallId );
|
|
103 |
break;
|
|
104 |
|
|
105 |
case MEngineMonitor::EPEMessageConnected:
|
|
106 |
HandleConnectedL( aCallId );
|
|
107 |
break;
|
|
108 |
|
|
109 |
case MEngineMonitor::EPEMessageIdle:
|
|
110 |
HandleIdleL( aCallId );
|
|
111 |
break;
|
|
112 |
|
|
113 |
case MEngineMonitor::EPEMessageConferenceIdle:
|
|
114 |
HandleConferenceIdleL();
|
|
115 |
break;
|
|
116 |
|
|
117 |
default:
|
|
118 |
CPhoneConference::HandlePhoneEngineMessageL( aMessage,
|
|
119 |
aCallId );
|
|
120 |
break;
|
|
121 |
}
|
|
122 |
}
|
|
123 |
|
|
124 |
// -----------------------------------------------------------
|
|
125 |
// CPhoneConferenceAndCallSetup::HandleCommandL
|
|
126 |
// -----------------------------------------------------------
|
|
127 |
//
|
|
128 |
TBool CPhoneConferenceAndCallSetup::HandleCommandL( TInt aCommand )
|
|
129 |
{
|
|
130 |
__LOGMETHODSTARTEND( EPhoneUIStates,
|
|
131 |
"CPhoneConferenceAndCallSetup::HandleCommandL()");
|
|
132 |
TBool commandStatus = ETrue;
|
|
133 |
switch( aCommand )
|
|
134 |
{
|
|
135 |
case EPhoneDtmfDialerCancel:
|
|
136 |
{
|
|
137 |
}
|
|
138 |
break;
|
|
139 |
|
|
140 |
default:
|
|
141 |
commandStatus = CPhoneConference::HandleCommandL( aCommand );
|
|
142 |
break;
|
|
143 |
}
|
|
144 |
return commandStatus;
|
|
145 |
}
|
|
146 |
|
|
147 |
// --------------------------------------------------------------
|
|
148 |
// CPhoneConferenceAndCallSetup::HandleKeyMessageL
|
|
149 |
// --------------------------------------------------------------
|
|
150 |
//
|
|
151 |
void CPhoneConferenceAndCallSetup::HandleKeyMessageL(
|
|
152 |
TPhoneKeyEventMessages aMessage,
|
|
153 |
TKeyCode aCode )
|
|
154 |
{
|
|
155 |
__LOGMETHODSTARTEND( EPhoneUIStates,
|
|
156 |
"CPhoneConferenceAndCallSetup::HandleKeyMessageL()");
|
|
157 |
switch ( aCode )
|
|
158 |
{
|
65
|
159 |
case EKeyNo: // End-key
|
37
|
160 |
if ( aMessage == EPhoneKeyLongPress )
|
|
161 |
{
|
|
162 |
iStateMachine->SendPhoneEngineMessage(
|
|
163 |
MPEPhoneModel::EPEMessageTerminateAllConnections );
|
|
164 |
}
|
|
165 |
else
|
|
166 |
{
|
|
167 |
DisconnectOutgoingCallL();
|
|
168 |
}
|
|
169 |
break;
|
|
170 |
|
|
171 |
default:
|
|
172 |
CPhoneConference::HandleKeyMessageL( aMessage, aCode );
|
|
173 |
break;
|
|
174 |
}
|
|
175 |
}
|
|
176 |
|
|
177 |
// -----------------------------------------------------------
|
|
178 |
// CPhoneConferenceAndCallSetup::HandleConnectingL
|
|
179 |
// -----------------------------------------------------------
|
|
180 |
//
|
|
181 |
void CPhoneConferenceAndCallSetup::HandleConnectingL( TInt aCallId )
|
|
182 |
{
|
|
183 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndCallSetup::HandleConnectingL()");
|
|
184 |
BeginUiUpdateLC();
|
|
185 |
UpdateRemoteInfoDataL ( aCallId );
|
|
186 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote );
|
|
187 |
|
|
188 |
TPhoneCmdParamBoolean globalNotifierParam;
|
|
189 |
globalNotifierParam.SetBoolean( EFalse );
|
|
190 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
|
|
191 |
&globalNotifierParam );
|
65
|
192 |
|
74
|
193 |
iNumberEntryManager->RemoveNumberEntryIfVisibilityIsFalseL();
|
37
|
194 |
|
74
|
195 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId );
|
37
|
196 |
|
74
|
197 |
UpdateUiCommands();
|
37
|
198 |
EndUiUpdate();
|
|
199 |
}
|
|
200 |
|
|
201 |
// -----------------------------------------------------------
|
|
202 |
// CPhoneConferenceAndCallSetup::HandleConnectedL
|
|
203 |
// -----------------------------------------------------------
|
|
204 |
//
|
|
205 |
void CPhoneConferenceAndCallSetup::HandleConnectedL( TInt aCallId )
|
|
206 |
{
|
|
207 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneConferenceAndCallSetup::HandleConnectedL()");
|
|
208 |
BeginUiUpdateLC();
|
74
|
209 |
|
|
210 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId );
|
37
|
211 |
|
74
|
212 |
iNumberEntryManager->RemoveNumberEntryIfVisibilityIsFalseL();
|
|
213 |
UpdateUiCommands();
|
37
|
214 |
EndUiUpdate();
|
65
|
215 |
iStateMachine->ChangeState( EPhoneStateConferenceAndSingle );
|
37
|
216 |
}
|
|
217 |
|
|
218 |
// -----------------------------------------------------------
|
|
219 |
// CPhoneConferenceAndCallSetup:HandleIdleL
|
|
220 |
// -----------------------------------------------------------
|
|
221 |
//
|
|
222 |
void CPhoneConferenceAndCallSetup::HandleIdleL( TInt aCallId )
|
|
223 |
{
|
|
224 |
__LOGMETHODSTARTEND( EPhoneUIStates,
|
|
225 |
"CPhoneConferenceAndCallSetup::HandleIdleL()");
|
|
226 |
TPhoneCmdParamBoolean globalNotifierParam;
|
|
227 |
globalNotifierParam.SetBoolean( EFalse );
|
|
228 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
|
|
229 |
&globalNotifierParam );
|
|
230 |
|
|
231 |
TPhoneCmdParamBoolean conferenceExistsForCallId;
|
|
232 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCallExistsInConference,
|
|
233 |
aCallId, &conferenceExistsForCallId );
|
|
234 |
|
|
235 |
if( conferenceExistsForCallId.Boolean() )
|
|
236 |
{
|
|
237 |
// Remove 'Conference on hold' global note
|
|
238 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote );
|
65
|
239 |
iViewCommandHandle->ExecuteCommandL(
|
|
240 |
EPhoneViewRemoveFromConference,
|
|
241 |
aCallId );
|
37
|
242 |
|
|
243 |
//Check if removed call was last one to be able to be in conference mode
|
|
244 |
//If there is no confrence call, go to single and call setup state
|
|
245 |
TPhoneCmdParamBoolean conferenceExists;
|
|
246 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetIsConference,
|
|
247 |
&conferenceExists );
|
|
248 |
__PHONELOG1( EBasic, EPhoneControl,
|
|
249 |
"CPhoneConferenceAndCallSetup::HandleIdleL - conferenceExists =%d ",
|
|
250 |
conferenceExists.Boolean() );
|
|
251 |
|
|
252 |
if( !conferenceExists.Boolean() )
|
|
253 |
{
|
|
254 |
if( iAlerting )
|
|
255 |
{
|
|
256 |
iStateMachine->ChangeState( EPhoneStateAlertingInSingle );
|
|
257 |
}
|
|
258 |
else
|
|
259 |
{
|
65
|
260 |
iStateMachine->ChangeState( EPhoneStateCallSetupInSingle );
|
37
|
261 |
}
|
|
262 |
}
|
|
263 |
}
|
|
264 |
else
|
65
|
265 |
{
|
37
|
266 |
// Remove outgoing call
|
|
267 |
BeginUiUpdateLC();
|
|
268 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
|
74
|
269 |
iNumberEntryManager->SetVisibilityIfNumberEntryUsedL( ETrue );
|
|
270 |
UpdateUiCommands();
|
37
|
271 |
EndUiUpdate();
|
|
272 |
iStateMachine->ChangeState( EPhoneStateConference );
|
65
|
273 |
}
|
37
|
274 |
}
|
|
275 |
|
|
276 |
// -----------------------------------------------------------
|
|
277 |
// CPhoneConferenceAndCallSetup:HandleConferenceIdleL
|
|
278 |
// -----------------------------------------------------------
|
|
279 |
//
|
|
280 |
void CPhoneConferenceAndCallSetup::HandleConferenceIdleL()
|
|
281 |
{
|
|
282 |
__LOGMETHODSTARTEND( EPhoneUIStates,
|
|
283 |
"CPhoneConferenceAndCallSetup::HandleConferenceIdleL()");
|
|
284 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveConferenceBubble );
|
65
|
285 |
|
37
|
286 |
TPhoneCmdParamCallStateData callStateData;
|
|
287 |
callStateData.SetCallState( EPEStateConnecting );
|
|
288 |
iViewCommandHandle->HandleCommandL(
|
|
289 |
EPhoneViewGetCallIdByState, &callStateData );
|
|
290 |
|
|
291 |
if ( callStateData.CallId() > KErrNotFound )
|
|
292 |
{
|
|
293 |
// Go to alerting and single state
|
74
|
294 |
UpdateUiCommands();
|
37
|
295 |
iStateMachine->ChangeState( EPhoneStateAlertingInSingle );
|
|
296 |
}
|
|
297 |
else
|
|
298 |
{
|
74
|
299 |
UpdateUiCommands();
|
37
|
300 |
iStateMachine->ChangeState( EPhoneStateCallSetupInSingle );
|
65
|
301 |
}
|
37
|
302 |
}
|
|
303 |
|
|
304 |
// End of File
|