author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Mon, 04 Oct 2010 00:16:48 +0300 | |
changeset 77 | 2be0b271d017 |
parent 72 | c76a0b1755b9 |
child 76 | cfea66083b62 |
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 |
{ |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
130 |
case EKeyYes: // send-key |
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
131 |
if ( iNumberEntryManager->IsNumberEntryUsedL() ) |
37 | 132 |
{ |
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
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; |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
141 |
|
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
142 |
case EKeyNo: // end-key |
37 | 143 |
if ( aMessage == EPhoneKeyLongPress ) |
144 |
{ |
|
145 |
iStateMachine->SendPhoneEngineMessage( |
|
146 |
CPEPhoneModelIF::EPEMessageTerminateAllConnections ); |
|
147 |
} |
|
148 |
else |
|
149 |
{ |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
150 |
DisconnectOutgoingCallL(); |
37 | 151 |
} |
152 |
||
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
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; |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
177 |
callStateData.SetCallState( EPEStateConnecting ); |
37 | 178 |
iViewCommandHandle->HandleCommandL( |
179 |
EPhoneViewGetCallIdByState, &callStateData ); |
|
180 |
||
181 |
if( callStateData.CallId() == aCallId ) |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
182 |
{ |
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
183 |
BeginUiUpdateLC(); |
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
184 |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
185 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId ); |
37 | 186 |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
187 |
UpdateUiCommands(); |
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
188 |
EndUiUpdate(); |
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
189 |
|
37 | 190 |
iStateMachine->ChangeState( EPhoneStateTwoSingles ); |
191 |
} |
|
192 |
else |
|
193 |
{ |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
194 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId ); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
195 |
} |
37 | 196 |
} |
197 |
// ----------------------------------------------------------- |
|
198 |
// CPhoneSingleAndAlerting::HandleIdleL |
|
199 |
// ----------------------------------------------------------- |
|
200 |
// |
|
201 |
void CPhoneSingleAndAlerting::HandleIdleL( TInt aCallId ) |
|
202 |
{ |
|
203 |
__LOGMETHODSTARTEND( EPhoneUIStates, |
|
204 |
"CPhoneSingleAndAlerting::HandleIdleL()"); |
|
205 |
BeginUiUpdateLC(); |
|
206 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
|
207 |
||
208 |
TPhoneCmdParamInteger countParam; |
|
209 |
iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCountOfActiveCalls, &countParam); |
|
210 |
||
211 |
if ( countParam.Integer() ) |
|
212 |
{ |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
213 |
UpdateUiCommands(); |
37 | 214 |
iStateMachine->ChangeState( EPhoneStateSingle ); |
215 |
} |
|
216 |
else |
|
217 |
{ |
|
218 |
DisplayCallTerminationNoteL(); |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
219 |
UpdateUiCommands(); |
37 | 220 |
iStateMachine->ChangeState( EPhoneStateAlerting ); |
221 |
} |
|
222 |
EndUiUpdate(); |
|
223 |
} |
|
224 |
||
225 |
// End of File |