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

📄 jprofileuihandler.c

📁 MTK_MMI的部分源代码,从code中大致了解到MMI的执行流程
💻 C
📖 第 1 页 / 共 5 页
字号:
/*****************************************************************************
*  Copyright Statement:
*  --------------------
*  This software is protected by Copyright and the information contained
*  herein is confidential. The software may not be copied and the information
*  contained herein may not be used or disclosed except with the written
*  permission of MediaTek Inc. (C) 2005
*
*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
*
*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/

/*****************************************************************************
 *
 * Filename:
 * ---------
 * JProfileUIHandler.C
 *
 * Project:
 * --------
 *   MAUI
 *
 * Description:
 * ------------
 *   This is source file for UI handling for the profile handler
 *
 * Author:
 * -------
 * -------
 *
 *============================================================================
 *             HISTORY
 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
 *------------------------------------------------------------------------------
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 *------------------------------------------------------------------------------
 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
 *============================================================================
 ****************************************************************************/

#ifndef _JPROFILEUIHANDLER_C
#define _JPROFILEUIHANDLER_C

#include "MMI_features.h"

#if defined (JATAAYU_SUPPORT) && (defined (WAP_SUPPORT) || (defined (MMS_SUPPORT)))

#include "PixtelDataTypes.h"
#include "kal_release.h"
#include "stack_config.h"
#include "stack_common.h"
#include "stack_msgs.h"
#include "app_ltlcom.h" /* local/peer struct */
#include "ProtocolEvents.h"
#include "DebugInitDef.h"       /* Debug Info */
#include "wap_ps_struct.h"

#include "Ucs2prot.h"
#include "Unicodexdcl.h"
#include "GlobalDefs.h"
#include "KeyBrd.h"
#include "wgui_categories.h"
#include "wgui_categories_inputsenum.h"
#include "wgui_categories_inputs.h"
#include "wgui_inline_edit.h"

#include "SettingProfile.h"
#include "ServiceDefs.h"
#include "HistoryGprot.h"
#include "CommonScreens.h"

#include "DataAccount.h"

#include "JProfileHandlerTypes.h"
#include "JProfileHandlerProts.h"
#include "JProfileHandlerDefs.h"

#include "JProvWap.h"
#include "JProvProts.h"
#include "JBrowserMMITypes.h"   /* Added by Sandeep for connection active flag */
#include "JBrowserMMIDefs.h"    /* Added by Tk for string ID */

#include "custom_nvram_editor_data_item.h"

#include "NVRAMType.h"
#include "NVRAMEnum.h"
#include "NVRAMProt.h"

ph_context_struct g_ph_cntx;

static U8 g_ph_conn_index;
static U8 g_ph_done_flag;

#if defined (JATAAYU_SUPPORT) && defined (WAP_SUPPORT)
nvram_wap_profile_content_struct *g_ph_wap_profile_p = NULL;
nvram_wap_profile_name_array_struct *g_ph_wap_prof_name_arr_p = NULL;
nvram_wap_profile_content_struct *g_ph_activated_wap_profile = NULL;
#endif /* defined (JATAAYU_SUPPORT) && defined (WAP_SUPPORT) */ 

nvram_mms_profile_content_struct *g_ph_mms_profile_p = NULL;
nvram_mms_profile_content_struct *g_ph_activated_mms_profile = NULL;
nvram_mms_profile_name_array_struct *g_ph_mms_prof_name_arr_p = NULL;

extern void EntryDTCNTMain(void);
#if defined(MMS_SUPPORT)/*dilip*/
extern void mmi_jmms_set_profile(void);
#endif
extern void mmi_brw_set_connection_active_flag(JC_BOOLEAN);
extern MMI_BOOL mmi_brw_validate_url(U8 *url_p);
extern void jdd_MemSetActiveModuleID(ETaskID taskId);

extern U8 g_prov_pend_set;
U16 g_ph_title_img_id;

