JBrowserMMIMain.c
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:118k
源码类别:

MTK

开发平台:

C/C++

  1. /*****************************************************************************
  2. *  Copyright Statement:
  3. *  --------------------
  4. *  This software is protected by Copyright and the information contained
  5. *  herein is confidential. The software may not be copied and the information
  6. *  contained herein may not be used or disclosed except with the written
  7. *  permission of MediaTek Inc. (C) 2005
  8. *
  9. *  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  10. *  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  11. *  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
  12. *  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  13. *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  14. *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  15. *  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  16. *  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  17. *  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
  18. *  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
  19. *  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
  20. *  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
  21. *
  22. *  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
  23. *  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  24. *  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  25. *  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
  26. *  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
  27. *
  28. *  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
  29. *  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
  30. *  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
  31. *  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
  32. *  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
  33. *
  34. *****************************************************************************/
  35. /*****************************************************************************
  36.  *
  37.  * Filename:
  38.  * ---------
  39.  * JBrowserMMIMain.c
  40.  *
  41.  * Project:
  42.  * --------
  43.  *   MAUI
  44.  *
  45.  * Description:
  46.  * ------------
  47.  *   This file is intends for common browser functions.
  48.  *
  49.  * Author:
  50.  * -------
  51.  * -------
  52.  *
  53.  *============================================================================
  54.  *             HISTORY
  55.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  56.  *------------------------------------------------------------------------------
  57.  * removed!
  58.  *
  59.  * removed!
  60.  * removed!
  61.  * removed!
  62.  *
  63.  * removed!
  64.  * removed!
  65.  * removed!
  66.  *
  67.  * removed!
  68.  * removed!
  69.  * removed!
  70.  *
  71.  * removed!
  72.  * removed!
  73.  * removed!
  74.  * removed!
  75.  *
  76.  * removed!
  77.  * removed!
  78.  * removed!
  79.  *
  80.  * removed!
  81.  * removed!
  82.  * removed!
  83.  *
  84.  * removed!
  85.  * removed!
  86.  * removed!
  87.  *
  88.  * removed!
  89.  * removed!
  90.  * removed!
  91.  *
  92.  * removed!
  93.  * removed!
  94.  * removed!
  95.  *
  96.  * removed!
  97.  * removed!
  98.  * removed!
  99.  *
  100.  * removed!
  101.  * removed!
  102.  * removed!
  103.  *
  104.  * removed!
  105.  * removed!
  106.  * removed!
  107.  *
  108.  * removed!
  109.  * removed!
  110.  * removed!
  111.  *
  112.  * removed!
  113.  * removed!
  114.  * removed!
  115.  *
  116.  * removed!
  117.  * removed!
  118.  * removed!
  119.  *
  120.  * removed!
  121.  * removed!
  122.  * removed!
  123.  *
  124.  * removed!
  125.  * removed!
  126.  * removed!
  127.  *
  128.  * removed!
  129.  * removed!
  130.  * removed!
  131.  *
  132.  * removed!
  133.  * removed!
  134.  * removed!
  135.  *
  136.  * removed!
  137.  * removed!
  138.  * removed!
  139.  *
  140.  * removed!
  141.  * removed!
  142.  * removed!
  143.  *
  144.  * removed!
  145.  * removed!
  146.  * removed!
  147.  *
  148.  * removed!
  149.  * removed!
  150.  * removed!
  151.  *
  152.  * removed!
  153.  * removed!
  154.  * removed!
  155.  *
  156.  * removed!
  157.  * removed!
  158.  * removed!
  159.  *
  160.  * removed!
  161.  * removed!
  162.  * removed!
  163.  *
  164.  * removed!
  165.  * removed!
  166.  * removed!
  167.  *
  168.  * removed!
  169.  * removed!
  170.  * removed!
  171.  *
  172.  * removed!
  173.  * removed!
  174.  * removed!
  175.  *
  176.  *------------------------------------------------------------------------------
  177.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  178.  *============================================================================
  179.  ****************************************************************************/
  180. #ifndef _MMI_JBROWSERMMIMAIN_C
  181. #define _MMI_JBROWSERMMIMAIN_C
  182. /*  Include: MMI header file */
  183. #include "MMI_features.h"
  184. #if defined (JATAAYU_SUPPORT) && defined (WAP_SUPPORT)
  185. #include "PixtelDataTypes.h"
  186. #include "Unicodexdcl.h"
  187. #include "HistoryGprot.h"
  188. #include "GlobalDefs.h"
  189. #include "SettingProfile.h"
  190. #include "DebugInitDef.h"
  191. #include "CommonScreens.h"
  192. #include "EventsGprot.h"
  193. #include "wgui_inputs.h"
  194. #include "wgui_categories.h"
  195. #include "wgui_categories_inputs.h"
  196. #include "OrganizerDef.h"
  197. #include "DateTimeGprot.h"
  198. #include "TimerEvents.h"
  199. #include "wgui_categories_popup.h"
  200. #include "settingGprots.h"
  201. #include "wgui_status_icons.h"
  202. #include "JBrowserMMIDefs.h"
  203. #include "JBrowserMMIProts.h"
  204. #include "JBrowserMMITypes.h"
  205. #include "JBrowserMMIGprots.h"
  206. #include "JProfileHandlerTypes.h"
  207. #include "JProfileHandlerProts.h"
  208. #include "FileManagerGProt.h"
  209. #include "DataAccount.h"
  210. #ifdef __MMI_FILE_MANAGER__
  211. #include "FileMgr.h"
  212. #endif 
  213. #ifdef __MMI_IRDA_SUPPORT__
  214. #include "IrdaMMIGprots.h"
  215. #endif 
  216. #include "JPushInboxCommonUI.h"
  217. /* included for primitives handling */
  218. #include "sat_def.h"
  219. #include "wap_ps_struct.h"
  220. #include "JProfileHandlerTypes.h"
  221. #if (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT))
  222. #include "JMMSMessageSettings.h"
  223. #include "JMMSGprot.h"
  224. #endif /* (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT)) */ 
  225. /*  Include: NVRAM header file */
  226. #include "NVRAMType.h"
  227. #include "NVRAMProt.h"
  228. #include "NVRAMEnum.h"
  229. /*  Include: Jataayu header file */
  230. #include "ddl.h"
  231. #include "jcal.h"
  232. #include "jdd_memapi.h"
  233. #include "jdd_ui_datatypes.h"
  234. #include "jdd_ui_window.h"
  235. #ifdef JBROWSER_USE_ASM
  236. #include "App_mem.h"
  237. #endif /* ifdef JBROWSER_USE_ASM */
  238. #ifdef __MMI_TOUCH_SCREEN__
  239. #include "jdd_ui_pen_support.h"
  240. #endif
  241. // MAUI_00019199: Start
  242. #include "wapadp.h" // wap_dl_error_enum and wap_dl_status_enum are defined here
  243. // MAUI_00019199: End
  244. /* 
  245.  * Global Variable
  246.  */
  247. brw_context_struct g_brw_cntx;
  248. U8 brw_current_url[BRW_BKM_MAX_URL_LENGTH * ENCODING_LENGTH];
  249. JC_FETCH_URL_INFO fetchUrlInfo;
  250. FuncPtr g_brw_LskFunPtr = NULL;
  251. FuncPtr g_brw_RskFunPtr = NULL;
  252. U16 g_brw_LskLabel;
  253. U16 g_brw_RskLabel;
  254. brw_page_context_struct g_brw_page_cntx;
  255. /* Animation handle of splash screen image */
  256. GDI_HANDLE brw_splash_ani_handle = GDI_ERROR_HANDLE;
  257. /* This array defines the currently registered Accesskeys  - (Shantanu-20061027)*/
  258. U16 g_jbrowser_accesskeys[MMI_JBROWSER_MAX_ACCESSKEY] = {       
  259.              KEY_STAR, 
  260.              KEY_0, 
  261.              KEY_1, 
  262.              KEY_2, 
  263.              KEY_3, 
  264.              KEY_4, 
  265.              KEY_5,
  266.              KEY_6, 
  267.              KEY_7, 
  268.              KEY_8, 
  269.              KEY_9, 
  270.              KEY_POUND 
  271.         #ifdef BROWSER_SENDKEY_AS_ACCESSKEY
  272.              ,KEY_SEND
  273.         #endif /* BROWSER_SENDKEY_AS_ACCESSKEY */
  274. };
  275. /* Extern Function,variables */
  276. extern void mmi_brw_accept_push_message(void);  /* puneet */
  277. extern void mmi_jdd_ui_blinking_text_timer_hdlr(void);
  278. extern void mmi_jdd_ui_marquee_text_timer_hdlr(void);
  279. extern int wap_is_ready(void);
  280. /* function to get the application window ID */
  281. extern JC_UINT32 mmi_jdd_ui_get_appWindowID(ETaskID eSrcTaskID);
  282. extern void mmi_ph_brw_set_activated_profile_homepage(U8 *);
  283. extern U8 *mmi_ph_brw_get_activated_profile_homepage(void);
  284. extern void jdd_MemSetActiveModuleID(ETaskID taskId);
  285. extern nvram_wap_profile_content_struct NVRAM_EF_WAP_PROFILE_CONTENT_DEFAULT[];
  286. extern nvram_wap_profile_name_struct NVRAM_EF_WAP_PROFILE_NAMES_DEFAULT[];
  287. #if (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT))
  288. extern nvram_mms_profile_content_struct NVRAM_EF_MMS_PROFILE_CONTENT_DEFAULT[];
  289. extern nvram_mms_profile_name_struct NVRAM_EF_MMS_PROFILE_NAMES_DEFAULT[];
  290. #endif
  291. extern nvram_brw_bkm_title_struct NVRAM_EF_BRW_BOOKMARK_TITLE_DEFAULT[];
  292. extern nvram_brw_bkm_url_struct NVRAM_EF_BRW_BOOKMARK_URL_DEFAULT[];
  293. extern U8 g_brw_notificationFlag;
  294. extern BOOL g_CSDcall_aborted_status;/*Added to handle the csd call aborted state*/
  295. extern void mmi_jdd_ui_entry_notification_msg_popup(void);
  296. extern MMI_BOOL g_brw_title_icon_animation_status;
  297. /*****************************************************************************
  298.  * FUNCTION
  299.  *  mmi_brw_wap_init
  300.  * DESCRIPTION
  301.  *  Init function for browser application
  302.  * PARAMETERS
  303.  *  void
  304.  * RETURNS
  305.  *  void
  306.  *****************************************************************************/
  307. void mmi_brw_wap_init(void)
  308. {
  309.     /*----------------------------------------------------------------*/
  310.     /* Local Variables                                                */
  311.     /*----------------------------------------------------------------*/
  312.     /*----------------------------------------------------------------*/
  313.     /* Code Body                                                      */
  314.     /*----------------------------------------------------------------*/
  315.     jdd_MemSetActiveModuleID(E_TASK_BROWSER_UI);
  316.     g_brw_cntx.isBrowserReady = FALSE;
  317.     g_brw_cntx.isBrowserInitInProgress = TRUE;
  318.     mmi_jbrowser_startup();
  319.     /* Set Highlight handlers */
  320.     SetHiliteHandler(MENU_ID_BRW_HOMEPAGE, mmi_brw_homepage_highlight_hdlr);
  321.     SetHiliteHandler(MENU_ID_BRW_BOOKMARKS, mmi_brw_bookmark_menu_highlight_hdlr);
  322.     SetHiliteHandler(MENU_ID_BRW_BKM_GOTO, mmi_brw_goto_bookmark_menu_highlight_hdlr);
  323.     SetHiliteHandler(MENU_ID_BRW_BKM_EDIT, mmi_brw_edit_bookmark_menu_highlight_hdlr);
  324.     SetHiliteHandler(MENU_ID_BRW_BKM_DELETE, mmi_brw_delete_bookmark_menu_highlight_hdlr);
  325.     SetHiliteHandler(MENU_ID_BRW_BKM_DELETE_ALL, mmi_brw_delete_all_bookmark_menu_highlight_hdlr);
  326.     SetHiliteHandler(MENU_ID_BRW_ADD_BOOKMARK, mmi_brw_add_bookmark_menu_highlight_hdlr);
  327.     SetHiliteHandler(MENU_ID_BRW_SET_AS_HOMEPAGE, mmi_brw_bookmark_set_as_homepage_menu_highlight_hdlr);
  328.     SetHiliteHandler(MENU_ID_BRW_RECENT_PAGES, mmi_brw_recent_pages_menu_highlight_hdlr);
  329.     SetHiliteHandler(MENU_ID_BRW_RECENT_PAGE_GOTO, mmi_brw_goto_recent_page_menu_highlight_hdlr);
  330.     SetHiliteHandler(MENU_ID_BRW_RECENT_PAGE_DELETE, mmi_brw_delete_recent_page_menu_highlight_hdlr);
  331.     SetHiliteHandler(MENU_ID_BRW_RECENT_PAGE_DELETE_ALL, mmi_brw_delete_all_recent_pages_menu_highlight_hdlr);
  332.     SetHiliteHandler(MENU_ID_BRW_ENTER_ADDRESS, mmi_brw_enter_address_menu_highlight_hdlr);
  333.     SetHiliteHandler(MENU_ID_BRW_SERVICE_INBOX, mmi_brw_service_inbox_menu_highlight_hdlr);
  334.     SetHiliteHandler(MENU_ID_BRW_PUSH_MSG_READ, mmi_brw_service_inbox_read_menu_highlight_hdlr);
  335.     SetHiliteHandler(MENU_ID_BRW_PUSH_MSG_DELETE, mmi_brw_service_inbox_delete_menu_highlight_hdlr);
  336.     SetHiliteHandler(MENU_ID_BRW_PUSH_MSG_DELETE_ALL, mmi_brw_service_inbox_delete_all_menu_highlight_hdlr);
  337.     SetHiliteHandler(MENU_ID_BRW_PUSH_MSG_READ_ACCEPT, mmi_brw_service_inbox_read_accept_menu_highlight_hdlr);
  338.     SetHiliteHandler(MENU_ID_BRW_PUSH_MSG_READ_DELETE, mmi_brw_service_inbox_read_delete_menu_highlight_hdlr);
  339. /* Hilite handlers for Enter Address Options List */
  340. SetHiliteHandler(MENU_ID_BRW_ENTER_ADR_GOTO, mmi_brw_enter_address_goto_menu_highlight_hdlr);
  341.     SetHiliteHandler(MENU_ID_BRW_ENTER_ADR_EDIT, mmi_brw_enter_address_edit_menu_highlight_hdlr);
  342. SetHiliteHandler(MENU_ID_BRW_ENTER_ADR_ADD_TO_BOOKMARK, mmi_brw_enter_address_add_to_bmk_menu_highlight_hdlr);
  343.     SetHiliteHandler(MENU_ID_BRW_ENTER_ADR_DELETE, mmi_brw_enter_address_delete_menu_highlight_hdlr);
  344.     SetHiliteHandler(MENU_ID_BRW_ENTER_ADR_DELETE_ALL, mmi_brw_enter_address_delete_all_menu_highlight_hdlr);
  345.     /* Set highlight handlers for settings menu items */
  346.     mmi_brw_setting_init();
  347.     /* Set highhandlers for rendered page options menu itmes */
  348.     mmi_rendered_page_init();
  349. }
  350. /*****************************************************************************
  351.  * FUNCTION
  352.  *  mmi_brw_homepage_highlight_hdlr
  353.  * DESCRIPTION
  354.  *  Highlight handler of homepage menu item.
  355.  *  Register key handlers.
  356.  * PARAMETERS
  357.  *  void
  358.  * RETURNS
  359.  *  void
  360.  *****************************************************************************/
  361. void mmi_brw_homepage_highlight_hdlr(void)
  362. {
  363.     /*----------------------------------------------------------------*/
  364.     /* Local Variables                                                */
  365.     /*----------------------------------------------------------------*/
  366.     /*----------------------------------------------------------------*/
  367.     /* Code Body                                                      */
  368.     /*----------------------------------------------------------------*/
  369.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  370.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  371.     SetLeftSoftkeyFunction(mmi_brw_entry_homepage, KEY_EVENT_UP);
  372. }
  373. /*****************************************************************************
  374.  * FUNCTION
  375.  *  mmi_brw_bookmark_menu_highlight_hdlr
  376.  * DESCRIPTION
  377.  *  Highlight handler of bookmark menu item.
  378.  *  Register key handlers.
  379.  * PARAMETERS
  380.  *  void
  381.  * RETURNS
  382.  *  void
  383.  *****************************************************************************/
  384. void mmi_brw_bookmark_menu_highlight_hdlr(void)
  385. {
  386.     /*----------------------------------------------------------------*/
  387.     /* Local Variables                                                */
  388.     /*----------------------------------------------------------------*/
  389.     /*----------------------------------------------------------------*/
  390.     /* Code Body                                                      */
  391.     /*----------------------------------------------------------------*/
  392.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  393.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  394.     SetLeftSoftkeyFunction(mmi_brw_entry_bookmark_list, KEY_EVENT_UP);
  395.     SetKeyHandler(mmi_brw_entry_bookmark_list, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  396. }
  397. /*****************************************************************************
  398.  * FUNCTION
  399.  *  mmi_brw_ren_page_add_to_bmk_highlight_hdlr
  400.  * DESCRIPTION
  401.  *  Highlight handler of Add to Bookmark menu item.
  402.  *  Register key handlers.
  403.  * PARAMETERS
  404.  *  void
  405.  * RETURNS
  406.  *  void
  407.  *****************************************************************************/
  408. void mmi_brw_ren_page_add_to_bmk_highlight_hdlr(void)
  409. {
  410.     /*----------------------------------------------------------------*/
  411.     /* Local Variables                                                */
  412.     /*----------------------------------------------------------------*/
  413.     /*----------------------------------------------------------------*/
  414.     /* Code Body                                                      */
  415.     /*----------------------------------------------------------------*/
  416.     SetLeftSoftkeyFunction(mmi_brw_save_page_url_title_to_bookmark, KEY_EVENT_UP);
  417. }
  418. /*****************************************************************************
  419.  * FUNCTION
  420.  *  mmi_brw_goto_bookmark_menu_highlight_hdlr
  421.  * DESCRIPTION
  422.  *  Highlight handler of goto menu item.
  423.  *  Register key handlers.
  424.  * PARAMETERS
  425.  *  void
  426.  * RETURNS
  427.  *  void
  428.  *****************************************************************************/
  429. void mmi_brw_goto_bookmark_menu_highlight_hdlr(void)
  430. {
  431.     /*----------------------------------------------------------------*/
  432.     /* Local Variables                                                */
  433.     /*----------------------------------------------------------------*/
  434.     /*----------------------------------------------------------------*/
  435.     /* Code Body                                                      */
  436.     /*----------------------------------------------------------------*/
  437.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  438.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  439.     SetLeftSoftkeyFunction(mmi_brw_goto_highlighted_bookmark, KEY_EVENT_UP);
  440.     /* SetKeyHandler(mmi_brw_goto_highlighted_bookmark,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
  441. }
  442. /*****************************************************************************
  443.  * FUNCTION
  444.  *  mmi_brw_edit_bookmark_menu_highlight_hdlr
  445.  * DESCRIPTION
  446.  *  Highlight handler of edit bookmark menu item.
  447.  * PARAMETERS
  448.  *  void
  449.  * RETURNS
  450.  *  void
  451.  *****************************************************************************/
  452. void mmi_brw_edit_bookmark_menu_highlight_hdlr(void)
  453. {
  454.     /*----------------------------------------------------------------*/
  455.     /* Local Variables                                                */
  456.     /*----------------------------------------------------------------*/
  457.     /*----------------------------------------------------------------*/
  458.     /* Code Body                                                      */
  459.     /*----------------------------------------------------------------*/
  460.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  461.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  462.     SetLeftSoftkeyFunction(mmi_brw_pre_entry_edit_bookmark, KEY_EVENT_UP);
  463.     SetKeyHandler(mmi_brw_pre_entry_edit_bookmark, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  464. }
  465. /*****************************************************************************
  466.  * FUNCTION
  467.  *  mmi_brw_delete_bookmark_menu_highlight_hdlr
  468.  * DESCRIPTION
  469.  *  Highlight handler of delete menu item.
  470.  * PARAMETERS
  471.  *  void
  472.  * RETURNS
  473.  *  void
  474.  *****************************************************************************/
  475. void mmi_brw_delete_bookmark_menu_highlight_hdlr(void)
  476. {
  477.     /*----------------------------------------------------------------*/
  478.     /* Local Variables                                                */
  479.     /*----------------------------------------------------------------*/
  480.     /*----------------------------------------------------------------*/
  481.     /* Code Body                                                      */
  482.     /*----------------------------------------------------------------*/
  483.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  484.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  485.     SetLeftSoftkeyFunction(mmi_brw_delete_confirm, KEY_EVENT_UP);
  486.     /* SetKeyHandler(mmi_brw_delete_confirm,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
  487. }
  488. /*****************************************************************************
  489.  * FUNCTION
  490.  *  mmi_brw_delete_all_bookmark_menu_highlight_hdlr
  491.  * DESCRIPTION
  492.  *  Highlight handler of Delete all menu item.
  493.  * PARAMETERS
  494.  *  void
  495.  * RETURNS
  496.  *  void
  497.  *****************************************************************************/
  498. void mmi_brw_delete_all_bookmark_menu_highlight_hdlr(void)
  499. {
  500.     /*----------------------------------------------------------------*/
  501.     /* Local Variables                                                */
  502.     /*----------------------------------------------------------------*/
  503.     /*----------------------------------------------------------------*/
  504.     /* Code Body                                                      */
  505.     /*----------------------------------------------------------------*/
  506.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  507.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  508.     SetLeftSoftkeyFunction(mmi_brw_confirm_delete_all_bookmark, KEY_EVENT_UP);
  509.     /* SetKeyHandler(mmi_brw_confirm_delete_all_bookmark,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
  510. }
  511. /*****************************************************************************
  512.  * FUNCTION
  513.  *  mmi_brw_add_bookmark_menu_highlight_hdlr
  514.  * DESCRIPTION
  515.  *  Highlight handler of add bookmark menu item.
  516.  * PARAMETERS
  517.  *  void
  518.  * RETURNS
  519.  *  void
  520.  *****************************************************************************/
  521. void mmi_brw_add_bookmark_menu_highlight_hdlr(void)
  522. {
  523.     /*----------------------------------------------------------------*/
  524.     /* Local Variables                                                */
  525.     /*----------------------------------------------------------------*/
  526.     /*----------------------------------------------------------------*/
  527.     /* Code Body                                                      */
  528.     /*----------------------------------------------------------------*/
  529.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  530.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  531.     SetLeftSoftkeyFunction(mmi_brw_pre_entry_add_bookmark, KEY_EVENT_UP);
  532.     SetKeyHandler(mmi_brw_pre_entry_add_bookmark, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  533. }
  534. /*****************************************************************************
  535.  * FUNCTION
  536.  *  mmi_brw_bookmark_set_as_homepage_menu_highlight_hdlr
  537.  * DESCRIPTION
  538.  *  Highlight handler of 'Set as homepage' menu item.
  539.  * PARAMETERS
  540.  *  void
  541.  * RETURNS
  542.  *  void
  543.  *****************************************************************************/
  544. void mmi_brw_bookmark_set_as_homepage_menu_highlight_hdlr(void)
  545. {
  546.     /*----------------------------------------------------------------*/
  547.     /* Local Variables                                                */
  548.     /*----------------------------------------------------------------*/
  549.     /*----------------------------------------------------------------*/
  550.     /* Code Body                                                      */
  551.     /*----------------------------------------------------------------*/
  552.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  553.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  554.     SetLeftSoftkeyFunction(mmi_brw_bookmark_set_as_homepage, KEY_EVENT_UP);
  555.     /* SetKeyHandler(mmi_brw_bookmark_set_as_homepage,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
  556. }
  557. /*****************************************************************************
  558.  * FUNCTION
  559.  *  mmi_brw_enter_address_goto_menu_highlight_hdlr
  560.  * DESCRIPTION
  561.  *  Highlight handler of Enter Address Goto Menu item.
  562.  *  Register key handlers.
  563.  * PARAMETERS
  564.  *  void
  565.  * RETURNS
  566.  *  void
  567.  *****************************************************************************/
  568. void mmi_brw_enter_address_goto_menu_highlight_hdlr(void)
  569. {
  570.     /*----------------------------------------------------------------*/
  571.     /* Local Variables                                                */
  572.     /*----------------------------------------------------------------*/
  573.     /*----------------------------------------------------------------*/
  574.     /* Code Body                                                      */
  575.     /*----------------------------------------------------------------*/
  576. /* Fetch the highlighted page and update the address history list */
  577.     SetLeftSoftkeyFunction(mmi_brw_update_address_history_list, KEY_EVENT_UP);
  578. }
  579. /*****************************************************************************
  580.  * FUNCTION
  581.  *  mmi_brw_enter_address_edit_menu_highlight_hdlr
  582.  * DESCRIPTION
  583.  *  Highlight handler of Enter Address Goto Menu item.
  584.  *  Register key handlers.
  585.  * PARAMETERS
  586.  *  void
  587.  * RETURNS
  588.  *  void
  589.  *****************************************************************************/
  590. void mmi_brw_enter_address_edit_menu_highlight_hdlr(void)
  591. {
  592.     /*----------------------------------------------------------------*/
  593.     /* Local Variables                                                */
  594.     /*----------------------------------------------------------------*/
  595.     /*----------------------------------------------------------------*/
  596.     /* Code Body                                                      */
  597.     /*----------------------------------------------------------------*/
  598. /* Fetch the highlighted page and update the address history list */
  599.     SetLeftSoftkeyFunction(mmi_brw_enter_address_edit_menu, KEY_EVENT_UP);
  600. }
  601. /*****************************************************************************
  602.  * FUNCTION
  603.  *  mmi_brw_enter_address_add_to_bmk_menu_highlight_hdlr
  604.  * DESCRIPTION
  605.  *  Highlight handler of Enter Address Add To BookMarks Menu item.
  606.  *  Register key handlers.
  607.  * PARAMETERS
  608.  *  void
  609.  * RETURNS
  610.  *  void
  611.  *****************************************************************************/
  612. void mmi_brw_enter_address_add_to_bmk_menu_highlight_hdlr(void)
  613. {
  614.     /*----------------------------------------------------------------*/
  615.     /* Local Variables                                                */
  616.     /*----------------------------------------------------------------*/
  617.     /*----------------------------------------------------------------*/
  618.     /* Code Body                                                      */
  619.     /*----------------------------------------------------------------*/
  620.     SetLeftSoftkeyFunction(mmi_brw_pre_entry_add_enter_address_bookmark, KEY_EVENT_UP);
  621. }
  622. /*****************************************************************************
  623.  * FUNCTION
  624.  *  mmi_brw_enter_address_delete_menu_highlight_hdlr
  625.  * DESCRIPTION
  626.  *  Highlight handler of Enter Address Delete Menu item.
  627.  *  Register key handlers.
  628.  * PARAMETERS
  629.  *  void
  630.  * RETURNS
  631.  *  void
  632.  *****************************************************************************/
  633. void mmi_brw_enter_address_delete_menu_highlight_hdlr(void)
  634. {
  635.     /*----------------------------------------------------------------*/
  636.     /* Local Variables                                                */
  637.     /*----------------------------------------------------------------*/
  638.     /*----------------------------------------------------------------*/
  639.     /* Code Body                                                      */
  640.     /*----------------------------------------------------------------*/
  641.     SetLeftSoftkeyFunction(mmi_brw_enter_address_delete_confirm, KEY_EVENT_UP);
  642. }
  643. /*****************************************************************************
  644.  * FUNCTION
  645.  *  mmi_brw_enter_address_delete_all_menu_highlight_hdlr
  646.  * DESCRIPTION
  647.  *  Highlight handler of Enter Address DeleteAll Menu item.
  648.  *  Register key handlers.
  649.  * PARAMETERS
  650.  *  void
  651.  * RETURNS
  652.  *  void
  653.  *****************************************************************************/
  654. void mmi_brw_enter_address_delete_all_menu_highlight_hdlr(void)
  655. {
  656.     /*----------------------------------------------------------------*/
  657.     /* Local Variables                                                */
  658.     /*----------------------------------------------------------------*/
  659.     /*----------------------------------------------------------------*/
  660.     /* Code Body                                                      */
  661.     /*----------------------------------------------------------------*/
  662.     SetLeftSoftkeyFunction(mmi_brw_enter_address_delete_all_confirm, KEY_EVENT_UP);
  663. }
  664. /*****************************************************************************
  665.  * FUNCTION
  666.  *  mmi_brw_recent_pages_menu_highlight_hdlr
  667.  * DESCRIPTION
  668.  *  Highlight handler of Recent pages menu item.
  669.  *  Register key handlers.
  670.  * PARAMETERS
  671.  *  void
  672.  * RETURNS
  673.  *  void
  674.  *****************************************************************************/
  675. void mmi_brw_recent_pages_menu_highlight_hdlr(void)
  676. {
  677.     /*----------------------------------------------------------------*/
  678.     /* Local Variables                                                */
  679.     /*----------------------------------------------------------------*/
  680.     /*----------------------------------------------------------------*/
  681.     /* Code Body                                                      */
  682.     /*----------------------------------------------------------------*/
  683.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  684.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  685.     SetLeftSoftkeyFunction(mmi_brw_entry_recent_page_list, KEY_EVENT_UP);
  686.     SetKeyHandler(mmi_brw_entry_recent_page_list, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  687. }
  688. /*****************************************************************************
  689.  * FUNCTION
  690.  *  mmi_brw_goto_recent_page_menu_highlight_hdlr
  691.  * DESCRIPTION
  692.  *  Highlight handler of goto menu item.
  693.  * PARAMETERS
  694.  *  void
  695.  * RETURNS
  696.  *  void
  697.  *****************************************************************************/
  698. void mmi_brw_goto_recent_page_menu_highlight_hdlr(void)
  699. {
  700.     /*----------------------------------------------------------------*/
  701.     /* Local Variables                                                */
  702.     /*----------------------------------------------------------------*/
  703.     /*----------------------------------------------------------------*/
  704.     /* Code Body                                                      */
  705.     /*----------------------------------------------------------------*/
  706.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  707.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  708.     SetLeftSoftkeyFunction(mmi_brw_goto_highlighted_recent_page, KEY_EVENT_UP);
  709.     /* SetKeyHandler(mmi_brw_goto_highlighted_recent_page,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
  710. }
  711. /*****************************************************************************
  712.  * FUNCTION
  713.  *  mmi_brw_delete_recent_page_menu_highlight_hdlr
  714.  * DESCRIPTION
  715.  *  Highlight handler of delete menu item.
  716.  * PARAMETERS
  717.  *  void
  718.  * RETURNS
  719.  *  void
  720.  *****************************************************************************/
  721. void mmi_brw_delete_recent_page_menu_highlight_hdlr(void)
  722. {
  723.     /*----------------------------------------------------------------*/
  724.     /* Local Variables                                                */
  725.     /*----------------------------------------------------------------*/
  726.     /*----------------------------------------------------------------*/
  727.     /* Code Body                                                      */
  728.     /*----------------------------------------------------------------*/
  729.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  730.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  731.     SetLeftSoftkeyFunction(mmi_brw_confirm_delete_recent_page, KEY_EVENT_UP);
  732.     /* SetKeyHandler(mmi_brw_confirm_delete_recent_page,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
  733. }
  734. /*****************************************************************************
  735.  * FUNCTION
  736.  *  mmi_brw_delete_all_recent_pages_menu_highlight_hdlr
  737.  * DESCRIPTION
  738.  *  Highlight handler of Delete all menu item.
  739.  * PARAMETERS
  740.  *  void
  741.  * RETURNS
  742.  *  void
  743.  *****************************************************************************/
  744. void mmi_brw_delete_all_recent_pages_menu_highlight_hdlr(void)
  745. {
  746.     /*----------------------------------------------------------------*/
  747.     /* Local Variables                                                */
  748.     /*----------------------------------------------------------------*/
  749.     /*----------------------------------------------------------------*/
  750.     /* Code Body                                                      */
  751.     /*----------------------------------------------------------------*/
  752.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  753.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  754.     SetLeftSoftkeyFunction(mmi_brw_confirm_delete_all_recent_pages, KEY_EVENT_UP);
  755.     /* SetKeyHandler(mmi_brw_confirm_delete_all_recent_pages,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
  756. }
  757. /*****************************************************************************
  758.  * FUNCTION
  759.  *  mmi_brw_enter_address_menu_highlight_hdlr
  760.  * DESCRIPTION
  761.  *  Highlight handler of enter address menu item.
  762.  *  Register key handlers.
  763.  * PARAMETERS
  764.  *  void
  765.  * RETURNS
  766.  *  void
  767.  *****************************************************************************/
  768. void mmi_brw_enter_address_menu_highlight_hdlr(void)
  769. {
  770.     /*----------------------------------------------------------------*/
  771.     /* Local Variables                                                */
  772.     /*----------------------------------------------------------------*/
  773.     /*----------------------------------------------------------------*/
  774.     /* Code Body                                                      */
  775.     /*----------------------------------------------------------------*/
  776.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  777.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  778.     SetLeftSoftkeyFunction(mmi_brw_entry_enter_address, KEY_EVENT_UP);
  779.     SetKeyHandler(mmi_brw_entry_enter_address, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  780. }
  781. /*****************************************************************************
  782.  * FUNCTION
  783.  *  mmi_brw_service_inbox_menu_highlight_hdlr
  784.  * DESCRIPTION
  785.  *  Highlight handler of service inbox menu item.
  786.  *  Register key handlers.
  787.  * PARAMETERS
  788.  *  void
  789.  * RETURNS
  790.  *  void
  791.  *****************************************************************************/
  792. void mmi_brw_service_inbox_menu_highlight_hdlr(void)
  793. {
  794. #ifndef __MMI_UNIFIED_MESSAGE__
  795.     /*----------------------------------------------------------------*/
  796.     /* Local Variables                                                */
  797.     /*----------------------------------------------------------------*/
  798.     /*----------------------------------------------------------------*/
  799.     /* Code Body                                                      */
  800.     /*----------------------------------------------------------------*/
  801.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  802.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  803.     SetLeftSoftkeyFunction(mmi_brw_entry_service_inbox, KEY_EVENT_UP);
  804.     SetKeyHandler(mmi_brw_entry_service_inbox, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  805. #endif /* __MMI_UNIFIED_MESSAGE__ */ 
  806. }
  807. /*****************************************************************************
  808.  * FUNCTION
  809.  *  mmi_brw_service_inbox_read_menu_highlight_hdlr
  810.  * DESCRIPTION
  811.  *  Highlight handler of read menu item.
  812.  * PARAMETERS
  813.  *  void
  814.  * RETURNS
  815.  *  void
  816.  *****************************************************************************/
  817. void mmi_brw_service_inbox_read_menu_highlight_hdlr(void)
  818. {
  819.     /*----------------------------------------------------------------*/
  820.     /* Local Variables                                                */
  821.     /*----------------------------------------------------------------*/
  822.     /*----------------------------------------------------------------*/
  823.     /* Code Body                                                      */
  824.     /*----------------------------------------------------------------*/
  825.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  826.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  827.     SetLeftSoftkeyFunction(mmi_brw_entry_read_push_message, KEY_EVENT_UP);
  828.     /* SetKeyHandler(mmi_brw_entry_read_push_message,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
  829. }
  830. /*****************************************************************************
  831.  * FUNCTION
  832.  *  mmi_brw_service_inbox_delete_menu_highlight_hdlr
  833.  * DESCRIPTION
  834.  *  Highlight handler of Delete menu item.
  835.  * PARAMETERS
  836.  *  void
  837.  * RETURNS
  838.  *  void
  839.  *****************************************************************************/
  840. void mmi_brw_service_inbox_delete_menu_highlight_hdlr(void)
  841. {
  842. #ifndef __MMI_UNIFIED_MESSAGE__
  843.     /*----------------------------------------------------------------*/
  844.     /* Local Variables                                                */
  845.     /*----------------------------------------------------------------*/
  846.     /*----------------------------------------------------------------*/
  847.     /* Code Body                                                      */
  848.     /*----------------------------------------------------------------*/
  849.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  850.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  851.     SetLeftSoftkeyFunction(mmi_brw_confirm_delete_push_message, KEY_EVENT_UP);
  852.     /* SetKeyHandler(mmi_brw_confirm_delete_push_message,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
  853. #endif /* __MMI_UNIFIED_MESSAGE__ */ 
  854. }
  855. /*****************************************************************************
  856.  * FUNCTION
  857.  *  mmi_brw_service_inbox_delete_all_menu_highlight_hdlr
  858.  * DESCRIPTION
  859.  *  Highlight handler of Delete all menu item.
  860.  * PARAMETERS
  861.  *  void
  862.  * RETURNS
  863.  *  void
  864.  *****************************************************************************/
  865. void mmi_brw_service_inbox_delete_all_menu_highlight_hdlr(void)
  866. {
  867.     /*----------------------------------------------------------------*/
  868.     /* Local Variables                                                */
  869.     /*----------------------------------------------------------------*/
  870.     /*----------------------------------------------------------------*/
  871.     /* Code Body                                                      */
  872.     /*----------------------------------------------------------------*/
  873.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  874.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  875.     SetLeftSoftkeyFunction(mmi_brw_confirm_delete_all_push_messages, KEY_EVENT_UP);
  876.     /* SetKeyHandler(mmi_brw_confirm_delete_all_push_messages,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
  877. }
  878. /*****************************************************************************
  879.  * FUNCTION
  880.  *  mmi_brw_service_inbox_read_accept_menu_highlight_hdlr
  881.  * DESCRIPTION
  882.  *  Highlight handler of Accept menu item.
  883.  * PARAMETERS
  884.  *  void
  885.  * RETURNS
  886.  *  void
  887.  *****************************************************************************/
  888. void mmi_brw_service_inbox_read_accept_menu_highlight_hdlr(void)
  889. {
  890.     /*----------------------------------------------------------------*/
  891.     /* Local Variables                                                */
  892.     /*----------------------------------------------------------------*/
  893.     /*----------------------------------------------------------------*/
  894.     /* Code Body                                                      */
  895.     /*----------------------------------------------------------------*/
  896.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  897.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  898.     SetLeftSoftkeyFunction(mmi_brw_accept_push_message, KEY_EVENT_UP);
  899.     /* SetKeyHandler(mmi_brw_accept_push_message,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
  900. }
  901. /*****************************************************************************
  902.  * FUNCTION
  903.  *  mmi_brw_service_inbox_read_delete_menu_highlight_hdlr
  904.  * DESCRIPTION
  905.  *  Highlight handler of Delete push message after reading
  906.  * PARAMETERS
  907.  *  void
  908.  * RETURNS
  909.  *  void
  910.  *****************************************************************************/
  911. void mmi_brw_service_inbox_read_delete_menu_highlight_hdlr(void)
  912. {
  913.     /*----------------------------------------------------------------*/
  914.     /* Local Variables                                                */
  915.     /*----------------------------------------------------------------*/
  916.     /*----------------------------------------------------------------*/
  917.     /* Code Body                                                      */
  918.     /*----------------------------------------------------------------*/
  919.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  920.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  921.     SetLeftSoftkeyFunction(mmi_brw_confirm_delete_push_message, KEY_EVENT_UP);
  922.     /* SetKeyHandler(mmi_brw_confirm_delete_push_message,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
  923. }
  924. /*****************************************************************************
  925.  * FUNCTION
  926.  *  mmi_brw_pre_entry_internet_services
  927.  * DESCRIPTION
  928.  *  Pre Entry function for Internet services screen
  929.  * PARAMETERS
  930.  *  void
  931.  * RETURNS
  932.  *  void
  933.  *****************************************************************************/
  934. void mmi_brw_pre_entry_internet_services(void)
  935. {
  936.     /* PIXTEL_JATAAYU added */
  937.     mmi_JBrowserInitApp();
  938.     /* PIXTEL_JATAAYU added */
  939.     /* Added to indicate that SAT is not active */
  940.     g_brw_cntx.isSATURL = E_FALSE;
  941. mmi_brw_entry_internet_services();
  942. }
  943. /*****************************************************************************
  944.  * FUNCTION
  945.  *  mmi_brw_entry_internet_services
  946.  * DESCRIPTION
  947.  *  Entry function for Internet services screen
  948.  * PARAMETERS
  949.  *  void
  950.  * RETURNS
  951.  *  void
  952.  *****************************************************************************/
  953. void mmi_brw_entry_internet_services(void)
  954. {
  955.     /*----------------------------------------------------------------*/
  956.     /* Local Variables                                                */
  957.     /*----------------------------------------------------------------*/
  958.     U16 UC_list_of_items[6];
  959.     U16 UC_list_of_icons[6];
  960.     U8 *guiBuffer;
  961.     S32 num_of_items;
  962.     /*----------------------------------------------------------------*/
  963.     /* Code Body                                                      */
  964.     /*----------------------------------------------------------------*/
  965.     /* Free the memory if already allocated */
  966.    // mmi_brw_wap_deinit();
  967.     /* PIXTEL_JATAAYU added */
  968.    // mmi_JBrowserInitApp();
  969.     /* PIXTEL_JATAAYU added */
  970.     /* Added to indicate that SAT is not active */
  971.    // g_brw_cntx.isSATURL = E_FALSE;
  972. g_brw_enter_add_flag = 0;/*added by tk to reset the flag of enter address screen's highlighter*/
  973.     EntryNewScreen(SCR_ID_BRW_INTERNET_SERVICES, NULL, mmi_brw_entry_internet_services, NULL);
  974.     guiBuffer = GetCurrGuiBuffer(SCR_ID_BRW_INTERNET_SERVICES);
  975.     num_of_items = GetNumOfChild(SERVICES_WAP_MENU_ID);
  976.     GetSequenceStringIds(SERVICES_WAP_MENU_ID, UC_list_of_items);
  977.     GetSequenceImageIds(SERVICES_WAP_MENU_ID, UC_list_of_icons);
  978.     SetParentHandler(SERVICES_WAP_MENU_ID);
  979.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  980.     ShowCategory15Screen(
  981.         STR_ID_BRW_INTERNET_SERVICES,
  982.         GetRootTitleIcon(SERVICES_WAP_MENU_ID),
  983.         STR_GLOBAL_OK,
  984.         0,
  985.         STR_GLOBAL_BACK,
  986.         0,
  987.         num_of_items,
  988.         UC_list_of_items,
  989.         UC_list_of_icons,
  990.         LIST_MENU,
  991.         0,
  992.         guiBuffer);
  993.     SetRightSoftkeyFunction(mmi_brw_GoBackServicesMenu, KEY_EVENT_UP);
  994.     SetKeyHandler(mmi_brw_GoBackServicesMenu, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  995. }
  996. /*****************************************************************************
  997.  * FUNCTION
  998.  *  mmi_brw_GoBackServicesMenu
  999.  * DESCRIPTION
  1000.  *  Function to go back to services menu
  1001.  * PARAMETERS
  1002.  *  void
  1003.  * RETURNS
  1004.  *  void
  1005.  *****************************************************************************/
  1006. void mmi_brw_GoBackServicesMenu(void)
  1007. {
  1008.     /*----------------------------------------------------------------*/
  1009.     /* Local Variables                                                */
  1010.     /*----------------------------------------------------------------*/
  1011.     /*----------------------------------------------------------------*/
  1012.     /* Code Body                                                      */
  1013.     /*----------------------------------------------------------------*/
  1014.     //mmi_JBrowserDeInitApp();
  1015.      mmi_brw_wap_deinit();
  1016.      GoBackHistory();
  1017. }
  1018. /*****************************************************************************
  1019.  * FUNCTION
  1020.  *  mmi_brw_entry_homepage
  1021.  * DESCRIPTION
  1022.  *  Entry function for homepage menu
  1023.  * PARAMETERS
  1024.  *  void
  1025.  * RETURNS
  1026.  *  void
  1027.  *****************************************************************************/
  1028. void mmi_brw_entry_homepage(void)
  1029. {
  1030.     /*----------------------------------------------------------------*/
  1031.     /* Local Variables                                                */
  1032.     /*----------------------------------------------------------------*/
  1033.     MMI_BOOL IsValidURL = MMI_FALSE;
  1034.     U8 curr_act_profile_url[BRW_WAP_PROFILE_HOMEPAGE_URL_LEN * ENCODING_LENGTH];
  1035.     /*----------------------------------------------------------------*/
  1036.     /* Code Body                                                      */
  1037.     /*----------------------------------------------------------------*/
  1038.     strcpy((S8*) curr_act_profile_url, (S8*) mmi_ph_brw_get_activated_profile_homepage());
  1039.     AnsiiToUnicodeString((S8*) brw_current_url, (S8*) curr_act_profile_url);
  1040.     IsValidURL = mmi_brw_validate_url(brw_current_url);
  1041.     if (IsValidURL == MMI_TRUE)
  1042.     {
  1043.         /* added by tk to set the current fetch url */
  1044.         mmi_brw_set_current_url((S8*) brw_current_url);
  1045.         mmi_brw_pre_entry_goto_url();
  1046.     }
  1047.     else
  1048.     {
  1049.         DisplayPopup((PU8) GetString(STR_ID_BRW_INVALID_URL), IMG_GLOBAL_ERROR, 1, JBROWSER_POPUP_TIME, ERROR_TONE);
  1050.     }
  1051. }
  1052. /*****************************************************************************
  1053.  * FUNCTION
  1054.  *  mmi_brw_clear_key_handler
  1055.  * DESCRIPTION
  1056.  *  Clear all key types handler for agiven key code
  1057.  * PARAMETERS
  1058.  *  key_code        [IN]        
  1059.  * RETURNS
  1060.  *  void
  1061.  *****************************************************************************/
  1062. void mmi_brw_clear_key_handler(U16 key_code)
  1063. {
  1064.     /*----------------------------------------------------------------*/
  1065.     /* Local Variables                                                */
  1066.     /*----------------------------------------------------------------*/
  1067.     /*----------------------------------------------------------------*/
  1068.     /* Code Body                                                      */
  1069.     /*----------------------------------------------------------------*/
  1070.     ClearKeyHandler(key_code, KEY_EVENT_UP);
  1071.     ClearKeyHandler(key_code, KEY_EVENT_DOWN);
  1072.     ClearKeyHandler(key_code, KEY_LONG_PRESS);
  1073.     ClearKeyHandler(key_code, KEY_REPEAT);
  1074. }
  1075. /*****************************************************************************
  1076.  * FUNCTION
  1077.  *  mmi_brw_wap_deinit
  1078.  * DESCRIPTION
  1079.  *  Free the memory allocated and close the browser window.
  1080.  * PARAMETERS
  1081.  *  void
  1082.  * RETURNS
  1083.  *  void
  1084.  *****************************************************************************/
  1085. void mmi_brw_wap_deinit(void)
  1086. {
  1087.     /*----------------------------------------------------------------*/
  1088.     /* Local Variables                                                */
  1089.     /*----------------------------------------------------------------*/
  1090.     /*----------------------------------------------------------------*/
  1091.     /* Code Body                                                      */
  1092.     /*----------------------------------------------------------------*/
  1093.     /* Added by tk to free allocated memory for URL */
  1094. PRINT_INFORMATION(("Inside mmi_brw_wap_deinit"));
  1095.     if (fetchUrlInfo.psUrl != NULL)
  1096.     {
  1097.         jdd_MemFree(fetchUrlInfo.psUrl);
  1098.         fetchUrlInfo.psUrl = NULL;
  1099.     }
  1100.     /* Free memory allocated to bookmarks */
  1101.     if (g_brw_cntx.bookmark_title_p != NULL)
  1102.     {
  1103.         jdd_MemFree(g_brw_cntx.bookmark_title_p);
  1104.         g_brw_cntx.bookmark_title_p = NULL;
  1105.     }
  1106.     /* Free memory allocated to bookmarks */
  1107.     if (g_brw_cntx.bookmark_url_p != NULL)
  1108.     {
  1109.         jdd_MemFree(g_brw_cntx.bookmark_url_p);
  1110.         g_brw_cntx.bookmark_url_p = NULL;
  1111.     }
  1112.     /* Free memory allocated to address history title */
  1113.     if (g_brw_cntx.address_history_title_p != NULL)
  1114.     {
  1115.         jdd_MemFree(g_brw_cntx.address_history_title_p);
  1116.         g_brw_cntx.address_history_title_p = NULL;
  1117.     }
  1118.     /* Free memory allocated to address history url */
  1119.     if (g_brw_cntx.address_history_url_p != NULL)
  1120.     {
  1121.         jdd_MemFree(g_brw_cntx.address_history_url_p);
  1122.         g_brw_cntx.address_history_url_p = NULL;
  1123.     }
  1124.     g_brw_cntx.total_address_history_items = 0;
  1125.     g_brw_cntx.total_bookmark_items = 0;
  1126.     g_brw_cntx.index_highlighted_item = 0;
  1127.     g_brw_add_hist_flag = 0;
  1128. g_brw_enter_add_flag = 0;
  1129. g_BrwCsdCallDisconnect = FALSE;
  1130. g_EndKey_pressed = FALSE;
  1131.     /* Free the do list if exists */
  1132.     if (g_brw_cntx.DoElementList != NULL)
  1133.     {
  1134.         mmi_brw_free_do_list();
  1135.     }
  1136.     /* Added by Pawan (31-07-06) */
  1137.     /* Free memory allocated to prompt edit buffer */
  1138.     if (g_brw_cntx.prompt_buffer != NULL)
  1139.     {
  1140.         jdd_MemFree(g_brw_cntx.prompt_buffer);
  1141.         g_brw_cntx.prompt_buffer = NULL;
  1142.     }
  1143.     /* Added by Vivek - 31072006 */
  1144.     mmi_brw_push_free_service_value_struct(&g_current_service_message);
  1145.     
  1146. if (g_brw_cntx.isLayoutInitialized == E_TRUE)
  1147.     {
  1148.     #ifdef __SATC3__
  1149.         if (g_brw_cntx.isSATURL == E_TRUE)
  1150.         {
  1151.             brw_send_termination_to_mmi(BRW_SAT_ERROR_TERMINATION);
  1152.         }
  1153.     #endif /* __SATC3__ */ 
  1154.         if (g_brw_page_cntx.brw_PageFetchStatus || g_brw_cntx.isDownloadSuspended == TRUE || g_brw_cntx.isDownloading == TRUE)  // Sandeep: Added For DLS
  1155.         {
  1156.             jdi_BrowserFetchStop(pBrowserCtxt);
  1157. #ifdef __JBROWSER_DLS_SUPPORT__
  1158. if (g_brw_cntx.isDownloading == TRUE)
  1159. {
  1160. // MAUI_00019199: Start
  1161. mmi_brw_dls_send_file_dl_progress_ind(WAP_DL_STATUS_ABORTED, WAP_DL_ERROR_CANCELLED);
  1162. // MAUI_00019199: Stop
  1163. g_brw_cntx.isDownloadSuspended = FALSE;
  1164. g_brw_cntx.isDownloading = FALSE;
  1165.     if (g_brw_cntx.dwnld_file_handle)
  1166.     {
  1167.         jdd_FSClose(g_brw_cntx.dwnld_file_handle);
  1168. g_brw_cntx.dwnld_file_handle = NULL;
  1169. if (g_brw_dls_cntx.p_file_name != NULL && g_brw_cntx.dwnld_fs_handle != NULL)
  1170. {
  1171. jdd_FSDelete(g_brw_cntx.dwnld_fs_handle, g_brw_dls_cntx.p_file_name); // Delete file
  1172. jdd_MemFree(g_brw_dls_cntx.p_file_name);
  1173. g_brw_dls_cntx.p_file_name = NULL;
  1174. }
  1175.     }
  1176.     if (g_brw_cntx.dwnld_fs_handle)
  1177.     {
  1178.         jdd_FSDeinitialize(g_brw_cntx.dwnld_fs_handle);
  1179. g_brw_cntx.dwnld_fs_handle = NULL;
  1180.     }
  1181. }
  1182. #endif /* __JBROWSER_DLS_SUPPORT__ */
  1183.         }
  1184.         jdi_BrowserClose(pBrowserCtxt, E_TRUE);
  1185.         mmi_JBrowserDeInitApp();
  1186. /*Release all the allocated memory from browser pool before it*/
  1187. #ifdef JBROWSER_USE_ASM
  1188. applib_mem_ap_free_all(APPLIB_MEM_AP_ID_JATAAYU_WAP);
  1189. jdd_MemDeinitBrowserASMPool();
  1190. #endif
  1191.     }
  1192.     g_brw_notificationFlag = 0;
  1193.     memset(&g_brw_page_cntx, 0, sizeof(g_brw_page_cntx));
  1194. g_brw_title_icon_animation_status = MMI_FALSE;
  1195.     memset(g_brw_page_cntx.brw_PageStatusCodeStack, -1, sizeof(g_brw_page_cntx.brw_PageStatusCodeStack));
  1196.     g_brw_cntx.page_fetchReqSrc = 0;
  1197. g_CSDcall_aborted_status = FALSE;
  1198.     g_mmi_brw_delete_push_notification = MMI_FALSE;
  1199. PRINT_INFORMATION(("Exit mmi_brw_wap_deinit"));
  1200. }
  1201. /*****************************************************************************
  1202.  * FUNCTION
  1203.  *  mmi_brw_clear_brw_soft_keys
  1204.  * DESCRIPTION
  1205.  *  Clear browser left and right soft keys
  1206.  * PARAMETERS
  1207.  *  void
  1208.  * RETURNS
  1209.  *  void
  1210.  *****************************************************************************/
  1211. void mmi_brw_clear_brw_soft_keys(void)
  1212. {
  1213.     /*----------------------------------------------------------------*/
  1214.     /* Local Variables                                                */
  1215.     /*----------------------------------------------------------------*/
  1216.     /*----------------------------------------------------------------*/
  1217.     /* Code Body                                                      */
  1218.     /*----------------------------------------------------------------*/
  1219.     g_brw_LskLabel = 0;
  1220.     g_brw_RskLabel = 0;
  1221.     g_brw_LskFunPtr = NULL;
  1222.     g_brw_RskFunPtr = NULL;
  1223. }
  1224. /*****************************************************************************
  1225.  * FUNCTION
  1226.  *  mmi_brw_pre_entry_goto_url
  1227.  * DESCRIPTION
  1228.  *  Pre Entry function for fetching url i.e when the user wants to fetch a page
  1229.  * PARAMETERS
  1230.  *  void
  1231.  * RETURNS
  1232.  *  void
  1233.  *****************************************************************************/
  1234. void mmi_brw_pre_entry_goto_url(void)
  1235. {
  1236.     /*----------------------------------------------------------------*/
  1237.     /* Local Variables                                                */
  1238.     /*----------------------------------------------------------------*/
  1239.     MMI_JDD_UI_WINDOW_INFO_STRUCT *jdd_window_info_struct_p = NULL;
  1240.     JC_UINT32 uiWindowID = 0;
  1241.     /*----------------------------------------------------------------*/
  1242.     /* Code Body                                                      */
  1243.     /*----------------------------------------------------------------*/
  1244.     uiWindowID = mmi_jdd_ui_get_appWindowID(E_TASK_BROWSER_CORE);
  1245.     jdd_window_info_struct_p = (MMI_JDD_UI_WINDOW_INFO_STRUCT*) uiWindowID;
  1246.     g_brw_LskLabel = 0;
  1247.     g_brw_RskLabel = STR_GLOBAL_CANCEL;
  1248.     g_brw_LskFunPtr = NULL;
  1249.     g_brw_RskFunPtr = mmi_brw_stop_fetch;
  1250.     mmi_brw_entry_goto_url();
  1251. }
  1252. /*****************************************************************************
  1253.  * FUNCTION
  1254.  *  mmi_brw_entry_goto_url
  1255.  * DESCRIPTION
  1256.  *  Entry function for fetching url i.e when the user wants to fetch a page
  1257.  * PARAMETERS
  1258.  *  void
  1259.  * RETURNS
  1260.  *  void
  1261.  *****************************************************************************/
  1262. void mmi_brw_entry_goto_url(void)
  1263. {
  1264.     /*----------------------------------------------------------------*/
  1265.     /* Local Variables                                                */
  1266.     /*----------------------------------------------------------------*/
  1267.     MMI_JDD_UI_WINDOW_INFO_STRUCT *jdd_window_info_struct_p = NULL;
  1268.     JC_UINT32 uiWindowID = 0;
  1269.     U8 *guiBuffer;
  1270.     U8 flag = 0;
  1271.     U8 category501_msgStr[4] = {0, };
  1272.     /*----------------------------------------------------------------*/
  1273.     /* Code Body                                                      */
  1274.     /*----------------------------------------------------------------*/
  1275.     uiWindowID = mmi_jdd_ui_get_appWindowID(E_TASK_BROWSER_CORE);
  1276.     jdd_window_info_struct_p = (MMI_JDD_UI_WINDOW_INFO_STRUCT*) uiWindowID;
  1277.     /* This will redraw the Primary MMI Window screen after any interrupt */
  1278.     PRINT_INFORMATION(("Enter Browser Screen 501"));
  1279.     EntryNewScreen(SCR_ID_BRW_JBROWSER_MAIN, mmi_brw_exit_goto_url, mmi_brw_entry_goto_url, NULL);
  1280.     guiBuffer = GetCurrGuiBuffer(SCR_ID_BRW_JBROWSER_MAIN);
  1281.     if (guiBuffer != NULL)
  1282.     {
  1283.         flag = 1;
  1284.     }
  1285.     if (IsScreenPresent(SCR_ID_BRW_JBROWSER_MAIN) && GetCurrScrnId() != SCR_ID_BRW_JBROWSER_MAIN)
  1286.     {
  1287.         if(g_brw_cntx.launch_brw_ext_app)
  1288.         {
  1289.             DeleteScreenIfPresent(SCR_ID_BRW_JBROWSER_MAIN);
  1290.         }
  1291.         else
  1292.         {
  1293.             DeleteNScrId(SCR_ID_BRW_JBROWSER_MAIN);
  1294.         }
  1295.     }
  1296.     g_brw_cntx.launch_brw_ext_app = MMI_FALSE;
  1297.     /* Here we are applying one hack to remove the DALMATIAN DOG IMAGE from the category screen.
  1298.        We will display the image whenever the browser is launched for the first time.
  1299.        For the first time we will pass category501_msgID = 0 so it will display the DOG IMAGE 
  1300.        and after this we will pass a string ID which has been populated for this specially to 
  1301.        display one blank space.Because, a single chracter can restrict the DALMATIAN DOG IMAGE
  1302.        to be rendered on Screen. */
  1303. #ifdef __MMI_UI_DALMATIAN_EDITOR__
  1304.     AnsiiToUnicodeString((PS8) category501_msgStr, " ");
  1305. #endif 
  1306.     ShowCategory501Screen(
  1307.         0,/* STR_ID_BRW_INTERNET_SERVICES, */
  1308.         0,/*GetRootTitleIcon(SERVICES_WAP_MENU_ID),*/
  1309.         0,/* g_brw_LskLabel, */
  1310.         0,
  1311.         0,/* g_brw_RskLabel, */
  1312.         0,
  1313.         category501_msgStr,
  1314.         guiBuffer);
  1315.     /* PIXTEL_JATAAYU added */
  1316.     if (jdd_window_info_struct_p != NULL)
  1317.     {
  1318.         if (jdd_window_info_struct_p->focussedCtrlTitleControlID != 0)
  1319.         {
  1320.             MMI_title_string = (UI_string_type) mmi_brw_get_focussed_ctrl_title();
  1321.         }
  1322.         else if (jdd_window_info_struct_p->winProp.pszCaptionValue != NULL)
  1323.         {
  1324.             MMI_title_string = (UI_string_type) jdd_window_info_struct_p->winProp.pszCaptionValue;
  1325.         }
  1326.         else
  1327.         {
  1328.             /* MMI_title_string = (UI_string_type) brw_current_url; */
  1329.         }
  1330.     }
  1331.     if (g_brw_page_cntx.brw_PageFetchStatus)
  1332.     {
  1333. g_brw_title_icon_animation_status = MMI_FALSE;
  1334.         mmi_brw_show_animated_title();
  1335.     }
  1336.     else
  1337.     {
  1338.         mmi_brw_show_normal_title();
  1339.     }
  1340.     if (E_FALSE == mmi_jdd_ui_get_jdd_flag(JDD_RENDERING_STARTED))
  1341.     {
  1342.         mmi_brw_start_animated_splash_screen();
  1343.     }
  1344.     mmi_brw_clear_key_handler(KEY_VOL_UP);
  1345.     mmi_brw_clear_key_handler(KEY_VOL_DOWN);
  1346.     SetKeyHandler(mmi_jdd_ui_left_key_hdlr, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1347.     SetKeyHandler(mmi_jdd_ui_right_key_hdlr, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1348.     SetKeyHandler(mmi_jdd_ui_down_key_hdlr, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
  1349.     SetKeyHandler(mmi_jdd_ui_down_key_hdlr, KEY_VOL_DOWN, KEY_EVENT_DOWN);
  1350.     SetKeyHandler(mmi_jdd_ui_up_key_hdlr, KEY_UP_ARROW, KEY_EVENT_DOWN);
  1351.     SetKeyHandler(mmi_jdd_ui_up_key_hdlr, KEY_VOL_UP, KEY_EVENT_DOWN);
  1352.     SetKeyHandler(mmi_jdd_ui_wap_key_hdlr, KEY_WAP, KEY_EVENT_UP);      /* replaced key event down to key event up added by tk */
  1353.     SetKeyHandler(mmi_jdd_ui_wap_key_hdlr, KEY_SEND, KEY_EVENT_UP);     /* replaced key event down to key event up added by tk */
  1354. mmi_brw_register_endkey_handler();
  1355.     
  1356.     /* Below added by Shantanu for accesskey Support - 20060412 */
  1357.     mmi_brw_register_accesskey_handler();
  1358.     #ifdef __MMI_TOUCH_SCREEN__
  1359.     mmi_jdd_ui_register_pen_handler();
  1360.     #endif
  1361.     if (flag == 0)
  1362.     {
  1363.         mmi_brw_goto_url();
  1364.     }
  1365.     else if (g_brw_page_cntx.brw_PageFetchStatus)
  1366.     {
  1367.         g_brw_LskLabel = 0;
  1368.         g_brw_RskLabel = STR_GLOBAL_CANCEL;
  1369.         g_brw_LskFunPtr = NULL;
  1370.         g_brw_RskFunPtr = mmi_brw_stop_fetch;
  1371.     }
  1372.     else if (g_brw_page_cntx.brw_PageRefreshDispStatus)
  1373.     {
  1374.         g_brw_LskLabel = 0;
  1375.         g_brw_RskLabel = STR_GLOBAL_CANCEL;
  1376.         g_brw_LskFunPtr = NULL;
  1377.         g_brw_RskFunPtr = NULL;
  1378.        
  1379.     }
  1380. /*    else
  1381.     {
  1382.         if (!g_brw_ActiveScreenFlag)
  1383.         {
  1384.             g_brw_LskLabel = STR_GLOBAL_OPTIONS;
  1385.             g_brw_LskFunPtr = mmi_brw_rendered_page_options;
  1386.             g_brw_RskLabel = 0;
  1387.             g_brw_RskFunPtr = NULL;
  1388.             if (E_TRUE == mmi_brw_is_back())
  1389.             {
  1390.                 g_brw_RskLabel = STR_GLOBAL_BACK;
  1391.                 g_brw_RskFunPtr = mmi_brw_goto_prev_page;
  1392.             }
  1393.             g_brw_ActiveScreenFlag = 0;
  1394.         }
  1395.         if (jdd_window_info_struct_p != NULL)
  1396.         {
  1397.             jdd_MMIShowWindow(uiWindowID, E_TRUE);
  1398.         }
  1399.     }
  1400. */
  1401.     if(flag && (jdd_window_info_struct_p != NULL))
  1402.     {
  1403.         jdd_MMIShowWindow(uiWindowID, E_TRUE);
  1404.     }
  1405. //g_brw_page_cntx.brw_isRefreshDisplay = MMI_FALSE;
  1406.     ChangeRightSoftkey(g_brw_RskLabel, 0);
  1407.     ChangeLeftSoftkey(g_brw_LskLabel, 0);
  1408.     SetLeftSoftkeyFunction((FuncPtr) g_brw_LskFunPtr, KEY_EVENT_UP);
  1409.     SetRightSoftkeyFunction((FuncPtr) g_brw_RskFunPtr, KEY_EVENT_UP);
  1410.     if (g_brw_notificationFlag)
  1411.     {
  1412.         g_brw_notificationFlag = 0;
  1413.         mmi_jdd_ui_entry_notification_msg_popup();
  1414.     }
  1415. }
  1416. /*****************************************************************************
  1417.  * FUNCTION
  1418.  *  mmi_brw_start_animated_splash_screen
  1419.  * DESCRIPTION
  1420.  *  
  1421.  * PARAMETERS
  1422.  *  void
  1423.  * RETURNS
  1424.  *  void
  1425.  *****************************************************************************/
  1426. void mmi_brw_start_animated_splash_screen(void)
  1427. {
  1428.     /*----------------------------------------------------------------*/
  1429.     /* Local Variables                                                */
  1430.     /*----------------------------------------------------------------*/
  1431.     DeviceCharacteristics dev_ch = {0};
  1432.     U8 *splash_img = NULL;
  1433.     S32 img_x = 0, img_y = 0, img_width = 0, img_height = 0;
  1434.     /*----------------------------------------------------------------*/
  1435.     /* Code Body                                                      */
  1436.     /*----------------------------------------------------------------*/
  1437.     mmi_brw_stop_animated_splash_screen();
  1438.     jdd_MMIGetDeviceCharacteristics(&dev_ch);
  1439.     splash_img = (PU8) GetImage(IMG_ID_BRW_SPLASH_SCREEN);
  1440.     gui_measure_image(splash_img, &img_width, &img_height);
  1441.     img_x = dev_ch.uiWindowX + ((dev_ch.uiRenderingWidth + dev_ch.uiScrollBarWidth - img_width) >> 1);
  1442.     img_y = dev_ch.uiWindowY + ((dev_ch.uiRenderingHeight + dev_ch.uiScrollBarWidth - img_height) >> 1);
  1443.     gui_lock_double_buffer();
  1444.     gui_push_clip();
  1445.     gui_set_clip(
  1446.         dev_ch.uiWindowX,
  1447.         dev_ch.uiWindowY,
  1448.         dev_ch.uiWindowX + dev_ch.uiRenderingWidth + dev_ch.uiScrollBarWidth - 1,
  1449.         dev_ch.uiWindowY + dev_ch.uiRenderingHeight + dev_ch.uiScrollBarWidth - 1);
  1450.     gui_fill_rectangle(
  1451.         dev_ch.uiWindowX,
  1452.         dev_ch.uiWindowY,
  1453.         dev_ch.uiWindowX + dev_ch.uiRenderingWidth + dev_ch.uiScrollBarWidth - 1,
  1454.         dev_ch.uiWindowY + dev_ch.uiRenderingHeight + dev_ch.uiScrollBarWidth - 1,
  1455.         gui_color(255, 255, 255));
  1456.     gdi_image_draw_animation(img_x, img_y, splash_img, &brw_splash_ani_handle);
  1457.     gui_pop_clip();
  1458.     gui_unlock_double_buffer();
  1459.     gui_BLT_double_buffer(
  1460.         dev_ch.uiWindowX,
  1461.         dev_ch.uiWindowY,
  1462.         dev_ch.uiWindowX + dev_ch.uiRenderingWidth + dev_ch.uiScrollBarWidth - 1,
  1463.         dev_ch.uiWindowY + dev_ch.uiRenderingHeight + dev_ch.uiScrollBarWidth - 1);
  1464. }
  1465. /*****************************************************************************
  1466.  * FUNCTION
  1467.  *  mmi_brw_stop_animated_splash_screen
  1468.  * DESCRIPTION
  1469.  *  
  1470.  * PARAMETERS
  1471.  *  void
  1472.  * RETURNS
  1473.  *  void
  1474.  *****************************************************************************/
  1475. void mmi_brw_stop_animated_splash_screen(void)
  1476. {
  1477.     /*----------------------------------------------------------------*/
  1478.     /* Local Variables                                                */
  1479.     /*----------------------------------------------------------------*/
  1480.     DeviceCharacteristics dev_ch = {0};
  1481.     /*----------------------------------------------------------------*/
  1482.     /* Code Body                                                      */
  1483.     /*----------------------------------------------------------------*/
  1484.     if (brw_splash_ani_handle != GDI_ERROR_HANDLE)
  1485.     {
  1486.         if (GetActiveScreenId() == SCR_ID_BRW_JBROWSER_MAIN)
  1487. {
  1488. gui_lock_double_buffer();
  1489. gdi_image_stop_animation(brw_splash_ani_handle);
  1490. brw_splash_ani_handle = GDI_ERROR_HANDLE;
  1491. /* Now fill the area with WHITE COLOR */
  1492. jdd_MMIGetDeviceCharacteristics(&dev_ch);
  1493.        
  1494. gui_push_clip();
  1495. gui_set_clip(
  1496. dev_ch.uiWindowX,
  1497. dev_ch.uiWindowY,
  1498. dev_ch.uiWindowX + dev_ch.uiRenderingWidth + dev_ch.uiScrollBarWidth - 1,
  1499. dev_ch.uiWindowY + dev_ch.uiRenderingHeight + dev_ch.uiScrollBarWidth - 1);
  1500. gui_fill_rectangle(
  1501. dev_ch.uiWindowX,
  1502. dev_ch.uiWindowY,
  1503. dev_ch.uiWindowX + dev_ch.uiRenderingWidth + dev_ch.uiScrollBarWidth - 1,
  1504. dev_ch.uiWindowY + dev_ch.uiRenderingHeight + dev_ch.uiScrollBarWidth - 1,
  1505. gui_color(255, 255, 255));
  1506. gui_pop_clip();
  1507. gui_unlock_double_buffer();
  1508. gui_BLT_double_buffer(
  1509. dev_ch.uiWindowX,
  1510. dev_ch.uiWindowY,
  1511. dev_ch.uiWindowX + dev_ch.uiRenderingWidth + dev_ch.uiScrollBarWidth - 1,
  1512. dev_ch.uiWindowY + dev_ch.uiRenderingHeight + dev_ch.uiScrollBarWidth - 1);
  1513. }
  1514. else
  1515. {
  1516. gdi_image_stop_animation(brw_splash_ani_handle);
  1517. brw_splash_ani_handle = GDI_ERROR_HANDLE;
  1518. }
  1519.     }
  1520. }
  1521. /*****************************************************************************
  1522.  * FUNCTION
  1523.  *  mmi_brw_register_endkey_handler
  1524.  * DESCRIPTION
  1525.  *  Function for registration of end key handler in case of CSD bearer
  1526.  * PARAMETERS
  1527.  *  void
  1528.  * RETURNS
  1529.  *  void
  1530.  *****************************************************************************/
  1531. void mmi_brw_register_endkey_handler(void)
  1532. {
  1533.     /*----------------------------------------------------------------*/
  1534.     /* Local Variables                                                */
  1535.     /*----------------------------------------------------------------*/
  1536.     nvram_wap_profile_content_struct *activated_wap_profile;
  1537.     /*----------------------------------------------------------------*/
  1538.     /* Code Body                                                      */
  1539.     /*----------------------------------------------------------------*/
  1540.     activated_wap_profile = mmi_ph_get_activated_wap_profile();
  1541.     if (mmi_ph_check_data_account_type(activated_wap_profile->data_account) == PH_DATA_ACCOUNT_CSD)
  1542.     {
  1543. SetKeyHandler(mmi_brw_goto_idle_screen_event, KEY_END, KEY_EVENT_DOWN);
  1544.     }
  1545. }
  1546. /*****************************************************************************
  1547.  * FUNCTION
  1548.  *  mmi_brw_goto_idle_screen
  1549.  * DESCRIPTION
  1550.  *  Function for displaying the idle screen
  1551.  * PARAMETERS
  1552.  *  void
  1553.  * RETURNS
  1554.  *  void
  1555.  *****************************************************************************/
  1556. void mmi_brw_goto_idle_screen(void)
  1557. {
  1558. if(g_brw_page_cntx.brw_PageFetchStatus && (!g_brw_page_cntx.brw_pageRenderStatus))
  1559. {
  1560. jdi_BrowserDisconnect(pBrowserCtxt);
  1561. }
  1562. else
  1563. {
  1564. DisplayIdleScreen();
  1565. }
  1566. }
  1567. /*****************************************************************************
  1568.  * FUNCTION
  1569.  *  mmi_brw_register_accesskey_handler
  1570.  * DESCRIPTION
  1571.  *  Function for registration of Groupkey handler for Accesskey Support
  1572.  * PARAMETERS
  1573.  *  void
  1574.  * RETURNS
  1575.  *  void
  1576.  *****************************************************************************/
  1577. void mmi_brw_register_accesskey_handler(void)
  1578. {
  1579.     /*----------------------------------------------------------------*/
  1580.     /* Local Variables                                                */
  1581.     /*----------------------------------------------------------------*/
  1582.    
  1583.     /*----------------------------------------------------------------*/
  1584.     /* Code Body                                                      */
  1585.     /*----------------------------------------------------------------*/
  1586.     /* Added by Shantanu for Accesskey Support -20060412 */
  1587.     SetGroupKeyHandler(mmi_brw_fill_accesskey_info_and_send_event_to_queue, g_jbrowser_accesskeys, MMI_JBROWSER_MAX_ACCESSKEY - 1, KEY_EVENT_UP);
  1588. }
  1589. /*****************************************************************************
  1590.  * FUNCTION
  1591.  *  mmi_brw_clear_accesskey_handler
  1592.  * DESCRIPTION
  1593.  *  Function for clearing of Groupkey handler for Accesskey Support
  1594.  * PARAMETERS
  1595.  *  void
  1596.  * RETURNS
  1597.  *  void
  1598.  *****************************************************************************/
  1599. void mmi_brw_clear_accesskey_handler(void)
  1600. {
  1601.     /*----------------------------------------------------------------*/
  1602.     /* Local Variables                                                */
  1603.     /*----------------------------------------------------------------*/
  1604.     
  1605.     /*----------------------------------------------------------------*/
  1606.     /* Code Body                                                      */
  1607.     /*----------------------------------------------------------------*/
  1608.     /* Added by Shantanu for Accesskey Support -20060412 */
  1609.     SetGroupKeyHandler(NULL, g_jbrowser_accesskeys, MMI_JBROWSER_MAX_ACCESSKEY - 1, KEY_EVENT_UP);
  1610. }
  1611. /*****************************************************************************
  1612.  * FUNCTION
  1613.  *  mmi_brw_exit_goto_url
  1614.  * DESCRIPTION
  1615.  *  Exit function for fetching url.
  1616.  * PARAMETERS
  1617.  *  void
  1618.  * RETURNS
  1619.  *  void
  1620.  *****************************************************************************/
  1621. void mmi_brw_exit_goto_url(void)
  1622. {
  1623.     /*----------------------------------------------------------------*/
  1624.     /* Local Variables                                                */
  1625.     /*----------------------------------------------------------------*/
  1626.     JC_UINT32 uiWindowID = 0;
  1627.     /*----------------------------------------------------------------*/
  1628.     /* Code Body                                                      */
  1629.     /*----------------------------------------------------------------*/
  1630.     uiWindowID = mmi_jdd_ui_get_appWindowID(E_TASK_BROWSER_CORE);
  1631.     /* Below changed By Shantanu */
  1632.     /* mmi_jdd_ui_show_window(uiWindowID,E_FALSE); */
  1633.     jdd_MMIShowWindow(uiWindowID, E_FALSE);
  1634. #ifdef JATAAYU_IMAGE_CACHING_ENABLE
  1635.     memset((S8*) hintData, 0, 8);
  1636. #endif /* JATAAYU_IMAGE_CACHING_ENABLE */
  1637.     mmi_brw_stop_animated_splash_screen();
  1638.     PRINT_INFORMATION(("Exit Browser Screen 501"));
  1639. }
  1640. /*****************************************************************************
  1641.  * FUNCTION
  1642.  *  mmi_brw_set_current_url
  1643.  * DESCRIPTION
  1644.  *  Set the current url to fetch
  1645.  * PARAMETERS
  1646.  *  brw_url_p       [?]     
  1647.  * RETURNS
  1648.  *  void
  1649.  *****************************************************************************/
  1650. void mmi_brw_set_current_url(S8 *brw_url_p)
  1651. {
  1652.     /*----------------------------------------------------------------*/
  1653.     /* Local Variables                                                */
  1654.     /*----------------------------------------------------------------*/
  1655.     JC_UINT32 uiGoUrlLen = 0;
  1656.     /*----------------------------------------------------------------*/
  1657.     /* Code Body                                                      */
  1658.     /*----------------------------------------------------------------*/
  1659.     uiGoUrlLen = pfnUnicodeStrlen((S8*) brw_url_p);
  1660.     if (fetchUrlInfo.psUrl != NULL)
  1661.     {
  1662.         jdd_MemFree(fetchUrlInfo.psUrl);
  1663.         fetchUrlInfo.psUrl = NULL;
  1664.     }
  1665.     /* Added by tk for concatenate http:// to the url if missing */
  1666.     if ((pfnUnicodeStrncmp((PS8) brw_url_p, (PS8) L"http://", 7) != 0) &&
  1667.         (pfnUnicodeStrncmp((PS8) brw_url_p, (PS8) L"https://", 8) != 0))
  1668.     {
  1669.         uiGoUrlLen += 7;
  1670.         fetchUrlInfo.psUrl = (JC_CHAR*) jdd_MemAlloc(uiGoUrlLen + 1, sizeof(JC_CHAR));
  1671.         AnsiiToUnicodeString((S8*) fetchUrlInfo.psUrl, (S8*) ("http://"));
  1672.         pfnUnicodeStrncat((S8*) fetchUrlInfo.psUrl, (S8*) brw_url_p, uiGoUrlLen - 7);
  1673.     }
  1674.     else
  1675.     {
  1676.         fetchUrlInfo.psUrl = (JC_CHAR*) jdd_MemAlloc(uiGoUrlLen + 1, sizeof(JC_CHAR));
  1677.         pfnUnicodeStrcpy((S8*) fetchUrlInfo.psUrl, (S8*) brw_url_p);
  1678.     }
  1679.     if (0 == uiGoUrlLen)
  1680.     {
  1681.         jdd_MemFree(fetchUrlInfo.psUrl);
  1682.         fetchUrlInfo.psUrl = NULL;  /* added by tk */
  1683.         return;
  1684.     }
  1685.     fetchUrlInfo.pPostData = NULL;
  1686.     fetchUrlInfo.uiPostDataLen = 0;
  1687. }
  1688. /*****************************************************************************
  1689.  * FUNCTION
  1690.  *  mmi_brw_goto_url
  1691.  * DESCRIPTION
  1692.  *  Interface function to fetch the url
  1693.  * PARAMETERS
  1694.  *  void
  1695.  * RETURNS
  1696.  *  void
  1697.  *****************************************************************************/
  1698. void mmi_brw_goto_url(void)
  1699. {
  1700. #if 0
  1701. /* under construction !*/
  1702. /* under construction !*/
  1703. /* under construction !*/
  1704. /* under construction !*/
  1705. /* under construction !*/
  1706. /* under construction !*/
  1707. /* under construction !*/
  1708. /* under construction !*/
  1709. /* under construction !*/
  1710. /* under construction !*/
  1711. /* under construction !*/
  1712. /* under construction !*/
  1713. /* under construction !*/
  1714. /* under construction !*/
  1715. /* under construction !*/
  1716. /* under construction !*/
  1717. /* under construction !*/
  1718. /* under construction !*/
  1719. /* under construction !*/
  1720. /* under construction !*/
  1721. /* under construction !*/
  1722. /* under construction !*/
  1723. /* under construction !*/
  1724. /* under construction !*/
  1725. /* under construction !*/
  1726. /* under construction !*/
  1727. /* under construction !*/
  1728. /* under construction !*/
  1729. /* under construction !*/
  1730. /* under construction !*/
  1731. /* under construction !*/
  1732. /* under construction !*/
  1733. /* under construction !*/
  1734. /* under construction !*/
  1735. /* under construction !*/
  1736. /* under construction !*/
  1737. /* under construction !*/
  1738. /* under construction !*/
  1739. /* under construction !*/
  1740. /* under construction !*/
  1741. /* under construction !*/
  1742. /* under construction !*/
  1743. /* under construction !*/
  1744. /* under construction !*/
  1745. /* under construction !*/
  1746. /* under construction !*/
  1747. /* under construction !*/
  1748. #endif /* 0 */ 
  1749.     /*----------------------------------------------------------------*/
  1750.     /* Code Body                                                      */
  1751.     /*----------------------------------------------------------------*/
  1752.     if (!g_brw_cntx.isSATURL)
  1753.     {
  1754.         JBrowserGoEvent();
  1755.     }
  1756.     else
  1757.     {
  1758.         JBrowserSATGotoURLEvent();
  1759.     }
  1760. }
  1761. /* added by tk */
  1762. /*****************************************************************************
  1763.  * FUNCTION
  1764.  *  mmi_brw_get_title_length
  1765.  * DESCRIPTION
  1766.  *  Interface function to get the max title length
  1767.  * PARAMETERS
  1768.  *  void
  1769.  * RETURNS
  1770.  *  S16
  1771.  *****************************************************************************/
  1772. S16 mmi_brw_get_title_length(void)
  1773. {
  1774.     /*----------------------------------------------------------------*/
  1775.     /* Local Variables                                                */
  1776.     /*----------------------------------------------------------------*/
  1777.     /*----------------------------------------------------------------*/
  1778.     /* Code Body                                                      */
  1779.     /*----------------------------------------------------------------*/
  1780.     return BRW_ADDRESS_HISTORY_MAX_TITLE_LENGTH;
  1781. }
  1782. /*****************************************************************************
  1783.  * FUNCTION
  1784.  *  mmi_brw_get_title_length
  1785.  * DESCRIPTION
  1786.  *  Interface function to get the max title length
  1787.  * PARAMETERS
  1788.  *  void
  1789.  * RETURNS
  1790.  *  S16
  1791.  *****************************************************************************/
  1792. void mmi_brw_show_title(void)
  1793. {
  1794.     /*----------------------------------------------------------------*/
  1795.     /* Local Variables                                                */
  1796.     /*----------------------------------------------------------------*/
  1797.     /*----------------------------------------------------------------*/
  1798.     /* Code Body                                                      */
  1799.     /*----------------------------------------------------------------*/
  1800.     if (GetActiveScreenId() == SCR_ID_BRW_JBROWSER_MAIN)
  1801.     {
  1802.         draw_title();
  1803.     }
  1804. }
  1805. /*****************************************************************************
  1806.  * FUNCTION
  1807.  *  mmi_brw_paint_outside_look
  1808.  * DESCRIPTION
  1809.  *  Interface function to redraw status,title and button bar,
  1810.  * PARAMETERS
  1811.  *  void
  1812.  * RETURNS
  1813.  *  void
  1814.  *****************************************************************************/
  1815. extern JC_BOOLEAN mmi_brw_is_browser_window_active(void);
  1816. void mmi_brw_paint_outside_look(void)
  1817. {
  1818.     /*----------------------------------------------------------------*/
  1819.     /* Local Variables                                                */
  1820.     /*----------------------------------------------------------------*/
  1821.     /*----------------------------------------------------------------*/
  1822.     /* Code Body                                                      */
  1823.     /*----------------------------------------------------------------*/
  1824.     if (GetActiveScreenId() == SCR_ID_BRW_JBROWSER_MAIN)
  1825.     {
  1826.         show_status_icons();
  1827.         draw_title();
  1828.         show_softkey_background();
  1829.         redraw_softkey(MMI_LEFT_SOFTKEY);
  1830.         redraw_softkey(MMI_RIGHT_SOFTKEY);
  1831.     }
  1832. }
  1833. /* tk end */
  1834. /*****************************************************************************
  1835.  * FUNCTION
  1836.  *  mmi_brw_is_browser_screen_present
  1837.  * DESCRIPTION
  1838.  *  Check whether browser screen is present in history or not
  1839.  * PARAMETERS
  1840.  *  void
  1841.  * RETURNS
  1842.  *  pBOOL
  1843.  *****************************************************************************/
  1844. pBOOL mmi_brw_is_browser_screen_present(void)
  1845. {
  1846. return IsScreenPresent(SCR_ID_BRW_JBROWSER_MAIN);
  1847. }
  1848. /*****************************************************************************
  1849.  * FUNCTION
  1850.  *  mmi_brw_validate_url
  1851.  * DESCRIPTION
  1852.  *  Utility function to validate the url.
  1853.  * PARAMETERS
  1854.  *  url_p       [?]     Url to be validated
  1855.  * RETURNS
  1856.  *  void
  1857.  *****************************************************************************/
  1858. MMI_BOOL mmi_brw_validate_url(U8 *url_p)
  1859. {
  1860.     /*----------------------------------------------------------------*/
  1861.     /* Local Variables                                                */
  1862.     /*----------------------------------------------------------------*/
  1863. U8 temp_url[(BRW_BKM_MAX_URL_LENGTH+8) * ENCODING_LENGTH] = {0, };/* 8 for adding http:// if it is not present*/
  1864.     /*----------------------------------------------------------------*/
  1865.     /* Code Body                                                      */
  1866.     /*----------------------------------------------------------------*/
  1867.  //   UnicodeToAnsii((PS8) temp_url, (PS8) url_p);
  1868.     
  1869. if ((pfnUnicodeStrncmp((PS8) url_p, (PS8) L"http://", 7) != 0) &&
  1870.         (pfnUnicodeStrncmp((PS8) url_p, (PS8) L"https://", 8) != 0))
  1871. {
  1872. U8 url[BRW_BKM_MAX_URL_LENGTH * ENCODING_LENGTH] = {0, };
  1873. UnicodeToAnsii((PS8) url, (PS8) url_p);
  1874. strcpy((S8*) temp_url, (S8*) ("http://"));
  1875. strcat((S8*) temp_url, (S8*) url);
  1876. }
  1877. else
  1878. {
  1879.     UnicodeToAnsii((PS8) temp_url, (PS8) url_p);
  1880. }
  1881.     if (jdi_isValidUrl((JC_UINT8*) temp_url))
  1882.     {
  1883.         return MMI_TRUE;
  1884.     }
  1885.     else
  1886.     {
  1887.         return MMI_FALSE;
  1888.     }
  1889. }
  1890. /*****************************************************************************
  1891.  * FUNCTION
  1892.  *  mmi_brw_set_as_homepage
  1893.  * DESCRIPTION
  1894.  *  Interface function to set the url as homepage
  1895.  * PARAMETERS
  1896.  *  url_p       [?]     
  1897.  * RETURNS
  1898.  *  void
  1899.  *****************************************************************************/
  1900. void mmi_brw_set_as_homepage(U8 *url_p)
  1901. {
  1902.     /*----------------------------------------------------------------*/
  1903.     /* Local Variables                                                */
  1904.     /*----------------------------------------------------------------*/
  1905.     U8 homepage_url[BRW_WAP_PROFILE_HOMEPAGE_URL_LEN * ENCODING_LENGTH];
  1906.     /*----------------------------------------------------------------*/
  1907.     /* Code Body                                                      */
  1908.     /*----------------------------------------------------------------*/
  1909.     UnicodeToAnsii((PS8) homepage_url, (PS8) url_p);
  1910.     mmi_ph_brw_set_activated_profile_homepage(homepage_url);
  1911.     DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, JBROWSER_POPUP_TIME, SUCCESS_TONE);
  1912. }
  1913. /*****************************************************************************
  1914.  * FUNCTION
  1915.  *  mmi_brw_go_back_authentication_screen.
  1916.  * DESCRIPTION
  1917.  *  back button(LSK) handling for authentication screen.
  1918.  * PARAMETERS
  1919.  *  void
  1920.  * RETURNS
  1921.  *  void
  1922.  *****************************************************************************/
  1923. void mmi_brw_go_back_authentication_screen(void)
  1924. {
  1925.     /*----------------------------------------------------------------*/
  1926.     JC_UINT32 navlist_count = 0;
  1927.     /*----------------------------------------------------------------*/
  1928.     /* Code Body                                                      */
  1929.     /*----------------------------------------------------------------*/
  1930.     jdi_BrowserSetAuthInfo(pBrowserCtxt, NULL);
  1931.     jdi_BrowserGetNavListCount(pBrowserCtxt, &navlist_count);
  1932.     if (navlist_count != 0)
  1933.     {
  1934.         GoBackHistory();
  1935.     }
  1936.     else
  1937.     {
  1938.         brw_auth_GoBackHistory();
  1939.     }
  1940. }
  1941. /*****************************************************************************
  1942.  * FUNCTION
  1943.  *  mmi_brw_go_back_authentication_screen.
  1944.  * DESCRIPTION
  1945.  *  back button(LSK) handling for submit confirm screen.
  1946.  * PARAMETERS
  1947.  *  void
  1948.  * RETURNS
  1949.  *  void
  1950.  *****************************************************************************/
  1951. void mmi_brw_go_back_confirm_submit_screen(void)
  1952. {
  1953.     /*----------------------------------------------------------------*/
  1954.     JC_UINT32 navlist_count = 0;
  1955.     /*----------------------------------------------------------------*/
  1956.     /* Code Body                                                      */
  1957.     /*----------------------------------------------------------------*/
  1958.     jdi_BrowserSetAuthInfo(pBrowserCtxt, NULL);
  1959.     jdi_BrowserGetNavListCount(pBrowserCtxt, &navlist_count);
  1960.     if (navlist_count != 0)
  1961.     {
  1962.         GoBackToHistory(SCR_ID_BRW_JBROWSER_MAIN);
  1963.     }
  1964.     else
  1965.     {
  1966.         brw_auth_GoBackHistory();
  1967.     }
  1968. }
  1969. /*****************************************************************************
  1970.  * FUNCTION
  1971.  *  mmi_brw_confirm_submit
  1972.  * DESCRIPTION
  1973.  *  Confirm Screen before submitting the form.
  1974.  * PARAMETERS
  1975.  *  void
  1976.  * RETURNS
  1977.  *  void
  1978.  *****************************************************************************/
  1979. void mmi_brw_confirm_submit(void)
  1980. {
  1981.     DisplayConfirm(
  1982.         STR_GLOBAL_YES,
  1983.         IMG_GLOBAL_YES,
  1984.         STR_GLOBAL_NO,
  1985.         IMG_GLOBAL_NO,
  1986.         get_string(STR_GLOBAL_SUBMIT),
  1987.         IMG_GLOBAL_QUESTION,
  1988.         WARNING_TONE);
  1989.     SetLeftSoftkeyFunction(mmi_brw_auth_entry_confirmation_hdlr, KEY_EVENT_UP);
  1990.     /* SetRightSoftkeyFunction(brw_auth_GoBackHistory, KEY_EVENT_UP); */
  1991.     SetRightSoftkeyFunction(mmi_brw_go_back_confirm_submit_screen, KEY_EVENT_UP);
  1992. }
  1993. /*****************************************************************************
  1994.  * FUNCTION
  1995.  *  mmi_brw_entry_auth_handler
  1996.  * DESCRIPTION
  1997.  *  Entry function for authentication screen
  1998.  * PARAMETERS
  1999.  *  void
  2000.  * RETURNS
  2001.  *  void
  2002.  *****************************************************************************/
  2003. void mmi_brw_entry_auth_handler(void)
  2004. {
  2005.     /*----------------------------------------------------------------*/
  2006.     /* Local Variables                                                */
  2007.     /*----------------------------------------------------------------*/
  2008.     U8 *guiBuffer;
  2009.     U8 *inputBuffer;
  2010.     U16 inputBufferSize;
  2011.     InlineItem brw_authenticate_list[4];
  2012.     U16 IconsImageList[4] = {0};
  2013.     /*----------------------------------------------------------------*/
  2014.     /* Code Body                                                      */
  2015.     /*----------------------------------------------------------------*/
  2016.     EntryNewScreen(SCR_ID_BRW_AUTHENTICATION, mmi_brw_exit_auth_handler, NULL, NULL);
  2017.     guiBuffer = GetCurrGuiBuffer(SCR_ID_BRW_AUTHENTICATION);
  2018.     InitializeCategory57Screen();
  2019.     memset(brw_authenticate_list, 0, sizeof(brw_authenticate_list));
  2020.     /* For username caption */
  2021.     SetInlineItemActivation(
  2022.         &brw_authenticate_list[BRW_INLINE_USERNAME_CAPTION],
  2023.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  2024.         0);
  2025.     SetInlineItemCaption(&brw_authenticate_list[BRW_INLINE_USERNAME_CAPTION], (U8*) GetString(STR_ID_BRW_USER_NAME));
  2026.     /* For username string */
  2027.     SetInlineItemActivation(&brw_authenticate_list[BRW_INLINE_USERNAME], KEY_LSK, KEY_EVENT_UP);
  2028.     SetInlineItemFullScreenEdit(
  2029.         &brw_authenticate_list[BRW_INLINE_USERNAME],
  2030.         STR_ID_BRW_USER_NAME,
  2031.         GetRootTitleIcon(SERVICES_WAP_MENU_ID),
  2032.         (U8*) g_brw_cntx.brw_auth_username,
  2033.         BRW_AUTH_LEN_USERNAME,
  2034.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES);
  2035.     SetInlineFullScreenEditCustomFunction(
  2036.         &brw_authenticate_list[BRW_INLINE_USERNAME],
  2037.         mmi_brw_auth_full_screen_editor_options);
  2038.     /* For password caption */
  2039.     SetInlineItemActivation(
  2040.         &brw_authenticate_list[BRW_INLINE_PASSWORD_CAPTION],
  2041.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  2042.         0);
  2043.     SetInlineItemCaption(&brw_authenticate_list[BRW_INLINE_PASSWORD_CAPTION], (U8*) GetString(STR_ID_BRW_PASSWORD));
  2044.     /* For password string */
  2045.     SetInlineItemActivation(&brw_authenticate_list[BRW_INLINE_PASSWORD], KEY_LSK, KEY_EVENT_UP);
  2046.     SetInlineItemFullScreenEdit(
  2047.         &brw_authenticate_list[BRW_INLINE_PASSWORD],
  2048.         STR_ID_BRW_PASSWORD,
  2049.         GetRootTitleIcon(SERVICES_WAP_MENU_ID),
  2050.         (U8*) g_brw_cntx.brw_auth_password,
  2051.         BRW_AUTH_LEN_PASSWORD,
  2052.         INPUT_TYPE_ALPHANUMERIC_PASSWORD | INPUT_TYPE_USE_ONLY_ENGLISH_MODES);
  2053.     SetInlineFullScreenEditCustomFunction(
  2054.         &brw_authenticate_list[BRW_INLINE_PASSWORD],
  2055.         mmi_brw_auth_full_screen_editor_options);
  2056.     inputBuffer = GetCurrNInputBuffer(SCR_ID_BRW_AUTHENTICATION, &inputBufferSize);
  2057.     if (inputBuffer != NULL)
  2058.     {
  2059.         SetCategory57Data(brw_authenticate_list, 4, inputBuffer);
  2060.     }
  2061.     SetParentHandler(0);
  2062.     IconsImageList[0] = IMG_ID_DTCNT_USER_NAME; 
  2063.     IconsImageList[2] = IMG_ID_DTCNT_PASSWD; 
  2064.     ShowCategory57Screen(
  2065.         STR_ID_BRW_AUTHENTICATION,
  2066.         GetRootTitleIcon(SERVICES_WAP_MENU_ID),
  2067.         STR_GLOBAL_EDIT,
  2068.         0,
  2069.         STR_GLOBAL_BACK,
  2070.         0,
  2071.         4,
  2072.         (U16*) IconsImageList,
  2073.         brw_authenticate_list,
  2074.         0,
  2075.         guiBuffer);
  2076.     SetCategory57RightSoftkeyFunctions(mmi_brw_confirm_submit, mmi_brw_go_back_authentication_screen);
  2077. }
  2078. /*****************************************************************************
  2079.  * FUNCTION
  2080.  *  mmi_brw_exit_auth_handler
  2081.  * DESCRIPTION
  2082.  *  Exit function for authentication screen
  2083.  * PARAMETERS
  2084.  *  void
  2085.  * RETURNS
  2086.  *  void
  2087.  *****************************************************************************/
  2088. void mmi_brw_exit_auth_handler(void)
  2089. {
  2090.     /*----------------------------------------------------------------*/
  2091.     /* Local Variables                                                */
  2092.     /*----------------------------------------------------------------*/
  2093.     history Scr;
  2094.     S16 nHistory = 0;
  2095.     U16 inputBufferSize;    /* added for inline edit history */
  2096.     /*----------------------------------------------------------------*/
  2097.     /* Code Body                                                      */
  2098.     /*----------------------------------------------------------------*/
  2099.     Scr.scrnID = SCR_ID_BRW_AUTHENTICATION;
  2100.     CloseCategory57Screen();
  2101.     Scr.entryFuncPtr = mmi_brw_entry_auth_handler;
  2102.     pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) & nHistory);
  2103.     GetCategory57History(Scr.guiBuffer);
  2104.     inputBufferSize = (U16) GetCategory57DataSize();    /* added for inline edit history */
  2105.     GetCategory57Data((U8*) Scr.inputBuffer);           /* added for inline edit history */
  2106.     AddNHistory(Scr, (U16) inputBufferSize);            /* added for inline edit history */
  2107. }
  2108. /*****************************************************************************
  2109.  * FUNCTION
  2110.  *  mmi_brw_auth_entry_confirmation_hdlr
  2111.  * DESCRIPTION
  2112.  *  Function for submitting the authentication information
  2113.  * PARAMETERS
  2114.  *  void
  2115.  * RETURNS
  2116.  *  void
  2117.  *****************************************************************************/
  2118. void mmi_brw_auth_entry_confirmation_hdlr(void)
  2119. {
  2120.     /*----------------------------------------------------------------*/
  2121.     /* Local Variables                                                */
  2122.     /*----------------------------------------------------------------*/
  2123.     JC_RETCODE iRet;
  2124.     /*----------------------------------------------------------------*/
  2125.     /* Code Body                                                      */
  2126.     /*----------------------------------------------------------------*/
  2127.     GoBacknHistory(1);
  2128.     pfnUnicodeStrcpy((PS8) g_brw_cntx.pAuthInfo.sUsername, (PS8) g_brw_cntx.brw_auth_username);
  2129.     pfnUnicodeStrcpy((PS8) g_brw_cntx.pAuthInfo.sPassword, (PS8) g_brw_cntx.brw_auth_password);
  2130.     iRet = jdi_BrowserSetAuthInfo(pBrowserCtxt, &g_brw_cntx.pAuthInfo);
  2131. }
  2132. /*****************************************************************************
  2133.  * FUNCTION
  2134.  *  brw_auth_GoBackHistory
  2135.  * DESCRIPTION
  2136.  *  Go back history by 1
  2137.  * PARAMETERS
  2138.  *  void
  2139.  * RETURNS
  2140.  *  void
  2141.  *****************************************************************************/
  2142. void brw_auth_GoBackHistory(void)
  2143. {
  2144.     /*----------------------------------------------------------------*/
  2145.     /* Local Variables                                                */
  2146.     /*----------------------------------------------------------------*/
  2147.     /*----------------------------------------------------------------*/
  2148.     /* Code Body                                                      */
  2149.     /*----------------------------------------------------------------*/
  2150.     /* GoBacknHistory(1); */
  2151.     DeleteNScrId(SCR_ID_BRW_JBROWSER_MAIN);
  2152. mmi_brw_set_data_connection_deactive_flag(E_TRUE);
  2153. mmi_brw_deinit_all();/*added by tk*/
  2154.     GoBackHistory();
  2155. }
  2156. /*****************************************************************************
  2157.  * FUNCTION
  2158.  *  mmi_brw_auth_full_screen_editor_options
  2159.  * DESCRIPTION
  2160.  *  Callback for full screen edit from inline edit screen.
  2161.  * PARAMETERS
  2162.  *  void
  2163.  * RETURNS
  2164.  *  void
  2165.  *****************************************************************************/
  2166. void mmi_brw_auth_full_screen_editor_options(void)
  2167. {
  2168.     /*----------------------------------------------------------------*/
  2169.     /* Local Variables                                                */
  2170.     /*----------------------------------------------------------------*/
  2171.     /*----------------------------------------------------------------*/
  2172.     /* Code Body                                                      */
  2173.     /*----------------------------------------------------------------*/
  2174.     ChangeLeftSoftkey(STR_GLOBAL_OPTIONS, IMG_GLOBAL_OPTIONS);
  2175.     SetLeftSoftkeyFunction(EntryScrForInputMethodAndDone, KEY_EVENT_UP);
  2176.     SetInputMethodAndDoneCaptionIcon(GetRootTitleIcon(SERVICES_WAP_MENU_ID));
  2177. }
  2178. /*****************************************************************************
  2179.  * FUNCTION
  2180.  *  mmi_brw_wap_startup_req_hdlr
  2181.  * DESCRIPTION
  2182.  *  Request handler for MSG_ID_WAP_BROWSER_STARTUP_REQ
  2183.  * PARAMETERS
  2184.  *  dataBuf     [?]     Buffer containing data
  2185.  * RETURNS
  2186.  *  void
  2187.  *****************************************************************************/
  2188. void mmi_brw_wap_startup_req_hdlr(void *dataBuf)
  2189. {
  2190.     /*----------------------------------------------------------------*/
  2191.     /* Local Variables                                                */
  2192.     /*----------------------------------------------------------------*/
  2193.     wap_browser_startup_req_struct *brw_startup_p = (wap_browser_startup_req_struct*) dataBuf;
  2194.     /*----------------------------------------------------------------*/
  2195.     /* Code Body                                                      */
  2196.     /*----------------------------------------------------------------*/
  2197.     /* Added to indicate that SAT is not active */
  2198.     g_brw_cntx.isSATURL = E_FALSE;
  2199.     if (brw_startup_p == NULL)
  2200.     {
  2201. ASSERT(0);
  2202.     }
  2203.     switch(brw_startup_p->type)
  2204.     {
  2205.         case WAP_BROWSER_GOTO_MAIN_MENU:
  2206.         {
  2207.             ASSERT(0);
  2208.             break;
  2209.         }
  2210.         case WAP_BROWSER_GOTO_HOMEPAGE:
  2211.         {
  2212.             /* Long press of WAP key from idle screen is handled in this case */
  2213.             ClearKeyHandler(KEY_WAP, KEY_LONG_PRESS);
  2214.             mmi_JBrowserInitApp();
  2215.             /* Added by tk to set page req source flag */
  2216.             g_brw_cntx.page_fetchReqSrc = 1;
  2217.             mmi_brw_entry_homepage();
  2218.             break;
  2219.         }
  2220.         case WAP_BROWSER_GOTO_URL:
  2221.         {
  2222.             /* Opening url from sms is handled in this case */
  2223.             U32 len = 0;
  2224.             MMI_BOOL IsValidURL;
  2225.             len = strlen((S8*) brw_startup_p->url);
  2226.             /* added by tk */
  2227.             if (len >= BRW_BKM_MAX_URL_LENGTH)
  2228.             {
  2229.                 len = BRW_BKM_MAX_URL_LENGTH - 1;
  2230.             }
  2231.             memset((void*)brw_current_url, 0, sizeof(brw_current_url));
  2232.             AnsiiNToUnicodeString((S8*) brw_current_url, (S8*) brw_startup_p->url, len);
  2233.             IsValidURL = mmi_brw_validate_url(brw_current_url);
  2234.             if (IsValidURL == MMI_TRUE)
  2235.             {
  2236.                 /* Added by tk to set page req source flag */
  2237.                 g_brw_cntx.page_fetchReqSrc = 1;
  2238.                 g_brw_cntx.launch_brw_ext_app = MMI_TRUE;
  2239.                 /* added by tk to set the current fetch url */
  2240.                 mmi_JBrowserInitApp();
  2241.                 mmi_brw_set_current_url((S8*) brw_current_url);
  2242.                 mmi_brw_pre_entry_goto_url();
  2243.             }
  2244.             else
  2245.             {
  2246.                 DisplayPopup((PU8) GetString(STR_ID_BRW_INVALID_URL), IMG_GLOBAL_ERROR, 1, JBROWSER_POPUP_TIME, ERROR_TONE);
  2247.             }
  2248.             break;
  2249.         }
  2250.         case WAP_BROWSER_ADD_BOOKMARK:
  2251.         {
  2252.             U32 len = 0;
  2253.             MMI_BOOL IsValidURL;
  2254.             edit_flag = BRW_ADD_BKM_FROM_USE_URL;
  2255.             mmi_brw_read_bookmark_from_nvram();
  2256.             /* If Bookmark list is full, Dispaly 'Bookmark list is full' */
  2257.             if (g_brw_cntx.total_bookmark_items >= BRW_MAX_BOOKMARKS)
  2258.             {
  2259.                 DisplayPopup((PU8) GetString(STR_ID_BRW_BOOKMARK_FULL), IMG_GLOBAL_ERROR, 1, JBROWSER_POPUP_TIME, ERROR_TONE);
  2260.             }
  2261.             else
  2262.             {
  2263.                 len = strlen((S8*) brw_startup_p->url);
  2264.             
  2265.                 if (len >= BRW_BKM_MAX_URL_LENGTH)
  2266.                 {
  2267.                     DisplayPopup((PU8) GetString(STR_ID_BRW_URL_LEN_EXCEED), IMG_GLOBAL_ERROR, 1, JBROWSER_POPUP_TIME, ERROR_TONE);
  2268.                 }
  2269.                 else
  2270.                 {
  2271.                     memset((void*)g_brw_bkm_selected_title, 0, sizeof(g_brw_bkm_selected_title));  /* Added by tk */
  2272.                     memset(g_brw_bkm_selected_url, 0, ((len + 1) * ENCODING_LENGTH));
  2273.                     AnsiiToUnicodeString((S8*) g_brw_bkm_selected_url, (S8*) brw_startup_p->url);
  2274.                     IsValidURL = mmi_brw_validate_url(g_brw_bkm_selected_url);
  2275.                     if (IsValidURL == MMI_TRUE)
  2276.                     {
  2277.     edit_flag = BRW_ADD_BKM_FROM_USE_URL;
  2278.     mmi_brw_entry_add_bookmark_screen_for_all();
  2279.                     }
  2280.                     else
  2281.                     {
  2282.                         DisplayPopup((PU8) GetString(STR_ID_BRW_INVALID_URL), IMG_GLOBAL_ERROR, 1, JBROWSER_POPUP_TIME, ERROR_TONE);
  2283.                     }
  2284.                 }
  2285.             }
  2286.             break;
  2287.         }
  2288.         case WAP_BROWSER_GOTO_URL_BACKGROUND:
  2289.         {
  2290.             /* Will not handle another launch browser request when browser is already open */
  2291.             /* Might happen in case of next URI in OMA download */ 
  2292.             if(IsScreenPresent(SCR_ID_BRW_JBROWSER_MAIN))
  2293.             {
  2294.                 return;
  2295.             }
  2296.             break;
  2297.         }
  2298.         case WAP_BROWSER_VIEW_PUSH_MSG:
  2299.         {
  2300.             ASSERT(0);
  2301.             break;
  2302.         }
  2303.     }
  2304. }
  2305. #ifdef __SATC3__
  2306. /*****************************************************************************
  2307.  * FUNCTION
  2308.  *  mmi_brw_sat_launch_request
  2309.  * DESCRIPTION
  2310.  *  Request handler for MSG_ID_WAP_MMI_LAUNCH_BROWSER_REQ
  2311.  * PARAMETERS
  2312.  *  p       [?]     pointer to the buffer containing data for SAT
  2313.  * RETURNS
  2314.  *  void
  2315.  *****************************************************************************/
  2316. void mmi_brw_sat_launch_request(void *p)
  2317. {
  2318.     /*----------------------------------------------------------------*/
  2319.     /* Local Variables                                                */
  2320.     /*----------------------------------------------------------------*/
  2321.     COMM_PROFILE profile;
  2322.     GENERIC_DATA_CONN pDataConn;
  2323.     JC_RETCODE iRet = JC_OK;
  2324.     nvram_wap_profile_content_struct *activated_wap_profile;
  2325.     wap_mmi_lauch_browser_req_struct *launch_p = (wap_mmi_lauch_browser_req_struct*) p;
  2326.     U8 res;
  2327.     U8 i;
  2328.     S8 gateway_ascii[50];
  2329.     /*----------------------------------------------------------------*/
  2330.     /* Code Body                                                      */
  2331.     /*----------------------------------------------------------------*/
  2332.     if (!wap_is_ready())
  2333.     {
  2334.         res = BRW_SAT_BRWOSER_BUSY;
  2335.         goto launch_err;
  2336.     }
  2337.     activated_wap_profile = mmi_ph_get_activated_wap_profile();
  2338.     if (launch_p->noBearer > 0)
  2339.     {
  2340.         U8 bearer = PH_DATA_ACCOUNT_INVALID;
  2341.         for (i = 0; i < launch_p->noBearer; i++)
  2342.         {
  2343.             if (launch_p->bearer[i] == 0x01)
  2344.             {
  2345.                 bearer = PH_DATA_ACCOUNT_CSD;
  2346.             }
  2347.         #ifdef __GPRS_MODE__
  2348.             else if (launch_p->bearer[i] == 0x03)
  2349.             {
  2350.                 bearer = PH_DATA_ACCOUNT_GPRS;
  2351.             }
  2352.         #endif /* __GPRS_MODE__ */ 
  2353.             if (bearer != PH_DATA_ACCOUNT_INVALID)
  2354.             {
  2355.                 break;
  2356.             }
  2357.         }
  2358.         if ((bearer != PH_DATA_ACCOUNT_INVALID) &&
  2359.             mmi_ph_check_data_account_type(activated_wap_profile->data_account) != bearer)
  2360.         {
  2361.             res = BRW_SAT_BEARER_UNAVAILABLE;
  2362.             goto launch_err;
  2363.         }
  2364.     }
  2365.     if (launch_p->browserMode == 0x00)
  2366.     {
  2367.         /* launch browser, if not already launched. 
  2368.            nothing to do */
  2369.     }
  2370.     else if (launch_p->browserMode == 0x02)
  2371.     {
  2372.         /* use the existing browser (the browser shall not use the active existing secured session) 
  2373.            nothing to do */
  2374.     }
  2375.     else if (launch_p->browserMode == 0x03)
  2376.     {
  2377.         /* close the existing browser session and launch new browser session */
  2378.         iRet = jdi_BrowserClose(pBrowserCtxt, E_TRUE);
  2379.         if (iRet != JC_OK)
  2380.         {
  2381.             ASSERT(0);
  2382.         }
  2383.     }
  2384.     if (launch_p->noUrl > 0)
  2385.     {
  2386.         if (!mmi_brw_validate_url(launch_p->url))
  2387.         {
  2388.             /* error */
  2389.             res = BRW_SAT_PARAM_URL_ERROR;
  2390.             goto launch_err;
  2391.         }
  2392.         else
  2393.         {
  2394.             /* pfnUnicodeStrcpy((S8*) brw_current_url, (S8*) launch_p->url); */
  2395.             /* added by tk to set the current fetch url */
  2396.             mmi_brw_set_current_url((S8*) launch_p->url);
  2397.         }
  2398.     }
  2399.     else
  2400.     {   /* Copy Homepage for activated profile if no url */
  2401.         AnsiiToUnicodeString((S8*) brw_current_url, (S8*) mmi_ph_brw_get_activated_profile_homepage());
  2402.         /* added by tk to set the current fetch url */
  2403.         mmi_brw_set_current_url((S8*) brw_current_url);
  2404.     }
  2405.     jc_memset(&profile, 0, sizeof(COMM_PROFILE));
  2406.     /* process gateway */
  2407.     UnicodeToAnsii(gateway_ascii, (PS8) launch_p->gateway);
  2408.     if (launch_p->noGateway > 0 && mmi_brw_check_ip(gateway_ascii))
  2409.     {
  2410.         strcpy((S8*) profile.szHostName, gateway_ascii);
  2411.         profile.eConnMode = E_COMM_WSP_CONNECTION_ORIENTED;
  2412.         profile.uiPortNumber = (JC_UINT32) 9201;
  2413.     }
  2414.     else
  2415.     {
  2416.         //res = BRW_SAT_PARAM_GATEWAY_ERROR;
  2417.         //goto launch_err;
  2418.     }
  2419.     if (!launch_p->noGateway)
  2420.     {
  2421.         sprintf(
  2422.             (PS8) profile.szHostName,
  2423.             "%d.%d.%d.%d",
  2424.             activated_wap_profile->proxy_ip[0],
  2425.             activated_wap_profile->proxy_ip[1],
  2426.             activated_wap_profile->proxy_ip[2],
  2427.             activated_wap_profile->proxy_ip[3]);
  2428.         profile.uiPortNumber = activated_wap_profile->proxy_port;
  2429.         switch (activated_wap_profile->conn_type)
  2430.         {
  2431.             case PH_CONN_TYPE_CONNECTION_OREINTED:
  2432.                 profile.eConnMode = E_COMM_WSP_CONNECTION_ORIENTED;
  2433.                 profile.uiPortNumber = (JC_UINT32) 9201;
  2434.                 break;
  2435.                 /* added by tk */
  2436.         #if defined (WAP_SEC_SUPPORT) && defined (JATAAYU_SUPPORT)
  2437.             case PH_CONN_TYPE_CONNECTION_OREINTED_SECURE:
  2438.                 profile.eConnMode = E_COMM_WSP_CONNECTION_ORIENTED_SECURE;
  2439.                 profile.uiPortNumber = (JC_UINT32) 9203;
  2440.                 break;
  2441.         #endif /* defined (WAP_SEC_SUPPORT) && defined (JATAAYU_SUPPORT) */ 
  2442.                 /* end */
  2443.             case PH_CONN_TYPE_HTTP:
  2444.                 if (strcmp((PS8) profile.szHostName, (PS8) "0.0.0.0") == 0)
  2445.                 {
  2446.                     profile.eConnMode = E_COMM_WPHTTP_DIRECT;
  2447.                 }
  2448.                 else
  2449.                 {
  2450.                     profile.eConnMode = E_COMM_WPHTTP_PROXY;
  2451.                     if(profile.uiPortNumber == 0)
  2452.                     {
  2453.                         profile.uiPortNumber = 80;
  2454.                     }
  2455.                 }
  2456.                 break;
  2457.         }
  2458.     }
  2459.     mmi_brw_set_timeout_value();
  2460.     mmi_JBrowserInitApp();
  2461.     iRet = jdi_BrowserSetTransportProfile(pBrowserCtxt, &profile);
  2462.     if (JC_OK != iRet)
  2463.     {
  2464.         res = BRW_SAT_UNKNOWN_ERROR;
  2465.         goto launch_err;
  2466.     }
  2467.     memset(&pDataConn, 0, sizeof(GENERIC_DATA_CONN));
  2468.     pDataConn.account_id = activated_wap_profile->data_account;
  2469.     iRet = jdi_BrowserSetDataConnectionProfile(pBrowserCtxt, (const GENERIC_DATA_CONN*)&pDataConn);
  2470.     if (JC_OK != iRet)
  2471.     {
  2472.         res = BRW_SAT_UNKNOWN_ERROR;
  2473.         goto launch_err;
  2474.     }
  2475.     /* This is added to indicate that a url is being fetched from SAT application.
  2476.        based on this we will send MSG_ID_WAP_MMI_BROWSER_TERMINATION_IND to MMI_TASK */
  2477.     g_brw_cntx.isSATURL = E_TRUE;
  2478.     /* Added by tk to set page req source flag */
  2479.     g_brw_cntx.page_fetchReqSrc = 1;
  2480.     mmi_brw_pre_entry_goto_url();
  2481.     res = BRW_SAT_LAUCH_SUCC;
  2482.   launch_err:
  2483.     mmi_brw_sat_lauch_response(res);
  2484. }
  2485. /*****************************************************************************
  2486.  * FUNCTION
  2487.  *  mmi_brw_sat_lauch_response
  2488.  * DESCRIPTION
  2489.  *  Response MSG_ID_WAP_MMI_LAUNCH_BROWSER_RSP
  2490.  * PARAMETERS
  2491.  *  res     [IN]        Type of response.
  2492.  * RETURNS
  2493.  *  void
  2494.  *****************************************************************************/
  2495. void mmi_brw_sat_lauch_response(U8 res)
  2496. {
  2497.     /*----------------------------------------------------------------*/
  2498.     /* Local Variables                                                */
  2499.     /*----------------------------------------------------------------*/
  2500.     wap_mmi_lauch_browser_rsp_struct *lauch_rsp_ptr;
  2501.     MYQUEUE Message;
  2502.     /*----------------------------------------------------------------*/
  2503.     /* Code Body                                                      */
  2504.     /*----------------------------------------------------------------*/
  2505.     lauch_rsp_ptr = (wap_mmi_lauch_browser_rsp_struct*) OslConstructDataPtr(sizeof(wap_mmi_lauch_browser_rsp_struct));
  2506.     PRINT_INFORMATION(("***********mmi_brw_sat_lauch_response: %d**********n", res));
  2507.     switch (res)
  2508.     {
  2509.         case BRW_SAT_LAUCH_SUCC:
  2510.             lauch_rsp_ptr->res = SAT_CMD_PERFORMED_SUCCESSFULLY;
  2511.             lauch_rsp_ptr->additionalInfo = SAT_LAUNCH_BROWSER_NO_SPECIFIC_CAUSE;
  2512.             break;
  2513.         case BRW_SAT_BRWOSER_BUSY:
  2514.             lauch_rsp_ptr->res = SAT_ME_CURRENTLY_UNABLE_TO_PROCESS_CMD;
  2515.             lauch_rsp_ptr->additionalInfo = SAT_LAUNCH_BROWSER_BROWSER_UNAVALIABLE;
  2516.             break;
  2517.         case BRW_SAT_BEARER_UNAVAILABLE:
  2518.             lauch_rsp_ptr->res = SAT_ME_CURRENTLY_UNABLE_TO_PROCESS_CMD;
  2519.             lauch_rsp_ptr->additionalInfo = SAT_LAUNCH_BROWSER_BEARER_UNAVALIABLE;
  2520.             break;
  2521.         case BRW_SAT_PARAM_GATEWAY_ERROR:
  2522.         case BRW_SAT_PARAM_URL_ERROR:
  2523.             lauch_rsp_ptr->res = SAT_LAUNCH_BROWER_GENERIC_ERROR_CODE;
  2524.             lauch_rsp_ptr->additionalInfo = SAT_LAUNCH_BROWSER_NO_SPECIFIC_CAUSE;
  2525.             break;
  2526.         case BRW_SAT_PROV_DATA_ERROR:
  2527.             lauch_rsp_ptr->res = SAT_LAUNCH_BROWER_GENERIC_ERROR_CODE;
  2528.             lauch_rsp_ptr->additionalInfo = SAT_LAUNCH_BROWSER_ME_UNABLE_TO_READ_PROVISION_DATA;
  2529.             break;
  2530.         default:
  2531.             lauch_rsp_ptr->res = SAT_LAUNCH_BROWER_GENERIC_ERROR_CODE;
  2532.             lauch_rsp_ptr->additionalInfo = SAT_LAUNCH_BROWSER_NO_SPECIFIC_CAUSE;
  2533.             break;
  2534.     }
  2535.     Message.oslSrcId = MOD_WAP;
  2536.     Message.oslDestId = MOD_MMI;
  2537.     Message.oslMsgId = MSG_ID_WAP_MMI_LAUNCH_BROWSER_RSP;
  2538.     Message.oslDataPtr = (oslParaType*) lauch_rsp_ptr;
  2539.     Message.oslPeerBuffPtr = NULL;
  2540.     OslMsgSendExtQueue(&Message);
  2541. }
  2542. #endif /* __SATC3__ */ 
  2543. /*****************************************************************************
  2544.  * FUNCTION
  2545.  *  mmi_brw_check_ip
  2546.  * DESCRIPTION
  2547.  *  Function to validate the IP
  2548.  * PARAMETERS
  2549.  *  s       [?]     IP address to be validated
  2550.  * RETURNS
  2551.  *  void
  2552.  *****************************************************************************/
  2553. S32 mmi_brw_check_ip(S8 *s)
  2554. {
  2555.     /*----------------------------------------------------------------*/
  2556.     /* Local Variables                                                */
  2557.     /*----------------------------------------------------------------*/
  2558.     S8 *ip;
  2559.     S8 seps[] = ".";
  2560.     S8 *token;
  2561.     S32 ip_sec = 0;
  2562.     /*----------------------------------------------------------------*/
  2563.     /* Code Body                                                      */
  2564.     /*----------------------------------------------------------------*/
  2565.     ip = (S8*) jdd_MemAlloc(1, strlen(s) + 1);
  2566.     strcpy(ip, s);
  2567.     /* 1st char of ip or hostname can't be '.' */
  2568.     if (ip[0] == '.' || ip[strlen(ip) - 1] == '.')
  2569.     {
  2570.         goto err;
  2571.     }
  2572.     token = strtok(ip, seps);
  2573.     while (token)
  2574.     {
  2575.         U16 i;
  2576.         for (i = 0; i < strlen(token); i++)
  2577.         {
  2578.             if (i >= 3)
  2579.             {
  2580.                 goto err;
  2581.             }
  2582.             if (token[i] < '0' || token[i] > '9')
  2583.             {
  2584.                 goto err;
  2585.             }
  2586.         }
  2587.         /* this segement is ip format */
  2588.         ip_sec++;
  2589.         token = strtok(NULL, seps);
  2590.     }
  2591.     if (ip_sec != 4)
  2592.     {
  2593.         goto err;
  2594.     }
  2595.     if (ip != NULL)
  2596.     {
  2597.         jdd_MemFree(ip);
  2598.         ip = NULL;
  2599.     }
  2600.     return 1;
  2601.   err:
  2602.     if (ip != NULL)
  2603.     {
  2604.         jdd_MemFree(ip);
  2605.         ip = NULL;
  2606.     }
  2607.     return 0;
  2608. }
  2609. /*****************************************************************************
  2610.  * FUNCTION
  2611.  *  mmi_brw_wap_poweroff_request
  2612.  * DESCRIPTION
  2613.  *  Request handler for MSG_ID_WAP_BROWSER_POWEROFF_REQ
  2614.  * PARAMETERS
  2615.  *  dataBuf     [?]     Pointer to buffer containing data
  2616.  * RETURNS
  2617.  *  void
  2618.  *****************************************************************************/
  2619. void mmi_brw_wap_poweroff_request(void *dataBuf)
  2620. {
  2621.     /*----------------------------------------------------------------*/
  2622.     /* Local Variables                                                */
  2623.     /*----------------------------------------------------------------*/
  2624.     /*----------------------------------------------------------------*/
  2625.     /* Code Body                                                      */
  2626.     /*----------------------------------------------------------------*/
  2627.     /* dataBuf will be NULL */
  2628.     /* Deinitialize the browser application */
  2629.     mmi_DeInitJBrowserCtxt();
  2630. #if (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT))
  2631.     mmi_jmms_deinit_shutdown();
  2632. #endif 
  2633.     /* Send response */
  2634.     mmi_brw_wap_poweroff_response();
  2635. #ifdef BROWSER_PUSH_ENABLE
  2636.     mmi_brw_deinitialize_push_message_list();
  2637. #endif /* BROWSER_PUSH_ENABLE */ 
  2638. #ifdef __SATC3__
  2639.     if (g_brw_cntx.isSATURL == E_TRUE)
  2640.     {
  2641.         brw_send_termination_to_mmi(BRW_SAT_ERROR_TERMINATION);
  2642.     }
  2643. #endif /* __SATC3__ */ 
  2644. }
  2645. /*****************************************************************************
  2646.  * FUNCTION
  2647.  *  mmi_brw_wap_poweroff_response
  2648.  * DESCRIPTION
  2649.  *  Response MSG_ID_WAP_BROWSER_POWEROFF_RSP
  2650.  * PARAMETERS
  2651.  *  void
  2652.  * RETURNS
  2653.  *  void
  2654.  *****************************************************************************/
  2655. void mmi_brw_wap_poweroff_response(void)
  2656. {
  2657.     /*----------------------------------------------------------------*/
  2658.     /* Local Variables                                                */
  2659.     /*----------------------------------------------------------------*/
  2660.     MYQUEUE Message;
  2661.     /*----------------------------------------------------------------*/
  2662.     /* Code Body                                                      */
  2663.     /*----------------------------------------------------------------*/
  2664.     Message.oslSrcId = MOD_WAP;
  2665.     Message.oslDestId = MOD_MMI;
  2666.     Message.oslMsgId = MSG_ID_WAP_BROWSER_POWEROFF_RSP;
  2667.     Message.oslDataPtr = (oslParaType*) NULL;
  2668.     Message.oslPeerBuffPtr = NULL;
  2669.     OslMsgSendExtQueue(&Message);
  2670. }
  2671. /*****************************************************************************
  2672.  * FUNCTION
  2673.  *  brw_send_termination_to_mmi
  2674.  * DESCRIPTION
  2675.  *  MSG_ID_WAP_MMI_BROWSER_TERMINATION_IND
  2676.  * PARAMETERS
  2677.  *  cause       [IN]        Type of termination (USER or ERROR)
  2678.  * RETURNS
  2679.  *  void
  2680.  *****************************************************************************/
  2681. void brw_send_termination_to_mmi(U8 cause)
  2682. {
  2683.     /*----------------------------------------------------------------*/
  2684.     /* Local Variables                                                */
  2685.     /*----------------------------------------------------------------*/
  2686.     MYQUEUE Message;
  2687.     wap_mmi_browser_termination_ind_struct *browser_term_ind_ptr;
  2688.     /*----------------------------------------------------------------*/
  2689.     /* Code Body                                                      */
  2690.     /*----------------------------------------------------------------*/
  2691.     browser_term_ind_ptr =
  2692.         (wap_mmi_browser_termination_ind_struct*) OslConstructDataPtr(sizeof(wap_mmi_browser_termination_ind_struct));
  2693.     if (cause == BRW_SAT_USER_TERMINATION)
  2694.     {
  2695.         browser_term_ind_ptr->cause = SAT_BROWSER_USER_TERMINATION;
  2696.     }
  2697.     else
  2698.     {
  2699.         browser_term_ind_ptr->cause = SAT_BROWSER_ERROR_TERMINATION;
  2700.     }
  2701.     Message.oslSrcId = MOD_WAP;
  2702.     Message.oslDestId = MOD_MMI;
  2703.     Message.oslMsgId = MSG_ID_WAP_MMI_BROWSER_TERMINATION_IND;
  2704.     Message.oslDataPtr = (oslParaType*) browser_term_ind_ptr;
  2705.     Message.oslPeerBuffPtr = NULL;
  2706.     OslMsgSendExtQueue(&Message);
  2707. }
  2708. /*****************************************************************************
  2709.  * FUNCTION
  2710.  *  mmi_brw_wap_entry_busy_progressing_screen_in_idle
  2711.  * DESCRIPTION
  2712.  *  Temporary screen with all key disabled and no put in history. Invoked from mmi_brw_wap_internet_key_hdlr
  2713.  * PARAMETERS
  2714.  *  void
  2715.  * RETURNS
  2716.  *  void
  2717.  *****************************************************************************/
  2718. void mmi_brw_wap_entry_busy_progressing_screen_in_idle(void)
  2719. {
  2720.     /*----------------------------------------------------------------*/
  2721.     /* Local Variables                                                */
  2722.     /*----------------------------------------------------------------*/
  2723.     /*----------------------------------------------------------------*/
  2724.     /* Code Body                                                      */
  2725.     /*----------------------------------------------------------------*/
  2726.     EntryNewScreen(SCR_ID_BRW_TRANSITION_ANIMATION, NULL, NULL, NULL);
  2727.     ShowCategory66Screen(
  2728.         (U16) STR_ID_BRW_INTERNET_SERVICES,
  2729.         GetRootTitleIcon(SERVICES_WAP_MENU_ID),
  2730.         0,
  2731.         0,
  2732.         0,
  2733.         0,
  2734.         (U8*) GetString(STR_ID_BRW_PLEASE_WAIT),
  2735.         IMG_ID_BRW_SAT_WAIT,
  2736.         NULL);
  2737.     ClearAllKeyHandler();   /* End key is still valid */
  2738. mmi_brw_clear_key_handler(KEY_END);
  2739. }
  2740. /*****************************************************************************
  2741.  * FUNCTION
  2742.  *  mmi_brw_wap_restore_factory_setting_req
  2743.  * DESCRIPTION
  2744.  *  Request handler for MSG_ID_WAP_RESTORE_FACTORY_SETTING_REQ
  2745.  * PARAMETERS
  2746.  *  dataBuf     [?]     Pointer to buffer containing data
  2747.  * RETURNS
  2748.  *  void
  2749.  *****************************************************************************/
  2750. void mmi_brw_wap_restore_factory_setting_req(void *dataBuf)
  2751. {
  2752.     /*----------------------------------------------------------------*/
  2753.     /* Local Variables                                                */
  2754.     /*----------------------------------------------------------------*/
  2755.     /*----------------------------------------------------------------*/
  2756.     /* Code Body                                                      */
  2757.     /*----------------------------------------------------------------*/
  2758.     mmi_brw_restore_default_profile_settings();
  2759.     mmi_brw_restore_default_browser_settings();
  2760.     mmi_brw_restore_default_bookmarks();
  2761.     /* mmi_brw_restore_default_certificates(); */
  2762. #if (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT))
  2763.     /* /manish--for JMMS */
  2764.     mmi_mms_restore_default_profile_settings();
  2765.     mmi_jmms_restore_nvram_default_settings();
  2766. #endif /* (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT)) */ 
  2767.     mmi_brw_wap_restore_factory_setting_cnf();
  2768. }
  2769. /*****************************************************************************
  2770.  * FUNCTION
  2771.  *  mmi_brw_restore_default_profile_settings
  2772.  * DESCRIPTION
  2773.  *  Restore the default profile settings
  2774.  * PARAMETERS
  2775.  *  void
  2776.  * RETURNS
  2777.  *  void
  2778.  *****************************************************************************/
  2779. void mmi_brw_restore_default_profile_settings(void)
  2780. {
  2781.     /*----------------------------------------------------------------*/
  2782.     /* Local Variables                                                */
  2783.     /*----------------------------------------------------------------*/
  2784.     U16 index = 0;
  2785.     S16 error = 0;
  2786.     U16 activateWapProfileIndex = 0;
  2787.     /*----------------------------------------------------------------*/
  2788.     /* Code Body                                                      */
  2789.     /*----------------------------------------------------------------*/
  2790.     for (index = 1; index <= NVRAM_WAP_PROFILE_MAX; index++)
  2791.     {
  2792.         WriteRecord(
  2793.             NVRAM_EF_WAP_PROFILE_CONTENT_LID,
  2794.             index,
  2795.             &NVRAM_EF_WAP_PROFILE_CONTENT_DEFAULT[index - 1],
  2796.             NVRAM_EF_WAP_PROFILE_CONTENT_SIZE,
  2797.             &error);
  2798.     }
  2799.     WriteRecord(
  2800.         NVRAM_EF_WAP_PROFILE_NAMES_LID,
  2801.         1,
  2802.         NVRAM_EF_WAP_PROFILE_NAMES_DEFAULT,
  2803.         NVRAM_EF_WAP_PROFILE_NAMES_SIZE,
  2804.         &error);
  2805.    // WriteValue(NVRAM_PH_ACTIVATED_WAP_PROFILE_INDEX, &activateWapProfileIndex, DS_BYTE, &error);
  2806. }
  2807. #if (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT))
  2808. /*****************************************************************************
  2809.  * FUNCTION
  2810.  *  mmi_mms_restore_default_profile_settings
  2811.  * DESCRIPTION
  2812.  *  Restore the default profile settings
  2813.  * PARAMETERS
  2814.  *  void
  2815.  * RETURNS
  2816.  *  void
  2817.  *****************************************************************************/
  2818. void mmi_mms_restore_default_profile_settings(void)
  2819. {
  2820.     /*----------------------------------------------------------------*/
  2821.     /* Local Variables                                                */
  2822.     /*----------------------------------------------------------------*/
  2823.     U16 index = 0;
  2824.     S16 error = 0;
  2825.     U16 activateMMSProfileIndex = 0;
  2826.     /*----------------------------------------------------------------*/
  2827.     /* Code Body                                                      */
  2828.     /*----------------------------------------------------------------*/
  2829.     for (index = 1; index <= NVRAM_MMS_PROFILE_MAX; index++)
  2830.     {
  2831.         WriteRecord(
  2832.             NVRAM_EF_MMS_PROFILE_CONTENT_LID,
  2833.             index,
  2834.             &NVRAM_EF_MMS_PROFILE_CONTENT_DEFAULT[index - 1],
  2835.             NVRAM_EF_MMS_PROFILE_CONTENT_SIZE,
  2836.             &error);
  2837.     }
  2838.     WriteRecord(
  2839.         NVRAM_EF_MMS_PROFILE_NAMES_LID,
  2840.         1,
  2841.         NVRAM_EF_MMS_PROFILE_NAMES_DEFAULT,
  2842.         NVRAM_EF_MMS_PROFILE_NAMES_SIZE,
  2843.         &error);
  2844.     //WriteValue(NVRAM_PH_ACTIVATED_MMS_PROFILE_INDEX, &activateMMSProfileIndex, DS_BYTE, &error);
  2845. }
  2846. #endif //#if (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT))
  2847. /*****************************************************************************
  2848.  * FUNCTION
  2849.  *  mmi_brw_restore_default_browser_settings
  2850.  * DESCRIPTION
  2851.  *  Restore the default browser settings
  2852.  * PARAMETERS
  2853.  *  void
  2854.  * RETURNS
  2855.  *  void
  2856.  *****************************************************************************/
  2857. void mmi_brw_restore_default_browser_settings(void)
  2858. {
  2859.     /*----------------------------------------------------------------*/
  2860.     /* Local Variables                                                */
  2861.     /*----------------------------------------------------------------*/
  2862.     S16 error = 0;
  2863.     U16 timeout_default = WAP_CUSTOM_CFG_DEFAULT_BROWSE_TIMEOUT;
  2864.     U8 show_image_default = WAP_CUSTOM_CFG_DEFAULT_SHOW_IMAGES_ON;
  2865.     U8 show_history_as_default = WAP_CUSTOM_CFG_DEFAULT_SHOW_HISTORY_AS_URL;
  2866.     /*----------------------------------------------------------------*/
  2867.     /* Code Body                                                      */
  2868.     /*----------------------------------------------------------------*/
  2869.     WriteValue(NVRAM_BRW_TIME_OUT_VALUE, &(timeout_default), DS_SHORT, &error);
  2870.     g_brw_cntx.timeout_value = timeout_default;
  2871.     WriteValue(NVRAM_BRW_SHOW_IMAGE_ON_OFF, &(show_image_default), DS_BYTE, &error);
  2872.     g_brw_cntx.show_images = show_image_default;
  2873.     WriteValue(NVRAM_BRW_SHOW_HISTORY_AS, &(show_history_as_default), DS_BYTE, &error);
  2874.     g_brw_cntx.show_history_as_url = show_history_as_default;
  2875. }
  2876. /*****************************************************************************
  2877.  * FUNCTION
  2878.  *  mmi_brw_restore_default_bookmarks
  2879.  * DESCRIPTION
  2880.  *  Restore the default bookmarks
  2881.  * PARAMETERS
  2882.  *  void
  2883.  * RETURNS
  2884.  *  void
  2885.  *****************************************************************************/
  2886. void mmi_brw_restore_default_bookmarks(void)
  2887. {
  2888.     /*----------------------------------------------------------------*/
  2889.     /* Local Variables                                                */
  2890.     /*----------------------------------------------------------------*/
  2891.     U16 record_count;
  2892.     S16 NvramError;
  2893.     /*----------------------------------------------------------------*/
  2894.     /* Code Body                                                      */
  2895.     /*----------------------------------------------------------------*/
  2896.     /* Read bookmarks from NVRAM if not already read */
  2897.     for (record_count = 1; record_count <= NVRAM_BRW_NUM_BOOKMARK_TITLE_RECORDS; record_count++)
  2898.     {
  2899.         WriteRecord(
  2900.             NVRAM_EF_BRW_BOOKMARK_TITLE_LID,
  2901.             record_count,
  2902.             &NVRAM_EF_BRW_BOOKMARK_TITLE_DEFAULT[(record_count - 1) * TITLES_PER_RECORD],
  2903.             NVRAM_BRW_BOOKMARK_TITLE_SIZE,
  2904.             &NvramError);
  2905.     }
  2906.     for (record_count = 1; record_count <= NVRAM_BRW_NUM_BOOKMARK_URL_RECORDS; record_count++)
  2907.     {
  2908.         WriteRecord(
  2909.             NVRAM_EF_BRW_BOOKMARK_URL_LID,
  2910.             record_count,
  2911.             &NVRAM_EF_BRW_BOOKMARK_URL_DEFAULT[(record_count - 1) * URLS_PER_RECORD],
  2912.             NVRAM_BRW_BOOKMARK_URL_SIZE,
  2913.             &NvramError);
  2914.     }
  2915. }
  2916. /*****************************************************************************
  2917.  * FUNCTION
  2918.  *  mmi_brw_wap_restore_factory_setting_cnf
  2919.  * DESCRIPTION
  2920.  *  Response MSG_ID_WAP_RESTORE_FACTORY_SETTING_CNF
  2921.  * PARAMETERS
  2922.  *  void
  2923.  * RETURNS
  2924.  *  void
  2925.  *****************************************************************************/
  2926. void mmi_brw_wap_restore_factory_setting_cnf(void)
  2927. {
  2928.     /*----------------------------------------------------------------*/
  2929.     /* Local Variables                                                */
  2930.     /*----------------------------------------------------------------*/
  2931.     MYQUEUE Message;
  2932.     /*----------------------------------------------------------------*/
  2933.     /* Code Body                                                      */
  2934.     /*----------------------------------------------------------------*/
  2935.     Message.oslSrcId = MOD_WAP;
  2936.     Message.oslDestId = MOD_MMI;
  2937.     Message.oslMsgId = MSG_ID_WAP_RESTORE_FACTORY_SETTING_CNF;
  2938.     Message.oslDataPtr = (oslParaType*) NULL;
  2939.     Message.oslPeerBuffPtr = NULL;
  2940.     OslMsgSendExtQueue(&Message);
  2941. }
  2942. #endif /* defined (JATAAYU_SUPPORT) && defined (WAP_SUPPORT) */ 
  2943. #endif /* _MMI_JBROWSERMMIMAIN_C */