⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jprofileuihandler.c

📁 MTK_MMI的部分源代码,从code中大致了解到MMI的执行流程
💻 C
📖 第 1 页 / 共 5 页
字号:
    S16 error;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (g_ph_cntx.profile_module == PH_BROWSER_PROFILE)
    {
        g_ph_cntx.wap_actived_profile_index = g_ph_cntx.profile_index;
        WriteValue(NVRAM_PH_ACTIVATED_WAP_PROFILE_INDEX, &g_ph_cntx.wap_actived_profile_index, DS_BYTE, &error);
        mmi_ph_get_activated_profile_data(PH_BROWSER_PROFILE, g_ph_cntx.profile_index);

    }
    else if (g_ph_cntx.profile_module == PH_MMS_PROFILE)
    {
        g_ph_cntx.mms_actived_profile_index = g_ph_cntx.profile_index;
        WriteValue(NVRAM_PH_ACTIVATED_MMS_PROFILE_INDEX, &g_ph_cntx.mms_actived_profile_index, DS_BYTE, &error);
        mmi_ph_get_activated_profile_data(PH_MMS_PROFILE, g_ph_cntx.profile_index);
    }
#if defined(MMS_SUPPORT)/*dilip*/
    mmi_jmms_set_profile();
#endif
    /* Added by Sandeep for checking data connection active or not */
    /* If the data profile is chnaged by the user then we have to set this flag as false so that 
       when a new page is fetched then we have to set the profile again */
    mmi_brw_set_connection_active_flag(E_FALSE);

    DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
    DeleteNHistory(1);
}


/*****************************************************************************
 * FUNCTION
 *  mmi_ph_show_connection_type_options
 * DESCRIPTION
 *  It shows the various connection type menu item available
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_ph_show_connection_type_options(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 *gui_buffer_p;
    S32 num_of_item = 0;
    S32 count;
    U32 conn_type_index;
    U16 nStrItemList[MAX_CONN_TYPE];

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    EntryNewScreen(SCR_ID_PROF_HDLR_CONN_TYPE, NULL, mmi_ph_show_connection_type_options, NULL);

    gui_buffer_p = GetCurrGuiBuffer(SCR_ID_PROF_HDLR_CONN_TYPE);

    num_of_item = GetNumOfChild(MENU_ID_PH_CONNECTION_TYPE);
    GetSequenceStringIds(MENU_ID_PH_CONNECTION_TYPE, nStrItemList);
    SetParentHandler(MENU_ID_PH_CONNECTION_TYPE);

    RegisterHighlightHandler(mmi_ph_conn_type_highlight_hdlr);

    for (count = 0; count < num_of_item; count++)
    {
        memset((S8*) subMenuDataPtrs[count], 0, MAX_SUB_MENU_SIZE);
        pfnUnicodeStrncpy((S8*) subMenuDataPtrs[count], (S8*) GetString(nStrItemList[count]), MAX_SUBMENU_CHARACTERS);
    }
    conn_type_index = mmi_ph_get_highlighted_menu_item();
    ShowCategory36Screen(
        STR_ID_PROF_HDLR_CONN_TYPE,
        //GetRootTitleIcon(SERVICES_WAP_MENU_ID),
		GetRootTitleIcon(g_ph_title_img_id),
        STR_GLOBAL_OK,
        IMG_GLOBAL_OK,
        STR_GLOBAL_BACK,
        IMG_GLOBAL_BACK,
        num_of_item,
        (U8 **) subMenuDataPtrs,
        (U16) conn_type_index,
        gui_buffer_p);

    SetLeftSoftkeyFunction(mmi_ph_entry_edit_connection_type_details, KEY_EVENT_UP);
    //NOTE : this will be needed if we want to update the connection type just by selecting the conn type
    //      SetRightSoftkeyFunction(mmi_ph_update_connection_type,KEY_EVENT_UP);
    //      SetKeyHandler(mmi_ph_update_connection_type,KEY_LEFT_ARROW,KEY_EVENT_DOWN);
    SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
    SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
}


/*****************************************************************************
 * FUNCTION
 *  mmi_ph_update_connection_type
 * DESCRIPTION
 *  This API updates the connection type in the edit profile screen
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_ph_update_connection_type(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    mmi_ph_highlight_inline_item_conn_type(g_ph_conn_index);
    DeleteNHistory(1);
}


/*****************************************************************************
 * FUNCTION
 *  mmi_ph_get_highlighted_menu_item
 * DESCRIPTION
 *  It gives the higlighted connection type menu item
 * PARAMETERS
 *  void
 * RETURNS
 *  U8 connection type highlighted
 *****************************************************************************/
U8 mmi_ph_get_highlighted_menu_item(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (g_ph_cntx.profile_module == PH_BROWSER_PROFILE)
    {
        if ((g_ph_wap_profile_p->conn_type == PH_CONN_TYPE_CONNECTION_OREINTED)
            || (g_ph_wap_profile_p->conn_type == PH_CONN_TYPE_CONNECTION_OREINTED_SECURE))
        {
            return (U8) PH_MENU_CONNECTION_OREINTED;
        }
        else if (g_ph_wap_profile_p->conn_type == PH_CONN_TYPE_HTTP)
        {
            return (U8) PH_MENU_HTTP;
        }
    }
    else if (g_ph_cntx.profile_module == PH_MMS_PROFILE)
    {
        if ((g_ph_mms_profile_p->conn_type == PH_CONN_TYPE_CONNECTION_OREINTED)
            || (g_ph_mms_profile_p->conn_type == PH_CONN_TYPE_CONNECTION_OREINTED_SECURE))
        {
            return (U8) PH_MENU_CONNECTION_OREINTED;
        }
        else if (g_ph_mms_profile_p->conn_type == PH_CONN_TYPE_HTTP)
        {
            return (U8) PH_MENU_HTTP;
        }

    }
    return (U8) PH_MENU_CONNECTION_OREINTED;
}