/*****************************************************************************
 * FUNCTION
 *  mmi_ph_deinit_profiles
 * DESCRIPTION
 *  This is the deinitialization routine,to free the memory  & reset values used by profile handler
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_ph_deinit_profiles(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (g_ph_wap_prof_name_arr_p != NULL)
    {
        jdd_MemFree(g_ph_wap_prof_name_arr_p);
        g_ph_wap_prof_name_arr_p = NULL;
    }
    if (g_ph_mms_prof_name_arr_p != NULL)
    {
        jdd_MemFree(g_ph_mms_prof_name_arr_p);
        g_ph_mms_prof_name_arr_p = NULL;
    }
    if (g_ph_cntx.profile_display_p != NULL)
    {
        jdd_MemFree(g_ph_cntx.profile_display_p);
        g_ph_cntx.profile_display_p = NULL;
    }

    if (g_ph_wap_profile_p != NULL)
    {
        jdd_MemFree(g_ph_wap_profile_p);
        g_ph_wap_profile_p = NULL;
    }
    if (g_ph_mms_profile_p != NULL)
    {
        jdd_MemFree(g_ph_mms_profile_p);
        g_ph_mms_profile_p = NULL;
    }
}


/*****************************************************************************
 * FUNCTION
 *  mmi_ph_init
 * DESCRIPTION
 *  This is the profile handler Initialization API
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_ph_init(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    S16 error;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    jdd_MemSetActiveModuleID(E_TASK_BROWSER_UI);
    if (g_ph_activated_wap_profile == NULL)
    {
        g_ph_activated_wap_profile =
            (nvram_wap_profile_content_struct*) jdd_MemAlloc(NVRAM_EF_WAP_PROFILE_CONTENT_SIZE, 1);
    }

    ReadValue(NVRAM_PH_ACTIVATED_WAP_PROFILE_INDEX, &g_ph_cntx.wap_actived_profile_index, DS_BYTE, &error);

    if (g_ph_cntx.wap_actived_profile_index == 0xFF)
    {
        g_ph_cntx.wap_actived_profile_index = 0x00;
        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.wap_actived_profile_index);
    if (g_ph_activated_mms_profile == NULL)
    {
        g_ph_activated_mms_profile =
            (nvram_mms_profile_content_struct*) jdd_MemAlloc(NVRAM_EF_MMS_PROFILE_CONTENT_SIZE, 1);
    }

    ReadValue(NVRAM_PH_ACTIVATED_MMS_PROFILE_INDEX, &g_ph_cntx.mms_actived_profile_index, DS_BYTE, &error);

    if (g_ph_cntx.mms_actived_profile_index == 0xFF)
    {
        g_ph_cntx.mms_actived_profile_index = 0x00;
        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.mms_actived_profile_index);
    /* Set Highlight handlers */
    SetHiliteHandler(MENU_ID_PH_SELECT_PROFILE_ACTIVATE, mmi_ph_activate_profile_highlight_hdlr);
    SetHiliteHandler(MENU_ID_PH_SELECT_PROFILE_EDIT, mmi_ph_edit_profile_highlight_hdlr);
}


/*****************************************************************************
 * FUNCTION
 *  mmi_ph_pre_entry_show_profile_list_menu
 * DESCRIPTION
 *  It is an pre entry function for showing profile name list.
 *  This makes the global profile name data ready to be displayed
 * PARAMETERS
 *  profile     [IN]        Profile Type (Browser or MMS)
 * RETURNS
 *  void
 *****************************************************************************/
#if defined MMS_SUPPORT
extern U16 mmi_jmms_get_profile_title_icon(void);
#endif
void mmi_ph_pre_entry_show_profile_list_menu(ph_profile_enum profile)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
	if(profile == PH_MMS_PROFILE || profile == PH_MMS_PROV_PROFILE)
	{
#if defined MMS_SUPPORT
		g_ph_title_img_id = mmi_jmms_get_profile_title_icon();
#endif
	}
	else
	{
		g_ph_title_img_id = SERVICES_WAP_MENU_ID;
	}
    if (profile == PH_BROWSER_PROFILE)
    {
        g_ph_cntx.profile_module = PH_BROWSER_PROFILE;
        mmi_ph_get_brw_profile_name_list();

    }
    else if (profile == PH_MMS_PROFILE)
    {
        g_ph_cntx.profile_module = PH_MMS_PROFILE;
        mmi_ph_get_mms_profile_name_list();
    }
    else if (profile == PH_BROWSER_PROV_PROFILE)
    {
        g_ph_cntx.profile_module = PH_BROWSER_PROV_PROFILE;
        mmi_ph_get_brw_profile_name_list();
    }
    else if (profile == PH_MMS_PROV_PROFILE)
    {
        g_ph_cntx.profile_module = PH_MMS_PROV_PROFILE;
        mmi_ph_get_mms_profile_name_list();
    }
    mmi_ph_entry_show_profile_list_menu();
}


/*****************************************************************************
 * FUNCTION
 *  mmi_ph_entry_show_profile_list_menu
 * DESCRIPTION
 *  Entry function to show profile name list
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_ph_entry_show_profile_list_menu(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    U8 *gui_buffer_p = NULL;
    S32 activated_index = 0;

⌨️ 快捷键说明

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