phonebookui/Phonebook2/UIControls/src/CPbk2FieldListBoxModel.cpp
branchRCL_3
changeset 85 38bb213f60ba
parent 74 6b5524b4f673
equal deleted inserted replaced
74:6b5524b4f673 85:38bb213f60ba
    32 #include <CPbk2PresentationContactField.h>
    32 #include <CPbk2PresentationContactField.h>
    33 #include <CPbk2PresentationContactFieldCollection.h>
    33 #include <CPbk2PresentationContactFieldCollection.h>
    34 #include <MPbk2FieldPropertyArray.h>
    34 #include <MPbk2FieldPropertyArray.h>
    35 #include <MPbk2FieldProperty.h>
    35 #include <MPbk2FieldProperty.h>
    36 #include <TPbk2StoreContactAnalyzer.h>
    36 #include <TPbk2StoreContactAnalyzer.h>
    37 #include <pbk2uicontrols.rsg>
    37 #include <Pbk2UIControls.rsg>
    38 #include "Pbk2AddressTools.h"
    38 #include "Pbk2AddressTools.h"
    39 #include <featmgr.h>
    39 
    40 // Virtual Phonebook
    40 // Virtual Phonebook
    41 #include <MVPbkFieldType.h>
    41 #include <MVPbkFieldType.h>
    42 #include <TVPbkFieldVersitProperty.h>
    42 #include <TVPbkFieldVersitProperty.h>
    43 #include <MVPbkContactFieldData.h>
    43 #include <MVPbkContactFieldData.h>
    44 #include <MVPbkContactStore.h>
    44 #include <MVPbkContactStore.h>
    45 #include <CVPbkContactManager.h>
    45 #include <CVPbkContactManager.h>
    46 #include <MVPbkContactFieldData.h>
    46 #include <MVPbkContactFieldData.h>
    47 #include <VPbkUtils.h>
    47 #include <VPbkUtils.h>
    48 #include <vpbkeng.rsg>
    48 #include <VPbkEng.rsg>
    49 #include <MVPbkStoreContact.h>
    49 #include <MVPbkStoreContact.h>
    50 
    50 
    51 #include <Pbk2Config.hrh> // For unSync
       
    52 /// Unnamed namespace for local definitions
    51 /// Unnamed namespace for local definitions
    53 namespace {
    52 namespace {
    54 
    53 
    55 _LIT( KCharsToReplace, "\t" );
    54 _LIT( KCharsToReplace, "\t" );
    56 _LIT( KReplacementChars, " " );
    55 _LIT( KReplacementChars, " " );
   696           CPbk2FieldListBoxRow& aRow, TParams& aParams )
   695           CPbk2FieldListBoxRow& aRow, TParams& aParams )
   697     {
   696     {
   698     // Format icon index
   697     // Format icon index
   699     TBuf<KMaxFormattedTIntLength> iconText; 
   698     TBuf<KMaxFormattedTIntLength> iconText; 
   700     TInt iconIndex = KErrNotFound;
   699     TInt iconIndex = KErrNotFound;
   701     TInt iconId = 0;
   700     
   702     // UnSync feature indicator flag and chinese flag
   701     if ( IsGeoFieldForAddressL( aField ) )
   703     TBool supportUnSyncFeature = FeatureManager::FeatureSupported(
   702         {
   704     		KFeatureIdFfTdUnSyncabPbfieldsInd);
   703         iconIndex = aParams.iIconArray.FindIcon(
   705     TBool supportChinese = FeatureManager::FeatureSupported(KFeatureIdChinese);
   704             TPbk2AppIconId( EPbk2qgn_prop_locev_map ) );
   706     // Valid address
       
   707     TBool addressValidated = IsGeoFieldForAddressL( aField );
       
   708     if( supportChinese && supportUnSyncFeature)
       
   709         {
       
   710         // UnSync Icon
       
   711         iconId = EPbk2qgn_prop_phonebook2_unsync;
       
   712         }
   705         }
   713     else
   706     else
   714         {
   707     	{
   715         iconId = addressValidated ?
   708         iconIndex = aParams.iIconArray.FindIcon(
   716             EPbk2qgn_prop_locev_map : EPbk2qgn_prop_pb_no_valid_lm;
   709     	    TPbk2AppIconId( EPbk2qgn_prop_pb_no_valid_lm ) );
   717         }
   710     	}
   718     TPbk2IconId pbkIconId(TUid::Uid(KPbk2UID3), iconId);
   711 
   719     iconIndex = aParams.iIconArray.FindIcon(pbkIconId); 
       
   720     iconText.Num( iconIndex );
   712     iconText.Num( iconIndex );
   721     aRow.AppendColumnL( iconText );
   713     aRow.AppendColumnL( iconText );
   722     }
   714     }
   723 
   715 
   724 // --------------------------------------------------------------------------
   716 // --------------------------------------------------------------------------