author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 17 Sep 2010 08:29:19 +0300 | |
changeset 72 | c76a0b1755b9 |
parent 56 | 5bcb308bd24d |
child 74 | d1c62c765e48 |
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 CPhoneCallSetupAndWaiting class. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
// INCLUDES |
|
20 |
#include <pevirtualengine.h> |
|
21 |
#include <StringLoader.h> |
|
22 |
#include <MediatorDomainUIDs.h> |
|
23 |
||
24 |
#include "cphonecallsetupandwaiting.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 "tphonecmdparamcallstatedata.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 "cphonemediatorfactory.h" |
|
39 |
#include "cphonemediatorsender.h" |
|
40 |
||
41 |
// ================= MEMBER FUNCTIONS ======================= |
|
42 |
||
43 |
// C++ default constructor can NOT contain any code, that |
|
44 |
// might leave. |
|
45 |
// |
|
46 |
CPhoneCallSetupAndWaiting::CPhoneCallSetupAndWaiting( |
|
47 |
MPhoneStateMachine* aStateMachine, |
|
48 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
49 |
MPhoneCustomization* aPhoneCustomization ) : |
|
50 |
CPhoneGsmInCall( aStateMachine, aViewCommandHandle, aPhoneCustomization ) |
|
51 |
{ |
|
52 |
} |
|
53 |
||
54 |
// ----------------------------------------------------------- |
|
55 |
// CPhoneCallSetupAndWaiting::~CPhoneCallSetupAndWaiting() |
|
56 |
// Destructor |
|
57 |
// (other items were commented in a header). |
|
58 |
// ----------------------------------------------------------- |
|
59 |
// |
|
60 |
CPhoneCallSetupAndWaiting::~CPhoneCallSetupAndWaiting() |
|
61 |
{ |
|
62 |
} |
|
63 |
||
64 |
// ----------------------------------------------------------- |
|
65 |
// CPhoneCallSetupAndWaiting::ConstructL() |
|
66 |
// Constructor |
|
67 |
// (other items were commented in a header). |
|
68 |
// ----------------------------------------------------------- |
|
69 |
// |
|
70 |
void CPhoneCallSetupAndWaiting::ConstructL() |
|
71 |
{ |
|
72 |
CPhoneGsmInCall::ConstructL(); |
|
73 |
} |
|
74 |
||
75 |
// ----------------------------------------------------------- |
|
76 |
// CPhoneCallSetupAndWaiting::NewL() |
|
77 |
// Constructor |
|
78 |
// (other items were commented in a header). |
|
79 |
// ----------------------------------------------------------- |
|
80 |
// |
|
81 |
CPhoneCallSetupAndWaiting* CPhoneCallSetupAndWaiting::NewL( |
|
82 |
MPhoneStateMachine* aStateMachine, |
|
83 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
84 |
MPhoneCustomization* aPhoneCustomization ) |
|
85 |
{ |
|
86 |
CPhoneCallSetupAndWaiting* self = new( ELeave ) CPhoneCallSetupAndWaiting( |
|
87 |
aStateMachine, aViewCommandHandle, aPhoneCustomization ); |
|
88 |
||
89 |
CleanupStack::PushL( self ); |
|
90 |
self->ConstructL(); |
|
91 |
CleanupStack::Pop( self ); |
|
92 |
||
93 |
return self; |
|
94 |
} |
|
95 |
||
96 |
// ----------------------------------------------------------- |
|
97 |
// CPhoneCallSetupAndWaiting::HandlePhoneEngineMessageL |
|
98 |
// ----------------------------------------------------------- |
|
99 |
// |
|
100 |
void CPhoneCallSetupAndWaiting::HandlePhoneEngineMessageL( |
|
101 |
const TInt aMessage, |
|
102 |
TInt aCallId ) |
|
103 |
{ |
|
104 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
105 |
"CPhoneCallSetupAndWaiting::HandlePhoneEngineMessageL()"); |
|
106 |
switch ( aMessage ) |
|
107 |
{ |
|
108 |
case MEngineMonitor::EPEMessageIdle: |
|
109 |
HandleIdleL( aCallId ); |
|
110 |
break; |
|
111 |
||
112 |
case MEngineMonitor::EPEMessageConnected: |
|
113 |
HandleConnectedL( aCallId ); |
|
114 |
break; |
|
115 |
||
116 |
default: |
|
117 |
CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId ); |
|
118 |
break; |
|
119 |
} |
|
120 |
} |
|
121 |
||
122 |
// ----------------------------------------------------------- |
|
123 |
// CPhoneCallSetupAndWaiting::HandleIdleL |
|
124 |
// ----------------------------------------------------------- |
|
125 |
// |
|
126 |
void CPhoneCallSetupAndWaiting::HandleIdleL( TInt aCallId ) |
|
127 |
{ |
|
128 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
129 |
"CPhoneCallSetupAndWaiting::HandleIdleL()"); |
|
130 |
BeginUiUpdateLC(); |
|
131 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
|
132 |
||
133 |
// Find out do we have waiting or outgoing call left |
|
134 |
TPhoneCmdParamCallStateData callStateData; |
|
135 |
callStateData.SetCallState( EPEStateRinging ); |
|
136 |
iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState, |
|
137 |
&callStateData ); |
|
138 |
||
139 |
if( callStateData.CallId() > KErrNotFound ) |
|
140 |
{ |
|
141 |
TPhoneCmdParamCallHeaderData callHeaderParam; |
|
142 |
callHeaderParam.SetCallState( EPEStateRinging ); |
|
143 |
SetCallHeaderTextsForCallComingInL( callStateData.CallId(), EFalse, &callHeaderParam ); |
|
144 |
||
145 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, |
|
146 |
callStateData.CallId(), |
|
147 |
&callHeaderParam ); |
|
148 |
||
149 |
SetTouchPaneButtons( EPhoneIncomingCallButtons ); |
|
150 |
BringIncomingToForegroundL(); |
|
151 |
iCbaManager->UpdateIncomingCbaL( callStateData.CallId() ); |
|
152 |
SetRingingTonePlaybackL( callStateData.CallId() ); |
|
153 |
SetBackButtonActive(EFalse); |
|
154 |
iStateMachine->ChangeState( EPhoneStateIncoming ); |
|
155 |
} |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
156 |
else // waiting call was terminated. |
37 | 157 |
{ |
158 |
CPhoneState::SetTouchPaneButtons( EPhoneCallSetupButtons ); |
|
159 |
UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
|
160 |
iStateMachine->ChangeState( EPhoneStateAlerting ); |
|
161 |
} |
|
162 |
EndUiUpdate(); |
|
163 |
} |
|
164 |
||
165 |
// ----------------------------------------------------------- |
|
166 |
// CPhoneCallSetupAndWaiting::UpdateInCallCbaL |
|
167 |
// ----------------------------------------------------------- |
|
168 |
// |
|
169 |
void CPhoneCallSetupAndWaiting::UpdateInCallCbaL() |
|
170 |
{ |
|
171 |
__LOGMETHODSTARTEND( EPhoneControl, |
|
172 |
"CPhoneCallSetupAndWaiting::UpdateInCallCbaL() "); |
|
173 |
UpdateCbaL( EPhoneCallHandlingIncomingRejectCBA ); |
|
174 |
} |
|
175 |
||
176 |
// ----------------------------------------------------------- |
|
177 |
// CPhoneCallSetupAndWaiting::HandleConnectedL |
|
178 |
// ----------------------------------------------------------- |
|
179 |
// |
|
180 |
void CPhoneCallSetupAndWaiting::HandleConnectedL( TInt aCallId ) |
|
181 |
{ |
|
182 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneCallSetupAndWaiting::HandleConnectedL() "); |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
183 |
BeginUiUpdateLC(); |
37 | 184 |
TPhoneCmdParamCallHeaderData callHeaderParam; |
185 |
callHeaderParam.SetCallState( EPEStateConnected ); |
|
186 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, |
|
187 |
&callHeaderParam ); |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
188 |
|
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
189 |
SetTouchPaneButtons( EPhoneWaitingCallButtons ); |
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
190 |
EndUiUpdate(); |
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
191 |
|
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
192 |
if ( IsNumberEntryUsedL() ) |
37 | 193 |
{ |
194 |
TPhoneCmdParamBoolean booleanParam; |
|
195 |
booleanParam.SetBoolean( ETrue ); |
|
196 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetNumberEntryVisible, &booleanParam ); |
|
197 |
} |
|
198 |
UpdateCbaL( EPhoneCallHandlingCallWaitingCBA ); |
|
199 |
iStateMachine->ChangeState( EPhoneStateWaitingInSingle ); |
|
200 |
} |
|
201 |
||
202 |
// End of File |