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

📄 jprofileuihandler.c

📁 MTK_MMI的部分源代码,从code中大致了解到MMI的执行流程
💻 C
📖 第 1 页 / 共 5 页
字号:
            (U8*) (g_ph_cntx.profile_display_p->password),
            buffer_size,
            INPUT_TYPE_ALPHANUMERIC_PASSWORD | INPUT_TYPE_USE_ONLY_ENGLISH_MODES);
        SetInlineFullScreenEditCustomFunction(
            wgui_inline_items + PH_PROFILE_USER_PASSWORD,
            mmi_ph_editable_profile_full_screen_edit);
    }
    else if (g_ph_cntx.profile_module == PH_MMS_PROFILE)
    {

        /* profile connection type */
        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))
        {
            SetInlineItemDisplayOnly(
                (wgui_inline_items + PH_PROFILE_CONN_TYPE),
                (U8*) GetString(STR_ID_PROF_HDLR_CONN_TYPE_CONNECTION));
        }
        else if (g_ph_mms_profile_p->conn_type == PH_CONN_TYPE_HTTP)
        {
            SetInlineItemDisplayOnly(
                (wgui_inline_items + PH_PROFILE_CONN_TYPE),
                (U8*) GetString(STR_ID_PROF_HDLR_CONN_TYPE_HTTP));
        }

        /* profile name inline item */
        buffer_size = NVRAM_WAP_PROFILE_PROFILE_NAME_LEN;
        if (g_ph_mms_prof_name_arr_p->nvram_mms_profile_name_array[g_ph_cntx.profile_index].dcs == PH_DCS_ASCII)
        {
        #if 0
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
        #endif /* 0 */ 
            AnsiiToUnicodeString(
                (S8*) g_ph_cntx.profile_display_p->profile_name,
                (S8*) (g_ph_mms_prof_name_arr_p->nvram_mms_profile_name_array[g_ph_cntx.profile_index].profile_name));

        }
        else if (g_ph_mms_prof_name_arr_p->nvram_mms_profile_name_array[g_ph_cntx.profile_index].dcs == PH_DCS_UCS)
        {
            UCS2Strcpy(
                (S8*) g_ph_cntx.profile_display_p->profile_name,
                (S8*) (g_ph_mms_prof_name_arr_p->nvram_mms_profile_name_array[g_ph_cntx.profile_index].profile_name));
        }
        SetInlineItemFullScreenEdit(
            (wgui_inline_items + PH_PROFILE_NAME),
            STR_ID_PROF_HDLR_RENAME_PROFILE,
            //GetRootTitleIcon(SERVICES_WAP_MENU_ID),
			GetRootTitleIcon(g_ph_title_img_id),
            (U8*) (g_ph_cntx.profile_display_p->profile_name),
            buffer_size,
            INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ENCODING_BASED_LENGTH | INPUT_TYPE_ONE_LESS_CHARACTER);
        SetInlineFullScreenEditCustomFunction(
            wgui_inline_items + PH_PROFILE_NAME,
            mmi_ph_editable_profile_full_screen_edit);

        /* profile MMSC url inline item */
        buffer_size = NVRAM_MMS_PROFILE_MMSC_URL_LEN;
        AnsiiToUnicodeString((S8*) g_ph_cntx.profile_display_p->homepage_url, (S8*) (g_ph_mms_profile_p->mmsc_url));
        SetInlineItemFullScreenEdit(
            (wgui_inline_items + PH_PROFILE_HOMEPAGE),
            STR_ID_PROF_HDLR_HOMEPAGE,
            //GetRootTitleIcon(SERVICES_WAP_MENU_ID),
			GetRootTitleIcon(g_ph_title_img_id),
            (U8*) (g_ph_cntx.profile_display_p->homepage_url),
            buffer_size,
            INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES);
        SetInlineFullScreenEditCustomFunction(
            wgui_inline_items + PH_PROFILE_HOMEPAGE,
            mmi_ph_editable_profile_full_screen_edit);

        /* profile username inline item */
        buffer_size = NVRAM_MMS_PROFILE_USERNAME_LEN;
        AnsiiToUnicodeString((S8*) g_ph_cntx.profile_display_p->username, (S8*) (g_ph_mms_profile_p->username));
        SetInlineItemFullScreenEdit(
            (wgui_inline_items + PH_PROFILE_USER_NAME),
            STR_ID_PROF_HDLR_USER_NAME,
            //GetRootTitleIcon(SERVICES_WAP_MENU_ID),
			GetRootTitleIcon(g_ph_title_img_id),
            (U8*) (g_ph_cntx.profile_display_p->username),
            buffer_size,
            INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES);
        SetInlineFullScreenEditCustomFunction(
            wgui_inline_items + PH_PROFILE_USER_NAME,
            mmi_ph_editable_profile_full_screen_edit);

        /* profile password inline item */
        buffer_size = NVRAM_MMS_PROFILE_PASSWORD_LEN;
        AnsiiToUnicodeString((S8*) g_ph_cntx.profile_display_p->password, (S8*) (g_ph_mms_profile_p->password));
        SetInlineItemFullScreenEdit(
            (wgui_inline_items + PH_PROFILE_USER_PASSWORD),
            STR_ID_PROF_HDLR_PASSWORD,
            //GetRootTitleIcon(SERVICES_WAP_MENU_ID),
			GetRootTitleIcon(g_ph_title_img_id),
            (U8*) (g_ph_cntx.profile_display_p->password),
            buffer_size,
            INPUT_TYPE_ALPHANUMERIC_PASSWORD | INPUT_TYPE_USE_ONLY_ENGLISH_MODES);
        SetInlineFullScreenEditCustomFunction(
            wgui_inline_items + PH_PROFILE_USER_PASSWORD,
            mmi_ph_editable_profile_full_screen_edit);
    }
}


