equal
deleted
inserted
replaced
29 #include "cauilogger.h" // Call Ui Logger |
29 #include "cauilogger.h" // Call Ui Logger |
30 #include <StringLoader.h> |
30 #include <StringLoader.h> |
31 #include <CallUI.rsg> |
31 #include <CallUI.rsg> |
32 #include <featmgr.h> // FeatureManager. |
32 #include <featmgr.h> // FeatureManager. |
33 |
33 |
|
34 #include <eikon.hrh> //EEikMenuItemSpecific |
|
35 |
|
36 |
34 // CONSTANTS |
37 // CONSTANTS |
35 |
38 |
36 // Empty filename for initialization. |
39 // Empty filename for initialization. |
37 _LIT( KCaUiNullResFile, "" ); |
40 _LIT( KCaUiNullResFile, "" ); |
38 |
41 |
212 // By default we want all internet, voice and video call resources |
215 // By default we want all internet, voice and video call resources |
213 TBool csVoiceMenuItemAvailable( ETrue ); |
216 TBool csVoiceMenuItemAvailable( ETrue ); |
214 TBool csVideoMenuItemAvailable( ETrue ); |
217 TBool csVideoMenuItemAvailable( ETrue ); |
215 TBool voipMenuItemAvailable( ETrue ); |
218 TBool voipMenuItemAvailable( ETrue ); |
216 |
219 |
|
220 TBool hideCallSubmenu( EFalse ); |
|
221 |
217 // If there is PhoneNumber parameter given, then only voice call |
222 // If there is PhoneNumber parameter given, then only voice call |
218 // resource is wanted. |
223 // resource is wanted. |
219 TInt count = aInParamList.Count(); |
224 TInt count = aInParamList.Count(); |
220 if ( count ) |
225 if ( count ) |
221 { |
226 { |
244 // Internet number parameter was found, |
249 // Internet number parameter was found, |
245 csVoiceMenuItemAvailable = EFalse; |
250 csVoiceMenuItemAvailable = EFalse; |
246 csVideoMenuItemAvailable = EFalse; |
251 csVideoMenuItemAvailable = EFalse; |
247 } |
252 } |
248 } |
253 } |
249 } |
254 |
|
255 index = 0; |
|
256 aInParamList.FindFirst( |
|
257 index, |
|
258 EGenericParamHideCallSubmenu, |
|
259 EVariantTypeAny ); |
|
260 |
|
261 if ( index >= 0 ) |
|
262 { |
|
263 // The call items (voice, video and VoIP) are located in the main level |
|
264 // of the menu |
|
265 hideCallSubmenu = ETrue; |
|
266 |
|
267 TInt32 variantValue = aInParamList[ index ].Value().AsTInt32(); |
|
268 |
|
269 if ( variantValue == EGenericParamVoiceCall ) |
|
270 { |
|
271 csVoiceMenuItemAvailable = EFalse; |
|
272 } |
|
273 else if ( variantValue == EGenericParamVideoCall ) |
|
274 { |
|
275 csVideoMenuItemAvailable = EFalse; |
|
276 } |
|
277 else if ( variantValue == EGenericParamVoIPCall ) |
|
278 { |
|
279 voipMenuItemAvailable = EFalse; |
|
280 } |
|
281 } |
|
282 } |
250 |
283 |
251 if ( csVideoMenuItemAvailable && |
284 if ( csVideoMenuItemAvailable && |
252 !FeatureManager::FeatureSupported( KFeatureIdCsVideoTelephony ) ) |
285 !FeatureManager::FeatureSupported( KFeatureIdCsVideoTelephony ) ) |
253 { |
286 { |
254 csVideoMenuItemAvailable = EFalse; |
287 csVideoMenuItemAvailable = EFalse; |
258 |
291 |
259 TInt menuIndex = aIndex; |
292 TInt menuIndex = aIndex; |
260 |
293 |
261 if ( csVoiceMenuItemAvailable ) |
294 if ( csVoiceMenuItemAvailable ) |
262 { |
295 { |
263 AddAiwMenuItemL( aMenuPane, menuIndex, ECSVoice ); |
296 AddAiwMenuItemL( aMenuPane, menuIndex, ECSVoice, 0, hideCallSubmenu ); |
264 menuIndex++; |
297 menuIndex++; |
265 } |
298 } |
266 |
299 |
267 if ( csVideoMenuItemAvailable ) |
300 if ( csVideoMenuItemAvailable ) |
268 { |
301 { |
269 AddAiwMenuItemL( aMenuPane, menuIndex, ECSVideo ); |
302 AddAiwMenuItemL( aMenuPane, menuIndex, ECSVideo, 0, hideCallSubmenu ); |
270 menuIndex++; |
303 menuIndex++; |
271 } |
304 } |
272 |
305 |
273 if ( voipMenuItemAvailable ) |
306 if ( voipMenuItemAvailable ) |
274 { |
307 { |
278 TInt numberOfVoipServices = voipServiceIds.Count(); |
311 TInt numberOfVoipServices = voipServiceIds.Count(); |
279 |
312 |
280 if ( 1 == numberOfVoipServices ) |
313 if ( 1 == numberOfVoipServices ) |
281 { |
314 { |
282 // Single VoIP service, use service name in menu item |
315 // Single VoIP service, use service name in menu item |
283 AddAiwMenuItemL( aMenuPane, menuIndex, EInternetWithName, voipServiceIds[0] ); |
316 AddAiwMenuItemL( aMenuPane, menuIndex, EInternetWithName, voipServiceIds[0], hideCallSubmenu ); |
284 menuIndex++; |
317 menuIndex++; |
285 } |
318 } |
286 else if ( numberOfVoipServices > 1 ) |
319 else if ( numberOfVoipServices > 1 ) |
287 { |
320 { |
288 // Regular internet call menu |
321 // Regular internet call menu |
289 AddAiwMenuItemL( aMenuPane, menuIndex, EInternet ); |
322 AddAiwMenuItemL( aMenuPane, menuIndex, EInternet, 0, hideCallSubmenu ); |
290 menuIndex++; |
323 menuIndex++; |
291 } |
324 } |
292 |
325 |
293 CleanupStack::PopAndDestroy( &voipServiceIds ); |
326 CleanupStack::PopAndDestroy( &voipServiceIds ); |
294 } |
327 } |
381 // CCaUiPlugin::AddAiwMenuItemL |
414 // CCaUiPlugin::AddAiwMenuItemL |
382 // |
415 // |
383 // |
416 // |
384 // ----------------------------------------------------------------------------- |
417 // ----------------------------------------------------------------------------- |
385 // |
418 // |
386 void CCaUiPlugin::AddAiwMenuItemL( CAiwMenuPane& aMenuPane, TInt aIndex, EMenuItemType aType, TServiceId aServiceId ) |
419 void CCaUiPlugin::AddAiwMenuItemL( |
|
420 CAiwMenuPane& aMenuPane, |
|
421 TInt aIndex, |
|
422 EMenuItemType aType, |
|
423 TServiceId aServiceId, |
|
424 TBool aHideCallSubmenu ) |
387 { |
425 { |
388 CEikMenuPaneItem::SData data; |
426 CEikMenuPaneItem::SData data; |
389 data.iCascadeId = 0; |
427 data.iCascadeId = 0; |
390 data.iFlags = 0; |
428 data.iFlags = 0; |
391 data.iExtraText = KNullDesC(); |
429 data.iExtraText = KNullDesC(); |
392 |
430 |
|
431 if ( aHideCallSubmenu ) |
|
432 { |
|
433 data.iFlags = EEikMenuItemSpecific; |
|
434 } |
|
435 |
393 HBufC* menuItemText = NULL; |
436 HBufC* menuItemText = NULL; |
394 |
437 |
395 switch ( aType ) |
438 switch ( aType ) |
396 { |
439 { |
397 case ECSVoice: |
440 case ECSVoice: |