JProfileUIHandler.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:110k
源码类别:
MTK
开发平台:
C/C++
- /*****************************************************************************
- * 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;
- U16 activated_profile_image[NVRAM_WAP_PROFILE_MAX] = {0, };
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_prov_pend_set = 0;
- activated_index = mmi_ph_get_activated_profile_index();
- activated_profile_image[activated_index] = IMG_ID_PROF_HDLR_SET_ACTIVATED_PROFILE;
- EntryNewScreen(SCR_ID_PROF_HDLR_PROF_LIST, NULL, mmi_ph_entry_show_profile_list_menu, NULL);
- gui_buffer_p = GetCurrGuiBuffer(SCR_ID_PROF_HDLR_PROF_LIST);
- RegisterHighlightHandler(mmi_ph_highlight_select_profile);
- mmi_ph_get_profile_name_list();
- ShowCategory53Screen(
- STR_ID_PROF_HDLR_SELECT_PROF_CAPTION,
- // GetRootTitleIcon(SERVICES_WAP_MENU_ID),
- GetRootTitleIcon(g_ph_title_img_id),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- NVRAM_WAP_PROFILE_MAX,
- (U8 **) subMenuDataPtrs,
- (PU16) activated_profile_image,
- 0,
- 0,
- activated_index,
- gui_buffer_p);
- /* Register function for left soft key */
- if ((g_ph_cntx.profile_module == PH_BROWSER_PROV_PROFILE) || (g_ph_cntx.profile_module == PH_MMS_PROV_PROFILE))/*This will handle the provising setting*/
- {
- SetLeftSoftkeyFunction(mmi_prov_get_dataaccount_data, KEY_EVENT_UP);
- SetKeyHandler(mmi_prov_get_dataaccount_data, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- /* Register function for right soft key */
- SetRightSoftkeyFunction(mmi_prov_handle_back, KEY_EVENT_UP);
- SetKeyHandler(mmi_prov_handle_back, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_prov_handle_cancel, KEY_END, KEY_EVENT_DOWN);
- }
- else
- {
- SetLeftSoftkeyFunction(mmi_ph_entry_select_editable_profile, KEY_EVENT_UP);
- SetKeyHandler(mmi_ph_entry_select_editable_profile, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- /* Register function for right soft key */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_entry_select_editable_profile
- * DESCRIPTION
- * This is entry function for the screen showing menu items (Activate ,Edit profile )
- * for any selected profile
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_entry_select_editable_profile(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *gui_buffer_p; /* Buffer holding history data */
- S32 num_of_item; /* Stores no of children in the submenu */
- S8 profile_name_string[(NVRAM_WAP_PROFILE_NAME_LEN + 1) * ENCODING_LENGTH];
- U32 count;
- U16 nStrItemList[2];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_PROF_HDLR_SELECTED_PROFILE, NULL, mmi_ph_entry_select_editable_profile, NULL);
- gui_buffer_p = GetCurrGuiBuffer(SCR_ID_PROF_HDLR_SELECTED_PROFILE);
- num_of_item = GetNumOfChild(MENU_ID_PH_SELECT_PROFILE);
- GetSequenceStringIds(MENU_ID_PH_SELECT_PROFILE, nStrItemList);
- SetParentHandler(MENU_ID_PH_SELECT_PROFILE);
- 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);
- }
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- if (g_ph_cntx.profile_module == PH_BROWSER_PROFILE)
- {
- if (g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[g_ph_cntx.profile_index].dcs == PH_DCS_ASCII)
- {
- AnsiiToUnicodeString(
- (S8*) profile_name_string,
- (S8*) g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[g_ph_cntx.profile_index].profile_name);
- }
- else if (g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[g_ph_cntx.profile_index].dcs == PH_DCS_UCS)
- {
- UCS2Strcpy(
- (S8*) profile_name_string,
- (S8*) (g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[g_ph_cntx.profile_index].profile_name));
- }
- }
- else if (g_ph_cntx.profile_module == PH_MMS_PROFILE)
- {
- if (g_ph_mms_prof_name_arr_p->nvram_mms_profile_name_array[g_ph_cntx.profile_index].dcs == PH_DCS_ASCII)
- {
- AnsiiToUnicodeString(
- (S8*) profile_name_string,
- (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*) profile_name_string,
- (S8*) (g_ph_mms_prof_name_arr_p->nvram_mms_profile_name_array[g_ph_cntx.profile_index].profile_name));
- }
- }
- ShowCategory353Screen(
- (U8*) (profile_name_string),
- //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*) gIndexIconsImageList,
- NULL,
- 0,
- 0,
- gui_buffer_p);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_activate_profile_highlight_hdlr
- * DESCRIPTION
- * It is the highlight handler for the MENU_ID_PH_SELECT_PROFILE_ACTIVATE menu item
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_activate_profile_highlight_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(mmi_ph_entry_activate_selected_profile, KEY_EVENT_UP);
- /* SetKeyHandler(mmi_ph_entry_activate_selected_profile,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_edit_profile_highlight_hdlr
- * DESCRIPTION
- * * It is the highlight handler for the MENU_ID_PH_SELECT_PROFILE_EDIT menu item
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_edit_profile_highlight_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(mmi_ph_pre_entry_edit_selected_profile, KEY_EVENT_UP);
- SetKeyHandler(mmi_ph_pre_entry_edit_selected_profile, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_highlight_select_profile
- * DESCRIPTION
- * This gets the highlighted index and stores it into global profile index
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_highlight_select_profile(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_ph_cntx.profile_index = (U8) index;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_pre_entry_edit_selected_profile
- * DESCRIPTION
- * It is the pre entry function for the edit profile screen,in this the profiel content data is
- * extracted from the NVRAM & data account info is requested ,on the response of data account
- * edit profile entry function is called
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_pre_entry_edit_selected_profile(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_ph_done_flag = 0x00;
- mmi_ph_get_selected_profile_content_data(g_ph_cntx.profile_index);
- DataAccountReadyCheck(mmi_ph_handle_get_data_account_name);
- /* mmi_ph_handle_get_data_account_name(); */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_entry_edit_selected_profile
- * DESCRIPTION
- * It is the entry function for the edit profile screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_entry_edit_selected_profile(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *input_buffer_p; /* added for inline edit history */
- U8 *gui_buffer_p; /* Buffer holding history data */
- U16 input_buffer_size;
- U16 EditProfileIconList[MAX_INLINE_ITEM_EDIT_PROFILE_LIST] = {IMG_GLOBAL_L1, 0, IMG_GLOBAL_L2, 0,
- IMG_GLOBAL_L3, 0, IMG_GLOBAL_L4, 0,
- IMG_GLOBAL_L5, 0, IMG_GLOBAL_L6, 0
- };
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_PROF_HDLR_EDIT_PROFILE, mmi_ph_exit_edit_selected_profile, NULL, NULL);
- InitializeCategory57Screen();
- gui_buffer_p = GetCurrGuiBuffer(SCR_ID_PROF_HDLR_EDIT_PROFILE);
- input_buffer_p = GetCurrNInputBuffer(SCR_ID_PROF_HDLR_EDIT_PROFILE, &input_buffer_size); /* added for inline edit history */
- mmi_ph_selected_profile_fill_inline_struct();
- if (input_buffer_p != NULL)
- {
- SetCategory57Data(wgui_inline_items, MAX_INLINE_ITEM_EDIT_PROFILE_LIST, input_buffer_p);
- }
- if ((GetInlineDoneFlag(gui_buffer_p) == 0) && (g_ph_done_flag == 0x01))
- {
- SetInlineDoneFlag(gui_buffer_p);
- }
- RegisterHighlightHandler(mmi_ph_highlight_inline_item);
- ShowCategory57Screen(
- STR_ID_BRW_EDIT_PROFILE,
- //GetRootTitleIcon(SERVICES_WAP_MENU_ID), /* modified by tk */
- GetRootTitleIcon(g_ph_title_img_id),
- STR_GLOBAL_EDIT,
- NULL,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- MAX_INLINE_ITEM_EDIT_PROFILE_LIST,
- EditProfileIconList,
- wgui_inline_items,
- 0,
- gui_buffer_p);
- SetCategory57RightSoftkeyFunctions(mmi_ph_save_selected_profile_changes, GoBackHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_exit_edit_selected_profile
- * DESCRIPTION
- * exit handler for edit profile screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_exit_edit_selected_profile(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history h;
- U16 input_buffer_size;
- S16 nHistory = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- h.scrnID = SCR_ID_PROF_HDLR_EDIT_PROFILE;
- CloseCategory57Screen();
- h.entryFuncPtr = mmi_ph_entry_edit_selected_profile;
- pfnUnicodeStrcpy((S8*) h.inputBuffer, (S8*) & nHistory);
- GetCategory57History(h.guiBuffer);
- input_buffer_size = (U16) GetCategory57DataSize();
- GetCategory57Data((U8*) h.inputBuffer);
- AddNHistory(h, input_buffer_size);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_highlight_inline_item
- * DESCRIPTION
- * exit handler for edit profile screen
- * PARAMETERS
- * index [IN] IN this is the index of the inline item in edit profile screen
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_highlight_inline_item(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((index == PH_PROFILE_DATA_ACCOUNT))
- {
- ChangeLeftSoftkey(STR_GLOBAL_SELECT, NULL);
- SetLeftSoftkeyFunction(mmi_ph_prof_list_data_acct, KEY_EVENT_UP);
- }
- else if ((index == PH_PROFILE_CONN_TYPE))
- {
- ChangeLeftSoftkey(STR_GLOBAL_SELECT, NULL);
- SetLeftSoftkeyFunction(mmi_ph_show_connection_type_options, KEY_EVENT_UP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_prof_list_data_acct
- * DESCRIPTION
- * LSK handler of Data Account item in Profile Setting inline editor screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_prof_list_data_acct(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((g_ph_cntx.profile_module == PH_MMS_PROFILE) || (g_ph_cntx.profile_module == PH_MMS_PROV_PROFILE))
- {
- mmi_dtcnt_select_account(
- mmi_ph_prof_callback,
- g_ph_title_img_id,
- DATA_ACCOUNT_BEARER_GPRS);
- }
- else
- {
- mmi_dtcnt_select_account(
- mmi_ph_prof_callback,
- g_ph_title_img_id,
- DATA_ACCOUNT_BEARER_GPRS | DATA_ACCOUNT_BEARER_CSD);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_prof_callback
- * DESCRIPTION
- *
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_prof_callback(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_ph_cntx.profile_display_p == NULL)
- {
- g_ph_cntx.profile_display_p =
- (ph_show_editable_profile_struct*) jdd_MemAlloc(sizeof(ph_show_editable_profile_struct), 1);
- }
- g_ph_cntx.profile_display_p->data_account = (U8) index;
- if ((g_ph_cntx.profile_module == PH_BROWSER_PROV_PROFILE) || (g_ph_cntx.profile_module == PH_MMS_PROV_PROFILE))
- {
- ph_data_account_enum data_account;
- data_account = mmi_ph_check_data_account_type(g_ph_cntx.profile_display_p->data_account);
- if (data_account == PH_DATA_ACCOUNT_CSD)
- {
- mmi_prov_prof_save_csd_data_acct();
- }
- else if (data_account == PH_DATA_ACCOUNT_GPRS)
- {
- mmi_prov_prof_save_gprs_data_acct();
- }
- }
- else
- {
- if (g_ph_cntx.profile_module == PH_BROWSER_PROFILE)
- {
- g_ph_wap_profile_p->data_account = g_ph_cntx.profile_display_p->data_account;
- mmi_dtcnt_get_account_name(
- g_ph_cntx.profile_display_p->data_account,
- (S8*) g_ph_cntx.profile_display_p->DataAccountName,
- MAX_DATA_ACCOUNT_NAME_LEN);
- g_ph_done_flag = 0x01;
- DeleteNHistory(1);
- GoBackHistory();
- }
- else if (g_ph_cntx.profile_module == PH_MMS_PROFILE)
- {
- g_ph_mms_profile_p->data_account = g_ph_cntx.profile_display_p->data_account;
- mmi_dtcnt_get_account_name(
- g_ph_cntx.profile_display_p->data_account,
- (S8*) g_ph_cntx.profile_display_p->DataAccountName,
- MAX_DATA_ACCOUNT_NAME_LEN);
- g_ph_done_flag = 0x01;
- GoBackHistory();
- }
- /* mmi_dtcnt_get_account_name(
- g_ph_cntx.profile_display_p->data_account,
- (S8*) g_ph_cntx.profile_display_p->DataAccountName,
- MAX_DATA_ACCOUNT_NAME_LEN);
- g_ph_done_flag = 0x01;
- DeleteNHistory(1);
- GoBackHistory();*/
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_selected_profile_fill_inline_struct
- * DESCRIPTION
- * This API handles the inline items in the edit profile screen ,like data account,username ,password,conn type.....
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_selected_profile_fill_inline_struct(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 buffer_size = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_ph_cntx.profile_display_p == NULL)
- {
- g_ph_cntx.profile_display_p =
- (ph_show_editable_profile_struct*) jdd_MemAlloc(sizeof(ph_show_editable_profile_struct), 1);
- }
- SetInlineItemActivation((wgui_inline_items + PH_PROFILE_NAME), KEY_LSK, KEY_EVENT_UP);
- SetInlineItemActivation((wgui_inline_items + PH_PROFILE_HOMEPAGE), KEY_LSK, KEY_EVENT_UP);
- SetInlineItemActivation((wgui_inline_items + PH_PROFILE_DATA_ACCOUNT), INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemActivation((wgui_inline_items + PH_PROFILE_CONN_TYPE), INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemActivation((wgui_inline_items + PH_PROFILE_USER_NAME), KEY_LSK, KEY_EVENT_UP);
- SetInlineItemActivation((wgui_inline_items + PH_PROFILE_USER_PASSWORD), KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption((wgui_inline_items + PH_PROFILE_NAME_STR), (U8*) GetString(STR_ID_PROF_HDLR_RENAME_PROFILE));
- if (g_ph_cntx.profile_module == PH_BROWSER_PROFILE)
- {
- SetInlineItemCaption(
- (wgui_inline_items + PH_PROFILE_HOMEPAGE_STR),
- (U8*) GetString(STR_ID_PROF_HDLR_HOMEPAGE));
- }
- else if (g_ph_cntx.profile_module == PH_MMS_PROFILE)
- {
- SetInlineItemCaption(
- (wgui_inline_items + PH_PROFILE_HOMEPAGE_STR),
- (U8*) GetString(STR_ID_PROF_HDLR_MMSC_URL));
- }
- SetInlineItemCaption(
- (wgui_inline_items + PH_PROFILE_DATA_ACCOUNT_STR),
- (U8*) GetString(STR_ID_PROF_HDLR_DATA_ACCOUNT));
- SetInlineItemCaption((wgui_inline_items + PH_PROFILE_CONN_TYPE_STR), (U8*) GetString(STR_ID_PROF_HDLR_CONN_TYPE));
- SetInlineItemCaption((wgui_inline_items + PH_PROFILE_USER_NAME_STR), (U8*) GetString(STR_ID_PROF_HDLR_USER_NAME));
- SetInlineItemCaption(
- (wgui_inline_items + PH_PROFILE_USER_PASSWORD_STR),
- (U8*) GetString(STR_ID_PROF_HDLR_PASSWORD));
- SetInlineItemDisplayOnly(
- (wgui_inline_items + PH_PROFILE_DATA_ACCOUNT),
- (U8*) g_ph_cntx.profile_display_p->DataAccountName);
- if (g_ph_cntx.profile_module == PH_BROWSER_PROFILE)
- {
- /* profile connection type */
- 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))
- {
- SetInlineItemDisplayOnly(
- (wgui_inline_items + PH_PROFILE_CONN_TYPE),
- (U8*) GetString(STR_ID_PROF_HDLR_CONN_TYPE_CONNECTION));
- }
- else if (g_ph_wap_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_wap_prof_name_arr_p->nvram_wap_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_wap_prof_name_arr_p->nvram_wap_profile_name_array[g_ph_cntx.profile_index].profile_name));
- }
- else if (g_ph_wap_prof_name_arr_p->nvram_wap_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_wap_prof_name_arr_p->nvram_wap_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 homepage url inline item */
- buffer_size = NVRAM_WAP_PROFILE_HOMEPAGE_URL_LEN;
- AnsiiToUnicodeString(
- (S8*) g_ph_cntx.profile_display_p->homepage_url,
- (S8*) (g_ph_wap_profile_p->homepage_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_WAP_PROFILE_USERNAME_LEN;
- AnsiiToUnicodeString((S8*) g_ph_cntx.profile_display_p->username, (S8*) (g_ph_wap_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_WAP_PROFILE_PASSWORD_LEN;
- AnsiiToUnicodeString((S8*) g_ph_cntx.profile_display_p->password, (S8*) (g_ph_wap_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);
- }
- 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 */
- /*----------------------------------------------------------------*/
- 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 == PH_MMS_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_mms_profile_p->conn_type = PH_CONN_TYPE_CONNECTION_OREINTED_SECURE;
- }
- else
- {
- g_ph_mms_profile_p->conn_type = PH_CONN_TYPE_CONNECTION_OREINTED;
- }
- #else /* defined (WAP_SEC_SUPPORT) && defined (JATAAYU_SUPPORT) */
- g_ph_mms_profile_p->conn_type = PH_CONN_TYPE_CONNECTION_OREINTED;
- #endif /* defined (WAP_SEC_SUPPORT) && defined (JATAAYU_SUPPORT) */
- }
- }
- else if (index == PH_MENU_HTTP)
- {
- if (g_ph_cntx.profile_module == PH_BROWSER_PROFILE)
- {
- g_ph_wap_profile_p->conn_type = PH_CONN_TYPE_HTTP;
- g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[g_ph_cntx.profile_index].conn_type =
- PH_CONN_TYPE_HTTP;
- }
- else if (g_ph_cntx.profile_module == PH_MMS_PROFILE)
- {
- g_ph_mms_profile_p->conn_type = PH_CONN_TYPE_HTTP;
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_save_connection_type_changes
- * DESCRIPTION
- * This API saves the changes done with the connection type like port & IP
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_save_connection_type_changes(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 ip_value[4];
- U32 ip_sum = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_ph_done_flag = 0x01; /* Tk added for Handling the Done RSK label */
- ip_value[0] = (U8) gui_atoi((UI_string_type) g_ph_cntx.profile_display_p->IP1);
- ip_value[1] = (U8) gui_atoi((UI_string_type) g_ph_cntx.profile_display_p->IP2);
- ip_value[2] = (U8) gui_atoi((UI_string_type) g_ph_cntx.profile_display_p->IP3);
- ip_value[3] = (U8) gui_atoi((UI_string_type) g_ph_cntx.profile_display_p->IP4);
- ip_sum = ip_value[0] + ip_value[1] + ip_value[2] + ip_value[3];
- if ((ip_sum == 0x00) && ((g_ph_conn_index == PH_MENU_CONNECTION_OREINTED)))
- {
- DisplayPopup(
- (PU8) GetString(STR_ID_PROF_HDLR_INVALID_IP),
- IMG_GLOBAL_ERROR,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- ERROR_TONE);
- }
- else
- {
- U32 port = 0;
- port = (U32) gui_atoi((UI_string_type) g_ph_cntx.profile_display_p->proxy_port);
- if (!UCS2Strlen((S8*) g_ph_cntx.profile_display_p->proxy_port))
- {
- DisplayPopup(
- (PU8) GetString(STR_ID_PROF_HDLR_INVALID_INPUT),
- IMG_GLOBAL_ERROR,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- ERROR_TONE);
- }
- else if (port >= PH_USHORT_MAX)
- {
- DisplayPopup(
- (PU8) GetString(STR_ID_PROF_HDLR_INVALID_INPUT),
- IMG_GLOBAL_ERROR,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- ERROR_TONE);
- }
- else
- {
- if (g_ph_cntx.profile_module == PH_BROWSER_PROFILE)
- {
- g_ph_wap_profile_p->proxy_ip[0] = ip_value[0];
- g_ph_wap_profile_p->proxy_ip[1] = ip_value[1];
- g_ph_wap_profile_p->proxy_ip[2] = ip_value[2];
- g_ph_wap_profile_p->proxy_ip[3] = ip_value[3];
- g_ph_wap_profile_p->proxy_port = (U16) port;
- mmi_ph_update_connection_type();
- GoBackHistory();
- }
- else if (g_ph_cntx.profile_module == PH_MMS_PROFILE)
- {
- g_ph_mms_profile_p->proxy_ip[0] = ip_value[0];
- g_ph_mms_profile_p->proxy_ip[1] = ip_value[1];
- g_ph_mms_profile_p->proxy_ip[2] = ip_value[2];
- g_ph_mms_profile_p->proxy_ip[3] = ip_value[3];
- g_ph_mms_profile_p->proxy_port = (U16) port;
- mmi_ph_update_connection_type();
- GoBackHistory();
- }
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_exit_edit_connection_type_details
- * DESCRIPTION
- * It is te exit handler for the edit connection type screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_exit_edit_connection_type_details(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history h;
- U16 input_buffer_size;
- S16 nHistory = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- h.scrnID = SCR_ID_PROF_HDLR_EDIT_CONN_TYPE;
- CloseCategory57Screen();
- h.entryFuncPtr = mmi_ph_entry_edit_connection_type_details;
- pfnUnicodeStrcpy((S8*) h.inputBuffer, (S8*) & nHistory);
- GetCategory57History(h.guiBuffer);
- input_buffer_size = (U16) GetCategory57DataSize();
- GetCategory57Data((U8*) h.inputBuffer);
- AddNHistory(h, input_buffer_size);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_edit_conn_type_fill_inline_struct
- * DESCRIPTION
- * This API handles the connection type inline edit screen,containing inline items like IP ,proxy port
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_edit_conn_type_fill_inline_struct(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 buffer_size = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_ph_cntx.profile_display_p == NULL)
- {
- g_ph_cntx.profile_display_p =
- (ph_show_editable_profile_struct*) jdd_MemAlloc(sizeof(ph_show_editable_profile_struct), 1);
- }
- if (g_ph_conn_index == PH_MENU_HTTP)
- {
- SetInlineItemActivation(
- (wgui_inline_items + PH_CONN_TYPE_IP_ADDRESS),
- INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
- 0);
- SetInlineItemCaption(
- (wgui_inline_items + PH_CONN_TYPE_IP_ADDRESS_STR),
- (U8*) GetString(STR_ID_PROF_HDLR_PROXY_ADDRESS));
- SetInlineItemActivation((wgui_inline_items + PH_CONN_TYPE_SECURITY), INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemCaption((wgui_inline_items + PH_CONN_TYPE_SECURITY_STR), (U8*) GetString(STR_ID_PROF_HDLR_PORT));
- /* dara NOTE ..for http ..its port in place of security */
- buffer_size = 6;
- SetInlineItemTextEdit(
- (wgui_inline_items + PH_CONN_TYPE_SECURITY),
- (U8*) (g_ph_cntx.profile_display_p->proxy_port),
- buffer_size,
- INPUT_TYPE_NUMERIC);
- if (g_ph_cntx.profile_module == PH_BROWSER_PROFILE)
- {
- gui_itoa((S32) g_ph_wap_profile_p->proxy_port, (U16*) g_ph_cntx.profile_display_p->proxy_port, 10);
- }
- else if (g_ph_cntx.profile_module == PH_MMS_PROFILE)
- {
- gui_itoa((S32) g_ph_mms_profile_p->proxy_port, (U16*) g_ph_cntx.profile_display_p->proxy_port, 10);
- }
- }
- else
- {
- SetInlineItemActivation(
- (wgui_inline_items + PH_CONN_TYPE_IP_ADDRESS),
- INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
- 0);
- SetInlineItemCaption(
- (wgui_inline_items + PH_CONN_TYPE_IP_ADDRESS_STR),
- (U8*) GetString(STR_ID_PROF_HDLR_IP_ADDRESS));
- #if defined (WAP_SEC_SUPPORT) && defined (JATAAYU_SUPPORT)
- SetInlineItemActivation((wgui_inline_items + PH_CONN_TYPE_SECURITY), INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemCaption(
- (wgui_inline_items + PH_CONN_TYPE_SECURITY_STR),
- (U8*) GetString(STR_ID_PROF_HDLR_SECURITY));
- g_ph_cntx.profile_display_p->security_option[0] = (U8*) GetString(STR_ID_PROF_HDLR_OFF);
- g_ph_cntx.profile_display_p->security_option[1] = (U8*) GetString(STR_ID_PROF_HDLR_ON);
- SetInlineItemSelect(
- (wgui_inline_items + CONN_TYPE_SECURITY),
- (S32) 0x02,
- (U8 **) g_ph_cntx.profile_display_p->security_option,
- (S32*) (&(g_ph_cntx.profile_display_p->security_opt_index)));
- #endif /* defined (WAP_SEC_SUPPORT) && defined (JATAAYU_SUPPORT) */
- if (g_ph_cntx.profile_module == PH_BROWSER_PROFILE)
- {
- gui_itoa((S32) g_ph_wap_profile_p->proxy_port, (U16*) g_ph_cntx.profile_display_p->proxy_port, 10);
- }
- else if (g_ph_cntx.profile_module == PH_MMS_PROFILE)
- {
- gui_itoa((S32) g_ph_mms_profile_p->proxy_port, (U16*) g_ph_cntx.profile_display_p->proxy_port, 10);
- }
- }
- if (g_ph_cntx.profile_module == PH_BROWSER_PROFILE)
- {
- ReturnThreeDigitString(g_ph_cntx.profile_display_p->IP1, (U8) g_ph_wap_profile_p->proxy_ip[0]);
- ReturnThreeDigitString(g_ph_cntx.profile_display_p->IP2, (U8) g_ph_wap_profile_p->proxy_ip[1]);
- ReturnThreeDigitString(g_ph_cntx.profile_display_p->IP3, (U8) g_ph_wap_profile_p->proxy_ip[2]);
- ReturnThreeDigitString(g_ph_cntx.profile_display_p->IP4, (U8) g_ph_wap_profile_p->proxy_ip[3]);
- SetInlineItemIP4(
- (wgui_inline_items + PH_CONN_TYPE_IP_ADDRESS),
- (U8*) g_ph_cntx.profile_display_p->IP1,
- (U8*) g_ph_cntx.profile_display_p->IP2,
- (U8*) g_ph_cntx.profile_display_p->IP3,
- (U8*) g_ph_cntx.profile_display_p->IP4,
- PreparedIPAddressString);
- }
- else if (g_ph_cntx.profile_module == PH_MMS_PROFILE)
- {
- ReturnThreeDigitString(g_ph_cntx.profile_display_p->IP1, (U8) g_ph_mms_profile_p->proxy_ip[0]);
- ReturnThreeDigitString(g_ph_cntx.profile_display_p->IP2, (U8) g_ph_mms_profile_p->proxy_ip[1]);
- ReturnThreeDigitString(g_ph_cntx.profile_display_p->IP3, (U8) g_ph_mms_profile_p->proxy_ip[2]);
- ReturnThreeDigitString(g_ph_cntx.profile_display_p->IP4, (U8) g_ph_mms_profile_p->proxy_ip[3]);
- SetInlineItemIP4(
- (wgui_inline_items + PH_CONN_TYPE_IP_ADDRESS),
- (U8*) g_ph_cntx.profile_display_p->IP1,
- (U8*) g_ph_cntx.profile_display_p->IP2,
- (U8*) g_ph_cntx.profile_display_p->IP3,
- (U8*) g_ph_cntx.profile_display_p->IP4,
- PreparedIPAddressString);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_get_selected_profile_content_data
- * DESCRIPTION
- * This gets the content data for the profile index selected()
- * its general for browser & MMS profiles
- * PARAMETERS
- * profile_index [IN] Profile index
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_get_selected_profile_content_data(U8 profile_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_ph_cntx.profile_module == PH_BROWSER_PROFILE)
- {
- if (g_ph_wap_profile_p == NULL)
- {
- g_ph_wap_profile_p =
- (nvram_wap_profile_content_struct*) jdd_MemAlloc(NVRAM_EF_WAP_PROFILE_CONTENT_SIZE, 1);
- }
- }
- else if (g_ph_cntx.profile_module == PH_MMS_PROFILE)
- {
- if (g_ph_mms_profile_p == NULL)
- {
- g_ph_mms_profile_p =
- (nvram_mms_profile_content_struct*) jdd_MemAlloc(NVRAM_EF_MMS_PROFILE_CONTENT_SIZE, 1);
- }
- }
- mmi_ph_get_profile_nvram_content_data(profile_index);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_get_activated_profile_index
- * DESCRIPTION
- * THis API returns the activated profile index
- * PARAMETERS
- * void
- * RETURNS
- * U8 activated profile index
- *****************************************************************************/
- U8 mmi_ph_get_activated_profile_index(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((g_ph_cntx.profile_module == PH_BROWSER_PROFILE) || (g_ph_cntx.profile_module == PH_BROWSER_PROV_PROFILE)) /* added by tk */
- {
- ReadValue(NVRAM_PH_ACTIVATED_WAP_PROFILE_INDEX, &g_ph_cntx.wap_actived_profile_index, DS_BYTE, &error);
- return g_ph_cntx.wap_actived_profile_index;
- }
- else if ((g_ph_cntx.profile_module == PH_MMS_PROFILE) || (g_ph_cntx.profile_module == PH_MMS_PROV_PROFILE)) /* added by tk */
- {
- ReadValue(NVRAM_PH_ACTIVATED_MMS_PROFILE_INDEX, &g_ph_cntx.mms_actived_profile_index, DS_BYTE, &error);
- return g_ph_cntx.mms_actived_profile_index;
- }
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_check_data_account_type
- * DESCRIPTION
- * It checks the data account type(CSD or GPRS) for the index passed
- * PARAMETERS
- * account_index [IN] Data account index
- * RETURNS
- * void
- *****************************************************************************/
- ph_data_account_enum mmi_ph_check_data_account_type(U8 account_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (custom_get_csd_profile_num() > account_index)
- {
- return PH_DATA_ACCOUNT_CSD;
- }
- else if ((custom_get_gprs_profile_num() + custom_get_csd_profile_num()) >= account_index)
- {
- return PH_DATA_ACCOUNT_GPRS;
- }
- else
- {
- return PH_DATA_ACCOUNT_INVALID;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_get_csd_account_name_req
- * DESCRIPTION
- * It send PRT_MMI_CC_GET_CSD_PROFILE_REQ to the L4 to get the csd data account for the index
- * PARAMETERS
- * item_num [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_get_csd_account_name_req(U8 item_num)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_cc_get_csd_profile_req_struct *my_msg_p;
- MYQUEUE Message;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- my_msg_p = (mmi_cc_get_csd_profile_req_struct*) OslConstructDataPtr(sizeof(mmi_cc_get_csd_profile_req_struct));
- my_msg_p->prof_id = item_num;
- SetProtocolEventHandler(mmi_ph_get_csd_account_name_rsp, PRT_MMI_CC_GET_CSD_PROFILE_RSP);
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_L4C;
- Message.oslMsgId = PRT_MMI_CC_GET_CSD_PROFILE_REQ;
- Message.oslDataPtr = (oslParaType*) my_msg_p;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_get_csd_account_name_rsp
- * DESCRIPTION
- * It handles the PRT_MMI_CC_GET_CSD_PROFILE_RSP from L4 to extract csd data account info
- * PARAMETERS
- * info [IN] Its the pointer to csd data received from L4
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_get_csd_account_name_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_cc_get_csd_profile_rsp_struct *local_p;
- U32 i = 0;
- S8 account_name_str[30 * ENCODING_LENGTH];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- local_p = (mmi_cc_get_csd_profile_rsp_struct*) info;
- SetDynaDataAccountName(account_name_str, g_ph_cntx.ph_dataaccount_index);
- if (local_p->name.name_dcs == DATA_ACCOUNT_UCS)
- {
- i = 0;
- if (local_p->name.name_length == 0)
- {
- pfnUnicodeStrcpy((PS8) g_ph_cntx.profile_display_p->DataAccountName, (PS8) account_name_str);
- }
- else
- {
- while (i != local_p->name.name_length)
- {
- g_ph_cntx.profile_display_p->DataAccountName[i] = local_p->name.name[i + 1];
- g_ph_cntx.profile_display_p->DataAccountName[i + 1] = local_p->name.name[i];
- i += 2;
- }
- g_ph_cntx.profile_display_p->DataAccountName[local_p->name.name_length] = 0x00;
- g_ph_cntx.profile_display_p->DataAccountName[local_p->name.name_length + 1] = 0x00;
- }
- }
- else if (local_p->name.name_dcs == DATA_ACCOUNT_ASCII)
- {
- if (local_p->name.name_length == 0)
- {
- pfnUnicodeStrcpy((PS8) g_ph_cntx.profile_display_p->DataAccountName, (PS8) account_name_str);
- }
- else
- {
- AnsiiNToUnicodeString(
- (PS8) g_ph_cntx.profile_display_p->DataAccountName,
- (PS8) local_p->name.name,
- (local_p->name.name_length + 1) * ENCODING_LENGTH);
- }
- }
- mmi_ph_entry_edit_selected_profile();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_get_gprs_account_name_req
- * DESCRIPTION
- * It send PRT_MMI_PS_GET_GPRS_DATA_ACCOUNT_REQ to the L4 to get the csd data account for the index
- * PARAMETERS
- * item_num [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_get_gprs_account_name_req(U8 item_num)
- {
- #ifdef __GPRS_MODE__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_ps_get_gprs_data_account_req_struct *my_msg_p;
- MYQUEUE Message;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- my_msg_p =
- (mmi_ps_get_gprs_data_account_req_struct*)
- OslConstructDataPtr(sizeof(mmi_ps_get_gprs_data_account_req_struct));
- my_msg_p->profile_id = item_num + 1 - MAX_DATA_ACCOUNT_GSM_LIMIT;
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_L4C;
- Message.oslMsgId = PRT_MMI_PS_GET_GPRS_DATA_ACCOUNT_REQ;
- Message.oslDataPtr = (oslParaType*) my_msg_p;
- Message.oslPeerBuffPtr = NULL;
- SetProtocolEventHandler(mmi_ph_get_gprs_account_name_rsp, PRT_MMI_PS_GET_GPRS_DATA_ACCOUNT_RSP);
- OslMsgSendExtQueue(&Message);
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "**** JProfileUIHandler.c ******GPRS Data Account request sent to L4 n"));
- #endif /* __GPRS_MODE__ */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_get_gprs_account_name_rsp
- * DESCRIPTION
- * It handles the PRT_MMI_PS_GET_GPRS_DATA_ACCOUNT_RSP from L4 to extract GPRS data account info
- * PARAMETERS
- * info [IN] Its the pointer to gprs data received from L4
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_get_gprs_account_name_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- #ifdef __GPRS_MODE__
- U32 i = 0;
- mmi_ps_get_gprs_data_account_rsp_struct *local_p;
- S8 account_name_str[30 * ENCODING_LENGTH];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- local_p = (mmi_ps_get_gprs_data_account_rsp_struct*) info;
- SetDynaDataAccountName(account_name_str, g_ph_cntx.ph_dataaccount_index);
- if (local_p->gprs_account.name_dcs == DATA_ACCOUNT_UCS)
- {
- i = 0;
- if (local_p->gprs_account.name_length == 0)
- {
- pfnUnicodeStrcpy((PS8) g_ph_cntx.profile_display_p->DataAccountName, (PS8) account_name_str);
- }
- else
- {
- while (i != local_p->gprs_account.name_length)
- {
- g_ph_cntx.profile_display_p->DataAccountName[i] = local_p->gprs_account.name[i + 1];
- g_ph_cntx.profile_display_p->DataAccountName[i + 1] = local_p->gprs_account.name[i];
- i += 2;
- }
- g_ph_cntx.profile_display_p->DataAccountName[local_p->gprs_account.name_length] = 0x00;
- g_ph_cntx.profile_display_p->DataAccountName[local_p->gprs_account.name_length + 1] = 0x00;
- }
- }
- else if (local_p->gprs_account.name_dcs == DATA_ACCOUNT_ASCII)
- {
- if (local_p->gprs_account.name_length == 0)
- {
- pfnUnicodeStrcpy((PS8) g_ph_cntx.profile_display_p->DataAccountName, (PS8) account_name_str);
- }
- else
- {
- AnsiiNToUnicodeString(
- (PS8) g_ph_cntx.profile_display_p->DataAccountName,
- (PS8) local_p->gprs_account.name,
- (local_p->gprs_account.name_length + 1) * ENCODING_LENGTH);
- }
- }
- mmi_ph_entry_edit_selected_profile();
- #endif /* __GPRS_MODE__ */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_handle_get_data_account_name
- * DESCRIPTION
- * It API checks for the profile module & then depending upon the
- * data account type associated ,send the request to the L4 to get the data account info
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_handle_get_data_account_name(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_ph_cntx.profile_display_p == NULL)
- {
- g_ph_cntx.profile_display_p =
- (ph_show_editable_profile_struct*) jdd_MemAlloc(sizeof(ph_show_editable_profile_struct), 1);
- }
- if (g_ph_cntx.profile_module == PH_BROWSER_PROFILE)
- {
- mmi_dtcnt_get_account_name(
- g_ph_wap_profile_p->data_account,
- (S8*) g_ph_cntx.profile_display_p->DataAccountName,
- MAX_DATA_ACCOUNT_NAME_LEN);
- }
- else if (g_ph_cntx.profile_module == PH_MMS_PROFILE)
- {
- mmi_dtcnt_get_account_name(
- g_ph_mms_profile_p->data_account,
- (S8*) g_ph_cntx.profile_display_p->DataAccountName,
- MAX_DATA_ACCOUNT_NAME_LEN);
- }
- mmi_ph_entry_edit_selected_profile();
- }
- #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 !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* 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 */
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_get_profile_name_list
- * DESCRIPTION
- * This API extracts profile names from the g_ph_wap_prof_name_arr_p,& g_ph_mms_prof_name_arr_p
- * into the subMenuData to be displayed
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_get_profile_name_list(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((g_ph_cntx.profile_module == PH_BROWSER_PROFILE) || (g_ph_cntx.profile_module == PH_BROWSER_PROV_PROFILE))
- {
- for (i = 0; i < NVRAM_WAP_PROFILE_MAX; i++)
- {
- if (g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[i].dcs == PH_DCS_UCS)
- {
- UCS2Strcpy(
- (S8*) (S8*) subMenuData[i],
- (S8*) (g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[i].profile_name));
- }
- else if (g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[i].dcs == PH_DCS_ASCII)
- {
- AnsiiToUnicodeString(
- (S8*) subMenuData[i],
- (S8*) (g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[i].profile_name));
- }
- }
- }
- else if ((g_ph_cntx.profile_module == PH_MMS_PROFILE) || (g_ph_cntx.profile_module == PH_MMS_PROV_PROFILE))
- {
- for (i = 0; i < NVRAM_MMS_PROFILE_MAX; i++)
- {
- if (g_ph_mms_prof_name_arr_p->nvram_mms_profile_name_array[i].dcs == PH_DCS_UCS)
- {
- UCS2Strcpy(
- (S8*) (S8*) subMenuData[i],
- (S8*) (g_ph_mms_prof_name_arr_p->nvram_mms_profile_name_array[i].profile_name));
- }
- else if (g_ph_mms_prof_name_arr_p->nvram_mms_profile_name_array[i].dcs == PH_DCS_ASCII)
- {
- AnsiiToUnicodeString(
- (S8*) subMenuData[i],
- (S8*) (g_ph_mms_prof_name_arr_p->nvram_mms_profile_name_array[i].profile_name));
- }
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_get_activated_wap_profile
- * DESCRIPTION
- * It returns the pointer to the activated wap profile content struct
- * PARAMETERS
- * void
- * RETURNS
- * g_ph_activated_wap_profile
- *****************************************************************************/
- nvram_wap_profile_content_struct *mmi_ph_get_activated_wap_profile(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return g_ph_activated_wap_profile;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_get_activated_mms_profile
- * DESCRIPTION
- * It returns the pointer to the activated MMS profile content struct
- * PARAMETERS
- * void
- * RETURNS
- * g_ph_activated_mms_profile
- *****************************************************************************/
- nvram_mms_profile_content_struct *mmi_ph_get_activated_mms_profile(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return g_ph_activated_mms_profile;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_brw_get_activated_profile_homepage
- * DESCRIPTION
- * It retreives the activated profile data and returns the homepage url of the activated profile
- * PARAMETERS
- * void
- * RETURNS
- * g_ph_activated_wap_profile->homepage_url the homepage url of the activated profile
- *****************************************************************************/
- U8 *mmi_ph_brw_get_activated_profile_homepage(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- 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);
- mmi_ph_get_activated_profile_data(PH_BROWSER_PROFILE, g_ph_cntx.wap_actived_profile_index);
- }
- return (U8*) (g_ph_activated_wap_profile->homepage_url);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_brw_set_activated_profile_homepage
- * DESCRIPTION
- * It sets the url passed as the homepage url of the activated WAP profile
- * PARAMETERS
- * homepage_url_p [?]
- * homepage_url(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_brw_set_activated_profile_homepage(U8 *homepage_url_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 len = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- len = strlen((S8*) homepage_url_p);
- if (len >= NVRAM_WAP_PROFILE_HOMEPAGE_URL_LEN)
- {
- len = NVRAM_WAP_PROFILE_HOMEPAGE_URL_LEN - 1;
- }
- memcpy(g_ph_activated_wap_profile->homepage_url, homepage_url_p, len);
- g_ph_activated_wap_profile->homepage_url[len] = ' ';
- mmi_ph_update_nvram_activated_wap_profile();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_mms_get_activated_profile_mmsc_url
- * DESCRIPTION
- * It returns the mmsc url associalted with the activated mms profile
- * PARAMETERS
- * void
- * RETURNS
- * g_ph_activated_mms_profile->mmsc_url mmsc url of the activated profile
- *****************************************************************************/
- U8 *mmi_ph_mms_get_activated_profile_mmsc_url(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- 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);
- mmi_ph_get_activated_profile_data(PH_MMS_PROFILE, g_ph_cntx.mms_actived_profile_index);
- }
- return (U8*) (g_ph_activated_mms_profile->mmsc_url);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_get_activated_prof_id_req_hdlr
- * DESCRIPTION
- * This is the request handler for MSG_ID_WAP_GET_BRA_PROF_ID_REQ request ID ,it in turns retruns teh activated profile index
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_get_activated_prof_id_req_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- wap_get_bra_prof_id_rsp_struct *prof_id_rsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- prof_id_rsp = (wap_get_bra_prof_id_rsp_struct*) OslConstructDataPtr(sizeof(wap_get_bra_prof_id_rsp_struct));
- prof_id_rsp->prof_id = g_ph_cntx.mms_actived_profile_index;
- prof_id_rsp->net_id = g_ph_activated_wap_profile->data_account;
- Message.oslSrcId = MOD_WAP;
- Message.oslDestId = MOD_J2ME;
- Message.oslMsgId = MSG_ID_WAP_GET_BRA_PROF_ID_RSP;
- Message.oslDataPtr = (oslParaType*) prof_id_rsp;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_get_prof_list_req_hdlr
- * DESCRIPTION
- * It is the request handler for the MSG_ID_WAP_GET_PROF_LIST_REQ ,it in turns returns the profiel name list as the response
- * PARAMETERS
- * req_src_id [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_get_prof_list_req_hdlr(module_type req_src_id)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wap_get_prof_list_rsp_struct *prof_list_rsp;
- ilm_struct *ilm_ptr;
- U32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- prof_list_rsp =
- (wap_get_prof_list_rsp_struct*) construct_local_para(sizeof(wap_get_prof_list_rsp_struct), TD_CTRL);
- prof_list_rsp->result = PH_PROFILE_SUCCESS;
- prof_list_rsp->number = NVRAM_WAP_PROFILE_MAX;
- prof_list_rsp->prof_list =
- (wap_prof_entry_struct*) OslMalloc((sizeof(wap_prof_entry_struct)) * NVRAM_WAP_PROFILE_MAX);
- mmi_ph_get_brw_profile_name_list();
- for (i = 0; i < NVRAM_WAP_PROFILE_MAX; i++)
- {
- U8 *s = g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[i].profile_name;
- if (g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[i].dcs == PH_DCS_ASCII)
- {
- U32 len = strlen((S8*) s);
- if (len > NVRAM_WAP_PROFILE_NAME_LEN / 2)
- {
- len = NVRAM_WAP_PROFILE_NAME_LEN / 2;
- }
- AnsiiNToUnicodeString((S8*) (prof_list_rsp->prof_list[i].name.value), (S8*) s, len);
- prof_list_rsp->prof_list[i].name.len = (len * ENCODING_LENGTH) + 1;
- }
- else if (g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[i].dcs == PH_DCS_UCS)
- {
- U32 len = UCS2Strlen((S8*) s);
- UCS2Strncpy((S8*) (prof_list_rsp->prof_list[i].name.value), (S8*) s, len);
- prof_list_rsp->prof_list[i].name.len = (len * ENCODING_LENGTH) + 1;
- }
- prof_list_rsp->prof_list[i].id = i;
- if (g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[i].conn_type == PH_CONN_TYPE_HTTP)
- {
- prof_list_rsp->prof_list[i].conn_type = PH_CONN_TYPE_HTTP;
- }
- else if (g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[i].conn_type ==
- PH_CONN_TYPE_CONNECTION_OREINTED)
- {
- prof_list_rsp->prof_list[i].conn_type = PH_CONN_TYPE_CONNECTION_OREINTED;
- }
- else if (g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[i].conn_type ==
- PH_CONN_TYPE_CONNECTION_OREINTED_SECURE)
- {
- prof_list_rsp->prof_list[i].conn_type = PH_CONN_TYPE_CONNECTION_OREINTED_SECURE;
- }
- }
- 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;
- }
- ilm_ptr = allocate_ilm(MOD_WAP);
- ilm_ptr->local_para_ptr = (local_para_struct*) prof_list_rsp;
- ilm_ptr->msg_id = MSG_ID_WAP_GET_PROF_LIST_RSP;
- ilm_ptr->peer_buff_ptr = NULL;
- if (req_src_id == MOD_J2ME)
- {
- SEND_ILM(MOD_WAP, MOD_J2ME, WAP_J2ME_SAP, ilm_ptr);
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "Profile Name List Response sent to Java Taskn"));
- }
- else if (req_src_id == MOD_MMI)
- {
- /* since in jataayu solution MOD_WAP, MOD_MMI are part of MMI task only */
- ilm_ptr->src_mod_id = MOD_WAP;
- ilm_ptr->dest_mod_id = MOD_MMI;
- ilm_ptr->sap_id = WAP_MMI_SAP;
- msg_send_ext_queue(ilm_ptr);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_get_prof_content_req_hdlr
- * DESCRIPTION
- * It is the rquest handler for the MSG_ID_WAP_GET_PROF_CONTENT_REQ request from the java task
- * this in turn returns the profiel content data as the response
- * PARAMETERS
- * req_src_id [IN]
- * msg [IN] This is pointer to profile content req struct sent by java task
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_get_prof_content_req_hdlr(module_type req_src_id, void *msg)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- ilm_struct *ilm_ptr;
- wap_get_prof_content_rsp_struct *prof_cont_rsp;
- wap_get_prof_content_req_struct *content_req_ptr;
- nvram_wap_profile_content_struct *prov_wap_profile = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- content_req_ptr = (wap_get_prof_content_req_struct*) msg;
- prof_cont_rsp =
- (wap_get_prof_content_rsp_struct*) construct_local_para(sizeof(wap_get_prof_content_rsp_struct), TD_CTRL);
- if (prov_wap_profile == NULL)
- {
- prov_wap_profile = (nvram_wap_profile_content_struct*) jdd_MemAlloc(NVRAM_EF_WAP_PROFILE_CONTENT_SIZE, 1);
- }
- ReadRecord(
- NVRAM_EF_WAP_PROFILE_CONTENT_LID,
- (U16) (content_req_ptr->id + 1),
- prov_wap_profile,
- NVRAM_EF_WAP_PROFILE_CONTENT_SIZE,
- &error);
- prof_cont_rsp->result = PH_PROFILE_SUCCESS;
- if (prov_wap_profile->conn_type == PH_CONN_TYPE_HTTP)
- {
- prof_cont_rsp->conn_type = PH_CONN_TYPE_HTTP;
- }
- else if (prov_wap_profile->conn_type == PH_CONN_TYPE_CONNECTION_OREINTED)
- {
- prof_cont_rsp->conn_type = PH_CONN_TYPE_CONNECTION_OREINTED;
- }
- else if (prov_wap_profile->conn_type == PH_CONN_TYPE_CONNECTION_OREINTED_SECURE)
- {
- prof_cont_rsp->conn_type = PH_CONN_TYPE_CONNECTION_OREINTED_SECURE;
- }
- prof_cont_rsp->net_id = prov_wap_profile->data_account;
- prof_cont_rsp->id = content_req_ptr->id;
- memset(prov_wap_profile->password, 0, NVRAM_WAP_PROFILE_PASSWORD_LEN);
- if (prov_wap_profile->password == NULL)
- {
- prof_cont_rsp->password[0] = ' ';
- }
- else if (strlen((S8*) prov_wap_profile->password) >= NVRAM_WAP_PROFILE_PASSWORD_LEN)
- {
- strncpy((S8*) prof_cont_rsp->password, (S8*) prov_wap_profile->password, NVRAM_WAP_PROFILE_PASSWORD_LEN - 1);
- prof_cont_rsp->password[NVRAM_WAP_PROFILE_PASSWORD_LEN - 2] = ' ';
- }
- else
- {
- strcpy((S8*) prof_cont_rsp->password, (S8*) prov_wap_profile->password);
- }
- memset(prov_wap_profile->username, 0, NVRAM_WAP_PROFILE_USERNAME_LEN);
- if (prov_wap_profile->username == NULL)
- {
- prof_cont_rsp->username[0] = ' ';
- }
- else if (strlen((S8*) prov_wap_profile->username) >= NVRAM_WAP_PROFILE_USERNAME_LEN)
- {
- strncpy((S8*) prof_cont_rsp->username, (S8*) prov_wap_profile->username, NVRAM_WAP_PROFILE_USERNAME_LEN - 1);
- prof_cont_rsp->username[NVRAM_WAP_PROFILE_USERNAME_LEN - 2] = ' ';
- }
- else
- {
- strcpy((S8*) prof_cont_rsp->username, (S8*) prov_wap_profile->username);
- }
- memset(prof_cont_rsp->prx_ip, 0, 4);
- memcpy(prof_cont_rsp->prx_ip, prov_wap_profile->proxy_ip, 4);
- prof_cont_rsp->prx_port = prov_wap_profile->proxy_port;
- jdd_MemFree(prov_wap_profile);
- prov_wap_profile = NULL;
- ilm_ptr = allocate_ilm(MOD_WAP);
- ilm_ptr->local_para_ptr = (local_para_struct*) prof_cont_rsp;
- ilm_ptr->msg_id = MSG_ID_WAP_GET_PROF_CONTENT_RSP;
- ilm_ptr->peer_buff_ptr = NULL;
- if (req_src_id == MOD_J2ME)
- {
- SEND_ILM(MOD_WAP, req_src_id, WAP_J2ME_SAP, ilm_ptr);
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "Profile Content Response sent to Java Taskn"));
- }
- else if (req_src_id == MOD_MMI)
- {
- /* since in jataayu solution MOD_WAP, MOD_MMI are part of MMI task only */
- ilm_ptr->src_mod_id = MOD_WAP;
- ilm_ptr->dest_mod_id = MOD_MMI;
- ilm_ptr->sap_id = WAP_MMI_SAP;
- msg_send_ext_queue(ilm_ptr);
- }
- }
- #endif /* defined (JATAAYU_SUPPORT) && (defined (WAP_SUPPORT) || (defined (MMS_SUPPORT))) */
- #endif /* _JPROFILEUIHANDLER_C */