128 // ----------------------------------------------------------------------------- |
128 // ----------------------------------------------------------------------------- |
129 // CPhoneMediatorCommandListener::Initialize |
129 // CPhoneMediatorCommandListener::Initialize |
130 // ----------------------------------------------------------------------------- |
130 // ----------------------------------------------------------------------------- |
131 // |
131 // |
132 void CPhoneMediatorCommandListener::Initialize( |
132 void CPhoneMediatorCommandListener::Initialize( |
133 MPhoneMenuAndCbaEvents* aMenuAndCbaEventHandler, |
133 MPhoneMenuAndCbaEvents* aMenuAndCbaEventHandler, |
134 MPhoneEngineMessageSender* aMessageSender, |
134 MPhoneEngineMessageSender* aMessageSender, |
135 MPEEngineInfo* aEngineInfo ) |
135 MPEEngineInfo* aEngineInfo ) |
136 { |
136 { |
137 __LOGMETHODSTARTEND(EPhoneMediatorCenter, "CPhoneMediatorCommandListener::Initialize( ) "); |
137 __LOGMETHODSTARTEND(EPhoneMediatorCenter, "CPhoneMediatorCommandListener::Initialize( ) "); |
138 iMenuAndCbaHandler = aMenuAndCbaEventHandler; |
138 iMenuAndCbaHandler = aMenuAndCbaEventHandler; |
139 iMessageSender = aMessageSender; |
139 iMessageSender = aMessageSender; |
140 iEngineInfo = aEngineInfo; |
140 iEngineInfo = aEngineInfo; |
141 } |
141 } |
142 |
142 |
143 // ----------------------------------------------------------------------------- |
143 // ----------------------------------------------------------------------------- |
144 // CPhoneMediatorCommandListener::RegisterMediatorCommandsL |
144 // CPhoneMediatorCommandListener::RegisterMediatorCommandsL |
145 // ----------------------------------------------------------------------------- |
145 // ----------------------------------------------------------------------------- |
146 // |
146 // |
147 void CPhoneMediatorCommandListener::RegisterMediatorCommandsL() |
147 void CPhoneMediatorCommandListener::RegisterMediatorCommandsL() |
148 { |
148 { |
149 __LOGMETHODSTARTEND(EPhoneMediatorCenter, |
149 __LOGMETHODSTARTEND(EPhoneMediatorCenter, |
150 "CPhoneMediatorCommandListener::RegisterMediatorCommandsL( ) "); |
150 "CPhoneMediatorCommandListener::RegisterMediatorCommandsL( ) "); |
151 iCommandResponder = CMediatorCommandResponder::NewL( this ); |
151 iCommandResponder = CMediatorCommandResponder::NewL( this ); |
152 |
152 |
153 RegisterVideoTelephonyMediatorCommands(); |
153 RegisterVideoTelephonyMediatorCommands(); |
154 RegisterAudioMediatorCommands(); |
154 RegisterAudioMediatorCommands(); |
155 RegisterGenericMediatorCommands(); |
155 RegisterGenericMediatorCommands(); |
156 } |
156 } |
157 |
157 |
158 // ----------------------------------------------------------------------------- |
158 // ----------------------------------------------------------------------------- |
159 // CPhoneMediatorCommandListener::RegisterVideoTelephonyMediatorCommands |
159 // CPhoneMediatorCommandListener::RegisterVideoTelephonyMediatorCommands |
160 // ----------------------------------------------------------------------------- |
160 // ----------------------------------------------------------------------------- |
161 // |
161 // |
162 void CPhoneMediatorCommandListener::RegisterVideoTelephonyMediatorCommands() |
162 void CPhoneMediatorCommandListener::RegisterVideoTelephonyMediatorCommands() |
163 { |
163 { |
164 __LOGMETHODSTARTEND(EPhoneMediatorCenter, |
164 __LOGMETHODSTARTEND(EPhoneMediatorCenter, |
165 "CPhoneMediatorCommandListener::RegisterVideoTelephonyMediatorCommands( ) "); |
165 "CPhoneMediatorCommandListener::RegisterVideoTelephonyMediatorCommands( ) "); |
166 TCapabilitySet caps; |
166 TCapabilitySet caps; |
167 caps.SetEmpty(); |
167 caps.SetEmpty(); |
168 |
168 |
169 // Video Telephony Commands |
169 // Video Telephony Commands |
170 MediatorService::TCommand newCommand; |
170 MediatorService::TCommand newCommand; |
171 newCommand.iCommandId = EVtCmdFallback; |
171 newCommand.iCommandId = EVtCmdFallback; |
172 newCommand.iVersion = TVersion( KVideoTelToPhoneCmdVersionMajor, |
172 newCommand.iVersion = TVersion( KVideoTelToPhoneCmdVersionMajor, |
173 KVideoTelToPhoneCmdVersionMinor, KVideoTelToPhoneCmdVersionBuild ); |
173 KVideoTelToPhoneCmdVersionMinor, KVideoTelToPhoneCmdVersionBuild ); |
174 caps.Set( ECapabilityNetworkControl ); |
174 caps.Set( ECapabilityNetworkControl ); |
175 newCommand.iCaps = caps; |
175 newCommand.iCaps = caps; |
176 newCommand.iTimeout = KPhoneUiMediatorIfTimeout; |
176 newCommand.iTimeout = KPhoneUiMediatorIfTimeout; |
177 iVideoTelCommands.Append( newCommand ); |
177 iVideoTelCommands.Append( newCommand ); |
178 |
178 |
215 |
215 |
216 // Register Audio Commands |
216 // Register Audio Commands |
217 TInt error = iCommandResponder->RegisterCommand( KMediatorTelephonyDomain, |
217 TInt error = iCommandResponder->RegisterCommand( KMediatorTelephonyDomain, |
218 KCatAudioCommandsToTelephony, |
218 KCatAudioCommandsToTelephony, |
219 iAudioCommands ); |
219 iAudioCommands ); |
220 __ASSERT_DEBUG( error == KErrNone, Panic( EPhoneMediatorCenterRegistrationFailed ) ); |
220 __ASSERT_DEBUG( error == KErrNone, Panic( EPhoneMediatorCenterRegistrationFailed ) ); |
221 } |
221 } |
222 |
222 |
223 // ----------------------------------------------------------------------------- |
223 // ----------------------------------------------------------------------------- |
224 // CPhoneMediatorCommandListener::RegisterGenericMediatorCommands |
224 // CPhoneMediatorCommandListener::RegisterGenericMediatorCommands |
225 // ----------------------------------------------------------------------------- |
225 // ----------------------------------------------------------------------------- |
226 // |
226 // |
227 void CPhoneMediatorCommandListener::RegisterGenericMediatorCommands() |
227 void CPhoneMediatorCommandListener::RegisterGenericMediatorCommands() |
228 { |
228 { |
229 __LOGMETHODSTARTEND(EPhoneMediatorCenter, |
229 __LOGMETHODSTARTEND(EPhoneMediatorCenter, |
230 "CPhoneMediatorCommandListener::RegisterGenericMediatorCommands( ) "); |
230 "CPhoneMediatorCommandListener::RegisterGenericMediatorCommands( ) "); |
231 TCapabilitySet caps; |
231 TCapabilitySet caps; |
232 caps.SetEmpty(); |
232 caps.SetEmpty(); |
233 |
233 |
234 // Generic Commands |
234 // Generic Commands |
235 MediatorService::TCommand newCommand; |
235 MediatorService::TCommand newCommand; |
236 newCommand.iCommandId = EPhoneCmdEndActiveCall; |
236 newCommand.iCommandId = EPhoneCmdEndActiveCall; |
237 newCommand.iVersion = TVersion( KTelephonyCommandsVersionMajor, |
237 newCommand.iVersion = TVersion( KTelephonyCommandsVersionMajor, |
238 KTelephonyCommandsVersionMinor, KTelephonyCommandsVersionBuild ); |
238 KTelephonyCommandsVersionMinor, KTelephonyCommandsVersionBuild ); |
239 caps.Set( ECapabilityNetworkControl ); |
239 caps.Set( ECapabilityNetworkControl ); |
240 newCommand.iCaps = caps; |
240 newCommand.iCaps = caps; |
241 newCommand.iTimeout = KPhoneUiMediatorIfTimeout; |
241 newCommand.iTimeout = KPhoneUiMediatorIfTimeout; |
242 iGenericCommands.Append( newCommand ); |
242 iGenericCommands.Append( newCommand ); |
243 |
243 |
244 // Register Generic Commands |
244 // Register Generic Commands |
245 TInt error = iCommandResponder->RegisterCommand( KMediatorTelephonyDomain, |
245 TInt error = iCommandResponder->RegisterCommand( KMediatorTelephonyDomain, |
246 KCatCommandsToTelephony, |
246 KCatCommandsToTelephony, |
247 iGenericCommands ); |
247 iGenericCommands ); |
248 __ASSERT_DEBUG( error == KErrNone, Panic( EPhoneMediatorCenterRegistrationFailed ) ); |
248 __ASSERT_DEBUG( error == KErrNone, Panic( EPhoneMediatorCenterRegistrationFailed ) ); |
249 } |
249 } |
250 |
250 |
251 // ----------------------------------------------------------------------------- |
251 // ----------------------------------------------------------------------------- |
252 // CPhoneMediatorCommandListener::MediatorCommandL |
252 // CPhoneMediatorCommandListener::MediatorCommandL |
253 // ----------------------------------------------------------------------------- |
253 // ----------------------------------------------------------------------------- |
254 // |
254 // |
255 void CPhoneMediatorCommandListener::MediatorCommandL( |
255 void CPhoneMediatorCommandListener::MediatorCommandL( |
256 TUid aDomain, |
256 TUid aDomain, |
257 TUid aCategory, |
257 TUid aCategory, |
258 TInt aCommandId, |
258 TInt aCommandId, |
259 TVersion aVersion, |
259 TVersion aVersion, |
260 const TDesC8& /*aData*/ ) |
260 const TDesC8& /*aData*/ ) |
261 { |
261 { |
262 __LOGMETHODSTARTEND(EPhoneMediatorCenter, "CPhoneMediatorCommandListener::MediatorCommandL( ) "); |
262 __LOGMETHODSTARTEND(EPhoneMediatorCenter, "CPhoneMediatorCommandListener::MediatorCommandL( ) "); |
263 if( aDomain == KMediatorTelephonyDomain && |
263 if( aDomain == KMediatorTelephonyDomain && |
264 aCategory == KCatVideoTelToPhoneCommands ) |
264 aCategory == KCatVideoTelToPhoneCommands ) |
265 { |
265 { |
266 VideoTelephonyCommandL( aCommandId, aVersion ); |
266 VideoTelephonyCommandL( aCommandId, aVersion ); |
267 SendResponse( aDomain, aCategory, aCommandId ); |
267 SendResponse( aDomain, aCategory, aCommandId ); |
268 return; |
268 return; |
269 } |
269 } |
270 else if( aDomain == KMediatorTelephonyDomain && |
270 else if( aDomain == KMediatorTelephonyDomain && |
271 aCategory == KCatAudioCommandsToTelephony ) |
271 aCategory == KCatAudioCommandsToTelephony ) |
272 { |
272 { |
273 AudioCommandL( aCommandId, aVersion ); |
273 AudioCommandL( aCommandId, aVersion ); |
274 SendResponse( aDomain, aCategory, aCommandId ); |
274 SendResponse( aDomain, aCategory, aCommandId ); |
275 return; |
275 return; |
276 } |
276 } |
277 else if( aDomain == KMediatorTelephonyDomain && |
277 else if( aDomain == KMediatorTelephonyDomain && |
278 aCategory == KCatCommandsToTelephony ) |
278 aCategory == KCatCommandsToTelephony ) |
279 { |
279 { |
280 GenericCommandL( aCommandId, aVersion ); |
280 GenericCommandL( aCommandId, aVersion ); |
281 SendResponse( aDomain, aCategory, aCommandId ); |
281 SendResponse( aDomain, aCategory, aCommandId ); |
282 return; |
282 return; |
283 } |
283 } |
284 |
284 |
285 TInt error = iCommandResponder->IssueResponse( aDomain, |
285 TInt error = iCommandResponder->IssueResponse( aDomain, |
286 aCategory, |
286 aCategory, |
287 aCommandId, |
287 aCommandId, |
288 KErrNotFound, |
288 KErrNotFound, |
289 KNullDesC8 ); |
289 KNullDesC8 ); |
290 } |
290 } |
291 |
291 |
292 // ----------------------------------------------------------------------------- |
292 // ----------------------------------------------------------------------------- |
293 // CPhoneMediatorCommandListener::CancelMediatorCommand |
293 // CPhoneMediatorCommandListener::CancelMediatorCommand |
294 // ----------------------------------------------------------------------------- |
294 // ----------------------------------------------------------------------------- |
295 // |
295 // |
296 void CPhoneMediatorCommandListener::CancelMediatorCommand( |
296 void CPhoneMediatorCommandListener::CancelMediatorCommand( |
297 TUid /*aDomain*/, |
297 TUid /*aDomain*/, |
298 TUid /*aCategory*/, |
298 TUid /*aCategory*/, |
299 TInt /*aCommandId*/ ) |
299 TInt /*aCommandId*/ ) |
300 { |
300 { |
301 __LOGMETHODSTARTEND(EPhoneMediatorCenter, |
301 __LOGMETHODSTARTEND(EPhoneMediatorCenter, |
302 "CPhoneMediatorCommandListener::CancelMediatorCommand( ) "); |
302 "CPhoneMediatorCommandListener::CancelMediatorCommand( ) "); |
303 } |
303 } |
304 |
304 |
305 // ----------------------------------------------------------------------------- |
305 // ----------------------------------------------------------------------------- |
306 // CPhoneMediatorCommandListener::SendResponse |
306 // CPhoneMediatorCommandListener::SendResponse |
307 // ----------------------------------------------------------------------------- |
307 // ----------------------------------------------------------------------------- |
308 // |
308 // |
309 void CPhoneMediatorCommandListener::SendResponse( |
309 void CPhoneMediatorCommandListener::SendResponse( |
310 TUid aDomain, |
310 TUid aDomain, |
311 TUid aCategory, |
311 TUid aCategory, |
312 TInt aCommandId ) |
312 TInt aCommandId ) |
313 { |
313 { |
314 __LOGMETHODSTARTEND(EPhoneMediatorCenter, |
314 __LOGMETHODSTARTEND(EPhoneMediatorCenter, |
315 "CPhoneMediatorCommandListener::SendResponse( ) "); |
315 "CPhoneMediatorCommandListener::SendResponse( ) "); |
316 iCommandResponder->IssueResponse( aDomain, |
316 iCommandResponder->IssueResponse( aDomain, |
317 aCategory, |
317 aCategory, |
318 aCommandId, |
318 aCommandId, |
319 KErrNone, |
319 KErrNone, |
320 KNullDesC8 ); |
320 KNullDesC8 ); |
321 } |
321 } |
322 |
322 |
323 // ----------------------------------------------------------------------------- |
323 // ----------------------------------------------------------------------------- |
324 // CPhoneMediatorCommandListener::VideoTelephonyCommandL |
324 // CPhoneMediatorCommandListener::VideoTelephonyCommandL |
325 // ----------------------------------------------------------------------------- |
325 // ----------------------------------------------------------------------------- |
326 // |
326 // |
327 void CPhoneMediatorCommandListener::VideoTelephonyCommandL( TInt aCommandId, TVersion /*aVersion*/ ) |
327 void CPhoneMediatorCommandListener::VideoTelephonyCommandL( TInt aCommandId, TVersion /*aVersion*/ ) |
328 { |
328 { |
329 __LOGMETHODSTARTEND(EPhoneMediatorCenter, |
329 __LOGMETHODSTARTEND(EPhoneMediatorCenter, |
330 "CPhoneMediatorCommandListener::VideoTelephonyCommandL( ) "); |
330 "CPhoneMediatorCommandListener::VideoTelephonyCommandL( ) "); |
331 |
331 |
332 __ASSERT_DEBUG( iMenuAndCbaHandler, Panic( EPhoneMediatorCenterSingletonNotInitialized ) ); |
332 __ASSERT_DEBUG( iMenuAndCbaHandler, Panic( EPhoneMediatorCenterSingletonNotInitialized ) ); |
333 __ASSERT_DEBUG( iMessageSender, Panic( EPhoneMediatorCenterSingletonNotInitialized ) ); |
333 __ASSERT_DEBUG( iMessageSender, Panic( EPhoneMediatorCenterSingletonNotInitialized ) ); |
334 |
334 |
335 switch( aCommandId ) |
335 switch( aCommandId ) |
336 { |
336 { |
337 case EVtCmdFallback: |
337 case EVtCmdFallback: |
338 iMenuAndCbaHandler->HandleCommandL( EPhoneInCallCmdEndThisActiveCall ); |
338 iMenuAndCbaHandler->HandleCommandL( EPhoneInCallCmdEndThisActiveCall ); |
339 CPhoneReconnectQuery::InstanceL()->ShowReconnectQueryL( ETrue ); |
339 CPhoneReconnectQuery::InstanceL()->ShowReconnectQueryL( ETrue ); |
340 break; |
340 break; |
341 |
341 |
342 case EVtCmdSwitchToVoice: |
342 case EVtCmdSwitchToVoice: |
343 iMenuAndCbaHandler->HandleCommandL( EPhoneCmdYesSwitchToVoice ); |
343 iMenuAndCbaHandler->HandleCommandL( EPhoneCmdYesSwitchToVoice ); |
344 break; |
344 break; |
345 |
345 |
346 case EVtCmdLowMemory: |
346 case EVtCmdLowMemory: |
347 iMenuAndCbaHandler->HandleCommandL( EPhoneCmdVideoCallOutOfMemory ); |
347 iMenuAndCbaHandler->HandleCommandL( EPhoneCmdVideoCallOutOfMemory ); |
348 break; |
348 break; |
349 |
349 |
350 default: |
350 default: |
351 __ASSERT_DEBUG( false, Panic( EPhoneMediatorCenterInvalidCommand ) ); |
351 __ASSERT_DEBUG( false, Panic( EPhoneMediatorCenterInvalidCommand ) ); |
352 break; |
352 break; |
353 } |
353 } |
354 } |
354 } |
355 |
355 |
356 // ----------------------------------------------------------------------------- |
356 // ----------------------------------------------------------------------------- |
357 // CPhoneMediatorCommandListener::AudioCommandL |
357 // CPhoneMediatorCommandListener::AudioCommandL |
358 // ----------------------------------------------------------------------------- |
358 // ----------------------------------------------------------------------------- |
359 // |
359 // |
360 void CPhoneMediatorCommandListener::AudioCommandL( TInt aCommandId, TVersion /*aVersion*/ ) |
360 void CPhoneMediatorCommandListener::AudioCommandL( TInt aCommandId, TVersion /*aVersion*/ ) |
361 { |
361 { |
362 __LOGMETHODSTARTEND(EPhoneMediatorCenter, |
362 __LOGMETHODSTARTEND(EPhoneMediatorCenter, |
363 "CPhoneMediatorCommandListener::AudioCommandL( ) "); |
363 "CPhoneMediatorCommandListener::AudioCommandL( ) "); |
364 |
364 |
365 __ASSERT_DEBUG( iMessageSender, Panic( EPhoneMediatorCenterSingletonNotInitialized ) ); |
365 __ASSERT_DEBUG( iMessageSender, Panic( EPhoneMediatorCenterSingletonNotInitialized ) ); |
366 __ASSERT_DEBUG( iEngineInfo, Panic( EPhoneMediatorCenterSingletonNotInitialized ) ); |
366 __ASSERT_DEBUG( iEngineInfo, Panic( EPhoneMediatorCenterSingletonNotInitialized ) ); |
367 |
367 |
368 switch( aCommandId ) |
368 switch( aCommandId ) |
369 { |
369 { |
370 case EAudioCmdUnmute: |
370 case EAudioCmdUnmute: |
371 iEngineInfo->SetAudioMuteCommand( false ); |
371 iEngineInfo->SetAudioMuteCommand( false ); |
372 iMessageSender->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageSetAudioMute ); |
372 iMessageSender->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageSetAudioMute ); |
373 break; |
373 break; |
374 |
374 |
375 case EAudioCmdMute: |
375 case EAudioCmdMute: |
376 iEngineInfo->SetAudioMuteCommand( true ); |
376 iEngineInfo->SetAudioMuteCommand( true ); |
377 iMessageSender->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageSetAudioMute ); |
377 iMessageSender->SendPhoneEngineMessage( MPEPhoneModel::EPEMessageSetAudioMute ); |
378 break; |
378 break; |
379 |
379 |
380 default: |
380 default: |
381 __ASSERT_DEBUG( false, Panic( EPhoneMediatorCenterInvalidCommand ) ); |
381 __ASSERT_DEBUG( false, Panic( EPhoneMediatorCenterInvalidCommand ) ); |
382 break; |
382 break; |
383 } |
383 } |
384 } |
384 } |
385 |
385 |
386 // ----------------------------------------------------------------------------- |
386 // ----------------------------------------------------------------------------- |
387 // CPhoneMediatorCommandListener::GenericCommandL |
387 // CPhoneMediatorCommandListener::GenericCommandL |
388 // ----------------------------------------------------------------------------- |
388 // ----------------------------------------------------------------------------- |
389 // |
389 // |
390 void CPhoneMediatorCommandListener::GenericCommandL( TInt aCommandId, TVersion /*aVersion*/ ) |
390 void CPhoneMediatorCommandListener::GenericCommandL( TInt aCommandId, TVersion /*aVersion*/ ) |
391 { |
391 { |
392 __LOGMETHODSTARTEND(EPhoneMediatorCenter, |
392 __LOGMETHODSTARTEND(EPhoneMediatorCenter, |
393 "CPhoneMediatorCommandListener::GenericCommandL( ) "); |
393 "CPhoneMediatorCommandListener::GenericCommandL( ) "); |
394 __ASSERT_DEBUG( iMenuAndCbaHandler, Panic( EPhoneMediatorCenterSingletonNotInitialized ) ); |
394 __ASSERT_DEBUG( iMenuAndCbaHandler, Panic( EPhoneMediatorCenterSingletonNotInitialized ) ); |
395 |
395 |
396 switch( aCommandId ) |
396 switch( aCommandId ) |
397 { |
397 { |
398 case EPhoneCmdEndActiveCall: |
398 case EPhoneCmdEndActiveCall: |
399 iMenuAndCbaHandler->HandleCommandL( EPhoneInCallCmdEndThisActiveCall ); |
399 iMenuAndCbaHandler->HandleCommandL( EPhoneInCallCmdEndThisActiveCall ); |
400 break; |
400 break; |
401 |
401 |
402 default: |
402 default: |
403 __ASSERT_DEBUG( false, Panic( EPhoneMediatorCenterInvalidCommand ) ); |
403 __ASSERT_DEBUG( false, Panic( EPhoneMediatorCenterInvalidCommand ) ); |
404 break; |
404 break; |
405 } |
405 } |
406 } |
406 } |
407 |
407 |
408 // End of File |
408 // End of File |