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