phonebookui/Phonebook2/ccapplication/ccacommlauncherplugin/src/ccappcommlaunchermenuhandler.cpp
branchRCL_3
changeset 23 5586b4d2ec3e
parent 3 04ab22b956c2
child 35 4ae315f230bc
equal deleted inserted replaced
21:b3431bff8c19 23:5586b4d2ec3e
    18 #include "ccappcommlauncherheaders.h"
    18 #include "ccappcommlauncherheaders.h"
    19 
    19 
    20 #include <mccacontactobserver.h>
    20 #include <mccacontactobserver.h>
    21 #include <mccappengine.h>
    21 #include <mccappengine.h>
    22 
    22 
       
    23 #include <mnproviderfinder.h>
       
    24 #include <mnprovider.h>
       
    25 
    23 using namespace AiwContactAssign;
    26 using namespace AiwContactAssign;
    24 
    27 
    25 // ======== MEMBER FUNCTIONS ========
    28 // ======== MEMBER FUNCTIONS ========
    26 
    29 
    27 // ---------------------------------------------------------------------------
    30 // ---------------------------------------------------------------------------
   254 //
   257 //
   255 void CCCAppCommLauncherMenuHandler::DynInitSelectMenuItemL(
   258 void CCCAppCommLauncherMenuHandler::DynInitSelectMenuItemL(
   256     CEikMenuPane* aMenuPane )
   259     CEikMenuPane* aMenuPane )
   257     {
   260     {
   258     CCA_DP(KCommLauncherLogFile, CCA_L("->CCCAppCommLauncherMenuHandler::DynInitSelectMenuItemL()"));
   261     CCA_DP(KCommLauncherLogFile, CCA_L("->CCCAppCommLauncherMenuHandler::DynInitSelectMenuItemL()"));
   259 
   262     
       
   263     // Used for checking whether some maps have been installed or not.
       
   264     RPointerArray<CMnProvider> providers;
       
   265     CleanupClosePushL( providers );
       
   266     MnProviderFinder::FindProvidersL( providers, CMnProvider::EServiceMapView );
       
   267     
   260     if ( !iPlugin.Container().CommMethodsAvailable() )
   268     if ( !iPlugin.Container().CommMethodsAvailable() )
   261         {// no comm methods available
   269         {// no comm methods available
   262         aMenuPane->DeleteMenuItem( ECCAppCommLauncherSelectCmd );
   270         aMenuPane->DeleteMenuItem( ECCAppCommLauncherSelectCmd );
   263         // ECCAppCommLauncherDefaultsCmd is deleted in the SimContactDynInitMenuPaneL() method
   271         // ECCAppCommLauncherDefaultsCmd is deleted in the SimContactDynInitMenuPaneL() method
   264         if (iContactStore != ECmsContactStoreSim)
   272         if (iContactStore != ECmsContactStoreSim)
   265             {
   273             {
   266             aMenuPane->DeleteMenuItem( ECCAppCommLauncherDefaultsCmd );
   274             aMenuPane->DeleteMenuItem( ECCAppCommLauncherDefaultsCmd );
   267             }
   275             }
   268         }
   276         }
   269 
   277     // If the count equals to 0, it means:
       
   278     // No map is installed and there must be no adress item displayed in launcher view. 
       
   279     else if ( providers.Count() > 0 )
       
   280     	{
       
   281         CCCAppCommLauncherContactHandler& contactHandler = iPlugin.ContactHandler();
       
   282         
       
   283         // Get the number how many addresses are defined.
       
   284         TInt addressAmount = 
       
   285              contactHandler.AddressAmount( VPbkFieldTypeSelectorFactory::EFindOnMapSelector);
       
   286         
       
   287         // If the amount of address is not 0 and the amount of listbox in launcher view is 1.
       
   288         // That means only address is defined in the contact.
       
   289         if ( ( addressAmount > 0 ) 
       
   290         	   && ( iPlugin.Container().GetListBoxItemAmount() == 1 ) )
       
   291         	{
       
   292         	aMenuPane->DeleteMenuItem( ECCAppCommLauncherDefaultsCmd );
       
   293         	}
       
   294     	}
       
   295 
       
   296     providers.ResetAndDestroy();
       
   297     CleanupStack::PopAndDestroy( &providers );
       
   298     
   270     CCA_DP(KCommLauncherLogFile, CCA_L("<-CCCAppCommLauncherMenuHandler::DynInitSelectMenuItemL()"));
   299     CCA_DP(KCommLauncherLogFile, CCA_L("<-CCCAppCommLauncherMenuHandler::DynInitSelectMenuItemL()"));
   271     }
   300     }
   272 
   301 
   273 // ---------------------------------------------------------------------------
   302 // ---------------------------------------------------------------------------
   274 // CCCAppCommLauncherMenuHandler::DynInitSelectOtherMenuItemL
   303 // CCCAppCommLauncherMenuHandler::DynInitSelectOtherMenuItemL