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


C++ CContactItemFieldSet::Find方法代码示例

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


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

示例1: CheckFieldContentL

/** 
 * Check that the field of type aFieldType has the same content as 
 * aExpectedContent
 * @param aFieldset Contact item fieldset
 * @param aFieldType Field type to test
 * @param aExpectedContent Expected data
 */
void CheckFieldContentL(CContactItemFieldSet& aFieldset, TFieldType aFieldType, const TDesC& aExpectedContent)
	{
	TInt pos = aFieldset.Find(aFieldType);
	CContactItemField& field = aFieldset[pos];
	CContactTextField* textField = field.TextStorage();
	test(textField != NULL);
	test(textField->Text() == aExpectedContent);
	}
开发者ID:Esclapion,项目名称:qt-mobility,代码行数:15,代码来源:t_iccentry.cpp

示例2: GetTextFieldFromFieldSet

void CReadContactsAO::GetTextFieldFromFieldSet(CContactItemFieldSet& aFieldSet, const TUid aField,TDesC& name)
{
	TInt index = aFieldSet.Find(aField);

    if ((index >= 0) && (index < aFieldSet.Count()))
    {
   	    CContactItemField& textfield = aFieldSet[index];
        CContactTextField* textValue = textfield.TextStorage();

		((TDes&)name).Copy(textValue->Text());		
    } 
}
开发者ID:deepakprabhakara,项目名称:ripplevault,代码行数:12,代码来源:readcontactsao.cpp

示例3: AddContactItemsL

/**Utility function for Adding any number of contact items
   with name and telephone fields.
*/
void CAgentTest::AddContactItemsL(TInt aCount)
	{
	iIdArray->Reset();
	CContactItem* templateCard = NULL;
	CContactCard* card = NULL;
	CContactItemFieldSet* fieldSet = NULL;
	
	for(TInt loop = 0; loop < aCount; ++loop)
		{
		TInt pos = KErrNotFound;
		TBuf<16> name;
		name.Format(_L("NAME%d"),loop);
		TBuf<16> tel;
		tel.Format(_L("123456%d"),loop);
		
		templateCard = iDb->ReadContactLC(iDb->TemplateId());
		card = CContactCard::NewLC(templateCard); 
	
		fieldSet = &card->CardFields();
		pos = fieldSet->Find(KUidContactFieldFamilyName);
		if (pos != KErrNotFound)
			{
			(*fieldSet)[pos].TextStorage()->SetTextL(name);		
			}
		pos = fieldSet->Find(KUidContactFieldPhoneNumber);
		
		if (pos != KErrNotFound)
			{
			(*fieldSet)[pos].TextStorage()->SetTextL(tel);	
			}
		
    	TContactItemId contactId = iDb->AddNewContactL(*card);
		iIdArray->AddL(contactId);
		CleanupStack::PopAndDestroy(2);
		}
	}
开发者ID:Esclapion,项目名称:qt-mobility,代码行数:39,代码来源:t_agent.cpp

示例4: RemoveFieldFromContactL

/**Utility function to remove any specified contact field from a specified contact item*/
TBool CAgentTest::RemoveFieldFromContactL(TContactItemId aContactId, TUid aContactField)
	{
	CContactItem* mainItem = NULL;
	CContactItemFieldSet* fields = NULL;
	mainItem = iDb->OpenContactL(aContactId);
	CleanupStack::PushL(mainItem);
	fields = &mainItem->CardFields();
	TInt pos = 0;
	pos = fields->Find(aContactField);
	if (pos != KErrNotFound)
		{
		fields->Remove(pos);	
		}
	iDb->CommitContactL(*mainItem);
	CleanupStack::PopAndDestroy();	
	return pos;	
	}
开发者ID:Esclapion,项目名称:qt-mobility,代码行数:18,代码来源:t_agent.cpp


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