pimprotocols/pbap/server/pbapvcardexporterutil.cpp
branchRCL_3
changeset 74 6b5524b4f673
parent 68 9da50d567e3c
child 85 38bb213f60ba
equal deleted inserted replaced
68:9da50d567e3c 74:6b5524b4f673
    67 	{
    67 	{
    68 	LOG_FUNC
    68 	LOG_FUNC
    69 	CVersitTlsData::VersitTlsDataL();		
    69 	CVersitTlsData::VersitTlsDataL();		
    70 	User::LeaveIfError(iTzClient.Connect());
    70 	User::LeaveIfError(iTzClient.Connect());
    71 	
    71 	
       
    72 	TRAPD(err, GetMatchDigitCountL())
       
    73 	if (err != KErrNone)
       
    74 		{
       
    75 		iMatchDigitCount = KDefaultGsmNumberMatchLength;
       
    76 		}
       
    77 
       
    78 	}
       
    79 
       
    80 CPbapVCardExporterUtil::~CPbapVCardExporterUtil()
       
    81 	{
       
    82 	LOG_FUNC
       
    83 	iTzClient.Close();
       
    84 	CVersitTlsData::CloseVersitTlsData();
       
    85 	}
       
    86 
       
    87 void CPbapVCardExporterUtil::GetMatchDigitCountL()
       
    88 	{
    72 	// Read the amount of digits to be used in contact matching
    89 	// Read the amount of digits to be used in contact matching
    73 	// The key is properly owned by PhoneApp, however we cannot include
    90 	// The key is properly owned by PhoneApp, however we cannot include
    74 	// that header file from here, so a temporary fix has been done to 
    91 	// that header file from here, so a temporary fix has been done to 
    75 	// use locally defined versions.  If there is a problem here it is 
    92 	// use locally defined versions.  If there is a problem here it is 
    76 	// likely because these values have gone out of sync.
    93 	// likely because these values have gone out of sync.
    77 	CRepository* repository = CRepository::NewLC(KCRUidTelConfiguration);
    94 	CRepository* repository = CRepository::NewLC(KCRUidTelConfiguration);
    78     if ( repository->Get(KTelMatchDigits, iMatchDigitCount) == KErrNone )
    95 	User::LeaveIfError(repository->Get(KTelMatchDigits, iMatchDigitCount));
    79         {
    96 	// The rest of the system has a miniumum of 7 for the number matching, so we do the same here
    80         // Min is 7
    97 	iMatchDigitCount = Max(iMatchDigitCount, KDefaultGsmNumberMatchLength);
    81         iMatchDigitCount = Max(iMatchDigitCount, KDefaultGsmNumberMatchLength);
       
    82         }
       
    83     else
       
    84         {
       
    85         iMatchDigitCount = KDefaultGsmNumberMatchLength;
       
    86         }
       
    87 	CleanupStack::PopAndDestroy(repository);
    98 	CleanupStack::PopAndDestroy(repository);
    88 	}
    99 	}
    89 
   100 
    90 CPbapVCardExporterUtil::~CPbapVCardExporterUtil()
       
    91 	{
       
    92 	LOG_FUNC
       
    93 	iTzClient.Close();
       
    94 	CVersitTlsData::CloseVersitTlsData();
       
    95 	}
       
    96 	
       
    97 /**
   101 /**
    98  Export a contact as vCard.
   102  Export a contact as vCard.
    99 
   103 
   100  @param aContactId Contact item ID to export. If this value is set to KNullContactId an empty vCard
   104  @param aContactId Contact item ID to export. If this value is set to KNullContactId an empty vCard
   101        containing only the mandatory properties defined in the PBAP specification will be exported
   105        containing only the mandatory properties defined in the PBAP specification will be exported