76 // CPhoneCallSetupAndWaiting::NewL() |
77 // CPhoneCallSetupAndWaiting::NewL() |
77 // Constructor |
78 // Constructor |
78 // (other items were commented in a header). |
79 // (other items were commented in a header). |
79 // ----------------------------------------------------------- |
80 // ----------------------------------------------------------- |
80 // |
81 // |
81 CPhoneCallSetupAndWaiting* CPhoneCallSetupAndWaiting::NewL( |
82 CPhoneCallSetupAndWaiting* CPhoneCallSetupAndWaiting::NewL( |
82 MPhoneStateMachine* aStateMachine, |
83 MPhoneStateMachine* aStateMachine, |
83 MPhoneViewCommandHandle* aViewCommandHandle, |
84 MPhoneViewCommandHandle* aViewCommandHandle, |
84 MPhoneCustomization* aPhoneCustomization ) |
85 MPhoneCustomization* aPhoneCustomization ) |
85 { |
86 { |
86 CPhoneCallSetupAndWaiting* self = new( ELeave ) CPhoneCallSetupAndWaiting( |
87 CPhoneCallSetupAndWaiting* self = new( ELeave ) CPhoneCallSetupAndWaiting( |
87 aStateMachine, aViewCommandHandle, aPhoneCustomization ); |
88 aStateMachine, aViewCommandHandle, aPhoneCustomization ); |
88 |
89 |
89 CleanupStack::PushL( self ); |
90 CleanupStack::PushL( self ); |
90 self->ConstructL(); |
91 self->ConstructL(); |
91 CleanupStack::Pop( self ); |
92 CleanupStack::Pop( self ); |
92 |
93 |
93 return self; |
94 return self; |
94 } |
95 } |
95 |
96 |
96 // ----------------------------------------------------------- |
97 // ----------------------------------------------------------- |
97 // CPhoneCallSetupAndWaiting::HandlePhoneEngineMessageL |
98 // CPhoneCallSetupAndWaiting::HandlePhoneEngineMessageL |
98 // ----------------------------------------------------------- |
99 // ----------------------------------------------------------- |
99 // |
100 // |
100 void CPhoneCallSetupAndWaiting::HandlePhoneEngineMessageL( |
101 void CPhoneCallSetupAndWaiting::HandlePhoneEngineMessageL( |
101 const TInt aMessage, |
102 const TInt aMessage, |
102 TInt aCallId ) |
103 TInt aCallId ) |
103 { |
104 { |
104 __LOGMETHODSTARTEND( EPhoneUIStates, |
105 __LOGMETHODSTARTEND( EPhoneUIStates, |
105 "CPhoneCallSetupAndWaiting::HandlePhoneEngineMessageL()"); |
106 "CPhoneCallSetupAndWaiting::HandlePhoneEngineMessageL()"); |
106 switch ( aMessage ) |
107 switch ( aMessage ) |
107 { |
108 { |
108 case MEngineMonitor::EPEMessageIdle: |
109 case MEngineMonitor::EPEMessageIdle: |
109 HandleIdleL( aCallId ); |
110 HandleIdleL( aCallId ); |
110 break; |
111 break; |
111 |
112 |
112 case MEngineMonitor::EPEMessageConnected: |
113 case MEngineMonitor::EPEMessageConnected: |
113 HandleConnectedL( aCallId ); |
114 HandleConnectedL( aCallId ); |
114 break; |
115 break; |
115 |
116 |
116 default: |
117 default: |
117 CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId ); |
118 CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId ); |
118 break; |
119 break; |
119 } |
120 } |
120 } |
121 } |
121 |
122 |
122 // ----------------------------------------------------------- |
123 // ----------------------------------------------------------- |
|
124 // CPhoneCallSetupAndWaiting::HandleErrorL |
|
125 // ----------------------------------------------------------- |
|
126 // |
|
127 EXPORT_C void CPhoneCallSetupAndWaiting::HandleErrorL( |
|
128 const TPEErrorInfo& aErrorInfo ) |
|
129 { |
|
130 __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneCallSetupAndWaiting::HandleErrorL()"); |
|
131 |
|
132 if( aErrorInfo.iErrorCode == ECCPErrorCCUserAlertingNoAnswer ) |
|
133 { |
|
134 // Should not shown "No Answer" note |
|
135 __PHONELOG1( EBasic, EPhoneUIStates, |
|
136 "PhoneUIStates: CPhoneCallSetupAndWaiting::HandleErrorL - aErrorInfo.iErrorCode =%d ", |
|
137 aErrorInfo.iErrorCode); |
|
138 } |
|
139 else |
|
140 { |
|
141 CPhoneState::HandleErrorL( aErrorInfo ); |
|
142 } |
|
143 } |
|
144 |
|
145 // ----------------------------------------------------------- |
|
146 // CPhoneCallSetupAndWaiting::OpenMenuBarL |
|
147 // ----------------------------------------------------------- |
|
148 // |
|
149 void CPhoneCallSetupAndWaiting::OpenMenuBarL() |
|
150 { |
|
151 __LOGMETHODSTARTEND( EPhoneUIStates, |
|
152 "CPhoneCallSetupAndWaiting::OpenMenuBarL()"); |
|
153 TInt resourceId; |
|
154 |
|
155 if ( iOnScreenDialer && IsDTMFEditorVisibleL() ) |
|
156 { |
|
157 resourceId = EPhoneDtmfDialerMenubar; |
|
158 } |
|
159 else if ( IsNumberEntryVisibleL() ) |
|
160 { |
|
161 resourceId = EPhoneAlertingAndWaitingCallMenuBarWithNumberEntry; |
|
162 } |
|
163 else |
|
164 { |
|
165 resourceId = EPhoneAlertingAndWaitingCallMenuBar; |
|
166 } |
|
167 |
|
168 TPhoneCmdParamInteger integerParam; |
|
169 integerParam.SetInteger( |
|
170 CPhoneMainResourceResolver::Instance()-> |
|
171 ResolveResourceID( resourceId ) ); |
|
172 iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, |
|
173 &integerParam ); |
|
174 } |
|
175 |
|
176 // ----------------------------------------------------------- |
123 // CPhoneCallSetupAndWaiting::HandleIdleL |
177 // CPhoneCallSetupAndWaiting::HandleIdleL |
124 // ----------------------------------------------------------- |
178 // ----------------------------------------------------------- |
125 // |
179 // |
126 void CPhoneCallSetupAndWaiting::HandleIdleL( TInt aCallId ) |
180 void CPhoneCallSetupAndWaiting::HandleIdleL( TInt aCallId ) |
127 { |
181 { |
128 __LOGMETHODSTARTEND( EPhoneUIStates, |
182 __LOGMETHODSTARTEND( EPhoneUIStates, |
129 "CPhoneCallSetupAndWaiting::HandleIdleL()"); |
183 "CPhoneCallSetupAndWaiting::HandleIdleL()"); |
130 |
184 |
131 BeginUiUpdateLC(); |
185 BeginUiUpdateLC(); |
132 |
186 |
133 // Remove call |
187 // Remove call |
134 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
188 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId ); |
|
189 |
|
190 // Close menu bar, if it is displayed |
|
191 iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
135 |
192 |
136 // Find out do we have waiting or outgoing call left |
193 // Find out do we have waiting or outgoing call left |
137 TPhoneCmdParamCallStateData callStateData; |
194 TPhoneCmdParamCallStateData callStateData; |
138 callStateData.SetCallState( EPEStateRinging ); |
195 callStateData.SetCallState( EPEStateRinging ); |
139 iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState, |
196 iViewCommandHandle->HandleCommandL( EPhoneViewGetCallIdByState, |
140 &callStateData ); |
197 &callStateData ); |
141 |
198 |
142 if( callStateData.CallId() > KErrNotFound ) |
199 if( callStateData.CallId() > KErrNotFound ) |
143 { |
200 { |
144 |
201 // Idle message came for callSetup |
|
202 |
|
203 if ( iOnScreenDialer && IsDTMFEditorVisibleL() ) |
|
204 { |
|
205 CloseDTMFEditorL(); |
|
206 } |
|
207 |
145 // Display ringing bubble |
208 // Display ringing bubble |
146 TPhoneCmdParamCallHeaderData callHeaderParam; |
209 TPhoneCmdParamCallHeaderData callHeaderParam; |
147 callHeaderParam.SetCallState( EPEStateRinging ); |
210 callHeaderParam.SetCallState( EPEStateRinging ); |
148 |
211 |
149 SetCallHeaderTextsForCallComingInL( callStateData.CallId(), EFalse, &callHeaderParam ); |
212 SetCallHeaderTextsForCallComingInL( callStateData.CallId(), EFalse, &callHeaderParam ); |
150 |
213 |
151 iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, |
214 iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, |
152 callStateData.CallId(), |
215 callStateData.CallId(), |
153 &callHeaderParam ); |
216 &callHeaderParam ); |
154 |
217 |
155 // Show incoming call buttons |
218 // Show incoming call buttons |
156 SetTouchPaneButtons( EPhoneIncomingCallButtons ); |
219 SetTouchPaneButtons( EPhoneIncomingCallButtons ); |
157 |
220 SetTouchPaneButtonEnabled( EPhoneCallComingCmdSilent ); |
158 // Bring up callhandling view |
221 |
159 BringIncomingToForegroundL(); |
222 // Bring up callhandling view |
160 |
223 BringIncomingToForegroundL(); |
|
224 |
161 // state changes to Incoming |
225 // state changes to Incoming |
162 iCbaManager->UpdateIncomingCbaL( callStateData.CallId() ); |
226 iCbaManager->UpdateIncomingCbaL( callStateData.CallId() ); |
|
227 UpdateSilenceButtonDimming(); |
163 SetRingingTonePlaybackL( callStateData.CallId() ); |
228 SetRingingTonePlaybackL( callStateData.CallId() ); |
164 SetBackButtonActive(EFalse); |
229 iStateMachine->ChangeState( EPhoneStateIncoming ); |
165 iStateMachine->ChangeState( EPhoneStateIncoming ); |
230 } |
166 } |
231 |
167 |
|
168 else |
232 else |
169 { |
233 { |
170 // Show call setup buttons |
234 // Show call setup buttons |
171 CPhoneState::SetTouchPaneButtons( EPhoneCallSetupButtons ); |
235 CPhoneState::SetTouchPaneButtons( EPhoneCallSetupButtons ); |
172 // Waiting call was terminated |
236 // Waiting call was terminated |
173 UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
237 UpdateCbaL( EPhoneCallHandlingInCallCBA ); |
174 iStateMachine->ChangeState( EPhoneStateAlerting ); |
238 iStateMachine->ChangeState( EPhoneStateAlerting ); |
175 } |
239 } |
176 |
240 |
177 EndUiUpdate(); |
241 EndUiUpdate(); |
178 } |
242 } |
179 |
243 |
180 // ----------------------------------------------------------- |
244 // ----------------------------------------------------------- |
181 // CPhoneCallSetupAndWaiting::UpdateInCallCbaL |
245 // CPhoneCallSetupAndWaiting::UpdateInCallCbaL |
182 // ----------------------------------------------------------- |
246 // ----------------------------------------------------------- |
183 // |
247 // |
184 void CPhoneCallSetupAndWaiting::UpdateInCallCbaL() |
248 void CPhoneCallSetupAndWaiting::UpdateInCallCbaL() |
185 { |
249 { |
186 __LOGMETHODSTARTEND( EPhoneControl, |
250 __LOGMETHODSTARTEND( EPhoneControl, |
187 "CPhoneCallSetupAndWaiting::UpdateInCallCbaL() "); |
251 "CPhoneCallSetupAndWaiting::UpdateInCallCbaL() "); |
188 |
252 |
189 UpdateCbaL( EPhoneCallHandlingIncomingRejectCBA ); |
253 UpdateCbaL( EPhoneCallHandlingIncomingRejectCBA ); |
190 } |
254 } |
191 |
255 |
192 // ----------------------------------------------------------- |
256 // ----------------------------------------------------------- |
193 // CPhoneCallSetupAndWaiting::HandleConnectedL |
257 // CPhoneCallSetupAndWaiting::HandleConnectedL |
195 // |
259 // |
196 void CPhoneCallSetupAndWaiting::HandleConnectedL( TInt aCallId ) |
260 void CPhoneCallSetupAndWaiting::HandleConnectedL( TInt aCallId ) |
197 { |
261 { |
198 __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneCallSetupAndWaiting::HandleConnectedL() "); |
262 __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneCallSetupAndWaiting::HandleConnectedL() "); |
199 |
263 |
|
264 // Close menu bar, if it is displayed |
|
265 iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose ); |
|
266 |
200 CPhoneState::BeginUiUpdateLC(); |
267 CPhoneState::BeginUiUpdateLC(); |
201 |
268 |
202 // Update bubble |
269 // Update bubble |
203 TPhoneCmdParamCallHeaderData callHeaderParam; |
270 TPhoneCmdParamCallHeaderData callHeaderParam; |
204 callHeaderParam.SetCallState( EPEStateConnected ); |
271 callHeaderParam.SetCallState( EPEStateConnected ); |
205 iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, |
272 iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, |
206 &callHeaderParam ); |
273 &callHeaderParam ); |
207 |
274 |
208 // Update Touch buttons |
275 // Update Touch buttons |
209 CPhoneState::SetTouchPaneButtons( EPhoneWaitingCallButtons ); |
276 CPhoneState::SetTouchPaneButtons( EPhoneWaitingCallButtons ); |
210 |
277 SetToolbarDimming( EFalse ); |
211 CPhoneState::EndUiUpdate(); |
278 |
212 |
279 EndUiUpdate(); |
|
280 |
213 if ( CPhoneState::IsNumberEntryUsedL() ) |
281 if ( CPhoneState::IsNumberEntryUsedL() ) |
214 { |
282 { |
215 // Show number entry |
283 // Show number entry |
216 TPhoneCmdParamBoolean booleanParam; |
284 TPhoneCmdParamBoolean booleanParam; |
217 booleanParam.SetBoolean( ETrue ); |
285 booleanParam.SetBoolean( ETrue ); |
218 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetNumberEntryVisible, &booleanParam ); |
286 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetNumberEntryVisible, &booleanParam ); |
219 } |
287 } |
220 |
288 |
221 // Go to Single And Waiting state |
289 // Go to Single And Waiting state |
222 UpdateCbaL( EPhoneCallHandlingCallWaitingCBA ); |
290 UpdateCbaL( EPhoneCallHandlingCallWaitingCBA ); |
223 iStateMachine->ChangeState( EPhoneStateWaitingInSingle ); |
291 iStateMachine->ChangeState( EPhoneStateWaitingInSingle ); |
224 } |
292 } |
225 |
293 |
226 // End of File |
294 // End of File |