WEB开发网
开发学院手机开发Symbian 开发 Symbian OS通讯录模型 阅读

Symbian OS通讯录模型

 2010-08-11 12:18:00 来源:WEB开发网   
核心提示:CleanupStack::PushL(iContactsDb);CContactItemFieldDef* iFieldDef =new (ELeave) CContactItemFieldDef();CleanupStack::PushL(iFieldDef);iFieldDef->AppendL(KUidC

CleanupStack::PushL(iContactsDb);

CContactItemFieldDef* iFieldDef =

new (ELeave) CContactItemFieldDef();

CleanupStack::PushL(iFieldDef);

iFieldDef->AppendL(KUidContactFieldGivenName);

iFieldDef->AppendL(KUidContactFieldFamilyName);

_LIT(KFindToken, "Bond");

_LIT(KOtherForename, "Wilkinson");

CIdleFinder* iFinder = iContactsDb->FindAsyncL(KFindToken,

iFieldDef, this);

CleanupStack::PushL(iFinder);

if(iFinder->IsComplete())

{

if(iFinder->Error() == KErrNone)

{

CContactIdArray* result = iFinder->TakeContactIds();

CleanupStack::PushL(result);

for (TInt i = 0; i < result->Count(); i++)

{

TContactItemId cardId = (*result)[i];

CContactItem* ownCard = iContactsDb ->OpenContactL(cardId);

CleanupStack::PushL(ownCard);

TInt index = ownCard->CardFields().Find(KUidContactFieldGivenName);

ownCard->CardFields()[index].TextStorage()->SetTextL(KOtherForename);

iContactsDb ->CommitContactL(*ownCard);

CleanupStack::PopAndDestroy(); // ownCard

}

CleanupStack::PopAndDestroy(); //result;

}

}

CleanupStack::PopAndDestroy(3);// iContactsDb、iFieldDef、iFinder

上一页  1 2 3 4 

Tags:Symbian OS 通讯录

编辑录入:coldstar [复制链接] [打 印]
赞助商链接