125 { |
125 { |
126 __LOGMETHODSTARTEND( EPhoneUIStates, |
126 __LOGMETHODSTARTEND( EPhoneUIStates, |
127 "CPhoneSingleAndAlerting::HandleKeyMessageL()"); |
127 "CPhoneSingleAndAlerting::HandleKeyMessageL()"); |
128 switch ( aCode ) |
128 switch ( aCode ) |
129 { |
129 { |
130 // send-key |
130 case EKeyYes: // send-key |
131 case EKeyYes: |
|
132 if ( CPhoneState::IsNumberEntryUsedL() ) |
131 if ( CPhoneState::IsNumberEntryUsedL() ) |
133 { |
132 { |
134 // send a manual control sequence |
133 CallFromNumberEntryL(); |
135 CPhoneState::CallFromNumberEntryL(); |
|
136 } |
134 } |
137 else |
135 else |
138 { |
136 { |
139 // Show not allowed note |
|
140 CPhoneState::SendGlobalErrorNoteL( |
137 CPhoneState::SendGlobalErrorNoteL( |
141 EPhoneNoteTextNotAllowed, ETrue ); |
138 EPhoneNoteTextNotAllowed, ETrue ); |
142 } |
139 } |
143 break; |
140 break; |
144 |
141 |
145 // end-key |
142 case EKeyNo: // end-key |
146 case EKeyNo: |
|
147 if ( aMessage == EPhoneKeyLongPress ) |
143 if ( aMessage == EPhoneKeyLongPress ) |
148 { |
144 { |
149 iStateMachine->SendPhoneEngineMessage( |
145 iStateMachine->SendPhoneEngineMessage( |
150 CPEPhoneModelIF::EPEMessageTerminateAllConnections ); |
146 CPEPhoneModelIF::EPEMessageTerminateAllConnections ); |
151 } |
147 } |
152 else |
148 else |
153 { |
149 { |
154 DisconnectOutgoingCallL(); |
150 DisconnectOutgoingCallL(); |
155 } |
151 } |
156 |
152 |
157 if ( CPhoneState::IsNumberEntryUsedL() ) |
153 if ( IsNumberEntryUsedL() ) |
158 { |
154 { |
159 // Remove number entry from screen |
|
160 iViewCommandHandle->ExecuteCommandL( |
155 iViewCommandHandle->ExecuteCommandL( |
161 EPhoneViewRemoveNumberEntry ); |
156 EPhoneViewRemoveNumberEntry ); |
162 // Do state-specific operation when number entry is cleared |
157 // Do state-specific operation when number entry is cleared |
163 HandleNumberEntryClearedL(); |
158 HandleNumberEntryClearedL(); |
164 } |
159 } |
165 break; |
160 break; |
166 |
161 |
167 default: |
162 default: |
168 // do base operation |
|
169 CPhoneAlerting::HandleKeyMessageL( aMessage, aCode ); |
163 CPhoneAlerting::HandleKeyMessageL( aMessage, aCode ); |
170 break; |
164 break; |
171 } |
165 } |
172 } |
166 } |
173 |
167 |
177 // |
171 // |
178 void CPhoneSingleAndAlerting::HandleConnectedL( TInt aCallId ) |
172 void CPhoneSingleAndAlerting::HandleConnectedL( TInt aCallId ) |
179 { |
173 { |
180 __LOGMETHODSTARTEND( EPhoneUIStates, |
174 __LOGMETHODSTARTEND( EPhoneUIStates, |
181 "CPhoneSingleAndAlerting::HandleConnectedL()"); |
175 "CPhoneSingleAndAlerting::HandleConnectedL()"); |
182 |
|
183 // Find the alerting call |
|
184 TPhoneCmdParamCallStateData callStateData; |
176 TPhoneCmdParamCallStateData callStateData; |
185 callStateData.SetCallState( EPEStateConnecting ); |
177 callStateData.SetCallState( EPEStateConnecting ); |
186 iViewCommandHandle->HandleCommandL( |
178 iViewCommandHandle->HandleCommandL( |
187 EPhoneViewGetCallIdByState, &callStateData ); |
179 EPhoneViewGetCallIdByState, &callStateData ); |
188 |
180 |
189 if( callStateData.CallId() == aCallId ) |
181 if( callStateData.CallId() == aCallId ) |
190 { |
182 { |
191 // Keep Phone in the foreground |
|
192 TPhoneCmdParamBoolean booleanParam; |
183 TPhoneCmdParamBoolean booleanParam; |
193 booleanParam.SetBoolean( EFalse ); |
184 booleanParam.SetBoolean( EFalse ); |
194 iViewCommandHandle->ExecuteCommandL( |
185 iViewCommandHandle->ExecuteCommandL( |
195 EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam ); |
186 EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam ); |
196 |
187 |
197 CPhoneState::BeginUiUpdateLC(); |
188 BeginUiUpdateLC(); |
198 |
189 |
199 // Show bubble |
|
200 TPhoneCmdParamCallHeaderData callHeaderParam; |
190 TPhoneCmdParamCallHeaderData callHeaderParam; |
201 callHeaderParam.SetCallState( EPEStateConnected ); |
191 callHeaderParam.SetCallState( EPEStateConnected ); |
202 iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, |
192 iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, |
203 &callHeaderParam ); |
193 &callHeaderParam ); |
204 |
194 |
205 CPhoneState::SetTouchPaneButtons( EPhoneTwoSinglesButtons ); |
195 SetTouchPaneButtons( EPhoneTwoSinglesButtons ); |
206 CPhoneState::EndUiUpdate(); |
196 EndUiUpdate(); |
207 |
197 |
208 // Set Hold flag to view |
|
209 TPhoneCmdParamBoolean holdFlag; |
198 TPhoneCmdParamBoolean holdFlag; |
210 holdFlag.SetBoolean( EFalse ); |
199 holdFlag.SetBoolean( EFalse ); |
211 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); |
200 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); |
212 |
201 |
213 |
|
214 // Set Two singles softkeys |
|
215 UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA ); |
202 UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA ); |
216 |
|
217 // Go to two singles state |
|
218 iStateMachine->ChangeState( EPhoneStateTwoSingles ); |
203 iStateMachine->ChangeState( EPhoneStateTwoSingles ); |
219 } |
204 } |
220 else |
205 else |
221 { |
206 { |
222 // Show bubble |
|
223 TPhoneCmdParamCallHeaderData callHeaderParam; |
207 TPhoneCmdParamCallHeaderData callHeaderParam; |
224 callHeaderParam.SetCallState( EPEStateConnected ); |
208 callHeaderParam.SetCallState( EPEStateConnected ); |
225 iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, |
209 iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, |
226 &callHeaderParam ); |
210 &callHeaderParam ); |
227 |
211 |
236 // |
220 // |
237 void CPhoneSingleAndAlerting::HandleIdleL( TInt aCallId ) |
221 void CPhoneSingleAndAlerting::HandleIdleL( TInt aCallId ) |
238 { |
222 { |
239 __LOGMETHODSTARTEND( EPhoneUIStates, |
223 __LOGMETHODSTARTEND( EPhoneUIStates, |
240 "CPhoneSingleAndAlerting::HandleIdleL()"); |
224 "CPhoneSingleAndAlerting::HandleIdleL()"); |
241 |
|
242 BeginUiUpdateLC(); |
225 BeginUiUpdateLC(); |
243 |
|
244 // Remove call |
|
245 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
226 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
246 |
227 |
247 if ( !TopAppIsDisplayedL() ) |
228 if ( !TopAppIsDisplayedL() ) |
248 { |
229 { |
249 // Continue displaying current app but set up the |
230 // Continue displaying current app but set up the |
254 TPhoneCmdParamInteger countParam; |
235 TPhoneCmdParamInteger countParam; |
255 iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCountOfActiveCalls, &countParam); |
236 iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCountOfActiveCalls, &countParam); |
256 |
237 |
257 if ( countParam.Integer() ) |
238 if ( countParam.Integer() ) |
258 { |
239 { |
259 SetTouchPaneButtons( EPhoneIncallButtons ); |
240 SetTouchPaneButtons( EPhoneIncallButtons ); |
260 // Set Hold flag to view |
|
261 TPhoneCmdParamBoolean holdFlag; |
241 TPhoneCmdParamBoolean holdFlag; |
262 holdFlag.SetBoolean( ETrue ); |
242 holdFlag.SetBoolean( ETrue ); |
263 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); |
243 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag ); |
264 UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
244 UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
265 iStateMachine->ChangeState( EPhoneStateSingle ); |
245 iStateMachine->ChangeState( EPhoneStateSingle ); |
266 } |
246 } |
267 else |
247 else |
268 { |
248 { |
269 // Display call termination note, if necessary |
|
270 DisplayCallTerminationNoteL(); |
249 DisplayCallTerminationNoteL(); |
271 SetTouchPaneButtons( EPhoneCallSetupButtons ); |
250 SetTouchPaneButtons( EPhoneCallSetupButtons ); |
272 UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
251 UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
273 iStateMachine->ChangeState( EPhoneStateAlerting ); |
252 iStateMachine->ChangeState( EPhoneStateAlerting ); |
274 } |
253 } |
275 |
|
276 EndUiUpdate(); |
254 EndUiUpdate(); |
277 } |
255 } |
278 |
256 |
279 // ----------------------------------------------------------- |
257 // ----------------------------------------------------------- |
280 // CPhoneSingleAndAlerting::UpdateInCallCbaL |
258 // CPhoneSingleAndAlerting::UpdateInCallCbaL |