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

MTK

开发平台:

C/C++

  1.     /*----------------------------------------------------------------*/
  2.     /* Local Variables                                                */
  3.     /*----------------------------------------------------------------*/
  4.     /*----------------------------------------------------------------*/
  5.     /* Code Body                                                      */
  6.     /*----------------------------------------------------------------*/
  7.     g_brw_page_cntx.brw_PageStatusCodeStack[1] = E_BROWSER_FETCH_BEGIN;
  8.         mmi_brw_show_animated_title();
  9.    
  10.     }
  11. /*****************************************************************************
  12.  * FUNCTION
  13.  *  mmi_brw_handle_page_fetch_terminated
  14.  * DESCRIPTION
  15.  *  It handle the page fetch terminated status
  16.  * PARAMETERS
  17.  *  void  
  18.  * RETURNS
  19.  *  void
  20.  *****************************************************************************/
  21. void mmi_brw_handle_page_fetch_terminated(void)
  22.     {
  23.     /*----------------------------------------------------------------*/
  24.     /* Local Variables                                                */
  25.     /*----------------------------------------------------------------*/
  26.     /*----------------------------------------------------------------*/
  27.     /* Code Body                                                      */
  28.     /*----------------------------------------------------------------*/
  29.         if (GetActiveScreenId() == SCR_ID_BRW_JBROWSER_MAIN)
  30.         {
  31.             mmi_brw_show_normal_title();
  32.         }
  33.     }
  34. /*****************************************************************************
  35.  * FUNCTION
  36.  *  mmi_brw_handle_page_rendering_begin
  37.  * DESCRIPTION
  38.  *  It handle the page rendering begin status
  39.  * PARAMETERS
  40.  *  void  
  41.  * RETURNS
  42.  *  void
  43.  *****************************************************************************/
  44. void mmi_brw_handle_page_rendering_begin(void)
  45.         {
  46.     /*----------------------------------------------------------------*/
  47.     /* Local Variables                                                */
  48.     /*----------------------------------------------------------------*/
  49.     /*----------------------------------------------------------------*/
  50.     /* Code Body                                                      */
  51.     /*----------------------------------------------------------------*/
  52.     g_brw_page_cntx.brw_PageStatusCodeStack[2] = E_BROWSER_RENDERING_BEGIN;
  53.   //      if(mmi_brw_is_animated_title() == MMI_FALSE)
  54.   //      {
  55.             mmi_brw_show_animated_title();
  56.    //     }
  57.     g_brw_page_cntx.brw_pageRenderStatus = 1;
  58.         /* Added By Shantanu -20060810 */
  59.         /* We will reset the manual refresh flag so that the user can enter the fullscreen editor
  60.            when rendering is started.We will check this flag while entering the editor screen */
  61.         mmi_jdd_ui_set_jdd_flag(JDD_MANUAL_REFRESH_FLAG, E_FALSE);
  62.     }
  63. /*****************************************************************************
  64.  * FUNCTION
  65.  *  mmi_brw_handle_page_rendering_terminated
  66.  * DESCRIPTION
  67.  *  It handle the page rendering terminated status
  68.  * PARAMETERS
  69.  *  void  
  70.  * RETURNS
  71.  *  void
  72.  *****************************************************************************/
  73. void mmi_brw_handle_page_rendering_terminated(void)
  74. {
  75.     /*----------------------------------------------------------------*/
  76.     /* Local Variables                                                */
  77.     /*----------------------------------------------------------------*/
  78.     /*----------------------------------------------------------------*/
  79.     /* Code Body                                                      */
  80.     /*----------------------------------------------------------------*/
  81. }
  82. /*****************************************************************************
  83.  * FUNCTION
  84.  *  mmi_brw_handle_page_refresh_begin
  85.  * DESCRIPTION
  86.  *  It handle the page refresh begin status
  87.  * PARAMETERS
  88.  *  void  
  89.  * RETURNS
  90.  *  void
  91.  *****************************************************************************/
  92. void mmi_brw_handle_page_refresh_begin(void)
  93. {
  94.     /*----------------------------------------------------------------*/
  95.     /* Local Variables                                                */
  96.     /*----------------------------------------------------------------*/
  97.     #ifdef __MMI_JDD_UI_DRAW_IMAGE_ON_TIMER_EVENT__
  98.     MMI_JDD_UI_WINDOW_INFO_STRUCT *jdd_window_info_struct_p = NULL;
  99.     JC_UINT32 uiWindowID = 0;
  100.     #endif /* __MMI_JDD_UI_DRAW_IMAGE_ON_TIMER_EVENT__ */
  101.     /*----------------------------------------------------------------*/
  102.     /* Code Body                                                      */
  103.     /*----------------------------------------------------------------*/
  104. if (!(g_brw_page_cntx.brw_PageFetchStatus||g_brw_page_cntx.brw_isRefreshDisplay))
  105.     {
  106.         g_brw_LskLabel = 0;
  107.         g_brw_RskLabel = STR_GLOBAL_CANCEL;
  108.         g_brw_LskFunPtr = NULL;
  109.         g_brw_RskFunPtr = NULL;
  110.         g_brw_page_cntx.brw_PageRefreshDispStatus = 1;
  111. #ifdef __MMI_JDD_UI_DRAW_IMAGE_ON_TIMER_EVENT__
  112.         uiWindowID = mmi_jdd_ui_get_appWindowID(E_TASK_BROWSER_CORE);
  113.         jdd_window_info_struct_p = (MMI_JDD_UI_WINDOW_INFO_STRUCT*) uiWindowID;
  114.         if (jdd_window_info_struct_p != NULL)
  115.         {
  116.     mmi_jdd_ui_flush_image_display_queue(uiWindowID);
  117.         }
  118.     #endif /* __MMI_JDD_UI_DRAW_IMAGE_ON_TIMER_EVENT__ */
  119.     }
  120. }
  121. /*****************************************************************************
  122.  * FUNCTION
  123.  *  mmi_brw_handle_page_refresh_terminated
  124.  * DESCRIPTION
  125.  *  It handle the page refresh terminated status
  126.  * PARAMETERS
  127.  *  void  
  128.  * RETURNS
  129.  *  void
  130.  *****************************************************************************/
  131. void mmi_brw_handle_page_refresh_terminated(void)
  132.     {
  133.     /*----------------------------------------------------------------*/
  134.     /* Local Variables                                                */
  135.     /*----------------------------------------------------------------*/
  136.     /*----------------------------------------------------------------*/
  137.     /* Code Body                                                      */
  138.     /*----------------------------------------------------------------*/
  139.     if (!(g_brw_page_cntx.brw_PageFetchStatus||g_brw_page_cntx.brw_isRefreshDisplay))
  140.         {
  141.             g_brw_LskLabel = STR_GLOBAL_OPTIONS;
  142.             g_brw_LskFunPtr = mmi_brw_rendered_page_options;
  143.             g_brw_RskLabel = 0;
  144.             g_brw_RskFunPtr = NULL;
  145.             if (E_TRUE == mmi_brw_is_back())
  146.             {
  147.                 g_brw_RskLabel = STR_GLOBAL_BACK;
  148.                 g_brw_RskFunPtr = mmi_brw_goto_prev_page;
  149.             }
  150.         g_brw_page_cntx.brw_PageRefreshDispStatus = 0;
  151.     }
  152. }
  153. /*****************************************************************************
  154.  * FUNCTION
  155.  *  mmi_brw_pageupdate_callback
  156.  * DESCRIPTION
  157.  *  It handle the when there is no page status update from core
  158.  * PARAMETERS
  159.  *  pAppArg                 [?]         
  160.  *  bIsScriptAbort          [IN]      
  161.  * RETURNS
  162.  *  void
  163.  *****************************************************************************/
  164. void mmi_brw_pageupdate_callback(void *pAppArg, JC_BOOLEAN bIsScriptAbort)
  165. {
  166. PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_brw_pageupdate_callback() called"));
  167. if(g_brw_page_cntx.brw_PageFetchStatus)
  168. {
  169. return;/*If page status callback has alredy been called then return*/
  170. }
  171. if(bIsScriptAbort)
  172. {
  173. if (GetActiveScreenId() == SCR_ID_BRW_JBROWSER_MAIN)       
  174. {
  175. mmi_brw_show_normal_title();
  176. }
  177. if (E_TRUE == mmi_brw_is_back())
  178. {
  179. g_brw_LskLabel = STR_GLOBAL_OPTIONS;
  180. g_brw_RskLabel = STR_GLOBAL_BACK;
  181. g_brw_LskFunPtr = mmi_brw_rendered_page_options;
  182. g_brw_RskFunPtr = mmi_brw_goto_prev_page;
  183. }
  184. else
  185. {
  186. g_brw_LskLabel = STR_GLOBAL_OPTIONS;
  187. g_brw_RskLabel = 0;
  188. g_brw_LskFunPtr = mmi_brw_rendered_page_options;
  189. g_brw_RskFunPtr = NULL;
  190. }
  191. g_brw_page_cntx.brw_PageFetchStatus = 0;
  192. jdi_BrowserResumeMarqueeTimer(pBrowserCtxt);
  193. memset(g_brw_page_cntx.brw_PageStatusCodeStack, -1, sizeof(g_brw_page_cntx.brw_PageStatusCodeStack));
  194. jdi_BrowserHistorySave(pBrowserCtxt);
  195. }
  196. if (GetActiveScreenId() == SCR_ID_BRW_JBROWSER_MAIN)
  197.     {
  198. right_softkey_up();
  199. left_softkey_up();
  200. mmi_brw_clear_key_handler(KEY_LSK);
  201. mmi_brw_clear_key_handler(KEY_RSK);
  202.         ChangeRightSoftkey(g_brw_RskLabel, 0);
  203.         ChangeLeftSoftkey(g_brw_LskLabel, 0);
  204.         SetLeftSoftkeyFunction((FuncPtr) g_brw_LskFunPtr, KEY_EVENT_UP);
  205.         SetRightSoftkeyFunction((FuncPtr) g_brw_RskFunPtr, KEY_EVENT_UP);
  206.     }
  207. }
  208. /*****************************************************************************
  209.  * FUNCTION
  210.  *  mmi_brw_page_status_callback
  211.  * DESCRIPTION
  212.  *  Rendering status callback
  213.  * PARAMETERS
  214.  *  pAppArg                 [?]         
  215.  *  eBrowserStatusCode      [IN]        
  216.  * RETURNS
  217.  *  void
  218.  *****************************************************************************/
  219. void mmi_brw_page_status_callback(void *pAppArg, E_BROWSER_STATUS_CODE eBrowserStatusCode)
  220. {
  221.     /*----------------------------------------------------------------*/
  222.     /* Local Variables                                                */
  223.     /*----------------------------------------------------------------*/
  224.     /*----------------------------------------------------------------*/
  225.     /* Code Body                                                      */
  226.     /*----------------------------------------------------------------*/
  227. if(!((GetActiveScreenId() == SCR_ID_BRW_JBROWSER_MAIN) || IsScreenPresent(SCR_ID_BRW_JBROWSER_MAIN)))
  228. {
  229. if(eBrowserStatusCode == E_BROWSER_PAGE_REQUEST_TERMINATED)
  230. {
  231. g_brw_page_cntx.brw_cancel_flag = 0;
  232. g_brw_page_cntx.brw_pageRenderStatus = 0;
  233. g_brw_page_cntx.brw_PageFetchStatus = 0;
  234. memset(g_brw_page_cntx.brw_PageStatusCodeStack, -1, sizeof(g_brw_page_cntx.brw_PageStatusCodeStack));
  235. jdi_BrowserHistorySave(pBrowserCtxt);
  236. }
  237. return;
  238. }
  239. PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "Page status calbk called with status",
  240.                                      eBrowserStatusCode));
  241.     if (eBrowserStatusCode == E_BROWSER_PAGE_REQUEST_BEGIN)
  242.     {
  243. mmi_brw_handle_page_request_begin();
  244.     }
  245.     else if (eBrowserStatusCode == E_BROWSER_PAGE_REQUEST_TERMINATED)
  246.     {
  247. mmi_brw_handle_page_request_terminated();
  248.     }
  249.     else if (eBrowserStatusCode == E_BROWSER_FETCH_BEGIN)
  250.     {
  251. mmi_brw_handle_page_fetch_begin();
  252. }
  253.     else if (eBrowserStatusCode == E_BROWSER_FETCH_TERMINATED)
  254.     {
  255. mmi_brw_handle_page_fetch_terminated();
  256.         }
  257.     else if (eBrowserStatusCode == E_BROWSER_RENDERING_BEGIN)
  258.     {
  259. mmi_brw_handle_page_rendering_begin();
  260.     }
  261.     else if (eBrowserStatusCode == E_BROWSER_RENDERING_TERMINATED)
  262.     {
  263. mmi_brw_handle_page_rendering_terminated();
  264.     }
  265.     else if (eBrowserStatusCode == E_BROWSER_PAGE_REFRESH_BEGIN)
  266.     {
  267. mmi_brw_handle_page_refresh_begin();
  268.     }
  269.     else if (eBrowserStatusCode == E_BROWSER_PAGE_REFRESH_TERMINATED)
  270.     {
  271. mmi_brw_handle_page_refresh_terminated();
  272.     }
  273.     else
  274.     {
  275.         /* assert should fail */
  276.     }
  277.     if (GetActiveScreenId() == SCR_ID_BRW_JBROWSER_MAIN)
  278.     {
  279. right_softkey_up();
  280. left_softkey_up();
  281. mmi_brw_clear_key_handler(KEY_LSK);
  282. mmi_brw_clear_key_handler(KEY_RSK);
  283.         ChangeRightSoftkey(g_brw_RskLabel, 0);
  284.         ChangeLeftSoftkey(g_brw_LskLabel, 0);
  285.         SetLeftSoftkeyFunction((FuncPtr) g_brw_LskFunPtr, KEY_EVENT_UP);
  286.         SetRightSoftkeyFunction((FuncPtr) g_brw_RskFunPtr, KEY_EVENT_UP);
  287.     }
  288. }
  289. /*****************************************************************************
  290.  * FUNCTION
  291.  *  mmi_brw_rendering_status_callback
  292.  * DESCRIPTION
  293.  *  Rendering status callback
  294.  * PARAMETERS
  295.  *  pAppArg             [?]         
  296.  *  eRenderStatus       [IN]        
  297.  * RETURNS
  298.  *  void
  299.  *****************************************************************************/
  300. void mmi_brw_rendering_status_callback(void *pAppArg, ERenderingStatus eRenderStatus)
  301. {
  302.     /*----------------------------------------------------------------*/
  303.     /* Local Variables                                                */
  304.     /*----------------------------------------------------------------*/
  305.     /*----------------------------------------------------------------*/
  306.     /* Code Body                                                      */
  307.     /*----------------------------------------------------------------*/
  308.     /*
  309.      * S32 iwidth =0;
  310.      * S32   iheight =0;
  311.      * nvram_wap_profile_content_struct *activated_wap_profile;
  312.      * if(E_FALSE == mmi_brw_is_browser_window_active())
  313.      * {
  314.      * return;
  315.      * }
  316.      * 
  317.      * if( eRenderStatus == E_RENDERING_STARTED )
  318.      * {
  319.      * activated_wap_profile = mmi_ph_get_activated_wap_profile(); 
  320.      * 
  321.      */ /* Free the DO list for the last rendered page */
  322.     /* mmi_brw_free_do_list(); */
  323.     /*
  324.      * if(mmi_ph_check_data_account_type(activated_wap_profile->data_account) == PH_DATA_ACCOUNT_CSD)
  325.      * {
  326.      * MMI_title_icon = (PU8)get_image(IMG_ID_BRW_CONNECTION_STATUS_CSD);
  327.      * }
  328.      * else if(mmi_ph_check_data_account_type(activated_wap_profile->data_account) == PH_DATA_ACCOUNT_GPRS)
  329.      * {
  330.      * MMI_title_icon = (PU8)get_image(IMG_ID_BRW_CONNECTION_STATUS_GPRS);
  331.      * }
  332.      * else
  333.      * {
  334.      * // Error
  335.      * }
  336.      * 
  337.      * if(MMI_title_icon!=NULL)
  338.      * {
  339.      * gui_measure_image(MMI_title_icon,&iwidth,&iheight);
  340.      * }
  341.      * 
  342.      * draw_title();
  343.      * 
  344.      * _MMI_animated_icon_x  = MMI_title_x+1;
  345.      * _MMI_animated_icon_y  = MMI_title_y+((MMI_title_height>>1)-(iheight>>1));
  346.      * 
  347.      * if(mmi_ph_check_data_account_type(activated_wap_profile->data_account) == PH_DATA_ACCOUNT_CSD)
  348.      * {
  349.      * _MMI_animated_icon  = (PU8)get_image(IMG_ID_BRW_CONNECTION_STATUS_CSD);
  350.      * }
  351.      * else if(mmi_ph_check_data_account_type(activated_wap_profile->data_account) == PH_DATA_ACCOUNT_GPRS)
  352.      * {
  353.      * _MMI_animated_icon  = (PU8)get_image(IMG_ID_BRW_CONNECTION_STATUS_GPRS);
  354.      * }
  355.      * else
  356.      * {
  357.      * // Error
  358.      * }
  359.      * 
  360.      * //PMT VIKAS START 20060515
  361.      * // wgui_show_transparent_animation();
  362.      * gdi_image_draw_animation_file(_MMI_animated_icon_x, _MMI_animated_icon_y, (PS8)_MMI_animated_icon, &g_brw_icon_handle);
  363.      * //PMT VIKAS END 20060515
  364.      * 
  365.      * ChangeLeftSoftkey(0,0);
  366.      * ChangeRightSoftkey(STR_GLOBAL_CANCEL,0);
  367.      * SetRightSoftkeyFunction(mmi_brw_stop_fetch,KEY_EVENT_UP);
  368.      * }
  369.      * else if(eRenderStatus == E_RENDERING_TERMINATED)
  370.      * {
  371.      * //PMT VIKAS START 20060515
  372.      * //     All animation should not stop at this stage.
  373.      * // gui_hide_animations();
  374.      * gdi_image_stop_animation(g_brw_icon_handle);
  375.      * //PMT VIKAS END 20060515
  376.      * MMI_title_icon = (PU8)get_image(GetRootTitleIcon(SERVICES_WAP_MENU_ID));
  377.      * if(mmi_brw_is_browser_window_active())//temp added by tk
  378.      * {
  379.      * draw_title();
  380.      * }
  381.      * 
  382.      * if(E_TRUE == mmi_brw_is_back())
  383.      * {
  384.      * ChangeRightSoftkey(STR_GLOBAL_BACK,0);
  385.      * SetRightSoftkeyFunction(mmi_brw_goto_prev_page,KEY_EVENT_UP);
  386.      * 
  387.      * ChangeLeftSoftkey(STR_GLOBAL_OPTIONS,0);
  388.      * SetLeftSoftkeyFunction(mmi_brw_rendered_page_options,KEY_EVENT_UP);
  389.      * }
  390.      * else
  391.      * {
  392.      * if(cancel_flag)
  393.      * {
  394.      * GoBackHistory();
  395.      * }
  396.      * else
  397.      * {
  398.      * ChangeRightSoftkey(0,0);
  399.      * 
  400.      * ChangeLeftSoftkey(STR_GLOBAL_OPTIONS,0);
  401.      * SetLeftSoftkeyFunction(mmi_brw_rendered_page_options,KEY_EVENT_UP);
  402.      * }
  403.      * }
  404.      * 
  405.      * jdi_BrowserHistorySave(pBrowserCtxt);
  406.      * cancel_flag = 0;
  407.      * }
  408.      * else
  409.      * {
  410.      */ /* assert should fail */
  411.     /* } */
  412. }
  413. /*****************************************************************************
  414.  * FUNCTION
  415.  *  mmi_brw_goto_prev_page
  416.  * DESCRIPTION
  417.  *  Fetch the previous page from history
  418.  * PARAMETERS
  419.  *  void
  420.  * RETURNS
  421.  *  void
  422.  *****************************************************************************/
  423. void mmi_brw_goto_prev_page(void)
  424. {
  425.     /*----------------------------------------------------------------*/
  426.     /* Local Variables                                                */
  427.     /*----------------------------------------------------------------*/
  428.     JC_RETCODE iRet = JC_OK;
  429.     /*----------------------------------------------------------------*/
  430.     /* Code Body                                                      */
  431.     /*----------------------------------------------------------------*/
  432.     /* Free the DO List for last rendered page */
  433.     mmi_brw_free_do_list();
  434.     iRet = jdi_BrowserBack(pBrowserCtxt);
  435.     if (JC_OK != iRet)
  436.     {
  437.         /* Error */
  438.     }
  439. }
  440. /*****************************************************************************
  441.  * FUNCTION
  442.  *  mmi_brw_exit_brw_page
  443.  * DESCRIPTION
  444.  *  Exit from browser screen
  445.  * PARAMETERS
  446.  *  void
  447.  * RETURNS
  448.  *  void
  449.  *****************************************************************************/
  450. void mmi_brw_exit_brw_page(void)
  451. {
  452. mmi_brw_entry_exit_menu();
  453. }
  454. /*****************************************************************************
  455.  * FUNCTION
  456.  *  mmi_brw_stop_fetch
  457.  * DESCRIPTION
  458.  *  Fetch stop event
  459.  * PARAMETERS
  460.  *  void
  461.  * RETURNS
  462.  *  void
  463.  *****************************************************************************/
  464. void mmi_brw_stop_fetch(void)
  465. {
  466.     /*----------------------------------------------------------------*/
  467.     /* Local Variables                                                */
  468.     /*----------------------------------------------------------------*/
  469.     JC_RETCODE iRet = JC_OK;
  470.     JC_EVENT_DATA eventData = {0, };
  471.     /*----------------------------------------------------------------*/
  472.     /* Code Body                                                      */
  473.     /*----------------------------------------------------------------*/
  474.     /* send browser start up event */
  475.     eventData.destTaskInfo.iAppID = E_TASK_BROWSER_UI;
  476.     eventData.destTaskInfo.iTaskID = E_TASK_BROWSER_UI;
  477.     eventData.srcTaskInfo.iAppID = E_TASK_BROWSER_UI;
  478.     eventData.srcTaskInfo.iTaskID = E_TASK_BROWSER_UI;
  479.     /* eventData.pEventInfo = NULL ; */
  480.     eventData.uiEventInfoSize = 0;
  481.     eventData.iEventType = E_BRW_STOP_FETCH_EVENT;
  482.     iRet = jdd_QueueSend(&eventData);
  483.     g_brw_page_cntx.brw_cancel_flag = 1;
  484. /* This variable was set when we try to fetch a page through EnterAddress Option
  485. screen. Reset this flag to 0 when page fetch was cancelled as depending on this
  486. core will set the title in EnterAddress Title history. */
  487. g_brw_add_hist_flag = 0;
  488.     if (JC_OK != iRet)
  489.     {
  490.         return;
  491.     }
  492. }
  493. /*****************************************************************************
  494.  * FUNCTION
  495.  *  mmi_brw_show_authentication_callback
  496.  * DESCRIPTION
  497.  *  Show authentication handler callback.
  498.  * PARAMETERS
  499.  *  pAppArg     [?]     
  500.  *  pmURL       [?]     
  501.  * RETURNS
  502.  *  void
  503.  *****************************************************************************/
  504. JC_RETCODE mmi_brw_show_authentication_callback(void *pAppArg, JC_AUTH_INDICATION *pAuthIndication)
  505. {
  506.     /*----------------------------------------------------------------*/
  507.     /* Local Variables                                                */
  508.     /*----------------------------------------------------------------*/
  509.     /*----------------------------------------------------------------*/
  510.     /* Code Body                                                      */
  511.     /*----------------------------------------------------------------*/
  512.     if (E_FALSE == mmi_brw_is_browser_window_active())
  513.     {
  514.         return JC_OK;
  515.     }
  516.     if(pAuthIndication->pcHeaders == NULL)
  517.     {
  518.         jdd_MMINotificationMessage(JC_ERR_AUTH_METHOD_INVALID, E_NOTIFICATION_ERR, NULL, NULL);
  519.         return JC_ERR_USER_CANCELLED;
  520.     }
  521.     /* Himanshu: Clear the username and password buffer while entering authentication screen */
  522.     memset(g_brw_cntx.brw_auth_username, 0, sizeof(g_brw_cntx.brw_auth_username));
  523.     memset(g_brw_cntx.brw_auth_password, 0, sizeof(g_brw_cntx.brw_auth_password));
  524.     mmi_brw_entry_auth_handler();
  525.     return JC_OK;
  526. }
  527. /*****************************************************************************
  528.  * FUNCTION
  529.  *  mmi_brw_do_tag_callback
  530.  * DESCRIPTION
  531.  *  Do tag_ handler callback
  532.  * PARAMETERS
  533.  *  pAppArg     [?]     
  534.  *  pDoList     [?]     
  535.  * RETURNS
  536.  *  void
  537.  *****************************************************************************/
  538. void mmi_brw_do_tag_callback(void *pAppArg, JC_DO_LIST *pDoList)
  539. {
  540.     /*----------------------------------------------------------------*/
  541.     /* Local Variables                                                */
  542.     /*----------------------------------------------------------------*/
  543.     JC_DO_LIST *pTempDoList;
  544.     S32 count = 0;
  545.     /*----------------------------------------------------------------*/
  546.     /* Code Body                                                      */
  547.     /*----------------------------------------------------------------*/
  548.     if (E_FALSE == mmi_brw_is_browser_window_active())
  549.     {
  550.         return;
  551.     }
  552.     /* Free the DO List for last rendered page */
  553.     mmi_brw_free_do_list();
  554.     if (NULL != pDoList)
  555.     {
  556.         mmi_brw_copy_linked_list(pDoList, &pTempDoList);
  557.         if (NULL == pTempDoList)
  558.         {
  559.          jdd_MMINotificationMessage((JC_INT32) JC_ERR_MEMORY_ALLOCATION, E_NOTIFICATION_ERR, NULL, NULL);
  560.          return;
  561.         }
  562.         g_brw_cntx.do_element_count = mmi_brw_get_do_element_count(pTempDoList);
  563.     }
  564.     if (g_brw_cntx.do_element_count != 0)
  565.     {
  566.         g_brw_cntx.DoElementList = (JC_DO_LIST **) jdd_MemAlloc(g_brw_cntx.do_element_count, sizeof(JC_DO_LIST*));
  567.         if (NULL == g_brw_cntx.DoElementList)
  568.         {
  569.          mmi_brw_free_duplicate_do_list(&pTempDoList);
  570.          jdd_MMINotificationMessage((JC_INT32) JC_ERR_MEMORY_ALLOCATION, E_NOTIFICATION_ERR, NULL, NULL);
  571.          return;
  572.         }
  573.         while (NULL != pTempDoList)
  574.         {
  575.             g_brw_cntx.DoElementList[count] = pTempDoList;
  576.             pTempDoList = pTempDoList->pNext;
  577.             count++;
  578.         }
  579.     }
  580. }
  581. /*****************************************************************************
  582.  * FUNCTION
  583.  *  mmi_brw_get_do_element_count
  584.  * DESCRIPTION
  585.  *  Function to get the number of do elements on the page
  586.  * PARAMETERS
  587.  *  pTempDoList     [?]     
  588.  * RETURNS
  589.  *  void
  590.  *****************************************************************************/
  591. U16 mmi_brw_get_do_element_count(JC_DO_LIST *pTempDoList)
  592. {
  593.     /*----------------------------------------------------------------*/
  594.     /* Local Variables                                                */
  595.     /*----------------------------------------------------------------*/
  596.     U16 Count = 0;
  597.     /*----------------------------------------------------------------*/
  598.     /* Code Body                                                      */
  599.     /*----------------------------------------------------------------*/
  600.     while (NULL != pTempDoList)
  601.     {
  602.         Count++;
  603.         pTempDoList = pTempDoList->pNext;
  604.     }
  605.     return (Count);
  606. }
  607. /*****************************************************************************
  608.  * FUNCTION
  609.  *  mmi_brw_free_duplicate_do_list
  610.  * DESCRIPTION
  611.  *  Free the memory assign to the duplecate link list.
  612.  * PARAMETERS
  613.  *  pTempDoList     [IN]        
  614.  * RETURNS
  615.  *  void
  616.  *****************************************************************************/
  617. void mmi_brw_free_duplicate_do_list(JC_DO_LIST **pTempDoList)
  618. {
  619.     /*----------------------------------------------------------------*/
  620.     /* Local Variables                                                */
  621.     /*----------------------------------------------------------------*/
  622.     JC_DO_LIST *temp_p = NULL;
  623.     
  624.     /*----------------------------------------------------------------*/
  625.     /* Code Body                                                      */
  626.     /*----------------------------------------------------------------*/
  627. while (NULL != *pTempDoList)
  628. {
  629. if (NULL != (*pTempDoList)->pDoLabel)
  630. {
  631. jdd_MemFree((*pTempDoList)->pDoLabel);
  632. (*pTempDoList)->pDoLabel = NULL;
  633. }
  634. if (NULL != (*pTempDoList)->pDoType)
  635. {
  636. jdd_MemFree((*pTempDoList)->pDoType);
  637. (*pTempDoList)->pDoType = NULL;
  638. }
  639. temp_p = *pTempDoList; 
  640. *pTempDoList = (*pTempDoList)->pNext;
  641. jdd_MemFree(temp_p);
  642. temp_p = NULL;
  643. }
  644. }
  645. /*****************************************************************************
  646.  * FUNCTION
  647.  *  mmi_brw_copy_linked_list
  648.  * DESCRIPTION
  649.  *  Function to make a copy of the linked list
  650.  * PARAMETERS
  651.  *  pDoList         [?]         
  652.  *  pTempDoList     [IN]        
  653.  * RETURNS
  654.  *  void
  655.  *****************************************************************************/
  656. void mmi_brw_copy_linked_list(JC_DO_LIST *pDoList, JC_DO_LIST **pTempDoList)
  657. {
  658.     /*----------------------------------------------------------------*/
  659.     /* Local Variables                                                */
  660.     /*----------------------------------------------------------------*/
  661.     JC_DO_LIST *temp_p = NULL;
  662.     JC_DO_LIST *temp_do_node_p = NULL;
  663.     
  664.     /*----------------------------------------------------------------*/
  665.     /* Code Body                                                      */
  666.     /*----------------------------------------------------------------*/
  667.     
  668.     *pTempDoList = NULL;
  669.     
  670.     while (NULL != pDoList) 
  671.     {
  672.         temp_do_node_p = (JC_DO_LIST*) jdd_MemAlloc(1, sizeof(JC_DO_LIST));
  673.         if (NULL == temp_do_node_p)
  674.         {
  675.         mmi_brw_free_duplicate_do_list(pTempDoList);
  676.             return;
  677.         }
  678.         temp_do_node_p->pDoElement = pDoList->pDoElement;
  679.        
  680.         temp_do_node_p->pDoLabel = (JC_CHAR*) jdi_UtilsTcsDup(pDoList->pDoLabel);
  681.         if (NULL == temp_do_node_p->pDoLabel)
  682.         {
  683.         mmi_brw_free_duplicate_do_list(pTempDoList);
  684.             return;
  685.         }
  686.        
  687.         temp_do_node_p->pDoType = (JC_CHAR*) jdi_UtilsTcsDup(pDoList->pDoType);
  688.         if (NULL == temp_do_node_p->pDoType)
  689.         {
  690.         mmi_brw_free_duplicate_do_list(pTempDoList);
  691.             return;
  692.         }
  693.      if (NULL == *pTempDoList)
  694.      {
  695.          *pTempDoList = temp_do_node_p;
  696.             temp_p = *pTempDoList;
  697.      }
  698.      else
  699.         {
  700.             temp_p->pNext = temp_do_node_p;
  701.             temp_p = temp_p->pNext;
  702.         }
  703.      pDoList = pDoList->pNext;
  704.     }
  705. }
  706. /*****************************************************************************
  707.  * FUNCTION
  708.  *  mmi_brw_set_confirm_callback
  709.  * DESCRIPTION
  710.  *  set confirm callback
  711.  * PARAMETERS
  712.  *  pAppArg         [?]         
  713.  *  pmMsg           [?]         
  714.  *  pmSoft1         [?]         
  715.  *  pmSoft2         [?]         
  716.  *  cbConfirm       [IN]        
  717.  *  pCBArg          [?]         
  718.  *  peStatus        [?]         
  719.  * RETURNS
  720.  *  void
  721.  *****************************************************************************/
  722. JC_RETCODE mmi_brw_set_confirm_callback(
  723.             void *pAppArg,
  724.             JC_CHAR *pmMsg,
  725.             JC_CHAR *pmSoft1,
  726.             JC_CHAR *pmSoft2,
  727.             BROWSER_CONFIRM_CB cbConfirm,
  728.             void *pCBArg,
  729.             JC_BOOLEAN *peStatus)
  730. {
  731.     /*----------------------------------------------------------------*/
  732.     /* Local Variables                                                */
  733.     /*----------------------------------------------------------------*/
  734.     JC_INT32 iStrLen = 0;
  735.     JC_RETCODE eRet = JC_OK;
  736.     /*----------------------------------------------------------------*/
  737.     /* Code Body                                                      */
  738.     /*----------------------------------------------------------------*/
  739.     if (E_FALSE == mmi_brw_is_browser_window_active())
  740.     {
  741.         return eRet;
  742.     }
  743.     if ((NULL != pmMsg) && ((iStrLen = jc_tcslen(pmMsg)) > 0))
  744.     {
  745.         g_pmMsg = pmMsg;
  746.      }
  747.     else
  748.     {
  749.         *peStatus = E_FALSE;
  750.         return JC_ERR_INVALID_PARAMETER;
  751.     }
  752.     gCallBackConfirm = cbConfirm;
  753.     pArg = pCBArg;
  754.     DisplayConfirm(0, 0, 0, 0, (UI_string_type) g_pmMsg, IMG_GLOBAL_QUESTION, 0);
  755.     if (!pmSoft1)   /* added by pawan 31-07-06 for default confirm soft keys */
  756.     {
  757.         pmSoft1 = (U16*) GetString(STR_GLOBAL_OK);
  758.     }
  759.     if (!pmSoft2)
  760.     {
  761.         pmSoft2 = (U16*) GetString(STR_GLOBAL_CANCEL);
  762.     }
  763.     ChangeLeftSoftkeyByString((UI_string_type) pmSoft1, NULL);
  764.     ChangeRightSoftkeyByString((UI_string_type) pmSoft2, NULL);
  765.     SetLeftSoftkeyFunction(mmi_brw_confirm_msg_LSK_hdlr, KEY_EVENT_UP);
  766.     SetRightSoftkeyFunction(mmi_brw_confirm_msg_RSK_hdlr, KEY_EVENT_UP);
  767.     g_brw_page_cntx.brw_PageFetchStatus = 0;
  768.     eRet = JC_ERR_WAIT_USER_ACTION;
  769.     return eRet;
  770. }
  771. /*****************************************************************************
  772.  * FUNCTION
  773.  *  mmi_brw_confirm_msg_LSK_hdlr
  774.  * DESCRIPTION
  775.  *  LSK handler for confirm screen
  776.  * PARAMETERS
  777.  *  void
  778.  * RETURNS
  779.  *  void
  780.  *****************************************************************************/
  781. void mmi_brw_confirm_msg_LSK_hdlr(void)
  782. {
  783.     /*----------------------------------------------------------------*/
  784.     /* Local Variables                                                */
  785.     /*----------------------------------------------------------------*/
  786.     /*----------------------------------------------------------------*/
  787.     /* Code Body                                                      */
  788.     /*----------------------------------------------------------------*/
  789.     GoBackHistory();
  790.     gCallBackConfirm(pArg, E_TRUE);
  791. }
  792. /*****************************************************************************
  793.  * FUNCTION
  794.  *  mmi_brw_confirm_msg_RSK_hdlr
  795.  * DESCRIPTION
  796.  *  RSK handler for confirm screen
  797.  * PARAMETERS
  798.  *  void
  799.  * RETURNS
  800.  *  void
  801.  *****************************************************************************/
  802. void mmi_brw_confirm_msg_RSK_hdlr(void)
  803. {
  804.     /*----------------------------------------------------------------*/
  805.     /* Local Variables                                                */
  806.     /*----------------------------------------------------------------*/
  807.     /*----------------------------------------------------------------*/
  808.     /* Code Body                                                      */
  809.     /*----------------------------------------------------------------*/
  810.     GoBackHistory();
  811.     gCallBackConfirm(pArg, E_FALSE);
  812. }
  813. /*****************************************************************************
  814.  * FUNCTION
  815.  *  mmi_brw_set_alert_callback
  816.  * DESCRIPTION
  817.  *  Set alert callback
  818.  * PARAMETERS
  819.  *  pAppArg     [?]         
  820.  *  pmMsg       [?]         
  821.  *  cbAlert     [IN]        
  822.  *  pCBArg      [?]         
  823.  * RETURNS
  824.  *  void
  825.  *****************************************************************************/
  826. JC_RETCODE mmi_brw_set_alert_callback(void *pAppArg, JC_CHAR *pmMsg, BROWSER_ALERT_CB cbAlert, void *pCBArg)
  827. {
  828.     /*----------------------------------------------------------------*/
  829.     /* Local Variables                                                */
  830.     /*----------------------------------------------------------------*/
  831.     JC_INT32 iStrLen = 0;
  832.     JC_RETCODE eRet = JC_OK;
  833.     /*----------------------------------------------------------------*/
  834.     /* Code Body                                                      */
  835.     /*----------------------------------------------------------------*/
  836.     if (E_FALSE == mmi_brw_is_browser_window_active())
  837.     {
  838.         return eRet;
  839.     }
  840.     if ((NULL != pmMsg) && ((iStrLen = jc_tcslen(pmMsg)) > 0))
  841.     {
  842.         g_pmMsg = pmMsg;
  843.     }
  844.     else
  845.     {
  846.         return JC_ERR_INVALID_PARAMETER;
  847.     }
  848.     gCallBackAlert = cbAlert;
  849.     pArg = pCBArg;
  850.     mmi_brw_entry_alert_callback_screen();
  851.     g_brw_page_cntx.brw_PageFetchStatus = 0;
  852.     eRet = JC_ERR_WAIT_USER_ACTION;
  853.     return eRet;
  854. }
  855. /*****************************************************************************
  856.  * FUNCTION
  857.  *  mmi_brw_entry_alert_callback_screen
  858.  * DESCRIPTION
  859.  *  Entry function for alert callback.
  860.  * PARAMETERS
  861.  *  void
  862.  * RETURNS
  863.  *  void
  864.  *****************************************************************************/
  865. void mmi_brw_entry_alert_callback_screen(void)
  866. {
  867.     /*----------------------------------------------------------------*/
  868.     /* Local Variables                                                */
  869.     /*----------------------------------------------------------------*/
  870.     U8 *guiBuffer = NULL;
  871.     /*----------------------------------------------------------------*/
  872.     /* Code Body                                                      */
  873.     /*----------------------------------------------------------------*/
  874.     EntryNewScreen(SCR_ID_BRW_WAP_ALERT_SCREEN, NULL, mmi_brw_entry_alert_callback_screen, NULL);
  875.     guiBuffer = GetCurrGuiBuffer(SCR_ID_BRW_WAP_ALERT_SCREEN);
  876. ShowCategory165Screen(
  877.         STR_GLOBAL_OK,
  878.         IMG_GLOBAL_OK,
  879.         0,
  880.         0,
  881.         (UI_string_type) g_pmMsg,
  882.         IMG_GLOBAL_QUESTION,
  883.         guiBuffer);
  884.     SetLeftSoftkeyFunction(mmi_brw_alert_msg_LSK_hdlr, KEY_EVENT_UP);
  885.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  886. }
  887. /*****************************************************************************
  888.  * FUNCTION
  889.  *  mmi_brw_alert_msg_LSK_hdlr
  890.  * DESCRIPTION
  891.  *  LSK handler for alert callback
  892.  * PARAMETERS
  893.  *  void
  894.  * RETURNS
  895.  *  void
  896.  *****************************************************************************/
  897. void mmi_brw_alert_msg_LSK_hdlr(void)
  898. {
  899.     /*----------------------------------------------------------------*/
  900.     /* Local Variables                                                */
  901.     /*----------------------------------------------------------------*/
  902.     /*----------------------------------------------------------------*/
  903.     /* Code Body                                                      */
  904.     /*----------------------------------------------------------------*/
  905.     GoBackHistory();
  906.     gCallBackAlert(pArg);
  907. }
  908. /*****************************************************************************
  909.  * FUNCTION
  910.  *  mmi_brw_set_prompt_callback
  911.  * DESCRIPTION
  912.  *  Prompt callback handler
  913.  * PARAMETERS
  914.  *  pAppArg             [?]         
  915.  *  pmMsg               [?]         
  916.  *  pmDefaultValue      [?]         
  917.  *  cbPrompt            [IN]        
  918.  *  pCBArg              [?]         
  919.  *  ppmMsg              [IN]        
  920.  *  peStatus            [?]         
  921.  * RETURNS
  922.  *  void
  923.  *****************************************************************************/
  924. /* PROMPT CALLBACK */
  925. JC_RETCODE mmi_brw_set_prompt_callback(
  926.             void *pAppArg,
  927.             JC_CHAR *pmMsg,
  928.             JC_CHAR *pmDefaultValue,
  929.             BROWSER_PROMPT_CB cbPrompt,
  930.             void *pCBArg,
  931.             JC_CHAR **ppmMsg,
  932.             JC_BOOLEAN *peStatus)
  933. {
  934.     /*----------------------------------------------------------------*/
  935.     /* Local Variables                                                */
  936.     /*----------------------------------------------------------------*/
  937.     JC_INT32 iStrLen = 0;
  938.     JC_RETCODE eRet = JC_OK;
  939.     /*----------------------------------------------------------------*/
  940.     /* Code Body                                                      */
  941.     /*----------------------------------------------------------------*/
  942.     if (E_FALSE == mmi_brw_is_browser_window_active())
  943.     {
  944.         return eRet;
  945.     }
  946.     if ((NULL != pmMsg) && ((iStrLen = jc_tcslen(pmMsg)) > 0) && (NULL != ppmMsg))
  947.     {
  948.         g_pmMsg = pmMsg;
  949.         if (pmDefaultValue)
  950.         {
  951.             g_pmDefaultValue = (JC_CHAR *)jdd_MemAlloc(pfnUnicodeStrlen((S8*) pmDefaultValue)+1, sizeof(JC_CHAR));
  952. if(NULL != g_pmDefaultValue)
  953. {
  954. pfnUnicodeStrcpy((S8*) g_pmDefaultValue, (S8*) pmDefaultValue);
  955. }
  956.         }
  957.         else
  958.         {
  959.             g_pmDefaultValue = NULL;
  960.         }
  961.     }
  962.     else
  963.     {
  964.         *peStatus = E_FALSE;
  965.         return JC_ERR_INVALID_PARAMETER;
  966.     }
  967.     gCallBackPrompt = cbPrompt;
  968.     pArg = pCBArg;
  969.     mmi_brw_entry_prompt_callback_screen();
  970.     eRet = JC_ERR_WAIT_USER_ACTION;
  971.     return eRet;
  972. }
  973. /*****************************************************************************
  974.  * FUNCTION
  975.  *  mmi_brw_entry_prompt_callback_screen
  976.  * DESCRIPTION
  977.  *  Entry function for prompt callback.
  978.  * PARAMETERS
  979.  *  void
  980.  * RETURNS
  981.  *  void
  982.  *****************************************************************************/
  983. void mmi_brw_entry_prompt_callback_screen(void)
  984. {
  985.     /*----------------------------------------------------------------*/
  986.     /* Local Variables                                                */
  987.     /*----------------------------------------------------------------*/
  988.     U32 msgLen = 0;
  989.     U8 *guiBuffer = NULL;
  990.     /*----------------------------------------------------------------*/
  991.     /* Code Body                                                      */
  992.     /*----------------------------------------------------------------*/
  993.     EntryNewScreen(SCR_ID_BRW_WAP_PROMPT_INPUT_SCREEN, NULL, mmi_brw_entry_prompt_callback_screen, NULL);
  994.     guiBuffer = GetCurrGuiBuffer(SCR_ID_BRW_WAP_PROMPT_INPUT_SCREEN);
  995.     msgLen = pfnUnicodeStrlen((S8*) g_pmMsg);
  996.     /* added by pawan 31-07-06 for dialoge input box */
  997.     ShowCategory74Screen(
  998.         STR_ID_BRW_PROMPT_MESSAGE,
  999.         GetRootTitleIcon(SERVICES_WAP_MENU_ID),
  1000.         STR_GLOBAL_OK,
  1001.         IMG_GLOBAL_OK,
  1002.         0,
  1003.         0,
  1004.         (PU8) g_pmMsg,
  1005.         msgLen,
  1006.         guiBuffer);
  1007.     SetLeftSoftkeyFunction(mmi_brw_pre_entry_prompt_callback_editor_screen, KEY_EVENT_UP);
  1008. }
  1009. /*****************************************************************************
  1010.  * FUNCTION
  1011.  *  mmi_brw_pre_entry_prompt_callback_editor_screen
  1012.  * DESCRIPTION
  1013.  *  Pre entry screen
  1014.  * PARAMETERS
  1015.  *  void
  1016.  * RETURNS
  1017.  *  void
  1018.  *****************************************************************************/
  1019. void mmi_brw_pre_entry_prompt_callback_editor_screen(void)
  1020. {
  1021.     g_brw_cntx.prompt_buffer = jdd_MemAlloc((MMI_JDD_UI_MAX_INPUT_LEN_FOR_ENABLED_INPUT_METHOD + 1) * ENCODING_LENGTH, 1);
  1022.     if (NULL != g_brw_cntx.prompt_buffer)
  1023.     {
  1024.         memset(g_brw_cntx.prompt_buffer, 0, (MMI_JDD_UI_MAX_INPUT_LEN_FOR_ENABLED_INPUT_METHOD + 1) * ENCODING_LENGTH);
  1025.         if (g_pmDefaultValue != NULL)
  1026.         {
  1027.             pfnUnicodeStrncpy((S8*) g_brw_cntx.prompt_buffer, (S8*) g_pmDefaultValue,MMI_JDD_UI_MAX_INPUT_LEN_FOR_ENABLED_INPUT_METHOD);
  1028.         }
  1029. if(g_pmDefaultValue)
  1030. {
  1031. jdd_MemFree(g_pmDefaultValue);
  1032. g_pmDefaultValue = NULL;
  1033. }
  1034.     }
  1035. mmi_brw_entry_prompt_callback_editor_screen();
  1036. }
  1037. /*****************************************************************************
  1038.  * FUNCTION
  1039.  *  mmi_brw_entry_prompt_callback_editor_screen
  1040.  * DESCRIPTION
  1041.  *  LSK handler for prompt callback.
  1042.  * PARAMETERS
  1043.  *  void
  1044.  * RETURNS
  1045.  *  void
  1046.  *****************************************************************************/
  1047. void mmi_brw_entry_prompt_callback_editor_screen(void)
  1048. {
  1049.     /*----------------------------------------------------------------*/
  1050.     /* Local Variables                                                */
  1051.     /*----------------------------------------------------------------*/
  1052.     U8 *guiBuffer = NULL;
  1053.     /*----------------------------------------------------------------*/
  1054.     /* Code Body                                                      */
  1055.     /*----------------------------------------------------------------*/
  1056.     EntryNewScreen(SCR_ID_BRW_WAP_PROMPT_EDITOR_SCREEN, NULL, mmi_brw_entry_prompt_callback_editor_screen, NULL);
  1057.     guiBuffer = GetCurrGuiBuffer(SCR_ID_BRW_WAP_PROMPT_EDITOR_SCREEN);
  1058. /*    g_brw_cntx.prompt_buffer = jdd_MemAlloc((MMI_JDD_UI_MAX_INPUT_LEN_FOR_ENABLED_INPUT_METHOD + 1) * ENCODING_LENGTH, 1);
  1059.     if (NULL != g_brw_cntx.prompt_buffer)
  1060.     {
  1061.         memset(g_brw_cntx.prompt_buffer, 0, (MMI_JDD_UI_MAX_INPUT_LEN_FOR_ENABLED_INPUT_METHOD + 1) * ENCODING_LENGTH);
  1062.         if (g_pmDefaultValue != NULL)
  1063.         {
  1064.             pfnUnicodeStrcpy((S8*) g_brw_cntx.prompt_buffer, (S8*) g_pmDefaultValue);
  1065.         }
  1066. if(g_pmDefaultValue)
  1067. {
  1068. jdd_MemFree(g_pmDefaultValue);
  1069. g_pmDefaultValue = NULL;
  1070. }
  1071.     }
  1072. */
  1073.     ShowCategory5Screen(
  1074.         STR_GLOBAL_EDIT,
  1075.         GetRootTitleIcon(SERVICES_WAP_MENU_ID),
  1076.         STR_GLOBAL_OK,
  1077.         IMG_GLOBAL_OK,
  1078.         STR_GLOBAL_CANCEL,
  1079.         0,
  1080.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE,
  1081.         (PU8) g_brw_cntx.prompt_buffer,
  1082.         MMI_JDD_UI_MAX_INPUT_LEN_FOR_ENABLED_INPUT_METHOD,
  1083.         guiBuffer);
  1084.     SetCategory5RightSoftkeyFunction(mmi_brw_prompt_msg_RSK_hdlr, KEY_EVENT_UP);  //pawan 28/10/2006
  1085.     SetLeftSoftkeyFunction(mmi_brw_prompt_msg_LSK_hdlr, KEY_EVENT_UP);
  1086. }
  1087. /*****************************************************************************
  1088.  * FUNCTION
  1089.  *  mmi_brw_prompt_msg_RSK_hdlr
  1090.  * DESCRIPTION
  1091.  *  LSK handler for prompt callback.
  1092.  * PARAMETERS
  1093.  *  void
  1094.  * RETURNS
  1095.  *  void
  1096.  *****************************************************************************/
  1097. void mmi_brw_prompt_msg_RSK_hdlr(void)
  1098. {
  1099.     /*----------------------------------------------------------------*/
  1100.     /* Local Variables                                                */
  1101.     /*----------------------------------------------------------------*/
  1102.     /*----------------------------------------------------------------*/
  1103.     /* Code Body                                                      */
  1104.     /*----------------------------------------------------------------*/
  1105. DeleteScreenIfPresent(SCR_ID_BRW_WAP_PROMPT_INPUT_SCREEN);
  1106. GoBackHistory();
  1107.     gCallBackPrompt(pArg, g_pmDefaultValue, E_FALSE);
  1108.     if (g_brw_cntx.prompt_buffer != NULL)
  1109.     {
  1110.         jdd_MemFree(g_brw_cntx.prompt_buffer);
  1111.         g_brw_cntx.prompt_buffer = NULL;
  1112.     }
  1113. if(g_pmDefaultValue)
  1114. {
  1115. jdd_MemFree(g_pmDefaultValue);
  1116. g_pmDefaultValue = NULL;
  1117. }
  1118. }
  1119. /*****************************************************************************
  1120.  * FUNCTION
  1121.  *  mmi_brw_prompt_msg_LSK_hdlr
  1122.  * DESCRIPTION
  1123.  *  LSK handler for prompt callback.
  1124.  * PARAMETERS
  1125.  *  void
  1126.  * RETURNS
  1127.  *  void
  1128.  *****************************************************************************/
  1129. void mmi_brw_prompt_msg_LSK_hdlr(void)
  1130. {
  1131.     /*----------------------------------------------------------------*/
  1132.     /* Local Variables                                                */
  1133.     /*----------------------------------------------------------------*/
  1134.     /*----------------------------------------------------------------*/
  1135.     /* Code Body                                                      */
  1136.     /*----------------------------------------------------------------*/
  1137. DeleteScreenIfPresent(SCR_ID_BRW_WAP_PROMPT_INPUT_SCREEN);
  1138. GoBackHistory();
  1139.     gCallBackPrompt(pArg, g_brw_cntx.prompt_buffer, E_TRUE);
  1140.     if (g_brw_cntx.prompt_buffer != NULL)
  1141.     {
  1142.         jdd_MemFree(g_brw_cntx.prompt_buffer);
  1143.         g_brw_cntx.prompt_buffer = NULL;
  1144.     }
  1145. }
  1146. /*****************************************************************************
  1147.  * FUNCTION
  1148.  *  mmi_brw_set_page_info_callback
  1149.  * DESCRIPTION
  1150.  *  Set page info callback.
  1151.  * PARAMETERS
  1152.  *  pAppArg         [?]     
  1153.  *  pPageInfo       [?]     
  1154.  * RETURNS
  1155.  *  void
  1156.  *****************************************************************************/
  1157. void mmi_brw_set_page_info_callback(void *pAppArg, JC_PAGE_INFO *pPageInfo)
  1158. {
  1159.     /*----------------------------------------------------------------*/
  1160.     /* Local Variables                                                */
  1161.     /*----------------------------------------------------------------*/
  1162.     /*----------------------------------------------------------------*/
  1163.     /* Code Body                                                      */
  1164.     /*----------------------------------------------------------------*/
  1165.     return;
  1166. }
  1167. /*****************************************************************************
  1168.  * FUNCTION
  1169.  *  mmi_brw_progress_status_callback
  1170.  * DESCRIPTION
  1171.  *  Progress status callback.
  1172.  * PARAMETERS
  1173.  *  pAppArg             [?]     
  1174.  *  pProgressInd        [?]     
  1175.  * RETURNS
  1176.  *  void
  1177.  *****************************************************************************/
  1178. void mmi_brw_progress_status_callback(void *pAppArg, COMM_PROGRESS_IND *pProgressInd)
  1179. {
  1180.     /*----------------------------------------------------------------*/
  1181.     /* Local Variables                                                */
  1182.     /*----------------------------------------------------------------*/
  1183.     /*----------------------------------------------------------------*/
  1184.     /* Code Body                                                      */
  1185.     /*----------------------------------------------------------------*/
  1186.     return;
  1187. }
  1188. /*****************************************************************************
  1189.  * FUNCTION
  1190.  *  mmi_brw_focus_callback
  1191.  * DESCRIPTION
  1192.  *  Callback for handling current focused control information.
  1193.  * PARAMETERS
  1194.  *  pAppArg             [?]         
  1195.  *  eFocusType          [IN]        
  1196.  *  bIsSelectable       [IN]        
  1197.  *  uiCtrlID            [IN]        
  1198.  * RETURNS
  1199.  *  void
  1200.  *****************************************************************************/
  1201. void mmi_brw_focus_callback(void *pAppArg, EControlType eFocusType, JC_BOOLEAN bIsSelectable, JC_UINT32 uiCtrlID)
  1202. {
  1203.     /*----------------------------------------------------------------*/
  1204.     /* Local Variables                                                */
  1205.     /*----------------------------------------------------------------*/
  1206.     /*----------------------------------------------------------------*/
  1207.     /* Code Body                                                      */
  1208.     /*----------------------------------------------------------------*/
  1209.     return;
  1210. }
  1211. /*****************************************************************************
  1212.  * FUNCTION
  1213.  *  mmi_brw_data_conn_status_app_callback
  1214.  * DESCRIPTION
  1215.  *  This function is used to get the status of data connection.
  1216.  * PARAMETERS
  1217.  *  data_accoiunt_id      [?]     
  1218.  *  eStatus   [?]     
  1219.  * RETURNS
  1220.  *  void
  1221.  *****************************************************************************/
  1222. void mmi_brw_data_conn_status_app_callback(JC_UINT32 data_accoiunt_id, JC_UINT32 eStatus)
  1223. {
  1224.     /*----------------------------------------------------------------*/
  1225.     /* Local Variables                                                */
  1226.     /*----------------------------------------------------------------*/
  1227.     /*----------------------------------------------------------------*/
  1228.     /* Code Body                                                      */
  1229.     /*----------------------------------------------------------------*/
  1230.     if (data_accoiunt_id < custom_get_csd_profile_num())
  1231.     {
  1232. PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s(%d)", "Dataconn calbk called with status",
  1233.                                      eStatus));
  1234.         switch(eStatus)
  1235.         {
  1236. case JDD_DATACONN_ACTIVATING:
  1237. g_brw_cntx.dataConnectionState = BRW_DATACONN_ACTIVATING;
  1238. break;
  1239. case JDD_DATACONN_ACTIVATED:
  1240. g_brw_cntx.dataConnectionState = BRW_DATACONN_ACTIVATED;
  1241. break;
  1242. case JDD_DATACONN_DEACTIVATING:
  1243. g_brw_cntx.dataConnectionState = BRW_DATACONN_DEACTIVATING;
  1244. break;
  1245. case JDD_DATACONN_DEACTIVATED:
  1246. g_CSDcall_aborted_status = GetDropRequestFlag();
  1247. g_brw_cntx.dataConnectionState = BRW_DATACONN_DEACTIVATED;
  1248. /*If data connection is deactivated for
  1249. E_BRW_DATACONN_AUTO_DISC_TIMEOUT_EVENT or by application then deinit will not be performed*/
  1250. if(!(g_BrwCsdCallDisconnect || g_brw_cntx.isDataConnectionDeactivate))
  1251. {
  1252. mmi_brw_deinit_event();
  1253. }
  1254. g_BrwCsdCallDisconnect = FALSE;
  1255. g_brw_cntx.isDataConnectionDeactivate = E_FALSE;
  1256. break;
  1257. case JDD_DATACONN_AUTO_DISC_TIMEOUT:
  1258. mmi_brw_dataconn_auto_disc_timeout_event();
  1259. break;
  1260. default:
  1261. break;
  1262.         }
  1263.     }
  1264. }
  1265. /*****************************************************************************
  1266.  * FUNCTION
  1267.  *  mmi_jdd_browser_ui_events_hdlr
  1268.  * DESCRIPTION
  1269.  *  EVENT HANDLER FOR BROWSER UI.
  1270.  * PARAMETERS
  1271.  *  pEventData      [?]     
  1272.  * RETURNS
  1273.  *  void
  1274.  *****************************************************************************/
  1275. extern BOOL g_option_refresh_page;
  1276. void mmi_jdd_browser_ui_events_hdlr(JC_EVENT_DATA *pEventData)
  1277. {
  1278.     /*----------------------------------------------------------------*/
  1279.     /* Local Variables                                                */
  1280.     /*----------------------------------------------------------------*/
  1281.     JC_RETCODE iRet = JC_OK;
  1282.     JC_MMI_EVENT *pmmiEventData = NULL;
  1283.     JC_MMI_EVENT mmiEventData;
  1284.     EJCScrollDirection eScrollDirection;
  1285. #if 0
  1286. /* under construction !*/
  1287. /* under construction !*/
  1288. /* under construction !*/
  1289. #endif /* 0 */
  1290.     /*----------------------------------------------------------------*/
  1291.     /* Code Body                                                      */
  1292.     /*----------------------------------------------------------------*/
  1293.     if ((E_TASK_BROWSER_CORE == pEventData->srcTaskInfo.iTaskID)
  1294.         || (E_TASK_BROWSER_UI == pEventData->srcTaskInfo.iTaskID))
  1295.     {
  1296.         switch (pEventData->iEventType)
  1297.         {
  1298.                 /* Handle secondary specific events */
  1299.             case E_BRW_STARTUP_EVENT:
  1300.             {
  1301. #ifdef JBROWSER_USE_ASM
  1302. /* Register the browser application with ASM. */
  1303.                 applib_mem_ap_register(APPLIB_MEM_AP_ID_JATAAYU_WAP, STR_ID_BRW_JBROWSER, NULL,
  1304. mmi_stop_wap_application);
  1305. #endif
  1306.                 /* PIXTEL_JATAAYU : Initialize the Browser State machine */
  1307.                 iRet = jdi_BrowserInitContext(&pBrowserCtxt, pBrowserCtxt);
  1308.                 if (JC_OK != iRet)
  1309.                 {
  1310.                     ASSERT(0);
  1311.                 }
  1312.                 iRet = jdi_BrowserInitCommPush(pBrowserCtxt);
  1313.                 if (JC_OK != iRet)
  1314.                 {
  1315.                     ASSERT(0);
  1316.                 }
  1317.             #ifdef BROWSER_PUSH_ENABLE
  1318.                 if(g_brw_cntx.isServiceMsgSetting)
  1319.                 {
  1320.                     mmi_brw_enable_push_Message(E_TRUE);
  1321.                 }
  1322.                 else
  1323.                 {
  1324.                     mmi_brw_enable_push_Message(E_FALSE);
  1325.                 }
  1326.                 mmi_brw_initialize_push_message_list(); 
  1327.                 jdi_BrowserRegisterPushHandler(pBrowserCtxt, mmi_brw_push_callback);
  1328.                 jdi_BrowserRegisterPushPPGValidateHandler(pBrowserCtxt, mmi_brw_push_PPG_validate_callback);
  1329.                 jdi_BrowserRegisterPushInboxHandler(pBrowserCtxt, mmi_brw_push_inbox_max_size_callback);
  1330.                 jdi_BrowserRegisterPushInboxFullHandler(pBrowserCtxt, mmi_brw_push_inbox_full_callback);
  1331.                 /* Added by Vivek 3 july, 2006 */
  1332.                 jdi_BrowserRegisterPushUpdateHandler(pBrowserCtxt, mmi_brw_push_with_delete_action);
  1333.             #endif /* BROWSER_PUSH_ENABLE */ 
  1334.                 g_brw_cntx.isBrowserReady = TRUE;
  1335.                 g_brw_cntx.isBrowserInitInProgress = FALSE;
  1336.                 /* Added By vivek to resolve the push status icon problem on 
  1337.                    rebooting the phone */
  1338.                 mmi_brw_unread_push_message_indication();
  1339.             #ifdef __MMI_UNIFIED_MESSAGE__
  1340.                 mmi_um_brw_push_ready_ind();
  1341.             #endif 
  1342.                 jdd_DataConnSetStatusAppCB(mmi_brw_data_conn_status_app_callback);
  1343. g_brw_cntx.dataConnectionState = BRW_DATACONN_DEACTIVATED;
  1344.             }
  1345.                 break;
  1346.             case E_BRW_START_FETCH_EVENT:
  1347.             {
  1348. jdd_MemSetActiveModuleID(E_TASK_BROWSER_CORE);
  1349.                 jdi_BrowserOpen(pBrowserCtxt);
  1350.                 jdi_BrowserSetMagnification(pBrowserCtxt, 100);
  1351.                 if (!g_brw_cntx.isConnectionActive)
  1352.                 {
  1353.                     mmi_brw_set_transport_and_data_profile();
  1354.                     g_brw_cntx.isConnectionActive = MMI_TRUE;
  1355.                 }
  1356.                 iRet = jdi_BrowserFetchRequest(pBrowserCtxt, &fetchUrlInfo);
  1357.                 if (JC_OK != iRet)
  1358.                 {
  1359.                     jdd_MMINotificationMessage((JC_INT32) iRet, E_NOTIFICATION_ERR, NULL, NULL);
  1360.                     return;
  1361.                 }
  1362.                 g_brw_cntx.page_fetch_event = BRW_START_FETCH_EVENT;    /* added by tk */
  1363.             }
  1364.                 break;
  1365.             case E_BRW_KEY_LEFT_EVENT:
  1366.                 eScrollDirection = E_JC_SCROLL_LEFT;
  1367.                 jdi_BrowserHandleScroll(pBrowserCtxt, eScrollDirection);
  1368.                 break;
  1369.             case E_BRW_KEY_RIGHT_EVENT:
  1370.                 eScrollDirection = E_JC_SCROLL_RIGHT;
  1371.                 jdi_BrowserHandleScroll(pBrowserCtxt, eScrollDirection);
  1372.                 break;
  1373.             case E_BRW_KEY_UP_EVENT:
  1374.                 eScrollDirection = E_JC_SCROLL_UP;
  1375.                 jdi_BrowserHandleScroll(pBrowserCtxt, eScrollDirection);
  1376.                 break;
  1377.             case E_BRW_KEY_DOWN_EVENT:
  1378.                 eScrollDirection = E_JC_SCROLL_DOWN;
  1379.                 jdi_BrowserHandleScroll(pBrowserCtxt, eScrollDirection);
  1380.                 break;
  1381.             case E_BRW_REFRESH_EVENT:
  1382. jdd_MemSetActiveModuleID(E_TASK_BROWSER_CORE);
  1383.                 jdi_BrowserRefreshDisplay(pBrowserCtxt);
  1384.                 break;
  1385.             case E_BRW_STOP_FETCH_EVENT:
  1386. jdd_MemSetActiveModuleID(E_TASK_BROWSER_CORE);
  1387.                 jdi_BrowserFetchStop(pBrowserCtxt);
  1388.                 /* jdi_BrowserRefreshDisplay(pBrowserCtxt) ;//commented by tk */
  1389.                 break;
  1390.             case E_BRW_ACTION_EVENT:
  1391. jdd_MemSetActiveModuleID(E_TASK_BROWSER_CORE);
  1392.                 jc_memset(&mmiEventData, 0, sizeof(JC_MMI_EVENT));
  1393.                 pmmiEventData = (JC_MMI_EVENT*) pEventData->pEventInfo;
  1394.                 mmiEventData = *pmmiEventData;
  1395.                 iRet = jdi_BrowserHandlePrimaryMMI(pBrowserCtxt, &mmiEventData);
  1396.                 if (JC_OK != iRet)
  1397.                 {
  1398.                     jdd_MMINotificationMessage((JC_INT32) iRet, E_NOTIFICATION_ERR, NULL, NULL);
  1399.                 }
  1400. jdd_QueueFree(pEventData);
  1401.                 g_brw_cntx.page_fetch_event = BRW_ACTION_EVENT;
  1402.                 break;
  1403.             case E_BRW_SAT_GOTO_URL_EVENT:
  1404. jdd_MemSetActiveModuleID(E_TASK_BROWSER_CORE);
  1405.                 jdi_BrowserOpen(pBrowserCtxt);
  1406.                 jdi_BrowserSetMagnification(pBrowserCtxt, 100);
  1407.                 iRet = jdi_BrowserFetchRequest(pBrowserCtxt, &fetchUrlInfo);
  1408.                 if (JC_OK != iRet)
  1409.                 {
  1410.                     jdd_MMINotificationMessage((JC_INT32) iRet, E_NOTIFICATION_ERR, NULL, NULL);
  1411.                     return;
  1412.                 }
  1413.                 g_brw_cntx.page_fetch_event = BRW_START_FETCH_EVENT;    /* added by tk */
  1414.                 break;
  1415.             #ifdef __DRM_SUPPORT__
  1416.             case E_BRW_PARSE_DRM_EVENT:
  1417.                 jBrowser_parse_drm_content();
  1418.                 break;
  1419.             #endif /* __DRM_SUPPORT__ */ 
  1420. case E_BRW_DEINIT_EVENT:
  1421. if(g_EndKey_pressed && (!g_brw_page_cntx.brw_PageFetchStatus))
  1422. {
  1423. DisplayIdleScreen();
  1424. }
  1425. else if(!g_EndKey_pressed)
  1426. {
  1427.                 mmi_brw_deinit_all();
  1428. mmi_brw_delete_brw_screen();
  1429. }
  1430.                 break;
  1431. case E_BRW_DATACONN_AUTO_DISC_TIMEOUT_EVENT:
  1432.                 
  1433. g_BrwCsdCallDisconnect = TRUE;
  1434. jdi_BrowserDisconnect(pBrowserCtxt);
  1435. mmi_brw_show_long_idle_disconnected_notification();
  1436.                 break;
  1437. case E_BRW_ENDKEY_EVENT:
  1438.                 
  1439. mmi_brw_goto_idle_screen();
  1440.                 break;
  1441.             default:
  1442.                 break;
  1443.         }
  1444.     }
  1445. }
  1446. #ifdef JBROWSER_USE_ASM
  1447. /*****************************************************************************
  1448.  * FUNCTION
  1449.  *  mmi_stop_wap_application
  1450.  * DESCRIPTION
  1451.  *  This function will be invoked when ASM requests WAP application memmory to free memory.
  1452.  *  This function will only be invoked in MMI context.
  1453.  * PARAMETERS
  1454.  *  owner       [IN]
  1455.  * RETURNS
  1456.  *  void
  1457.  *****************************************************************************/
  1458. void mmi_stop_wap_application(void)
  1459. {
  1460.     /* De-initialize the application */
  1461. mmi_brw_wap_deinit();
  1462. /* Free the application memmory */
  1463. applib_mem_ap_free(wap_heap_space);
  1464. /* Notify MMI about application being stopped */
  1465. applib_mem_ap_notify_stop_finished(APPLIB_MEM_AP_ID_JATAAYU_WAP, KAL_TRUE);
  1466. }
  1467. /*****************************************************************************
  1468.  * FUNCTION
  1469.  *  mmi_wap_enter_req_handler
  1470.  * DESCRIPTION
  1471.  *  Responsible for launch of application screen. If it fals to allocate memory. it can
  1472.  * invoke mmi_frm_appmem_propmt_to_release_mem to enter out of memmory screen.
  1473.  * PARAMETERS
  1474.  *  owner       [IN]
  1475.  * RETURNS
  1476.  *  void
  1477.  *****************************************************************************/
  1478. void mmi_wap_enter_req_handler(void)
  1479. {
  1480. JC_RETCODE iRet;
  1481. wap_heap_space = applib_mem_ap_alloc(APPLIB_MEM_AP_ID_JATAAYU_WAP, 500*1024);
  1482. if (wap_heap_space)
  1483. {
  1484. iRet = jdd_MemInitBrowserASMPool(wap_heap_space, 500*1024);
  1485. }
  1486. else 
  1487. {
  1488. mmi_frm_appmem_prompt_to_release_mem(
  1489. APPLIB_MEM_AP_ID_JATAAYU_WAP,
  1490. NULL,
  1491. 500*1024,
  1492. mmi_wap_request_ASM_success_callback);
  1493. }
  1494. }
  1495. /*****************************************************************************
  1496.  * FUNCTION
  1497.  *  mmi_wap_request_ASM_success_callback
  1498.  * DESCRIPTION
  1499.  * This function will get called when user stops other applications and releases
  1500.  * enough memory. This function will again try to allocate ASM memory to browser.
  1501.  * PARAMETERS
  1502.  *  owner       [IN]
  1503.  * RETURNS
  1504.  *  void
  1505.  *****************************************************************************/
  1506. void mmi_wap_request_ASM_success_callback(void)
  1507. {
  1508. wap_heap_space = applib_mem_ap_alloc(APPLIB_MEM_AP_ID_JATAAYU_WAP, 500*1024);
  1509. ASSERT(wap_heap_space);
  1510. }
  1511. #endif /* ifdef JBROWSER_USE_ASM */
  1512. /*****************************************************************************
  1513.  * FUNCTION
  1514.  *  mmi_JBrowserInitApp
  1515.  * DESCRIPTION
  1516.  *  Initialize the browser application if not already initialized
  1517.  * PARAMETERS
  1518.  *  void
  1519.  * RETURNS
  1520.  *  void
  1521.  *****************************************************************************/
  1522. JC_HANDLE *pvDRMArg;
  1523. void mmi_JBrowserInitApp(void)
  1524. {
  1525.     /*----------------------------------------------------------------*/
  1526.     /* Local Variables                                                */
  1527.     /*----------------------------------------------------------------*/
  1528.     /*----------------------------------------------------------------*/
  1529.     /* Code Body                                                      */
  1530.     /*----------------------------------------------------------------*/
  1531.     /* If the layout is not Initialized then Initialize it */
  1532.     if (g_brw_cntx.isLayoutInitialized == E_FALSE)
  1533.     {
  1534. #ifdef JBROWSER_USE_ASM
  1535. /* Allocate browser ASM pool. */
  1536. mmi_wap_enter_req_handler();
  1537. #endif
  1538. jdd_MemSetActiveModuleID(E_TASK_BROWSER_CORE);
  1539.         jdi_BrowserInitLayoutHistory(pBrowserCtxt);
  1540.         jdi_BrowserInitCacheCookie(pBrowserCtxt);
  1541.         jdi_BrowserSetMagnification(pBrowserCtxt, 100);
  1542.         jdi_BrowserRegisterShowAuthHandler(pBrowserCtxt, mmi_brw_show_authentication_callback);
  1543.         /* Presently not in use */
  1544.         //jdi_BrowserRegisterShowProgressHandler (pBrowserCtxt, mmi_brw_show_progress_bar_callback) ;
  1545.         //jdi_BrowserRegisterPageStatusHandler (pBrowserCtxt, mmi_brw_rendering_status_callback) ; 
  1546.         //ADDED BY TK to register a callback for page fetching
  1547.         jdi_BrowserRegisterBrowserStatusIndicator(pBrowserCtxt, mmi_brw_page_status_callback);
  1548.     jdi_BrowserRegisterPageUpdateIndicator(pBrowserCtxt, mmi_brw_pageupdate_callback);  //pawan
  1549.         jdi_BrowserRegisterEmptyNavListInd(pBrowserCtxt, mmi_brw_empty_navlist_callback);
  1550.         /* Presently not in use */
  1551.         /* jdi_BrowserRegisterPageRenderingStatusHandler (pBrowserCtxt, mmi_brw_page_rendering_status_callback)  ; */
  1552.         jdi_BrowserRegisterDoTagHandler(pBrowserCtxt, mmi_brw_do_tag_callback);
  1553.         jdi_BrowserEnableCache(pBrowserCtxt, E_TRUE);
  1554.         jdi_BrowserEnableCookie(pBrowserCtxt, E_TRUE);
  1555.         jdi_BrowserEnableFourWayNavigation(pBrowserCtxt, E_TRUE);
  1556.         jdi_BrowserEnableOfflineBrowsing(pBrowserCtxt, E_FALSE);
  1557.         jdi_BrowserEnableCircularScrolling(pBrowserCtxt, E_TRUE);
  1558.         /* Below modified by Shantanu - 20060606 */
  1559.         jdi_BrowserSetImageAsSelectable(pBrowserCtxt, g_brw_cntx.image_selection);
  1560.         jdi_BrowserSetAlertCB(pBrowserCtxt, mmi_brw_set_alert_callback, NULL);
  1561.         jdi_BrowserSetConfirmCB(pBrowserCtxt, mmi_brw_set_confirm_callback, NULL);
  1562.         jdi_BrowserSetPromptCB(pBrowserCtxt, mmi_brw_set_prompt_callback, NULL);
  1563.         jdi_BrowserRegisterPageInfoHandler(pBrowserCtxt, mmi_brw_set_page_info_callback);
  1564.         jdi_BrowserRegisterProgressStatusHandler(pBrowserCtxt, mmi_brw_progress_status_callback);
  1565.         jdi_BrowserRegisterFocusHandler(pBrowserCtxt, mmi_brw_focus_callback);
  1566.         jdi_BrowserRegisterMimeHandler(pBrowserCtxt, mmi_brw_mime_callback_hdlr);
  1567.         jdi_BrowserRegisterMimeContentHandler (pBrowserCtxt,  mmi_brw_mime_content_callback_hdlr);
  1568.         jdi_BrowserSetBgImageDisplay(pBrowserCtxt, E_FALSE);
  1569.     #ifdef __DRM_SUPPORT__
  1570.         jdi_BrowserRegisterDRMCB(
  1571.             pBrowserCtxt,
  1572.             jBrowser_drm_indication_handler,
  1573.             jBrowser_drm_rights_update_handler,
  1574.             NULL,
  1575.             pvDRMArg);
  1576.     #endif /* __DRM_SUPPORT__ */ 
  1577.         jdi_BrowserRegisterMultimediaHandler(pBrowserCtxt, mmi_brw_multimedia_callback_hdlr);
  1578.         /* Added by Sandeep to set if images should be shown on the rendered page or not */
  1579.         jdi_BrowserGraphicsEnable(pBrowserCtxt, g_brw_cntx.show_images);
  1580.         /* added by sandeep to get the timeout value */
  1581.         /* We have to set this flag to prevent multiple initialization */
  1582.         g_brw_cntx.isLayoutInitialized = E_TRUE;
  1583. //Tk start 18/01/2007
  1584. #ifdef JBROWSER_USE_ASM
  1585. /* Create a new Communication handle */
  1586. mmi_brw_communication_init();
  1587. #endif
  1588. //Tk end 18/01/2007
  1589.     }
  1590. }
  1591. /*****************************************************************************
  1592.  * FUNCTION
  1593.  *  mmi_brw_communication_init
  1594.  * DESCRIPTION
  1595.  *  Create a new browser communication handle and initialize it.
  1596.  * PARAMETERS
  1597.  *  void
  1598.  * RETURNS
  1599.  *  void
  1600.  *****************************************************************************/
  1601. void mmi_brw_communication_init(void)
  1602. {
  1603. /*----------------------------------------------------------------*/
  1604.     /* Local Variables                                                */
  1605.     /*----------------------------------------------------------------*/
  1606.     JC_RETCODE eRet = JC_OK;
  1607.     JC_TASK_INFO appTaskInfo = {0, };
  1608.     JC_TASK_INFO transportTaskInfo = {0, };
  1609.     /*----------------------------------------------------------------*/
  1610.     /* Code Body                                                      */
  1611.     /*----------------------------------------------------------------*/
  1612.     PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_brw_communication_init"));
  1613.     appTaskInfo.iTaskID = (JC_INT32) E_TASK_BROWSER_CORE;
  1614.     appTaskInfo.iAppID = (JC_INT32) E_TASK_BROWSER_CORE;
  1615.     transportTaskInfo.iTaskID = (JC_INT32) E_TASK_TRANSPORT;
  1616.     transportTaskInfo.iAppID = (JC_INT32) E_TASK_TRANSPORT;
  1617.     eRet = jdi_CommunicationInitialize(&appTaskInfo, &transportTaskInfo, &g_brw_cntx, &g_brw_cntx.hCommHandle);
  1618.     if (JC_OK != eRet)
  1619.     {
  1620.         //goto error;
  1621.     }
  1622. }
  1623. /*****************************************************************************
  1624.  * FUNCTION
  1625.  *  mmi_JBrowserDeInitApp
  1626.  * DESCRIPTION
  1627.  *  Deinitialize the browser application(on exit from browser)
  1628.  * PARAMETERS
  1629.  *  void
  1630.  * RETURNS
  1631.  *  void
  1632.  *****************************************************************************/
  1633. void mmi_JBrowserDeInitApp(void)
  1634. {
  1635.     /*----------------------------------------------------------------*/
  1636.     /* Local Variables                                                */
  1637.     /*----------------------------------------------------------------*/
  1638.     /*----------------------------------------------------------------*/
  1639.     /* Code Body                                                      */
  1640.     /*----------------------------------------------------------------*/
  1641. PRINT_INFORMATION(("Inside mmi_JBrowserDeInitApp"));
  1642. //Tk start 18/01/2007
  1643. #ifdef JBROWSER_USE_ASM
  1644. /* DeInitialize the communicator */
  1645. jdi_CommunicationStopAllReq(g_brw_cntx.hCommHandle);
  1646. /*Added by TK to deinitialize the communication layer of browser*/
  1647. jdi_BrowserCommunicationDeinitialize(pBrowserCtxt ,g_brw_cntx.hCommHandle );
  1648. #endif
  1649. //Tk end 18/01/2007
  1650.     jdi_BrowserDeInitCacheCookie(pBrowserCtxt);
  1651.     jdi_BrowserDeInitLayoutHistory(pBrowserCtxt);
  1652.     /* Added by Sandeep for checking data connection active or not */
  1653.     /* If the data profile is chnaged by the user then we have to set this flag as false so that 
  1654.        when a new page is fetched then we have to set the profile again */
  1655.     g_brw_cntx.isConnectionActive = MMI_FALSE;
  1656.     /* Added by Sandeep to check if any page is rendered or not This is used when notification
  1657.        comes on a link fetched from the page which is opened for the first time. THe rendered page 
  1658.        should be restored. */
  1659.     g_brw_cntx.isRenderedFlag = E_FALSE;
  1660.     /* Added by Sandeep : to reset the layoutInitialized flag */
  1661.     g_brw_cntx.isLayoutInitialized = E_FALSE;
  1662. #ifdef JATAAYU_IMAGE_CACHING_ENABLE
  1663.     /* DeInitialize the memory pool container used for buffered images. */
  1664.     deinit_image_pool();
  1665. #endif /* JATAAYU_IMAGE_CACHING_ENABLE */ /* ifdef JATAAYU_IMAGE_CACHING_ENABLE */
  1666. PRINT_INFORMATION(("Exit mmi_JBrowserDeInitApp"));
  1667. }
  1668. /*****************************************************************************
  1669.  * FUNCTION
  1670.  *  mmi_DeInitJBrowserCtxt
  1671.  * DESCRIPTION
  1672.  *  Deinitialize the browser Context (at shutdown)
  1673.  * PARAMETERS
  1674.  *  void
  1675.  * RETURNS
  1676.  *  void
  1677.  *****************************************************************************/
  1678. void mmi_DeInitJBrowserCtxt(void)
  1679. {
  1680.     /*----------------------------------------------------------------*/
  1681.     /* Local Variables                                                */
  1682.     /*----------------------------------------------------------------*/
  1683.     /*----------------------------------------------------------------*/
  1684.     /* Code Body                                                      */
  1685.     /*----------------------------------------------------------------*/
  1686.     if (pBrowserCtxt != NULL)
  1687.     {
  1688.         /* PIXTEL_JATAAYU
  1689.            jdi_BrowserDeInitialize(pBrowserCtxt); */
  1690.         jdi_BrowserDeInitContext(pBrowserCtxt);
  1691.         pBrowserCtxt = NULL;
  1692.     }
  1693. }
  1694. /*****************************************************************************
  1695.  * FUNCTION
  1696.  *  JBrowserRefreshPage
  1697.  * DESCRIPTION
  1698.  *  Refresh the current rendered page.
  1699.  * PARAMETERS
  1700.  *  void
  1701.  * RETURNS
  1702.  *  void
  1703.  *****************************************************************************/
  1704. void JBrowserRefreshPage(void)
  1705. {
  1706.     /*----------------------------------------------------------------*/
  1707.     /* Local Variables                                                */
  1708.     /*----------------------------------------------------------------*/
  1709.     /*----------------------------------------------------------------*/
  1710.     /* Code Body                                                      */
  1711.     /*----------------------------------------------------------------*/
  1712.     jdi_BrowserOpen(pBrowserCtxt);
  1713.     jdi_BrowserSetMagnification(pBrowserCtxt, 100);
  1714.     g_brw_page_cntx.brw_PageRefreshStatus = 1;
  1715.     /* Added By Shantanu -20060810 */
  1716.     /* We will set this flag when the user selects "Refresh" from rendered page
  1717.        option menu.This flag will restrict the user to enter the full screen editor 
  1718.        while the page is being refreshed */
  1719.     mmi_jdd_ui_set_jdd_flag(JDD_MANUAL_REFRESH_FLAG, E_TRUE);
  1720. #ifdef DOWNLOAD_CLIENT_ENABLE
  1721.     if (InitDownloadClient(pBrowserCtxt) != JC_OK)
  1722.     {
  1723.     }
  1724. #endif /* DOWNLOAD_CLIENT_ENABLE */ 
  1725. jdd_MemSetActiveModuleID(E_TASK_BROWSER_CORE);
  1726.     jdi_BrowserRefreshPage(pBrowserCtxt);
  1727. }
  1728. /* Function Below added by Shantanu for Accesskey Support - 20060412 */
  1729. /*****************************************************************************
  1730.  * FUNCTION
  1731.  *  mmi_brw_fill_accesskey_info_and_send_event_to_queue
  1732.  * DESCRIPTION
  1733.  *  Function to fill accesskey info and sent it to the queue
  1734.  * PARAMETERS
  1735.  *  void
  1736.  * RETURNS
  1737.  *  void
  1738.  *****************************************************************************/
  1739. void mmi_brw_fill_accesskey_info_and_send_event_to_queue(void)
  1740. {
  1741.     /*----------------------------------------------------------------*/
  1742.     /* Local Variables                                                */
  1743.     /*----------------------------------------------------------------*/
  1744.     MMI_JDD_UI_WINDOW_INFO_STRUCT *jdd_window_info_struct_p = NULL;
  1745.     JC_UINT32 uiWindowID = 0;
  1746.     JC_EVENT_DATA eventData = {0, };
  1747.     JC_MMI_EVENT controlEventData = {0, };
  1748.     JC_RETCODE iRet = JC_OK;
  1749.     U16 keyCode, keyType;
  1750.     /*----------------------------------------------------------------*/
  1751.     /* Code Body                                                      */
  1752.     /*----------------------------------------------------------------*/
  1753.     eventData.destTaskInfo.iAppID = E_TASK_BROWSER_UI;
  1754.     eventData.destTaskInfo.iTaskID = E_TASK_BROWSER_UI;
  1755.     eventData.srcTaskInfo.iAppID = E_TASK_BROWSER_UI;
  1756.     eventData.srcTaskInfo.iTaskID = E_TASK_BROWSER_UI;
  1757.     eventData.iEventType = E_BRW_ACTION_EVENT;
  1758.     uiWindowID = mmi_jdd_ui_get_appWindowID(E_TASK_BROWSER_CORE);
  1759.     jdd_window_info_struct_p = (MMI_JDD_UI_WINDOW_INFO_STRUCT*) uiWindowID;
  1760.     if (jdd_window_info_struct_p != NULL)
  1761.     {
  1762.         /* for getting the last key press event */
  1763.         GetkeyInfo(&keyCode, &keyType);
  1764.         switch (keyCode)
  1765.         {
  1766.             case KEY_0:
  1767.             case KEY_1:
  1768.             case KEY_2:
  1769.             case KEY_3:
  1770.             case KEY_4:
  1771.             case KEY_5:
  1772.             case KEY_6:
  1773.             case KEY_7:
  1774.             case KEY_8:
  1775.             case KEY_9:
  1776.                 controlEventData.eventData.accessKeyEvent.uiAccessKeyIndex = keyCode;
  1777.                 break;
  1778.             case KEY_STAR:
  1779.                 controlEventData.eventData.accessKeyEvent.uiAccessKeyIndex = STAR_ACCESS_KEY;
  1780.                 break;
  1781.             case KEY_POUND:
  1782.                 controlEventData.eventData.accessKeyEvent.uiAccessKeyIndex = HASH_ACCESS_KEY;
  1783.                 break;
  1784.             #ifdef BROWSER_SENDKEY_AS_ACCESSKEY
  1785.             case KEY_SEND:
  1786.                 controlEventData.eventData.accessKeyEvent.uiAccessKeyIndex = SEND_ACCESS_KEY;
  1787.                 break;
  1788.             #endif /* BROWSER_SENDKEY_AS_ACCESSKEY */
  1789.             default:
  1790.                 /* All the accesskeys are handled above. 
  1791.                    If it gives an assert then we should handle the new key */
  1792.                 ASSERT(0);
  1793.         }
  1794.         controlEventData.eEventType = JC_MMI_ACCESSKEY_EVENT;
  1795.         eventData.uiEventInfoSize = sizeof(JC_MMI_EVENT);
  1796.         iRet = jdd_QueueAlloc(&eventData);
  1797.         if (JC_OK != iRet)
  1798.         {
  1799.             return;
  1800.         }
  1801.         jc_memcpy(eventData.pEventInfo, &controlEventData, sizeof(JC_MMI_EVENT));
  1802.         iRet = jdd_QueueSend(&eventData);
  1803.         if (JC_OK != iRet)
  1804.         {
  1805.             return;
  1806.         }
  1807.     }
  1808. }
  1809. /*****************************************************************************
  1810.  * FUNCTION
  1811.  *  mmi_brw_fill_control_info_and_send_event_to_queue
  1812.  * DESCRIPTION
  1813.  *  Function to fill control info and sent it to the queue
  1814.  * PARAMETERS
  1815.  *  void
  1816.  * RETURNS
  1817.  *  void
  1818.  *****************************************************************************/
  1819. void mmi_brw_fill_control_info_and_send_event_to_queue(void)
  1820. {
  1821.     /*----------------------------------------------------------------*/
  1822.     /* Local Variables                                                */
  1823.     /*----------------------------------------------------------------*/
  1824.     MMI_JDD_UI_WINDOW_INFO_STRUCT *jdd_window_info_struct_p = NULL;
  1825.     JC_UINT32 uiWindowID = 0;
  1826.     JC_EVENT_DATA eventData = {0, };
  1827.     JC_MMI_EVENT controlEventData = {0, };
  1828.     JC_RETCODE iRet = JC_OK;
  1829.     JDD_CONTROL_INFO *control_info;
  1830.     /*----------------------------------------------------------------*/
  1831.     /* Code Body                                                      */
  1832.     /*----------------------------------------------------------------*/
  1833.     eventData.destTaskInfo.iAppID = E_TASK_BROWSER_UI;
  1834.     eventData.destTaskInfo.iTaskID = E_TASK_BROWSER_UI;
  1835.     eventData.srcTaskInfo.iAppID = E_TASK_BROWSER_UI;
  1836.     eventData.srcTaskInfo.iTaskID = E_TASK_BROWSER_UI;
  1837.     eventData.iEventType = E_BRW_ACTION_EVENT;
  1838.     uiWindowID = mmi_jdd_ui_get_appWindowID(E_TASK_BROWSER_CORE);
  1839.     jdd_window_info_struct_p = (MMI_JDD_UI_WINDOW_INFO_STRUCT*) uiWindowID;
  1840.     if (jdd_window_info_struct_p != NULL)
  1841.     {
  1842.         controlEventData.uiControlID = (JC_UINT32) jdd_window_info_struct_p->currFocussedControlID;
  1843.         controlEventData.uiWindowID = jdd_window_info_struct_p->uiWindowID;
  1844.         control_info = (JDD_CONTROL_INFO*) jdd_window_info_struct_p->currFocussedControlID;
  1845.         if (control_info == NULL)
  1846.         {
  1847.             return;
  1848.         }
  1849.         switch (control_info->uiControlType)
  1850.         {
  1851.             case E_TEXT_BOX:
  1852.             {
  1853.                 controlEventData.eEventType = JC_MMI_LINK_EVENT;
  1854.             }
  1855.                 break;
  1856.             case E_INPUT_BOX:
  1857.             {
  1858.                 controlEventData.eEventType = JC_MMI_INPUT_EVENT;
  1859.             }
  1860.                 break;
  1861.             case E_BUTTON:
  1862.             {
  1863.                 controlEventData.eEventType = JC_MMI_BUTTON_EVENT;
  1864.             }
  1865.                 break;
  1866.             case E_CHECK_BOX:
  1867.             {
  1868.                 controlEventData.eEventType = JC_MMI_CHECK_EVENT;
  1869.             }
  1870.                 break;
  1871.             case E_RADIO_BOX:
  1872.             {
  1873.                 controlEventData.eEventType = JC_MMI_RADIO_EVENT;
  1874.             }
  1875.                 break;
  1876.             case E_LIST_BOX:
  1877.             {
  1878.                 controlEventData.eEventType = JC_MMI_LIST_EVENT;
  1879.             }
  1880.                 break;
  1881.             case E_COMBO_BOX:
  1882.             {
  1883.                 controlEventData.eEventType = JC_MMI_COMBO_EVENT;
  1884.             }
  1885.                 break;
  1886.             case E_PICTOGRAM:
  1887.             case E_IMAGE_TEXT:
  1888.             case E_IMAGE:
  1889.             case E_OBJECT:
  1890.             {
  1891.                 controlEventData.eEventType = JC_MMI_IMAGE_EVENT;
  1892.             }
  1893.                 break;
  1894.             default:
  1895.             {
  1896.                 return;
  1897.             }
  1898.                 break;
  1899.         }
  1900.         eventData.uiEventInfoSize = sizeof(JC_MMI_EVENT);
  1901.         iRet = jdd_QueueAlloc(&eventData);
  1902.         if (JC_OK != iRet)
  1903.         {
  1904.             return;
  1905.         }
  1906.         jc_memcpy(eventData.pEventInfo, &controlEventData, sizeof(JC_MMI_EVENT));
  1907.         iRet = jdd_QueueSend(&eventData);
  1908.         if (JC_OK != iRet)
  1909.         {
  1910.             return;
  1911.         }
  1912.         g_brw_cntx.isRenderedFlag = E_TRUE;
  1913.     }
  1914. }
  1915. /*****************************************************************************
  1916.  * FUNCTION
  1917.  *  JBrowserSATGotoURLEvent
  1918.  * DESCRIPTION
  1919.  *  Goto event from sat(fetch a url from sat application)
  1920.  * PARAMETERS
  1921.  *  void
  1922.  * RETURNS
  1923.  *  void
  1924.  *****************************************************************************/
  1925. void JBrowserSATGotoURLEvent(void)
  1926. {
  1927.     /*----------------------------------------------------------------*/
  1928.     /* Local Variables                                                */
  1929.     /*----------------------------------------------------------------*/
  1930.     JC_RETCODE iRet = JC_OK;
  1931.     JC_EVENT_DATA eventData = {0, };
  1932.     /*----------------------------------------------------------------*/
  1933.     /* Code Body                                                      */
  1934.     /*----------------------------------------------------------------*/
  1935.     jc_memset(&eventData, 0, sizeof(JC_EVENT_DATA));
  1936.     eventData.pEventInfo = NULL;
  1937.     eventData.uiEventInfoSize = 0;
  1938.     eventData.iEventType = E_BRW_SAT_GOTO_URL_EVENT;
  1939.     eventData.destTaskInfo.iAppID = E_TASK_BROWSER_UI;
  1940.     eventData.destTaskInfo.iTaskID = E_TASK_BROWSER_UI;
  1941.     eventData.srcTaskInfo.iAppID = E_TASK_BROWSER_UI;
  1942.     eventData.srcTaskInfo.iTaskID = E_TASK_BROWSER_UI;
  1943.     iRet = jdd_QueueSend(&eventData);
  1944.     if (JC_OK != iRet)
  1945.     {
  1946.         return;
  1947.     }
  1948. }
  1949. /*****************************************************************************
  1950.  * FUNCTION
  1951.  *  jbrowser_is_ready
  1952.  * DESCRIPTION
  1953.  *  
  1954.  * PARAMETERS
  1955.  *  void
  1956.  * RETURNS
  1957.  *  
  1958.  *****************************************************************************/
  1959. U8 jbrowser_is_ready(void)
  1960. {
  1961.     /*----------------------------------------------------------------*/
  1962.     /* Local Variables                                                */
  1963.     /*----------------------------------------------------------------*/
  1964.     /*----------------------------------------------------------------*/
  1965.     /* Code Body                                                      */
  1966.     /*----------------------------------------------------------------*/
  1967.     return g_brw_cntx.isBrowserReady;
  1968. }
  1969. /*****************************************************************************
  1970.  * FUNCTION
  1971.  *  jbrowser_is_init
  1972.  * DESCRIPTION
  1973.  *  
  1974.  * PARAMETERS
  1975.  *  void
  1976.  * RETURNS
  1977.  *  
  1978.  *****************************************************************************/
  1979. U8 jbrowser_is_init(void)
  1980. {
  1981.     /*----------------------------------------------------------------*/
  1982.     /* Local Variables                                                */
  1983.     /*----------------------------------------------------------------*/
  1984.     /*----------------------------------------------------------------*/
  1985.     /* Code Body                                                      */
  1986.     /*----------------------------------------------------------------*/
  1987.     return g_brw_cntx.isBrowserInitInProgress;
  1988. }
  1989. /*****************************************************************************
  1990.  * FUNCTION
  1991.  *  jbrowser_is_open
  1992.  * DESCRIPTION
  1993.  *  
  1994.  * PARAMETERS
  1995.  *  void
  1996.  * RETURNS
  1997.  *  
  1998.  *****************************************************************************/
  1999. U8 jbrowser_is_open(void)
  2000. {
  2001.     /*----------------------------------------------------------------*/
  2002.     /* Local Variables                                                */
  2003.     /*----------------------------------------------------------------*/
  2004.     /*----------------------------------------------------------------*/
  2005.     /* Code Body                                                      */
  2006.     /*----------------------------------------------------------------*/
  2007.     /*return g_brw_cntx.isLayoutInitialized;*/
  2008.     return FALSE;
  2009. }
  2010. /*****************************************************************************
  2011.  * FUNCTION
  2012.  *  jbrowser_shutdown
  2013.  * DESCRIPTION
  2014.  *  
  2015.  * PARAMETERS
  2016.  *  void
  2017.  * RETURNS
  2018.  *  
  2019.  *****************************************************************************/
  2020. void jbrowser_shutdown(void)
  2021. {
  2022.     /*----------------------------------------------------------------*/
  2023.     /* Local Variables                                                */
  2024.     /*----------------------------------------------------------------*/
  2025.     /*----------------------------------------------------------------*/
  2026.     /* Code Body                                                      */
  2027.     /*----------------------------------------------------------------*/
  2028. mmi_brw_wap_deinit();
  2029.     /* Free the DO List for last rendered page */
  2030.     mmi_brw_free_do_list();
  2031. #ifdef __SATC3__
  2032.     if (g_brw_cntx.isSATURL == E_TRUE)
  2033.     {
  2034.         brw_send_termination_to_mmi(SAT_BROWSER_USER_TERMINATION);
  2035.     }
  2036. #endif /* __SATC3__ */ 
  2037.     /* Go to services menu if entered from wap otherwise go to last screen before rendered page */
  2038.     if (IsScreenPresent(SERVICES_MAIN_MENU_SCREEN_ID))
  2039.     {
  2040.         GoBackToHistory(SERVICES_MAIN_MENU_SCREEN_ID);
  2041.     }
  2042.     else if (!IsScreenPresent(SERVICES_MAIN_MENU_SCREEN_ID) && IsScreenPresent(SCR_ID_BRW_INTERNET_SERVICES))
  2043.     {
  2044.         DisplayIdleScreen();
  2045.     }
  2046.     else
  2047.     {
  2048.         GoBackHistory();
  2049.     }
  2050. }
  2051. /*****************************************************************************
  2052.  * FUNCTION
  2053.  *  mmi_brw_entry_wap_not_ready
  2054.  * DESCRIPTION
  2055.  *  
  2056.  * PARAMETERS
  2057.  *  void
  2058.  * RETURNS
  2059.  *  void
  2060.  *****************************************************************************/
  2061. void mmi_brw_entry_wap_not_ready(void)
  2062. {
  2063.     /*----------------------------------------------------------------*/
  2064.     /* Local Variables                                                */
  2065.     /*----------------------------------------------------------------*/
  2066.     /*----------------------------------------------------------------*/
  2067.     /* Code Body                                                      */
  2068.     /*----------------------------------------------------------------*/
  2069.     EntryNewScreen(SCR_ID_BRW_WAP_NOT_READY, mmi_brw_exit_wap_not_ready, NULL, NULL);
  2070.     StartTimer(JBROWSER_WAP_NOT_READY_TIMER, 2000, mmi_wap_wait_and_go_back);
  2071.     ShowCategory66Screen(
  2072.         STR_ID_BRW_INTERNET_SERVICES,
  2073.         GetRootTitleIcon(SERVICES_WAP_MENU_ID),
  2074.         0,
  2075.         0,
  2076.         STR_GLOBAL_BACK,
  2077.         IMG_GLOBAL_BACK,
  2078.         (U8*) GetString(STR_ID_BRW_PLEASE_WAIT),
  2079.         IMG_ID_BRW_SAT_WAIT,
  2080.         NULL);
  2081.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2082. }
  2083. /*****************************************************************************
  2084.  * FUNCTION
  2085.  *  mmi_brw_exit_wap_not_ready
  2086.  * DESCRIPTION
  2087.  *  
  2088.  * PARAMETERS
  2089.  *  void
  2090.  * RETURNS
  2091.  *  void
  2092.  *****************************************************************************/
  2093. void mmi_brw_exit_wap_not_ready(void)
  2094. {
  2095.     /*----------------------------------------------------------------*/
  2096.     /* Local Variables                                                */
  2097.     /*----------------------------------------------------------------*/
  2098.     /*----------------------------------------------------------------*/
  2099.     /* Code Body                                                      */
  2100.     /*----------------------------------------------------------------*/
  2101.     StopTimer(JBROWSER_WAP_NOT_READY_TIMER);
  2102. }
  2103. /*****************************************************************************
  2104.  * FUNCTION
  2105.  *  mmi_wap_wait_and_go_back
  2106.  * DESCRIPTION
  2107.  *  
  2108.  * PARAMETERS
  2109.  *  void
  2110.  * RETURNS
  2111.  *  void
  2112.  *****************************************************************************/
  2113. void mmi_wap_wait_and_go_back(void)
  2114. {
  2115.     /*----------------------------------------------------------------*/
  2116.     /* Local Variables                                                */
  2117.     /*----------------------------------------------------------------*/
  2118.     /*----------------------------------------------------------------*/
  2119.     /* Code Body                                                      */
  2120.     /*----------------------------------------------------------------*/
  2121.     StopTimer(JBROWSER_WAP_NOT_READY_TIMER);
  2122.     GoBackHistory();
  2123. }
  2124. /*****************************************************************************
  2125.  * FUNCTION
  2126.  *  mmi_brw_is_cancel_flag_set
  2127.  * DESCRIPTION
  2128.  *  Function to check if cancel lag is set
  2129.  * PARAMETERS
  2130.  *  void
  2131.  * RETURNS
  2132.  *  void
  2133.  *****************************************************************************/
  2134. JC_BOOLEAN mmi_brw_is_cancel_flag_set(void)
  2135. {
  2136.     /*----------------------------------------------------------------*/
  2137.     /* Local Variables                                                */
  2138.     /*----------------------------------------------------------------*/
  2139.     /*----------------------------------------------------------------*/
  2140.     /* Code Body                                                      */
  2141.     /*----------------------------------------------------------------*/
  2142.     return (g_brw_page_cntx.brw_cancel_flag);
  2143. }
  2144. /*****************************************************************************
  2145.  * FUNCTION
  2146.  *  mmi_brw_is_back
  2147.  * DESCRIPTION
  2148.  *  Function to check if there is any page behid the current rendered page i.e in history.
  2149.  * PARAMETERS
  2150.  *  void
  2151.  * RETURNS
  2152.  *  void
  2153.  *****************************************************************************/
  2154. JC_BOOLEAN mmi_brw_is_back(void)
  2155. {
  2156.     /*----------------------------------------------------------------*/
  2157.     /* Local Variables                                                */
  2158.     /*----------------------------------------------------------------*/
  2159.     /*----------------------------------------------------------------*/
  2160.     /* Code Body                                                      */
  2161.     /*----------------------------------------------------------------*/
  2162.     return jdi_BrowserIsBack(pBrowserCtxt);
  2163. }
  2164. /*****************************************************************************
  2165.  * FUNCTION
  2166.  *  mmi_brw_set_connection_active_flag
  2167.  * DESCRIPTION
  2168.  *  Function to check if connection is already there or not
  2169.  * PARAMETERS
  2170.  *  flag        [IN]        
  2171.  * RETURNS
  2172.  *  void
  2173.  *****************************************************************************/
  2174. void mmi_brw_set_connection_active_flag(JC_BOOLEAN flag)
  2175. {
  2176.     /*----------------------------------------------------------------*/
  2177.     /* Local Variables                                                */
  2178.     /*----------------------------------------------------------------*/
  2179.     /*----------------------------------------------------------------*/
  2180.     /* Code Body                                                      */
  2181.     /*----------------------------------------------------------------*/
  2182.     g_brw_cntx.isConnectionActive = flag;
  2183. }
  2184. /*****************************************************************************
  2185.  * FUNCTION
  2186.  *  mmi_brw_set_data_connection_deactive_flag
  2187.  * DESCRIPTION
  2188.  *  Function to set data conn deactivate flag only if data connection is in 
  2189. activated or activating state in case of CSD only and it is reset in data conn callbk.
  2190.  * PARAMETERS
  2191.  *  flag        [IN]        
  2192.  * RETURNS
  2193.  *  void
  2194.  *****************************************************************************/
  2195. void mmi_brw_set_data_connection_deactive_flag(JC_BOOLEAN flag)
  2196. {
  2197.     /*----------------------------------------------------------------*/
  2198.     /* Local Variables                                                */
  2199.     /*----------------------------------------------------------------*/
  2200.     /*----------------------------------------------------------------*/
  2201.     /* Code Body                                                      */
  2202.     /*----------------------------------------------------------------*/
  2203. if(g_brw_cntx.dataConnectionState == BRW_DATACONN_ACTIVATING || g_brw_cntx.dataConnectionState == BRW_DATACONN_ACTIVATED)
  2204.     {
  2205. if(mmi_brw_check_csd_data_account())
  2206. {
  2207. g_brw_cntx.isDataConnectionDeactivate = flag;
  2208. }
  2209. }
  2210. }
  2211. /*****************************************************************************
  2212.  * FUNCTION
  2213.  *  mmi_brw_is_rendered_flag
  2214.  * DESCRIPTION
  2215.  *  Function to check if any page is rendered or not
  2216.  * PARAMETERS
  2217.  *  void
  2218.  * RETURNS
  2219.  *  void
  2220.  *****************************************************************************/
  2221. JC_BOOLEAN mmi_brw_is_rendered_flag(void)
  2222. {
  2223.     /*----------------------------------------------------------------*/
  2224.     /* Local Variables                                                */
  2225.     /*----------------------------------------------------------------*/
  2226.     /*----------------------------------------------------------------*/
  2227.     /* Code Body                                                      */
  2228.     /*----------------------------------------------------------------*/
  2229.     //return g_brw_cntx.isRenderedFlag;
  2230. return (g_brw_page_cntx.brw_Pre_PageRenderStatus || g_brw_page_cntx.brw_pageRenderStatus);
  2231. }
  2232. /*****************************************************************************
  2233.  * FUNCTION
  2234.  *  mmi_brw_delete_brw_screen
  2235.  * DESCRIPTION
  2236.  *  Function to delete the browser screen
  2237.  * PARAMETERS
  2238.  *  void
  2239.  * RETURNS
  2240.  *  void
  2241.  *****************************************************************************/
  2242. void mmi_brw_delete_brw_screen(void)
  2243. {
  2244.     /*----------------------------------------------------------------*/
  2245.     /* Local Variables                                                */
  2246.     /*----------------------------------------------------------------*/
  2247.     /*----------------------------------------------------------------*/
  2248.     /* Code Body                                                      */
  2249.     /*----------------------------------------------------------------*/
  2250.     /* if there is already rendered page then it remains on the render page if we press abort on calling screen in case of csd bearer */
  2251.     if (IsScreenPresent(SCR_ID_BRW_JBROWSER_MAIN) && !mmi_brw_check_browser_scr_pre_delte_condition() &&
  2252.         !(g_brw_page_cntx.brw_Pre_PageRenderStatus || g_brw_page_cntx.brw_pageRenderStatus))
  2253.     {
  2254.         DeleteScreenIfPresent(SCR_ID_BRW_JBROWSER_MAIN);
  2255.     }
  2256. else if((GetActiveScreenId() == SCR_ID_BRW_JBROWSER_MAIN) &&
  2257.         !(g_brw_page_cntx.brw_Pre_PageRenderStatus || g_brw_page_cntx.brw_pageRenderStatus))
  2258. {
  2259. GoBackHistory();
  2260. }
  2261. }
  2262. /*****************************************************************************
  2263.  * FUNCTION
  2264.  *  mmi_brw_is_browser_window_active
  2265.  * DESCRIPTION
  2266.  *  Function to check if the browser window is present.
  2267.  * PARAMETERS
  2268.  *  void
  2269.  * RETURNS
  2270.  *  void
  2271.  *****************************************************************************/
  2272. JC_BOOLEAN mmi_brw_is_browser_window_active(void)
  2273. {
  2274.     /*----------------------------------------------------------------*/
  2275.     /* Local Variables                                                */
  2276.     /*----------------------------------------------------------------*/
  2277. #if 0
  2278. /* under construction !*/
  2279. /* under construction !*/
  2280. /* under construction !*/
  2281. /* under construction !*/
  2282. /* under construction !*/
  2283. /* under construction !*/
  2284. /* under construction !*/
  2285. /* under construction !*/
  2286. /* under construction !*/
  2287. /* under construction !*/
  2288. /* under construction !*/
  2289. /* under construction !*/
  2290. /* under construction !*/
  2291. /* under construction !*/
  2292. /* under construction !*/
  2293. #endif
  2294. if (GetActiveScreenId() == SCR_ID_BRW_JBROWSER_MAIN)
  2295.     {
  2296.         return E_TRUE;    
  2297.     }
  2298.     return E_FALSE; 
  2299. }
  2300. /*****************************************************************************
  2301.  * FUNCTION
  2302.  *  mmi_brw_set_transport_and_data_profile
  2303.  * DESCRIPTION
  2304.  *  Function to set the profile and data connection
  2305.  * PARAMETERS
  2306.  *  void
  2307.  * RETURNS
  2308.  *  void
  2309.  *****************************************************************************/
  2310. void mmi_brw_set_transport_and_data_profile(void)
  2311. {
  2312.     /*----------------------------------------------------------------*/
  2313.     /* Local Variables                                                */
  2314.     /*----------------------------------------------------------------*/
  2315.     COMM_PROFILE profile;
  2316.     JC_RETCODE iRet = JC_OK;
  2317.     GENERIC_DATA_CONN pDataConn;
  2318.     nvram_wap_profile_content_struct *activated_wap_profile;
  2319.     /*----------------------------------------------------------------*/
  2320.     /* Code Body                                                      */
  2321.     /*----------------------------------------------------------------*/
  2322.     activated_wap_profile = mmi_ph_get_activated_wap_profile();
  2323.     jc_memset(&profile, 0, sizeof(COMM_PROFILE));
  2324.     sprintf(
  2325.         (PS8) profile.szHostName,
  2326.         "%d.%d.%d.%d",
  2327.         activated_wap_profile->proxy_ip[0],
  2328.         activated_wap_profile->proxy_ip[1],
  2329.         activated_wap_profile->proxy_ip[2],
  2330.         activated_wap_profile->proxy_ip[3]);
  2331.     profile.uiPortNumber = (JC_UINT32) activated_wap_profile->proxy_port;
  2332.     switch (activated_wap_profile->conn_type)
  2333.     {
  2334.         case PH_CONN_TYPE_CONNECTION_OREINTED:
  2335.             profile.eConnMode = E_COMM_WSP_CONNECTION_ORIENTED;
  2336.             profile.uiPortNumber = (JC_UINT32) 9201;
  2337.             break;
  2338.             /* added by tk */
  2339.     #if defined (WAP_SEC_SUPPORT) && defined (JATAAYU_SUPPORT)
  2340.         case PH_CONN_TYPE_CONNECTION_OREINTED_SECURE:
  2341.             profile.eConnMode = E_COMM_WSP_CONNECTION_ORIENTED_SECURE;
  2342.             profile.uiPortNumber = (JC_UINT32) 9203;
  2343.             break;
  2344.     #endif /* defined (WAP_SEC_SUPPORT) && defined (JATAAYU_SUPPORT) */ 
  2345.             /* end */
  2346.         case PH_CONN_TYPE_HTTP:
  2347.             if (strcmp((PS8) profile.szHostName, (PS8) "0.0.0.0") == 0)
  2348.             {
  2349.                 profile.eConnMode = E_COMM_WPHTTP_DIRECT;
  2350.             }
  2351.             else
  2352.             {
  2353.                 profile.eConnMode = E_COMM_WPHTTP_PROXY;
  2354.                 if(profile.uiPortNumber == 0)
  2355.                 {
  2356.                     profile.uiPortNumber = 80;
  2357.                 }
  2358.             }
  2359.             break;
  2360.     }
  2361.     mmi_brw_set_timeout_value();
  2362.     iRet = jdi_BrowserSetTransportProfile(pBrowserCtxt, &profile);
  2363.     if (JC_OK != iRet)
  2364.     {
  2365.         ASSERT(0);
  2366.     }
  2367.     /* Set Data connection profile */
  2368.     memset(&pDataConn, 0, sizeof(GENERIC_DATA_CONN));
  2369.     pDataConn.account_id = activated_wap_profile->data_account;
  2370.     iRet = jdi_BrowserSetDataConnectionProfile(pBrowserCtxt, (const GENERIC_DATA_CONN*)&pDataConn);
  2371.     if (JC_OK != iRet)
  2372.     {
  2373.         ASSERT(0);
  2374.     }
  2375. }
  2376. /*****************************************************************************
  2377.  * FUNCTION
  2378.  *  jbrowser_wap_screen_id
  2379.  * DESCRIPTION
  2380.  *  
  2381.  * PARAMETERS
  2382.  *  void
  2383.  * RETURNS
  2384.  *  
  2385.  *****************************************************************************/
  2386. U16 jbrowser_wap_screen_id(void)
  2387. {
  2388.     /*----------------------------------------------------------------*/
  2389.     /* Local Variables                                                */
  2390.     /*----------------------------------------------------------------*/
  2391. S32 i, total_screens;
  2392. U16 check_screens[]=
  2393. {
  2394. SCR_ID_JMMS_WRITE_MMS,
  2395.         SCR_ID_JMMS_PREVIEW,
  2396.         SCR_ID_JMMS_PROGRESS,
  2397. SCR_ID_JMMS_INBOX_OPTIONS,
  2398. SCR_ID_JMMS_OUTBOX_OPTIONS,
  2399. SCR_ID_JMMS_DRAFTS_OPTIONS,
  2400. SCR_ID_JMMS_SENT_OPTIONS,
  2401. SCR_ID_JMMS_MESSAGE_SETTINGS,
  2402. SCR_ID_JMMS_TEMPLATES
  2403. };
  2404.     /*----------------------------------------------------------------*/
  2405.     /* Code Body                                                      */
  2406.     /*----------------------------------------------------------------*/
  2407. total_screens=sizeof(check_screens)/sizeof(U16);
  2408. for(i=0;i<total_screens;i++)
  2409. {
  2410. if(IsScreenPresent((U16)check_screens[i]))
  2411. return check_screens[i];
  2412. }
  2413.     return SCR_ID_BRW_JBROWSER_MAIN;
  2414. }
  2415. /*****************************************************************************
  2416.  * FUNCTION
  2417.  *  mmi_brw_deinit_all
  2418.  * DESCRIPTION
  2419.  *  
  2420.  * PARAMETERS
  2421.  *  void
  2422.  * RETURNS
  2423.  *  void
  2424.  *****************************************************************************/
  2425. void mmi_brw_deinit_all(void)
  2426. {
  2427.     /*----------------------------------------------------------------*/
  2428.     /* Local Variables                                                */
  2429.     /*----------------------------------------------------------------*/
  2430.     /*----------------------------------------------------------------*/
  2431.     /* Code Body                                                      */
  2432.     /*----------------------------------------------------------------*/
  2433. PRINT_INFORMATION(("Inside mmi_brw_deinit_all, Deinit All"));
  2434.  //   jdi_BrowserDisconnect(pBrowserCtxt);
  2435.     /* If browser launch from wap menu then return */
  2436.     if (!g_brw_cntx.page_fetchReqSrc)
  2437.     {
  2438. /* This variable was set when we try to fetch a page through EnterAddress Option
  2439. screen. Reset this flag to 0 when second page fetch from render page's Eneter Adress throws error. */
  2440. g_brw_add_hist_flag = 0;
  2441. g_brw_notificationFlag = 0;
  2442. g_BrwCsdCallDisconnect = FALSE;
  2443. jdi_BrowserDisconnect(pBrowserCtxt);
  2444.         return;
  2445.     }
  2446.     mmi_brw_wap_deinit();
  2447. #if defined (JATAAYU_SUPPORT) && (defined (WAP_SUPPORT) || (defined (MMS_SUPPORT)))
  2448.     mmi_ph_deinit_profiles();
  2449.     mmi_prov_deinit();
  2450. #endif /* defined (JATAAYU_SUPPORT) && (defined (WAP_SUPPORT) || (defined (MMS_SUPPORT))) */ 
  2451. PRINT_INFORMATION(("Exit mmi_brw_deinit_all, Deinit Completed"));
  2452. }
  2453. /*****************************************************************************
  2454.  * FUNCTION
  2455.  *  mmi_brw_check_csd_data_account
  2456.  * DESCRIPTION
  2457.  *  Returns the rendering status of cyrrent page
  2458.  * PARAMETERS
  2459.  *  void
  2460.  * RETURNS
  2461.  *  void
  2462.  *****************************************************************************/
  2463. BOOL mmi_brw_check_csd_data_account(void)
  2464. {
  2465.     /*----------------------------------------------------------------*/
  2466.     /* Local Variables                                                */
  2467.     /*----------------------------------------------------------------*/
  2468.     nvram_wap_profile_content_struct *activated_wap_profile;
  2469.     /*----------------------------------------------------------------*/
  2470.     /* Code Body                                                      */
  2471.     /*----------------------------------------------------------------*/
  2472.     activated_wap_profile = mmi_ph_get_activated_wap_profile();
  2473.     if (mmi_ph_check_data_account_type(activated_wap_profile->data_account) == PH_DATA_ACCOUNT_CSD)
  2474.     {
  2475. return TRUE;
  2476.     }
  2477. else
  2478. {
  2479. return FALSE;
  2480. }
  2481. }
  2482. /*****************************************************************************
  2483.  * FUNCTION
  2484.  *  mmi_brw_get_ren_page_status
  2485.  * DESCRIPTION
  2486.  *  Returns the rendering status of cyrrent page
  2487.  * PARAMETERS
  2488.  *  void
  2489.  * RETURNS
  2490.  *  void
  2491.  *****************************************************************************/
  2492. U8 mmi_brw_get_ren_page_status(void)
  2493. {
  2494.     /*----------------------------------------------------------------*/
  2495.     /* Local Variables                                                */
  2496.     /*----------------------------------------------------------------*/
  2497.     /*----------------------------------------------------------------*/
  2498.     /* Code Body                                                      */
  2499.     /*----------------------------------------------------------------*/
  2500.     return g_brw_page_cntx.brw_pageRenderStatus;
  2501. }
  2502. /*****************************************************************************
  2503.  * FUNCTION
  2504.  *  mmi_brw_get_ren_page_status
  2505.  * DESCRIPTION
  2506.  *  Returns the rendering status of current page
  2507.  * PARAMETERS
  2508.  *  void
  2509.  * RETURNS
  2510.  *  void
  2511.  *****************************************************************************/
  2512. U8 mmi_brw_get_ren_page_refersh_display_status(void)
  2513. {
  2514.     /*----------------------------------------------------------------*/
  2515.     /* Local Variables                                                */
  2516.     /*----------------------------------------------------------------*/
  2517.     /*----------------------------------------------------------------*/
  2518.     /* Code Body                                                      */
  2519.     /*----------------------------------------------------------------*/
  2520.     return g_brw_page_cntx.brw_PageRefreshDispStatus;
  2521. }
  2522. /*****************************************************************************
  2523.  * FUNCTION
  2524.  *  mmi_brw_check_browser_scr_pre_delte_condition
  2525.  * DESCRIPTION
  2526.  *  It checks whether we can delete the brw scr or not
  2527.  * PARAMETERS
  2528.  *  void
  2529.  * RETURNS
  2530.  *  JC_BOOLEAN
  2531.  *****************************************************************************/
  2532. JC_BOOLEAN mmi_brw_check_browser_scr_pre_delte_condition(void)
  2533. {
  2534. if((IsScreenPresent(SCR_ID_BRW_WAP_ALERT_SCREEN)) ||
  2535. (IsScreenPresent(SCR_ID_BRW_WAP_PROMPT_INPUT_SCREEN)) ||
  2536. (IsScreenPresent(SCR_ID_BRW_AUTHENTICATION)) ||
  2537. //(IsScreenPresent() == SCR_ID_BRW_JBROWSER_MAIN) ||
  2538. mmi_jdd_ui_is_entry_notification_screen_present())
  2539. {
  2540. return E_TRUE;
  2541. }
  2542. else
  2543. {
  2544. return E_FALSE;
  2545. }
  2546. }
  2547. /*****************************************************************************
  2548.  * FUNCTION
  2549.  *  mmi_brw_show_long_idle_disconnected_notification
  2550.  * DESCRIPTION
  2551.  *  Shows long idle disconnected notification
  2552.  * PARAMETERS
  2553.  *  void
  2554.  * RETURNS
  2555.  *  void
  2556.  *****************************************************************************/
  2557. void mmi_brw_show_long_idle_disconnected_notification(void)
  2558. {
  2559.     /*----------------------------------------------------------------*/
  2560.     /* Local Variables                                                */
  2561.     /*----------------------------------------------------------------*/
  2562.     /*----------------------------------------------------------------*/
  2563.     /* Code Body                                                      */
  2564.     /*----------------------------------------------------------------*/
  2565. if(GetTotalCallCount() > 1)/*voice call as well as data call*/
  2566. {
  2567. EntryNewScreen(SCR_ID_BRW_LONG_IDLE_DISCONNECTED, NULL, NULL, NULL);
  2568. ShowCategory151Screen(
  2569. 0,
  2570. 0,
  2571. 0,
  2572. 0,
  2573. 0,
  2574. 0,
  2575. (PU8)GetString(STR_ID_LONG_IDLE_DISCONNECTED),
  2576. (PU8)GetImage(IMG_GLOBAL_INFO),
  2577. 0);
  2578. /*Delete browser screen*/
  2579.   if((IsScreenPresent(SCR_ID_BRW_JBROWSER_MAIN)) &&
  2580.   !(mmi_brw_check_browser_scr_pre_delte_condition()) &&
  2581. !(g_brw_page_cntx.brw_Pre_PageRenderStatus || g_brw_page_cntx.brw_pageRenderStatus || mmi_brw_is_back()))
  2582. {
  2583. DeleteScreenIfPresent(SCR_ID_BRW_JBROWSER_MAIN);
  2584. }
  2585. }
  2586. else
  2587. {
  2588. EntryNewScreen(SCR_ID_BRW_LONG_IDLE_DISCONNECTED, NULL, mmi_brw_show_long_idle_disconnected_notification, NULL);
  2589. ShowCategory151Screen(
  2590. 0,
  2591. 0,
  2592. STR_GLOBAL_OK,
  2593. IMG_GLOBAL_OK,
  2594. 0,
  2595. 0,
  2596. (PU8)GetString(STR_ID_LONG_IDLE_DISCONNECTED),
  2597. (PU8)GetImage(IMG_GLOBAL_INFO),
  2598. 0);
  2599. SetLeftSoftkeyFunction(mmi_brw_handle_long_idle_disconnected_notification, KEY_EVENT_UP);
  2600. }
  2601.  
  2602. }
  2603. /*****************************************************************************
  2604.  * FUNCTION
  2605.  *  mmi_brw_handle_long_idle_disconnected_notification
  2606.  * DESCRIPTION
  2607.  *  Handle key event for long idle disconnected notification
  2608.  * PARAMETERS
  2609.  *  void
  2610.  * RETURNS
  2611.  *  void
  2612.  *****************************************************************************/
  2613. void mmi_brw_handle_long_idle_disconnected_notification(void)
  2614. {
  2615.     /*----------------------------------------------------------------*/
  2616.     /* Local Variables                                                */
  2617.     /*----------------------------------------------------------------*/
  2618.     /*----------------------------------------------------------------*/
  2619.     /* Code Body                                                      */
  2620.     /*----------------------------------------------------------------*/
  2621. /* if((GetCurrScrnId() == SCR_ID_BRW_JBROWSER_MAIN) &&
  2622.         !(g_brw_page_cntx.brw_Pre_PageRenderStatus || g_brw_page_cntx.brw_pageRenderStatus || mmi_brw_is_back()))
  2623. {
  2624. DeleteScreenIfPresent(SCR_ID_BRW_JBROWSER_MAIN);
  2625. }
  2626. */
  2627.   if((IsScreenPresent(SCR_ID_BRW_JBROWSER_MAIN)) &&
  2628.   !(mmi_brw_check_browser_scr_pre_delte_condition()) &&
  2629.         !(g_brw_page_cntx.brw_Pre_PageRenderStatus || g_brw_page_cntx.brw_pageRenderStatus || mmi_brw_is_back()))
  2630. {
  2631. DeleteScreenIfPresent(SCR_ID_BRW_JBROWSER_MAIN);
  2632. }
  2633. GoBackHistory();
  2634. }
  2635. /*****************************************************************************
  2636.  * FUNCTION
  2637.  *  mmi_brw_get_focussed_ctrl_title
  2638.  * DESCRIPTION
  2639.  *  Returns the current focussed control's title
  2640.  * PARAMETERS
  2641.  *  void
  2642.  * RETURNS
  2643.  *  void
  2644.  *****************************************************************************/
  2645. JC_CHAR* mmi_brw_get_focussed_ctrl_title(void)
  2646. {
  2647.     /*----------------------------------------------------------------*/
  2648.     /* Local Variables                                                */
  2649.     /*----------------------------------------------------------------*/
  2650.     /*----------------------------------------------------------------*/
  2651.     /* Code Body                                                      */
  2652.     /*----------------------------------------------------------------*/
  2653.     return jdi_BrowserGetFocusedCtrlTitle(pBrowserCtxt);
  2654. }
  2655. #ifdef __MMI_TOUCH_SCREEN__
  2656. /*****************************************************************************
  2657.  * FUNCTION
  2658.  *  mmi_brw_handle_stylus_event
  2659.  * DESCRIPTION
  2660.  *  This function is called from JDD level to intimate browser core with the pen event
  2661.  * PARAMETERS
  2662.  *  x       [IN]    This specify the x - coordinate realtive to browser window
  2663.  *  y       [IN]    This specify the y - coordinate realtive to browser window
  2664.  * RETURNS
  2665.  *  void
  2666.  *****************************************************************************/
  2667. void mmi_brw_handle_stylus_event(JC_INT32 x,JC_INT32 y,EStylusEvent event)
  2668. {
  2669.     /*----------------------------------------------------------------*/
  2670.     /* Local Variables                                                */
  2671.     /*----------------------------------------------------------------*/
  2672.     JC_RETCODE eRet = JC_OK;
  2673.     /*----------------------------------------------------------------*/
  2674.     /* Code Body                                                      */
  2675.     /*----------------------------------------------------------------*/
  2676.     if(pBrowserCtxt == NULL)
  2677.     {
  2678.         return;
  2679.     }
  2680.     eRet = jdi_BrowserHandleStylusEvent(pBrowserCtxt,x,y,event);
  2681.     if(eRet != JC_OK)
  2682.     {
  2683.         jdd_MMINotificationMessage((JC_INT32) eRet, E_NOTIFICATION_ERR, NULL, NULL);
  2684.     }
  2685. }
  2686. /*****************************************************************************
  2687.  * FUNCTION
  2688.  *  mmi_brw_handle_stylus_scroll_event
  2689.  * DESCRIPTION
  2690.  *  This function is called from JDD level to intimate browser core with the pen scroll event
  2691.  * PARAMETERS
  2692.  *  iPos            [IN]    This specify the scrollbar position
  2693.  *  eScrollType     [IN]    This specify the type of scrollbar Horizontal/Vertical
  2694.  * RETURNS
  2695.  *  void
  2696.  *****************************************************************************/
  2697. void mmi_brw_handle_stylus_scroll_event(JC_INT32 iPos,EScrollBarType  eScrollType)
  2698. {
  2699.     /*----------------------------------------------------------------*/
  2700.     /* Local Variables                                                */
  2701.     /*----------------------------------------------------------------*/
  2702.     JC_RETCODE eRet = JC_OK;
  2703.     /*----------------------------------------------------------------*/
  2704.     /* Code Body                                                      */
  2705.     /*----------------------------------------------------------------*/
  2706.     if(pBrowserCtxt == NULL)
  2707.     {
  2708.         return;
  2709.     }
  2710.     eRet = jdi_BrowserHandleStylusScroll(pBrowserCtxt,iPos,eScrollType);
  2711.     if(eRet != JC_OK)
  2712.     {
  2713.         jdd_MMINotificationMessage((JC_INT32) eRet, E_NOTIFICATION_ERR, NULL, NULL);
  2714.     }
  2715. }
  2716. #endif /*  __MMI_TOUCH_SCREEN__ */
  2717. /*****************************************************************************
  2718.  * FUNCTION
  2719.  *  mmi_brw_suspend_layout_marquee_timer
  2720.  * DESCRIPTION
  2721.  *  This function is called from JDD level to intimate browser core for suspending
  2722.  *  Layout Marquee Timer
  2723.  * PARAMETERS
  2724.  *  void
  2725.  * RETURNS
  2726.  *  void
  2727.  *****************************************************************************/
  2728. void mmi_brw_suspend_layout_marquee_timer(void)
  2729. {
  2730.     /*----------------------------------------------------------------*/
  2731.     /* Local Variables                                                */
  2732.     /*----------------------------------------------------------------*/
  2733.     
  2734.     /*----------------------------------------------------------------*/
  2735.     /* Code Body                                                      */
  2736.     /*----------------------------------------------------------------*/
  2737.     if(pBrowserCtxt == NULL)
  2738.     {
  2739.         return;
  2740.     }
  2741.     jdi_BrowserSuspendMarqueeTimer(pBrowserCtxt);
  2742. }
  2743. /*****************************************************************************
  2744.  * FUNCTION
  2745.  *  mmi_brw_goto_idle_screen_event
  2746.  * DESCRIPTION
  2747.  *  Function for displaying the idle screen
  2748.  * PARAMETERS
  2749.  *  void
  2750.  * RETURNS
  2751.  *  void
  2752.  *****************************************************************************/
  2753. void mmi_brw_goto_idle_screen_event(void)
  2754. {
  2755.     /*----------------------------------------------------------------*/
  2756.     /* Local Variables                                                */
  2757.     /*----------------------------------------------------------------*/
  2758.     JC_RETCODE iRet = JC_OK;
  2759.     JC_EVENT_DATA eventData = {0, };
  2760.     /*----------------------------------------------------------------*/
  2761.     /* Code Body                                                      */
  2762.     /*----------------------------------------------------------------*/
  2763. g_EndKey_pressed = TRUE;/*Indicate that end key has been pressed*/
  2764.     eventData.pEventInfo = NULL;
  2765.     eventData.uiEventInfoSize = 0;
  2766.     eventData.iEventType = E_BRW_ENDKEY_EVENT;
  2767.     eventData.destTaskInfo.iAppID = E_TASK_BROWSER_UI;
  2768.     eventData.destTaskInfo.iTaskID = E_TASK_BROWSER_UI;
  2769.     eventData.srcTaskInfo.iAppID = E_TASK_BROWSER_UI;
  2770.     eventData.srcTaskInfo.iTaskID = E_TASK_BROWSER_UI;
  2771.     iRet = jdd_QueueSend(&eventData);
  2772.     if (JC_OK != iRet)
  2773.     {
  2774.         return;
  2775.     }
  2776. }
  2777. /*****************************************************************************
  2778.  * FUNCTION
  2779.  *  mmi_brw_resume_layout_marquee_timer
  2780.  * DESCRIPTION
  2781.  *  This function is called from JDD level to intimate browser core for resuming
  2782.  *  Layout Marquee Timer
  2783.  * PARAMETERS
  2784.  *  void
  2785.  * RETURNS
  2786.  *  void
  2787.  *****************************************************************************/
  2788. void mmi_brw_resume_layout_marquee_timer(void)
  2789. {
  2790.     /*----------------------------------------------------------------*/
  2791.     /* Local Variables                                                */
  2792.     /*----------------------------------------------------------------*/
  2793.     
  2794.     /*----------------------------------------------------------------*/
  2795.     /* Code Body                                                      */
  2796.     /*----------------------------------------------------------------*/
  2797.     if(pBrowserCtxt == NULL)
  2798.     {
  2799.         return;
  2800.     }
  2801.     jdi_BrowserResumeMarqueeTimer(pBrowserCtxt);
  2802. }
  2803. #endif /* defined (JATAAYU_SUPPORT) && defined (WAP_SUPPORT) */ // #if defined (JATAAYU_SUPPORT) && defined (WAP_SUPPORT)
  2804. #endif /* _MMI_JBROWSERSTARTUP_C */ // #define _MMI_JBROWSERSTARTUP_C