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 CPhoneTwoSingles class.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
// INCLUDES
|
|
20 |
#include <eikmenub.h>
|
|
21 |
#include <eikenv.h>
|
|
22 |
#include <StringLoader.h>
|
|
23 |
#include <pevirtualengine.h>
|
|
24 |
#include <mpeengineinfo.h>
|
|
25 |
#include <cpephonemodelif.h>
|
|
26 |
#include <featmgr.h>
|
|
27 |
#include "cphonetwosingles.h"
|
|
28 |
#include "mphonestatemachine.h"
|
|
29 |
#include "phoneviewcommanddefinitions.h"
|
|
30 |
#include "phoneui.hrh"
|
|
31 |
#include "cphonemainresourceresolver.h"
|
|
32 |
#include "phonerssbase.h"
|
|
33 |
#include "phonestatedefinitions.h"
|
|
34 |
#include "tphonecmdparaminteger.h"
|
|
35 |
#include "tphonecmdparamappinfo.h"
|
|
36 |
#include "tphonecmdparamboolean.h"
|
|
37 |
#include "tphonecmdparamstring.h"
|
|
38 |
#include "tphonecmdparamcallheaderdata.h"
|
|
39 |
#include "tphonecmdparamcallstatedata.h"
|
|
40 |
#include "phonestatedefinitionsgsm.h"
|
|
41 |
#include "phonelogger.h"
|
|
42 |
|
|
43 |
// ================= MEMBER FUNCTIONS =======================
|
|
44 |
|
|
45 |
// C++ default constructor can NOT contain any code, that
|
|
46 |
// might leave.
|
|
47 |
//
|
|
48 |
EXPORT_C CPhoneTwoSingles::CPhoneTwoSingles(
|
|
49 |
MPhoneStateMachine* aStateMachine,
|
|
50 |
MPhoneViewCommandHandle* aViewCommandHandle,
|
|
51 |
MPhoneCustomization* aPhoneCustomization ) :
|
|
52 |
CPhoneGsmInCall( aStateMachine, aViewCommandHandle, aPhoneCustomization )
|
|
53 |
{
|
|
54 |
}
|
|
55 |
|
|
56 |
// -----------------------------------------------------------
|
|
57 |
// CPhoneTwoSingles::~CPhoneTwoSingles()
|
|
58 |
// Destructor
|
|
59 |
// (other items were commented in a header).
|
|
60 |
// -----------------------------------------------------------
|
|
61 |
//
|
|
62 |
EXPORT_C CPhoneTwoSingles::~CPhoneTwoSingles()
|
|
63 |
{
|
|
64 |
}
|
|
65 |
|
|
66 |
// -----------------------------------------------------------
|
|
67 |
// CPhoneTwoSingles::ConstructL()
|
|
68 |
// Constructor
|
|
69 |
// (other items were commented in a header).
|
|
70 |
// -----------------------------------------------------------
|
|
71 |
//
|
|
72 |
EXPORT_C void CPhoneTwoSingles::ConstructL()
|
|
73 |
{
|
|
74 |
CPhoneGsmInCall::ConstructL();
|
|
75 |
|
|
76 |
TPhoneCmdParamBoolean globalNotifierParam;
|
|
77 |
globalNotifierParam.SetBoolean( EFalse );
|
|
78 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
|
|
79 |
&globalNotifierParam );
|
|
80 |
}
|
|
81 |
|
|
82 |
// -----------------------------------------------------------
|
|
83 |
// CPhoneTwoSingles::NewL()
|
|
84 |
// Constructor
|
|
85 |
// (other items were commented in a header).
|
|
86 |
// -----------------------------------------------------------
|
|
87 |
//
|
|
88 |
CPhoneTwoSingles* CPhoneTwoSingles::NewL(
|
|
89 |
MPhoneStateMachine* aStateMachine,
|
|
90 |
MPhoneViewCommandHandle* aViewCommandHandle,
|
|
91 |
MPhoneCustomization* aPhoneCustomization )
|
|
92 |
{
|
|
93 |
CPhoneTwoSingles* self = new( ELeave ) CPhoneTwoSingles(
|
|
94 |
aStateMachine, aViewCommandHandle, aPhoneCustomization );
|
|
95 |
|
|
96 |
CleanupStack::PushL( self );
|
|
97 |
self->ConstructL();
|
|
98 |
CleanupStack::Pop( self );
|
|
99 |
|
|
100 |
return self;
|
|
101 |
}
|
|
102 |
|
|
103 |
// -----------------------------------------------------------
|
|
104 |
// CPhoneTwoSingles::HandlePhoneEngineMessageL
|
|
105 |
// -----------------------------------------------------------
|
|
106 |
//
|
|
107 |
EXPORT_C void CPhoneTwoSingles::HandlePhoneEngineMessageL(
|
|
108 |
const TInt aMessage,
|
|
109 |
TInt aCallId )
|
|
110 |
{
|
|
111 |
__LOGMETHODSTARTEND( EPhoneUIStates,
|
|
112 |
"CPhoneTwoSingles::HandlePhoneEngineMessageL()");
|
|
113 |
switch ( aMessage )
|
|
114 |
{
|
|
115 |
case MEngineMonitor::EPEMessageIdle:
|
|
116 |
HandleIdleL( aCallId );
|
|
117 |
break;
|
|
118 |
|
|
119 |
case MEngineMonitor::EPEMessageConnected:
|
|
120 |
case MEngineMonitor::EPEMessageHeld:
|
76
|
121 |
UpdateCallHeaderAndUiCommandsL( aCallId );
|
37
|
122 |
break;
|
|
123 |
|
|
124 |
case MEngineMonitor::EPEMessageConnectedConference:
|
|
125 |
HandleConnectedConferenceL( aCallId );
|
|
126 |
break;
|
|
127 |
|
|
128 |
case MEngineMonitor::EPEMessageIncoming:
|
|
129 |
HandleIncomingL( aCallId );
|
|
130 |
break;
|
|
131 |
|
|
132 |
default:
|
|
133 |
CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
|
|
134 |
break;
|
|
135 |
}
|
|
136 |
}
|
|
137 |
|
|
138 |
// -----------------------------------------------------------
|
|
139 |
// CPhoneTwoSingles:HandleIdleL
|
|
140 |
// -----------------------------------------------------------
|
|
141 |
//
|
|
142 |
void CPhoneTwoSingles::HandleIdleL( TInt aCallId )
|
|
143 |
{
|
|
144 |
__LOGMETHODSTARTEND( EPhoneUIStates,
|
|
145 |
"CPhoneTwoSingles::HandleIdleL()");
|
|
146 |
BeginUiUpdateLC();
|
|
147 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
|
|
148 |
|
|
149 |
TPhoneCmdParamInteger activeCallCount;
|
|
150 |
iViewCommandHandle->ExecuteCommandL(
|
|
151 |
EPhoneViewGetCountOfActiveCalls, &activeCallCount );
|
|
152 |
|
|
153 |
switch( activeCallCount.Integer() )
|
|
154 |
{
|
|
155 |
case EOneActiveCall:
|
|
156 |
{
|
74
|
157 |
iNumberEntryManager->SetVisibilityIfNumberEntryUsedL(ETrue);
|
|
158 |
UpdateUiCommands();
|
37
|
159 |
iStateMachine->ChangeState( EPhoneStateSingle );
|
|
160 |
}
|
|
161 |
|
|
162 |
default:
|
|
163 |
break;
|
|
164 |
}
|
|
165 |
EndUiUpdate();
|
|
166 |
}
|
|
167 |
|
|
168 |
// -----------------------------------------------------------
|
|
169 |
// CPhoneTwoSingles::HandleKeyMessageL
|
|
170 |
// -----------------------------------------------------------
|
|
171 |
//
|
|
172 |
EXPORT_C void CPhoneTwoSingles::HandleKeyMessageL(
|
|
173 |
TPhoneKeyEventMessages aMessage,
|
|
174 |
TKeyCode aCode )
|
|
175 |
{
|
|
176 |
__LOGMETHODSTARTEND( EPhoneUIStates,
|
|
177 |
"CPhoneTwoSingles::HandleKeyMessageL()");
|
|
178 |
switch ( aCode )
|
|
179 |
{
|
65
|
180 |
case EKeyYes: // send-key
|
37
|
181 |
{
|
74
|
182 |
if ( !iNumberEntryManager->IsNumberEntryVisibleL() )
|
37
|
183 |
{
|
|
184 |
iStateMachine->SendPhoneEngineMessage(
|
|
185 |
CPEPhoneModelIF::EPEMessageSwap );
|
|
186 |
}
|
|
187 |
else
|
|
188 |
{
|
74
|
189 |
iNumberEntryManager->CallFromNumberEntryL();
|
37
|
190 |
}
|
|
191 |
break;
|
|
192 |
}
|
|
193 |
|
|
194 |
default:
|
|
195 |
CPhoneGsmInCall::HandleKeyMessageL( aMessage, aCode );
|
|
196 |
break;
|
|
197 |
}
|
|
198 |
}
|
|
199 |
|
|
200 |
// -----------------------------------------------------------
|
|
201 |
// CPhoneTwoSingles::HandleNumberEntryClearedL()
|
|
202 |
// -----------------------------------------------------------
|
|
203 |
//
|
|
204 |
EXPORT_C void CPhoneTwoSingles::HandleNumberEntryClearedL()
|
|
205 |
{
|
|
206 |
__LOGMETHODSTARTEND( EPhoneUIStates,
|
|
207 |
"CPhoneTwoSingles::HandleNumberEntryClearedL()");
|
74
|
208 |
UpdateUiCommands();
|
37
|
209 |
}
|
|
210 |
|
|
211 |
// -----------------------------------------------------------
|
|
212 |
// CPhoneTwoSingles::HandleConnectedConferenceL
|
|
213 |
// -----------------------------------------------------------
|
|
214 |
//
|
|
215 |
EXPORT_C void CPhoneTwoSingles::HandleConnectedConferenceL( TInt aCallId )
|
|
216 |
{
|
|
217 |
__LOGMETHODSTARTEND( EPhoneUIStates,
|
|
218 |
"CPhoneTwoSingles::HandleConnectedConferenceL()");
|
|
219 |
BeginUiUpdateLC();
|
74
|
220 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewCreateConference, aCallId );
|
|
221 |
UpdateUiCommands();
|
37
|
222 |
EndUiUpdate();
|
|
223 |
iStateMachine->ChangeState( EPhoneStateConference );
|
|
224 |
}
|
|
225 |
|
|
226 |
// -----------------------------------------------------------
|
|
227 |
// CPhoneTwoSingles::HandleIncomingL
|
|
228 |
// -----------------------------------------------------------
|
|
229 |
//
|
|
230 |
void CPhoneTwoSingles::HandleIncomingL( TInt aCallId )
|
|
231 |
{
|
|
232 |
__LOGMETHODSTARTEND( EPhoneUIStates,
|
74
|
233 |
"CPhoneTwoSingles::HandleIncomingL()");
|
|
234 |
DisplayCallHeaderL( aCallId, ECheckIfNEUsedBeforeSettingVisibilityFalse );
|
65
|
235 |
iStateMachine->ChangeState( EPhoneStateTwoSinglesAndWaiting );
|
37
|
236 |
}
|
|
237 |
|
|
238 |
// End of File
|