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

MTK

开发平台:

C/C++

  1. /*****************************************************************************
  2. *  Copyright Statement:
  3. *  --------------------
  4. *  This software is protected by Copyright and the information contained
  5. *  herein is confidential. The software may not be copied and the information
  6. *  contained herein may not be used or disclosed except with the written
  7. *  permission of MediaTek Inc. (C) 2005
  8. *
  9. *  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  10. *  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  11. *  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
  12. *  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  13. *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  14. *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  15. *  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  16. *  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  17. *  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
  18. *  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
  19. *  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
  20. *  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
  21. *
  22. *  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
  23. *  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  24. *  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  25. *  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
  26. *  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
  27. *
  28. *  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
  29. *  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
  30. *  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
  31. *  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
  32. *  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
  33. *
  34. *****************************************************************************/
  35. /*****************************************************************************
  36.  *
  37.  * Filename:
  38.  * ---------
  39.  * JBrowserMMISettings.c
  40.  *
  41.  * Project:
  42.  * --------
  43.  *   MAUI
  44.  *
  45.  * Description:
  46.  * ------------
  47.  *   This file is intends for settigs feature in browser.
  48.  *
  49.  * Author:
  50.  * -------
  51.  * -------
  52.  *
  53.  *============================================================================
  54.  *             HISTORY
  55.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  56.  *------------------------------------------------------------------------------
  57.  * removed!
  58.  *
  59.  * removed!
  60.  * removed!
  61.  * removed!
  62.  *
  63.  * removed!
  64.  * removed!
  65.  * removed!
  66.  *
  67.  * removed!
  68.  * removed!
  69.  * removed!
  70.  *
  71.  * removed!
  72.  * removed!
  73.  * removed!
  74.  *
  75.  * removed!
  76.  * removed!
  77.  * removed!
  78.  *
  79.  *------------------------------------------------------------------------------
  80.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  81.  *============================================================================
  82.  ****************************************************************************/
  83. #ifndef _MMI_JBROWSERMMISETTINGS_C
  84. #define _MMI_JBROWSERMMISETTINGS_C
  85. /*  Include: MMI header file */
  86. #include "MMI_features.h"
  87. #if defined (JATAAYU_SUPPORT) && defined (WAP_SUPPORT)
  88. #include "PixtelDataTypes.h"
  89. #include "Unicodexdcl.h"
  90. #include "HistoryGprot.h"
  91. #include "GlobalDefs.h"
  92. #include "CommonScreens.h"
  93. #include "SettingProfile.h"
  94. #include "wgui_categories.h"
  95. #include "wgui_categories_inputs.h"
  96. #include "wap_ps_struct.h"
  97. #include "wapadp.h"
  98. #include "JBrowserMMIDefs.h"
  99. #include "JBrowserMMIProts.h"
  100. #include "JBrowserMMITypes.h"
  101. #include "JProfileHandlerTypes.h"
  102. #include "JProfileHandlerProts.h"
  103. /*  Include: NVRAM header file */
  104. #include "NVRAMType.h"
  105. #include "NVRAMProt.h"
  106. #include "NVRAMEnum.h"
  107. /*  Include: Jataayu header file */
  108. #include "ddl.h"
  109. #include "jcal.h"
  110. #include "jdd_memapi.h"
  111. #include "jdi_communicator.h"
  112. #include "jdi_BrowserDatatype.h"
  113. #include "JPushInboxCommonAPIs.h"       /* Added By Vivek 27 June, 2006 */
  114. /* Local */
  115. //comment by tk
  116. //BOOL service_message_status;
  117. static S8 *gBrwShowImagesString[BRW_SHOW_IMAGES_OPTION];
  118. static S32 gBrwShowImageState = 0;
  119. static S8 *gBrwShowHistoryAsString[BRW_SHOW_HISTORY_AS_OPTION];
  120. static S32 gBrwShowHistoryState = 0;
  121. static S8 gBrwTimeoutValue[(BRW_TIME_OUT_LEN + 1) * ENCODING_LENGTH];
  122. static S8 *gBrwShowImagesSelection[BRW_SHOW_IMAGES_SELECTION];
  123. static S32 gBrwImageSelectionState = 0;
  124. /*****************************************************************************
  125.  * FUNCTION
  126.  *  mmi_brw_setting_init
  127.  * DESCRIPTION
  128.  *  Set highlight handlers for settings menu items
  129.  * PARAMETERS
  130.  *  void
  131.  * RETURNS
  132.  *  void
  133.  *****************************************************************************/
  134. void mmi_brw_setting_init(void)
  135. {
  136.     /*----------------------------------------------------------------*/
  137.     /* Local Variables                                                */
  138.     /*----------------------------------------------------------------*/
  139.     /*----------------------------------------------------------------*/
  140.     /* Code Body                                                      */
  141.     /*----------------------------------------------------------------*/
  142.     SetHiliteHandler(MENU_ID_BRW_SETTINGS_1, mmi_brw_setting_highlight_hdlr);
  143.     SetHiliteHandler(MENU_ID_BRW_SETTINGS_2, mmi_brw_setting_highlight_hdlr);
  144.     SetHiliteHandler(MENU_ID_BRW_SELECT_PROFILE, mmi_brw_setting_select_profile_highlight_hdlr);
  145.     SetHiliteHandler(MENU_ID_BRW_BROWSER_OPTIONS, mmi_brw_setting_browser_option_highlight_hdlr);
  146.     SetHiliteHandler(MENU_ID_BRW_SERVICE_MESSAGES, mmi_brw_setting_service_messages_highlight_hdlr);
  147.     SetHiliteHandler(MENU_ID_BRW_CLEAR_CACHE, mmi_brw_setting_clear_cache_highlight_hdlr);
  148.     SetHiliteHandler(MENU_ID_BRW_CLEAR_COOKIES, mmi_brw_setting_clear_cookies_highlight_hdlr);
  149. #if defined (WAP_SEC_SUPPORT) && defined (JATAAYU_SUPPORT)
  150.     SetHiliteHandler(MENU_ID_BRW_TRUSTED_CERTIFICATES, mmi_brw_setting_trusted_certificates_highlight_hdlr);
  151. #endif 
  152.     /* hint handler */
  153.     SetHintHandler(MENU_ID_BRW_SERVICE_MESSAGES, mmi_brw_setting_service_messages_hint_hdlr);
  154.     /* Added by Sandeep to read the values from NVRAM */
  155.     mmi_brw_read_setting_browser_option();
  156. }
  157. /* ------------------------Settings----------------------------// */
  158. /*****************************************************************************
  159.  * FUNCTION
  160.  *  mmi_brw_setting_highlight_hdlr
  161.  * DESCRIPTION
  162.  *  Highlight handler for Settings in WAP browser main menu
  163.  * PARAMETERS
  164.  *  void
  165.  * RETURNS
  166.  *  void
  167.  *****************************************************************************/
  168. void mmi_brw_setting_highlight_hdlr(void)
  169. {
  170.     /*----------------------------------------------------------------*/
  171.     /* Local Variables                                                */
  172.     /*----------------------------------------------------------------*/
  173.     /*----------------------------------------------------------------*/
  174.     /* Code Body                                                      */
  175.     /*----------------------------------------------------------------*/
  176.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  177.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  178.     SetLeftSoftkeyFunction(mmi_brw_entry_setting, KEY_EVENT_UP);
  179.     SetKeyHandler(mmi_brw_entry_setting, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  180. }
  181. /*****************************************************************************
  182.  * FUNCTION
  183.  *  mmi_brw_entry_setting
  184.  * DESCRIPTION
  185.  *  Entry function for settings screen from main menu
  186.  * PARAMETERS
  187.  *  void
  188.  * RETURNS
  189.  *  void
  190.  *****************************************************************************/
  191. void mmi_brw_entry_setting(void)
  192. {
  193.     /*----------------------------------------------------------------*/
  194.     /* Local Variables                                                */
  195.     /*----------------------------------------------------------------*/
  196.     U8 *guiBuffer;
  197.     U16 nStrItemList[MAX_SUB_MENUS];
  198.     U8 *nHintList[MAX_SUB_MENUS];
  199.     U16 nNumofItem;
  200.     /*----------------------------------------------------------------*/
  201.     /* Code Body                                                      */
  202.     /*----------------------------------------------------------------*/
  203.     EntryNewScreen(SCR_ID_BRW_SETTINGS, NULL, mmi_brw_entry_setting, NULL);
  204.     guiBuffer = GetCurrGuiBuffer(SCR_ID_BRW_SETTINGS);
  205.     nNumofItem = GetNumOfChild(MENU_ID_BRW_SETTINGS_1);
  206.     GetSequenceStringIds(MENU_ID_BRW_SETTINGS_1, nStrItemList);
  207.     SetParentHandler(MENU_ID_BRW_SETTINGS_1);
  208.     ConstructHintsList(MENU_ID_BRW_SETTINGS_1, nHintList);
  209.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  210.     ShowCategory52Screen(
  211.         STR_ID_BRW_SETTINGS,
  212.         GetRootTitleIcon(SERVICES_WAP_MENU_ID),
  213.         STR_GLOBAL_OK,
  214.         IMG_GLOBAL_OK,
  215.         STR_GLOBAL_BACK,
  216.         IMG_GLOBAL_BACK,
  217.         nNumofItem,
  218.         nStrItemList,
  219.         (U16*) gIndexIconsImageList,
  220.         nHintList,
  221.         0,
  222.         0,
  223.         guiBuffer);
  224.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  225.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  226. }
  227. /*****************************************************************************
  228.  * FUNCTION
  229.  *  mmi_brw_ren_page_setting_highlight_hdlr
  230.  * DESCRIPTION
  231.  *  Highlight handler for Settings on rendered page
  232.  * PARAMETERS
  233.  *  void
  234.  * RETURNS
  235.  *  void
  236.  *****************************************************************************/
  237. void mmi_brw_ren_page_setting_highlight_hdlr(void)
  238. {
  239.     /*----------------------------------------------------------------*/
  240.     /* Local Variables                                                */
  241.     /*----------------------------------------------------------------*/
  242.     /*----------------------------------------------------------------*/
  243.     /* Code Body                                                      */
  244.     /*----------------------------------------------------------------*/
  245.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  246.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  247.     SetLeftSoftkeyFunction(mmi_brw_ren_page_entry_setting, KEY_EVENT_UP);
  248.     SetKeyHandler(mmi_brw_ren_page_entry_setting, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  249. }
  250. /*****************************************************************************
  251.  * FUNCTION
  252.  *  mmi_brw_ren_page_entry_setting
  253.  * DESCRIPTION
  254.  *  Entry function for settings screen from rendered page
  255.  * PARAMETERS
  256.  *  void
  257.  * RETURNS
  258.  *  void
  259.  *****************************************************************************/
  260. void mmi_brw_ren_page_entry_setting(void)
  261. {
  262.     /*----------------------------------------------------------------*/
  263.     /* Local Variables                                                */
  264.     /*----------------------------------------------------------------*/
  265.     U8 *guiBuffer;
  266.     U16 nStrItemList[MAX_SUB_MENUS];
  267.     U8 *nHintList[MAX_SUB_MENUS];
  268.     U16 nNumofItem;
  269.     /*----------------------------------------------------------------*/
  270.     /* Code Body                                                      */
  271.     /*----------------------------------------------------------------*/
  272.     EntryNewScreen(SCR_ID_BRW_SETTINGS, NULL, mmi_brw_ren_page_entry_setting, NULL);
  273.     guiBuffer = GetCurrGuiBuffer(SCR_ID_BRW_SETTINGS);
  274.     nNumofItem = GetNumOfChild(MENU_ID_BRW_SETTINGS_2);
  275.     GetSequenceStringIds(MENU_ID_BRW_SETTINGS_2, nStrItemList);
  276.     SetParentHandler(MENU_ID_BRW_SETTINGS_2);
  277.     ConstructHintsList(MENU_ID_BRW_SETTINGS_2, nHintList);
  278.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  279.     ShowCategory52Screen(
  280.         STR_ID_BRW_SETTINGS,
  281.         GetRootTitleIcon(SERVICES_WAP_MENU_ID),
  282.         STR_GLOBAL_OK,
  283.         IMG_GLOBAL_OK,
  284.         STR_GLOBAL_BACK,
  285.         IMG_GLOBAL_BACK,
  286.         nNumofItem,
  287.         nStrItemList,
  288.         (U16*) gIndexIconsImageList,
  289.         nHintList,
  290.         0,
  291.         0,
  292.         guiBuffer);
  293.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  294.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  295. }
  296. /* -------------------------Profile------------------------------// */
  297. /*****************************************************************************
  298.  * FUNCTION
  299.  *  mmi_brw_setting_select_profile_highlight_hdlr
  300.  * DESCRIPTION
  301.  *  Entry function for profile menu
  302.  * PARAMETERS
  303.  *  void
  304.  * RETURNS
  305.  *  void
  306.  *****************************************************************************/
  307. void mmi_brw_setting_select_profile_highlight_hdlr(void)
  308. {
  309.     /*----------------------------------------------------------------*/
  310.     /* Local Variables                                                */
  311.     /*----------------------------------------------------------------*/
  312.     /*----------------------------------------------------------------*/
  313.     /* Code Body                                                      */
  314.     /*----------------------------------------------------------------*/
  315.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  316.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  317.     /* PMT DARA  PROFILE HANDLER 020106 */
  318.     SetLeftSoftkeyFunction(mmi_brw_show_profile_list, KEY_EVENT_UP);
  319.     SetKeyHandler(mmi_brw_show_profile_list, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  320. }
  321. /*****************************************************************************
  322.  * FUNCTION
  323.  *  mmi_brw_show_profile_list
  324.  * DESCRIPTION
  325.  *  Entry function for select profile menu
  326.  * PARAMETERS
  327.  *  void
  328.  * RETURNS
  329.  *  void
  330.  *****************************************************************************/
  331. /* PMT DARA  PROFILE HANDLER 020106 */
  332. void mmi_brw_show_profile_list(void)
  333. {
  334.     /*----------------------------------------------------------------*/
  335.     /* Local Variables                                                */
  336.     /*----------------------------------------------------------------*/
  337.     /*----------------------------------------------------------------*/
  338.     /* Code Body                                                      */
  339.     /*----------------------------------------------------------------*/
  340.     mmi_ph_pre_entry_show_profile_list_menu(PH_BROWSER_PROFILE);
  341. }
  342. /* -------------------------Browser Option-----------------------------// */
  343. /*****************************************************************************
  344.  * FUNCTION
  345.  *  mmi_brw_read_setting_browser_option
  346.  * DESCRIPTION
  347.  *  Function to read settings from NVRAM
  348.  * PARAMETERS
  349.  *  void
  350.  * RETURNS
  351.  *  void
  352.  *****************************************************************************/
  353. void mmi_brw_read_setting_browser_option(void)
  354. {
  355.     /*----------------------------------------------------------------*/
  356.     /* Local Variables                                                */
  357.     /*----------------------------------------------------------------*/
  358.     S16 error;
  359.     /*----------------------------------------------------------------*/
  360.     /* Code Body                                                      */
  361.     /*----------------------------------------------------------------*/
  362.     ReadValue(NVRAM_BRW_TIME_OUT_VALUE, &(g_brw_cntx.timeout_value), DS_SHORT, &error);
  363.     if (g_brw_cntx.timeout_value == 0xFFFF)
  364.     {
  365.         g_brw_cntx.timeout_value = WAP_CUSTOM_CFG_DEFAULT_BROWSE_TIMEOUT;
  366.         WriteValue(NVRAM_BRW_TIME_OUT_VALUE, &(g_brw_cntx.timeout_value), DS_SHORT, &error);
  367.     }
  368.     ReadValue(NVRAM_BRW_SHOW_IMAGE_ON_OFF, &(g_brw_cntx.show_images), DS_BYTE, &error);
  369.     if (g_brw_cntx.show_images == 0xFF)
  370.     {
  371.         g_brw_cntx.show_images = WAP_CUSTOM_CFG_DEFAULT_SHOW_IMAGES_ON;
  372.         WriteValue(NVRAM_BRW_SHOW_IMAGE_ON_OFF, &(g_brw_cntx.show_images), DS_BYTE, &error);
  373.     }
  374.     ReadValue(NVRAM_BRW_SHOW_HISTORY_AS, &(g_brw_cntx.show_history_as_url), DS_BYTE, &error);
  375.     if (g_brw_cntx.show_history_as_url == 0xFF)
  376.     {
  377.         g_brw_cntx.show_history_as_url = WAP_CUSTOM_CFG_DEFAULT_SHOW_HISTORY_AS_URL;
  378.         WriteValue(NVRAM_BRW_SHOW_HISTORY_AS, &(g_brw_cntx.show_history_as_url), DS_BYTE, &error);
  379.     }
  380. ReadValue(NVRAM_BRW_IMAGE_SELECTION_ON_OFF, &(g_brw_cntx.image_selection), DS_BYTE, &error);
  381.     if (g_brw_cntx.image_selection == 0xFF)
  382.     {
  383.         g_brw_cntx.image_selection = WAP_CUSTOM_CFG_DEFAULT_IMAGE_SELECTION_ON;
  384.         WriteValue(NVRAM_BRW_IMAGE_SELECTION_ON_OFF, &(g_brw_cntx.image_selection), DS_BYTE, &error);
  385.     }
  386.     /* added by tk */
  387.     ReadValue(NVRAM_BRW_SHOW_SERVICE_INBOX_MSG, &(g_brw_cntx.isServiceMsgSetting), DS_BYTE, &error);
  388.     /* tk end */
  389.     if (g_brw_cntx.isServiceMsgSetting == 0xFF)
  390.     {
  391.         g_brw_cntx.isServiceMsgSetting = WAP_CUSTOM_CFG_DEFAULT_SHOW_SERVICE_INBOX_MSG;
  392.         WriteValue(NVRAM_BRW_SHOW_SERVICE_INBOX_MSG, &(g_brw_cntx.isServiceMsgSetting), DS_BYTE, &error);
  393.     }
  394. }
  395. /*****************************************************************************
  396.  * FUNCTION
  397.  *  mmi_brw_write_setting_browser_option
  398.  * DESCRIPTION
  399.  *  Function to write settings to NVRAM
  400.  * PARAMETERS
  401.  *  void
  402.  * RETURNS
  403.  *  void
  404.  *****************************************************************************/
  405. void mmi_brw_write_setting_browser_option(void)
  406. {
  407.     /*----------------------------------------------------------------*/
  408.     /* Local Variables                                                */
  409.     /*----------------------------------------------------------------*/
  410.     S16 error;
  411.     /*----------------------------------------------------------------*/
  412.     /* Code Body                                                      */
  413.     /*----------------------------------------------------------------*/
  414.     WriteValue(NVRAM_BRW_TIME_OUT_VALUE, &(g_brw_cntx.timeout_value), DS_SHORT, &error);
  415.     WriteValue(NVRAM_BRW_SHOW_IMAGE_ON_OFF, &(g_brw_cntx.show_images), DS_BYTE, &error);
  416.     WriteValue(NVRAM_BRW_SHOW_HISTORY_AS, &(g_brw_cntx.show_history_as_url), DS_BYTE, &error);
  417. WriteValue(NVRAM_BRW_IMAGE_SELECTION_ON_OFF, &(g_brw_cntx.image_selection), DS_BYTE, &error);
  418. }
  419. /*****************************************************************************
  420.  * FUNCTION
  421.  *  mmi_brw_setting_browser_option_highlight_hdlr
  422.  * DESCRIPTION
  423.  *  Highlight handler for browser settings option
  424.  * PARAMETERS
  425.  *  void
  426.  * RETURNS
  427.  *  void
  428.  *****************************************************************************/
  429. void mmi_brw_setting_browser_option_highlight_hdlr(void)
  430. {
  431.     /*----------------------------------------------------------------*/
  432.     /* Local Variables                                                */
  433.     /*----------------------------------------------------------------*/
  434.     /*----------------------------------------------------------------*/
  435.     /* Code Body                                                      */
  436.     /*----------------------------------------------------------------*/
  437.     ChangeLeftSoftkey(STR_GLOBAL_OPTIONS, IMG_GLOBAL_OPTIONS);
  438.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  439.     SetLeftSoftkeyFunction(mmi_brw_setting_entry_browser_option, KEY_EVENT_UP);
  440.     SetKeyHandler(mmi_brw_setting_entry_browser_option, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  441. }
  442. /*****************************************************************************
  443.  * FUNCTION
  444.  *  mmi_brw_setting_entry_browser_option
  445.  * DESCRIPTION
  446.  *  Entry function for browser settings option
  447.  * PARAMETERS
  448.  *  void
  449.  * RETURNS
  450.  *  void
  451.  *****************************************************************************/
  452. void mmi_brw_setting_entry_browser_option(void)
  453. {
  454.     /*----------------------------------------------------------------*/
  455.     /* Local Variables                                                */
  456.     /*----------------------------------------------------------------*/
  457.     U8 *guiBuffer;
  458.     U8 *inputBuffer;
  459.     U16 inputBufferSize;
  460.     U16 BrowserOptionImageList[NUMBER_OF_ITEMS_IN_BROWSER_OPTION] = {IMG_GLOBAL_L1,
  461.         0,
  462.         IMG_GLOBAL_L2,
  463.         0,
  464.         IMG_GLOBAL_L3,
  465.         0,
  466. IMG_GLOBAL_L4,
  467. 0
  468.     };
  469.     /*----------------------------------------------------------------*/
  470.     /* Code Body                                                      */
  471.     /*----------------------------------------------------------------*/
  472.     EntryNewScreen(SCR_ID_BRW_BROWSER_OPTIONS, mmi_brw_setting_exit_browser_option, NULL, NULL);
  473.     InitializeCategory57Screen();
  474.     guiBuffer = GetCurrGuiBuffer(SCR_ID_BRW_BROWSER_OPTIONS);
  475.     if (guiBuffer == NULL)
  476.     {
  477.         mmi_brw_time_out_get_string_value(gBrwTimeoutValue, g_brw_cntx.timeout_value);
  478.         gBrwShowImageState = g_brw_cntx.show_images;
  479.         gBrwShowHistoryState = g_brw_cntx.show_history_as_url;
  480. gBrwImageSelectionState = g_brw_cntx.image_selection;
  481.     }
  482.     else
  483.     {
  484.         DisableCategory57ScreenDone();
  485.     }
  486.     inputBuffer = GetCurrNInputBuffer(SCR_ID_BRW_BROWSER_OPTIONS, &inputBufferSize);
  487.     SetParentHandler(0);
  488.     mmi_brw_setting_fill_inline_struct_browser_option();
  489.     RegisterHighlightHandler(mmi_brw_setting_highlight_browser_option_edit_inline_item);
  490.     if (inputBuffer != NULL)
  491.     {
  492.         SetCategory57Data(wgui_inline_items, NUMBER_OF_ITEMS_IN_BROWSER_OPTION, inputBuffer);
  493.     }
  494.     ShowCategory57Screen(
  495.         STR_ID_BRW_BROWSER_OPTIONS,
  496.         GetRootTitleIcon(SERVICES_WAP_MENU_ID),
  497.         STR_GLOBAL_EDIT,
  498.         IMG_GLOBAL_OK,
  499.         STR_GLOBAL_BACK,
  500.         IMG_GLOBAL_BACK,
  501.         NUMBER_OF_ITEMS_IN_BROWSER_OPTION,
  502.         BrowserOptionImageList,
  503.         wgui_inline_items,
  504.         0,
  505.         guiBuffer);
  506.     DisableCategory57ScreenDone();
  507.     SetCategory57RightSoftkeyFunctions(NULL, GoBackHistory);
  508. }
  509. /*****************************************************************************
  510.  * FUNCTION
  511.  *  mmi_brw_setting_exit_browser_option
  512.  * DESCRIPTION
  513.  *  Exit function for browser settings option
  514.  * PARAMETERS
  515.  *  void
  516.  * RETURNS
  517.  *  void
  518.  *****************************************************************************/
  519. void mmi_brw_setting_exit_browser_option(void)
  520. {
  521.     /*----------------------------------------------------------------*/
  522.     /* Local Variables                                                */
  523.     /*----------------------------------------------------------------*/
  524.     history h;
  525.     S16 nHistory = 0;
  526.     U16 inputBufferSize;
  527.     /*----------------------------------------------------------------*/
  528.     /* Code Body                                                      */
  529.     /*----------------------------------------------------------------*/
  530.     h.scrnID = SCR_ID_BRW_BROWSER_OPTIONS;
  531.     CloseCategory57Screen();
  532.     h.entryFuncPtr = mmi_brw_setting_entry_browser_option;
  533.     pfnUnicodeStrcpy((S8*) h.inputBuffer, (S8*) & nHistory);
  534.     GetCategory57History(h.guiBuffer);
  535.     inputBufferSize = (U16) GetCategory57DataSize();
  536.     GetCategory57Data((U8*) h.inputBuffer);
  537.     AddNHistory(h, inputBufferSize);
  538. }
  539. /*****************************************************************************
  540.  * FUNCTION
  541.  *  mmi_brw_setting_fill_inline_struct_browser_option
  542.  * DESCRIPTION
  543.  *  Function to Fill valuses in inine edit screen
  544.  * PARAMETERS
  545.  *  void
  546.  * RETURNS
  547.  *  void
  548.  *****************************************************************************/
  549. void mmi_brw_setting_fill_inline_struct_browser_option(void)
  550. {
  551.     /*----------------------------------------------------------------*/
  552.     /* Local Variables                                                */
  553.     /*----------------------------------------------------------------*/
  554.     /*----------------------------------------------------------------*/
  555.     /* Code Body                                                      */
  556.     /*----------------------------------------------------------------*/
  557.     gBrwShowImagesString[0] = GetString(STR_GLOBAL_OFF);
  558.     gBrwShowImagesString[1] = GetString(STR_GLOBAL_ON);
  559.     gBrwShowHistoryAsString[0] = GetString(STR_ID_BRW_SHOW_HISTORY_AS_OPTION_TITLE);
  560.     gBrwShowHistoryAsString[1] = GetString(STR_ID_BRW_SHOW_HISTORY_AS_OPTION_URL);
  561. gBrwShowImagesSelection[0] = GetString(STR_GLOBAL_OFF);
  562.     gBrwShowImagesSelection[1] = GetString(STR_GLOBAL_ON);
  563.     /* Caption */
  564.     SetInlineItemActivation(
  565.         &(wgui_inline_items[BRW_INLINE_TIMEOUT_CAPTION]),
  566.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  567.         0);
  568.     SetInlineItemCaption(&(wgui_inline_items[BRW_INLINE_TIMEOUT_CAPTION]), (U8*) GetString(STR_ID_BRW_TIMEOUT));
  569.     /* Inline Edit */
  570.     SetInlineItemActivation(&(wgui_inline_items[BRW_INLINE_TIMEOUT_EDIT]), INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  571.     SetInlineItemTextEdit(
  572.         &(wgui_inline_items[BRW_INLINE_TIMEOUT_EDIT]),
  573.         (U8*) gBrwTimeoutValue,
  574.         BRW_TIME_OUT_LEN + 1,
  575.         INPUT_TYPE_NUMERIC);
  576.     LeftJustifyInlineItem(&(wgui_inline_items[BRW_INLINE_TIMEOUT_EDIT]));
  577.     DisableInlineItemHighlight(&wgui_inline_items[BRW_INLINE_TIMEOUT_EDIT]);
  578.     /* Caption */
  579.     SetInlineItemActivation(
  580.         &(wgui_inline_items[BRW_INLINE_SHOW_IMAGES_CAPTION]),
  581.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  582.         0);
  583.     SetInlineItemCaption(
  584.         &(wgui_inline_items[BRW_INLINE_SHOW_IMAGES_CAPTION]),
  585.         (U8*) GetString(STR_ID_BRW_SHOW_IMAGES));
  586.     /* Inline Select */
  587.     SetInlineItemActivation(
  588.         &(wgui_inline_items[BRW_INLINE_SHOW_IMAGES_SELECT]),
  589.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  590.         0);
  591.     SetInlineItemSelect(
  592.         &(wgui_inline_items[BRW_INLINE_SHOW_IMAGES_SELECT]),
  593.         (S32) BRW_SHOW_IMAGES_OPTION,
  594.         (U8 **) gBrwShowImagesString,
  595.         &gBrwShowImageState);
  596.     /* Caption */
  597.     SetInlineItemActivation(
  598.         &(wgui_inline_items[BRW_INLINE_SHOW_HISTORY_CAPTION]),
  599.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  600.         0);
  601.     SetInlineItemCaption(
  602.         &(wgui_inline_items[BRW_INLINE_SHOW_HISTORY_CAPTION]),
  603.         (U8*) GetString(STR_ID_BRW_SHOW_ADDRESS_LIST_AS));
  604.     /* Inline Select */
  605.     SetInlineItemActivation(
  606.         &(wgui_inline_items[BRW_INLINE_SHOW_HISTORY_SELECT]),
  607.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  608.         0);
  609.     SetInlineItemSelect(
  610.         &(wgui_inline_items[BRW_INLINE_SHOW_HISTORY_SELECT]),
  611.         (S32) BRW_SHOW_HISTORY_AS_OPTION,
  612.         (U8 **) gBrwShowHistoryAsString,
  613.         &gBrwShowHistoryState);
  614. /* Caption for image selection */
  615. SetInlineItemActivation(
  616.         &(wgui_inline_items[BRW_INLINE_IMAGES_SELECTION_CAPTION]),
  617.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  618.         0);
  619.     SetInlineItemCaption(
  620.         &(wgui_inline_items[BRW_INLINE_IMAGES_SELECTION_CAPTION]),
  621.         (U8*) GetString(STR_ID_BRW_IMAGE_SELECTION));
  622.     /* Inline Select for image selection */
  623.     SetInlineItemActivation(
  624.         &(wgui_inline_items[BRW_INLINE_IMAGES_SELECTION_SELECT]),
  625.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  626.         0);
  627.     SetInlineItemSelect(
  628.         &(wgui_inline_items[BRW_INLINE_IMAGES_SELECTION_SELECT]),
  629.         (S32) BRW_SHOW_IMAGES_OPTION,
  630.         (U8 **) gBrwShowImagesSelection,
  631.         &gBrwImageSelectionState);
  632. }
  633. /*****************************************************************************
  634.  * FUNCTION
  635.  *  mmi_brw_setting_highlight_browser_option_edit_inline_item
  636.  * DESCRIPTION
  637.  *  
  638.  * PARAMETERS
  639.  *  index       [IN]        
  640.  * RETURNS
  641.  *  void
  642.  *****************************************************************************/
  643. void mmi_brw_setting_highlight_browser_option_edit_inline_item(S32 index)
  644. {
  645.     /*----------------------------------------------------------------*/
  646.     /* Local Variables                                                */
  647.     /*----------------------------------------------------------------*/
  648.     /*----------------------------------------------------------------*/
  649.     /* Code Body                                                      */
  650.     /*----------------------------------------------------------------*/
  651.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  652.     SetLeftSoftkeyFunction(mmi_brw_setting_browser_option_confirm_save, KEY_EVENT_UP);
  653. }
  654. /*****************************************************************************
  655.  * FUNCTION
  656.  *  mmi_brw_setting_browser_option_confirm_save
  657.  * DESCRIPTION
  658.  *  Function to confirm save settings
  659.  * PARAMETERS
  660.  *  void
  661.  * RETURNS
  662.  *  void
  663.  *****************************************************************************/
  664. void mmi_brw_setting_browser_option_confirm_save(void)
  665. {
  666.     /*----------------------------------------------------------------*/
  667.     /* Local Variables                                                */
  668.     /*----------------------------------------------------------------*/
  669.     /*----------------------------------------------------------------*/
  670.     /* Code Body                                                      */
  671.     /*----------------------------------------------------------------*/
  672.     DisplayConfirm(
  673.         STR_GLOBAL_YES,
  674.         IMG_GLOBAL_YES,
  675.         STR_GLOBAL_NO,
  676.         IMG_GLOBAL_NO,
  677.         get_string(STR_GLOBAL_SAVE),
  678.         IMG_GLOBAL_QUESTION,
  679.         WARNING_TONE);
  680.     SetLeftSoftkeyFunction(mmi_brw_setting_browser_option_save, KEY_EVENT_UP);
  681.     SetRightSoftkeyFunction(mmi_brw_setting_browser_option_cancel_save, KEY_EVENT_UP);  /* added by tk */
  682. }
  683. /* added by tk */
  684. /*****************************************************************************
  685.  * FUNCTION
  686.  *  mmi_brw_setting_browser_option_cancel_save
  687.  * DESCRIPTION
  688.  *  Function to cacel confirm save settings
  689.  * PARAMETERS
  690.  *  void
  691.  * RETURNS
  692.  *  void
  693.  *****************************************************************************/
  694. void mmi_brw_setting_browser_option_cancel_save(void)
  695. {
  696.     /*----------------------------------------------------------------*/
  697.     /* Local Variables                                                */
  698.     /*----------------------------------------------------------------*/
  699.     /*----------------------------------------------------------------*/
  700.     /* Code Body                                                      */
  701.     /*----------------------------------------------------------------*/
  702.     GoBackToHistory(SCR_ID_BRW_SETTINGS);
  703. }
  704. /* tk end */
  705. /*****************************************************************************
  706.  * FUNCTION
  707.  *  mmi_brw_setting_browser_option_save
  708.  * DESCRIPTION
  709.  *  Function to save the settings
  710.  * PARAMETERS
  711.  *  void
  712.  * RETURNS
  713.  *  void
  714.  *****************************************************************************/
  715. void mmi_brw_setting_browser_option_save(void)
  716. {
  717.     /*----------------------------------------------------------------*/
  718.     /* Local Variables                                                */
  719.     /*----------------------------------------------------------------*/
  720.     S8 timeout[BRW_TIME_OUT_LEN + 1];
  721.     U16 timeoutvalue;
  722.     /*----------------------------------------------------------------*/
  723.     /* Code Body                                                      */
  724.     /*----------------------------------------------------------------*/
  725.     UnicodeToAnsii(timeout, (S8*) gBrwTimeoutValue);
  726.     timeoutvalue = atoi(timeout);
  727.     if (timeoutvalue < 30 || timeoutvalue > 300)
  728.     {
  729.         DisplayPopup(
  730.             (PU8) GetString(STR_ID_BRW_INVALID_TIMEOUT),
  731.             IMG_GLOBAL_ERROR,
  732.             0,
  733.             JBROWSER_POPUP_TIME,
  734.             ERROR_TONE);
  735.         return;
  736.     }
  737.     g_brw_cntx.timeout_value = timeoutvalue;
  738.     g_brw_cntx.show_images = gBrwShowImageState;
  739.     g_brw_cntx.show_history_as_url = gBrwShowHistoryState;
  740. g_brw_cntx.image_selection = gBrwImageSelectionState;
  741.     mmi_brw_write_setting_browser_option();
  742.     /* Added by sandeep to set the timeout value */
  743.     mmi_brw_set_connection_active_flag(MMI_FALSE);
  744.     /* Added by Sandeep to set if images should be shown on the rendered page or not */
  745.     jdi_BrowserGraphicsEnable(pBrowserCtxt, g_brw_cntx.show_images);
  746. jdi_BrowserSetImageAsSelectable(pBrowserCtxt, g_brw_cntx.image_selection);
  747.     DisplayPopup(
  748.         (PU8) GetString(STR_GLOBAL_DONE),
  749.         IMG_GLOBAL_ACTIVATED,
  750.         0,
  751.         JBROWSER_POPUP_TIME,
  752.         SUCCESS_TONE);
  753.     DeleteUptoScrID(SCR_ID_BRW_SETTINGS);
  754. }
  755. /*****************************************************************************
  756.  * FUNCTION
  757.  *  mmi_brw_time_out_get_string_value
  758.  * DESCRIPTION
  759.  *  Function to make the string from a value
  760.  * PARAMETERS
  761.  *  StringVal       [?]         
  762.  *  value           [IN]        
  763.  * RETURNS
  764.  *  void
  765.  *****************************************************************************/
  766. void mmi_brw_time_out_get_string_value(S8 *StringVal, U16 value)
  767. {
  768.     /*----------------------------------------------------------------*/
  769.     /* Local Variables                                                */
  770.     /*----------------------------------------------------------------*/
  771.     S8 StrVal[16];
  772.     /*----------------------------------------------------------------*/
  773.     /* Code Body                                                      */
  774.     /*----------------------------------------------------------------*/
  775.     sprintf(StrVal, "%d", value);
  776.     AnsiiToUnicodeString(StringVal, StrVal);
  777. }
  778. /* -------------------------Service Messages---------------------------// */
  779. /*****************************************************************************
  780.  * FUNCTION
  781.  *  mmi_brw_setting_service_messages_highlight_hdlr
  782.  * DESCRIPTION
  783.  *  Highlight handler of Service Messages menu item.
  784.  *  Register key handlers.
  785.  * PARAMETERS
  786.  *  void
  787.  * RETURNS
  788.  *  void
  789.  *****************************************************************************/
  790. void mmi_brw_setting_service_messages_highlight_hdlr(void)
  791. {
  792.     /*----------------------------------------------------------------*/
  793.     /* Local Variables                                                */
  794.     /*----------------------------------------------------------------*/
  795.     /*----------------------------------------------------------------*/
  796.     /* Code Body                                                      */
  797.     /*----------------------------------------------------------------*/
  798.     if (g_brw_cntx.isServiceMsgSetting) /* added by tk */
  799.     {
  800.         ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
  801.     }
  802.     else
  803.     {
  804.         ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
  805.     }
  806.     SetLeftSoftkeyFunction(mmi_brw_setting_service_messages_toggle, KEY_EVENT_UP);
  807.     ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  808.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  809. }
  810. /*****************************************************************************
  811.  * FUNCTION
  812.  *  mmi_brw_setting_service_messages_hint_hdlr
  813.  * DESCRIPTION
  814.  *  Hint Handler of service messages.
  815.  * PARAMETERS
  816.  *  index       [IN]        
  817.  * RETURNS
  818.  *  void
  819.  *****************************************************************************/
  820. void mmi_brw_setting_service_messages_hint_hdlr(U16 index)
  821. {
  822.     /*----------------------------------------------------------------*/
  823.     /* Local Variables                                                */
  824.     /*----------------------------------------------------------------*/
  825.     /*----------------------------------------------------------------*/
  826.     /* Code Body                                                      */
  827.     /*----------------------------------------------------------------*/
  828.     memset((S8*) hintData[index], 0, sizeof(hintData[index]));
  829.     if (g_brw_cntx.isServiceMsgSetting) /* added by tk */
  830.     {
  831.         pfnUnicodeStrcpy((S8*) hintData[index], GetString(STR_GLOBAL_ON));
  832.     }
  833.     else
  834.     {
  835.         pfnUnicodeStrcpy((S8*) hintData[index], GetString(STR_GLOBAL_OFF));
  836.     }
  837. }
  838. /*****************************************************************************
  839.  * FUNCTION
  840.  *  mmi_brw_setting_service_messages_toggle
  841.  * DESCRIPTION
  842.  *  Toggle state of service messages.
  843.  * PARAMETERS
  844.  *  void
  845.  * RETURNS
  846.  *  void
  847.  *****************************************************************************/
  848. void mmi_brw_setting_service_messages_toggle(void)
  849. {
  850.     /*----------------------------------------------------------------*/
  851.     /* Local Variables                                                */
  852.     /*----------------------------------------------------------------*/
  853.     U16 index;
  854.     S16 error;
  855.     /*----------------------------------------------------------------*/
  856.     /* Code Body                                                      */
  857.     /*----------------------------------------------------------------*/
  858.     index = GetCurrHiliteID();
  859.     if (g_brw_cntx.isServiceMsgSetting) /* added by tk */
  860.     {
  861.         /* service_message_status = 0; */
  862.         g_brw_cntx.isServiceMsgSetting = E_FALSE;   /* added by tk */
  863.         mmi_brw_enable_push_Message(0);             /* Added By Vivek 27 june, 2006 */
  864.         pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
  865.         Category52ChangeItemDescription(index, hintData[index]);
  866.         ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
  867.     }
  868.     else
  869.     {
  870.         g_brw_cntx.isServiceMsgSetting = E_TRUE;    /* added by tk */
  871.         mmi_brw_enable_push_Message(1);             /* Added By Vivek 27 june, 2006 */
  872.         pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
  873.         Category52ChangeItemDescription(index, hintData[index]);
  874.         ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
  875.     }
  876.     /* PMT ADDED BY TK */
  877.     WriteValue(NVRAM_BRW_SHOW_SERVICE_INBOX_MSG, &(g_brw_cntx.isServiceMsgSetting), DS_BYTE, &error);
  878.     /* PMT TK END */
  879.     RedrawCategoryFunction();
  880.     mmi_brw_setting_service_messages_highlight_hdlr();
  881. }
  882. /* ---------------------------Clear Cache------------------------------// */
  883. /*****************************************************************************
  884.  * FUNCTION
  885.  *  mmi_brw_setting_clear_cache_highlight_hdlr
  886.  * DESCRIPTION
  887.  *  Highlight handler of Clear Cache menu item.
  888.  *  Register key handlers.
  889.  * PARAMETERS
  890.  *  void
  891.  * RETURNS
  892.  *  void
  893.  *****************************************************************************/
  894. void mmi_brw_setting_clear_cache_highlight_hdlr(void)
  895. {
  896.     /*----------------------------------------------------------------*/
  897.     /* Local Variables                                                */
  898.     /*----------------------------------------------------------------*/
  899.     /*----------------------------------------------------------------*/
  900.     /* Code Body                                                      */
  901.     /*----------------------------------------------------------------*/
  902.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  903.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  904.     SetLeftSoftkeyFunction(mmi_brw_setting_clear_cache_confirm, KEY_EVENT_UP);
  905.     /* SetKeyHandler(mmi_brw_setting_clear_cache_confirm, KEY_RIGHT_ARROW,  KEY_EVENT_DOWN); */
  906. }
  907. /*****************************************************************************
  908.  * FUNCTION
  909.  *  mmi_brw_setting_clear_cache_confirm
  910.  * DESCRIPTION
  911.  *  This function displays the confirmation screen for deleting the
  912.  *  browser setting cache.
  913.  * PARAMETERS
  914.  *  void
  915.  * RETURNS
  916.  *  void
  917.  *****************************************************************************/
  918. void mmi_brw_setting_clear_cache_confirm(void)
  919. {
  920.     /*----------------------------------------------------------------*/
  921.     /* Local Variables                                                */
  922.     /*----------------------------------------------------------------*/
  923.     /*----------------------------------------------------------------*/
  924.     /* Code Body                                                      */
  925.     /*----------------------------------------------------------------*/
  926.     DisplayConfirm(
  927.         STR_GLOBAL_YES,
  928.         IMG_GLOBAL_YES,
  929.         STR_GLOBAL_NO,
  930.         IMG_GLOBAL_NO,
  931.         get_string(STR_ID_BRW_DELETE_CACHE),
  932.         IMG_GLOBAL_QUESTION,
  933.         WARNING_TONE);
  934.     SetLeftSoftkeyFunction(mmi_brw_setting_clear_cache, KEY_EVENT_UP);
  935.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  936. }
  937. /*****************************************************************************
  938.  * FUNCTION
  939.  *  mmi_brw_setting_clear_cache
  940.  * DESCRIPTION
  941.  *  Deletes the Browser Setting Cache.
  942.  * PARAMETERS
  943.  *  void
  944.  * RETURNS
  945.  *  void
  946.  *****************************************************************************/
  947. void mmi_brw_setting_clear_cache(void)
  948. {
  949.     /*----------------------------------------------------------------*/
  950.     /* Local Variables                                                */
  951.     /*----------------------------------------------------------------*/
  952.     JC_RETCODE eRet = JC_OK;
  953.     /*----------------------------------------------------------------*/
  954.     /* Code Body                                                      */
  955.     /*----------------------------------------------------------------*/
  956.     eRet = jdi_BrowserClearCache(pBrowserCtxt);
  957.     if (eRet == JC_OK)
  958.     {
  959.         /* jdi_BrowserCacheSave(pBrowserCtxt); */
  960.         DisplayPopup(
  961.             (PU8) GetString(STR_GLOBAL_DONE),
  962.             IMG_GLOBAL_ACTIVATED,
  963.             0,
  964.             JBROWSER_POPUP_TIME,
  965.             SUCCESS_TONE);
  966.         /* Clear all the Authorization Information along with Clear Cache */
  967.         jdi_BrowserClearAuthInfo(pBrowserCtxt, E_BR_CLEAR_ALL);
  968.     }
  969.     else
  970.     {
  971.         DisplayPopup(
  972.             (PU8) GetString(STR_GLOBAL_ERROR),
  973.             IMG_GLOBAL_ERROR,
  974.             1,
  975.             JBROWSER_POPUP_TIME,
  976.             ERROR_TONE); 
  977.     }
  978. }
  979. /* ---------------------------Clear Cookies------------------------------// */
  980. /*****************************************************************************
  981.  * FUNCTION
  982.  *  mmi_brw_setting_clear_cookies_highlight_hdlr
  983.  * DESCRIPTION
  984.  *  Highlight handler of Clear Cookies menu item.
  985.  *  Register key handlers.
  986.  * PARAMETERS
  987.  *  void
  988.  * RETURNS
  989.  *  void
  990.  *****************************************************************************/
  991. void mmi_brw_setting_clear_cookies_highlight_hdlr(void)
  992. {
  993.     /*----------------------------------------------------------------*/
  994.     /* Local Variables                                                */
  995.     /*----------------------------------------------------------------*/
  996.     /*----------------------------------------------------------------*/
  997.     /* Code Body                                                      */
  998.     /*----------------------------------------------------------------*/
  999.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  1000.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  1001.     SetLeftSoftkeyFunction(mmi_brw_setting_clear_cookies_confirm, KEY_EVENT_UP);
  1002.     /* SetKeyHandler(mmi_brw_setting_clear_cookies_confirm, KEY_RIGHT_ARROW,KEY_EVENT_DOWN); */
  1003. }
  1004. /*****************************************************************************
  1005.  * FUNCTION
  1006.  *  mmi_brw_setting_clear_cookies_confirm
  1007.  * DESCRIPTION
  1008.  *  This function displays the confirmation screen for deleting the
  1009.  *  browser setting cookies.
  1010.  * PARAMETERS
  1011.  *  void
  1012.  * RETURNS
  1013.  *  void
  1014.  *****************************************************************************/
  1015. void mmi_brw_setting_clear_cookies_confirm(void)
  1016. {
  1017.     /*----------------------------------------------------------------*/
  1018.     /* Local Variables                                                */
  1019.     /*----------------------------------------------------------------*/
  1020.     /*----------------------------------------------------------------*/
  1021.     /* Code Body                                                      */
  1022.     /*----------------------------------------------------------------*/
  1023.     DisplayConfirm(
  1024.         STR_GLOBAL_YES,
  1025.         IMG_GLOBAL_YES,
  1026.         STR_GLOBAL_NO,
  1027.         IMG_GLOBAL_NO,
  1028.         get_string(STR_ID_BRW_DELETE_COOKIES),
  1029.         IMG_GLOBAL_QUESTION,
  1030.         WARNING_TONE);
  1031.     SetLeftSoftkeyFunction(mmi_brw_setting_clear_cookies, KEY_EVENT_UP);
  1032.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1033. }
  1034. /*****************************************************************************
  1035.  * FUNCTION
  1036.  *  mmi_brw_setting_clear_cookies
  1037.  * DESCRIPTION
  1038.  *  Deletes the Browser Setting Cookies.
  1039.  * PARAMETERS
  1040.  *  void
  1041.  * RETURNS
  1042.  *  void
  1043.  *****************************************************************************/
  1044. void mmi_brw_setting_clear_cookies(void)
  1045. {
  1046.     /*----------------------------------------------------------------*/
  1047.     /* Local Variables                                                */
  1048.     /*----------------------------------------------------------------*/
  1049.     JC_RETCODE eRet = JC_OK;
  1050.     /*----------------------------------------------------------------*/
  1051.     /* Code Body                                                      */
  1052.     /*----------------------------------------------------------------*/
  1053.     eRet = jdi_BrowserClearCookie(pBrowserCtxt);
  1054.     if (eRet == JC_OK)
  1055.     {
  1056.         jdi_BrowserCookieSave(pBrowserCtxt);
  1057.         DisplayPopup(
  1058.             (PU8) GetString(STR_GLOBAL_DONE),
  1059.             IMG_GLOBAL_ACTIVATED,
  1060.             0,
  1061.             JBROWSER_POPUP_TIME,
  1062.             SUCCESS_TONE);
  1063.     }
  1064.     else
  1065.     {
  1066.         DisplayPopup(
  1067.             (PU8) GetString(STR_GLOBAL_ERROR),
  1068.             IMG_GLOBAL_ERROR,
  1069.             1,
  1070.             JBROWSER_POPUP_TIME,
  1071.             ERROR_TONE);    
  1072.     }
  1073. }
  1074. /* ---------------------------Trusted Certificates---------------------------// */
  1075. /*****************************************************************************
  1076.  * FUNCTION
  1077.  *  mmi_brw_setting_trusted_certificates_highlight_hdlr
  1078.  * DESCRIPTION
  1079.  *  Highlight handler of Trusted Certificates menu item.
  1080.  *  Register key handlers.
  1081.  * PARAMETERS
  1082.  *  void
  1083.  * RETURNS
  1084.  *  void
  1085.  *****************************************************************************/
  1086. #if defined (WAP_SEC_SUPPORT) && defined (JATAAYU_SUPPORT)
  1087. void mmi_brw_setting_trusted_certificates_highlight_hdlr(void)
  1088. {
  1089.     /*----------------------------------------------------------------*/
  1090.     /* Local Variables                                                */
  1091.     /*----------------------------------------------------------------*/
  1092.     /*----------------------------------------------------------------*/
  1093.     /* Code Body                                                      */
  1094.     /*----------------------------------------------------------------*/
  1095.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  1096.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  1097.     SetLeftSoftkeyFunction(NULL, KEY_EVENT_UP);
  1098.     SetKeyHandler(NULL, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1099. }
  1100. #endif /* defined (WAP_SEC_SUPPORT) && defined (JATAAYU_SUPPORT) */ 
  1101. /*****************************************************************************
  1102.  * FUNCTION
  1103.  *  mmi_brw_set_timeout_value
  1104.  * DESCRIPTION
  1105.  *  External function to set the timeout value
  1106.  * PARAMETERS
  1107.  *  void
  1108.  * RETURNS
  1109.  *  void
  1110.  *****************************************************************************/
  1111. void mmi_brw_set_timeout_value(void)
  1112. {
  1113.     /*----------------------------------------------------------------*/
  1114.     /* Local Variables                                                */
  1115.     /*----------------------------------------------------------------*/
  1116.     nvram_wap_profile_content_struct *activated_wap_profile;
  1117.     ST_BROWSER_SET_OPTION brw_set_timeout;
  1118.     /*----------------------------------------------------------------*/
  1119.     /* Code Body                                                      */
  1120.     /*----------------------------------------------------------------*/
  1121.     activated_wap_profile = mmi_ph_get_activated_wap_profile();
  1122.     if (activated_wap_profile->conn_type == PH_CONN_TYPE_HTTP)
  1123.     {
  1124.         brw_set_timeout.iMaxConnectRetries = 0;
  1125.         brw_set_timeout.iTimeOutVal = g_brw_cntx.timeout_value;
  1126.     }
  1127.     else
  1128.     {
  1129.         brw_set_timeout.iMaxConnectRetries = BRW_MAX_WSP_RETRIES;
  1130.         brw_set_timeout.iTimeOutVal = (g_brw_cntx.timeout_value)/(BRW_MAX_WSP_RETRIES+1);
  1131.     }
  1132.     jdi_BrowserSetOption(pBrowserCtxt, &brw_set_timeout);
  1133. }
  1134. #endif /* defined (JATAAYU_SUPPORT) && defined (WAP_SUPPORT) */ /* #if defined (JATAAYU_SUPPORT) && defined (WAP_SUPPORT) */
  1135. /* PMT HIMANSHU END 20051207 */
  1136. #endif /* _MMI_JBROWSERMMISETTINGS_C */