/*****************************************************************************
 * FUNCTION
 *  mmi_ph_conn_type_highlight_hdlr
 * DESCRIPTION
 *  This API is to update the global connection type index
 * PARAMETERS
 *  index       [IN]        Highlighted index
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_ph_conn_type_highlight_hdlr(S32 index)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    g_ph_conn_index = (U8) index;
}


/*****************************************************************************
 * FUNCTION
 *  mmi_ph_entry_edit_connection_type_details
 * DESCRIPTION
 *  This is the entry fucntion for connection type details inline item screen
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_ph_entry_edit_connection_type_details(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 *input_buffer_p; /* added for inline edit history */
    U8 *gui_buffer_p;   /* Buffer holding history data */
    U16 input_buffer_size;
	U32 conn_type_index; // Sandeep
    U16 EditConnTypeIconList[MAX_INLINE_ITEM_EDIT_CONN_TYPE_LIST] = {IMG_GLOBAL_L1, 0, IMG_GLOBAL_L2, 0};

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    EntryNewScreen(SCR_ID_PROF_HDLR_EDIT_CONN_TYPE, mmi_ph_exit_edit_connection_type_details, NULL, NULL);

    InitializeCategory57Screen();

    gui_buffer_p = GetCurrGuiBuffer(SCR_ID_PROF_HDLR_EDIT_CONN_TYPE);
    input_buffer_p = GetCurrNInputBuffer(SCR_ID_PROF_HDLR_EDIT_CONN_TYPE, &input_buffer_size);  /* added for inline edit history */

    mmi_ph_edit_conn_type_fill_inline_struct();

    if (input_buffer_p != NULL)
    {
        if (g_ph_conn_index == PH_MENU_HTTP)
        {
            SetCategory57Data(wgui_inline_items, MAX_INLINE_ITEM_EDIT_CONN_TYPE_LIST, input_buffer_p);
        }
        else
        {
            SetCategory57Data(wgui_inline_items, 2, input_buffer_p);
        }
    }

	//Sandeep
	conn_type_index = mmi_ph_get_highlighted_menu_item();
	if ( conn_type_index != g_ph_conn_index )
	{
		SetInlineListMenuChanged();
	}

    if (g_ph_conn_index == PH_MENU_HTTP)
    {
        ShowCategory57Screen(
            STR_GLOBAL_EDIT,
            //GetRootTitleIcon(SERVICES_WAP_MENU_ID),
			GetRootTitleIcon(g_ph_title_img_id),
            STR_GLOBAL_EDIT,
            NULL,
            STR_GLOBAL_BACK,
            IMG_GLOBAL_BACK,
            MAX_INLINE_ITEM_EDIT_CONN_TYPE_LIST,
            EditConnTypeIconList,
            wgui_inline_items,
            0,
            gui_buffer_p);
    }
    else
    {
        ShowCategory57Screen(
            STR_GLOBAL_EDIT,
            //GetRootTitleIcon(SERVICES_WAP_MENU_ID),
			GetRootTitleIcon(g_ph_title_img_id),
            STR_GLOBAL_EDIT,
            NULL,
            STR_GLOBAL_BACK,
            IMG_GLOBAL_BACK,
            2,
            EditConnTypeIconList,
            wgui_inline_items,
            0,
            gui_buffer_p);
    }

    SetCategory57RightSoftkeyFunctions(mmi_ph_save_connection_type_changes, GoBackHistory);

}


/*****************************************************************************
 * FUNCTION
 *  mmi_ph_highlight_inline_item_conn_type
 * DESCRIPTION
 *  This API updates the Browser & MMS proifle structs based  on the highlighted index
 * PARAMETERS
 *  index       [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_ph_highlight_inline_item_conn_type(S32 index)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (index == PH_MENU_CONNECTION_OREINTED)
    {
        if (g_ph_cntx.profile_module == PH_BROWSER_PROFILE)
        {

        #if defined (WAP_SEC_SUPPORT) && defined (JATAAYU_SUPPORT)
            if (UCS2Strcmp
                ((S8*) g_ph_cntx.profile_display_p->security_option[g_ph_cntx.profile_display_p->security_opt_index],
                 (S8*) GetString(STR_ID_PROF_HDLR_ON)) == 0)
            {
                g_ph_wap_profile_p->conn_type = CONN_TYPE_CONNECTION_OREINTED_SECURE;
                g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[g_ph_cntx.profile_index].conn_type =
                    CONN_TYPE_CONNECTION_OREINTED_SECURE;

            }
            else
            {
                g_ph_wap_profile_p->conn_type = PH_CONN_TYPE_CONNECTION_OREINTED;
                g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[g_ph_cntx.profile_index].conn_type =
                    PH_CONN_TYPE_CONNECTION_OREINTED;
            }
        #else /* defined (WAP_SEC_SUPPORT) && defined (JATAAYU_SUPPORT) */ 
            g_ph_wap_profile_p->conn_type = PH_CONN_TYPE_CONNECTION_OREINTED;
            g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[g_ph_cntx.profile_index].conn_type =
                PH_CONN_TYPE_CONNECTION_OREINTED;
        #endif /* defined (WAP_SEC_SUPPORT) && defined (JATAAYU_SUPPORT) */ 
        }
        else if (g_ph_cntx.profile_module 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -