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


C++ CContact::GetEntryId方法代码示例

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


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

示例1: SaveFormDataL

TBool CVoIPForm::SaveFormDataL()
    {
    CVoIPAppUi* iAppUi = static_cast<CVoIPAppUi*> (iEikonEnv->EikAppUi());
    CVoIPDocument* iDocument =
            static_cast<CVoIPDocument*> (iAppUi->Document());

    TInt iModifyIndex = iDocument->ModifyIndex();
    RPointerArray<CContact> contacts = iAppUi->GetPhoneBook()->GetContactsL();

    if (iModifyIndex >= 0)
        {
        CContact* contact = contacts[iModifyIndex];

        if (contact)
            {
            iAppUi->GetPhoneBook()->DeleteContactItem(contact->GetEntryId());

            TContactItemId contactItemId =
                    iAppUi->GetPhoneBook()->CreateDefaultContactItem();

            contact->SetEntryId(contactItemId);

            CPbkContactItem* contactItem =
                    iAppUi->GetPhoneBook()->OpenContactItemLCX(contactItemId);

            TInt pageId = ActivePageId();

            RArray<CEikCaptionedControl*> aControls;

            ControlsOnPage(aControls, pageId);

            for (TInt i = 0; i < aControls.Count(); i++)
                {
                CEikCaptionedControl* control =
                        ((CEikCaptionedControl*) aControls[i]);

                TPbkContactItemField* field = contactItem->FindField(
                        control->iId);

                if (field == NULL)
                    {
                    CPbkFieldInfo* fieldInfo =
                            iAppUi->GetPhoneBook()->GetFieldsInfo().Find(
                                    control->iId);
                    contactItem->AddFieldL(*fieldInfo);
                    field = contactItem->FindField(control->iId);
                    }

                field->SetLabelL(control->GetFullCaptionText());

                CPbkFieldInfo& fieldInfo = field->FieldInfo();
                if (fieldInfo.CtrlType() == EPbkFieldCtrlTypeDateEditor)
                    {
                    CEikDateEditor* nEditor =
                            static_cast<CEikDateEditor*> (ControlOrNull(
                                    control->iId));
                    TTime time = nEditor->Date();
                    field->DateTimeStorage()->SetTime(time);
                    }
                else
                    {
                    CEikEdwin* nEditor =
                            static_cast<CEikEdwin*> (ControlOrNull(
                                    control->iId));
                    HBufC* text = nEditor->GetTextInHBufL();
                    field->TextStorage()->SetText(text);
                    }
                }

            aControls.Reset();

            iAppUi->GetPhoneBook()->CommitContactItem(contactItem);
            CleanupStack::PopAndDestroy(2); //OpenContactItemLCX
            }
        }
    return ETrue;
    }
开发者ID:bohwaz,项目名称:s60voip,代码行数:77,代码来源:VoIPForm.cpp

示例2: LoadFormValuesFromDataL

void CVoIPForm::LoadFormValuesFromDataL()
    {
    TInt pageId = ActivePageId();

    // Delete all controls not saved.

    RArray<CEikCaptionedControl*> aControls;

    ControlsOnPage(aControls, pageId);

    for (TInt i = 0; i < aControls.Count(); i++)
        {
        CEikCaptionedControl* control =
                ((CEikCaptionedControl*) aControls[i]);
        DeleteLine(control->iId, EFalse);
        }

    aControls.Reset();

    // Create controls based on PhoneBook contact item.

    CVoIPAppUi* iAppUi = static_cast<CVoIPAppUi*> (iEikonEnv->EikAppUi());
    CVoIPDocument* iDocument =
            static_cast<CVoIPDocument*> (iAppUi->Document());

    TInt iModifyIndex = iDocument->ModifyIndex();
    RPointerArray<CContact> contacts = iAppUi->GetPhoneBook()->GetContactsL();

    if (iModifyIndex >= 0)
        {
        CContact* contact = contacts[iModifyIndex];

        if (contact)
            {
            CPbkContactItem* contactItem =
                    iAppUi->GetPhoneBook()->ReadContactItemLC(
                            contact->GetEntryId());

            CPbkFieldArray& fieldArray = contactItem->CardFields();

            for (TInt i = 0; i < fieldArray.Count(); i++)
                {
                TPbkContactItemField field = fieldArray[i];
                if (field.IsEmpty() == EFalse)
                    {
                    CPbkFieldInfo& fieldInfo = field.FieldInfo();
                    TInt id = fieldInfo.FieldId();
                    TAny* unused = 0;

                    if (fieldInfo.CtrlType() == EPbkFieldCtrlTypeTextEditor)
                        {
                        TInt type = EEikCtEdwin;

                        CEikEdwin * nEditor =
                                static_cast<CEikEdwin*> (ControlOrNull(id));
                        if (!nEditor)
                            {
                            CEikEdwin* edwin =
                                    (CEikEdwin*) CreateLineByTypeL(
                                            field.Label(), pageId, id, type,
                                            unused);

                            edwin->ConstructL(EEikEdwinNoHorizScrolling
                                    | EEikEdwinResizable, 10, 100, 1);

                            edwin->SetTextL(&(field.Text()));
                            }
                        }
                    else if (fieldInfo.CtrlType()
                            == EPbkFieldCtrlTypeNumberEditor)
                        {
                        TInt type = EAknCtIntegerEdwin;

                        CAknNumericEdwin
                                * nEditor =
                                        static_cast<CAknNumericEdwin*> (ControlOrNull(
                                                id));
                        if (!nEditor)
                            {
                            CAknNumericEdwin* edwin =
                                    (CAknNumericEdwin*) CreateLineByTypeL(
                                            field.Label(), pageId, id, type,
                                            unused);

                            edwin->ConstructL(EEikEdwinNoHorizScrolling
                                    | EEikEdwinResizable, 10, 100, 1);

                            edwin->SetTextL(&(field.Text()));
                            }
                        }
                    else if (fieldInfo.CtrlType()
                            == EPbkFieldCtrlTypeDateEditor)
                        {
                        TInt type = EEikCtDateEditor;

                        CEikDateEditor * nEditor =
                                static_cast<CEikDateEditor*> (ControlOrNull(
                                        id));
                        if (!nEditor)
                            {
//.........这里部分代码省略.........
开发者ID:bohwaz,项目名称:s60voip,代码行数:101,代码来源:VoIPForm.cpp


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