author | hgs |
Mon, 04 Oct 2010 16:06:10 +0300 | |
changeset 76 | cfea66083b62 |
parent 74 | d1c62c765e48 |
child 78 | baacf668fe89 |
permissions | -rw-r--r-- |
37 | 1 |
/* |
2 |
* Copyright (c) 2006 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 CPhoneGsmInCall class. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
// INCLUDES |
|
20 |
#include <mpeengineinfo.h> |
|
21 |
#include <pevirtualengine.h> |
|
22 |
#include <cpephonemodelif.h> |
|
23 |
#include <StringLoader.h> |
|
24 |
||
25 |
#include "cphonegsmincall.h" |
|
26 |
#include "phonerssbase.h" |
|
27 |
#include "phonelogger.h" |
|
28 |
#include "cphonegeneralgsmmessageshandler.h" |
|
29 |
#include "tphonecmdparamglobalnote.h" |
|
30 |
#include "tphonecmdparamboolean.h" |
|
31 |
#include "tphonecmdparaminteger.h" |
|
32 |
#include "mphonestatemachine.h" |
|
33 |
#include "cphonemainresourceresolver.h" |
|
34 |
#include "phoneui.hrh" |
|
35 |
||
36 |
#include "tphonecmdparamcallstatedata.h" |
|
37 |
#include "tphonecmdparamcallheaderdata.h" |
|
38 |
||
39 |
// ================= MEMBER FUNCTIONS ======================= |
|
40 |
||
41 |
// C++ default constructor can NOT contain any code, that |
|
42 |
// might leave. |
|
43 |
// |
|
44 |
CPhoneGsmInCall::CPhoneGsmInCall( |
|
45 |
MPhoneStateMachine* aStateMachine, |
|
46 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
47 |
MPhoneCustomization* aPhoneCustomization ) : |
|
48 |
CPhoneStateInCall( aStateMachine, aViewCommandHandle, aPhoneCustomization ) |
|
49 |
{ |
|
50 |
} |
|
51 |
||
52 |
// ----------------------------------------------------------- |
|
53 |
// CPhoneGsmInCall::~CPhoneGsmInCall() |
|
54 |
// Destructor |
|
55 |
// (other items were commented in a header). |
|
56 |
// ----------------------------------------------------------- |
|
57 |
||
58 |
CPhoneGsmInCall::~CPhoneGsmInCall() |
|
59 |
{ |
|
60 |
} |
|
61 |
||
62 |
// ----------------------------------------------------------- |
|
63 |
// CPhoneGsmInCall::ConstructL() |
|
64 |
// Constructor |
|
65 |
// (other items were commented in a header). |
|
66 |
// ----------------------------------------------------------- |
|
67 |
// |
|
68 |
void CPhoneGsmInCall::ConstructL() |
|
69 |
{ |
|
70 |
__LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneGsmInCall::ConstructL()"); |
|
71 |
CPhoneStateInCall::ConstructL(); |
|
72 |
} |
|
73 |
||
74 |
// ----------------------------------------------------------- |
|
75 |
// CPhoneGsmInCall::NewL() |
|
76 |
// Constructor |
|
77 |
// (other items were commented in a header). |
|
78 |
// ----------------------------------------------------------- |
|
79 |
// |
|
80 |
CPhoneGsmInCall* CPhoneGsmInCall::NewL( |
|
81 |
MPhoneStateMachine* aStateMachine, |
|
82 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
83 |
MPhoneCustomization* aPhoneCustomization ) |
|
84 |
{ |
|
85 |
CPhoneGsmInCall* self = new (ELeave) |
|
86 |
CPhoneGsmInCall( aStateMachine, aViewCommandHandle, aPhoneCustomization ); |
|
87 |
||
88 |
CleanupStack::PushL( self ); |
|
89 |
self->ConstructL(); |
|
90 |
CleanupStack::Pop( self ); |
|
91 |
||
92 |
return self; |
|
93 |
} |
|
94 |
||
95 |
// ----------------------------------------------------------- |
|
96 |
// CPhoneGsmInCall::HandlePhoneEngineMessageL |
|
97 |
// ----------------------------------------------------------- |
|
98 |
// |
|
99 |
void CPhoneGsmInCall::HandlePhoneEngineMessageL( |
|
100 |
const TInt aMessage, |
|
101 |
TInt aCallId ) |
|
102 |
{ |
|
103 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
104 |
"CPhoneGsmInCall::HandlePhoneEngineMessageL() "); |
|
105 |
switch ( aMessage ) |
|
106 |
{ |
|
107 |
case MEngineMonitor::EPEMessageRemoteHeld: |
|
108 |
CPhoneState::SendGlobalInfoNoteL( |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
109 |
EPhoneInformationRemotePutOnHoldNote, ETrue ); |
37 | 110 |
break; |
111 |
||
112 |
case MEngineMonitor::EPEMessageRemoteResumed: |
|
113 |
CPhoneState::SendGlobalInfoNoteL( |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
114 |
EPhoneInformationConnectedNote, ETrue ); |
37 | 115 |
break; |
116 |
||
117 |
case MEngineMonitor::EPEMessageRemoteCreatedConference: |
|
118 |
CPhoneState::SendGlobalInfoNoteL( |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
119 |
EPhoneInformationRemoteCreateConferenceNote, ETrue ); |
37 | 120 |
break; |
121 |
case MEngineMonitor::EPEMessageIncCallIsForw: // fall through |
|
122 |
case MEngineMonitor::EPEMessageIssuingSSRequest: // fall through |
|
123 |
case MEngineMonitor::EPEMessageCallBarred: // fall through |
|
124 |
case MEngineMonitor::EPEMessageIssuedSSRequest: // fall through |
|
125 |
case MEngineMonitor::EPEMessageTempClirActivationUnsuccessful: |
|
126 |
case MEngineMonitor::EPEMessageIncCallForwToC: // fall through |
|
127 |
case MEngineMonitor::EPEMessageOutCallForwToC: // fall through |
|
128 |
case MEngineMonitor::EPEMessageForwardUnconditionalModeActive: // fall through |
|
129 |
case MEngineMonitor::EPEMessageForwardConditionallyModeActive: |
|
130 |
{ |
|
131 |
CPhoneGeneralGsmMessagesHandler* gsmMsgHandler = |
|
132 |
CPhoneGeneralGsmMessagesHandler::NewL( *iStateMachine, |
|
133 |
*iViewCommandHandle, |
|
134 |
*this ); |
|
135 |
CleanupStack::PushL( gsmMsgHandler ); |
|
136 |
gsmMsgHandler->HandlePhoneEngineMessageL( aMessage, aCallId ); |
|
137 |
CleanupStack::PopAndDestroy( gsmMsgHandler ); |
|
138 |
||
139 |
// Needed also in non-touch, if call waiting request (*43#) |
|
140 |
// is sent during active call at least. |
|
74 | 141 |
UpdateUiCommands(); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
142 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
143 |
break; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
144 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
145 |
case MEngineMonitor::EPEMessageColpNumberAvailable: |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
146 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
147 |
HandleColpNoteL( aCallId ); |
37 | 148 |
} |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
149 |
break; |
37 | 150 |
|
151 |
default: |
|
152 |
CPhoneStateInCall::HandlePhoneEngineMessageL( |
|
153 |
aMessage, aCallId ); |
|
154 |
break; |
|
155 |
} |
|
156 |
} |
|
157 |
||
158 |
// ----------------------------------------------------------- |
|
159 |
// CPhoneGsmInCall:HandleCommandL |
|
160 |
// ----------------------------------------------------------- |
|
161 |
// |
|
162 |
EXPORT_C TBool CPhoneGsmInCall::HandleCommandL( TInt aCommand ) |
|
163 |
{ |
|
164 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
165 |
"CPhoneGsmInCall::HandleCommandL() "); |
|
166 |
TBool commandStatus = ETrue; |
|
167 |
||
168 |
switch( aCommand ) |
|
169 |
{ |
|
170 |
case EPhoneCallComingCmdAnswer: |
|
171 |
case EPhoneInCallCmdAnswer: |
|
172 |
iStateMachine->SendPhoneEngineMessage( |
|
173 |
CPEPhoneModelIF::EPEMessageAnswer ); |
|
174 |
break; |
|
175 |
||
176 |
// 'Replace' from menu |
|
177 |
case EPhoneInCallCmdReplace: |
|
178 |
ReplaceCallL(); |
|
179 |
break; |
|
180 |
||
181 |
case EPhoneInCallCmdSwap: |
|
182 |
iStateMachine->SendPhoneEngineMessage( |
|
183 |
CPEPhoneModelIF::EPEMessageSwap ); |
|
184 |
break; |
|
185 |
||
186 |
case EPhoneInCallCmdEndAllCalls: |
|
187 |
iStateMachine->SendPhoneEngineMessage( |
|
188 |
CPEPhoneModelIF::EPEMessageReleaseAll ); |
|
189 |
break; |
|
190 |
||
191 |
case EPhoneInCallCmdCreateConference: |
|
192 |
iStateMachine->SendPhoneEngineMessage( |
|
193 |
CPEPhoneModelIF::EPEMessageCreateConference ); |
|
194 |
break; |
|
195 |
||
196 |
case EPhoneInCallCmdTransfer: |
|
197 |
iStateMachine->SendPhoneEngineMessage( |
|
198 |
CPEPhoneModelIF::EPEMessageTransfer ); |
|
199 |
break; |
|
200 |
||
201 |
default: |
|
202 |
CPhoneStateInCall::HandleCommandL( aCommand ); |
|
203 |
break; |
|
204 |
} |
|
205 |
return commandStatus; |
|
206 |
} |
|
207 |
||
208 |
||
209 |
// ----------------------------------------------------------- |
|
210 |
// CPhoneGsmInCall::ReplaceCallL |
|
211 |
// ----------------------------------------------------------- |
|
212 |
// |
|
213 |
void CPhoneGsmInCall::ReplaceCallL() |
|
214 |
{ |
|
215 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
216 |
"CPhoneGsmInCall::ReplaceCallL() "); |
|
217 |
||
218 |
iStateMachine->SendPhoneEngineMessage( |
|
219 |
MPEPhoneModel::EPEMessageReplaceActive ); |
|
220 |
} |
|
221 |
||
222 |
// ----------------------------------------------------------- |
|
223 |
// CPhoneGsmInCall::HandleColpNoteL |
|
224 |
// ----------------------------------------------------------- |
|
225 |
// |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
226 |
void CPhoneGsmInCall::HandleColpNoteL( TInt aCallId ) |
37 | 227 |
{ |
228 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneGsmInCall::HandleColpNoteL() "); |
|
229 |
MPEEngineInfo* EngineInfo = CPhoneState::iStateMachine->PhoneEngineInfo(); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
230 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
231 |
TPhoneCmdParamGlobalNote globalNoteParam; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
232 |
globalNoteParam.SetText( EngineInfo->RemoteColpNumber( aCallId ) ); |
53 | 233 |
globalNoteParam.SetType( EPhoneNotificationDialog ); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
234 |
globalNoteParam.SetTextResourceId( |
37 | 235 |
CPhoneMainResourceResolver::Instance()-> |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
236 |
ResolveResourceID( EPhoneColpConnected ) ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
237 |
globalNoteParam.SetNotificationDialog( ETrue ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
238 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
239 |
iViewCommandHandle->ExecuteCommandL( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
240 |
EPhoneViewShowGlobalNote, &globalNoteParam ); |
37 | 241 |
} |
242 |
||
243 |
// ----------------------------------------------------------- |
|
244 |
// CPhoneGsmInCall::BringIncomingToForegroundL() |
|
245 |
// ----------------------------------------------------------- |
|
246 |
// |
|
247 |
void CPhoneGsmInCall::BringIncomingToForegroundL() |
|
248 |
{ |
|
249 |
__LOGMETHODSTARTEND(EPhoneControl, "CPhoneGsmInCall::BringIncomingToForegroundL( ) "); |
|
250 |
// Remove any phone dialogs if they are displayed |
|
251 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs ); |
|
74 | 252 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewBringPhoneAppToForeground ); |
37 | 253 |
|
254 |
// Disable global notes when there is an incoming call |
|
255 |
TPhoneCmdParamBoolean globalNotifierParam; |
|
256 |
globalNotifierParam.SetBoolean( ETrue ); |
|
257 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled, |
|
76 | 258 |
&globalNotifierParam ); |
37 | 259 |
} |
260 |
||
261 |
||
262 |
// End of File |