📄 jbrowsermmimain.c
字号:
* 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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -