JBrowserMMIMain.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:118k
源码类别:
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:
- * ---------
- * JBrowserMMIMain.c
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * This file is intends for common browser functions.
- *
- * Author:
- * -------
- * -------
- *
- *============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
- #ifndef _MMI_JBROWSERMMIMAIN_C
- #define _MMI_JBROWSERMMIMAIN_C
- /* Include: MMI header file */
- #include "MMI_features.h"
- #if defined (JATAAYU_SUPPORT) && defined (WAP_SUPPORT)
- #include "PixtelDataTypes.h"
- #include "Unicodexdcl.h"
- #include "HistoryGprot.h"
- #include "GlobalDefs.h"
- #include "SettingProfile.h"
- #include "DebugInitDef.h"
- #include "CommonScreens.h"
- #include "EventsGprot.h"
- #include "wgui_inputs.h"
- #include "wgui_categories.h"
- #include "wgui_categories_inputs.h"
- #include "OrganizerDef.h"
- #include "DateTimeGprot.h"
- #include "TimerEvents.h"
- #include "wgui_categories_popup.h"
- #include "settingGprots.h"
- #include "wgui_status_icons.h"
- #include "JBrowserMMIDefs.h"
- #include "JBrowserMMIProts.h"
- #include "JBrowserMMITypes.h"
- #include "JBrowserMMIGprots.h"
- #include "JProfileHandlerTypes.h"
- #include "JProfileHandlerProts.h"
- #include "FileManagerGProt.h"
- #include "DataAccount.h"
- #ifdef __MMI_FILE_MANAGER__
- #include "FileMgr.h"
- #endif
- #ifdef __MMI_IRDA_SUPPORT__
- #include "IrdaMMIGprots.h"
- #endif
- #include "JPushInboxCommonUI.h"
- /* included for primitives handling */
- #include "sat_def.h"
- #include "wap_ps_struct.h"
- #include "JProfileHandlerTypes.h"
- #if (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT))
- #include "JMMSMessageSettings.h"
- #include "JMMSGprot.h"
- #endif /* (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT)) */
- /* Include: NVRAM header file */
- #include "NVRAMType.h"
- #include "NVRAMProt.h"
- #include "NVRAMEnum.h"
- /* Include: Jataayu header file */
- #include "ddl.h"
- #include "jcal.h"
- #include "jdd_memapi.h"
- #include "jdd_ui_datatypes.h"
- #include "jdd_ui_window.h"
- #ifdef JBROWSER_USE_ASM
- #include "App_mem.h"
- #endif /* ifdef JBROWSER_USE_ASM */
- #ifdef __MMI_TOUCH_SCREEN__
- #include "jdd_ui_pen_support.h"
- #endif
- // MAUI_00019199: Start
- #include "wapadp.h" // wap_dl_error_enum and wap_dl_status_enum are defined here
- // MAUI_00019199: End
- /*
- * Global Variable
- */
- brw_context_struct g_brw_cntx;
- U8 brw_current_url[BRW_BKM_MAX_URL_LENGTH * ENCODING_LENGTH];
- JC_FETCH_URL_INFO fetchUrlInfo;
- FuncPtr g_brw_LskFunPtr = NULL;
- FuncPtr g_brw_RskFunPtr = NULL;
- U16 g_brw_LskLabel;
- U16 g_brw_RskLabel;
- brw_page_context_struct g_brw_page_cntx;
- /* Animation handle of splash screen image */
- GDI_HANDLE brw_splash_ani_handle = GDI_ERROR_HANDLE;
- /* This array defines the currently registered Accesskeys - (Shantanu-20061027)*/
- U16 g_jbrowser_accesskeys[MMI_JBROWSER_MAX_ACCESSKEY] = {
- KEY_STAR,
- KEY_0,
- KEY_1,
- KEY_2,
- KEY_3,
- KEY_4,
- KEY_5,
- KEY_6,
- KEY_7,
- KEY_8,
- KEY_9,
- KEY_POUND
- #ifdef BROWSER_SENDKEY_AS_ACCESSKEY
- ,KEY_SEND
- #endif /* BROWSER_SENDKEY_AS_ACCESSKEY */
- };
- /* Extern Function,variables */
- extern void mmi_brw_accept_push_message(void); /* puneet */
- extern void mmi_jdd_ui_blinking_text_timer_hdlr(void);
- extern void mmi_jdd_ui_marquee_text_timer_hdlr(void);
- extern int wap_is_ready(void);
- /* function to get the application window ID */
- extern JC_UINT32 mmi_jdd_ui_get_appWindowID(ETaskID eSrcTaskID);
- extern void mmi_ph_brw_set_activated_profile_homepage(U8 *);
- extern U8 *mmi_ph_brw_get_activated_profile_homepage(void);
- extern void jdd_MemSetActiveModuleID(ETaskID taskId);
- extern nvram_wap_profile_content_struct NVRAM_EF_WAP_PROFILE_CONTENT_DEFAULT[];
- extern nvram_wap_profile_name_struct NVRAM_EF_WAP_PROFILE_NAMES_DEFAULT[];
- #if (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT))
- extern nvram_mms_profile_content_struct NVRAM_EF_MMS_PROFILE_CONTENT_DEFAULT[];
- extern nvram_mms_profile_name_struct NVRAM_EF_MMS_PROFILE_NAMES_DEFAULT[];
- #endif
- extern nvram_brw_bkm_title_struct NVRAM_EF_BRW_BOOKMARK_TITLE_DEFAULT[];
- extern nvram_brw_bkm_url_struct NVRAM_EF_BRW_BOOKMARK_URL_DEFAULT[];
- extern U8 g_brw_notificationFlag;
- extern BOOL g_CSDcall_aborted_status;/*Added to handle the csd call aborted state*/
- extern void mmi_jdd_ui_entry_notification_msg_popup(void);
- extern MMI_BOOL g_brw_title_icon_animation_status;
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_wap_init
- * DESCRIPTION
- * Init function for browser application
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_wap_init(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- jdd_MemSetActiveModuleID(E_TASK_BROWSER_UI);
- g_brw_cntx.isBrowserReady = FALSE;
- g_brw_cntx.isBrowserInitInProgress = TRUE;
- mmi_jbrowser_startup();
- /* Set Highlight handlers */
- SetHiliteHandler(MENU_ID_BRW_HOMEPAGE, mmi_brw_homepage_highlight_hdlr);
- SetHiliteHandler(MENU_ID_BRW_BOOKMARKS, mmi_brw_bookmark_menu_highlight_hdlr);
- SetHiliteHandler(MENU_ID_BRW_BKM_GOTO, mmi_brw_goto_bookmark_menu_highlight_hdlr);
- SetHiliteHandler(MENU_ID_BRW_BKM_EDIT, mmi_brw_edit_bookmark_menu_highlight_hdlr);
- SetHiliteHandler(MENU_ID_BRW_BKM_DELETE, mmi_brw_delete_bookmark_menu_highlight_hdlr);
- SetHiliteHandler(MENU_ID_BRW_BKM_DELETE_ALL, mmi_brw_delete_all_bookmark_menu_highlight_hdlr);
- SetHiliteHandler(MENU_ID_BRW_ADD_BOOKMARK, mmi_brw_add_bookmark_menu_highlight_hdlr);
- SetHiliteHandler(MENU_ID_BRW_SET_AS_HOMEPAGE, mmi_brw_bookmark_set_as_homepage_menu_highlight_hdlr);
- SetHiliteHandler(MENU_ID_BRW_RECENT_PAGES, mmi_brw_recent_pages_menu_highlight_hdlr);
- SetHiliteHandler(MENU_ID_BRW_RECENT_PAGE_GOTO, mmi_brw_goto_recent_page_menu_highlight_hdlr);
- SetHiliteHandler(MENU_ID_BRW_RECENT_PAGE_DELETE, mmi_brw_delete_recent_page_menu_highlight_hdlr);
- SetHiliteHandler(MENU_ID_BRW_RECENT_PAGE_DELETE_ALL, mmi_brw_delete_all_recent_pages_menu_highlight_hdlr);
- SetHiliteHandler(MENU_ID_BRW_ENTER_ADDRESS, mmi_brw_enter_address_menu_highlight_hdlr);
- SetHiliteHandler(MENU_ID_BRW_SERVICE_INBOX, mmi_brw_service_inbox_menu_highlight_hdlr);
- SetHiliteHandler(MENU_ID_BRW_PUSH_MSG_READ, mmi_brw_service_inbox_read_menu_highlight_hdlr);
- SetHiliteHandler(MENU_ID_BRW_PUSH_MSG_DELETE, mmi_brw_service_inbox_delete_menu_highlight_hdlr);
- SetHiliteHandler(MENU_ID_BRW_PUSH_MSG_DELETE_ALL, mmi_brw_service_inbox_delete_all_menu_highlight_hdlr);
- SetHiliteHandler(MENU_ID_BRW_PUSH_MSG_READ_ACCEPT, mmi_brw_service_inbox_read_accept_menu_highlight_hdlr);
- SetHiliteHandler(MENU_ID_BRW_PUSH_MSG_READ_DELETE, mmi_brw_service_inbox_read_delete_menu_highlight_hdlr);
- /* Hilite handlers for Enter Address Options List */
- SetHiliteHandler(MENU_ID_BRW_ENTER_ADR_GOTO, mmi_brw_enter_address_goto_menu_highlight_hdlr);
- SetHiliteHandler(MENU_ID_BRW_ENTER_ADR_EDIT, mmi_brw_enter_address_edit_menu_highlight_hdlr);
- SetHiliteHandler(MENU_ID_BRW_ENTER_ADR_ADD_TO_BOOKMARK, mmi_brw_enter_address_add_to_bmk_menu_highlight_hdlr);
- SetHiliteHandler(MENU_ID_BRW_ENTER_ADR_DELETE, mmi_brw_enter_address_delete_menu_highlight_hdlr);
- SetHiliteHandler(MENU_ID_BRW_ENTER_ADR_DELETE_ALL, mmi_brw_enter_address_delete_all_menu_highlight_hdlr);
- /* Set highlight handlers for settings menu items */
- mmi_brw_setting_init();
- /* Set highhandlers for rendered page options menu itmes */
- mmi_rendered_page_init();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_homepage_highlight_hdlr
- * DESCRIPTION
- * Highlight handler of homepage menu item.
- * Register key handlers.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_homepage_highlight_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(mmi_brw_entry_homepage, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_bookmark_menu_highlight_hdlr
- * DESCRIPTION
- * Highlight handler of bookmark menu item.
- * Register key handlers.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_bookmark_menu_highlight_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(mmi_brw_entry_bookmark_list, KEY_EVENT_UP);
- SetKeyHandler(mmi_brw_entry_bookmark_list, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_ren_page_add_to_bmk_highlight_hdlr
- * DESCRIPTION
- * Highlight handler of Add to Bookmark menu item.
- * Register key handlers.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_ren_page_add_to_bmk_highlight_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_brw_save_page_url_title_to_bookmark, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_goto_bookmark_menu_highlight_hdlr
- * DESCRIPTION
- * Highlight handler of goto menu item.
- * Register key handlers.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_goto_bookmark_menu_highlight_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(mmi_brw_goto_highlighted_bookmark, KEY_EVENT_UP);
- /* SetKeyHandler(mmi_brw_goto_highlighted_bookmark,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_edit_bookmark_menu_highlight_hdlr
- * DESCRIPTION
- * Highlight handler of edit bookmark menu item.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_edit_bookmark_menu_highlight_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(mmi_brw_pre_entry_edit_bookmark, KEY_EVENT_UP);
- SetKeyHandler(mmi_brw_pre_entry_edit_bookmark, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_delete_bookmark_menu_highlight_hdlr
- * DESCRIPTION
- * Highlight handler of delete menu item.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_delete_bookmark_menu_highlight_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(mmi_brw_delete_confirm, KEY_EVENT_UP);
- /* SetKeyHandler(mmi_brw_delete_confirm,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_delete_all_bookmark_menu_highlight_hdlr
- * DESCRIPTION
- * Highlight handler of Delete all menu item.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_delete_all_bookmark_menu_highlight_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(mmi_brw_confirm_delete_all_bookmark, KEY_EVENT_UP);
- /* SetKeyHandler(mmi_brw_confirm_delete_all_bookmark,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_add_bookmark_menu_highlight_hdlr
- * DESCRIPTION
- * Highlight handler of add bookmark menu item.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_add_bookmark_menu_highlight_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(mmi_brw_pre_entry_add_bookmark, KEY_EVENT_UP);
- SetKeyHandler(mmi_brw_pre_entry_add_bookmark, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_bookmark_set_as_homepage_menu_highlight_hdlr
- * DESCRIPTION
- * Highlight handler of 'Set as homepage' menu item.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_bookmark_set_as_homepage_menu_highlight_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(mmi_brw_bookmark_set_as_homepage, KEY_EVENT_UP);
- /* SetKeyHandler(mmi_brw_bookmark_set_as_homepage,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_enter_address_goto_menu_highlight_hdlr
- * DESCRIPTION
- * Highlight handler of Enter Address Goto Menu item.
- * Register key handlers.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_enter_address_goto_menu_highlight_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Fetch the highlighted page and update the address history list */
- SetLeftSoftkeyFunction(mmi_brw_update_address_history_list, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_enter_address_edit_menu_highlight_hdlr
- * DESCRIPTION
- * Highlight handler of Enter Address Goto Menu item.
- * Register key handlers.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_enter_address_edit_menu_highlight_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Fetch the highlighted page and update the address history list */
- SetLeftSoftkeyFunction(mmi_brw_enter_address_edit_menu, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_enter_address_add_to_bmk_menu_highlight_hdlr
- * DESCRIPTION
- * Highlight handler of Enter Address Add To BookMarks Menu item.
- * Register key handlers.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_enter_address_add_to_bmk_menu_highlight_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_brw_pre_entry_add_enter_address_bookmark, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_enter_address_delete_menu_highlight_hdlr
- * DESCRIPTION
- * Highlight handler of Enter Address Delete Menu item.
- * Register key handlers.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_enter_address_delete_menu_highlight_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_brw_enter_address_delete_confirm, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_enter_address_delete_all_menu_highlight_hdlr
- * DESCRIPTION
- * Highlight handler of Enter Address DeleteAll Menu item.
- * Register key handlers.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_enter_address_delete_all_menu_highlight_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_brw_enter_address_delete_all_confirm, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_recent_pages_menu_highlight_hdlr
- * DESCRIPTION
- * Highlight handler of Recent pages menu item.
- * Register key handlers.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_recent_pages_menu_highlight_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(mmi_brw_entry_recent_page_list, KEY_EVENT_UP);
- SetKeyHandler(mmi_brw_entry_recent_page_list, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_goto_recent_page_menu_highlight_hdlr
- * DESCRIPTION
- * Highlight handler of goto menu item.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_goto_recent_page_menu_highlight_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(mmi_brw_goto_highlighted_recent_page, KEY_EVENT_UP);
- /* SetKeyHandler(mmi_brw_goto_highlighted_recent_page,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_delete_recent_page_menu_highlight_hdlr
- * DESCRIPTION
- * Highlight handler of delete menu item.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_delete_recent_page_menu_highlight_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(mmi_brw_confirm_delete_recent_page, KEY_EVENT_UP);
- /* SetKeyHandler(mmi_brw_confirm_delete_recent_page,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_delete_all_recent_pages_menu_highlight_hdlr
- * DESCRIPTION
- * Highlight handler of Delete all menu item.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_delete_all_recent_pages_menu_highlight_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(mmi_brw_confirm_delete_all_recent_pages, KEY_EVENT_UP);
- /* SetKeyHandler(mmi_brw_confirm_delete_all_recent_pages,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_enter_address_menu_highlight_hdlr
- * DESCRIPTION
- * Highlight handler of enter address menu item.
- * Register key handlers.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_enter_address_menu_highlight_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(mmi_brw_entry_enter_address, KEY_EVENT_UP);
- SetKeyHandler(mmi_brw_entry_enter_address, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_service_inbox_menu_highlight_hdlr
- * DESCRIPTION
- * Highlight handler of service inbox menu item.
- * Register key handlers.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_service_inbox_menu_highlight_hdlr(void)
- {
- #ifndef __MMI_UNIFIED_MESSAGE__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(mmi_brw_entry_service_inbox, KEY_EVENT_UP);
- SetKeyHandler(mmi_brw_entry_service_inbox, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_service_inbox_read_menu_highlight_hdlr
- * DESCRIPTION
- * Highlight handler of read menu item.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_service_inbox_read_menu_highlight_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(mmi_brw_entry_read_push_message, KEY_EVENT_UP);
- /* SetKeyHandler(mmi_brw_entry_read_push_message,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_service_inbox_delete_menu_highlight_hdlr
- * DESCRIPTION
- * Highlight handler of Delete menu item.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_service_inbox_delete_menu_highlight_hdlr(void)
- {
- #ifndef __MMI_UNIFIED_MESSAGE__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(mmi_brw_confirm_delete_push_message, KEY_EVENT_UP);
- /* SetKeyHandler(mmi_brw_confirm_delete_push_message,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_service_inbox_delete_all_menu_highlight_hdlr
- * DESCRIPTION
- * Highlight handler of Delete all menu item.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_service_inbox_delete_all_menu_highlight_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(mmi_brw_confirm_delete_all_push_messages, KEY_EVENT_UP);
- /* SetKeyHandler(mmi_brw_confirm_delete_all_push_messages,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_service_inbox_read_accept_menu_highlight_hdlr
- * DESCRIPTION
- * Highlight handler of Accept menu item.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_service_inbox_read_accept_menu_highlight_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(mmi_brw_accept_push_message, KEY_EVENT_UP);
- /* SetKeyHandler(mmi_brw_accept_push_message,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_service_inbox_read_delete_menu_highlight_hdlr
- * DESCRIPTION
- * Highlight handler of Delete push message after reading
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_service_inbox_read_delete_menu_highlight_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(mmi_brw_confirm_delete_push_message, KEY_EVENT_UP);
- /* SetKeyHandler(mmi_brw_confirm_delete_push_message,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_pre_entry_internet_services
- * DESCRIPTION
- * Pre Entry function for Internet services screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_pre_entry_internet_services(void)
- {
- /* PIXTEL_JATAAYU added */
- mmi_JBrowserInitApp();
- /* PIXTEL_JATAAYU added */
- /* Added to indicate that SAT is not active */
- g_brw_cntx.isSATURL = E_FALSE;
- mmi_brw_entry_internet_services();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_entry_internet_services
- * DESCRIPTION
- * Entry function for Internet services screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_entry_internet_services(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 UC_list_of_items[6];
- U16 UC_list_of_icons[6];
- U8 *guiBuffer;
- S32 num_of_items;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Free the memory if already allocated */
- // mmi_brw_wap_deinit();
- /* PIXTEL_JATAAYU added */
- // mmi_JBrowserInitApp();
- /* PIXTEL_JATAAYU added */
- /* Added to indicate that SAT is not active */
- // g_brw_cntx.isSATURL = E_FALSE;
- g_brw_enter_add_flag = 0;/*added by tk to reset the flag of enter address screen's highlighter*/
- EntryNewScreen(SCR_ID_BRW_INTERNET_SERVICES, NULL, mmi_brw_entry_internet_services, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_BRW_INTERNET_SERVICES);
- num_of_items = GetNumOfChild(SERVICES_WAP_MENU_ID);
- GetSequenceStringIds(SERVICES_WAP_MENU_ID, UC_list_of_items);
- GetSequenceImageIds(SERVICES_WAP_MENU_ID, UC_list_of_icons);
- SetParentHandler(SERVICES_WAP_MENU_ID);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory15Screen(
- STR_ID_BRW_INTERNET_SERVICES,
- GetRootTitleIcon(SERVICES_WAP_MENU_ID),
- STR_GLOBAL_OK,
- 0,
- STR_GLOBAL_BACK,
- 0,
- num_of_items,
- UC_list_of_items,
- UC_list_of_icons,
- LIST_MENU,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(mmi_brw_GoBackServicesMenu, KEY_EVENT_UP);
- SetKeyHandler(mmi_brw_GoBackServicesMenu, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_GoBackServicesMenu
- * DESCRIPTION
- * Function to go back to services menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_GoBackServicesMenu(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- //mmi_JBrowserDeInitApp();
- mmi_brw_wap_deinit();
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_entry_homepage
- * DESCRIPTION
- * Entry function for homepage menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_entry_homepage(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_BOOL IsValidURL = MMI_FALSE;
- U8 curr_act_profile_url[BRW_WAP_PROFILE_HOMEPAGE_URL_LEN * ENCODING_LENGTH];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- strcpy((S8*) curr_act_profile_url, (S8*) mmi_ph_brw_get_activated_profile_homepage());
- AnsiiToUnicodeString((S8*) brw_current_url, (S8*) curr_act_profile_url);
- IsValidURL = mmi_brw_validate_url(brw_current_url);
- if (IsValidURL == MMI_TRUE)
- {
- /* added by tk to set the current fetch url */
- mmi_brw_set_current_url((S8*) brw_current_url);
- mmi_brw_pre_entry_goto_url();
- }
- else
- {
- DisplayPopup((PU8) GetString(STR_ID_BRW_INVALID_URL), IMG_GLOBAL_ERROR, 1, JBROWSER_POPUP_TIME, ERROR_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_clear_key_handler
- * DESCRIPTION
- * Clear all key types handler for agiven key code
- * PARAMETERS
- * key_code [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_clear_key_handler(U16 key_code)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearKeyHandler(key_code, KEY_EVENT_UP);
- ClearKeyHandler(key_code, KEY_EVENT_DOWN);
- ClearKeyHandler(key_code, KEY_LONG_PRESS);
- ClearKeyHandler(key_code, KEY_REPEAT);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_wap_deinit
- * DESCRIPTION
- * Free the memory allocated and close the browser window.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_wap_deinit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Added by tk to free allocated memory for URL */
- PRINT_INFORMATION(("Inside mmi_brw_wap_deinit"));
- if (fetchUrlInfo.psUrl != NULL)
- {
- jdd_MemFree(fetchUrlInfo.psUrl);
- fetchUrlInfo.psUrl = NULL;
- }
- /* Free memory allocated to bookmarks */
- if (g_brw_cntx.bookmark_title_p != NULL)
- {
- jdd_MemFree(g_brw_cntx.bookmark_title_p);
- g_brw_cntx.bookmark_title_p = NULL;
- }
- /* Free memory allocated to bookmarks */
- if (g_brw_cntx.bookmark_url_p != NULL)
- {
- jdd_MemFree(g_brw_cntx.bookmark_url_p);
- g_brw_cntx.bookmark_url_p = NULL;
- }
- /* Free memory allocated to address history title */
- if (g_brw_cntx.address_history_title_p != NULL)
- {
- jdd_MemFree(g_brw_cntx.address_history_title_p);
- g_brw_cntx.address_history_title_p = NULL;
- }
- /* Free memory allocated to address history url */
- if (g_brw_cntx.address_history_url_p != NULL)
- {
- jdd_MemFree(g_brw_cntx.address_history_url_p);
- g_brw_cntx.address_history_url_p = NULL;
- }
- g_brw_cntx.total_address_history_items = 0;
- g_brw_cntx.total_bookmark_items = 0;
- g_brw_cntx.index_highlighted_item = 0;
- g_brw_add_hist_flag = 0;
- g_brw_enter_add_flag = 0;
- g_BrwCsdCallDisconnect = FALSE;
- g_EndKey_pressed = FALSE;
- /* Free the do list if exists */
- if (g_brw_cntx.DoElementList != NULL)
- {
- mmi_brw_free_do_list();
- }
- /* Added by Pawan (31-07-06) */
- /* Free memory allocated to prompt edit buffer */
- if (g_brw_cntx.prompt_buffer != NULL)
- {
- jdd_MemFree(g_brw_cntx.prompt_buffer);
- g_brw_cntx.prompt_buffer = NULL;
- }
- /* Added by Vivek - 31072006 */
- mmi_brw_push_free_service_value_struct(&g_current_service_message);
- if (g_brw_cntx.isLayoutInitialized == E_TRUE)
- {
- #ifdef __SATC3__
- if (g_brw_cntx.isSATURL == E_TRUE)
- {
- brw_send_termination_to_mmi(BRW_SAT_ERROR_TERMINATION);
- }
- #endif /* __SATC3__ */
- if (g_brw_page_cntx.brw_PageFetchStatus || g_brw_cntx.isDownloadSuspended == TRUE || g_brw_cntx.isDownloading == TRUE) // Sandeep: Added For DLS
- {
- jdi_BrowserFetchStop(pBrowserCtxt);
- #ifdef __JBROWSER_DLS_SUPPORT__
- if (g_brw_cntx.isDownloading == TRUE)
- {
- // MAUI_00019199: Start
- mmi_brw_dls_send_file_dl_progress_ind(WAP_DL_STATUS_ABORTED, WAP_DL_ERROR_CANCELLED);
- // MAUI_00019199: Stop
- g_brw_cntx.isDownloadSuspended = FALSE;
- g_brw_cntx.isDownloading = FALSE;
- if (g_brw_cntx.dwnld_file_handle)
- {
- jdd_FSClose(g_brw_cntx.dwnld_file_handle);
- g_brw_cntx.dwnld_file_handle = NULL;
- if (g_brw_dls_cntx.p_file_name != NULL && g_brw_cntx.dwnld_fs_handle != NULL)
- {
- jdd_FSDelete(g_brw_cntx.dwnld_fs_handle, g_brw_dls_cntx.p_file_name); // Delete file
- jdd_MemFree(g_brw_dls_cntx.p_file_name);
- g_brw_dls_cntx.p_file_name = NULL;
- }
- }
- if (g_brw_cntx.dwnld_fs_handle)
- {
- jdd_FSDeinitialize(g_brw_cntx.dwnld_fs_handle);
- g_brw_cntx.dwnld_fs_handle = NULL;
- }
- }
- #endif /* __JBROWSER_DLS_SUPPORT__ */
- }
- jdi_BrowserClose(pBrowserCtxt, E_TRUE);
- mmi_JBrowserDeInitApp();
- /*Release all the allocated memory from browser pool before it*/
- #ifdef JBROWSER_USE_ASM
- applib_mem_ap_free_all(APPLIB_MEM_AP_ID_JATAAYU_WAP);
- jdd_MemDeinitBrowserASMPool();
- #endif
- }
- g_brw_notificationFlag = 0;
- memset(&g_brw_page_cntx, 0, sizeof(g_brw_page_cntx));
- g_brw_title_icon_animation_status = MMI_FALSE;
- memset(g_brw_page_cntx.brw_PageStatusCodeStack, -1, sizeof(g_brw_page_cntx.brw_PageStatusCodeStack));
- g_brw_cntx.page_fetchReqSrc = 0;
- g_CSDcall_aborted_status = FALSE;
- g_mmi_brw_delete_push_notification = MMI_FALSE;
- PRINT_INFORMATION(("Exit mmi_brw_wap_deinit"));
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_clear_brw_soft_keys
- * DESCRIPTION
- * Clear browser left and right soft keys
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_clear_brw_soft_keys(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_brw_LskLabel = 0;
- g_brw_RskLabel = 0;
- g_brw_LskFunPtr = NULL;
- g_brw_RskFunPtr = NULL;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_pre_entry_goto_url
- * DESCRIPTION
- * Pre Entry function for fetching url i.e when the user wants to fetch a page
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_pre_entry_goto_url(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_JDD_UI_WINDOW_INFO_STRUCT *jdd_window_info_struct_p = NULL;
- JC_UINT32 uiWindowID = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- uiWindowID = mmi_jdd_ui_get_appWindowID(E_TASK_BROWSER_CORE);
- jdd_window_info_struct_p = (MMI_JDD_UI_WINDOW_INFO_STRUCT*) uiWindowID;
- g_brw_LskLabel = 0;
- g_brw_RskLabel = STR_GLOBAL_CANCEL;
- g_brw_LskFunPtr = NULL;
- g_brw_RskFunPtr = mmi_brw_stop_fetch;
- mmi_brw_entry_goto_url();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_entry_goto_url
- * DESCRIPTION
- * Entry function for fetching url i.e when the user wants to fetch a page
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_entry_goto_url(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_JDD_UI_WINDOW_INFO_STRUCT *jdd_window_info_struct_p = NULL;
- JC_UINT32 uiWindowID = 0;
- U8 *guiBuffer;
- U8 flag = 0;
- U8 category501_msgStr[4] = {0, };
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- uiWindowID = mmi_jdd_ui_get_appWindowID(E_TASK_BROWSER_CORE);
- jdd_window_info_struct_p = (MMI_JDD_UI_WINDOW_INFO_STRUCT*) uiWindowID;
- /* This will redraw the Primary MMI Window screen after any interrupt */
- PRINT_INFORMATION(("Enter Browser Screen 501"));
- EntryNewScreen(SCR_ID_BRW_JBROWSER_MAIN, mmi_brw_exit_goto_url, mmi_brw_entry_goto_url, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_BRW_JBROWSER_MAIN);
- if (guiBuffer != NULL)
- {
- flag = 1;
- }
- if (IsScreenPresent(SCR_ID_BRW_JBROWSER_MAIN) && GetCurrScrnId() != SCR_ID_BRW_JBROWSER_MAIN)
- {
- if(g_brw_cntx.launch_brw_ext_app)
- {
- DeleteScreenIfPresent(SCR_ID_BRW_JBROWSER_MAIN);
- }
- else
- {
- DeleteNScrId(SCR_ID_BRW_JBROWSER_MAIN);
- }
- }
- g_brw_cntx.launch_brw_ext_app = MMI_FALSE;
- /* Here we are applying one hack to remove the DALMATIAN DOG IMAGE from the category screen.
- We will display the image whenever the browser is launched for the first time.
- For the first time we will pass category501_msgID = 0 so it will display the DOG IMAGE
- and after this we will pass a string ID which has been populated for this specially to
- display one blank space.Because, a single chracter can restrict the DALMATIAN DOG IMAGE
- to be rendered on Screen. */
- #ifdef __MMI_UI_DALMATIAN_EDITOR__
- AnsiiToUnicodeString((PS8) category501_msgStr, " ");
- #endif
- ShowCategory501Screen(
- 0,/* STR_ID_BRW_INTERNET_SERVICES, */
- 0,/*GetRootTitleIcon(SERVICES_WAP_MENU_ID),*/
- 0,/* g_brw_LskLabel, */
- 0,
- 0,/* g_brw_RskLabel, */
- 0,
- category501_msgStr,
- guiBuffer);
- /* PIXTEL_JATAAYU added */
- if (jdd_window_info_struct_p != NULL)
- {
- if (jdd_window_info_struct_p->focussedCtrlTitleControlID != 0)
- {
- MMI_title_string = (UI_string_type) mmi_brw_get_focussed_ctrl_title();
- }
- else if (jdd_window_info_struct_p->winProp.pszCaptionValue != NULL)
- {
- MMI_title_string = (UI_string_type) jdd_window_info_struct_p->winProp.pszCaptionValue;
- }
- else
- {
- /* MMI_title_string = (UI_string_type) brw_current_url; */
- }
- }
- if (g_brw_page_cntx.brw_PageFetchStatus)
- {
- g_brw_title_icon_animation_status = MMI_FALSE;
- mmi_brw_show_animated_title();
- }
- else
- {
- mmi_brw_show_normal_title();
- }
- if (E_FALSE == mmi_jdd_ui_get_jdd_flag(JDD_RENDERING_STARTED))
- {
- mmi_brw_start_animated_splash_screen();
- }
- mmi_brw_clear_key_handler(KEY_VOL_UP);
- mmi_brw_clear_key_handler(KEY_VOL_DOWN);
- SetKeyHandler(mmi_jdd_ui_left_key_hdlr, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_jdd_ui_right_key_hdlr, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_jdd_ui_down_key_hdlr, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_jdd_ui_down_key_hdlr, KEY_VOL_DOWN, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_jdd_ui_up_key_hdlr, KEY_UP_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_jdd_ui_up_key_hdlr, KEY_VOL_UP, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_jdd_ui_wap_key_hdlr, KEY_WAP, KEY_EVENT_UP); /* replaced key event down to key event up added by tk */
- SetKeyHandler(mmi_jdd_ui_wap_key_hdlr, KEY_SEND, KEY_EVENT_UP); /* replaced key event down to key event up added by tk */
- mmi_brw_register_endkey_handler();
- /* Below added by Shantanu for accesskey Support - 20060412 */
- mmi_brw_register_accesskey_handler();
- #ifdef __MMI_TOUCH_SCREEN__
- mmi_jdd_ui_register_pen_handler();
- #endif
- if (flag == 0)
- {
- mmi_brw_goto_url();
- }
- else if (g_brw_page_cntx.brw_PageFetchStatus)
- {
- g_brw_LskLabel = 0;
- g_brw_RskLabel = STR_GLOBAL_CANCEL;
- g_brw_LskFunPtr = NULL;
- g_brw_RskFunPtr = mmi_brw_stop_fetch;
- }
- else if (g_brw_page_cntx.brw_PageRefreshDispStatus)
- {
- g_brw_LskLabel = 0;
- g_brw_RskLabel = STR_GLOBAL_CANCEL;
- g_brw_LskFunPtr = NULL;
- g_brw_RskFunPtr = NULL;
- }
- /* else
- {
- if (!g_brw_ActiveScreenFlag)
- {
- g_brw_LskLabel = STR_GLOBAL_OPTIONS;
- g_brw_LskFunPtr = mmi_brw_rendered_page_options;
- g_brw_RskLabel = 0;
- g_brw_RskFunPtr = NULL;
- if (E_TRUE == mmi_brw_is_back())
- {
- g_brw_RskLabel = STR_GLOBAL_BACK;
- g_brw_RskFunPtr = mmi_brw_goto_prev_page;
- }
- g_brw_ActiveScreenFlag = 0;
- }
- if (jdd_window_info_struct_p != NULL)
- {
- jdd_MMIShowWindow(uiWindowID, E_TRUE);
- }
- }
- */
- if(flag && (jdd_window_info_struct_p != NULL))
- {
- jdd_MMIShowWindow(uiWindowID, E_TRUE);
- }
- //g_brw_page_cntx.brw_isRefreshDisplay = MMI_FALSE;
- ChangeRightSoftkey(g_brw_RskLabel, 0);
- ChangeLeftSoftkey(g_brw_LskLabel, 0);
- SetLeftSoftkeyFunction((FuncPtr) g_brw_LskFunPtr, KEY_EVENT_UP);
- SetRightSoftkeyFunction((FuncPtr) g_brw_RskFunPtr, KEY_EVENT_UP);
- if (g_brw_notificationFlag)
- {
- g_brw_notificationFlag = 0;
- mmi_jdd_ui_entry_notification_msg_popup();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_start_animated_splash_screen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_start_animated_splash_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- DeviceCharacteristics dev_ch = {0};
- U8 *splash_img = NULL;
- S32 img_x = 0, img_y = 0, img_width = 0, img_height = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_brw_stop_animated_splash_screen();
- jdd_MMIGetDeviceCharacteristics(&dev_ch);
- splash_img = (PU8) GetImage(IMG_ID_BRW_SPLASH_SCREEN);
- gui_measure_image(splash_img, &img_width, &img_height);
- img_x = dev_ch.uiWindowX + ((dev_ch.uiRenderingWidth + dev_ch.uiScrollBarWidth - img_width) >> 1);
- img_y = dev_ch.uiWindowY + ((dev_ch.uiRenderingHeight + dev_ch.uiScrollBarWidth - img_height) >> 1);
- gui_lock_double_buffer();
- gui_push_clip();
- gui_set_clip(
- dev_ch.uiWindowX,
- dev_ch.uiWindowY,
- dev_ch.uiWindowX + dev_ch.uiRenderingWidth + dev_ch.uiScrollBarWidth - 1,
- dev_ch.uiWindowY + dev_ch.uiRenderingHeight + dev_ch.uiScrollBarWidth - 1);
- gui_fill_rectangle(
- dev_ch.uiWindowX,
- dev_ch.uiWindowY,
- dev_ch.uiWindowX + dev_ch.uiRenderingWidth + dev_ch.uiScrollBarWidth - 1,
- dev_ch.uiWindowY + dev_ch.uiRenderingHeight + dev_ch.uiScrollBarWidth - 1,
- gui_color(255, 255, 255));
- gdi_image_draw_animation(img_x, img_y, splash_img, &brw_splash_ani_handle);
- gui_pop_clip();
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(
- dev_ch.uiWindowX,
- dev_ch.uiWindowY,
- dev_ch.uiWindowX + dev_ch.uiRenderingWidth + dev_ch.uiScrollBarWidth - 1,
- dev_ch.uiWindowY + dev_ch.uiRenderingHeight + dev_ch.uiScrollBarWidth - 1);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_stop_animated_splash_screen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_stop_animated_splash_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- DeviceCharacteristics dev_ch = {0};
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (brw_splash_ani_handle != GDI_ERROR_HANDLE)
- {
- if (GetActiveScreenId() == SCR_ID_BRW_JBROWSER_MAIN)
- {
- gui_lock_double_buffer();
- gdi_image_stop_animation(brw_splash_ani_handle);
- brw_splash_ani_handle = GDI_ERROR_HANDLE;
- /* Now fill the area with WHITE COLOR */
- jdd_MMIGetDeviceCharacteristics(&dev_ch);
- gui_push_clip();
- gui_set_clip(
- dev_ch.uiWindowX,
- dev_ch.uiWindowY,
- dev_ch.uiWindowX + dev_ch.uiRenderingWidth + dev_ch.uiScrollBarWidth - 1,
- dev_ch.uiWindowY + dev_ch.uiRenderingHeight + dev_ch.uiScrollBarWidth - 1);
- gui_fill_rectangle(
- dev_ch.uiWindowX,
- dev_ch.uiWindowY,
- dev_ch.uiWindowX + dev_ch.uiRenderingWidth + dev_ch.uiScrollBarWidth - 1,
- dev_ch.uiWindowY + dev_ch.uiRenderingHeight + dev_ch.uiScrollBarWidth - 1,
- gui_color(255, 255, 255));
- gui_pop_clip();
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(
- dev_ch.uiWindowX,
- dev_ch.uiWindowY,
- dev_ch.uiWindowX + dev_ch.uiRenderingWidth + dev_ch.uiScrollBarWidth - 1,
- dev_ch.uiWindowY + dev_ch.uiRenderingHeight + dev_ch.uiScrollBarWidth - 1);
- }
- else
- {
- gdi_image_stop_animation(brw_splash_ani_handle);
- brw_splash_ani_handle = GDI_ERROR_HANDLE;
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_register_endkey_handler
- * DESCRIPTION
- * Function for registration of end key handler in case of CSD bearer
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_register_endkey_handler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- nvram_wap_profile_content_struct *activated_wap_profile;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- activated_wap_profile = mmi_ph_get_activated_wap_profile();
- if (mmi_ph_check_data_account_type(activated_wap_profile->data_account) == PH_DATA_ACCOUNT_CSD)
- {
- SetKeyHandler(mmi_brw_goto_idle_screen_event, KEY_END, KEY_EVENT_DOWN);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_goto_idle_screen
- * DESCRIPTION
- * Function for displaying the idle screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_goto_idle_screen(void)
- {
- if(g_brw_page_cntx.brw_PageFetchStatus && (!g_brw_page_cntx.brw_pageRenderStatus))
- {
- jdi_BrowserDisconnect(pBrowserCtxt);
- }
- else
- {
- DisplayIdleScreen();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_register_accesskey_handler
- * DESCRIPTION
- * Function for registration of Groupkey handler for Accesskey Support
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_register_accesskey_handler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Added by Shantanu for Accesskey Support -20060412 */
- SetGroupKeyHandler(mmi_brw_fill_accesskey_info_and_send_event_to_queue, g_jbrowser_accesskeys, MMI_JBROWSER_MAX_ACCESSKEY - 1, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_clear_accesskey_handler
- * DESCRIPTION
- * Function for clearing of Groupkey handler for Accesskey Support
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_clear_accesskey_handler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Added by Shantanu for Accesskey Support -20060412 */
- SetGroupKeyHandler(NULL, g_jbrowser_accesskeys, MMI_JBROWSER_MAX_ACCESSKEY - 1, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_exit_goto_url
- * DESCRIPTION
- * Exit function for fetching url.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_exit_goto_url(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_UINT32 uiWindowID = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- uiWindowID = mmi_jdd_ui_get_appWindowID(E_TASK_BROWSER_CORE);
- /* Below changed By Shantanu */
- /* mmi_jdd_ui_show_window(uiWindowID,E_FALSE); */
- jdd_MMIShowWindow(uiWindowID, E_FALSE);
- #ifdef JATAAYU_IMAGE_CACHING_ENABLE
- memset((S8*) hintData, 0, 8);
- #endif /* JATAAYU_IMAGE_CACHING_ENABLE */
- mmi_brw_stop_animated_splash_screen();
- PRINT_INFORMATION(("Exit Browser Screen 501"));
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_set_current_url
- * DESCRIPTION
- * Set the current url to fetch
- * PARAMETERS
- * brw_url_p [?]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_set_current_url(S8 *brw_url_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_UINT32 uiGoUrlLen = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- uiGoUrlLen = pfnUnicodeStrlen((S8*) brw_url_p);
- if (fetchUrlInfo.psUrl != NULL)
- {
- jdd_MemFree(fetchUrlInfo.psUrl);
- fetchUrlInfo.psUrl = NULL;
- }
- /* Added by tk for concatenate http:// to the url if missing */
- if ((pfnUnicodeStrncmp((PS8) brw_url_p, (PS8) L"http://", 7) != 0) &&
- (pfnUnicodeStrncmp((PS8) brw_url_p, (PS8) L"https://", 8) != 0))
- {
- uiGoUrlLen += 7;
- fetchUrlInfo.psUrl = (JC_CHAR*) jdd_MemAlloc(uiGoUrlLen + 1, sizeof(JC_CHAR));
- AnsiiToUnicodeString((S8*) fetchUrlInfo.psUrl, (S8*) ("http://"));
- pfnUnicodeStrncat((S8*) fetchUrlInfo.psUrl, (S8*) brw_url_p, uiGoUrlLen - 7);
- }
- else
- {
- fetchUrlInfo.psUrl = (JC_CHAR*) jdd_MemAlloc(uiGoUrlLen + 1, sizeof(JC_CHAR));
- pfnUnicodeStrcpy((S8*) fetchUrlInfo.psUrl, (S8*) brw_url_p);
- }
- if (0 == uiGoUrlLen)
- {
- jdd_MemFree(fetchUrlInfo.psUrl);
- fetchUrlInfo.psUrl = NULL; /* added by tk */
- return;
- }
- fetchUrlInfo.pPostData = NULL;
- fetchUrlInfo.uiPostDataLen = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_goto_url
- * DESCRIPTION
- * Interface function to fetch the url
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_goto_url(void)
- {
- #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 !*/
- #endif /* 0 */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!g_brw_cntx.isSATURL)
- {
- JBrowserGoEvent();
- }
- else
- {
- JBrowserSATGotoURLEvent();
- }
- }
- /* added by tk */
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_get_title_length
- * DESCRIPTION
- * Interface function to get the max title length
- * PARAMETERS
- * void
- * RETURNS
- * S16
- *****************************************************************************/
- S16 mmi_brw_get_title_length(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return BRW_ADDRESS_HISTORY_MAX_TITLE_LENGTH;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_get_title_length
- * DESCRIPTION
- * Interface function to get the max title length
- * PARAMETERS
- * void
- * RETURNS
- * S16
- *****************************************************************************/
- void mmi_brw_show_title(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (GetActiveScreenId() == SCR_ID_BRW_JBROWSER_MAIN)
- {
- draw_title();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_paint_outside_look
- * DESCRIPTION
- * Interface function to redraw status,title and button bar,
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- extern JC_BOOLEAN mmi_brw_is_browser_window_active(void);
- void mmi_brw_paint_outside_look(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (GetActiveScreenId() == SCR_ID_BRW_JBROWSER_MAIN)
- {
- show_status_icons();
- draw_title();
- show_softkey_background();
- redraw_softkey(MMI_LEFT_SOFTKEY);
- redraw_softkey(MMI_RIGHT_SOFTKEY);
- }
- }
- /* tk end */
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_is_browser_screen_present
- * DESCRIPTION
- * Check whether browser screen is present in history or not
- * PARAMETERS
- * void
- * RETURNS
- * pBOOL
- *****************************************************************************/
- pBOOL mmi_brw_is_browser_screen_present(void)
- {
- return IsScreenPresent(SCR_ID_BRW_JBROWSER_MAIN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_validate_url
- * DESCRIPTION
- * Utility function to validate the url.
- * PARAMETERS
- * url_p [?] Url to be validated
- * RETURNS
- * void
- *****************************************************************************/
- MMI_BOOL mmi_brw_validate_url(U8 *url_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 temp_url[(BRW_BKM_MAX_URL_LENGTH+8) * ENCODING_LENGTH] = {0, };/* 8 for adding http:// if it is not present*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- // UnicodeToAnsii((PS8) temp_url, (PS8) url_p);
- if ((pfnUnicodeStrncmp((PS8) url_p, (PS8) L"http://", 7) != 0) &&
- (pfnUnicodeStrncmp((PS8) url_p, (PS8) L"https://", 8) != 0))
- {
- U8 url[BRW_BKM_MAX_URL_LENGTH * ENCODING_LENGTH] = {0, };
- UnicodeToAnsii((PS8) url, (PS8) url_p);
- strcpy((S8*) temp_url, (S8*) ("http://"));
- strcat((S8*) temp_url, (S8*) url);
- }
- else
- {
- UnicodeToAnsii((PS8) temp_url, (PS8) url_p);
- }
- if (jdi_isValidUrl((JC_UINT8*) temp_url))
- {
- return MMI_TRUE;
- }
- else
- {
- return MMI_FALSE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_set_as_homepage
- * DESCRIPTION
- * Interface function to set the url as homepage
- * PARAMETERS
- * url_p [?]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_set_as_homepage(U8 *url_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 homepage_url[BRW_WAP_PROFILE_HOMEPAGE_URL_LEN * ENCODING_LENGTH];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UnicodeToAnsii((PS8) homepage_url, (PS8) url_p);
- mmi_ph_brw_set_activated_profile_homepage(homepage_url);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, JBROWSER_POPUP_TIME, SUCCESS_TONE);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_go_back_authentication_screen.
- * DESCRIPTION
- * back button(LSK) handling for authentication screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_go_back_authentication_screen(void)
- {
- /*----------------------------------------------------------------*/
- JC_UINT32 navlist_count = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- jdi_BrowserSetAuthInfo(pBrowserCtxt, NULL);
- jdi_BrowserGetNavListCount(pBrowserCtxt, &navlist_count);
- if (navlist_count != 0)
- {
- GoBackHistory();
- }
- else
- {
- brw_auth_GoBackHistory();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_go_back_authentication_screen.
- * DESCRIPTION
- * back button(LSK) handling for submit confirm screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_go_back_confirm_submit_screen(void)
- {
- /*----------------------------------------------------------------*/
- JC_UINT32 navlist_count = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- jdi_BrowserSetAuthInfo(pBrowserCtxt, NULL);
- jdi_BrowserGetNavListCount(pBrowserCtxt, &navlist_count);
- if (navlist_count != 0)
- {
- GoBackToHistory(SCR_ID_BRW_JBROWSER_MAIN);
- }
- else
- {
- brw_auth_GoBackHistory();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_confirm_submit
- * DESCRIPTION
- * Confirm Screen before submitting the form.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_confirm_submit(void)
- {
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_GLOBAL_SUBMIT),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetLeftSoftkeyFunction(mmi_brw_auth_entry_confirmation_hdlr, KEY_EVENT_UP);
- /* SetRightSoftkeyFunction(brw_auth_GoBackHistory, KEY_EVENT_UP); */
- SetRightSoftkeyFunction(mmi_brw_go_back_confirm_submit_screen, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_entry_auth_handler
- * DESCRIPTION
- * Entry function for authentication screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_entry_auth_handler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U8 *inputBuffer;
- U16 inputBufferSize;
- InlineItem brw_authenticate_list[4];
- U16 IconsImageList[4] = {0};
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_BRW_AUTHENTICATION, mmi_brw_exit_auth_handler, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_BRW_AUTHENTICATION);
- InitializeCategory57Screen();
- memset(brw_authenticate_list, 0, sizeof(brw_authenticate_list));
- /* For username caption */
- SetInlineItemActivation(
- &brw_authenticate_list[BRW_INLINE_USERNAME_CAPTION],
- INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
- 0);
- SetInlineItemCaption(&brw_authenticate_list[BRW_INLINE_USERNAME_CAPTION], (U8*) GetString(STR_ID_BRW_USER_NAME));
- /* For username string */
- SetInlineItemActivation(&brw_authenticate_list[BRW_INLINE_USERNAME], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit(
- &brw_authenticate_list[BRW_INLINE_USERNAME],
- STR_ID_BRW_USER_NAME,
- GetRootTitleIcon(SERVICES_WAP_MENU_ID),
- (U8*) g_brw_cntx.brw_auth_username,
- BRW_AUTH_LEN_USERNAME,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES);
- SetInlineFullScreenEditCustomFunction(
- &brw_authenticate_list[BRW_INLINE_USERNAME],
- mmi_brw_auth_full_screen_editor_options);
- /* For password caption */
- SetInlineItemActivation(
- &brw_authenticate_list[BRW_INLINE_PASSWORD_CAPTION],
- INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
- 0);
- SetInlineItemCaption(&brw_authenticate_list[BRW_INLINE_PASSWORD_CAPTION], (U8*) GetString(STR_ID_BRW_PASSWORD));
- /* For password string */
- SetInlineItemActivation(&brw_authenticate_list[BRW_INLINE_PASSWORD], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit(
- &brw_authenticate_list[BRW_INLINE_PASSWORD],
- STR_ID_BRW_PASSWORD,
- GetRootTitleIcon(SERVICES_WAP_MENU_ID),
- (U8*) g_brw_cntx.brw_auth_password,
- BRW_AUTH_LEN_PASSWORD,
- INPUT_TYPE_ALPHANUMERIC_PASSWORD | INPUT_TYPE_USE_ONLY_ENGLISH_MODES);
- SetInlineFullScreenEditCustomFunction(
- &brw_authenticate_list[BRW_INLINE_PASSWORD],
- mmi_brw_auth_full_screen_editor_options);
- inputBuffer = GetCurrNInputBuffer(SCR_ID_BRW_AUTHENTICATION, &inputBufferSize);
- if (inputBuffer != NULL)
- {
- SetCategory57Data(brw_authenticate_list, 4, inputBuffer);
- }
- SetParentHandler(0);
- IconsImageList[0] = IMG_ID_DTCNT_USER_NAME;
- IconsImageList[2] = IMG_ID_DTCNT_PASSWD;
- ShowCategory57Screen(
- STR_ID_BRW_AUTHENTICATION,
- GetRootTitleIcon(SERVICES_WAP_MENU_ID),
- STR_GLOBAL_EDIT,
- 0,
- STR_GLOBAL_BACK,
- 0,
- 4,
- (U16*) IconsImageList,
- brw_authenticate_list,
- 0,
- guiBuffer);
- SetCategory57RightSoftkeyFunctions(mmi_brw_confirm_submit, mmi_brw_go_back_authentication_screen);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_exit_auth_handler
- * DESCRIPTION
- * Exit function for authentication screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_exit_auth_handler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history Scr;
- S16 nHistory = 0;
- U16 inputBufferSize; /* added for inline edit history */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Scr.scrnID = SCR_ID_BRW_AUTHENTICATION;
- CloseCategory57Screen();
- Scr.entryFuncPtr = mmi_brw_entry_auth_handler;
- pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) & nHistory);
- GetCategory57History(Scr.guiBuffer);
- inputBufferSize = (U16) GetCategory57DataSize(); /* added for inline edit history */
- GetCategory57Data((U8*) Scr.inputBuffer); /* added for inline edit history */
- AddNHistory(Scr, (U16) inputBufferSize); /* added for inline edit history */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_auth_entry_confirmation_hdlr
- * DESCRIPTION
- * Function for submitting the authentication information
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_auth_entry_confirmation_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_RETCODE iRet;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GoBacknHistory(1);
- pfnUnicodeStrcpy((PS8) g_brw_cntx.pAuthInfo.sUsername, (PS8) g_brw_cntx.brw_auth_username);
- pfnUnicodeStrcpy((PS8) g_brw_cntx.pAuthInfo.sPassword, (PS8) g_brw_cntx.brw_auth_password);
- iRet = jdi_BrowserSetAuthInfo(pBrowserCtxt, &g_brw_cntx.pAuthInfo);
- }
- /*****************************************************************************
- * FUNCTION
- * brw_auth_GoBackHistory
- * DESCRIPTION
- * Go back history by 1
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void brw_auth_GoBackHistory(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* GoBacknHistory(1); */
- DeleteNScrId(SCR_ID_BRW_JBROWSER_MAIN);
- mmi_brw_set_data_connection_deactive_flag(E_TRUE);
- mmi_brw_deinit_all();/*added by tk*/
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_auth_full_screen_editor_options
- * DESCRIPTION
- * Callback for full screen edit from inline edit screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_auth_full_screen_editor_options(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OPTIONS, IMG_GLOBAL_OPTIONS);
- SetLeftSoftkeyFunction(EntryScrForInputMethodAndDone, KEY_EVENT_UP);
- SetInputMethodAndDoneCaptionIcon(GetRootTitleIcon(SERVICES_WAP_MENU_ID));
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_wap_startup_req_hdlr
- * DESCRIPTION
- * Request handler for MSG_ID_WAP_BROWSER_STARTUP_REQ
- * PARAMETERS
- * dataBuf [?] Buffer containing data
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_wap_startup_req_hdlr(void *dataBuf)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wap_browser_startup_req_struct *brw_startup_p = (wap_browser_startup_req_struct*) dataBuf;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Added to indicate that SAT is not active */
- g_brw_cntx.isSATURL = E_FALSE;
- if (brw_startup_p == NULL)
- {
- ASSERT(0);
- }
- switch(brw_startup_p->type)
- {
- case WAP_BROWSER_GOTO_MAIN_MENU:
- {
- ASSERT(0);
- break;
- }
- case WAP_BROWSER_GOTO_HOMEPAGE:
- {
- /* Long press of WAP key from idle screen is handled in this case */
- ClearKeyHandler(KEY_WAP, KEY_LONG_PRESS);
- mmi_JBrowserInitApp();
- /* Added by tk to set page req source flag */
- g_brw_cntx.page_fetchReqSrc = 1;
- mmi_brw_entry_homepage();
- break;
- }
- case WAP_BROWSER_GOTO_URL:
- {
- /* Opening url from sms is handled in this case */
- U32 len = 0;
- MMI_BOOL IsValidURL;
- len = strlen((S8*) brw_startup_p->url);
- /* added by tk */
- if (len >= BRW_BKM_MAX_URL_LENGTH)
- {
- len = BRW_BKM_MAX_URL_LENGTH - 1;
- }
- memset((void*)brw_current_url, 0, sizeof(brw_current_url));
- AnsiiNToUnicodeString((S8*) brw_current_url, (S8*) brw_startup_p->url, len);
- IsValidURL = mmi_brw_validate_url(brw_current_url);
- if (IsValidURL == MMI_TRUE)
- {
- /* Added by tk to set page req source flag */
- g_brw_cntx.page_fetchReqSrc = 1;
- g_brw_cntx.launch_brw_ext_app = MMI_TRUE;
- /* added by tk to set the current fetch url */
- mmi_JBrowserInitApp();
- mmi_brw_set_current_url((S8*) brw_current_url);
- mmi_brw_pre_entry_goto_url();
- }
- else
- {
- DisplayPopup((PU8) GetString(STR_ID_BRW_INVALID_URL), IMG_GLOBAL_ERROR, 1, JBROWSER_POPUP_TIME, ERROR_TONE);
- }
- break;
- }
- case WAP_BROWSER_ADD_BOOKMARK:
- {
- U32 len = 0;
- MMI_BOOL IsValidURL;
- edit_flag = BRW_ADD_BKM_FROM_USE_URL;
- mmi_brw_read_bookmark_from_nvram();
- /* If Bookmark list is full, Dispaly 'Bookmark list is full' */
- if (g_brw_cntx.total_bookmark_items >= BRW_MAX_BOOKMARKS)
- {
- DisplayPopup((PU8) GetString(STR_ID_BRW_BOOKMARK_FULL), IMG_GLOBAL_ERROR, 1, JBROWSER_POPUP_TIME, ERROR_TONE);
- }
- else
- {
- len = strlen((S8*) brw_startup_p->url);
- if (len >= BRW_BKM_MAX_URL_LENGTH)
- {
- DisplayPopup((PU8) GetString(STR_ID_BRW_URL_LEN_EXCEED), IMG_GLOBAL_ERROR, 1, JBROWSER_POPUP_TIME, ERROR_TONE);
- }
- else
- {
- memset((void*)g_brw_bkm_selected_title, 0, sizeof(g_brw_bkm_selected_title)); /* Added by tk */
- memset(g_brw_bkm_selected_url, 0, ((len + 1) * ENCODING_LENGTH));
- AnsiiToUnicodeString((S8*) g_brw_bkm_selected_url, (S8*) brw_startup_p->url);
- IsValidURL = mmi_brw_validate_url(g_brw_bkm_selected_url);
- if (IsValidURL == MMI_TRUE)
- {
- edit_flag = BRW_ADD_BKM_FROM_USE_URL;
- mmi_brw_entry_add_bookmark_screen_for_all();
- }
- else
- {
- DisplayPopup((PU8) GetString(STR_ID_BRW_INVALID_URL), IMG_GLOBAL_ERROR, 1, JBROWSER_POPUP_TIME, ERROR_TONE);
- }
- }
- }
- break;
- }
- case WAP_BROWSER_GOTO_URL_BACKGROUND:
- {
- /* Will not handle another launch browser request when browser is already open */
- /* Might happen in case of next URI in OMA download */
- if(IsScreenPresent(SCR_ID_BRW_JBROWSER_MAIN))
- {
- return;
- }
- break;
- }
- case WAP_BROWSER_VIEW_PUSH_MSG:
- {
- ASSERT(0);
- break;
- }
- }
- }
- #ifdef __SATC3__
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_sat_launch_request
- * DESCRIPTION
- * Request handler for MSG_ID_WAP_MMI_LAUNCH_BROWSER_REQ
- * PARAMETERS
- * p [?] pointer to the buffer containing data for SAT
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_sat_launch_request(void *p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- COMM_PROFILE profile;
- GENERIC_DATA_CONN pDataConn;
- JC_RETCODE iRet = JC_OK;
- nvram_wap_profile_content_struct *activated_wap_profile;
- wap_mmi_lauch_browser_req_struct *launch_p = (wap_mmi_lauch_browser_req_struct*) p;
- U8 res;
- U8 i;
- S8 gateway_ascii[50];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!wap_is_ready())
- {
- res = BRW_SAT_BRWOSER_BUSY;
- goto launch_err;
- }
- activated_wap_profile = mmi_ph_get_activated_wap_profile();
- if (launch_p->noBearer > 0)
- {
- U8 bearer = PH_DATA_ACCOUNT_INVALID;
- for (i = 0; i < launch_p->noBearer; i++)
- {
- if (launch_p->bearer[i] == 0x01)
- {
- bearer = PH_DATA_ACCOUNT_CSD;
- }
- #ifdef __GPRS_MODE__
- else if (launch_p->bearer[i] == 0x03)
- {
- bearer = PH_DATA_ACCOUNT_GPRS;
- }
- #endif /* __GPRS_MODE__ */
- if (bearer != PH_DATA_ACCOUNT_INVALID)
- {
- break;
- }
- }
- if ((bearer != PH_DATA_ACCOUNT_INVALID) &&
- mmi_ph_check_data_account_type(activated_wap_profile->data_account) != bearer)
- {
- res = BRW_SAT_BEARER_UNAVAILABLE;
- goto launch_err;
- }
- }
- if (launch_p->browserMode == 0x00)
- {
- /* launch browser, if not already launched.
- nothing to do */
- }
- else if (launch_p->browserMode == 0x02)
- {
- /* use the existing browser (the browser shall not use the active existing secured session)
- nothing to do */
- }
- else if (launch_p->browserMode == 0x03)
- {
- /* close the existing browser session and launch new browser session */
- iRet = jdi_BrowserClose(pBrowserCtxt, E_TRUE);
- if (iRet != JC_OK)
- {
- ASSERT(0);
- }
- }
- if (launch_p->noUrl > 0)
- {
- if (!mmi_brw_validate_url(launch_p->url))
- {
- /* error */
- res = BRW_SAT_PARAM_URL_ERROR;
- goto launch_err;
- }
- else
- {
- /* pfnUnicodeStrcpy((S8*) brw_current_url, (S8*) launch_p->url); */
- /* added by tk to set the current fetch url */
- mmi_brw_set_current_url((S8*) launch_p->url);
- }
- }
- else
- { /* Copy Homepage for activated profile if no url */
- AnsiiToUnicodeString((S8*) brw_current_url, (S8*) mmi_ph_brw_get_activated_profile_homepage());
- /* added by tk to set the current fetch url */
- mmi_brw_set_current_url((S8*) brw_current_url);
- }
- jc_memset(&profile, 0, sizeof(COMM_PROFILE));
- /* process gateway */
- UnicodeToAnsii(gateway_ascii, (PS8) launch_p->gateway);
- if (launch_p->noGateway > 0 && mmi_brw_check_ip(gateway_ascii))
- {
- strcpy((S8*) profile.szHostName, gateway_ascii);
- profile.eConnMode = E_COMM_WSP_CONNECTION_ORIENTED;
- profile.uiPortNumber = (JC_UINT32) 9201;
- }
- else
- {
- //res = BRW_SAT_PARAM_GATEWAY_ERROR;
- //goto launch_err;
- }
- if (!launch_p->noGateway)
- {
- sprintf(
- (PS8) profile.szHostName,
- "%d.%d.%d.%d",
- activated_wap_profile->proxy_ip[0],
- activated_wap_profile->proxy_ip[1],
- activated_wap_profile->proxy_ip[2],
- activated_wap_profile->proxy_ip[3]);
- profile.uiPortNumber = activated_wap_profile->proxy_port;
- switch (activated_wap_profile->conn_type)
- {
- case PH_CONN_TYPE_CONNECTION_OREINTED:
- profile.eConnMode = E_COMM_WSP_CONNECTION_ORIENTED;
- profile.uiPortNumber = (JC_UINT32) 9201;
- break;
- /* added by tk */
- #if defined (WAP_SEC_SUPPORT) && defined (JATAAYU_SUPPORT)
- case PH_CONN_TYPE_CONNECTION_OREINTED_SECURE:
- profile.eConnMode = E_COMM_WSP_CONNECTION_ORIENTED_SECURE;
- profile.uiPortNumber = (JC_UINT32) 9203;
- break;
- #endif /* defined (WAP_SEC_SUPPORT) && defined (JATAAYU_SUPPORT) */
- /* end */
- case PH_CONN_TYPE_HTTP:
- if (strcmp((PS8) profile.szHostName, (PS8) "0.0.0.0") == 0)
- {
- profile.eConnMode = E_COMM_WPHTTP_DIRECT;
- }
- else
- {
- profile.eConnMode = E_COMM_WPHTTP_PROXY;
- if(profile.uiPortNumber == 0)
- {
- profile.uiPortNumber = 80;
- }
- }
- break;
- }
- }
- mmi_brw_set_timeout_value();
- mmi_JBrowserInitApp();
- iRet = jdi_BrowserSetTransportProfile(pBrowserCtxt, &profile);
- if (JC_OK != iRet)
- {
- res = BRW_SAT_UNKNOWN_ERROR;
- goto launch_err;
- }
- memset(&pDataConn, 0, sizeof(GENERIC_DATA_CONN));
- pDataConn.account_id = activated_wap_profile->data_account;
- iRet = jdi_BrowserSetDataConnectionProfile(pBrowserCtxt, (const GENERIC_DATA_CONN*)&pDataConn);
- if (JC_OK != iRet)
- {
- res = BRW_SAT_UNKNOWN_ERROR;
- goto launch_err;
- }
- /* This is added to indicate that a url is being fetched from SAT application.
- based on this we will send MSG_ID_WAP_MMI_BROWSER_TERMINATION_IND to MMI_TASK */
- g_brw_cntx.isSATURL = E_TRUE;
- /* Added by tk to set page req source flag */
- g_brw_cntx.page_fetchReqSrc = 1;
- mmi_brw_pre_entry_goto_url();
- res = BRW_SAT_LAUCH_SUCC;
- launch_err:
- mmi_brw_sat_lauch_response(res);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_sat_lauch_response
- * DESCRIPTION
- * Response MSG_ID_WAP_MMI_LAUNCH_BROWSER_RSP
- * PARAMETERS
- * res [IN] Type of response.
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_sat_lauch_response(U8 res)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wap_mmi_lauch_browser_rsp_struct *lauch_rsp_ptr;
- MYQUEUE Message;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- lauch_rsp_ptr = (wap_mmi_lauch_browser_rsp_struct*) OslConstructDataPtr(sizeof(wap_mmi_lauch_browser_rsp_struct));
- PRINT_INFORMATION(("***********mmi_brw_sat_lauch_response: %d**********n", res));
- switch (res)
- {
- case BRW_SAT_LAUCH_SUCC:
- lauch_rsp_ptr->res = SAT_CMD_PERFORMED_SUCCESSFULLY;
- lauch_rsp_ptr->additionalInfo = SAT_LAUNCH_BROWSER_NO_SPECIFIC_CAUSE;
- break;
- case BRW_SAT_BRWOSER_BUSY:
- lauch_rsp_ptr->res = SAT_ME_CURRENTLY_UNABLE_TO_PROCESS_CMD;
- lauch_rsp_ptr->additionalInfo = SAT_LAUNCH_BROWSER_BROWSER_UNAVALIABLE;
- break;
- case BRW_SAT_BEARER_UNAVAILABLE:
- lauch_rsp_ptr->res = SAT_ME_CURRENTLY_UNABLE_TO_PROCESS_CMD;
- lauch_rsp_ptr->additionalInfo = SAT_LAUNCH_BROWSER_BEARER_UNAVALIABLE;
- break;
- case BRW_SAT_PARAM_GATEWAY_ERROR:
- case BRW_SAT_PARAM_URL_ERROR:
- lauch_rsp_ptr->res = SAT_LAUNCH_BROWER_GENERIC_ERROR_CODE;
- lauch_rsp_ptr->additionalInfo = SAT_LAUNCH_BROWSER_NO_SPECIFIC_CAUSE;
- break;
- case BRW_SAT_PROV_DATA_ERROR:
- lauch_rsp_ptr->res = SAT_LAUNCH_BROWER_GENERIC_ERROR_CODE;
- lauch_rsp_ptr->additionalInfo = SAT_LAUNCH_BROWSER_ME_UNABLE_TO_READ_PROVISION_DATA;
- break;
- default:
- lauch_rsp_ptr->res = SAT_LAUNCH_BROWER_GENERIC_ERROR_CODE;
- lauch_rsp_ptr->additionalInfo = SAT_LAUNCH_BROWSER_NO_SPECIFIC_CAUSE;
- break;
- }
- Message.oslSrcId = MOD_WAP;
- Message.oslDestId = MOD_MMI;
- Message.oslMsgId = MSG_ID_WAP_MMI_LAUNCH_BROWSER_RSP;
- Message.oslDataPtr = (oslParaType*) lauch_rsp_ptr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- #endif /* __SATC3__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_check_ip
- * DESCRIPTION
- * Function to validate the IP
- * PARAMETERS
- * s [?] IP address to be validated
- * RETURNS
- * void
- *****************************************************************************/
- S32 mmi_brw_check_ip(S8 *s)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 *ip;
- S8 seps[] = ".";
- S8 *token;
- S32 ip_sec = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ip = (S8*) jdd_MemAlloc(1, strlen(s) + 1);
- strcpy(ip, s);
- /* 1st char of ip or hostname can't be '.' */
- if (ip[0] == '.' || ip[strlen(ip) - 1] == '.')
- {
- goto err;
- }
- token = strtok(ip, seps);
- while (token)
- {
- U16 i;
- for (i = 0; i < strlen(token); i++)
- {
- if (i >= 3)
- {
- goto err;
- }
- if (token[i] < '0' || token[i] > '9')
- {
- goto err;
- }
- }
- /* this segement is ip format */
- ip_sec++;
- token = strtok(NULL, seps);
- }
- if (ip_sec != 4)
- {
- goto err;
- }
- if (ip != NULL)
- {
- jdd_MemFree(ip);
- ip = NULL;
- }
- return 1;
- err:
- if (ip != NULL)
- {
- jdd_MemFree(ip);
- ip = NULL;
- }
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_wap_poweroff_request
- * DESCRIPTION
- * Request handler for MSG_ID_WAP_BROWSER_POWEROFF_REQ
- * PARAMETERS
- * dataBuf [?] Pointer to buffer containing data
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_wap_poweroff_request(void *dataBuf)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* dataBuf will be NULL */
- /* Deinitialize the browser application */
- mmi_DeInitJBrowserCtxt();
- #if (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT))
- mmi_jmms_deinit_shutdown();
- #endif
- /* Send response */
- mmi_brw_wap_poweroff_response();
- #ifdef BROWSER_PUSH_ENABLE
- mmi_brw_deinitialize_push_message_list();
- #endif /* BROWSER_PUSH_ENABLE */
- #ifdef __SATC3__
- if (g_brw_cntx.isSATURL == E_TRUE)
- {
- brw_send_termination_to_mmi(BRW_SAT_ERROR_TERMINATION);
- }
- #endif /* __SATC3__ */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_wap_poweroff_response
- * DESCRIPTION
- * Response MSG_ID_WAP_BROWSER_POWEROFF_RSP
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_wap_poweroff_response(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Message.oslSrcId = MOD_WAP;
- Message.oslDestId = MOD_MMI;
- Message.oslMsgId = MSG_ID_WAP_BROWSER_POWEROFF_RSP;
- Message.oslDataPtr = (oslParaType*) NULL;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * brw_send_termination_to_mmi
- * DESCRIPTION
- * MSG_ID_WAP_MMI_BROWSER_TERMINATION_IND
- * PARAMETERS
- * cause [IN] Type of termination (USER or ERROR)
- * RETURNS
- * void
- *****************************************************************************/
- void brw_send_termination_to_mmi(U8 cause)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- wap_mmi_browser_termination_ind_struct *browser_term_ind_ptr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- browser_term_ind_ptr =
- (wap_mmi_browser_termination_ind_struct*) OslConstructDataPtr(sizeof(wap_mmi_browser_termination_ind_struct));
- if (cause == BRW_SAT_USER_TERMINATION)
- {
- browser_term_ind_ptr->cause = SAT_BROWSER_USER_TERMINATION;
- }
- else
- {
- browser_term_ind_ptr->cause = SAT_BROWSER_ERROR_TERMINATION;
- }
- Message.oslSrcId = MOD_WAP;
- Message.oslDestId = MOD_MMI;
- Message.oslMsgId = MSG_ID_WAP_MMI_BROWSER_TERMINATION_IND;
- Message.oslDataPtr = (oslParaType*) browser_term_ind_ptr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_wap_entry_busy_progressing_screen_in_idle
- * DESCRIPTION
- * Temporary screen with all key disabled and no put in history. Invoked from mmi_brw_wap_internet_key_hdlr
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_wap_entry_busy_progressing_screen_in_idle(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_BRW_TRANSITION_ANIMATION, NULL, NULL, NULL);
- ShowCategory66Screen(
- (U16) STR_ID_BRW_INTERNET_SERVICES,
- GetRootTitleIcon(SERVICES_WAP_MENU_ID),
- 0,
- 0,
- 0,
- 0,
- (U8*) GetString(STR_ID_BRW_PLEASE_WAIT),
- IMG_ID_BRW_SAT_WAIT,
- NULL);
- ClearAllKeyHandler(); /* End key is still valid */
- mmi_brw_clear_key_handler(KEY_END);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_wap_restore_factory_setting_req
- * DESCRIPTION
- * Request handler for MSG_ID_WAP_RESTORE_FACTORY_SETTING_REQ
- * PARAMETERS
- * dataBuf [?] Pointer to buffer containing data
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_wap_restore_factory_setting_req(void *dataBuf)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_brw_restore_default_profile_settings();
- mmi_brw_restore_default_browser_settings();
- mmi_brw_restore_default_bookmarks();
- /* mmi_brw_restore_default_certificates(); */
- #if (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT))
- /* /manish--for JMMS */
- mmi_mms_restore_default_profile_settings();
- mmi_jmms_restore_nvram_default_settings();
- #endif /* (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT)) */
- mmi_brw_wap_restore_factory_setting_cnf();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_restore_default_profile_settings
- * DESCRIPTION
- * Restore the default profile settings
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_restore_default_profile_settings(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 index = 0;
- S16 error = 0;
- U16 activateWapProfileIndex = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (index = 1; index <= NVRAM_WAP_PROFILE_MAX; index++)
- {
- WriteRecord(
- NVRAM_EF_WAP_PROFILE_CONTENT_LID,
- index,
- &NVRAM_EF_WAP_PROFILE_CONTENT_DEFAULT[index - 1],
- NVRAM_EF_WAP_PROFILE_CONTENT_SIZE,
- &error);
- }
- WriteRecord(
- NVRAM_EF_WAP_PROFILE_NAMES_LID,
- 1,
- NVRAM_EF_WAP_PROFILE_NAMES_DEFAULT,
- NVRAM_EF_WAP_PROFILE_NAMES_SIZE,
- &error);
- // WriteValue(NVRAM_PH_ACTIVATED_WAP_PROFILE_INDEX, &activateWapProfileIndex, DS_BYTE, &error);
- }
- #if (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT))
- /*****************************************************************************
- * FUNCTION
- * mmi_mms_restore_default_profile_settings
- * DESCRIPTION
- * Restore the default profile settings
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_mms_restore_default_profile_settings(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 index = 0;
- S16 error = 0;
- U16 activateMMSProfileIndex = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (index = 1; index <= NVRAM_MMS_PROFILE_MAX; index++)
- {
- WriteRecord(
- NVRAM_EF_MMS_PROFILE_CONTENT_LID,
- index,
- &NVRAM_EF_MMS_PROFILE_CONTENT_DEFAULT[index - 1],
- NVRAM_EF_MMS_PROFILE_CONTENT_SIZE,
- &error);
- }
- WriteRecord(
- NVRAM_EF_MMS_PROFILE_NAMES_LID,
- 1,
- NVRAM_EF_MMS_PROFILE_NAMES_DEFAULT,
- NVRAM_EF_MMS_PROFILE_NAMES_SIZE,
- &error);
- //WriteValue(NVRAM_PH_ACTIVATED_MMS_PROFILE_INDEX, &activateMMSProfileIndex, DS_BYTE, &error);
- }
- #endif //#if (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT))
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_restore_default_browser_settings
- * DESCRIPTION
- * Restore the default browser settings
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_restore_default_browser_settings(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- U16 timeout_default = WAP_CUSTOM_CFG_DEFAULT_BROWSE_TIMEOUT;
- U8 show_image_default = WAP_CUSTOM_CFG_DEFAULT_SHOW_IMAGES_ON;
- U8 show_history_as_default = WAP_CUSTOM_CFG_DEFAULT_SHOW_HISTORY_AS_URL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- WriteValue(NVRAM_BRW_TIME_OUT_VALUE, &(timeout_default), DS_SHORT, &error);
- g_brw_cntx.timeout_value = timeout_default;
- WriteValue(NVRAM_BRW_SHOW_IMAGE_ON_OFF, &(show_image_default), DS_BYTE, &error);
- g_brw_cntx.show_images = show_image_default;
- WriteValue(NVRAM_BRW_SHOW_HISTORY_AS, &(show_history_as_default), DS_BYTE, &error);
- g_brw_cntx.show_history_as_url = show_history_as_default;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_restore_default_bookmarks
- * DESCRIPTION
- * Restore the default bookmarks
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_restore_default_bookmarks(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 record_count;
- S16 NvramError;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Read bookmarks from NVRAM if not already read */
- for (record_count = 1; record_count <= NVRAM_BRW_NUM_BOOKMARK_TITLE_RECORDS; record_count++)
- {
- WriteRecord(
- NVRAM_EF_BRW_BOOKMARK_TITLE_LID,
- record_count,
- &NVRAM_EF_BRW_BOOKMARK_TITLE_DEFAULT[(record_count - 1) * TITLES_PER_RECORD],
- NVRAM_BRW_BOOKMARK_TITLE_SIZE,
- &NvramError);
- }
- for (record_count = 1; record_count <= NVRAM_BRW_NUM_BOOKMARK_URL_RECORDS; record_count++)
- {
- WriteRecord(
- NVRAM_EF_BRW_BOOKMARK_URL_LID,
- record_count,
- &NVRAM_EF_BRW_BOOKMARK_URL_DEFAULT[(record_count - 1) * URLS_PER_RECORD],
- NVRAM_BRW_BOOKMARK_URL_SIZE,
- &NvramError);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_brw_wap_restore_factory_setting_cnf
- * DESCRIPTION
- * Response MSG_ID_WAP_RESTORE_FACTORY_SETTING_CNF
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_brw_wap_restore_factory_setting_cnf(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Message.oslSrcId = MOD_WAP;
- Message.oslDestId = MOD_MMI;
- Message.oslMsgId = MSG_ID_WAP_RESTORE_FACTORY_SETTING_CNF;
- Message.oslDataPtr = (oslParaType*) NULL;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- #endif /* defined (JATAAYU_SUPPORT) && defined (WAP_SUPPORT) */
- #endif /* _MMI_JBROWSERMMIMAIN_C */