本文整理汇总了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);
}
示例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());
}
}
示例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);
}
}
示例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;
}