MTK平台相关资料(7)

2019-06-02 14:03

按下保存键,进入:

mmi_phb_entry_op_add_entry_confirm() mmi_phb_op_add_pre_save() if(!mmi_phb_op_check_pre_save()) //check输入是否正确:姓名号码是否为空pbName,pbNumber,pbHomeNumber,pbOfficeNumber,pbFaxNumber { return; } mmi_phb_op_add_entry_req() //发送消息到L4保存entry mmi_phb_show_in_progress() //显示消息:正在处理 mmi_phb_op_set_entry_prepare_name_number(&myMsgPtr->list,pbName,pbNumber); //装载姓名和号码,没有装载optionalfieldsandIDs。 发送消息:PRT_PHB_SET_ENTRY_REQ SetProtocolEventHandler(mmi_phb_op_add_entry_rsp,PRT_PHB_SET_ENTRY_RSP);

返回消息后,进入CBACK函数: mmi_phb_op_add_entry_rsp() { if(localPtr->result.flag==0)//存储成功 { store_index=mmi_phb_op_get_store_index_and_increase_counter(localPtr->list[0].storage,localPtr->list[0].record_index); //record_index是entry的物理存储位置,从1开始。 //store_index是entry在数组PhoneBook中的存储位置,从0开始。 if(localPtr->list[0].storage==MMI_NVRAM) //存储在NVRAM { mmi_phb_op_update_optional_field(store_index,MMI_NVRAM,1); //保存optionalfieldtoNVRAM //把用户输入的信息拷贝到中PhoneBookOptionalFields UnicodeToAnsii((PS8)PhoneBookOptionalFields.homeNumber,pbHomeNumber); pfnUnicodeStrcpy((PS8)PhoneBookOptionalFields.companyName,pbCompanyName); UnicodeToAnsii((PS8)PhoneBookOptionalFields.emailAddress,pbEmailAddress); UnicodeToAnsii((PS8)PhoneBookOptionalFields.officeNumber,pbOfficeNumber);

UnicodeToAnsii((PS8)PhoneBookOptionalFields.faxNumber,pbFaxNumber); //写入到NVRAM。可见:在NVRAM中,也是按照store_index的顺序存储的,与PhoneBook一样。不过是从1开始。 WriteRecord(NVRAM_EF_PHB_FIELDS_LID,(U16)(store_index+1),(void*)&PhoneBookOptionalFields, OPTIONAL_FIELDS_RECORD_SIZE, &pError); //根据store_index来读取这个entry的optionalIDS. optid_record=(store_index/OPTIONAL_IDS_RECORD_TOTAL)+1; optid_index=store_index-(optid_record-1)*OPTIONAL_IDS_RECORD_TOTAL; ReadRecord(NVRAM_EF_PHB_IDS_LID,optid_record,(void*)PhbOptIDs,OPTIONAL_IDS_RECORD_SIZE,&pError); 把g_phb_cntx.image_id_list,

g_phb_cntx.selected_grp_index,g_phb_cntx.ring_tone_list信息拷贝到刚刚读取出来的PhbOptIDs中。 然后再写入NVRAM中 WriteRecord(NVRAM_EF_PHB_IDS_LID,optid_record,PhbOptIDs,OPTIONAL_IDS_RECORD_SIZE,&pError); mmi_phb_op_increase_lookup_table(); //把家庭,公司,传真号码加入到数组LookUpTable[]中。 mmi_phb_video_update_by_index(store_index); //保存来电的video到NVRAM中。 UnicodeToAnsii((PS8)num_ascii,(PS8)pbNumber); flag+=mmi_phb_op_increase_lookup_table(store_index,(S8*)num_ascii,NULL,NULL,NULL); //把电话加入LookUpTable[]中。 mmi_phb_lookup_table_sort() ;//对数组LookUpTable[]按照号码大小顺序排序 mmi_phb_op_set_entry_rsp_name_number(&localPtr->list[0],store_index); //把姓名和号码保存在PhoneBook[store_index]中。 mmi_phb_op_update_field_flag();//updatefileterflagofeachentry.

mmi_phb_bday_update_field();//保存生日信息 ReadRecord(NVRAM_EF_PHB_BIRTHDAY_LID,bday_record,(void*)bday_data,NVRAM_EF_PHB_BIRTHDAY_SIZE,&pError); 拷贝pbYear,pbMon,pbDay到bday_data中; WriteRecord(NVRAM_EF_PHB_BIRTHDAY_LID,bday_record,(void*)bday_data,NVRAM_EF_PHB_BIRTHDAY_SIZE,&pError); mmi_phb_util_make_pinyin_cache(store_index); //把

PhoneBook[store_index]中姓名的拼音加入到g_phb_name_pinyin_index[store_index]中。 /*Insertnametonamemappingtable.*/ mmi_phb_sort_insert_name_index(store_index); //如果是从CALLLOG中来保存一个entry,那么就更新这个calllog ReqUpdateCallLogName(PhoneBook[store_index].alpha_id.name_length,PhoneBook[store_index].alpha_id.name_dcs, PhoneBook[store_index].alpha_id.name); mmi_phb_clear_old_add_history(); //删除历史screen } } else //存储失败 { 提示错误信息; 删除历史screen; } g_phb_enter_from=MMI_PHB_ENTER_NONE; g_phb_cntx.current_op=MMI_PHB_OP_NONE; }

三、电话列表 PhoneBook 3.ViewPhonebook 分类查看 1.ViewSIM SIM卡 MITEM111_PBOOK_VIEW_SIM_ENTRY

2.ViewPhone 本机 MITEM111_PBOOK_VIEW_PHONE_ENTRY 1.SIM卡

mmi_phb_highlight_view_sim() mmi_phb_view_sim() g_edit_listview =MMI_PHB_LIST_FOR_SIM;//每次进入phoneentrylistview时,都要设置这个变量。 检查电话簿已经读取完毕,并且此刻没有电话簿的操作,SIM卡有号码 mmi_phb_entry_list2(g_phb_cntx.sim_used,/*TotalEntry*/ STR_PHB_VIEW,/*TitleString*/ IMG_SCR_PBOOK_CAPTION,/*TitleImage*/ STR_GLOBAL_OPTIONS,/*LSK*/ IMG_GLOBAL_OPTIONS,/*LSK*/ #ifdefined(__MMI_INTELLIGENT_CALL_ALERT__) mmi_phb_get_index_speak_name_sim, #else mmi_phb_get_index_sim,//mmi_phb_get_index,/*HighlightCallback*/ #endif mmi_phb_entry_op_option_sim,/*LSKCallback*/ mmi_phb_choose_number_normal,/*SENDKeyCallback*/ mmi_phb_list_get_item_sim,//mmi_phb_list_get_item,/*ListCallback*/ mmi_phb_list_get_hint_sim,//mmi_phb_list_get_hint,/*HintCallback*/ mmi_phb_view_sim,/*Re-EntryCallback*/ TRUE,/*AlphaIndex*/ TRUE); /*RightArrowKey*/ 详细看上面注册的函数: (1)高亮:mmi_phb_get_index_sim() 设置:g_phb_cntx.active_index。注意:g_phb_cntx.active_index是在g_phb_name_index[]数组中的位置。0,1,2,3,4…。即:当前高亮的entry在数组: g_phb_name_index[]中的顺序位置。

(2)左软件响应mmi_phb_entry_op_option_sim() ShowCategory15Screen()每一个entry的选项菜单 (3)SEND键响应mmi_phb_choose_number_normal() mmi_phb_list_pre_choose_number()//当该entry有多个号码时,让用户选择拨哪个 mmi_phb_entry_list_choose_number() (4)获取SIM卡item:mmi_phb_list_get_item_sim() 获取SIM卡中entry的姓名。没有姓名的就获取号码 (5)hintcallback:mmi_phb_list_get_hint_sim() 获取hint信息:号码

mmi_phb_entry_list2() mmi_phb_list_build_alpha_index() //用户快捷方式。按照g_phb_name_index[]中保存的字母顺序,提取PhoneBook中的姓名,按照首字母的顺序以字母(26个)为索 引,把每个entry在电话列表中的listindex保存在g_phb_alpha_index_list[]中。即:g_phb_alpha_index_list[]中保存的是该entry的listindex。这样,当用户输入某个字 母时,如:c,那么就可以直接跳转到g_phb_alpha_index_list[2]的值所指示的位置。 ShowCategory184Screen() ShowCategory185Screen() init_dynamic_item_buffer() dynamic_item_buffer.load_func=get_item_func; dynamic_item_buffer.hint_func=get_hint_func; load_dynamic_item_buffer() for(i=0;i


MTK平台相关资料(7).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:如果你还这样,注定是个卢瑟

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: