MTK6225 Speed Dial

 

1. [话机设置]中的[速拨]设置

      资源加载:

      populateSettingMenu()

              PopulatePhoneSetupResData()

 

       ADD_APPLICATION_MENUITEM((MENU_SETTING_SPEED_DIAL, MENU9102_INITIAL_SETUP, 2,

                              MENU_SETTING_SPEED_STATUS,

                              MITEM113_PBOOK_SPEED_DIAL,

                              SHOW, (MOVEABLEACROSSPARENT | SHORTCUTABLE), DISP_LIST, STR_MENU_SETTING_SPEED_DIAL, 0));

    ADD_APPLICATION_MENUITEM((MENU_SETTING_SPEED_STATUS, MENU_SETTING_SPEED_DIAL, 0,

                              SHOW, NONMOVEABLE, DISP_LIST, STR_SETTING_SPEED_STATUS, 0));

    ADD_APPLICATION_MENUITEM((MITEM113_PBOOK_SPEED_DIAL, MENU_SETTING_SPEED_DIAL, 0,

                              SHOW, NONMOVEABLE, DISP_LIST, STR_SCR_SPEED_DIAL_MAIN_CAPTION, IMG_GLOBAL_L2));

 

    /* Speed Dial - Operation */

    ADD_APPLICATION_MENUITEM((MENU_ID_SPEED_DIAL_OPERATION, 0, 2,

                              MENU_ID_SPEED_DIAL_OP_EDIT,

                              MENU_ID_SPEED_DIAL_OP_DEL, SHOW, NONMOVEABLE, DISP_LIST, STR_MENU_SETTING_SPEED_DIAL, 0));

    ADD_APPLICATION_MENUITEM((MENU_ID_SPEED_DIAL_OP_EDIT, MENU_ID_SPEED_DIAL_OPERATION, 0,

                              SHOW, NONMOVEABLE, DISP_LIST, STR_GLOBAL_EDIT, 0));

    ADD_APPLICATION_MENUITEM((MENU_ID_SPEED_DIAL_OP_DEL, MENU_ID_SPEED_DIAL_OPERATION, 0,

                              SHOW, NONMOVEABLE, DISP_LIST, STR_GLOBAL_DELETE, IMG_GLOBAL_L2));

 

2.初始化过程:

  InitAllApplications()

     mmi_phb_init()

              void PhbInitSpeedDial(void)

            {

                 SetHiliteHandler(MENU_SETTING_SPEED_DIAL, HighlightPhbSpeedDial);

                 SetHiliteHandler(MITEM113_PBOOK_SPEED_DIAL, HighlightPhbSpeedDialSetNum);

                 SetHiliteHandler(MENU_SETTING_SPEED_STATUS, HighlightPhbSpeedDialStatus);

 

                 SetHintHandler(MENU_SETTING_SPEED_DIAL, HintPhbSpeedDial);

                 SetHintHandler(MENU_SETTING_SPEED_STATUS, HintPhbSpeedDial);        /*                                                                                               SetHintHandler(MENU_SETTING_SPEED_STATUS,HintSpeedDialOn); */

 

                 SetHiliteHandler(MENU_ID_SPEED_DIAL_OP_EDIT, HighlightPhbSpeedDialSetNumOptionEdit);

                 SetHiliteHandler(MENU_ID_SPEED_DIAL_OP_DEL, HighlightPhbSpeedDialSetNumOptionDel);

              }

        

 

 

相关的变量:

CurrentSpeedType-------------速拨功能是否开启

CurrentSpeedTypeChange-----在函数ExitPhbSpeedDial()中判断,以重写NVRAM中的值。NVRAM_SETTING_SPEED_DIAL

SpeedDialInfo speedDialTable[MAX_SPEED_DIAL_NUMBER]; ----------------速拨的信息(电话号码),

数据结构SpeedDialInfo为:

type;

storage;

record_index;

number[]

name[]

 

currentKeyIndex------------在速拨清单中,当前高亮的MENU索引

 

 

 

速拨号码的初始化:

开机之后,mmi_phb_get_entry_by_index_req(),发送消息PRT_PHB_GET_ENTRY_BY_INDEX_REQ到L4。

并设置:

SetProtocolEventHandler(mmi_phb_get_entry_by_index_rsp, PRT_PHB_GET_ENTRY_BY_INDEX_RSP);

在CBack函数中,

mmi_phb_get_entry_by_index_rsp()

         PhbGetSpeedDialInfo( )

              PhbReadSpeedDialNVRAM()

                     ReadRecord(NVRAM_EF_PHONEBOOK_SPEEDDIAL_LID, 1, speedDialTable, NVRAM_SPEEDDIAL_RECORD_SIZE, &error);

 

 

 

(1)[速拨]入口函数:

         EntryPhbSpeedDial()

              ShowCategory52Screen()

(2)改变速拨状态

         EntryPhbSpeedDialStatus()

(3)速拨清单

         EntryPhbSpeedDialSetNum()

              ShowCategory53Screen( )

 

         删除一个速拨号码时,操作是:

         memset(&speedDialTable[currentKeyIndex], 0, sizeof(SpeedDialInfo));

    WriteRecord(NVRAM_EF_PHONEBOOK_SPEEDDIAL_LID, 1, speedDialTable, NVRAM_SPEEDDIAL_RECORD_SIZE, &error);

         仅仅把speedDialTable[currentKeyIndex]里的号码清空,然后写入NVRAM中。

 

         编辑一个速拨号码,操作是:

         mmi_phb_speed_dial_enter_phb()

              phbListView = MMI_PHB_LIST_FOR_SPEED_DIAL;

              mmi_phb_list_pre_entry_for_numbers();

                     mmi_phb_list_pre_entry_for_numbers_ext()

                            设置左软件响应:mmi_phb_entry_choose_numbers()

                            //显示电话簿列表

                            mmi_phb_entry_list(EntryCount,                           /*Total Entry*/

                                          STR_SCR_PBOOK_VIEW_CAPTION, /*Title String*/

                                          IMG_SCR_PBOOK_CAPTION, /*Title Image*/              

                                          STR_GLOBAL_OK,                             /*LSK*/

                                          IMG_GLOBAL_OK,                            /*LSK*/

                                          mmi_phb_get_index_second_level,         /*Highlight Callback*/ 

                                          LSKEntryPtr,      /*LSK Callback*/

                                          NULL,                                                          /*SEND Key Callback*/

                                          mmi_phb_list_get_item,     /*List Callback*/

                                          mmi_phb_list_get_hint,      /*Hint Callback*/

                                          mmi_phb_list_pre_entry_for_numbers,     /*Re-Entry Callback*/

                                          TRUE,   /*Alpha Index*/

                                          TRUE);  /*Right Arrow Key*/

 

         在电话簿列表中,按下左软件,进入:

         mmi_phb_entry_choose_numbers()

              mmi_phb_send_data(pbName, (S8*)g_phb_cntx.number_to_dial[0]); 这个函数是把电话簿里的内容(姓名和号码)送到不同的应用

                     PhbSetSpeedDialFormListEx( (PU8)name, (PU8)number, g_phb_name_index[g_phb_cntx.active_index_second] );

                            //把信息写入到结构speedDialTable中。

                            speedDialTable[currentKeyIndex].storage         = storage;

                            speedDialTable[currentKeyIndex].type            = MMI_PHB_PHONEBOOK;

                            speedDialTable[currentKeyIndex].record_index = record_index;

        

                            pfnUnicodeStrcpy((PS8)speedDialTable[currentKeyIndex].name,(PS8)name );

                            pfnUnicodeStrcpy((S8*)speedDialTable[currentKeyIndex].number,(PS8)number);

                            WriteRecord(NVRAM_EF_PHONEBOOK_SPEEDDIAL_LID, 1, speedDialTable, NVRAM_SPEEDDIAL_RECORD_SIZE, &error);

         至此,就完成了速拨号码的编辑。

 

 

在Idle界面,速拨。(eg: 在Idle Screen长按数字键2)

按键响应:IdleCallSpeedDialOnLongPress()

                            S8 *tempbuffer = NULL;

                            tempbuffer = PhbGetSpeedDialNum(Keycode);    //获取号码。Keycode必须是2—9

                                                        直接返回speedDialTable[keyId - 2].number。

                            if (tempbuffer != NULL)

                    {

                        pfnUnicodeStrcpy(g_idle_context.DialPadCallBuffer, tempbuffer);      拷贝号码到拨号缓冲中

                       IdleDialPadCall();                                                                              拨号

                    }

                    else

                    {

                       IdleShowScrNoSpeedDialNumSaved();                                            号码为空,提示错误信息

                    }

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

IOT物联网小镇

赏点银子去植发

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值