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

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.  * Filename:
  37.  * ---------
  38.  * EbookSrc.c
  39.  *
  40.  * Project:
  41.  * --------
  42.  *   MAUI
  43.  *
  44.  * Description:
  45.  * ------------
  46.  *   
  47.  *
  48.  * Author:
  49.  * -------
  50.  * -------
  51.  *
  52.  *==============================================================================
  53.  *             HISTORY
  54.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
  55.  *------------------------------------------------------------------------------
  56.  * removed!
  57.  *
  58.  *------------------------------------------------------------------------------
  59.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
  60.  *============================================================================== 
  61.  *******************************************************************************/
  62. /**
  63.  * Copyright Notice
  64.  * ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
  65.  * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
  66.  *  (It is illegal to remove this copyright notice from this software or any
  67.  *  portion of it)
  68.  */
  69. /***************** Ebook Application implementation *********************/
  70. /**************************************************************
  71.    FILENAME : EbookSrc.c
  72.    PURPOSE     : Ebook Appliocation
  73.    REMARKS     : nil
  74.    AUTHOR      : Rajat Kumar
  75.    DATE     : 
  76. **************************************************************/
  77. /*  */
  78. #include "StdC.h"
  79. #include "L4Dr1.h"
  80. #include "SettingProfile.h"
  81. #include "L4Dr.h"
  82. #include "wgui_categories.h"
  83. #include "MMI_features.h"
  84. #ifdef __MMI_EBOOK_READER__
  85. #include "gpioInc.h"
  86. #include "FileManagerDef.h"
  87. #include "FileManagerGprot.h"
  88. #include "EbookDefs.h"
  89. #include "EbookProt.h"
  90. #include "EbookManager.h"
  91. #include "CommonScreens.h"
  92. #include "DownloadDefs.h"
  93. #include "wgui_categories.h"
  94. #include "wgui_categories_inputs.h"
  95. #include "wgui_inputs.h"
  96. #include "drm_gprot.h"
  97. #include "SimDetectionDef.h"
  98. #include "USBDeviceGprot.h"
  99. #include "KeyBrd.h"
  100. /* Global Variables */
  101. extern pBOOL IsBackHistory;
  102. g_ebook_app_cntx g_ebook_app_context;
  103. g_ebook_app_cntx *g_ebook_app_cntx_p = &g_ebook_app_context;
  104. EBOOKSET_CNTX g_ebookset_cntx;
  105. EBOOKSET_CNTX *g_ebookset_cntx_p = &g_ebookset_cntx;
  106. gui_page_info_app ebook_frm_setting_struct;
  107. gui_page_info_app *ebook_frm_setting = &ebook_frm_setting_struct;
  108. /*****************************************************************************
  109.  * FUNCTION
  110.  *  mmi_ebook_usb_mode_on
  111.  * DESCRIPTION
  112.  *  For USB Power On Mode
  113.  * PARAMETERS
  114.  *  void
  115.  * RETURNS
  116.  *  void
  117.  *****************************************************************************/
  118. void mmi_ebook_usb_mode_on(void)
  119. {
  120.     /*----------------------------------------------------------------*/
  121.     /* Local Variables                                                */
  122.     /*----------------------------------------------------------------*/
  123.     /*----------------------------------------------------------------*/
  124.     /* Code Body                                                      */
  125.     /*----------------------------------------------------------------*/
  126.     /* DisplayPopup((PU8)GetString(STR_NO_BOOK_MARK_PRESENT),IMG_GLOBAL_WARNING,1,EBR_ST_NOTIFYDURATION,ERROR_TONE); */
  127.     g_ebookset_cntx_p->is_usb_plugged_in = TRUE;
  128. }
  129. /*****************************************************************************
  130.  * FUNCTION
  131.  *  mmi_ebook_usb_mode_off
  132.  * DESCRIPTION
  133.  *  For USB Power On Mode
  134.  * PARAMETERS
  135.  *  void
  136.  * RETURNS
  137.  *  void
  138.  *****************************************************************************/
  139. void mmi_ebook_usb_mode_off(void)
  140. {
  141.     /*----------------------------------------------------------------*/
  142.     /* Local Variables                                                */
  143.     /*----------------------------------------------------------------*/
  144.     /*----------------------------------------------------------------*/
  145.     /* Code Body                                                      */
  146.     /*----------------------------------------------------------------*/
  147.     g_ebookset_cntx_p->is_usb_plugged_in = FALSE;
  148. }
  149. /*****************************************************************************
  150.  * FUNCTION
  151.  *  ebr_entry_book_shel_screen
  152.  * DESCRIPTION
  153.  *  Entry function for book shelf screen
  154.  * PARAMETERS
  155.  *  void
  156.  * RETURNS
  157.  *  void
  158.  *****************************************************************************/
  159. void ebr_entry_book_shel_screen(void)
  160. {
  161.     /*----------------------------------------------------------------*/
  162.     /* Local Variables                                                */
  163.     /*----------------------------------------------------------------*/
  164.     FMGR_FILTER filter;
  165.     S16 local_nfo_id;
  166.     /*----------------------------------------------------------------*/
  167.     /* Code Body                                                      */
  168.     /*----------------------------------------------------------------*/
  169.     /* DeleteScreenIfPresent(EBOOK_BOOK_SHELF_SETTINGS_SCREEN_ID); */
  170.     if (g_ebookset_cntx_p->is_usb_plugged_in == TRUE)
  171.     {
  172.     #ifdef MMI_ON_HARDWARE_P
  173.     #ifdef __USB_IN_NORMAL_MODE__
  174.         mmi_usb_app_unavailable_popup(0);
  175.     #endif 
  176.     #else /* MMI_ON_HARDWARE_P */ 
  177.         DisplayPopup((PU8) GetString(STR_USB_IS_PLUGGED_IN), IMG_GLOBAL_WARNING, 1, EBR_ST_NOTIFYDURATION, ERROR_TONE);
  178.     #endif /* MMI_ON_HARDWARE_P */ 
  179.         return;
  180.     }
  181.     ebr_frm_set_src_application_type();
  182.     ebr_frm_delete_unused_nfo_file();
  183.     local_nfo_id = ebr_frm_read_from_nvram();
  184.     ebr_frm_check_is_nfo_file_exist(local_nfo_id);
  185.     local_nfo_id = ebr_frm_read_from_nvram();
  186.     if (local_nfo_id > 0)
  187.     {
  188.         gdi_layer_lock_frame_buffer();
  189.     }
  190.     {
  191.         FMGR_FILTER_INIT(&filter);
  192.         FMGR_FILTER_SET(&filter, FMGR_TYPE_EBOOK_TXT);
  193.         FMGR_FILTER_SET(&filter, FMGR_TYPE_EBOOK_PDB);
  194.         mmi_fmgr_select_path_and_enter(
  195.             APP_EBOOK,
  196.             FMGR_SELECT_BROWSE,
  197.             filter,
  198.             (PS8) ebr_frm_get_path_for_bookshelf(),
  199.             ebr_book_file_callback);
  200.     }
  201.     if (local_nfo_id > 0)
  202.     {
  203.         gdi_layer_unlock_frame_buffer();
  204.         ebr_frm_set_file_name(local_nfo_id);
  205.         ebr_entry_open_book();
  206.     }
  207.     ClearKeyHandler(KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  208. }
  209. /*****************************************************************************
  210.  * FUNCTION
  211.  *  InitEbookApp
  212.  * DESCRIPTION
  213.  *  Set highlight handler for Menu Ooptions
  214.  * PARAMETERS
  215.  *  void
  216.  * RETURNS
  217.  *  void
  218.  *****************************************************************************/
  219. void InitEbookApp(void)
  220. {
  221.     /*----------------------------------------------------------------*/
  222.     /* Local Variables                                                */
  223.     /*----------------------------------------------------------------*/
  224.     /*----------------------------------------------------------------*/
  225.     /* Code Body                                                      */
  226.     /*----------------------------------------------------------------*/
  227.     SetHiliteHandler(MENU_ID_EBK_RFS_OPTION, ebr_highlight_refresh_book_shelf);
  228.     SetHiliteHandler(MENU_ID_EBK_RFS_OPTION_LIMITED, ebr_highlight_refresh_book_shelf);
  229.     SetHiliteHandler(MENU_ID_EBK_OPEN, ebr_highlight_open_ebook);
  230.     SetHiliteHandler(MENU_ID_EBK_INFO, ebr_higlight_book_info);
  231.     SetHiliteHandler(MENU_ID_EBK_DELETE, ebr_highlight_delete_ebook);
  232.     SetHiliteHandler(MENU_ID_EBK_HELP, ebr_highlight_help);
  233.     SetHiliteHandler(MENU_ID_EBK_SETTINGS, ebr_highlight_book_shelf_settings);
  234.     SetHiliteHandler(MENU_ID_EBK_SETTINGS_LIMITED, ebr_highlight_book_shelf_settings);
  235.     SetHiliteHandler(MENU_ID_EBK_FIND, ebr_highlight_search);
  236.     SetHiliteHandler(MENU_ID_EBK_FIND_NEXT, ebr_highlight_search_next);
  237.     SetHiliteHandler(MENU_ID_EBK_JUMP, ebr_highlight_jump_to);
  238.     SetHiliteHandler(MENU_ID_EBK_GOTO_BOOKMARK, ebr_highlight_goto_book_mark);
  239.     SetHiliteHandler(MENU_ID_EBK_REMOVE_BOOKMARK, ebr_highlight_remove_book_mark);
  240.     SetHiliteHandler(MENU_ID_EBK_ADD_BOOKMARK, ebr_highlight_add_book_mark);
  241.     SetHiliteHandler(MENU_ID_EBK_BOOK_SETTINGS, ebr_highlight_book_settings);
  242.     SetHiliteHandler(MENU_ID_EBK_BOOK_INFO, ebr_highlight_open_book_info);
  243.     SetHiliteHandler(MENU_ID_EBK_CLOSE, ebr_close_book);
  244.     SetHiliteHandler(MENU_ID_EBK_CASE_SENSITIVE, ebr_highlight_case_sensitive_serach);
  245.     SetHiliteHandler(MENU_ID_EBK_CASE_INSENSITIVE, ebr_highlight_case_in_sensitive_serach);
  246.     SetHiliteHandler(MENU_ID_EBK_BOOK_RESTORE_DEFAULT, ebr_highlight_ebk_restore_default);
  247.     SetHiliteHandler(MENU_ID_EBK_DELETE_ALL, ebr_highlight_delete_all);
  248.     SetHiliteHandler(MENU_ID_EBK_RESTORE_DEFAULT, ebr_highlight_book_shelf_restore_default);
  249.     memset(g_ebook_app_cntx_p->ebr_search_string_input, 0, sizeof(g_ebook_app_cntx_p->ebr_search_string_input));
  250.     ebr_frm_init();
  251. }
  252. /*****************************************************************************
  253.  * FUNCTION
  254.  *  ebr_book_file_callback
  255.  * DESCRIPTION
  256.  *  Call back for Book shelf Screen
  257.  * PARAMETERS
  258.  *  fullname        [IN]        
  259.  *  is_short        [IN]        
  260.  * RETURNS
  261.  *  void
  262.  *****************************************************************************/
  263. void ebr_book_file_callback(void *fullname, int is_short)
  264. {
  265.     /*----------------------------------------------------------------*/
  266.     /* Local Variables                                                */
  267.     /*----------------------------------------------------------------*/
  268.     /*----------------------------------------------------------------*/
  269.     /* Code Body                                                      */
  270.     /*----------------------------------------------------------------*/
  271.     GoBackHistory();
  272. }
  273. /*****************************************************************************
  274.  * FUNCTION
  275.  *  ebr_show_limit_book_shelf_option
  276.  * DESCRIPTION
  277.  *  Options for Limited Book Shelf
  278.  * PARAMETERS
  279.  *  void
  280.  * RETURNS
  281.  *  void
  282.  *****************************************************************************/
  283. void ebr_show_limit_book_shelf_option(void)
  284. {
  285.     /*----------------------------------------------------------------*/
  286.     /* Local Variables                                                */
  287.     /*----------------------------------------------------------------*/
  288.     U8 *guiBuffer;
  289.     U16 nNumofItem;
  290.     U16 nStrItemList[MAX_SUB_MENUS];
  291.     U16 nImgIltemList[MAX_SUB_MENUS];
  292.     U8 *hintList[MAX_SUB_MENUS];
  293.     /*----------------------------------------------------------------*/
  294.     /* Code Body                                                      */
  295.     /*----------------------------------------------------------------*/
  296.     EntryNewScreen(EBOOK_OPEN_OPTION_SCREENID, NULL, ebr_show_limit_book_shelf_option, NULL);
  297.     guiBuffer = GetCurrGuiBuffer(EBOOK_OPEN_OPTION_SCREENID);
  298.     
  299.     nNumofItem = GetNumOfChild(MENU_ID_EBK_LIMITED_BOOKSHELF_OPTION);
  300.     GetSequenceStringIds(MENU_ID_EBK_LIMITED_BOOKSHELF_OPTION, nStrItemList);
  301.     GetSequenceImageIds(MENU_ID_EBK_LIMITED_BOOKSHELF_OPTION, nImgIltemList);
  302.     SetParentHandler(MENU_ID_EBK_LIMITED_BOOKSHELF_OPTION);
  303.     
  304.     /* Construct List To Show Hint */
  305.     ConstructHintsList(MENU_ID_EBK_BOOKSHELF_OPTION, hintList);
  306.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  307.     ShowCategory52Screen(
  308.         STR_GLOBAL_OPTIONS,
  309.         GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
  310.         STR_GLOBAL_OK,
  311.         IMG_GLOBAL_OK,
  312.         STR_GLOBAL_BACK,
  313.         IMG_GLOBAL_BACK,
  314.         nNumofItem,
  315.         nStrItemList,
  316.         (U16*) gIndexIconsImageList,
  317.         hintList,
  318.         0,
  319.         0,
  320.         guiBuffer);
  321.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  322.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  323. }
  324. /*****************************************************************************
  325.  * FUNCTION
  326.  *  mmi_ebook_get_menuId
  327.  * DESCRIPTION
  328.  *  
  329.  * PARAMETERS
  330.  *  void
  331.  * RETURNS
  332.  *  
  333.  *****************************************************************************/
  334. U16 mmi_ebook_get_menuId(void)
  335. {
  336.     /*----------------------------------------------------------------*/
  337.     /* Local Variables                                                */
  338.     /*----------------------------------------------------------------*/
  339.     S16 count_no_of_nfo_file;
  340.     /*----------------------------------------------------------------*/
  341.     /* Code Body                                                      */
  342.     /*----------------------------------------------------------------*/
  343.     count_no_of_nfo_file = ebr_frm_get_total_countof_nfo_file();
  344.     ebr_frm_write_default_value_for_nfo_id_in_nvram();
  345.     if (count_no_of_nfo_file <= 0)
  346.     {
  347.         return MENU_ID_EBK_LIMITED_BOOKSHELF_OPTION;
  348.     }
  349.     else
  350.     {
  351.         return MENU_ID_EBK_BOOKSHELF_OPTION;
  352.     }
  353. }
  354. /*****************************************************************************
  355.  * FUNCTION
  356.  *  ebr_entry_refresh_book_shelf
  357.  * DESCRIPTION
  358.  *  Refreshed Book Shelf Screen
  359.  * PARAMETERS
  360.  *  void
  361.  * RETURNS
  362.  *  void
  363.  *****************************************************************************/
  364. void ebr_entry_refresh_book_shelf(void)
  365. {
  366.     /*----------------------------------------------------------------*/
  367.     /* Local Variables                                                */
  368.     /*----------------------------------------------------------------*/
  369.     /*----------------------------------------------------------------*/
  370.     /* Code Body                                                      */
  371.     /*----------------------------------------------------------------*/
  372.     ebr_please_wait_actual_screen_2();
  373.     ebr_frm_entry_refresh_book_shelf();
  374.     DisplayPopup(
  375.         (PU8) GetString(STR_BOOK_SHELF_REFRESHED),
  376.         IMG_GLOBAL_ACTIVATED,
  377.         1,
  378.         EBR_ST_NOTIFYDURATION,
  379.         SUCCESS_TONE);
  380.     if (IsScreenPresent(SCR_FMGR_APP_FILE_OPTION))
  381.     {
  382.         DeleteNScrId(SCR_FMGR_APP_FILE_OPTION);
  383.     }
  384.     else
  385.     {
  386.         DeleteNScrId(EBOOK_OPEN_OPTION_SCREENID);
  387.     }
  388. }
  389. /*****************************************************************************
  390.  * FUNCTION
  391.  *  ebr_highlight_refresh_book_shelf
  392.  * DESCRIPTION
  393.  *  Set highlight handler for Menu Ooptions
  394.  * PARAMETERS
  395.  *  void
  396.  * RETURNS
  397.  *  void
  398.  *****************************************************************************/
  399. void ebr_highlight_refresh_book_shelf(void)
  400. {
  401.     /*----------------------------------------------------------------*/
  402.     /* Local Variables                                                */
  403.     /*----------------------------------------------------------------*/
  404.     /*----------------------------------------------------------------*/
  405.     /* Code Body                                                      */
  406.     /*----------------------------------------------------------------*/
  407.     /* 1 Change left soft key icon and label */
  408.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  409.     /* 2 Change right soft key icon and label */
  410.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  411.     /* 3 Register function for left soft key */
  412.     SetLeftSoftkeyFunction(ebr_entry_refresh_book_shelf, KEY_EVENT_UP);
  413.     /* 4 Register function for right soft key */
  414.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  415.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  416.     ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  417. }
  418. /*****************************************************************************
  419.  * FUNCTION
  420.  *  ebr_highlight_ebk_restore_default
  421.  * DESCRIPTION
  422.  *  Set highlight handler for Restore Default
  423.  * PARAMETERS
  424.  *  void
  425.  * RETURNS
  426.  *  void
  427.  *****************************************************************************/
  428. void ebr_highlight_ebk_restore_default(void)
  429. {
  430.     /*----------------------------------------------------------------*/
  431.     /* Local Variables                                                */
  432.     /*----------------------------------------------------------------*/
  433.     /*----------------------------------------------------------------*/
  434.     /* Code Body                                                      */
  435.     /*----------------------------------------------------------------*/
  436.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  437.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  438.     SetLeftSoftkeyFunction(ebr_app_restore_default_book_settings, KEY_EVENT_UP);
  439.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  440.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  441.     ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  442. }
  443. /*****************************************************************************
  444.  * FUNCTION
  445.  *  ebr_highlight_delete_all
  446.  * DESCRIPTION
  447.  *  Set highlight handler Delete All
  448.  * PARAMETERS
  449.  *  void
  450.  * RETURNS
  451.  *  void
  452.  *****************************************************************************/
  453. void ebr_highlight_delete_all(void)
  454. {
  455.     /*----------------------------------------------------------------*/
  456.     /* Local Variables                                                */
  457.     /*----------------------------------------------------------------*/
  458.     /*----------------------------------------------------------------*/
  459.     /* Code Body                                                      */
  460.     /*----------------------------------------------------------------*/
  461.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  462.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  463.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  464.     ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  465.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  466.     highlight_fmgr_delete_all_file();
  467. }
  468. /*****************************************************************************
  469.  * FUNCTION
  470.  *  ebr_highlight_book_shelf_restore_default
  471.  * DESCRIPTION
  472.  *  Set highlight handler for Restore Default
  473.  * PARAMETERS
  474.  *  void
  475.  * RETURNS
  476.  *  void
  477.  *****************************************************************************/
  478. void ebr_highlight_book_shelf_restore_default(void)
  479. {
  480.     /*----------------------------------------------------------------*/
  481.     /* Local Variables                                                */
  482.     /*----------------------------------------------------------------*/
  483.     /*----------------------------------------------------------------*/
  484.     /* Code Body                                                      */
  485.     /*----------------------------------------------------------------*/
  486.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  487.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  488.     SetLeftSoftkeyFunction(ebr_app_restore_default_book_shelf_settings, KEY_EVENT_UP);
  489.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  490.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  491.     ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  492. }
  493. /*****************************************************************************
  494.  * FUNCTION
  495.  *  ebr_highlight_open_ebook
  496.  * DESCRIPTION
  497.  *  Set highlight handler for Open book
  498.  * PARAMETERS
  499.  *  void
  500.  * RETURNS
  501.  *  void
  502.  *****************************************************************************/
  503. void ebr_highlight_open_ebook(void)
  504. {
  505.     /*----------------------------------------------------------------*/
  506.     /* Local Variables                                                */
  507.     /*----------------------------------------------------------------*/
  508.     FMGR_FILE_INFO_STRUCT file_info;
  509.     /*----------------------------------------------------------------*/
  510.     /* Code Body                                                      */
  511.     /*----------------------------------------------------------------*/
  512.     mmi_fmgr_kernel_get_file_info(mmi_fmgr_kernel_get_cur_idx(), &file_info);
  513.     ebr_set_selected_file_name(&file_info);
  514.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  515.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  516.     SetLeftSoftkeyFunction(ebr_entry_open_book, KEY_EVENT_UP);
  517.     SetKeyHandler(ebr_entry_open_book, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  518.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  519.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  520. }
  521. /*****************************************************************************
  522.  * FUNCTION
  523.  *  ebr_higlight_book_info
  524.  * DESCRIPTION
  525.  *  Set highlight handler for Book Info
  526.  * PARAMETERS
  527.  *  void
  528.  * RETURNS
  529.  *  void
  530.  *****************************************************************************/
  531. void ebr_higlight_book_info(void)
  532. {
  533.     /*----------------------------------------------------------------*/
  534.     /* Local Variables                                                */
  535.     /*----------------------------------------------------------------*/
  536.     /*----------------------------------------------------------------*/
  537.     /* Code Body                                                      */
  538.     /*----------------------------------------------------------------*/
  539.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  540.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  541.     SetLeftSoftkeyFunction(ebr_entry_book_info, KEY_EVENT_UP);
  542.     SetKeyHandler(ebr_entry_book_info, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  543.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  544. }
  545. /*****************************************************************************
  546.  * FUNCTION
  547.  *  ebr_highlight_delete_ebook
  548.  * DESCRIPTION
  549.  *  Set highlight handler for Delete Book
  550.  * PARAMETERS
  551.  *  void
  552.  * RETURNS
  553.  *  void
  554.  *****************************************************************************/
  555. void ebr_highlight_delete_ebook(void)
  556. {
  557.     /*----------------------------------------------------------------*/
  558.     /* Local Variables                                                */
  559.     /*----------------------------------------------------------------*/
  560.     /*----------------------------------------------------------------*/
  561.     /* Code Body                                                      */
  562.     /*----------------------------------------------------------------*/
  563.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  564.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  565.     SetLeftSoftkeyFunction(ebr_entry_delete_book_popup, KEY_EVENT_UP);
  566.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  567.     ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  568. }
  569. /*****************************************************************************
  570.  * FUNCTION
  571.  *  ebr_entry_delete_book_popup
  572.  * DESCRIPTION
  573.  *  Display popUp for Delete and confirm deletion
  574.  * PARAMETERS
  575.  *  void
  576.  * RETURNS
  577.  *  void
  578.  *****************************************************************************/
  579. void ebr_entry_delete_book_popup(void)
  580. {
  581.     /*----------------------------------------------------------------*/
  582.     /* Local Variables                                                */
  583.     /*----------------------------------------------------------------*/
  584.     /*----------------------------------------------------------------*/
  585.     /* Code Body                                                      */
  586.     /*----------------------------------------------------------------*/
  587.     DisplayConfirm(
  588.         STR_GLOBAL_YES,
  589.         IMG_GLOBAL_YES,
  590.         STR_GLOBAL_NO,
  591.         IMG_GLOBAL_NO,
  592.         get_string(STR_DELETE_EBOOK_CONFIRM),
  593.         IMG_GLOBAL_QUESTION,
  594.         WARNING_TONE);
  595.     SetLeftSoftkeyFunction(ebr_entry_delete_ebook, KEY_EVENT_UP);
  596.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  597. }
  598. /*****************************************************************************
  599.  * FUNCTION
  600.  *  ebr_highlight_help
  601.  * DESCRIPTION
  602.  *  Set highlight handler for Help
  603.  * PARAMETERS
  604.  *  void
  605.  * RETURNS
  606.  *  void
  607.  *****************************************************************************/
  608. void ebr_highlight_help(void)
  609. {
  610.     /*----------------------------------------------------------------*/
  611.     /* Local Variables                                                */
  612.     /*----------------------------------------------------------------*/
  613.     /*----------------------------------------------------------------*/
  614.     /* Code Body                                                      */
  615.     /*----------------------------------------------------------------*/
  616.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  617.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  618.     SetLeftSoftkeyFunction(ebr_entry_help, KEY_EVENT_UP);
  619.     SetKeyHandler(ebr_entry_help, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  620.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  621. }
  622. /*****************************************************************************
  623.  * FUNCTION
  624.  *  ebr_highlight_book_shelf_settings
  625.  * DESCRIPTION
  626.  *  Set highlight handler for Settings
  627.  * PARAMETERS
  628.  *  void
  629.  * RETURNS
  630.  *  void
  631.  *****************************************************************************/
  632. void ebr_highlight_book_shelf_settings(void)
  633. {
  634.     /*----------------------------------------------------------------*/
  635.     /* Local Variables                                                */
  636.     /*----------------------------------------------------------------*/
  637.     /*----------------------------------------------------------------*/
  638.     /* Code Body                                                      */
  639.     /*----------------------------------------------------------------*/
  640.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  641.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  642.     SetLeftSoftkeyFunction(ebr_entry_settings, KEY_EVENT_UP);
  643.     SetKeyHandler(ebr_entry_settings, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  644.     g_ebook_app_cntx_p->ebr_set_local_setting_flag = 0;
  645.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  646.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  647. }
  648. /*****************************************************************************
  649.  * FUNCTION
  650.  *  ebr_highlight_search
  651.  * DESCRIPTION
  652.  *  Set highlight handler for Search
  653.  * PARAMETERS
  654.  *  void
  655.  * RETURNS
  656.  *  void
  657.  *****************************************************************************/
  658. void ebr_highlight_search(void)
  659. {
  660.     /*----------------------------------------------------------------*/
  661.     /* Local Variables                                                */
  662.     /*----------------------------------------------------------------*/
  663.     /*----------------------------------------------------------------*/
  664.     /* Code Body                                                      */
  665.     /*----------------------------------------------------------------*/
  666.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  667.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  668.     SetLeftSoftkeyFunction(ebr_entry_search, KEY_EVENT_UP);
  669.     SetKeyHandler(ebr_entry_search, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  670.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  671.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  672. }
  673. /*****************************************************************************
  674.  * FUNCTION
  675.  *  ebr_highlight_search_next
  676.  * DESCRIPTION
  677.  *  Set highlight handler for find next Search
  678.  * PARAMETERS
  679.  *  void
  680.  * RETURNS
  681.  *  void
  682.  *****************************************************************************/
  683. void ebr_highlight_search_next(void)
  684. {
  685.     /*----------------------------------------------------------------*/
  686.     /* Local Variables                                                */
  687.     /*----------------------------------------------------------------*/
  688.     /*----------------------------------------------------------------*/
  689.     /* Code Body                                                      */
  690.     /*----------------------------------------------------------------*/
  691.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  692.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  693.     SetLeftSoftkeyFunction(ebr_app_search_string_next_from_menu, KEY_EVENT_UP);
  694.     SetKeyHandler(ebr_app_search_string_next_from_menu, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  695.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  696.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  697. }
  698. /*****************************************************************************
  699.  * FUNCTION
  700.  *  ebr_app_search_result_successful
  701.  * DESCRIPTION
  702.  *  Set the flag
  703.  * PARAMETERS
  704.  *  result      [IN]        
  705.  * RETURNS
  706.  *  void
  707.  *****************************************************************************/
  708. void ebr_app_search_result_successful(pBOOL result)
  709. {
  710.     /*----------------------------------------------------------------*/
  711.     /* Local Variables                                                */
  712.     /*----------------------------------------------------------------*/
  713.     /*----------------------------------------------------------------*/
  714.     /* Code Body                                                      */
  715.     /*----------------------------------------------------------------*/
  716.     g_ebook_app_cntx_p->ebr_search_found_next_flag = result;
  717. }
  718. /*****************************************************************************
  719.  * FUNCTION
  720.  *  ebr_app_search_string_next_from_menu
  721.  * DESCRIPTION
  722.  *  Shows the Find NExt menu option
  723.  * PARAMETERS
  724.  *  void
  725.  * RETURNS
  726.  *  void
  727.  *****************************************************************************/
  728. void ebr_app_search_string_next_from_menu(void)
  729. {
  730.     /*----------------------------------------------------------------*/
  731.     /* Local Variables                                                */
  732.     /*----------------------------------------------------------------*/
  733. #ifdef __MMI_LANG_HINDI__
  734.     pBOOL full_character;
  735. #endif 
  736. S32 search_satus;
  737.     /*----------------------------------------------------------------*/
  738.     /* Code Body                                                      */
  739.     /*----------------------------------------------------------------*/
  740.     if(!ebr_frm_check_file_exist())
  741. {
  742. go_back_to_bookshelf_screen();
  743. ebr_app_display_pop_up_error_opening_book();
  744. return;
  745. }
  746.     ebr_please_wait_actual_screen_2();
  747. #ifdef __MMI_LANG_HINDI__
  748.     full_character = ebr_frm_check_for_full_characters((S16*) g_ebook_app_cntx_p->ebr_search_string_input);
  749.     if (!full_character)
  750.     {
  751.         ebr_app_show_string_incomplete_pop_up();
  752.         return;
  753.     }
  754. #endif /* __MMI_LANG_HINDI__ */ 
  755. search_satus = ebr_frm_search_string_algo_find_next();
  756.     if (search_satus==1)
  757.     {
  758.         ebr_app_search_result_successful(TRUE);
  759.         ebr_app_delete_upto_open_book_screen_id();
  760.         GoBackHistory();
  761.         ebr_frm_set_data_for_display();
  762.     }
  763.     else
  764.     {
  765.         if(search_satus==2)
  766. {
  767. ebr_app_search_result_invalid();
  768. }
  769. else
  770. {
  771.         ebr_app_search_result_unsucessfull();
  772.     }
  773. }
  774. }
  775. /*****************************************************************************
  776.  * FUNCTION
  777.  *  ebr_app_search_string_next
  778.  * DESCRIPTION
  779.  *  called when find next is executed
  780.  * PARAMETERS
  781.  *  void
  782.  * RETURNS
  783.  *  void
  784.  *****************************************************************************/
  785. void ebr_app_search_string_next(void)
  786. {
  787.     /*----------------------------------------------------------------*/
  788.     /* Local Variables                                                */
  789.     /*----------------------------------------------------------------*/
  790. #ifdef __MMI_LANG_HINDI__
  791.     pBOOL full_character;
  792. #endif 
  793. S32 search_satus;
  794.     /*----------------------------------------------------------------*/
  795.     /* Code Body                                                      */
  796.     /*----------------------------------------------------------------*/
  797.     ebr_frm_set_find_next_flag();
  798. if(!ebr_frm_check_file_exist())
  799. {
  800. go_back_to_bookshelf_screen();
  801. ebr_app_display_pop_up_error_opening_book();
  802. return;
  803. }
  804.     ebr_please_wait_actual_screen_2();
  805. #ifdef __MMI_LANG_HINDI__
  806.     full_character = ebr_frm_check_for_full_characters((S16*) g_ebook_app_cntx_p->ebr_search_string_input);
  807.     if (!full_character)
  808.     {
  809.         ebr_app_show_string_incomplete_pop_up();
  810.         return;
  811.     }
  812. #endif /* __MMI_LANG_HINDI__ */ 
  813. search_satus = ebr_frm_search_string_algo_find_next();
  814. if (search_satus == 0xFF)
  815.     {
  816.         return;
  817.     }
  818.     else if (search_satus==1)
  819.     {
  820.         ebr_app_search_result_successful(TRUE);
  821.         g_ebook_app_cntx_p->enable_screen_exit = 0;
  822.         EntryNewScreen(SCR_ID_EBOOK_WAITSCREEN, NULL, NULL, NULL);
  823.         g_ebook_app_cntx_p->enable_screen_exit = 1;
  824.         ebr_app_delete_upto_open_book_screen_id();
  825.         GoBackHistory();
  826.         ebr_frm_set_data_for_display();
  827.     }
  828.     else
  829.     {
  830.         if(search_satus==2)
  831. {
  832. ebr_app_search_result_invalid();
  833. }
  834. else
  835. {
  836.         ebr_app_search_result_unsucessfull();
  837.     }
  838. }
  839. }
  840. /*****************************************************************************
  841.  * FUNCTION
  842.  *  ebr_highlight_jump_to
  843.  * DESCRIPTION
  844.  *  Set highlight handler for Menu Ooptions
  845.  * PARAMETERS
  846.  *  void
  847.  * RETURNS
  848.  *  void
  849.  *****************************************************************************/
  850. void ebr_highlight_jump_to(void)
  851. {
  852.     /*----------------------------------------------------------------*/
  853.     /* Local Variables                                                */
  854.     /*----------------------------------------------------------------*/
  855.     /*----------------------------------------------------------------*/
  856.     /* Code Body                                                      */
  857.     /*----------------------------------------------------------------*/
  858.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  859.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  860.     SetLeftSoftkeyFunction(ebr_entry_jump_to, KEY_EVENT_UP);
  861.     SetKeyHandler(ebr_entry_jump_to, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  862.     memset(g_ebook_app_cntx_p->percentage_val, 0, (EBR_MAX_EBOOK_PERCENTAGE_VALUE + 1) * ENCODING_LENGTH);
  863.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  864.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  865. }
  866. /*****************************************************************************
  867.  * FUNCTION
  868.  *  ebr_pre_entry_jump_to
  869.  * DESCRIPTION
  870.  *  Pre Entry function for jumpTo
  871.  * PARAMETERS
  872.  *  void
  873.  * RETURNS
  874.  *  void
  875.  *****************************************************************************/
  876. void ebr_pre_entry_jump_to(void)
  877. {
  878.     /*----------------------------------------------------------------*/
  879.     /* Local Variables                                                */
  880.     /*----------------------------------------------------------------*/
  881.     /*----------------------------------------------------------------*/
  882.     /* Code Body                                                      */
  883.     /*----------------------------------------------------------------*/
  884.     memset(g_ebook_app_cntx_p->percentage_val, 0, (EBR_MAX_EBOOK_PERCENTAGE_VALUE + 1) * ENCODING_LENGTH);
  885.     ebr_entry_jump_to();
  886. }
  887. /*****************************************************************************
  888.  * FUNCTION
  889.  *  ebr_highlight_goto_book_mark
  890.  * DESCRIPTION
  891.  *  Set highlight handler for Menu Ooptions
  892.  * PARAMETERS
  893.  *  void
  894.  * RETURNS
  895.  *  void
  896.  *****************************************************************************/
  897. void ebr_highlight_goto_book_mark(void)
  898. {
  899.     /*----------------------------------------------------------------*/
  900.     /* Local Variables                                                */
  901.     /*----------------------------------------------------------------*/
  902.     /*----------------------------------------------------------------*/
  903.     /* Code Body                                                      */
  904.     /*----------------------------------------------------------------*/
  905.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  906.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  907.     SetLeftSoftkeyFunction(ebr_entry_goto_book_mark, KEY_EVENT_UP);
  908.     SetKeyHandler(ebr_entry_goto_book_mark, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  909.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  910.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  911. }
  912. /*****************************************************************************
  913.  * FUNCTION
  914.  *  ebr_highlight_remove_book_mark
  915.  * DESCRIPTION
  916.  *  Set highlight handler for Menu Ooptions
  917.  * PARAMETERS
  918.  *  void
  919.  * RETURNS
  920.  *  void
  921.  *****************************************************************************/
  922. void ebr_highlight_remove_book_mark(void)
  923. {
  924.     /*----------------------------------------------------------------*/
  925.     /* Local Variables                                                */
  926.     /*----------------------------------------------------------------*/
  927.     /*----------------------------------------------------------------*/
  928.     /* Code Body                                                      */
  929.     /*----------------------------------------------------------------*/
  930.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  931.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  932.     SetLeftSoftkeyFunction(ebr_entry_remove_book_mark, KEY_EVENT_UP);
  933.     SetKeyHandler(ebr_entry_remove_book_mark, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  934.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  935.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  936. }
  937. /*****************************************************************************
  938.  * FUNCTION
  939.  *  ebr_entry_remove_book_mark
  940.  * DESCRIPTION
  941.  *  Entry Function for Remove Bookmark
  942.  * PARAMETERS
  943.  *  void
  944.  * RETURNS
  945.  *  void
  946.  *****************************************************************************/
  947. void ebr_entry_remove_book_mark(void)
  948. {
  949.     /*----------------------------------------------------------------*/
  950.     /* Local Variables                                                */
  951.     /*----------------------------------------------------------------*/
  952.     U8 *guiBuffer;
  953.     S16 no_of_book_marks = 0;
  954.     /*----------------------------------------------------------------*/
  955.     /* Code Body                                                      */
  956.     /*----------------------------------------------------------------*/
  957.     if(!ebr_frm_check_file_exist())
  958. {
  959. go_back_to_bookshelf_screen();
  960. ebr_app_display_pop_up_error_opening_book();
  961. return;
  962. }
  963.     no_of_book_marks = ebr_frm_get_count_of_book_marks();
  964.     EntryNewScreen(EBOOK_REMOVE_BOOKMARK_SCREENID, NULL, ebr_entry_remove_book_mark, NULL);
  965.     guiBuffer = GetCurrGuiBuffer(EBOOK_REMOVE_BOOKMARK_SCREENID);
  966.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  967.     SetParentHandler(0);
  968.     if (no_of_book_marks == 0)
  969.     {   /*   ShowCategory184Screen(STR_RMV_BOOKMARK_EBOOK, (U16)NULL,
  970.            0, 0,
  971.            STR_GLOBAL_BACK, IMG_GLOBAL_BACK, 
  972.            no_of_book_marks,ebr_get_book_mark_name_list,
  973.            NULL, 0, guiBuffer); */
  974.         DisplayPopup(
  975.             (PU8) GetString(STR_NO_BOOK_MARK_PRESENT),
  976.             IMG_GLOBAL_WARNING,
  977.             1,
  978.             EBR_ST_NOTIFYDURATION,
  979.             ERROR_TONE);
  980.         DeleteNScrId(EBOOK_REMOVE_BOOKMARK_SCREENID);
  981.         return;
  982.         /* GoBackHistory(); */
  983.     }
  984.     else
  985.     {
  986.         ShowCategory184Screen(
  987.             STR_RMV_BOOKMARK_EBOOK,
  988.             GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
  989.             STR_GLOBAL_OK,
  990.             IMG_GLOBAL_OK,
  991.             STR_GLOBAL_BACK,
  992.             IMG_GLOBAL_BACK,
  993.             no_of_book_marks,
  994.             ebr_get_book_mark_name_list,
  995.             NULL,
  996.             0,
  997.             guiBuffer);
  998.     }
  999.     /* register LSK and right key handlers */
  1000.     ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1001.     SetLeftSoftkeyFunction(ebr_delete_bookmark, KEY_EVENT_UP);
  1002.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1003.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1004.     ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1005. }
  1006. /*****************************************************************************
  1007.  * FUNCTION
  1008.  *  ebr_delete_bookmark
  1009.  * DESCRIPTION
  1010.  *  PopuUp display for deletion of BookMark
  1011.  * PARAMETERS
  1012.  *  void
  1013.  * RETURNS
  1014.  *  void
  1015.  *****************************************************************************/
  1016. void ebr_delete_bookmark(void)
  1017. {
  1018.     /*----------------------------------------------------------------*/
  1019.     /* Local Variables                                                */
  1020.     /*----------------------------------------------------------------*/
  1021.     /*----------------------------------------------------------------*/
  1022.     /* Code Body                                                      */
  1023.     /*----------------------------------------------------------------*/
  1024.     if(!ebr_frm_check_file_exist())
  1025. {
  1026. go_back_to_bookshelf_screen();
  1027. ebr_app_display_pop_up_error_opening_book();
  1028. return;
  1029. }
  1030.     DisplayConfirm(
  1031.         STR_GLOBAL_YES,
  1032.         IMG_GLOBAL_YES,
  1033.         STR_GLOBAL_NO,
  1034.         IMG_GLOBAL_NO,
  1035.         get_string(STR_DELETE_BOOK_MARK),
  1036.         IMG_GLOBAL_QUESTION,
  1037.         WARNING_TONE);
  1038.     SetLeftSoftkeyFunction(ebr_remove_selected_bookmark, KEY_EVENT_UP);
  1039.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1040. }
  1041. /*****************************************************************************
  1042.  * FUNCTION
  1043.  *  ebr_entry_goto_book_mark
  1044.  * DESCRIPTION
  1045.  *  Entry Function for Go to BookMark
  1046.  * PARAMETERS
  1047.  *  void
  1048.  * RETURNS
  1049.  *  void
  1050.  *****************************************************************************/
  1051. void ebr_entry_goto_book_mark(void)
  1052. {
  1053.     /*----------------------------------------------------------------*/
  1054.     /* Local Variables                                                */
  1055.     /*----------------------------------------------------------------*/
  1056.     U8 *guiBuffer;
  1057.     S16 no_of_book_marks = 0;
  1058.     /*----------------------------------------------------------------*/
  1059.     /* Code Body                                                      */
  1060.     /*----------------------------------------------------------------*/
  1061.     if(!ebr_frm_check_file_exist())
  1062. {
  1063. go_back_to_bookshelf_screen();
  1064. ebr_app_display_pop_up_error_opening_book();
  1065. return;
  1066. }
  1067.     no_of_book_marks = ebr_frm_get_count_of_book_marks();
  1068.     EntryNewScreen(EBOOK_GOTO_BOOKMARK_SCREENID, NULL, ebr_entry_goto_book_mark, NULL);
  1069.     guiBuffer = GetCurrGuiBuffer(EBOOK_GOTO_BOOKMARK_SCREENID);
  1070.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1071.     SetParentHandler(0);
  1072.     if (no_of_book_marks == 0)
  1073.     {   /* ShowCategory184Screen(STR_GOTO_BOOKMARK_EBOOK, (U16)NULL,
  1074.            0, 0,
  1075.            STR_GLOBAL_BACK, IMG_GLOBAL_BACK, 
  1076.            no_of_book_marks ,ebr_get_book_mark_name_list,
  1077.            NULL, 0, guiBuffer); */
  1078.         DisplayPopup(
  1079.             (PU8) GetString(STR_NO_BOOK_MARK_PRESENT),
  1080.             IMG_GLOBAL_WARNING,
  1081.             1,
  1082.             EBR_ST_NOTIFYDURATION,
  1083.             ERROR_TONE);
  1084.         DeleteNScrId(EBOOK_GOTO_BOOKMARK_SCREENID);
  1085.         return;
  1086.     }
  1087.     else
  1088.     {
  1089.         ShowCategory184Screen(
  1090.             STR_GOTO_BOOKMARK_EBOOK,
  1091.             GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
  1092.             STR_GLOBAL_OK,
  1093.             IMG_GLOBAL_OK,
  1094.             STR_GLOBAL_BACK,
  1095.             IMG_GLOBAL_BACK,
  1096.             no_of_book_marks,
  1097.             ebr_get_book_mark_name_list,
  1098.             NULL,
  1099.             0,
  1100.             guiBuffer);
  1101.     }
  1102.     /* register LSK and right key handlers */
  1103.     SetLeftSoftkeyFunction(ebr_goto_selected_bookmark, KEY_EVENT_UP);
  1104.     SetKeyHandler(ebr_goto_selected_bookmark, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1105.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1106.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1107. }
  1108. /*****************************************************************************
  1109.  * FUNCTION
  1110.  *  ebr_goto_selected_bookmark
  1111.  * DESCRIPTION
  1112.  *  Entry Function for Go to BookMark
  1113.  * PARAMETERS
  1114.  *  void
  1115.  * RETURNS
  1116.  *  void
  1117.  *****************************************************************************/
  1118. void ebr_goto_selected_bookmark(void)
  1119. {
  1120.     /*----------------------------------------------------------------*/
  1121.     /* Local Variables                                                */
  1122.     /*----------------------------------------------------------------*/
  1123.     S16 selected_index = 0;
  1124.     /*----------------------------------------------------------------*/
  1125.     /* Code Body                                                      */
  1126.     /*----------------------------------------------------------------*/
  1127.     selected_index = GetCurrHiliteID();
  1128.     if(!ebr_frm_check_file_exist())
  1129. {
  1130. go_back_to_bookshelf_screen();
  1131. ebr_app_display_pop_up_error_opening_book();
  1132. return;
  1133. }
  1134.     ebr_frm_get_record_for_bookmark(selected_index);
  1135.     DeleteUptoScrID(EBOOK_OPEN_SCREENID);
  1136.     GoBackHistory();
  1137. }
  1138. /*****************************************************************************
  1139.  * FUNCTION
  1140.  *  ebr_remove_selected_bookmark
  1141.  * DESCRIPTION
  1142.  *  Exit function for Delete book mark
  1143.  * PARAMETERS
  1144.  *  void
  1145.  * RETURNS
  1146.  *  void
  1147.  *****************************************************************************/
  1148. void ebr_remove_selected_bookmark(void)
  1149. {
  1150.     /*----------------------------------------------------------------*/
  1151.     /* Local Variables                                                */
  1152.     /*----------------------------------------------------------------*/
  1153.     /*----------------------------------------------------------------*/
  1154.     /* Code Body                                                      */
  1155.     /*----------------------------------------------------------------*/
  1156.     ebr_frm_remove_bookmark(GetCurrHiliteID());
  1157.     if (IsScreenPresent(EBOOK_BOOK_SETTINGS_SCREENID))
  1158.     {
  1159.         DeleteUptoScrID(EBOOK_BOOK_SETTINGS_SCREENID);
  1160.     }
  1161.     else
  1162.     {
  1163.         DeleteNScrId(EBOOK_REMOVE_BOOKMARK_SCREENID);
  1164.     }
  1165.     DisplayPopup((PU8) GetString(STR_DELETED), IMG_GLOBAL_ACTIVATED, 1, EBR_ST_NOTIFYDURATION, SUCCESS_TONE);
  1166. }
  1167. /*****************************************************************************
  1168.  * FUNCTION
  1169.  *  ebr_highlight_add_book_mark
  1170.  * DESCRIPTION
  1171.  *  Set highlight handler for Menu Ooptions
  1172.  * PARAMETERS
  1173.  *  void
  1174.  * RETURNS
  1175.  *  void
  1176.  *****************************************************************************/
  1177. void ebr_highlight_add_book_mark(void)
  1178. {
  1179.     /*----------------------------------------------------------------*/
  1180.     /* Local Variables                                                */
  1181.     /*----------------------------------------------------------------*/
  1182.     /*----------------------------------------------------------------*/
  1183.     /* Code Body                                                      */
  1184.     /*----------------------------------------------------------------*/
  1185.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  1186.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  1187.     SetLeftSoftkeyFunction(ebr_entry_add_book_mark, KEY_EVENT_UP);
  1188.     SetKeyHandler(ebr_entry_add_book_mark, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1189.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1190.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1191. }
  1192. /*****************************************************************************
  1193.  * FUNCTION
  1194.  *  ebr_entry_add_book_mark
  1195.  * DESCRIPTION
  1196.  *  Entry function for Add book mark
  1197.  * PARAMETERS
  1198.  *  void
  1199.  * RETURNS
  1200.  *  void
  1201.  *****************************************************************************/
  1202. void ebr_entry_add_book_mark(void)
  1203. {
  1204.     /*----------------------------------------------------------------*/
  1205.     /* Local Variables                                                */
  1206.     /*----------------------------------------------------------------*/
  1207.     U8 *guiBuffer = NULL;
  1208.     U8 ebr_bookmark_name[EBR_FRM_MAX_BOOKMARK_NAME_SIZE];
  1209.     U8 ebr_bookmark_name_ucs[EBR_FRM_MAX_BOOKMARK_NAME_SIZE];
  1210.     S16 no_of_book_marks = 0;
  1211.     UI_string_type s[EBR_MAX_SETTINGS_VAL_ENCD_TYPE];
  1212.     /*----------------------------------------------------------------*/
  1213.     /* Code Body                                                      */
  1214.     /*----------------------------------------------------------------*/
  1215.     if(!ebr_frm_check_file_exist())
  1216. {
  1217. go_back_to_bookshelf_screen();
  1218. ebr_app_display_pop_up_error_opening_book();
  1219. return;
  1220. }
  1221.     no_of_book_marks = ebr_frm_get_count_of_book_marks();
  1222.     if (no_of_book_marks >= EBR_FRM_MAX_NO_OF_BOOKMARKS)
  1223.     {
  1224.         /* Display Pop up that no more BookMarks can be added */
  1225.         if (IsScreenPresent(EBOOK_BOOK_SETTINGS_SCREENID))
  1226.         {
  1227.             DeleteUptoScrID(EBOOK_BOOK_SETTINGS_SCREENID);
  1228.         }
  1229.         DisplayPopup((PU8) GetString(STR_MAX_BOOK_MARK), IMG_GLOBAL_WARNING, 1, EBR_ST_NOTIFYDURATION, ERROR_TONE);
  1230.         return;
  1231.     }
  1232.     EntryNewScreen(EBOOK_ADD_BOOK_MARK_SCREEN_ID, NULL, ebr_entry_add_book_mark, NULL);
  1233.     guiBuffer = GetCurrGuiBuffer(EBOOK_ADD_BOOK_MARK_SCREEN_ID);
  1234.     if (guiBuffer == NULL)
  1235.     {
  1236.         strcpy((char*)ebr_bookmark_name, (const S8*)"Bookmark");
  1237.         gui_itoa(no_of_book_marks, (UI_string_type) s, EBR_MAX_SETTINGS_VAL_ENCD_TYPE);
  1238.         strcat((S8*) ebr_bookmark_name, (const S8*)" ");
  1239.         strcat((S8*) ebr_bookmark_name, (const S8*)s);
  1240.         AnsiiToUnicodeString((S8*) ebr_bookmark_name_ucs, (S8*) ebr_bookmark_name);
  1241.         pfnUnicodeStrcpy((S8*) g_ebook_app_cntx_p->book_mark_name, (S8*) ebr_bookmark_name_ucs);
  1242.     }
  1243.     ShowCategory5Screen(
  1244.         STR_ADD_BOOKMARK_EBOOK,
  1245.         GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
  1246.         STR_GLOBAL_OPTIONS,
  1247.         IMG_GLOBAL_OPTIONS,
  1248.         STR_GLOBAL_BACK,
  1249.         IMG_GLOBAL_BACK,
  1250.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE,
  1251.         g_ebook_app_cntx_p->book_mark_name,
  1252.         EBR_FRM_MAX_BOOKMARK_NAME_SIZE + 1,
  1253.         guiBuffer);
  1254.     SetLeftSoftkeyFunction(ebr_entry_book_mark_edit_list, KEY_EVENT_UP);
  1255.     SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1256. }
  1257. /*****************************************************************************
  1258.  * FUNCTION
  1259.  *  ebr_entry_book_mark_edit_list
  1260.  * DESCRIPTION
  1261.  *  Entry function for Add book mark
  1262.  * PARAMETERS
  1263.  *  void
  1264.  * RETURNS
  1265.  *  void
  1266.  *****************************************************************************/
  1267. void ebr_entry_book_mark_edit_list(void)
  1268. {
  1269.     /*----------------------------------------------------------------*/
  1270.     /* Local Variables                                                */
  1271.     /*----------------------------------------------------------------*/
  1272.     U8 *guiBuffer;
  1273.     U16 ItemList[2];
  1274.     U16 nItems;
  1275.     /*----------------------------------------------------------------*/
  1276.     /* Code Body                                                      */
  1277.     /*----------------------------------------------------------------*/
  1278.     EntryNewScreen(SCR_EDIT_BOOK_MARK_NAME, NULL, ebr_entry_book_mark_edit_list, NULL);
  1279.     guiBuffer = GetCurrGuiBuffer(SCR_EDIT_BOOK_MARK_NAME);
  1280.     nItems = GetNumOfChild(MENU_EBOOK_EDIT_BOOK_MARK_NAME);
  1281.     GetSequenceStringIds(MENU_EBOOK_EDIT_BOOK_MARK_NAME, ItemList);
  1282.     RegisterHighlightHandler(ebr_get_add_book_mark_options);
  1283.     ShowCategory52Screen(
  1284.         STR_GLOBAL_OPTIONS,
  1285.         GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
  1286.         STR_GLOBAL_OK,
  1287.         IMG_GLOBAL_OK,
  1288.         STR_GLOBAL_BACK,
  1289.         IMG_GLOBAL_BACK,
  1290.         nItems,
  1291.         ItemList,
  1292.         (PU16) gIndexIconsImageList,
  1293.         0,
  1294.         0,
  1295.         0,
  1296.         guiBuffer);
  1297.     /* Register function for left soft key */
  1298.     SetLeftSoftkeyFunction(ebr_get_add_book_mark, KEY_EVENT_UP);
  1299.     /* Register function for right soft key */
  1300.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1301.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1302. }
  1303. /*****************************************************************************
  1304.  * FUNCTION
  1305.  *  ebr_get_add_book_mark
  1306.  * DESCRIPTION
  1307.  *  Processing for Highlight Handler
  1308.  * PARAMETERS
  1309.  *  void
  1310.  * RETURNS
  1311.  *  void
  1312.  *****************************************************************************/
  1313. void ebr_get_add_book_mark(void)
  1314. {
  1315.     /*----------------------------------------------------------------*/
  1316.     /* Local Variables                                                */
  1317.     /*----------------------------------------------------------------*/
  1318.     /*----------------------------------------------------------------*/
  1319.     /* Code Body                                                      */
  1320.     /*----------------------------------------------------------------*/
  1321.     switch (g_ebook_app_cntx_p->current_highlighted_item)
  1322.     {
  1323.         case 0:
  1324.             ebr_frm_add_book_mark_pre_entry();
  1325.             break;
  1326.         case 1: /* Input Methods */
  1327.             EntryInputMethodScreen();
  1328.             RegisterInputMethodScreenCloseFunction(GoBackHistoryFromInputMethod);
  1329.             break;
  1330.         default:
  1331.             break;
  1332.     }
  1333. }
  1334. /*****************************************************************************
  1335.  * FUNCTION
  1336.  *  ebr_get_add_book_mark_options
  1337.  * DESCRIPTION
  1338.  *  Highlight Handler
  1339.  * PARAMETERS
  1340.  *  nIndex      [IN]        
  1341.  * RETURNS
  1342.  *  void
  1343.  *****************************************************************************/
  1344. void ebr_get_add_book_mark_options(S32 nIndex)
  1345. {
  1346.     /*----------------------------------------------------------------*/
  1347.     /* Local Variables                                                */
  1348.     /*----------------------------------------------------------------*/
  1349.     /*----------------------------------------------------------------*/
  1350.     /* Code Body                                                      */
  1351.     /*----------------------------------------------------------------*/
  1352.     g_ebook_app_cntx_p->current_highlighted_item = nIndex;
  1353.     switch (nIndex)
  1354.     {
  1355.         case 0: /* Done */
  1356.             ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_UP);
  1357.             break;
  1358.         case 1: /* Input Methods */
  1359.             SetKeyHandler(ebr_get_add_book_mark, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1360.             break;
  1361.         default:
  1362.             break;
  1363.     }
  1364. }
  1365. /*****************************************************************************
  1366.  * FUNCTION
  1367.  *  GoBackHistoryFromInputMethod
  1368.  * DESCRIPTION
  1369.  *  Go back History
  1370.  * PARAMETERS
  1371.  *  void
  1372.  * RETURNS
  1373.  *  void
  1374.  *****************************************************************************/
  1375. void GoBackHistoryFromInputMethod(void)
  1376. {
  1377.     /*----------------------------------------------------------------*/
  1378.     /* Local Variables                                                */
  1379.     /*----------------------------------------------------------------*/
  1380.     /*----------------------------------------------------------------*/
  1381.     /* Code Body                                                      */
  1382.     /*----------------------------------------------------------------*/
  1383.     GoBacknHistory(1);
  1384. }
  1385. /*****************************************************************************
  1386.  * FUNCTION
  1387.  *  ebr_get_book_mark_name
  1388.  * DESCRIPTION
  1389.  *  Get book mark name
  1390.  * PARAMETERS
  1391.  *  void
  1392.  * RETURNS
  1393.  *  S8*
  1394.  *****************************************************************************/
  1395. S8 *ebr_get_book_mark_name(void)
  1396. {
  1397.     /*----------------------------------------------------------------*/
  1398.     /* Local Variables                                                */
  1399.     /*----------------------------------------------------------------*/
  1400.     /*----------------------------------------------------------------*/
  1401.     /* Code Body                                                      */
  1402.     /*----------------------------------------------------------------*/
  1403.     return (S8*) g_ebook_app_cntx_p->book_mark_name;
  1404. }
  1405. /*****************************************************************************
  1406.  * FUNCTION
  1407.  *  ebr_highlight_book_settings
  1408.  * DESCRIPTION
  1409.  *  Set highlight handler for Menu Ooptions
  1410.  * PARAMETERS
  1411.  *  void
  1412.  * RETURNS
  1413.  *  void
  1414.  *****************************************************************************/
  1415. void ebr_highlight_book_settings(void)
  1416. {
  1417.     /*----------------------------------------------------------------*/
  1418.     /* Local Variables                                                */
  1419.     /*----------------------------------------------------------------*/
  1420.     /*----------------------------------------------------------------*/
  1421.     /* Code Body                                                      */
  1422.     /*----------------------------------------------------------------*/
  1423.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  1424.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  1425.     SetLeftSoftkeyFunction(ebr_entry_settings, KEY_EVENT_UP);
  1426.     SetKeyHandler(ebr_entry_settings, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1427.     g_ebook_app_cntx_p->ebr_set_local_setting_flag = 1;
  1428.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1429.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1430. }
  1431. /*****************************************************************************
  1432.  * FUNCTION
  1433.  *  ebr_highlight_open_book_info
  1434.  * DESCRIPTION
  1435.  *  Set highlight handler for Menu Ooptions
  1436.  * PARAMETERS
  1437.  *  void
  1438.  * RETURNS
  1439.  *  void
  1440.  *****************************************************************************/
  1441. void ebr_highlight_open_book_info(void)
  1442. {
  1443.     /*----------------------------------------------------------------*/
  1444.     /* Local Variables                                                */
  1445.     /*----------------------------------------------------------------*/
  1446.     /*----------------------------------------------------------------*/
  1447.     /* Code Body                                                      */
  1448.     /*----------------------------------------------------------------*/
  1449.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  1450.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  1451.     SetLeftSoftkeyFunction(ebr_entry_book_info, KEY_EVENT_UP);
  1452.     SetKeyHandler(ebr_entry_book_info, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1453.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1454.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1455. }
  1456. /*****************************************************************************
  1457.  * FUNCTION
  1458.  *  ebr_close_book
  1459.  * DESCRIPTION
  1460.  *  Set highlight handler for Menu Ooptions
  1461.  * PARAMETERS
  1462.  *  void
  1463.  * RETURNS
  1464.  *  void
  1465.  *****************************************************************************/
  1466. void ebr_close_book(void)
  1467. {
  1468.     /*----------------------------------------------------------------*/
  1469.     /* Local Variables                                                */
  1470.     /*----------------------------------------------------------------*/
  1471.     /*----------------------------------------------------------------*/
  1472.     /* Code Body                                                      */
  1473.     /*----------------------------------------------------------------*/
  1474.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  1475.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  1476.     SetLeftSoftkeyFunction(ebr_entry_close_book, KEY_EVENT_UP);
  1477.     SetKeyHandler(ebr_entry_close_book, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1478.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1479.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1480. }
  1481. /*****************************************************************************
  1482.  * FUNCTION
  1483.  *  ebr_highlight_case_in_sensitive_serach
  1484.  * DESCRIPTION
  1485.  *  Set highlight handler for Menu Ooptions
  1486.  * PARAMETERS
  1487.  *  void
  1488.  * RETURNS
  1489.  *  void
  1490.  *****************************************************************************/
  1491. void ebr_highlight_case_in_sensitive_serach(void)
  1492. {
  1493.     /*----------------------------------------------------------------*/
  1494.     /* Local Variables                                                */
  1495.     /*----------------------------------------------------------------*/
  1496.     /*----------------------------------------------------------------*/
  1497.     /* Code Body                                                      */
  1498.     /*----------------------------------------------------------------*/
  1499.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  1500.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  1501.     SetLeftSoftkeyFunction(ebr_ebook_search_string, KEY_EVENT_UP);
  1502.     SetKeyHandler(ebr_ebook_search_string, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1503.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1504.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1505. }
  1506. /*****************************************************************************
  1507.  * FUNCTION
  1508.  *  ebr_highlight_case_sensitive_serach
  1509.  * DESCRIPTION
  1510.  *  Set highlight handler for Menu Ooptions
  1511.  * PARAMETERS
  1512.  *  void
  1513.  * RETURNS
  1514.  *  void
  1515.  *****************************************************************************/
  1516. void ebr_highlight_case_sensitive_serach(void)
  1517. {
  1518.     /*----------------------------------------------------------------*/
  1519.     /* Local Variables                                                */
  1520.     /*----------------------------------------------------------------*/
  1521.     /*----------------------------------------------------------------*/
  1522.     /* Code Body                                                      */
  1523.     /*----------------------------------------------------------------*/
  1524.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  1525.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  1526.     SetLeftSoftkeyFunction(ebr_ebook_search_string, KEY_EVENT_UP);
  1527.     SetKeyHandler(ebr_ebook_search_string, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1528.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1529.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1530. }
  1531. /*****************************************************************************
  1532.  * FUNCTION
  1533.  *  ebr_entry_jump_to
  1534.  * DESCRIPTION
  1535.  *  Entry Function for jumpTo
  1536.  * PARAMETERS
  1537.  *  void
  1538.  * RETURNS
  1539.  *  void
  1540.  *****************************************************************************/
  1541. void ebr_entry_jump_to(void)
  1542. {
  1543.     /*----------------------------------------------------------------*/
  1544.     /* Local Variables                                                */
  1545.     /*----------------------------------------------------------------*/
  1546.     U8 *guiBuffer = NULL;
  1547.     U8 *inputBuffer;
  1548.     U16 nNumofItem = 4; /* Stores no of children in the submenu */
  1549.     U16 inputBufferSize;
  1550.     S16 item_index = 0;
  1551.     S32 book_size;
  1552.     S32 page_size;
  1553.     /*----------------------------------------------------------------*/
  1554.     /* Code Body                                                      */
  1555.     /*----------------------------------------------------------------*/
  1556.     book_size = ebr_frm_get_book_temp_size_from_nfo();
  1557.     page_size = ebr_frm_get_page_size();
  1558.     if (book_size <= page_size)
  1559.     {
  1560.         DisplayPopup((PU8) GetString(STR_BOOK_TOO_SMALL), IMG_GLOBAL_WARNING, 1, EBR_ST_NOTIFYDURATION, WARNING_TONE);
  1561.         return;
  1562.     }
  1563.     EntryNewScreen(EBOOK_JUMPTO_SCREEN_ID, ebr_exit_jump_to, NULL, NULL);
  1564.     guiBuffer = GetCurrGuiBuffer(EBOOK_JUMPTO_SCREEN_ID);
  1565.     inputBuffer = GetCurrNInputBuffer(EBOOK_JUMPTO_SCREEN_ID, &inputBufferSize);        /* added for inline edit history */
  1566.     InitializeCategory57Screen();
  1567.     ebr_fill_settings_inline_edit_struct((void*)&wgui_inline_items);
  1568.     g_ebook_app_cntx_p->ebook_jump_text_end_beg[EBR_JUMP_BEGIN] = (U8*) GetString(STR_JMP_BEG_EBOOK);
  1569.     g_ebook_app_cntx_p->ebook_jump_text_end_beg[EBR_JUMP_MIDDLE] = (U8*) GetString(STR_JMP_MID_EBOOK);
  1570.     g_ebook_app_cntx_p->ebook_jump_text_end_beg[EBR_JUMP_END] = (U8*) GetString(STR_JMP_END_EBOOK);
  1571.     SetInlineItemActivation(&wgui_inline_items[item_index], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1572.     SetInlineItemCaption(&wgui_inline_items[item_index], (PU8) (U8*) GetString(STR_JUMP_EBOOK));
  1573.     SetInlineItemActivation(&wgui_inline_items[++item_index], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1574.     SetInlineItemSelect(
  1575.         &wgui_inline_items[item_index],
  1576.         3,
  1577.         g_ebook_app_cntx_p->ebook_jump_text_end_beg,
  1578.         (S32*) & (g_ebookset_cntx_p->inlineHighligtItem) /* CurrSelect */ );
  1579.     SetInlineItemActivation(&wgui_inline_items[++item_index], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1580.     SetInlineItemCaption(&wgui_inline_items[item_index], (PU8) (U8*) GetString(STR_JMP_PERCENTAGE_EBOOK));
  1581.     SetInlineItemActivation(&wgui_inline_items[++item_index], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1582.     SetInlineItemDisplayOnly(&(wgui_inline_items[item_index]), (U8*) "1");
  1583.     RegisterHighlightHandler(ebr_highlight_jump_to_item);
  1584.     if (inputBuffer != NULL)
  1585.     {
  1586.         SetCategory57Data(wgui_inline_items, nNumofItem, inputBuffer);
  1587.     }
  1588.     if (GetInlineDoneFlag(guiBuffer) == 0 && g_ebook_app_cntx_p->percentage_val == '')
  1589.     {
  1590.         SetInlineDoneFlag(guiBuffer);
  1591.     }
  1592.     ShowCategory57Screen(
  1593.         STR_JUMP_EBOOK,
  1594.         GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
  1595.         STR_GLOBAL_OK,
  1596.         IMG_GLOBAL_OK,
  1597.         STR_GLOBAL_BACK,
  1598.         IMG_GLOBAL_BACK,
  1599.         nNumofItem,
  1600.         NULL,
  1601.         wgui_inline_items,
  1602.         0,
  1603.         guiBuffer);
  1604.     /* Register function for right soft key */
  1605.     SetCategory57RightSoftkeyFunctions(ebr_entry_jump_to_done_hndlr, GoBackHistory);
  1606. }
  1607. /*****************************************************************************
  1608.  * FUNCTION
  1609.  *  ebr_highlight_jump_to_item
  1610.  * DESCRIPTION
  1611.  *  Changes the Left soft key options in case of Percentage
  1612.  * PARAMETERS
  1613.  *  index       [IN]        
  1614.  * RETURNS
  1615.  *  void
  1616.  *****************************************************************************/
  1617. void ebr_highlight_jump_to_item(S32 index)
  1618. {
  1619.     /*----------------------------------------------------------------*/
  1620.     /* Local Variables                                                */
  1621.     /*----------------------------------------------------------------*/
  1622.     /*----------------------------------------------------------------*/
  1623.     /* Code Body                                                      */
  1624.     /*----------------------------------------------------------------*/
  1625.     if (index == 3)
  1626.     {
  1627.         ChangeLeftSoftkey(STR_GLOBAL_EDIT, 0);
  1628.         SetLeftSoftkeyFunction(ebr_entry_percentage_screen, KEY_EVENT_UP);
  1629.     }
  1630. }
  1631. /*****************************************************************************
  1632.  * FUNCTION
  1633.  *  ebr_entry_percentage_screen
  1634.  * DESCRIPTION
  1635.  *  Entry Function for Percentage Screen.
  1636.  * PARAMETERS
  1637.  *  void
  1638.  * RETURNS
  1639.  *  void
  1640.  *****************************************************************************/
  1641. void ebr_entry_percentage_screen(void)
  1642. {
  1643.     /*----------------------------------------------------------------*/
  1644.     /* Local Variables                                                */
  1645.     /*----------------------------------------------------------------*/
  1646.     U8 *guiBuffer;
  1647.     /*----------------------------------------------------------------*/
  1648.     /* Code Body                                                      */
  1649.     /*----------------------------------------------------------------*/
  1650.     EntryNewScreen(SCR_EBOOK_ENTER_PERCENTAGE_SCREEN_ID, NULL, ebr_entry_percentage_screen, NULL);
  1651.     guiBuffer = GetCurrGuiBuffer(SCR_EBOOK_ENTER_PERCENTAGE_SCREEN_ID);
  1652.     SetParentHandler(0);
  1653.     ShowCategory5Screen(
  1654.         STR_PERCENTAGE_SCREEN,
  1655.         GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
  1656.         (U16) STR_GLOBAL_OK,
  1657.         (U16) IMG_GLOBAL_OK,
  1658.         STR_GLOBAL_BACK,
  1659.         IMG_GLOBAL_BACK,
  1660.         INPUT_TYPE_NUMERIC,
  1661.         (U8*) g_ebook_app_cntx_p->percentage_val,
  1662.         (S32) EBR_MAX_EBOOK_PERCENTAGE_VALUE + 1,
  1663.         guiBuffer);
  1664.     SetLeftSoftkeyFunction(ebr_go_back_to_inline_edit_screen, KEY_EVENT_UP);
  1665.     SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1666. }
  1667. /*****************************************************************************
  1668.  * FUNCTION
  1669.  *  ebr_go_back_to_inline_edit_screen
  1670.  * DESCRIPTION
  1671.  *  Screen for the percentage editor.
  1672.  * PARAMETERS
  1673.  *  void
  1674.  * RETURNS
  1675.  *  void
  1676.  *****************************************************************************/
  1677. void ebr_go_back_to_inline_edit_screen(void)
  1678. {
  1679.     /*----------------------------------------------------------------*/
  1680.     /* Local Variables                                                */
  1681.     /*----------------------------------------------------------------*/
  1682.     U8 percentage_number_buffer[4] = {0};
  1683.     S16 percantage_val = 0;
  1684.     /*----------------------------------------------------------------*/
  1685.     /* Code Body                                                      */
  1686.     /*----------------------------------------------------------------*/
  1687.     UnicodeToAnsii((S8*) percentage_number_buffer, (S8*) g_ebook_app_cntx_p->percentage_val);
  1688.     percantage_val = atoi((char const*)percentage_number_buffer);
  1689.     if ((percantage_val > 0) && (percantage_val <= 100))
  1690.     {
  1691.     }
  1692.     else
  1693.     {
  1694.         /* DeleteNScrId(EBOOK_JUMPTO_DONE_SCREEN_ID); */
  1695.         DisplayPopup(
  1696.             (PU8) GetString(STR_WRONG_PERCENTAGE_VALUE),
  1697.             IMG_GLOBAL_ERROR,
  1698.             1,
  1699.             EBR_ST_NOTIFYDURATION,
  1700.             ERROR_TONE);
  1701.         return;
  1702.     }
  1703.     ebr_frm_jump_to_record(percantage_val, g_ebookset_cntx_p->inlineHighligtItem);
  1704.     DeleteUptoScrID(EBOOK_OPEN_SCREENID);
  1705.     GoBackHistory();
  1706. }
  1707. /*****************************************************************************
  1708.  * FUNCTION
  1709.  *  ebr_exit_jump_to
  1710.  * DESCRIPTION
  1711.  *  Exit function for Jump To
  1712.  * PARAMETERS
  1713.  *  void
  1714.  * RETURNS
  1715.  *  void
  1716.  *****************************************************************************/
  1717. void ebr_exit_jump_to(void)
  1718. {
  1719.     /*----------------------------------------------------------------*/
  1720.     /* Local Variables                                                */
  1721.     /*----------------------------------------------------------------*/
  1722.     history Scr;
  1723.     S16 nHistory = 0;
  1724.     U16 size;
  1725.     /*----------------------------------------------------------------*/
  1726.     /* Code Body                                                      */
  1727.     /*----------------------------------------------------------------*/
  1728.     CloseCategory57Screen();
  1729.     Scr.scrnID = EBOOK_JUMPTO_SCREEN_ID;
  1730.     CloseCategory57Screen();
  1731.     Scr.entryFuncPtr = ebr_entry_jump_to;
  1732.     pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) & nHistory);
  1733.     GetCategoryHistory(Scr.guiBuffer);
  1734.     size = (U16) GetCategory57DataSize();
  1735.     GetCategory57Data((U8*) Scr.inputBuffer);
  1736.     AddNHistory(Scr, size);
  1737. }
  1738. /*****************************************************************************
  1739.  * FUNCTION
  1740.  *  ebr_entry_jump_to_done_hndlr
  1741.  * DESCRIPTION
  1742.  *  Entry Function
  1743.  * PARAMETERS
  1744.  *  void
  1745.  * RETURNS
  1746.  *  void
  1747.  *****************************************************************************/
  1748. void ebr_entry_jump_to_done_hndlr(void)
  1749. {
  1750.     /*----------------------------------------------------------------*/
  1751.     /* Local Variables                                                */
  1752.     /*----------------------------------------------------------------*/
  1753.     S16 percantage_val = 0;
  1754.     /*----------------------------------------------------------------*/
  1755.     /* Code Body                                                      */
  1756.     /*----------------------------------------------------------------*/
  1757.     /* Call Exit Handler */
  1758.     if (IsScreenPresent(SCR_FMGR_APP_FILE_OPTION))
  1759.     {
  1760.         EntryNewScreen(EBOOK_JUMPTO_DONE_SCREEN_ID, NULL, NULL, NULL);
  1761.     }
  1762.     ebr_frm_jump_to_record(percantage_val, g_ebookset_cntx_p->inlineHighligtItem);
  1763.     DeleteUptoScrID(EBOOK_OPEN_SCREENID);
  1764.     GoBackHistory();
  1765. }
  1766. /*****************************************************************************
  1767.  * FUNCTION
  1768.  *  ebr_entry_close_book
  1769.  * DESCRIPTION
  1770.  *  Entry Function for Close
  1771.  * PARAMETERS
  1772.  *  void
  1773.  * RETURNS
  1774.  *  void
  1775.  *****************************************************************************/
  1776. void ebr_entry_close_book(void)
  1777. {
  1778.     /*----------------------------------------------------------------*/
  1779.     /* Local Variables                                                */
  1780.     /*----------------------------------------------------------------*/
  1781.     S16 nfo_id = 0;
  1782.     pBOOL is_src_app_is_file_manager;
  1783.     /*----------------------------------------------------------------*/
  1784.     /* Code Body                                                      */
  1785.     /*----------------------------------------------------------------*/
  1786.     ebr_frm_rwrite_into_nvram(nfo_id);
  1787.     is_src_app_is_file_manager = ebr_frm_ebook_exit();
  1788.     if (is_src_app_is_file_manager)
  1789.     {
  1790.         if (IsScreenPresent(SCR_FMGR_FILE_OPTION))
  1791.     {
  1792.             ebr_frm_remove_last_directory();
  1793.     }
  1794.         if (IsScreenPresent(SCR_FMGR_EXPLORER))
  1795.     {
  1796.             DeleteUptoScrID(SCR_FMGR_EXPLORER);
  1797.         }
  1798.             GoBackHistory();
  1799.         }
  1800.         else
  1801.         {
  1802.         if (IsScreenPresent(SCR_FMGR_EXPLORER))
  1803.         {
  1804.             DeleteUptoScrID(SCR_FMGR_EXPLORER);
  1805.             GoBackHistory();
  1806.         }
  1807.     }
  1808. }
  1809. /*****************************************************************************
  1810.  * FUNCTION
  1811.  *  ebr_entry_search
  1812.  * DESCRIPTION
  1813.  *  Set highlight handler for Menu Ooptions
  1814.  * PARAMETERS
  1815.  *  void
  1816.  * RETURNS
  1817.  *  void
  1818.  *****************************************************************************/
  1819. void ebr_entry_search(void)
  1820. {
  1821.     /*----------------------------------------------------------------*/
  1822.     /* Local Variables                                                */
  1823.     /*----------------------------------------------------------------*/
  1824.     U8 *guiBuffer;
  1825.     U16 nNumofItem;
  1826.     U16 nStrItemList[MAX_SUB_MENUS];
  1827.     U16 nImgIltemList[MAX_SUB_MENUS];
  1828.     /*----------------------------------------------------------------*/
  1829.     /* Code Body                                                      */
  1830.     /*----------------------------------------------------------------*/
  1831.     ebr_frm_reset_find_next_data();
  1832.     EntryNewScreen(EBOOK_SEARCH_SCREENID, NULL, ebr_entry_search, NULL);
  1833.     guiBuffer = GetCurrGuiBuffer(EBOOK_SEARCH_SCREENID);
  1834.     nNumofItem = GetNumOfChild(MENU_ID_EBK_FIND);
  1835.     GetSequenceStringIds(MENU_ID_EBK_FIND, nStrItemList);
  1836.     GetSequenceImageIds(MENU_ID_EBK_FIND, nImgIltemList);
  1837.     SetParentHandler(MENU_ID_EBK_FIND);
  1838.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1839.     ShowCategory52Screen(
  1840.         STR_FIND_EBOOK,
  1841.         GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
  1842.         STR_GLOBAL_OPTIONS,
  1843.         IMG_GLOBAL_OPTIONS,
  1844.         STR_GLOBAL_BACK,
  1845.         IMG_GLOBAL_BACK,
  1846.         nNumofItem,
  1847.         nStrItemList,
  1848.         (U16*) gIndexIconsImageList,
  1849.         0,
  1850.         0,
  1851.         0,
  1852.         guiBuffer);
  1853.     SetLeftSoftkeyFunction(ebr_ebook_search_string, KEY_EVENT_UP);
  1854.     SetKeyHandler(ebr_ebook_search_string, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1855.     SetRightSoftkeyFunction(go_back_to_settings_screen, KEY_EVENT_UP);
  1856.     SetKeyHandler(go_back_to_settings_screen, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1857. }
  1858. /*****************************************************************************
  1859.  * FUNCTION
  1860.  *  go_back_to_settings_screen
  1861.  * DESCRIPTION
  1862.  *  Go back to Setting screen
  1863.  * PARAMETERS
  1864.  *  void
  1865.  * RETURNS
  1866.  *  void
  1867.  *****************************************************************************/
  1868. void go_back_to_settings_screen(void)
  1869. {
  1870.     /*----------------------------------------------------------------*/
  1871.     /* Local Variables                                                */
  1872.     /*----------------------------------------------------------------*/
  1873.     /*----------------------------------------------------------------*/
  1874.     /* Code Body                                                      */
  1875.     /*----------------------------------------------------------------*/
  1876.     DeleteUptoScrID(EBOOK_BOOK_SETTINGS);
  1877.     GoBackHistory();
  1878. }
  1879. /*****************************************************************************
  1880.  * FUNCTION
  1881.  *  ebr_ebook_search_string
  1882.  * DESCRIPTION
  1883.  *  Set highlight handler for Menu Ooptions
  1884.  * PARAMETERS
  1885.  *  void
  1886.  * RETURNS
  1887.  *  void
  1888.  *****************************************************************************/
  1889. void ebr_ebook_search_string(void)
  1890. {
  1891.     /*----------------------------------------------------------------*/
  1892.     /* Local Variables                                                */
  1893.     /*----------------------------------------------------------------*/
  1894.     U8 *guiBuffer = NULL;
  1895.     /*----------------------------------------------------------------*/
  1896.     /* Code Body                                                      */
  1897.     /*----------------------------------------------------------------*/
  1898.     EntryNewScreen(EBOOK_SEARCH_STR_SCREENID, NULL, ebr_ebook_search_string, NULL);
  1899.     guiBuffer = GetCurrGuiBuffer(EBOOK_SEARCH_STR_SCREENID);
  1900.     ShowCategory5Screen(
  1901.         STR_FIND_EBOOK,
  1902.         GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
  1903.         STR_GLOBAL_OPTIONS,
  1904.         IMG_GLOBAL_OPTIONS,
  1905.         STR_GLOBAL_BACK,
  1906.         IMG_GLOBAL_BACK,
  1907.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE,
  1908.         (U8*) g_ebook_app_cntx_p->ebr_search_string_input,
  1909.         EBR_MAX_STR_SEARCH_LENGTH + 1,
  1910.         guiBuffer);
  1911.     SetLeftSoftkeyFunction(ebr_entry_search_edit_list, KEY_EVENT_UP);
  1912.     SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1913. }
  1914. /*****************************************************************************
  1915.  * FUNCTION
  1916.  *  ebr_entry_search_edit_list
  1917.  * DESCRIPTION
  1918.  *  Entry function for Add book mark
  1919.  * PARAMETERS
  1920.  *  void
  1921.  * RETURNS
  1922.  *  void
  1923.  *****************************************************************************/
  1924. void ebr_entry_search_edit_list(void)
  1925. {
  1926.     /*----------------------------------------------------------------*/
  1927.     /* Local Variables                                                */
  1928.     /*----------------------------------------------------------------*/
  1929.     U8 *guiBuffer;
  1930.     U16 ItemList[2];
  1931.     U16 nItems;
  1932. #ifdef __MMI_LANG_HINDI__
  1933.     pBOOL full_character;
  1934. #endif 
  1935.     /*----------------------------------------------------------------*/
  1936.     /* Code Body                                                      */
  1937.     /*----------------------------------------------------------------*/
  1938. #ifdef __MMI_LANG_HINDI__
  1939.     full_character = ebr_frm_check_for_full_characters((S16*) g_ebook_app_cntx_p->ebr_search_string_input);
  1940.     if (!full_character)
  1941.     {
  1942.         ebr_app_show_string_incomplete_pop_up();
  1943.         return;
  1944.     }
  1945. #endif /* __MMI_LANG_HINDI__ */ 
  1946.     EntryNewScreen(SCR_EDIT_BOOK_MARK_NAME, NULL, ebr_entry_search_edit_list, NULL);
  1947.     guiBuffer = GetCurrGuiBuffer(SCR_EDIT_BOOK_MARK_NAME);
  1948.     nItems = GetNumOfChild(MENU_EBOOK_EDIT_BOOK_MARK_NAME);
  1949.     GetSequenceStringIds(MENU_EBOOK_EDIT_BOOK_MARK_NAME, ItemList);
  1950.     RegisterHighlightHandler(ebr_get_add_search_string_options);
  1951.     ShowCategory52Screen(
  1952.         STR_GLOBAL_OPTIONS,
  1953.         GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
  1954.         STR_GLOBAL_OK,
  1955.         IMG_GLOBAL_OK,
  1956.         STR_GLOBAL_BACK,
  1957.         IMG_GLOBAL_BACK,
  1958.         nItems,
  1959.         ItemList,
  1960.         (PU16) gIndexIconsImageList,
  1961.         0,
  1962.         0,
  1963.         0,
  1964.         guiBuffer);
  1965.     /* Register function for left soft key */
  1966.     SetLeftSoftkeyFunction(ebr_get_add_search_string, KEY_EVENT_UP);
  1967.     /* Register function for right soft key */
  1968.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1969.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1970. }
  1971. /*****************************************************************************
  1972.  * FUNCTION
  1973.  *  ebr_get_add_search_string
  1974.  * DESCRIPTION
  1975.  *  Processing for Highlight Handler
  1976.  * PARAMETERS
  1977.  *  void
  1978.  * RETURNS
  1979.  *  void
  1980.  *****************************************************************************/
  1981. void ebr_get_add_search_string(void)
  1982. {
  1983.     /*----------------------------------------------------------------*/
  1984.     /* Local Variables                                                */
  1985.     /*----------------------------------------------------------------*/
  1986.     /*----------------------------------------------------------------*/
  1987.     /* Code Body                                                      */
  1988.     /*----------------------------------------------------------------*/
  1989.     switch (g_ebook_app_cntx_p->current_highlighted_item)
  1990.     {
  1991.         case 0:
  1992.             ebr_app_search_string();
  1993.             break;
  1994.         case 1: /* Input Methods */
  1995.             EntryInputMethodScreen();
  1996.             RegisterInputMethodScreenCloseFunction(GoBackHistoryFromInputMethod);
  1997.             break;
  1998.         default:
  1999.             break;
  2000.     }
  2001. }
  2002. /*****************************************************************************
  2003.  * FUNCTION
  2004.  *  ebr_get_add_search_string_options
  2005.  * DESCRIPTION
  2006.  *  Highlight Handler
  2007.  * PARAMETERS
  2008.  *  nIndex      [IN]        
  2009.  * RETURNS
  2010.  *  void
  2011.  *****************************************************************************/
  2012. void ebr_get_add_search_string_options(S32 nIndex)
  2013. {
  2014.     /*----------------------------------------------------------------*/
  2015.     /* Local Variables                                                */
  2016.     /*----------------------------------------------------------------*/
  2017.     /*----------------------------------------------------------------*/
  2018.     /* Code Body                                                      */
  2019.     /*----------------------------------------------------------------*/
  2020.     g_ebook_app_cntx_p->current_highlighted_item = nIndex;
  2021.     switch (nIndex)
  2022.     {
  2023.         case 0: /* Done */
  2024.             ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_UP);
  2025.             break;
  2026.         case 1: /* Input Methods */
  2027.             SetKeyHandler(ebr_get_add_search_string, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2028.             break;
  2029.         default:
  2030.             break;
  2031.     }
  2032. }
  2033. /*****************************************************************************
  2034.  * FUNCTION
  2035.  *  ebr_app_search_string
  2036.  * DESCRIPTION
  2037.  *  Function for Search
  2038.  * PARAMETERS
  2039.  *  void
  2040.  * RETURNS
  2041.  *  void
  2042.  *****************************************************************************/
  2043. void ebr_app_search_string(void)
  2044. {
  2045.     /*----------------------------------------------------------------*/
  2046.     /* Local Variables                                                */
  2047.     /*----------------------------------------------------------------*/
  2048.     ebr_app_search_type_enum search_type = GetCurrHiliteID();
  2049. S32 search_satus;
  2050.     S32 str_length = pfnUnicodeStrlen((const S8*)g_ebook_app_cntx_p->ebr_search_string_input);
  2051. if(!ebr_frm_check_file_exist())
  2052. {
  2053. go_back_to_bookshelf_screen();
  2054. ebr_app_display_pop_up_error_opening_book();
  2055. return;
  2056. }
  2057.     /*----------------------------------------------------------------*/
  2058.     /* Code Body                                                      */
  2059.     /*----------------------------------------------------------------*/
  2060.     if (str_length == 0)
  2061.     {
  2062.         ebr_frm_search_string_empty();
  2063.         return;
  2064.     }
  2065.     ebr_please_wait_actual_screen_2();
  2066.     search_satus = ebr_frm_search_string_algo(search_type, (S8*) g_ebook_app_cntx_p->ebr_search_string_input, MMI_FALSE);
  2067.     /* search not complete */
  2068.     if (search_satus == 0xFF)
  2069.     {
  2070.         return;
  2071.     }
  2072.     else if ((search_satus ==1) &&
  2073.         ((g_ebook_app_cntx_p->ebr_search_string_input[0] != '') || (g_ebook_app_cntx_p->ebr_search_string_input[1] != '' )))
  2074.     {
  2075.         if (!ebr_frm_get_auto_scroll_status())
  2076.         {
  2077.             gui_paging_reset_auto_scroll();
  2078.         }
  2079.         ebr_app_search_result_successful((pBOOL) search_type);
  2080.         ebr_app_delete_upto_open_book_screen_id();
  2081.         GoBackHistory();
  2082.         ebr_frm_set_data_for_display();
  2083.     }
  2084.     else
  2085.     {
  2086. if(search_satus==2)
  2087. {
  2088. ebr_app_search_result_invalid();
  2089. }
  2090. else
  2091. {
  2092.         ebr_app_search_result_unsucessfull();
  2093.     }
  2094. }
  2095. }