本文整理汇总了C++中CContactItemField::AgentStorage方法的典型用法代码示例。如果您正苦于以下问题:C++ CContactItemField::AgentStorage方法的具体用法?C++ CContactItemField::AgentStorage怎么用?C++ CContactItemField::AgentStorage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CContactItemField
的用法示例。
在下文中一共展示了CContactItemField::AgentStorage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoCompareCContactItemFieldStorageTypeL
TBool CPackagerCntComparator::DoCompareCContactItemFieldStorageTypeL(const CContactItemField& anItemField1, const CContactItemField& anItemField2) const
/** Compares two storage type items contained within their respective CContactItemField parent.
@param anItemField1 The first CContactItemField containing the storage type to be compared.
@param anItemField2 The second CContactItemField containing the storage type to be compared.
@return ETrue if the two items are equal, EFalse otherwise. */
{
// Check if storage type is same first, otherwise don't need to
// compare storage content.
if(!DoCompareTUint(anItemField1.StorageType(), anItemField2.StorageType()))
{
return EFalse;
}
TBool result = ETrue;
switch (anItemField1.StorageType())
{
case KStorageTypeText:
result = DoCompareTPtrC(anItemField1.TextStorage()->Text(), anItemField2.TextStorage()->Text());
break;
case KStorageTypeStore:
result = (anItemField1.StoreStorage()->Thing()==anItemField2.StoreStorage()->Thing());
break;
case KStorageTypeDateTime:
result = DoCompareTTime(anItemField1.DateTimeStorage()->Time(), anItemField2.DateTimeStorage()->Time());
break;
case KStorageTypeContactItemId:
result = DoCompareTContactItemId(anItemField1.AgentStorage()->Value(), anItemField2.AgentStorage()->Value());
break;
default:
User::Leave(KErrNotSupported);
break;
}
return result;
}
示例2: SetFieldL
/*sets a specific contact field to a value as determined by its type.
field at aPos in aFields is set to aText*/
void CContactsRamTest::SetFieldL(const CContactItemField &aField, const TDesC& aText)
{
if( aField.IsTemplateLabelField() )
{
return;
}
if( 0 == aText.Size() )
{
return;
}
switch(aField.StorageType())
{
case KStorageTypeText:
aField.TextStorage()->SetTextL(aText);
break;
case KStorageTypeStore:
{
HBufC8 *buf = HBufC8::NewLC(aText.Size());
TPtr8 tptr8 = buf->Des();
tptr8.Copy(aText);
aField.StoreStorage()->SetThingL(*buf);
CleanupStack::PopAndDestroy(buf);
}
break;
case KStorageTypeContactItemId:
{
aField.AgentStorage()->SetAgentId( KAgentId );
}
break;
case KStorageTypeDateTime:
{
if( aText.Size() > 0 )
{
aField.DateTimeStorage()->SetTime( TTime(KTime) );
}
else
{
aField.DateTimeStorage()->SetTime( TTime(0) );
}
}
break;
default:
User::Panic(aText,EInvariantFalse);
break;
}
}
示例3: MakeAgentL
/**Utility function for adding agent to a contact item*/
void CAgentTest::MakeAgentL(TContactItemId aMainContactId, TContactItemId aAgentId)
{
CContactItem* mainItem = NULL;
CContactItemField* field = NULL;
mainItem = iDb->OpenContactL(aMainContactId);
CleanupStack::PushL(mainItem);
field = CContactItemField::NewLC(KStorageTypeContactItemId, KUidContactFieldVCardMapAGENT );
field->SetMapping(KUidContactFieldVCardMapAGENT);
field->AgentStorage()->SetAgentId(aAgentId);
mainItem->AddFieldL(*field);
CleanupStack::Pop();
iDb->CommitContactL(*mainItem);
CleanupStack::PopAndDestroy();
}