当前位置: 首页>>代码示例>>C++>>正文


C++ CContactDatabase::OpenContactLX方法代码示例

本文整理汇总了C++中CContactDatabase::OpenContactLX方法的典型用法代码示例。如果您正苦于以下问题:C++ CContactDatabase::OpenContactLX方法的具体用法?C++ CContactDatabase::OpenContactLX怎么用?C++ CContactDatabase::OpenContactLX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CContactDatabase的用法示例。


在下文中一共展示了CContactDatabase::OpenContactLX方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: FailWriteValidationL

/**
 * Unsuccessful edit. Fail the write validation request
 * @param aDb Contact database
 * @param aId Item Id to edit
 */
void FailWriteValidationL(CContactDatabase& aDb, TContactItemId aId)
	{
	syncChecker->SetValidateResponseL(MContactSynchroniser::ERead,KErrNone);
	syncChecker->SetValidateResponseL(MContactSynchroniser::EEdit, KErrNone);
	syncChecker->SetValidateWriteResponseL(KErrAccessDenied);
	syncChecker->ResetMethodCallCountsL();

	CContactItem* item = aDb.OpenContactLX(aId);
	CleanupStack::PushL(item);
	CContactItemFieldSet& fieldset = item->CardFields();
	const TInt pos = fieldset.Find(KUidContactFieldFamilyName);	
	CContactItemField& field = fieldset[pos];
	CContactTextField* textfield = field.TextStorage();
	textfield->SetTextL(KGivenEditName);

	TRAPD(err, aDb.CommitContactL(*item));
	test(syncChecker->ValidateMethodCallCountL() == 4);	
	test(err==KErrAccessDenied);
	CleanupStack::PopAndDestroy(2); //item, lock record
	}
开发者ID:Esclapion,项目名称:qt-mobility,代码行数:25,代码来源:t_iccmultiplephonebook.cpp

示例2: CreateICCTemplateL

/** 
 * Create template card for ICC contact items 
 * @param aDb Contact database
 */
TContactItemId CreateICCTemplateL(CContactDatabase& aDb)
	{
	CContactItem* temp = aDb.CreateContactCardTemplateLC(KTemplateName);
	TContactItemId templateId = temp->Id();
	CleanupStack::PopAndDestroy(temp);
	temp=NULL;

	//Remove all the unnecessary fields
	temp = aDb.OpenContactLX(templateId);
	CleanupStack::PushL(temp);	
	const TInt fieldCount = temp->CardFields().Count();
	for(TInt i=fieldCount-1;i>=0;i--)
		temp->RemoveField(i);
		
	CContactItemField* name = CContactItemField::NewLC(KStorageTypeText,KUidContactFieldFamilyName);
	name->SetMapping(KUidContactFieldVCardMapUnusedN);
	temp->AddFieldL(*name);
	CleanupStack::Pop(name);

	CContactItemField* number = CContactItemField::NewLC(KStorageTypeText,KUidContactFieldPhoneNumber);
	number->SetMapping(KUidContactFieldVCardMapTEL);
	temp->AddFieldL(*number);
	CleanupStack::Pop(number);
				
	CContactItemField* slotnum = CContactItemField::NewLC(KStorageTypeText,KUidContactFieldICCSlot);
	temp->AddFieldL(*slotnum);
	CleanupStack::Pop(slotnum);

	CContactItemField* phonebook = CContactItemField::NewLC(KStorageTypeText,KUidContactFieldICCPhonebook);
	temp->AddFieldL(*phonebook);
	CleanupStack::Pop(phonebook);

	aDb.CommitContactL(*temp);
	CleanupStack::PopAndDestroy(2);	// temp, close template	
	
	return templateId;
	}
开发者ID:Esclapion,项目名称:qt-mobility,代码行数:41,代码来源:t_iccentry.cpp


注:本文中的CContactDatabase::OpenContactLX方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。