phonebookui/Phonebook2/NamesListExtension/src/NamesListUiExtensionPlugin.cpp
branchRCL_3
changeset 45 34879f5cfc63
parent 35 4ae315f230bc
child 58 d4f567ce2e7c
equal deleted inserted replaced
39:a6539d1e8e43 45:34879f5cfc63
    39 #include <MPbk2ApplicationServices.h>
    39 #include <MPbk2ApplicationServices.h>
    40 #include <MPbk2ApplicationServices2.h>
    40 #include <MPbk2ApplicationServices2.h>
    41 #include <CPbk2StoreConfiguration.h>
    41 #include <CPbk2StoreConfiguration.h>
    42 #include <TVPbkContactStoreUriPtr.h>
    42 #include <TVPbkContactStoreUriPtr.h>
    43 #include <CPbk2ApplicationServices.h>
    43 #include <CPbk2ApplicationServices.h>
       
    44 #include <Phonebook2PrivateCRKeys.h>
    44 
    45 
    45 #include <MPbk2ContactUiControl.h>
    46 #include <MPbk2ContactUiControl.h>
    46 #include <MPbk2ViewExplorer.h>
    47 #include <MPbk2ViewExplorer.h>
    47 #include <CPbk2ViewState.h>
    48 #include <CPbk2ViewState.h>
    48 
    49 
    77 #include <coemain.h>
    78 #include <coemain.h>
    78 #include <eikmenub.h>
    79 #include <eikmenub.h>
    79 #include <AiwCommon.hrh>
    80 #include <AiwCommon.hrh>
    80 #include <avkon.hrh>
    81 #include <avkon.hrh>
    81 #include <avkon.rsg>
    82 #include <avkon.rsg>
       
    83 #include <centralrepository.h>
    82 
    84 
    83 /// Unnamed namespace for local definitions
    85 /// Unnamed namespace for local definitions
    84 namespace {
    86 namespace {
    85 const TInt KMinNumOfContactsToMerge = 2; // minimum number of contacts to merge
    87 const TInt KMinNumOfContactsToMerge = 2; // minimum number of contacts to merge
    86 } /// namespace
    88 } /// namespace
   153             KMPbk2ApplicationServicesExtension2Uid );
   155             KMPbk2ApplicationServicesExtension2Uid );
   154         if( !ext )
   156         if( !ext )
   155             {
   157             {
   156             User::Leave( KErrNotReady );
   158             User::Leave( KErrNotReady );
   157             }
   159             }
       
   160         // Check status message variation
       
   161         TInt showStatusInNamesList = 0;
       
   162         CRepository* cenrep =
       
   163             CRepository::NewLC( TUid::Uid( KCRUidPhonebook ) );
       
   164         User::LeaveIfError(
       
   165             cenrep->Get( KPhonebookStatusMessageVisibility, 
       
   166                     showStatusInNamesList ) );
       
   167         CleanupStack::PopAndDestroy( cenrep );
       
   168         
       
   169         // By default status is not shown in names list
       
   170         TInt32 spbContentFlags = CSpbContentProvider::EPhoneNumber;
       
   171         
       
   172         if( showStatusInNamesList )
       
   173             {
       
   174             spbContentFlags = (CSpbContentProvider::EStatusMessage | 
       
   175                     CSpbContentProvider::EPhoneNumber);
       
   176             }
       
   177         
   158         CPbk2StoreManager& storeManager = 
   178         CPbk2StoreManager& storeManager = 
   159             static_cast<MPbk2ApplicationServices2*>(ext)->StoreManager();
   179             static_cast<MPbk2ApplicationServices2*>(ext)->StoreManager();
   160         iContentProvider = CSpbContentProvider::NewL( iAppServices->ContactManager(), storeManager,  
   180         iContentProvider = CSpbContentProvider::NewL( 
   161             CSpbContentProvider::EStatusMessage | CSpbContentProvider::EPhoneNumber );
   181                 iAppServices->ContactManager(), storeManager, spbContentFlags );
   162         }
   182         }
   163 	return *iContentProvider;
   183 	return *iContentProvider;
   164 	}
   184 	}
   165 
   185 
   166 
   186