/*****************************************************************************
 * FUNCTION
 *  mmi_ph_editable_profile_full_screen_edit
 * DESCRIPTION
 *  It is the inline full screen edit custom function
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_ph_editable_profile_full_screen_edit(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    mmi_ph_update_profile_inline_values();
    ChangeLeftSoftkey(STR_GLOBAL_OPTIONS, IMG_GLOBAL_OPTIONS);
    SetInputMethodAndDoneCaptionIcon(GetRootTitleIcon(g_ph_title_img_id)/*GetRootTitleIcon(SERVICES_WAP_MENU_ID)*/);
    SetLeftSoftkeyFunction(EntryScrForInputMethodAndDone, KEY_EVENT_UP);
}


/*****************************************************************************
 * FUNCTION
 *  mmi_ph_update_profile_inline_values
 * DESCRIPTION
 *  It fills the global profile structure based on the inline edit displayable data
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_ph_update_profile_inline_values(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (g_ph_cntx.profile_module == PH_BROWSER_PROFILE)
    {
        UnicodeToAnsii((S8*) (g_ph_wap_profile_p->password), (S8*) (g_ph_cntx.profile_display_p->password));
    }
    else if (g_ph_cntx.profile_module == PH_MMS_PROFILE)
    {
        UnicodeToAnsii((S8*) (g_ph_mms_profile_p->password), (S8*) (g_ph_cntx.profile_display_p->password));
    }
    else
    {
        ASSERT(0);
    }
    /* Other values can be updated later like username */
}


/*****************************************************************************
 * FUNCTION
 *  mmi_ph_save_selected_profile_changes
 * DESCRIPTION
 *  This is the entry function for the save edit profile changes confirmation screen
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_ph_save_selected_profile_changes(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    DisplayConfirm(
        STR_GLOBAL_YES,
        IMG_GLOBAL_YES,
        STR_GLOBAL_NO,
        IMG_GLOBAL_NO,
        get_string(STR_GLOBAL_SAVE),
        IMG_GLOBAL_QUESTION,
        WARNING_TONE);

    SetLeftSoftkeyFunction(mmi_ph_editable_profile_save_changes, KEY_EVENT_UP);
    SetRightSoftkeyFunction(mmi_ph_editable_profile_reject_changes, KEY_EVENT_UP);

}


/*****************************************************************************
 * FUNCTION
 *  mmi_ph_editable_profile_reject_changes
 * DESCRIPTION
 *  It handles the Press of RSK(NO) on the save changes screen for the editable profile
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_ph_editable_profile_reject_changes(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    DeleteNHistory(1);
    GoBackHistory();
}


/*****************************************************************************
 * FUNCTION
 *  mmi_ph_editable_profile_save_changes
 * DESCRIPTION
 *  It invokes the storage into the NVRAM for the changes done in the profile struct (Browser ,MMS)
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_ph_editable_profile_save_changes(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    MMI_BOOL IsValidURL;

    IsValidURL = mmi_brw_validate_url((PU8) g_ph_cntx.profile_display_p->homepage_url);

    if (IsValidURL == MMI_TRUE)
    {
        if (g_ph_cntx.profile_index == g_ph_cntx.wap_actived_profile_index)
        {
            mmi_brw_set_connection_active_flag(E_FALSE);
        }
		
        if (g_ph_cntx.profile_module == PH_BROWSER_PROFILE)
        {
            mmi_ph_update_nvram_wap_profile();
        }
        else if (g_ph_cntx.profile_module == PH_MMS_PROFILE)
        {
            mmi_ph_update_nvram_mms_profile();
        }
    }
    else
    {
        DisplayPopup((PU8) GetString(STR_ID_BRW_INVALID_URL), IMG_GLOBAL_ERROR, 1, UI_POPUP_NOTIFYDURATION_TIME, ERROR_TONE);
    }
}


/*****************************************************************************
 * FUNCTION
 *  mmi_ph_entry_activate_selected_profile
 * DESCRIPTION
 *  It is the entry function for the activate profile confirmation screen
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_ph_entry_activate_selected_profile(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    DisplayConfirm(
        STR_GLOBAL_YES,
        IMG_GLOBAL_YES,
        STR_GLOBAL_NO,
        IMG_GLOBAL_NO,
        get_string(STR_ID_PROF_HDLR_ACTIVATE_PROFILE),
        IMG_GLOBAL_QUESTION,
        WARNING_TONE);

    SetLeftSoftkeyFunction(mmi_ph_activate_selected_profile, KEY_EVENT_UP);
    SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
}


/*****************************************************************************
 * FUNCTION
 *  mmi_ph_activate_selected_profile
 * DESCRIPTION
 *  It updates the current selected profile index as the activated proifle index
 *  & based on this index updates the activated profile struct.
 *  Done popup is shown on completion
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_ph_activate_selected_profile(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

⌨️ 快捷键说明

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