32 #include "tphonecmdparaminteger.h" |
30 #include "tphonecmdparaminteger.h" |
33 #include "tphonecmdparamstring.h" |
31 #include "tphonecmdparamstring.h" |
34 #include "tphonecmdparamquery.h" |
32 #include "tphonecmdparamquery.h" |
35 #include "tphonecmdparamglobalnote.h" |
33 #include "tphonecmdparamglobalnote.h" |
36 #include "cphonemainresourceresolver.h" |
34 #include "cphonemainresourceresolver.h" |
37 #include "cphonestatemachinevoip.h" |
|
38 #include "cphonestateutilsvoip.h" |
|
39 |
|
40 |
35 |
41 |
36 |
42 // ======== MEMBER FUNCTIONS ======== |
37 // ======== MEMBER FUNCTIONS ======== |
43 |
38 |
44 // --------------------------------------------------------------------------- |
39 // --------------------------------------------------------------------------- |
143 iStateMachine.PhoneEngineInfo()-> |
138 iStateMachine.PhoneEngineInfo()-> |
144 SetTransferTargetCommand( fetchContent ); |
139 SetTransferTargetCommand( fetchContent ); |
145 iStateMachine.SendPhoneEngineMessage( |
140 iStateMachine.SendPhoneEngineMessage( |
146 MPEPhoneModel::EPEMessageDoUnattendedTransfer ); |
141 MPEPhoneModel::EPEMessageDoUnattendedTransfer ); |
147 |
142 |
148 if ( KErrNone == iStateMachine.PhoneEngineInfo()-> |
143 ShowWaitingAcceptanceNoteL(); |
149 ErrorInfo().iErrorCode ) |
|
150 { |
|
151 ShowWaitingAcceptanceNoteL(); |
|
152 } |
|
153 } |
144 } |
154 break; |
145 break; |
155 case EPhoneCmdUnattendedTransferCallBackOk: |
146 |
156 { |
|
157 MPEEngineInfo* info = iStateMachine.PhoneEngineInfo(); |
|
158 const TDesC& callBackToAddr = info->CallBackAddress(); |
|
159 // Service id used for last call is used to call back |
|
160 TUint32 serviceId = info->ServiceIdCommand(); |
|
161 static_cast<CPhoneStateMachineVoIP&>( |
|
162 iStateMachine ).StateUtils().SelectServiceAndDialL( |
|
163 callBackToAddr, serviceId ); |
|
164 } |
|
165 break; |
|
166 case EPhoneCmdUnattendedTransferCallBackCancel: |
|
167 { |
|
168 MPEEngineInfo* info = iStateMachine.PhoneEngineInfo(); |
|
169 info->SetCallBackAddress( KNullDesC ); |
|
170 } |
|
171 break; |
|
172 default: |
147 default: |
173 __PHONELOG( EOnlyFatal, PhoneUIVoIPExtension, |
148 __PHONELOG( EOnlyFatal, PhoneUIVoIPExtension, |
174 "CPhoneUnattendedTransferCmdHandler::HandleCommandL, DEFAULT" ); |
149 "CPhoneUnattendedTransferCmdHandler::HandleCommandL, DEFAULT" ); |
175 ASSERT( EFalse ); |
150 ASSERT( EFalse ); |
176 } |
151 } |
183 // |
158 // |
184 void CPhoneUnattendedTransferCmdHandler::ShowTransferDialerL() |
159 void CPhoneUnattendedTransferCmdHandler::ShowTransferDialerL() |
185 { |
160 { |
186 __LOGMETHODSTARTEND( PhoneUIVoIPExtension, |
161 __LOGMETHODSTARTEND( PhoneUIVoIPExtension, |
187 "CPhoneUnattendedTransferCmdHandler::ShowTransferDialerL" ) |
162 "CPhoneUnattendedTransferCmdHandler::ShowTransferDialerL" ) |
188 |
163 |
189 CPhoneState* phoneState = static_cast<CPhoneState*>( iStateMachine.State() ); |
|
190 if ( FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer ) ) |
|
191 { |
|
192 TPhoneCmdParamCustomDialer customDialerParam; |
|
193 customDialerParam.SetDialerController( iTransferDialerController ); |
|
194 |
|
195 // Set dialer to transfer mode. |
|
196 iViewCommandHandle.ExecuteCommandL( |
|
197 EPhoneViewShowCustomizedDialer, |
|
198 &customDialerParam ); |
|
199 |
|
200 // Open transfer dialer |
|
201 phoneState->BeginTransEffectLC( ECallUiDisappear ); |
|
202 iViewCommandHandle.ExecuteCommandL( EPhoneViewCreateNumberEntry ); |
|
203 phoneState->EndTransEffect(); |
|
204 |
|
205 // Update CBA to transfer dialer CBA |
|
206 TPhoneCmdParamInteger resourceId; |
|
207 resourceId.SetInteger( CPhoneMainResourceResolver::Instance()-> |
|
208 ResolveResourceID( iTransferDialerController->CbaResourceId() ) ); |
|
209 iViewCommandHandle.ExecuteCommandL( EPhoneViewUpdateCba, |
|
210 &resourceId ); |
|
211 } |
|
212 else |
|
213 { |
|
214 HBufC *text = HBufC::NewLC( KPhoneNumberEntryBufferSize ); |
|
215 TPtr ptr( text->Des() ); |
|
216 // Pre-populate the query with the number entry contents, if it exists |
|
217 if ( phoneState->IsNumberEntryUsedL() ) |
|
218 { |
|
219 // get the number entry contents |
|
220 TPhoneCmdParamString stringParam; |
|
221 stringParam.SetString( &ptr ); |
|
222 iViewCommandHandle.ExecuteCommandL( |
|
223 EPhoneViewGetLocalizedNumberFromEntry, |
|
224 &stringParam ); |
|
225 } |
|
226 |
|
227 TPhoneCmdParamQuery queryDialogParam; |
|
228 queryDialogParam.SetQueryType( EPhoneGenericTextQuery ); |
|
229 queryDialogParam.SetQueryResourceId( |
|
230 CPhoneMainResourceResolver::Instance()-> |
|
231 ResolveResourceID( EPhoneVoIPTransferAddressQuery ) ); |
|
232 |
|
233 queryDialogParam.SetDefaultCba( CPhoneMainResourceResolver::Instance()-> |
|
234 ResolveResourceID( EPhoneVoIPTransferAddressQueryEmptySoftkeys ) ); |
|
235 |
|
236 queryDialogParam.SetContentCba( CPhoneMainResourceResolver::Instance()-> |
|
237 ResolveResourceID( EPhoneVoIPTransferAddressQueryNotEmptySoftkeys ) ); |
|
238 |
|
239 queryDialogParam.SetDataText( &ptr ); |
|
240 queryDialogParam.SetSendKeyEnabled( ETrue ); |
|
241 |
|
242 // Display dialog |
|
243 iViewCommandHandle.ExecuteCommandL( |
|
244 EPhoneViewShowQuery, &queryDialogParam ); |
|
245 |
|
246 CleanupStack::PopAndDestroy( text ); |
|
247 } |
|
248 } |
164 } |
249 |
165 |
250 |
166 |
251 // --------------------------------------------------------------------------- |
167 // --------------------------------------------------------------------------- |
252 // CPhoneUnattendedTransferCmdHandler::DoUnattendedTransferL |
168 // CPhoneUnattendedTransferCmdHandler::DoUnattendedTransferL |
268 phoneState->IsCustomizedDialerVisibleL() ) |
184 phoneState->IsCustomizedDialerVisibleL() ) |
269 { |
185 { |
270 iViewCommandHandle.ExecuteCommand( |
186 iViewCommandHandle.ExecuteCommand( |
271 EPhoneViewGetNumberFromEntry, |
187 EPhoneViewGetNumberFromEntry, |
272 &transferTarget ); |
188 &transferTarget ); |
273 |
|
274 phoneState->CloseCustomizedDialerL(); |
|
275 } |
|
276 else |
|
277 { |
|
278 iViewCommandHandle.ExecuteCommandL( |
|
279 EPhoneViewGetTextQueryContent, &transferTarget ); |
|
280 } |
189 } |
281 |
190 |
282 // Set transfer to address to the phoneengine |
191 // Set transfer to address to the phoneengine |
283 iStateMachine.PhoneEngineInfo()->SetTransferTargetCommand( ptr ); |
192 iStateMachine.PhoneEngineInfo()->SetTransferTargetCommand( ptr ); |
284 iStateMachine.SendPhoneEngineMessage( |
193 iStateMachine.SendPhoneEngineMessage( |
285 MPEPhoneModel::EPEMessageDoUnattendedTransfer ); |
194 MPEPhoneModel::EPEMessageDoUnattendedTransfer ); |
286 |
195 |
287 if ( KErrNone == iStateMachine.PhoneEngineInfo()->ErrorInfo().iErrorCode ) |
196 ShowWaitingAcceptanceNoteL(); |
288 { |
|
289 ShowWaitingAcceptanceNoteL(); |
|
290 } |
|
291 CleanupStack::PopAndDestroy( content ); |
197 CleanupStack::PopAndDestroy( content ); |
292 } |
198 } |
293 |
199 |
294 |
200 |
295 // --------------------------------------------------------------------------- |
201 // --------------------------------------------------------------------------- |
318 "CPhoneUnattendedTransferCmdHandler::OpenSingleItemContactFetchL" ) |
220 "CPhoneUnattendedTransferCmdHandler::OpenSingleItemContactFetchL" ) |
319 |
221 |
320 TPhoneCmdParamInteger integerParam; |
222 TPhoneCmdParamInteger integerParam; |
321 integerParam.SetInteger( aFetchType ); |
223 integerParam.SetInteger( aFetchType ); |
322 |
224 |
323 iViewCommandHandle.HandleCommandL( |
225 /*iViewCommandHandle.HandleCommandL( |
324 EPhoneViewOpenSingleItemFetchDialog, |
226 EPhoneViewOpenSingleItemFetchDialog, |
325 &integerParam ); |
227 &integerParam );*/ |
326 } |
228 } |
327 |
229 |
328 // --------------------------------------------------------------------------- |
230 // --------------------------------------------------------------------------- |
329 // CPhoneUnattendedTransferCmdHandler::ShowWaitingAcceptanceNoteL |
231 // CPhoneUnattendedTransferCmdHandler::ShowWaitingAcceptanceNoteL |
330 // --------------------------------------------------------------------------- |
232 // --------------------------------------------------------------------------- |
331 // |
233 // |
332 void CPhoneUnattendedTransferCmdHandler::ShowWaitingAcceptanceNoteL() |
234 void CPhoneUnattendedTransferCmdHandler::ShowWaitingAcceptanceNoteL() |
333 { |
235 { |
334 __LOGMETHODSTARTEND( PhoneUIVoIPExtension, |
236 __LOGMETHODSTARTEND( PhoneUIVoIPExtension, |
335 "CPhoneUnattendedTransferCmdHandler::ShowWaitingAcceptanceNoteL" ) |
237 "CPhoneUnattendedTransferCmdHandler::ShowWaitingAcceptanceNoteL" ) |
336 // Show "Waiting acceptance..." note |
238 //TODO: Show "Waiting acceptance..." note |
337 TPhoneCmdParamGlobalNote globalNoteParam; |
239 // TPhoneCmdParamGlobalNote globalNoteParam; |
338 globalNoteParam.SetType( EAknGlobalWaitNote ); |
240 // globalNoteParam.SetType( EAknGlobalWaitNote ); |
339 globalNoteParam.SetTone( EAvkonSIDNoSound ); |
241 // globalNoteParam.SetTone( EAvkonSIDNoSound ); |
340 globalNoteParam.SetSoftkeys( R_AVKON_SOFTKEYS_EMPTY ); |
242 // globalNoteParam.SetSoftkeys( R_AVKON_SOFTKEYS_EMPTY ); |
341 globalNoteParam.SetTextResourceId( CPhoneMainResourceResolver::Instance()-> |
243 // globalNoteParam.SetTextResourceId( CPhoneMainResourceResolver::Instance()-> |
342 ResolveResourceID( EPhoneVoIPWaitingAcceptanceNote ) ); |
244 // ResolveResourceID( EPhoneVoIPWaitingAcceptanceNote ) ); |
343 iViewCommandHandle.ExecuteCommandL( |
245 // iViewCommandHandle.ExecuteCommandL( |
344 EPhoneViewShowGlobalNote, &globalNoteParam ); |
246 // EPhoneViewShowGlobalNote, &globalNoteParam ); |
345 } |
247 } |
346 |
|
347 // --------------------------------------------------------------------------- |
|
348 // CPhoneUnattendedTransferCmdHandler::LaunchCallBackQuery |
|
349 // --------------------------------------------------------------------------- |
|
350 // |
|
351 void CPhoneUnattendedTransferCmdHandler::LaunchCallBackQueryL() |
|
352 { |
|
353 __LOGMETHODSTARTEND( PhoneUIVoIPExtension, |
|
354 "CPhoneUnattendedTransferCmdHandler::LaunchCallBackQueryL() ") |
|
355 MPEEngineInfo* info = iStateMachine.PhoneEngineInfo(); |
|
356 const TDesC& callBackToAddr = info->CallBackAddress(); |
|
357 // We cannot do call back if original call had private address |
|
358 if ( callBackToAddr.Compare( KNullDesC ) == 0 ) |
|
359 { |
|
360 return; |
|
361 } |
|
362 |
|
363 TPhoneCmdParamQuery queryParam; |
|
364 queryParam.SetQueryType( EPhoneGlobalMsgQuery ); |
|
365 |
|
366 HBufC* msgHeader = |
|
367 StringLoader::LoadLC( CPhoneMainResourceResolver::Instance()-> |
|
368 ResolveResourceID( EPhoneVoIPTransferCallBackHeader ) ); |
|
369 queryParam.SetQueryPrompt( *msgHeader ); |
|
370 |
|
371 HBufC* queryText = |
|
372 StringLoader::LoadLC( CPhoneMainResourceResolver::Instance()-> |
|
373 ResolveResourceID( |
|
374 EPhoneVoIPTransferCallBackText ), callBackToAddr ); |
|
375 |
|
376 queryParam.SetDataText( &queryText->Des() ); |
|
377 |
|
378 queryParam.SetDefaultCba( R_AVKON_SOFTKEYS_OK_CANCEL ); |
|
379 |
|
380 // configure custom command mappings for user responses |
|
381 queryParam.SetCbaCommandMapping( |
|
382 EAknSoftkeyOk, EPhoneCmdUnattendedTransferCallBackOk ); |
|
383 queryParam.SetCbaCommandMapping( |
|
384 EAknSoftkeyCancel, EPhoneCmdUnattendedTransferCallBackCancel ); |
|
385 |
|
386 iViewCommandHandle.ExecuteCommandL( EPhoneViewShowQuery, &queryParam ); |
|
387 |
|
388 CleanupStack::PopAndDestroy( queryText ); |
|
389 CleanupStack::PopAndDestroy( msgHeader ); |
|
390 } |
|