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) 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 CPhoneSingleAndAlerting class. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
// INCLUDES |
|
20 |
#include <pevirtualengine.h> |
|
21 |
#include <cpephonemodelif.h> |
|
22 |
#include "cphonesingleandalerting.h" |
|
23 |
#include "tphonecmdparamboolean.h" |
|
24 |
#include "mphonestatemachine.h" |
|
25 |
#include "tphonecmdparamboolean.h" |
|
26 |
#include "tphonecmdparaminteger.h" |
|
27 |
#include "tphonecmdparamcallheaderdata.h" |
|
28 |
#include "tphonecmdparamglobalnote.h" |
|
29 |
#include "tphonecmdparamcallstatedata.h" |
|
30 |
#include "phoneviewcommanddefinitions.h" |
|
31 |
#include "phoneui.hrh" |
|
32 |
#include "cphonemainresourceresolver.h" |
|
33 |
#include "phonerssbase.h" |
|
34 |
#include "phonestatedefinitionsgsm.h" |
|
35 |
#include "phonelogger.h" |
|
36 |
||
37 |
// ================= MEMBER FUNCTIONS ======================= |
|
38 |
||
39 |
// C++ default constructor can NOT contain any code, that |
|
40 |
// might leave. |
|
41 |
// |
|
42 |
CPhoneSingleAndAlerting::CPhoneSingleAndAlerting( |
|
43 |
MPhoneStateMachine* aStateMachine, |
|
44 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
45 |
MPhoneCustomization* aPhoneCustomization ) : |
|
46 |
CPhoneAlerting( aStateMachine, aViewCommandHandle, aPhoneCustomization ) |
|
47 |
{ |
|
48 |
} |
|
49 |
||
50 |
// ----------------------------------------------------------- |
|
51 |
// CPhoneSingleAndAlerting::~CPhoneSingleAndAlerting() |
|
52 |
// Destructor |
|
53 |
// (other items were commented in a header). |
|
54 |
// ----------------------------------------------------------- |
|
55 |
// |
|
56 |
CPhoneSingleAndAlerting::~CPhoneSingleAndAlerting() |
|
57 |
{ |
|
58 |
} |
|
59 |
||
60 |
// ----------------------------------------------------------- |
|
61 |
// CPhoneSingleAndAlerting::ConstructL() |
|
62 |
// Constructor |
|
63 |
// (other items were commented in a header). |
|
64 |
// ----------------------------------------------------------- |
|
65 |
// |
|
66 |
void CPhoneSingleAndAlerting::ConstructL() |
|
67 |
{ |
|
68 |
CPhoneAlerting::ConstructL(); |
|
69 |
} |
|
70 |
||
71 |
// ----------------------------------------------------------- |
|
72 |
// CPhoneSingleAndAlerting::NewL() |
|
73 |
// Constructor |
|
74 |
// (other items were commented in a header). |
|
75 |
// ----------------------------------------------------------- |
|
76 |
// |
|
77 |
CPhoneSingleAndAlerting* CPhoneSingleAndAlerting::NewL( |
|
78 |
MPhoneStateMachine* aStateMachine, |
|
79 |
MPhoneViewCommandHandle* aViewCommandHandle, |
|
80 |
MPhoneCustomization* aPhoneCustomization ) |
|
81 |
{ |
|
82 |
CPhoneSingleAndAlerting* self = new( ELeave ) CPhoneSingleAndAlerting( |
|
83 |
aStateMachine, aViewCommandHandle, aPhoneCustomization ); |
|
84 |
||
85 |
CleanupStack::PushL( self ); |
|
86 |
self->ConstructL(); |
|
87 |
CleanupStack::Pop( self ); |
|
88 |
||
89 |
return self; |
|
90 |
} |
|
91 |
||
92 |
// ----------------------------------------------------------- |
|
93 |
// CPhoneSingleAndAlerting::HandlePhoneEngineMessageL |
|
94 |
// ----------------------------------------------------------- |
|
95 |
// |
|
96 |
void CPhoneSingleAndAlerting::HandlePhoneEngineMessageL( |
|
97 |
const TInt aMessage, |
|
98 |
TInt aCallId ) |
|
99 |
{ |
|
100 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
101 |
"CPhoneSingleAndAlerting::HandlePhoneEngineMessageL()"); |
|
102 |
switch ( aMessage ) |
|
103 |
{ |
|
104 |
case MEngineMonitor::EPEMessageConnected: |
|
105 |
HandleConnectedL( aCallId ); |
|
106 |
break; |
|
107 |
||
108 |
case MEngineMonitor::EPEMessageIdle: |
|
109 |
HandleIdleL( aCallId ); |
|
110 |
break; |
|
111 |
||
112 |
default: |
|
113 |
CPhoneAlerting::HandlePhoneEngineMessageL( aMessage, aCallId ); |
|
114 |
break; |
|
115 |
} |
|
116 |
} |
|
117 |
||
118 |
// -------------------------------------------------------------- |
|
119 |
// CPhoneSingleAndAlerting::HandleKeyMessageL |
|
120 |
// -------------------------------------------------------------- |
|
121 |
// |
|
122 |
void CPhoneSingleAndAlerting::HandleKeyMessageL( |
|
123 |
TPhoneKeyEventMessages aMessage, |
|
124 |
TKeyCode aCode ) |
|
125 |
{ |
|
126 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
127 |
"CPhoneSingleAndAlerting::HandleKeyMessageL()"); |
|
128 |
switch ( aCode ) |
|
129 |
{ |
|
65 | 130 |
case EKeyYes: // send-key |
74 | 131 |
if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
37 | 132 |
{ |
74 | 133 |
iNumberEntryManager->CallFromNumberEntryL(); |
37 | 134 |
} |
135 |
else |
|
136 |
{ |
|
137 |
CPhoneState::SendGlobalErrorNoteL( |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
138 |
EPhoneNoteTextNotAllowed, ETrue ); |
37 | 139 |
} |
140 |
break; |
|
65 | 141 |
|
142 |
case EKeyNo: // end-key |
|
37 | 143 |
if ( aMessage == EPhoneKeyLongPress ) |
144 |
{ |
|
145 |
iStateMachine->SendPhoneEngineMessage( |
|
146 |
CPEPhoneModelIF::EPEMessageTerminateAllConnections ); |
|
147 |
} |
|
148 |
else |
|
149 |
{ |
|
65 | 150 |
DisconnectOutgoingCallL(); |
37 | 151 |
} |
152 |
||
74 | 153 |
if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
37 | 154 |
{ |
155 |
iViewCommandHandle->ExecuteCommandL( |
|
156 |
EPhoneViewRemoveNumberEntry ); |
|
157 |
// Do state-specific operation when number entry is cleared |
|
158 |
HandleNumberEntryClearedL(); |
|
159 |
} |
|
160 |
break; |
|
161 |
||
162 |
default: |
|
163 |
CPhoneAlerting::HandleKeyMessageL( aMessage, aCode ); |
|
164 |
break; |
|
165 |
} |
|
166 |
} |
|
167 |
||
168 |
// ----------------------------------------------------------- |
|
169 |
// CPhoneSingleAndAlerting::HandleConnectedL |
|
170 |
// ----------------------------------------------------------- |
|
171 |
// |
|
172 |
void CPhoneSingleAndAlerting::HandleConnectedL( TInt aCallId ) |
|
173 |
{ |
|
174 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
175 |
"CPhoneSingleAndAlerting::HandleConnectedL()"); |
|
176 |
TPhoneCmdParamCallStateData callStateData; |
|
65 | 177 |
callStateData.SetCallState( EPEStateConnecting ); |
37 | 178 |
iViewCommandHandle->HandleCommandL( |
179 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
180 |
||
181 |
if( callStateData.CallId() == aCallId ) |
|
65 | 182 |
{ |
76 | 183 |
UpdateCallHeaderAndUiCommandsL( aCallId ); |
37 | 184 |
iStateMachine->ChangeState( EPhoneStateTwoSingles ); |
185 |
} |
|
186 |
else |
|
187 |
{ |
|
76 | 188 |
UpdateCallHeader( aCallId ); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
189 |
} |
37 | 190 |
} |
191 |
// ----------------------------------------------------------- |
|
192 |
// CPhoneSingleAndAlerting::HandleIdleL |
|
193 |
// ----------------------------------------------------------- |
|
194 |
// |
|
195 |
void CPhoneSingleAndAlerting::HandleIdleL( TInt aCallId ) |
|
196 |
{ |
|
197 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
198 |
"CPhoneSingleAndAlerting::HandleIdleL()"); |
|
199 |
BeginUiUpdateLC(); |
|
200 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
|
201 |
||
202 |
TPhoneCmdParamInteger countParam; |
|
203 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCountOfActiveCalls, &countParam); |
|
204 |
||
205 |
if ( countParam.Integer() ) |
|
206 |
{ |
|
74 | 207 |
UpdateUiCommands(); |
37 | 208 |
iStateMachine->ChangeState( EPhoneStateSingle ); |
209 |
} |
|
210 |
else |
|
211 |
{ |
|
212 |
DisplayCallTerminationNoteL(); |
|
74 | 213 |
UpdateUiCommands(); |
37 | 214 |
iStateMachine->ChangeState( EPhoneStateAlerting ); |
215 |
} |
|
216 |
EndUiUpdate(); |
|
217 |
} |
|
218 |
||
219 |
// End of File |