EbookSrc.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:169k
源码类别:
MTK
开发平台:
C/C++
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2005
- *
- * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
- * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
- * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
- *
- * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
- * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
- * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
- * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
- * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
- * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
- *
- *****************************************************************************/
- /*******************************************************************************
- * Filename:
- * ---------
- * EbookSrc.c
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- *
- *
- * Author:
- * -------
- * -------
- *
- *==============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * removed!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *==============================================================================
- *******************************************************************************/
- /**
- * Copyright Notice
- * ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
- * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
- * (It is illegal to remove this copyright notice from this software or any
- * portion of it)
- */
- /***************** Ebook Application implementation *********************/
- /**************************************************************
- FILENAME : EbookSrc.c
- PURPOSE : Ebook Appliocation
- REMARKS : nil
- AUTHOR : Rajat Kumar
- DATE :
- **************************************************************/
- /* */
- #include "StdC.h"
- #include "L4Dr1.h"
- #include "SettingProfile.h"
- #include "L4Dr.h"
- #include "wgui_categories.h"
- #include "MMI_features.h"
- #ifdef __MMI_EBOOK_READER__
- #include "gpioInc.h"
- #include "FileManagerDef.h"
- #include "FileManagerGprot.h"
- #include "EbookDefs.h"
- #include "EbookProt.h"
- #include "EbookManager.h"
- #include "CommonScreens.h"
- #include "DownloadDefs.h"
- #include "wgui_categories.h"
- #include "wgui_categories_inputs.h"
- #include "wgui_inputs.h"
- #include "drm_gprot.h"
- #include "SimDetectionDef.h"
- #include "USBDeviceGprot.h"
- #include "KeyBrd.h"
- /* Global Variables */
- extern pBOOL IsBackHistory;
- g_ebook_app_cntx g_ebook_app_context;
- g_ebook_app_cntx *g_ebook_app_cntx_p = &g_ebook_app_context;
- EBOOKSET_CNTX g_ebookset_cntx;
- EBOOKSET_CNTX *g_ebookset_cntx_p = &g_ebookset_cntx;
- gui_page_info_app ebook_frm_setting_struct;
- gui_page_info_app *ebook_frm_setting = &ebook_frm_setting_struct;
- /*****************************************************************************
- * FUNCTION
- * mmi_ebook_usb_mode_on
- * DESCRIPTION
- * For USB Power On Mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ebook_usb_mode_on(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* DisplayPopup((PU8)GetString(STR_NO_BOOK_MARK_PRESENT),IMG_GLOBAL_WARNING,1,EBR_ST_NOTIFYDURATION,ERROR_TONE); */
- g_ebookset_cntx_p->is_usb_plugged_in = TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ebook_usb_mode_off
- * DESCRIPTION
- * For USB Power On Mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ebook_usb_mode_off(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_ebookset_cntx_p->is_usb_plugged_in = FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_entry_book_shel_screen
- * DESCRIPTION
- * Entry function for book shelf screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_entry_book_shel_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- FMGR_FILTER filter;
- S16 local_nfo_id;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* DeleteScreenIfPresent(EBOOK_BOOK_SHELF_SETTINGS_SCREEN_ID); */
- if (g_ebookset_cntx_p->is_usb_plugged_in == TRUE)
- {
- #ifdef MMI_ON_HARDWARE_P
- #ifdef __USB_IN_NORMAL_MODE__
- mmi_usb_app_unavailable_popup(0);
- #endif
- #else /* MMI_ON_HARDWARE_P */
- DisplayPopup((PU8) GetString(STR_USB_IS_PLUGGED_IN), IMG_GLOBAL_WARNING, 1, EBR_ST_NOTIFYDURATION, ERROR_TONE);
- #endif /* MMI_ON_HARDWARE_P */
- return;
- }
- ebr_frm_set_src_application_type();
- ebr_frm_delete_unused_nfo_file();
- local_nfo_id = ebr_frm_read_from_nvram();
- ebr_frm_check_is_nfo_file_exist(local_nfo_id);
- local_nfo_id = ebr_frm_read_from_nvram();
- if (local_nfo_id > 0)
- {
- gdi_layer_lock_frame_buffer();
- }
- {
- FMGR_FILTER_INIT(&filter);
- FMGR_FILTER_SET(&filter, FMGR_TYPE_EBOOK_TXT);
- FMGR_FILTER_SET(&filter, FMGR_TYPE_EBOOK_PDB);
- mmi_fmgr_select_path_and_enter(
- APP_EBOOK,
- FMGR_SELECT_BROWSE,
- filter,
- (PS8) ebr_frm_get_path_for_bookshelf(),
- ebr_book_file_callback);
- }
- if (local_nfo_id > 0)
- {
- gdi_layer_unlock_frame_buffer();
- ebr_frm_set_file_name(local_nfo_id);
- ebr_entry_open_book();
- }
- ClearKeyHandler(KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * InitEbookApp
- * DESCRIPTION
- * Set highlight handler for Menu Ooptions
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void InitEbookApp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetHiliteHandler(MENU_ID_EBK_RFS_OPTION, ebr_highlight_refresh_book_shelf);
- SetHiliteHandler(MENU_ID_EBK_RFS_OPTION_LIMITED, ebr_highlight_refresh_book_shelf);
- SetHiliteHandler(MENU_ID_EBK_OPEN, ebr_highlight_open_ebook);
- SetHiliteHandler(MENU_ID_EBK_INFO, ebr_higlight_book_info);
- SetHiliteHandler(MENU_ID_EBK_DELETE, ebr_highlight_delete_ebook);
- SetHiliteHandler(MENU_ID_EBK_HELP, ebr_highlight_help);
- SetHiliteHandler(MENU_ID_EBK_SETTINGS, ebr_highlight_book_shelf_settings);
- SetHiliteHandler(MENU_ID_EBK_SETTINGS_LIMITED, ebr_highlight_book_shelf_settings);
- SetHiliteHandler(MENU_ID_EBK_FIND, ebr_highlight_search);
- SetHiliteHandler(MENU_ID_EBK_FIND_NEXT, ebr_highlight_search_next);
- SetHiliteHandler(MENU_ID_EBK_JUMP, ebr_highlight_jump_to);
- SetHiliteHandler(MENU_ID_EBK_GOTO_BOOKMARK, ebr_highlight_goto_book_mark);
- SetHiliteHandler(MENU_ID_EBK_REMOVE_BOOKMARK, ebr_highlight_remove_book_mark);
- SetHiliteHandler(MENU_ID_EBK_ADD_BOOKMARK, ebr_highlight_add_book_mark);
- SetHiliteHandler(MENU_ID_EBK_BOOK_SETTINGS, ebr_highlight_book_settings);
- SetHiliteHandler(MENU_ID_EBK_BOOK_INFO, ebr_highlight_open_book_info);
- SetHiliteHandler(MENU_ID_EBK_CLOSE, ebr_close_book);
- SetHiliteHandler(MENU_ID_EBK_CASE_SENSITIVE, ebr_highlight_case_sensitive_serach);
- SetHiliteHandler(MENU_ID_EBK_CASE_INSENSITIVE, ebr_highlight_case_in_sensitive_serach);
- SetHiliteHandler(MENU_ID_EBK_BOOK_RESTORE_DEFAULT, ebr_highlight_ebk_restore_default);
- SetHiliteHandler(MENU_ID_EBK_DELETE_ALL, ebr_highlight_delete_all);
- SetHiliteHandler(MENU_ID_EBK_RESTORE_DEFAULT, ebr_highlight_book_shelf_restore_default);
- memset(g_ebook_app_cntx_p->ebr_search_string_input, 0, sizeof(g_ebook_app_cntx_p->ebr_search_string_input));
- ebr_frm_init();
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_book_file_callback
- * DESCRIPTION
- * Call back for Book shelf Screen
- * PARAMETERS
- * fullname [IN]
- * is_short [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_book_file_callback(void *fullname, int is_short)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_show_limit_book_shelf_option
- * DESCRIPTION
- * Options for Limited Book Shelf
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_show_limit_book_shelf_option(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U16 nNumofItem;
- U16 nStrItemList[MAX_SUB_MENUS];
- U16 nImgIltemList[MAX_SUB_MENUS];
- U8 *hintList[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(EBOOK_OPEN_OPTION_SCREENID, NULL, ebr_show_limit_book_shelf_option, NULL);
- guiBuffer = GetCurrGuiBuffer(EBOOK_OPEN_OPTION_SCREENID);
- nNumofItem = GetNumOfChild(MENU_ID_EBK_LIMITED_BOOKSHELF_OPTION);
- GetSequenceStringIds(MENU_ID_EBK_LIMITED_BOOKSHELF_OPTION, nStrItemList);
- GetSequenceImageIds(MENU_ID_EBK_LIMITED_BOOKSHELF_OPTION, nImgIltemList);
- SetParentHandler(MENU_ID_EBK_LIMITED_BOOKSHELF_OPTION);
- /* Construct List To Show Hint */
- ConstructHintsList(MENU_ID_EBK_BOOKSHELF_OPTION, hintList);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_GLOBAL_OPTIONS,
- GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- hintList,
- 0,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ebook_get_menuId
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- *
- *****************************************************************************/
- U16 mmi_ebook_get_menuId(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 count_no_of_nfo_file;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- count_no_of_nfo_file = ebr_frm_get_total_countof_nfo_file();
- ebr_frm_write_default_value_for_nfo_id_in_nvram();
- if (count_no_of_nfo_file <= 0)
- {
- return MENU_ID_EBK_LIMITED_BOOKSHELF_OPTION;
- }
- else
- {
- return MENU_ID_EBK_BOOKSHELF_OPTION;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_entry_refresh_book_shelf
- * DESCRIPTION
- * Refreshed Book Shelf Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_entry_refresh_book_shelf(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ebr_please_wait_actual_screen_2();
- ebr_frm_entry_refresh_book_shelf();
- DisplayPopup(
- (PU8) GetString(STR_BOOK_SHELF_REFRESHED),
- IMG_GLOBAL_ACTIVATED,
- 1,
- EBR_ST_NOTIFYDURATION,
- SUCCESS_TONE);
- if (IsScreenPresent(SCR_FMGR_APP_FILE_OPTION))
- {
- DeleteNScrId(SCR_FMGR_APP_FILE_OPTION);
- }
- else
- {
- DeleteNScrId(EBOOK_OPEN_OPTION_SCREENID);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_highlight_refresh_book_shelf
- * DESCRIPTION
- * Set highlight handler for Menu Ooptions
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_highlight_refresh_book_shelf(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 1 Change left soft key icon and label */
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- /* 2 Change right soft key icon and label */
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- /* 3 Register function for left soft key */
- SetLeftSoftkeyFunction(ebr_entry_refresh_book_shelf, KEY_EVENT_UP);
- /* 4 Register function for right soft key */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_highlight_ebk_restore_default
- * DESCRIPTION
- * Set highlight handler for Restore Default
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_highlight_ebk_restore_default(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetLeftSoftkeyFunction(ebr_app_restore_default_book_settings, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_highlight_delete_all
- * DESCRIPTION
- * Set highlight handler Delete All
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_highlight_delete_all(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- highlight_fmgr_delete_all_file();
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_highlight_book_shelf_restore_default
- * DESCRIPTION
- * Set highlight handler for Restore Default
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_highlight_book_shelf_restore_default(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetLeftSoftkeyFunction(ebr_app_restore_default_book_shelf_settings, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_highlight_open_ebook
- * DESCRIPTION
- * Set highlight handler for Open book
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_highlight_open_ebook(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- FMGR_FILE_INFO_STRUCT file_info;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_fmgr_kernel_get_file_info(mmi_fmgr_kernel_get_cur_idx(), &file_info);
- ebr_set_selected_file_name(&file_info);
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetLeftSoftkeyFunction(ebr_entry_open_book, KEY_EVENT_UP);
- SetKeyHandler(ebr_entry_open_book, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_higlight_book_info
- * DESCRIPTION
- * Set highlight handler for Book Info
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_higlight_book_info(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetLeftSoftkeyFunction(ebr_entry_book_info, KEY_EVENT_UP);
- SetKeyHandler(ebr_entry_book_info, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_highlight_delete_ebook
- * DESCRIPTION
- * Set highlight handler for Delete Book
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_highlight_delete_ebook(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetLeftSoftkeyFunction(ebr_entry_delete_book_popup, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_entry_delete_book_popup
- * DESCRIPTION
- * Display popUp for Delete and confirm deletion
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_entry_delete_book_popup(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_DELETE_EBOOK_CONFIRM),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetLeftSoftkeyFunction(ebr_entry_delete_ebook, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_highlight_help
- * DESCRIPTION
- * Set highlight handler for Help
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_highlight_help(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetLeftSoftkeyFunction(ebr_entry_help, KEY_EVENT_UP);
- SetKeyHandler(ebr_entry_help, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_highlight_book_shelf_settings
- * DESCRIPTION
- * Set highlight handler for Settings
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_highlight_book_shelf_settings(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetLeftSoftkeyFunction(ebr_entry_settings, KEY_EVENT_UP);
- SetKeyHandler(ebr_entry_settings, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- g_ebook_app_cntx_p->ebr_set_local_setting_flag = 0;
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_highlight_search
- * DESCRIPTION
- * Set highlight handler for Search
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_highlight_search(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetLeftSoftkeyFunction(ebr_entry_search, KEY_EVENT_UP);
- SetKeyHandler(ebr_entry_search, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_highlight_search_next
- * DESCRIPTION
- * Set highlight handler for find next Search
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_highlight_search_next(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetLeftSoftkeyFunction(ebr_app_search_string_next_from_menu, KEY_EVENT_UP);
- SetKeyHandler(ebr_app_search_string_next_from_menu, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_search_result_successful
- * DESCRIPTION
- * Set the flag
- * PARAMETERS
- * result [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_search_result_successful(pBOOL result)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_ebook_app_cntx_p->ebr_search_found_next_flag = result;
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_search_string_next_from_menu
- * DESCRIPTION
- * Shows the Find NExt menu option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_search_string_next_from_menu(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_LANG_HINDI__
- pBOOL full_character;
- #endif
- S32 search_satus;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if(!ebr_frm_check_file_exist())
- {
- go_back_to_bookshelf_screen();
- ebr_app_display_pop_up_error_opening_book();
- return;
- }
- ebr_please_wait_actual_screen_2();
- #ifdef __MMI_LANG_HINDI__
- full_character = ebr_frm_check_for_full_characters((S16*) g_ebook_app_cntx_p->ebr_search_string_input);
- if (!full_character)
- {
- ebr_app_show_string_incomplete_pop_up();
- return;
- }
- #endif /* __MMI_LANG_HINDI__ */
- search_satus = ebr_frm_search_string_algo_find_next();
- if (search_satus==1)
- {
- ebr_app_search_result_successful(TRUE);
- ebr_app_delete_upto_open_book_screen_id();
- GoBackHistory();
- ebr_frm_set_data_for_display();
- }
- else
- {
- if(search_satus==2)
- {
- ebr_app_search_result_invalid();
- }
- else
- {
- ebr_app_search_result_unsucessfull();
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_search_string_next
- * DESCRIPTION
- * called when find next is executed
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_search_string_next(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_LANG_HINDI__
- pBOOL full_character;
- #endif
- S32 search_satus;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ebr_frm_set_find_next_flag();
- if(!ebr_frm_check_file_exist())
- {
- go_back_to_bookshelf_screen();
- ebr_app_display_pop_up_error_opening_book();
- return;
- }
- ebr_please_wait_actual_screen_2();
- #ifdef __MMI_LANG_HINDI__
- full_character = ebr_frm_check_for_full_characters((S16*) g_ebook_app_cntx_p->ebr_search_string_input);
- if (!full_character)
- {
- ebr_app_show_string_incomplete_pop_up();
- return;
- }
- #endif /* __MMI_LANG_HINDI__ */
- search_satus = ebr_frm_search_string_algo_find_next();
- if (search_satus == 0xFF)
- {
- return;
- }
- else if (search_satus==1)
- {
- ebr_app_search_result_successful(TRUE);
- g_ebook_app_cntx_p->enable_screen_exit = 0;
- EntryNewScreen(SCR_ID_EBOOK_WAITSCREEN, NULL, NULL, NULL);
- g_ebook_app_cntx_p->enable_screen_exit = 1;
- ebr_app_delete_upto_open_book_screen_id();
- GoBackHistory();
- ebr_frm_set_data_for_display();
- }
- else
- {
- if(search_satus==2)
- {
- ebr_app_search_result_invalid();
- }
- else
- {
- ebr_app_search_result_unsucessfull();
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_highlight_jump_to
- * DESCRIPTION
- * Set highlight handler for Menu Ooptions
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_highlight_jump_to(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetLeftSoftkeyFunction(ebr_entry_jump_to, KEY_EVENT_UP);
- SetKeyHandler(ebr_entry_jump_to, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- memset(g_ebook_app_cntx_p->percentage_val, 0, (EBR_MAX_EBOOK_PERCENTAGE_VALUE + 1) * ENCODING_LENGTH);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_pre_entry_jump_to
- * DESCRIPTION
- * Pre Entry function for jumpTo
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_pre_entry_jump_to(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(g_ebook_app_cntx_p->percentage_val, 0, (EBR_MAX_EBOOK_PERCENTAGE_VALUE + 1) * ENCODING_LENGTH);
- ebr_entry_jump_to();
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_highlight_goto_book_mark
- * DESCRIPTION
- * Set highlight handler for Menu Ooptions
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_highlight_goto_book_mark(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetLeftSoftkeyFunction(ebr_entry_goto_book_mark, KEY_EVENT_UP);
- SetKeyHandler(ebr_entry_goto_book_mark, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_highlight_remove_book_mark
- * DESCRIPTION
- * Set highlight handler for Menu Ooptions
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_highlight_remove_book_mark(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetLeftSoftkeyFunction(ebr_entry_remove_book_mark, KEY_EVENT_UP);
- SetKeyHandler(ebr_entry_remove_book_mark, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_entry_remove_book_mark
- * DESCRIPTION
- * Entry Function for Remove Bookmark
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_entry_remove_book_mark(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- S16 no_of_book_marks = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if(!ebr_frm_check_file_exist())
- {
- go_back_to_bookshelf_screen();
- ebr_app_display_pop_up_error_opening_book();
- return;
- }
- no_of_book_marks = ebr_frm_get_count_of_book_marks();
- EntryNewScreen(EBOOK_REMOVE_BOOKMARK_SCREENID, NULL, ebr_entry_remove_book_mark, NULL);
- guiBuffer = GetCurrGuiBuffer(EBOOK_REMOVE_BOOKMARK_SCREENID);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- SetParentHandler(0);
- if (no_of_book_marks == 0)
- { /* ShowCategory184Screen(STR_RMV_BOOKMARK_EBOOK, (U16)NULL,
- 0, 0,
- STR_GLOBAL_BACK, IMG_GLOBAL_BACK,
- no_of_book_marks,ebr_get_book_mark_name_list,
- NULL, 0, guiBuffer); */
- DisplayPopup(
- (PU8) GetString(STR_NO_BOOK_MARK_PRESENT),
- IMG_GLOBAL_WARNING,
- 1,
- EBR_ST_NOTIFYDURATION,
- ERROR_TONE);
- DeleteNScrId(EBOOK_REMOVE_BOOKMARK_SCREENID);
- return;
- /* GoBackHistory(); */
- }
- else
- {
- ShowCategory184Screen(
- STR_RMV_BOOKMARK_EBOOK,
- GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- no_of_book_marks,
- ebr_get_book_mark_name_list,
- NULL,
- 0,
- guiBuffer);
- }
- /* register LSK and right key handlers */
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(ebr_delete_bookmark, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_delete_bookmark
- * DESCRIPTION
- * PopuUp display for deletion of BookMark
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_delete_bookmark(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if(!ebr_frm_check_file_exist())
- {
- go_back_to_bookshelf_screen();
- ebr_app_display_pop_up_error_opening_book();
- return;
- }
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_DELETE_BOOK_MARK),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetLeftSoftkeyFunction(ebr_remove_selected_bookmark, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_entry_goto_book_mark
- * DESCRIPTION
- * Entry Function for Go to BookMark
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_entry_goto_book_mark(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- S16 no_of_book_marks = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if(!ebr_frm_check_file_exist())
- {
- go_back_to_bookshelf_screen();
- ebr_app_display_pop_up_error_opening_book();
- return;
- }
- no_of_book_marks = ebr_frm_get_count_of_book_marks();
- EntryNewScreen(EBOOK_GOTO_BOOKMARK_SCREENID, NULL, ebr_entry_goto_book_mark, NULL);
- guiBuffer = GetCurrGuiBuffer(EBOOK_GOTO_BOOKMARK_SCREENID);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- SetParentHandler(0);
- if (no_of_book_marks == 0)
- { /* ShowCategory184Screen(STR_GOTO_BOOKMARK_EBOOK, (U16)NULL,
- 0, 0,
- STR_GLOBAL_BACK, IMG_GLOBAL_BACK,
- no_of_book_marks ,ebr_get_book_mark_name_list,
- NULL, 0, guiBuffer); */
- DisplayPopup(
- (PU8) GetString(STR_NO_BOOK_MARK_PRESENT),
- IMG_GLOBAL_WARNING,
- 1,
- EBR_ST_NOTIFYDURATION,
- ERROR_TONE);
- DeleteNScrId(EBOOK_GOTO_BOOKMARK_SCREENID);
- return;
- }
- else
- {
- ShowCategory184Screen(
- STR_GOTO_BOOKMARK_EBOOK,
- GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- no_of_book_marks,
- ebr_get_book_mark_name_list,
- NULL,
- 0,
- guiBuffer);
- }
- /* register LSK and right key handlers */
- SetLeftSoftkeyFunction(ebr_goto_selected_bookmark, KEY_EVENT_UP);
- SetKeyHandler(ebr_goto_selected_bookmark, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_goto_selected_bookmark
- * DESCRIPTION
- * Entry Function for Go to BookMark
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_goto_selected_bookmark(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 selected_index = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- selected_index = GetCurrHiliteID();
- if(!ebr_frm_check_file_exist())
- {
- go_back_to_bookshelf_screen();
- ebr_app_display_pop_up_error_opening_book();
- return;
- }
- ebr_frm_get_record_for_bookmark(selected_index);
- DeleteUptoScrID(EBOOK_OPEN_SCREENID);
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_remove_selected_bookmark
- * DESCRIPTION
- * Exit function for Delete book mark
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_remove_selected_bookmark(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ebr_frm_remove_bookmark(GetCurrHiliteID());
- if (IsScreenPresent(EBOOK_BOOK_SETTINGS_SCREENID))
- {
- DeleteUptoScrID(EBOOK_BOOK_SETTINGS_SCREENID);
- }
- else
- {
- DeleteNScrId(EBOOK_REMOVE_BOOKMARK_SCREENID);
- }
- DisplayPopup((PU8) GetString(STR_DELETED), IMG_GLOBAL_ACTIVATED, 1, EBR_ST_NOTIFYDURATION, SUCCESS_TONE);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_highlight_add_book_mark
- * DESCRIPTION
- * Set highlight handler for Menu Ooptions
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_highlight_add_book_mark(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetLeftSoftkeyFunction(ebr_entry_add_book_mark, KEY_EVENT_UP);
- SetKeyHandler(ebr_entry_add_book_mark, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_entry_add_book_mark
- * DESCRIPTION
- * Entry function for Add book mark
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_entry_add_book_mark(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- U8 ebr_bookmark_name[EBR_FRM_MAX_BOOKMARK_NAME_SIZE];
- U8 ebr_bookmark_name_ucs[EBR_FRM_MAX_BOOKMARK_NAME_SIZE];
- S16 no_of_book_marks = 0;
- UI_string_type s[EBR_MAX_SETTINGS_VAL_ENCD_TYPE];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if(!ebr_frm_check_file_exist())
- {
- go_back_to_bookshelf_screen();
- ebr_app_display_pop_up_error_opening_book();
- return;
- }
- no_of_book_marks = ebr_frm_get_count_of_book_marks();
- if (no_of_book_marks >= EBR_FRM_MAX_NO_OF_BOOKMARKS)
- {
- /* Display Pop up that no more BookMarks can be added */
- if (IsScreenPresent(EBOOK_BOOK_SETTINGS_SCREENID))
- {
- DeleteUptoScrID(EBOOK_BOOK_SETTINGS_SCREENID);
- }
- DisplayPopup((PU8) GetString(STR_MAX_BOOK_MARK), IMG_GLOBAL_WARNING, 1, EBR_ST_NOTIFYDURATION, ERROR_TONE);
- return;
- }
- EntryNewScreen(EBOOK_ADD_BOOK_MARK_SCREEN_ID, NULL, ebr_entry_add_book_mark, NULL);
- guiBuffer = GetCurrGuiBuffer(EBOOK_ADD_BOOK_MARK_SCREEN_ID);
- if (guiBuffer == NULL)
- {
- strcpy((char*)ebr_bookmark_name, (const S8*)"Bookmark");
- gui_itoa(no_of_book_marks, (UI_string_type) s, EBR_MAX_SETTINGS_VAL_ENCD_TYPE);
- strcat((S8*) ebr_bookmark_name, (const S8*)" ");
- strcat((S8*) ebr_bookmark_name, (const S8*)s);
- AnsiiToUnicodeString((S8*) ebr_bookmark_name_ucs, (S8*) ebr_bookmark_name);
- pfnUnicodeStrcpy((S8*) g_ebook_app_cntx_p->book_mark_name, (S8*) ebr_bookmark_name_ucs);
- }
- ShowCategory5Screen(
- STR_ADD_BOOKMARK_EBOOK,
- GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
- STR_GLOBAL_OPTIONS,
- IMG_GLOBAL_OPTIONS,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE,
- g_ebook_app_cntx_p->book_mark_name,
- EBR_FRM_MAX_BOOKMARK_NAME_SIZE + 1,
- guiBuffer);
- SetLeftSoftkeyFunction(ebr_entry_book_mark_edit_list, KEY_EVENT_UP);
- SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_entry_book_mark_edit_list
- * DESCRIPTION
- * Entry function for Add book mark
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_entry_book_mark_edit_list(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U16 ItemList[2];
- U16 nItems;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_EDIT_BOOK_MARK_NAME, NULL, ebr_entry_book_mark_edit_list, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_EDIT_BOOK_MARK_NAME);
- nItems = GetNumOfChild(MENU_EBOOK_EDIT_BOOK_MARK_NAME);
- GetSequenceStringIds(MENU_EBOOK_EDIT_BOOK_MARK_NAME, ItemList);
- RegisterHighlightHandler(ebr_get_add_book_mark_options);
- ShowCategory52Screen(
- STR_GLOBAL_OPTIONS,
- GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nItems,
- ItemList,
- (PU16) gIndexIconsImageList,
- 0,
- 0,
- 0,
- guiBuffer);
- /* Register function for left soft key */
- SetLeftSoftkeyFunction(ebr_get_add_book_mark, KEY_EVENT_UP);
- /* Register function for right soft key */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_get_add_book_mark
- * DESCRIPTION
- * Processing for Highlight Handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_get_add_book_mark(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (g_ebook_app_cntx_p->current_highlighted_item)
- {
- case 0:
- ebr_frm_add_book_mark_pre_entry();
- break;
- case 1: /* Input Methods */
- EntryInputMethodScreen();
- RegisterInputMethodScreenCloseFunction(GoBackHistoryFromInputMethod);
- break;
- default:
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_get_add_book_mark_options
- * DESCRIPTION
- * Highlight Handler
- * PARAMETERS
- * nIndex [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_get_add_book_mark_options(S32 nIndex)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_ebook_app_cntx_p->current_highlighted_item = nIndex;
- switch (nIndex)
- {
- case 0: /* Done */
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_UP);
- break;
- case 1: /* Input Methods */
- SetKeyHandler(ebr_get_add_book_mark, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- break;
- default:
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * GoBackHistoryFromInputMethod
- * DESCRIPTION
- * Go back History
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void GoBackHistoryFromInputMethod(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GoBacknHistory(1);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_get_book_mark_name
- * DESCRIPTION
- * Get book mark name
- * PARAMETERS
- * void
- * RETURNS
- * S8*
- *****************************************************************************/
- S8 *ebr_get_book_mark_name(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (S8*) g_ebook_app_cntx_p->book_mark_name;
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_highlight_book_settings
- * DESCRIPTION
- * Set highlight handler for Menu Ooptions
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_highlight_book_settings(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetLeftSoftkeyFunction(ebr_entry_settings, KEY_EVENT_UP);
- SetKeyHandler(ebr_entry_settings, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- g_ebook_app_cntx_p->ebr_set_local_setting_flag = 1;
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_highlight_open_book_info
- * DESCRIPTION
- * Set highlight handler for Menu Ooptions
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_highlight_open_book_info(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetLeftSoftkeyFunction(ebr_entry_book_info, KEY_EVENT_UP);
- SetKeyHandler(ebr_entry_book_info, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_close_book
- * DESCRIPTION
- * Set highlight handler for Menu Ooptions
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_close_book(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetLeftSoftkeyFunction(ebr_entry_close_book, KEY_EVENT_UP);
- SetKeyHandler(ebr_entry_close_book, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_highlight_case_in_sensitive_serach
- * DESCRIPTION
- * Set highlight handler for Menu Ooptions
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_highlight_case_in_sensitive_serach(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetLeftSoftkeyFunction(ebr_ebook_search_string, KEY_EVENT_UP);
- SetKeyHandler(ebr_ebook_search_string, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_highlight_case_sensitive_serach
- * DESCRIPTION
- * Set highlight handler for Menu Ooptions
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_highlight_case_sensitive_serach(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetLeftSoftkeyFunction(ebr_ebook_search_string, KEY_EVENT_UP);
- SetKeyHandler(ebr_ebook_search_string, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_entry_jump_to
- * DESCRIPTION
- * Entry Function for jumpTo
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_entry_jump_to(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- U8 *inputBuffer;
- U16 nNumofItem = 4; /* Stores no of children in the submenu */
- U16 inputBufferSize;
- S16 item_index = 0;
- S32 book_size;
- S32 page_size;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- book_size = ebr_frm_get_book_temp_size_from_nfo();
- page_size = ebr_frm_get_page_size();
- if (book_size <= page_size)
- {
- DisplayPopup((PU8) GetString(STR_BOOK_TOO_SMALL), IMG_GLOBAL_WARNING, 1, EBR_ST_NOTIFYDURATION, WARNING_TONE);
- return;
- }
- EntryNewScreen(EBOOK_JUMPTO_SCREEN_ID, ebr_exit_jump_to, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(EBOOK_JUMPTO_SCREEN_ID);
- inputBuffer = GetCurrNInputBuffer(EBOOK_JUMPTO_SCREEN_ID, &inputBufferSize); /* added for inline edit history */
- InitializeCategory57Screen();
- ebr_fill_settings_inline_edit_struct((void*)&wgui_inline_items);
- g_ebook_app_cntx_p->ebook_jump_text_end_beg[EBR_JUMP_BEGIN] = (U8*) GetString(STR_JMP_BEG_EBOOK);
- g_ebook_app_cntx_p->ebook_jump_text_end_beg[EBR_JUMP_MIDDLE] = (U8*) GetString(STR_JMP_MID_EBOOK);
- g_ebook_app_cntx_p->ebook_jump_text_end_beg[EBR_JUMP_END] = (U8*) GetString(STR_JMP_END_EBOOK);
- SetInlineItemActivation(&wgui_inline_items[item_index], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemCaption(&wgui_inline_items[item_index], (PU8) (U8*) GetString(STR_JUMP_EBOOK));
- SetInlineItemActivation(&wgui_inline_items[++item_index], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemSelect(
- &wgui_inline_items[item_index],
- 3,
- g_ebook_app_cntx_p->ebook_jump_text_end_beg,
- (S32*) & (g_ebookset_cntx_p->inlineHighligtItem) /* CurrSelect */ );
- SetInlineItemActivation(&wgui_inline_items[++item_index], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemCaption(&wgui_inline_items[item_index], (PU8) (U8*) GetString(STR_JMP_PERCENTAGE_EBOOK));
- SetInlineItemActivation(&wgui_inline_items[++item_index], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemDisplayOnly(&(wgui_inline_items[item_index]), (U8*) "1");
- RegisterHighlightHandler(ebr_highlight_jump_to_item);
- if (inputBuffer != NULL)
- {
- SetCategory57Data(wgui_inline_items, nNumofItem, inputBuffer);
- }
- if (GetInlineDoneFlag(guiBuffer) == 0 && g_ebook_app_cntx_p->percentage_val == ' ')
- {
- SetInlineDoneFlag(guiBuffer);
- }
- ShowCategory57Screen(
- STR_JUMP_EBOOK,
- GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- NULL,
- wgui_inline_items,
- 0,
- guiBuffer);
- /* Register function for right soft key */
- SetCategory57RightSoftkeyFunctions(ebr_entry_jump_to_done_hndlr, GoBackHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_highlight_jump_to_item
- * DESCRIPTION
- * Changes the Left soft key options in case of Percentage
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_highlight_jump_to_item(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (index == 3)
- {
- ChangeLeftSoftkey(STR_GLOBAL_EDIT, 0);
- SetLeftSoftkeyFunction(ebr_entry_percentage_screen, KEY_EVENT_UP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_entry_percentage_screen
- * DESCRIPTION
- * Entry Function for Percentage Screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_entry_percentage_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_EBOOK_ENTER_PERCENTAGE_SCREEN_ID, NULL, ebr_entry_percentage_screen, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_EBOOK_ENTER_PERCENTAGE_SCREEN_ID);
- SetParentHandler(0);
- ShowCategory5Screen(
- STR_PERCENTAGE_SCREEN,
- GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
- (U16) STR_GLOBAL_OK,
- (U16) IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- INPUT_TYPE_NUMERIC,
- (U8*) g_ebook_app_cntx_p->percentage_val,
- (S32) EBR_MAX_EBOOK_PERCENTAGE_VALUE + 1,
- guiBuffer);
- SetLeftSoftkeyFunction(ebr_go_back_to_inline_edit_screen, KEY_EVENT_UP);
- SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_go_back_to_inline_edit_screen
- * DESCRIPTION
- * Screen for the percentage editor.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_go_back_to_inline_edit_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 percentage_number_buffer[4] = {0};
- S16 percantage_val = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UnicodeToAnsii((S8*) percentage_number_buffer, (S8*) g_ebook_app_cntx_p->percentage_val);
- percantage_val = atoi((char const*)percentage_number_buffer);
- if ((percantage_val > 0) && (percantage_val <= 100))
- {
- }
- else
- {
- /* DeleteNScrId(EBOOK_JUMPTO_DONE_SCREEN_ID); */
- DisplayPopup(
- (PU8) GetString(STR_WRONG_PERCENTAGE_VALUE),
- IMG_GLOBAL_ERROR,
- 1,
- EBR_ST_NOTIFYDURATION,
- ERROR_TONE);
- return;
- }
- ebr_frm_jump_to_record(percantage_val, g_ebookset_cntx_p->inlineHighligtItem);
- DeleteUptoScrID(EBOOK_OPEN_SCREENID);
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_exit_jump_to
- * DESCRIPTION
- * Exit function for Jump To
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_exit_jump_to(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history Scr;
- S16 nHistory = 0;
- U16 size;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- CloseCategory57Screen();
- Scr.scrnID = EBOOK_JUMPTO_SCREEN_ID;
- CloseCategory57Screen();
- Scr.entryFuncPtr = ebr_entry_jump_to;
- pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) & nHistory);
- GetCategoryHistory(Scr.guiBuffer);
- size = (U16) GetCategory57DataSize();
- GetCategory57Data((U8*) Scr.inputBuffer);
- AddNHistory(Scr, size);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_entry_jump_to_done_hndlr
- * DESCRIPTION
- * Entry Function
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_entry_jump_to_done_hndlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 percantage_val = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Call Exit Handler */
- if (IsScreenPresent(SCR_FMGR_APP_FILE_OPTION))
- {
- EntryNewScreen(EBOOK_JUMPTO_DONE_SCREEN_ID, NULL, NULL, NULL);
- }
- ebr_frm_jump_to_record(percantage_val, g_ebookset_cntx_p->inlineHighligtItem);
- DeleteUptoScrID(EBOOK_OPEN_SCREENID);
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_entry_close_book
- * DESCRIPTION
- * Entry Function for Close
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_entry_close_book(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 nfo_id = 0;
- pBOOL is_src_app_is_file_manager;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ebr_frm_rwrite_into_nvram(nfo_id);
- is_src_app_is_file_manager = ebr_frm_ebook_exit();
- if (is_src_app_is_file_manager)
- {
- if (IsScreenPresent(SCR_FMGR_FILE_OPTION))
- {
- ebr_frm_remove_last_directory();
- }
- if (IsScreenPresent(SCR_FMGR_EXPLORER))
- {
- DeleteUptoScrID(SCR_FMGR_EXPLORER);
- }
- GoBackHistory();
- }
- else
- {
- if (IsScreenPresent(SCR_FMGR_EXPLORER))
- {
- DeleteUptoScrID(SCR_FMGR_EXPLORER);
- GoBackHistory();
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_entry_search
- * DESCRIPTION
- * Set highlight handler for Menu Ooptions
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_entry_search(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U16 nNumofItem;
- U16 nStrItemList[MAX_SUB_MENUS];
- U16 nImgIltemList[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ebr_frm_reset_find_next_data();
- EntryNewScreen(EBOOK_SEARCH_SCREENID, NULL, ebr_entry_search, NULL);
- guiBuffer = GetCurrGuiBuffer(EBOOK_SEARCH_SCREENID);
- nNumofItem = GetNumOfChild(MENU_ID_EBK_FIND);
- GetSequenceStringIds(MENU_ID_EBK_FIND, nStrItemList);
- GetSequenceImageIds(MENU_ID_EBK_FIND, nImgIltemList);
- SetParentHandler(MENU_ID_EBK_FIND);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_FIND_EBOOK,
- GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
- STR_GLOBAL_OPTIONS,
- IMG_GLOBAL_OPTIONS,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- 0,
- 0,
- 0,
- guiBuffer);
- SetLeftSoftkeyFunction(ebr_ebook_search_string, KEY_EVENT_UP);
- SetKeyHandler(ebr_ebook_search_string, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(go_back_to_settings_screen, KEY_EVENT_UP);
- SetKeyHandler(go_back_to_settings_screen, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * go_back_to_settings_screen
- * DESCRIPTION
- * Go back to Setting screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void go_back_to_settings_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DeleteUptoScrID(EBOOK_BOOK_SETTINGS);
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_ebook_search_string
- * DESCRIPTION
- * Set highlight handler for Menu Ooptions
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_ebook_search_string(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(EBOOK_SEARCH_STR_SCREENID, NULL, ebr_ebook_search_string, NULL);
- guiBuffer = GetCurrGuiBuffer(EBOOK_SEARCH_STR_SCREENID);
- ShowCategory5Screen(
- STR_FIND_EBOOK,
- GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
- STR_GLOBAL_OPTIONS,
- IMG_GLOBAL_OPTIONS,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE,
- (U8*) g_ebook_app_cntx_p->ebr_search_string_input,
- EBR_MAX_STR_SEARCH_LENGTH + 1,
- guiBuffer);
- SetLeftSoftkeyFunction(ebr_entry_search_edit_list, KEY_EVENT_UP);
- SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_entry_search_edit_list
- * DESCRIPTION
- * Entry function for Add book mark
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_entry_search_edit_list(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U16 ItemList[2];
- U16 nItems;
- #ifdef __MMI_LANG_HINDI__
- pBOOL full_character;
- #endif
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_LANG_HINDI__
- full_character = ebr_frm_check_for_full_characters((S16*) g_ebook_app_cntx_p->ebr_search_string_input);
- if (!full_character)
- {
- ebr_app_show_string_incomplete_pop_up();
- return;
- }
- #endif /* __MMI_LANG_HINDI__ */
- EntryNewScreen(SCR_EDIT_BOOK_MARK_NAME, NULL, ebr_entry_search_edit_list, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_EDIT_BOOK_MARK_NAME);
- nItems = GetNumOfChild(MENU_EBOOK_EDIT_BOOK_MARK_NAME);
- GetSequenceStringIds(MENU_EBOOK_EDIT_BOOK_MARK_NAME, ItemList);
- RegisterHighlightHandler(ebr_get_add_search_string_options);
- ShowCategory52Screen(
- STR_GLOBAL_OPTIONS,
- GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nItems,
- ItemList,
- (PU16) gIndexIconsImageList,
- 0,
- 0,
- 0,
- guiBuffer);
- /* Register function for left soft key */
- SetLeftSoftkeyFunction(ebr_get_add_search_string, KEY_EVENT_UP);
- /* Register function for right soft key */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_get_add_search_string
- * DESCRIPTION
- * Processing for Highlight Handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_get_add_search_string(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (g_ebook_app_cntx_p->current_highlighted_item)
- {
- case 0:
- ebr_app_search_string();
- break;
- case 1: /* Input Methods */
- EntryInputMethodScreen();
- RegisterInputMethodScreenCloseFunction(GoBackHistoryFromInputMethod);
- break;
- default:
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_get_add_search_string_options
- * DESCRIPTION
- * Highlight Handler
- * PARAMETERS
- * nIndex [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_get_add_search_string_options(S32 nIndex)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_ebook_app_cntx_p->current_highlighted_item = nIndex;
- switch (nIndex)
- {
- case 0: /* Done */
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_UP);
- break;
- case 1: /* Input Methods */
- SetKeyHandler(ebr_get_add_search_string, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- break;
- default:
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_search_string
- * DESCRIPTION
- * Function for Search
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_search_string(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- ebr_app_search_type_enum search_type = GetCurrHiliteID();
- S32 search_satus;
- S32 str_length = pfnUnicodeStrlen((const S8*)g_ebook_app_cntx_p->ebr_search_string_input);
- if(!ebr_frm_check_file_exist())
- {
- go_back_to_bookshelf_screen();
- ebr_app_display_pop_up_error_opening_book();
- return;
- }
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (str_length == 0)
- {
- ebr_frm_search_string_empty();
- return;
- }
- ebr_please_wait_actual_screen_2();
- search_satus = ebr_frm_search_string_algo(search_type, (S8*) g_ebook_app_cntx_p->ebr_search_string_input, MMI_FALSE);
- /* search not complete */
- if (search_satus == 0xFF)
- {
- return;
- }
- else if ((search_satus ==1) &&
- ((g_ebook_app_cntx_p->ebr_search_string_input[0] != ' ') || (g_ebook_app_cntx_p->ebr_search_string_input[1] != ' ' )))
- {
- if (!ebr_frm_get_auto_scroll_status())
- {
- gui_paging_reset_auto_scroll();
- }
- ebr_app_search_result_successful((pBOOL) search_type);
- ebr_app_delete_upto_open_book_screen_id();
- GoBackHistory();
- ebr_frm_set_data_for_display();
- }
- else
- {
- if(search_satus==2)
- {
- ebr_app_search_result_invalid();
- }
- else
- {
- ebr_app_search_result_unsucessfull();
- }
- }
- }