EbookSrc.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:169k
源码类别:
MTK
开发平台:
C/C++
- /*****************************************************************************
- * FUNCTION
- * ebr_app_save_settings_scroll
- * DESCRIPTION
- * Save scroll flag in nfo file
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_save_settings_scroll(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ebr_app_delete_upto_open_book_screen_id();
- ebr_app_display_pop_up_changed_auto_scroll(ebr_frm_save_settings_scroll());
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_save_settings_screen_mode
- * DESCRIPTION
- * Saves screen mode in NFO file.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_save_settings_screen_mode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ebr_app_delete_upto_open_book_screen_id();
- ebr_app_display_pop_up_changed_screen_mode(ebr_frm_save_settings_screen_mode());
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_entry_open_book
- * DESCRIPTION
- * Entry Function for Open Book
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- extern pBOOL isInCall(void);
- void ebr_entry_open_book(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- S16 buffer_size;
- U16 lsk=STR_GLOBAL_OPTIONS;
- U16 display_name[MAX_EBOOK_NAME_LENGTH + 1];
- S16 return_val;
- S32 book_size;
- S32 page_size;
- S16 full_screen, auto_scroll_staus;
- ebr_frm_nfo_create_type_errors_enum error_type = EBR_FRM_NFO_CREATE_SUCCESS;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ebr_please_wait_actual_screen();
- PowerAndEndKeyHandler();
- if (ebr_frm_get_current_recursive_conversion_state() == EBR_FRM_CONVERSION_UNDERWAY)
- {
- ebr_frm_convert_record_record_recursively();
- return;
- }
- if (ebr_frm_get_current_recursive_conversion_state() == EBR_FRM_NFO_CONVERSION_COMPLETED)
- {
- DeleteNScrId(EBOOK_OPEN_SCREENID);
- ebr_frm_set_current_recursive_conversion_state(EBR_FRM_NO_CONVERSION);
- }
- guiBuffer = GetCurrGuiBuffer(EBOOK_OPEN_SCREENID);
- if (guiBuffer == NULL)
- {
- error_type = ebr_frm_reset_for_new_book();
- g_ebook_app_cntx_p->enable_screen_exit = 1;
- if ((ebr_frm_nfo_create_type_errors_enum) error_type == EBR_FRM_NFO_CREATE_FAILURE)
- {
- if (ebr_frm_check_nfo_file_size())
- {
- ebr_app_dispaly_less_memory_pop_up();
- }
- else
- {
- ebr_app_display_pop_up_error_opening_book();
- }
- DeleteNScrId(EBOOK_OPEN_SCREENID);
- return;
- }
- else
- {
- if ((ebr_frm_nfo_create_type_errors_enum) error_type == EBR_FRM_NFO_CREATE_FILE_TYPE_NOT_SUPPORTED)
- {
- ebr_app_display_pop_up_format_not_supported();
- DeleteNScrId(EBOOK_OPEN_SCREENID);
- return;
- }
- }
- if ((ebr_frm_nfo_create_type_errors_enum) error_type == EBR_FRM_EMPTY_BOOK)
- {
- ebr_app_display_pop_up_empty_book();
- DeleteNScrId(EBOOK_OPEN_SCREENID);
- return;
- }
- }
- memset(g_ebook_app_cntx_p->buffer_data, 0, EBR_RECORD_SIZE_MAX + GUI_SHARED_BYTES);
- ebr_frm_register_recursive_callback_fn(ebr_entry_open_book);
- return_val = ebr_frm_get_data_to_open_book(ebook_frm_setting, g_ebook_app_cntx_p->buffer_data, (PS8)display_name);
- if (return_val == 0)
- {
- ebr_app_dispaly_less_memory_pop_up();
- DeleteNScrId(EBOOK_OPEN_SCREENID);
- return;
- }
- else
- {
- if (return_val == -1)
- {
- ebr_app_display_pop_up_error_opening_book();
- DeleteNScrId(EBOOK_OPEN_SCREENID);
- return;
- }
- }
- if (return_val == 3)
- {
- ebr_app_display_pop_up_error_opening_book();
- DeleteNScrId(EBOOK_OPEN_SCREENID);
- return;
- }
- if (return_val == 2)
- {
- ebr_app_display_pop_up_empty_book();
- DeleteNScrId(EBOOK_OPEN_SCREENID);
- return;
- }
- if (ebr_frm_get_current_recursive_conversion_state() == EBR_FRM_CONVERSION_UNDERWAY)
- {
- return;
- }
- buffer_size = pfnUnicodeStrlen((const S8*)g_ebook_app_cntx_p->buffer_data);
- full_screen = ebr_frm_get_full_screen_flag_status();
- auto_scroll_staus = ebr_frm_get_auto_scroll_flag_status();
- if (auto_scroll_staus)
- {
- TurnOnBacklight(0);
- }
- ebr_stop_please_wait_actual_screen();
- EntryNewScreen(EBOOK_OPEN_SCREENID, ebr_mmi_ebook_exit, ebr_entry_open_book, NULL);
- #ifdef __MMI_TOUCH_SCREEN__
- ebook_frm_setting->key_callback = ebr_set_key_TS;
- #endif
- if (isInCall())
- lsk = 0;
- if (full_screen == 0)
- {
- ShowCategory75Screen(
- display_name,
- GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
- lsk,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- (U8*) g_ebook_app_cntx_p->buffer_data,
- buffer_size,
- NULL,
- &ebook_frm_setting);
- SetLeftSoftkeyFunction(ebr_entry_book_settings, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- else
- {
- ShowCategory77Screen(
- (U16*) display_name,
- GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
- lsk,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- (U8*) g_ebook_app_cntx_p->buffer_data,
- buffer_size,
- NULL,
- &ebook_frm_setting);
- SetKeyHandler(ebr_entry_book_settings, KEY_LSK, KEY_EVENT_DOWN);
- SetKeyHandler(GoBackHistory, KEY_RSK, KEY_EVENT_DOWN);
- }
- /* PowerAndEndKeyHandler(); */
- register_multiline_inputbox_navigate_callback(ebr_frm_reset_find_next_data);
- if (ebook_frm_setting->search_flag_is_on)
- {
- ebr_frm_get_and_set_current_page_values();
- }
- g_ebook_app_cntx_p->ebr_set_local_setting_flag = 1;
- book_size = ebr_frm_get_book_size_from_nfo();
- page_size = ebr_frm_get_page_size();
- //KP Jerry add on 2007-3-22 start
- ClearKeyHandler(KEY_0, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_1, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_2, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_3, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_4, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_5, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_6, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_7, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_8, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_9, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_STAR, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_POUND, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_0, KEY_LONG_PRESS);
- ClearKeyHandler(KEY_1, KEY_LONG_PRESS);
- ClearKeyHandler(KEY_2, KEY_LONG_PRESS);
- ClearKeyHandler(KEY_3, KEY_LONG_PRESS);
- ClearKeyHandler(KEY_4, KEY_LONG_PRESS);
- ClearKeyHandler(KEY_5, KEY_LONG_PRESS);
- ClearKeyHandler(KEY_6, KEY_LONG_PRESS);
- ClearKeyHandler(KEY_7, KEY_LONG_PRESS);
- ClearKeyHandler(KEY_8, KEY_LONG_PRESS);
- ClearKeyHandler(KEY_9, KEY_LONG_PRESS);
- ClearKeyHandler(KEY_STAR, KEY_LONG_PRESS);
- ClearKeyHandler(KEY_POUND, KEY_LONG_PRESS);
- ClearKeyHandler(KEY_0, KEY_REPEAT);
- ClearKeyHandler(KEY_1, KEY_REPEAT);
- ClearKeyHandler(KEY_2, KEY_REPEAT);
- ClearKeyHandler(KEY_3, KEY_REPEAT);
- ClearKeyHandler(KEY_4, KEY_REPEAT);
- ClearKeyHandler(KEY_5, KEY_REPEAT);
- ClearKeyHandler(KEY_6, KEY_REPEAT);
- ClearKeyHandler(KEY_7, KEY_REPEAT);
- ClearKeyHandler(KEY_8, KEY_REPEAT);
- ClearKeyHandler(KEY_9, KEY_REPEAT);
- ClearKeyHandler(KEY_STAR, KEY_REPEAT);
- ClearKeyHandler(KEY_POUND, KEY_REPEAT);
- //KP Jerry add on 2007-3-22 end
- SetKeyHandler(ebr_entry_settings, KEY_0, KEY_EVENT_UP);
- SetKeyHandler(ebr_entry_help, KEY_1, KEY_EVENT_UP);
- SetKeyHandler(ebr_entry_add_book_mark, KEY_2, KEY_EVENT_UP);
- SetKeyHandler(ebr_entry_search, KEY_3, KEY_EVENT_UP);
- SetKeyHandler(ebr_pre_entry_jump_to, KEY_4, KEY_EVENT_UP);
- SetKeyHandler(ebr_entry_goto_book_mark, KEY_5, KEY_EVENT_UP);
- //KP Jerry modify on 2007-3-22 start
- /*Old:
- if (((g_ebook_app_cntx_p->ebr_search_string_input[0] != ' ') || (g_ebook_app_cntx_p->ebr_search_string_input[1] != ' ')) && ebr_frm_get_auto_scroll_status())
- {
- SetKeyHandler(ebr_app_search_string_next, KEY_6, KEY_EVENT_UP);
- }
- */
- SetKeyHandler(ebr_app_search_string_next_if_available, KEY_6, KEY_EVENT_UP);
- //KP Jerry modify on 2007-3-22 end
- SetKeyHandler(ebr_app_save_settings_scroll, KEY_7, KEY_EVENT_UP); /* Auto Scroll */ //KP Jerry add on 2007-3-22
- SetKeyHandler(ebr_entry_remove_book_mark, KEY_8, KEY_EVENT_UP);
- SetKeyHandler(ebr_app_save_settings_screen_mode, KEY_9, KEY_EVENT_UP); /* Full Screen */ //KP Jerry add on 2007-3-22
- SetKeyHandler(ebr_app_save_settings_scroll, KEY_POUND, KEY_EVENT_UP); /* Auto Scroll */
- SetKeyHandler(ebr_app_save_settings_screen_mode, KEY_STAR, KEY_EVENT_UP); /* Full Screen */
- }
- //KP Jerry add on 2007-3-22 start
- void ebr_app_search_string_next_if_available(void)
- {
- if (((g_ebook_app_cntx_p->ebr_search_string_input[0] != ' ') || (g_ebook_app_cntx_p->ebr_search_string_input[1] != ' ')) && ebr_frm_get_auto_scroll_status())
- {
- ebr_app_search_string_next();
- }
- }
- //KP Jerry add on 2007-3-22 end
- /*****************************************************************************
- * FUNCTION
- * ebr_stop_please_wait_actual_screen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_stop_please_wait_actual_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ExitCategory66Screen();
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_please_wait_actual_screen
- * DESCRIPTION
- * Please Wait Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_please_wait_actual_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EBOOK_WAITSCREEN, NULL, NULL, NULL);
- ClearHighlightHandler();
- /* ShowCategory151Screen(0, 0, 0, 0, 0, 0, (PU8)GetString(STR_WAIT_STRING), 0, NULL); */
- ShowCategory66Screen(
- (U16) STR_EBOOK_WAIT,
- GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
- 0,
- 0,
- 0,
- 0,
- (U8*) GetString(STR_EBOOK_WAIT),
- IMAGE_EBOOK_WAIT,
- NULL);
- /* ShowCategory9Screen(wait_string, wait_image_id, NULL); */
- ClearAllKeyHandler();
- ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_please_wait_actual_screen_2
- * DESCRIPTION
- * Please Wait Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_please_wait_actual_screen_2(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EBOOK_WAITSCREEN, NULL, NULL, NULL);
- ClearHighlightHandler();
- /* ShowCategory151Screen(0, 0, 0, 0, 0, 0, (PU8)GetString(STR_WAIT_STRING), 0, NULL); */
- ShowCategory66Screen(
- (U16) STR_EBOOK_WAIT,
- GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
- 0,
- 0,
- 0,
- 0,
- (U8*) GetString(STR_EBOOK_WAIT),
- IMAGE_EBOOK_WAIT,
- NULL);
- /* ShowCategory9Screen(wait_string, wait_image_id, NULL); */
- ClearAllKeyHandler();
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_please_wait_move_screen
- * DESCRIPTION
- * Please Wait Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_please_wait_move_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* EntryNewScreen(SCR_ID_EBOOK_WAITSCREEN, NULL, NULL, NULL); */
- ClearHighlightHandler();
- ClearKeyEvents();
- /* ShowCategory151Screen(0, 0, 0, 0, 0, 0, (PU8)GetString(STR_WAIT_STRING), 0, NULL); */
- ShowCategory66Screen(
- (U16) STR_EBOOK_WAIT,
- GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
- 0,
- 0,
- 0,
- 0,
- (U8*) GetString(STR_EBOOK_WAIT),
- IMAGE_EBOOK_WAIT,
- NULL);
- /* ShowCategory9Screen(wait_string, wait_image_id, NULL); */
- ClearAllKeyHandler();
- ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * go_back_to_bookshelf_screen
- * DESCRIPTION
- * Go to Book shelf Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void go_back_to_bookshelf_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ebr_frm_close_the_ebook();
- DeleteNScrId(SCR_FMGR_APP_FILE_OPTION);
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_frm_set_full_screen_on
- * DESCRIPTION
- * Set full screen ON
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_frm_set_full_screen_on(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DeleteUptoScrID(EBOOK_OPEN_SCREENID);
- ebr_entry_open_book();
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_frm_set_full_screen_off
- * DESCRIPTION
- * Set full screen OFF
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_frm_set_full_screen_off(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DeleteUptoScrID(EBOOK_OPEN_SCREENID);
- ebr_entry_open_book();
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_entry_book_settings
- * DESCRIPTION
- * Entry Function for Setting Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_entry_book_settings(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U16 nNumofItem;
- U16 nStrItemList[MAX_SUB_MENUS];
- U16 nImgIltemList[MAX_SUB_MENUS];
- U8 *hintList[MAX_SUB_MENUS];
- S32 book_size;
- S32 page_size;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(EBOOK_BOOK_SETTINGS_SCREENID, NULL, ebr_entry_book_settings, NULL);
- guiBuffer = GetCurrGuiBuffer(EBOOK_BOOK_SETTINGS_SCREENID);
- book_size = ebr_frm_get_book_size_from_nfo();
- page_size = ebr_frm_get_page_size();
- if (*g_ebook_app_cntx_p->ebr_search_string_input != ' ' && ebr_frm_get_auto_scroll_status())
- {
- SetParentHandler(MENU_ID_EBK_OPEN_OPTIONS_1);
- nNumofItem = GetNumOfChild(MENU_ID_EBK_OPEN_OPTIONS_1);
- GetSequenceStringIds(MENU_ID_EBK_OPEN_OPTIONS_1, nStrItemList);
- GetSequenceImageIds(MENU_ID_EBK_OPEN_OPTIONS_1, nImgIltemList);
- ConstructHintsList(MENU_ID_EBK_OPEN_OPTIONS_1, hintList);
- }
- else
- {
- SetParentHandler(MENU_ID_EBK_OPEN_OPTIONS);
- nNumofItem = GetNumOfChild(MENU_ID_EBK_OPEN_OPTIONS);
- GetSequenceStringIds(MENU_ID_EBK_OPEN_OPTIONS, nStrItemList);
- GetSequenceImageIds(MENU_ID_EBK_OPEN_OPTIONS, nImgIltemList);
- /* Construct List To Show Hint */
- ConstructHintsList(MENU_ID_EBK_OPEN_OPTIONS, hintList);
- }
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_OPEN_BOOK_OPTION,
- 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(go_back_to_settings_screen, KEY_EVENT_UP);
- SetKeyHandler(go_back_to_settings_screen, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_entry_book_info
- * DESCRIPTION
- * Entry Function for Book Info Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_entry_book_info(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U8 display_info[EBR_DISPLAY_INFO_SIZE], book_size[EBR_DISPLAY_INFO_DATA];
- U8 new_line_info[EBR_NEW_LINE_SIZE];
- S32 file_size, total_size;
- U8 *type;
- S8 buffer[MAX_EBOOK_NAME_LENGTH];
- S8 new_line[]="n";
- U8 type_info[EBR_DISPLAY_INFO_DATA * ENCODING_LENGTH];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(EBOOK_INFO_SCREENID, NULL, ebr_entry_book_info, NULL);
- guiBuffer = GetCurrGuiBuffer(EBOOK_INFO_SCREENID);
- type = ebr_frm_get_book_type();
- AnsiiToUnicodeString((S8*) new_line_info, (S8*) new_line);
- AnsiiToUnicodeString((S8*) type_info, (S8*) type);
- pfnUnicodeStrcpy((PS8) display_info, (PS8) get_string(STR_EBOOK_BOOK_INFO_TITLE));
- pfnUnicodeStrcat((PS8) display_info, (PS8) ebr_frm_get_book_name());
- pfnUnicodeStrcat((PS8) display_info, (S8*) new_line_info);
- pfnUnicodeStrcat((PS8) display_info, (S8*) get_string(STR_EBOOK_BOOK_INFO_SIZE));
- total_size = ebr_frm_get_book_size();
- if (total_size > 1024 * 1024)
- {
- file_size = total_size / 1024;
- sprintf(buffer, "%d.%dM", (U16) (file_size / 1024), (U16) ((file_size % 1024) / 103));
- }
- else if (total_size > 1024)
- {
- sprintf(buffer, "%d.%dK", (U16) (total_size / 1024), (U16) ((total_size % 1024) / 103));
- }
- else /* less than 1024 */
- {
- sprintf(buffer, "%dB", (U16) (total_size));
- }
- AnsiiToUnicodeString((S8*) book_size, (S8*) buffer);
- pfnUnicodeStrcat((PS8) display_info, (PS8) book_size);
- pfnUnicodeStrcat((PS8) display_info, (PS8) new_line_info);
- pfnUnicodeStrcat((PS8) display_info, (PS8) get_string(STR_EBOOK_BOOK_INFO_FORMAT));
- pfnUnicodeStrcat((PS8) display_info, (PS8) type_info);
- ShowCategory74Screen(
- STR_INFO_EBOOK,
- GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
- 0,
- 0,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- (U8*) display_info,
- pfnUnicodeStrlen((const S8*)display_info),
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_entry_delete_ebook
- * DESCRIPTION
- * Entry Function for Delete Book Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_entry_delete_ebook(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 return_type = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return_type = ebr_frm_delete_ebook();
- DeleteNScrId(SCR_FMGR_APP_FILE_OPTION);
- if(return_type==-45)
- {
- DisplayPopup((PU8) GetString(FMGR_FS_READ_ONLY_ERROR_TEXT), IMG_GLOBAL_ERROR, 1, EBR_ST_NOTIFYDURATION, ERROR_TONE);
- }
- else if (return_type < 0)
- {
- DisplayPopup((PU8) GetString(FMGR_FS_GENERAL_FAILURE_TEXT), IMG_GLOBAL_ERROR, 1, EBR_ST_NOTIFYDURATION, ERROR_TONE);
- }
- else
- {
- DisplayPopup((PU8) GetString(STR_DELETED), IMG_GLOBAL_ACTIVATED, 1, EBR_ST_NOTIFYDURATION, SUCCESS_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_entry_help
- * DESCRIPTION
- * Entry Function for Help Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_entry_help(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PS8 buffer_data;
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(EBOOK_HELP_SCREEN, NULL, ebr_entry_help, NULL);
- guiBuffer = GetCurrGuiBuffer(EBOOK_HELP_SCREEN);
- #ifdef __MMI_TOUCH_SCREEN__
- buffer_data = GetString(STR_EBOOK_TOUCH_SCREEN_HELP);
- #else
- buffer_data = GetString(STR_EBOOK_HELP_DESCRIPTION);
- #endif
- ShowCategory74Screen(
- STR_HELP_EBOOK,
- GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
- 0,
- 0,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- (U8*) buffer_data,
- 510,
- guiBuffer);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_entry_settings
- * DESCRIPTION
- * Entry Function for Settings Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_entry_settings(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- U8 status;
- U8 *inputBuffer;
- U16 nNumofItem = EBR_TOTAL_NUMBER_OF_ITEM_BKSHLF; /* Stores no of children in the submenu */
- U16 inputBufferSize;
- U16 gIndexIconsImageList_local[] =
- {
- IMG_GLOBAL_L1,
- 0,
- IMG_GLOBAL_L2,
- 0,
- IMG_GLOBAL_L3,
- 0,
- IMG_GLOBAL_L4,
- 0,
- IMG_GLOBAL_L5,
- 0,
- IMG_GLOBAL_L6,
- 0,
- IMG_GLOBAL_L7,
- 0,
- IMG_GLOBAL_L8,
- 0
- };
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- nNumofItem = EBR_TOTAL_NUMBER_OF_ITEM_BKSHLF;
- mmi_fmgr_get_exist_storage_inline_list(NULL, &status, NULL, NULL);
- if (g_ebook_app_cntx_p->ebr_set_local_setting_flag == 1 ||
- (g_ebook_app_cntx_p->ebr_set_local_setting_flag != 1 && (status == 1)))
- {
- gIndexIconsImageList_local[14] = 0;
- gIndexIconsImageList_local[15] = 0;
- nNumofItem = EBR_TOTAL_NUMBER_OF_ITEM_BOOK;
- }
- EntryNewScreen(EBOOK_BOOK_SHELF_SETTINGS_SCREEN_ID, ebr_exit_settings, NULL, NULL);
- InitializeCategory57Screen();
- guiBuffer = GetCurrGuiBuffer(EBOOK_BOOK_SHELF_SETTINGS_SCREEN_ID);
- inputBuffer = GetCurrNInputBuffer(EBOOK_BOOK_SHELF_SETTINGS_SCREEN_ID, &inputBufferSize); /* added for inline edit history */
- if (inputBuffer != NULL)
- {
- SetCategory57Data(wgui_inline_items, nNumofItem, inputBuffer);
- }
- else
- {
- //ClearHighlightHandler();
- /* Ge the Default value from NVRAM */
- ebr_frm_get_default_settings_value(g_ebookset_cntx_p, g_ebook_app_cntx_p->ebr_set_local_setting_flag);
- }
- ebr_fill_settings_inline_edit_struct((void*)&wgui_inline_items);
- RegisterHighlightHandler(mmi_ebr_highlight_setting);
- if (mmi_ebr_is_memory_type_changed(g_ebookset_cntx_p->inlineHighligtItemSelectMemory) && GetInlineDoneFlag(guiBuffer) == 0)
- {
- SetInlineDoneFlag(guiBuffer);
- }
- if (g_ebook_app_cntx_p->ebr_set_local_setting_flag != 1)
- {
- ShowCategory57Screen(
- STR_SETTINGS_EBOOK,
- GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_DONE,
- IMG_GLOBAL_BACK,
- nNumofItem,
- (U16*) gIndexIconsImageList_local,
- wgui_inline_items,
- 0,
- guiBuffer);
- }
- else
- {
- ShowCategory57Screen(
- STR_BOOK_SETTINGS_EBOOK,
- GetRootTitleIcon(MAIN_MENU_EBOOK_MENUID),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_DONE,
- IMG_GLOBAL_BACK,
- nNumofItem,
- (U16*) gIndexIconsImageList_local,
- wgui_inline_items,
- 0,
- guiBuffer);
- }
- /* Register function for right soft key */
- SetCategory57RightSoftkeyFunctions(ebr_book_settings_confirm_pop_up, GoBackHistory);
- }
- #ifdef __MMI_TOUCH_SCREEN__
- /*****************************************************************************
- * FUNCTION
- * ebr_set_key_TS
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_set_key_TS(UI_character_type c)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (c)
- {
- case '0':
- ebr_entry_settings();
- break;
- case '1':
- ebr_entry_help();
- break;
- case '2':
- ebr_entry_add_book_mark();
- break;
- case '3':
- ebr_entry_search();
- break;
- case '4':
- ebr_pre_entry_jump_to();
- break;
- case '5':
- ebr_entry_goto_book_mark();
- break;
- case '6':
- if (((g_ebook_app_cntx_p->ebr_search_string_input[0] != ' ') || (g_ebook_app_cntx_p->ebr_search_string_input[1] != ' ')) && ebr_frm_get_auto_scroll_status())
- {
- ebr_app_search_string_next();
- }
- break;
- case '7':
- ebr_app_save_settings_scroll();
- break;
- case '8':
- ebr_entry_remove_book_mark();
- break;
- case '9':
- ebr_app_save_settings_screen_mode();
- break;
- default:
- break;
- }
- }
- #endif /* __MMI_TOUCH_SCREEN__ */
- /*****************************************************************************
- * FUNCTION
- * ebr_book_settings_confirm_pop_up
- * DESCRIPTION
- * Confirmation Screen for Settings
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_book_settings_confirm_pop_up(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_CONFIRM_SAVE_SETTINGS),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- if (g_ebook_app_cntx_p->ebr_set_local_setting_flag == 1)
- {
- SetLeftSoftkeyFunction(ebr_book_settings_done_hdlr, KEY_EVENT_UP);
- SetRightSoftkeyFunction(go_back_to_open_book_screen, KEY_EVENT_UP);
- }
- else
- {
- SetLeftSoftkeyFunction(ebr_entry_settings_done_hndlr, KEY_EVENT_UP);
- SetRightSoftkeyFunction(go_back_to_book_shelf_scren, KEY_EVENT_UP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * go_back_to_book_shelf_scren
- * DESCRIPTION
- * Go to book Shelf Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void go_back_to_book_shelf_scren(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 count_no_of_nfo_file = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- count_no_of_nfo_file = ebr_frm_get_total_countof_nfo_file();
- IsBackHistory = MMI_TRUE;
- if (IsScreenPresent(FMGR_SCR_MARKER))
- {
- DeleteNScrId(FMGR_SCR_MARKER);
- }
- else
- {
- if (count_no_of_nfo_file <= 0)
- {
- DeleteNScrId(EBOOK_OPEN_OPTION_SCREENID);
- }
- else
- {
- DeleteNScrId(EBOOK_BOOK_SHELF_SETTINGS_SCREEN_ID);
- }
- }
- ebr_entry_book_shel_screen();
- }
- /*****************************************************************************
- * FUNCTION
- * go_back_to_open_book_screen
- * DESCRIPTION
- * Go to Open Book Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void go_back_to_open_book_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (IsScreenPresent(EBOOK_BOOK_SETTINGS_SCREENID))
- {
- DeleteUptoScrID(EBOOK_OPEN_SCREENID);
- GoBackHistory();
- }
- else
- {
- DeleteUptoScrID(EBOOK_OPEN_SCREENID);
- GoBackHistory();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_exit_settings
- * DESCRIPTION
- * Exit function for Settings Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_exit_settings(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history Scr;
- S16 nHistory = 0;
- U16 size;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- CloseCategory57Screen();
- Scr.scrnID = EBOOK_BOOK_SHELF_SETTINGS_SCREEN_ID;
- CloseCategory57Screen();
- Scr.entryFuncPtr = ebr_entry_settings;
- pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) & nHistory);
- GetCategoryHistory(Scr.guiBuffer);
- size = (U16) GetCategory57DataSize();
- GetCategory57Data((U8*) Scr.inputBuffer);
- AddNHistory(Scr, size);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_entry_settings_done_hndlr
- * DESCRIPTION
- * Set highlight handler for Menu Ooptions
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_entry_settings_done_hndlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ebr_frm_set_settings_and_save_in_nvram(g_ebookset_cntx_p);
- DeleteUptoScrID(SCR_FMGR_EXPLORER);
- IsBackHistory = MMI_TRUE;
- DisplayPopupCallBack(
- (PU8) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- EBR_ST_NOTIFYDURATION,
- SUCCESS_TONE,
- ebr_entry_book_shel_screen);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_book_settings_done_hdlr
- * DESCRIPTION
- * Set highlight handler for Menu Ooptions
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_book_settings_done_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ebr_frm_set_settings_and_save(g_ebookset_cntx_p);
- if (IsScreenPresent(EBOOK_BOOK_SETTINGS_SCREENID))
- {
- DeleteUptoScrID(EBOOK_OPEN_SCREENID);
- }
- else
- {
- DeleteUptoScrID(EBOOK_OPEN_SCREENID);
- }
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- EBR_ST_NOTIFYDURATION,
- SUCCESS_TONE);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_fill_settings_inline_edit_struct
- * DESCRIPTION
- * Set highlight handler for Menu Ooptions
- * PARAMETERS
- * pInlineStruct [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_fill_settings_inline_edit_struct(void *pInlineStruct)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 i = 0;
- U8 status = 0;
- InlineItem *InlineStruct = (InlineItem*) pInlineStruct;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_ebook_app_cntx_p->ebook_settings_font_style[EBR_FONT_STYLE_NORMAL] =
- (U8*) GetString(STR_SETTINGS_FONT_STYLE_NORMAL);
- g_ebook_app_cntx_p->ebook_settings_font_style[EBR_FONT_STYLE_ITALIC] =
- (U8*) GetString(STR_SETTINGS_FONT_STYLE_ITALIC);
- g_ebook_app_cntx_p->ebook_settings_font_style[EBR_FONT_STYLE_BOLD] = (U8*) GetString(STR_SETTINGS_FONT_STYLE_BOLD);
- g_ebook_app_cntx_p->ebook_settings_font_size[EBR_FONT_SIZE_SMALL] = (U8*) GetString(STR_SETTINGS_FONT_SIZE_SMALL);
- g_ebook_app_cntx_p->ebook_settings_font_size[EBR_FONT_SIZE_MEDIUM] =
- (U8*) GetString(STR_SETTINGS_FONT_SIZE_MEDIUM);
- g_ebook_app_cntx_p->ebook_settings_font_size[EBR_FONT_SIZE_LARGE] = (U8*) GetString(STR_SETTINGS_FONT_SIZE_LARGE);
- g_ebook_app_cntx_p->ebook_settings_scroll_by[EBR_SCROLL_BY_LINE] = (U8*) GetString(STR_SETTINGS_SCROLL_BY_LINE);
- g_ebook_app_cntx_p->ebook_settings_scroll_by[EBR_SCROLL_BY_PAGE] = (U8*) GetString(STR_SETTINGS_SCROLL_BY_PAGE);
- g_ebook_app_cntx_p->ebook_settings_auto_scroll[EBR_SCROLL_OFF] = (U8*) GetString(STR_SETTINGS_AUTO_SCROLL_OFF);
- g_ebook_app_cntx_p->ebook_settings_auto_scroll[EBR_SCROLL_ON] = (U8*) GetString(STR_SETTINGS_AUTO_SCROLL_ON);
- g_ebook_app_cntx_p->ebook_settings_full_screen[EBR_FULL_SCREEN_OFF] =
- (U8*) GetString(STR_SETTINGS_FULL_SCREEN_OFF);
- g_ebook_app_cntx_p->ebook_settings_full_screen[EBR_FULL_SCREEN_ON] = (U8*) GetString(STR_SETTINGS_FULL_SCREEN_ON);
- g_ebook_app_cntx_p->ebook_settings_encoding_format[i++] =
- (U8*) GetString(STR_SETTINGS_ENCODING_FORMAT_WESTERN_WIN);
- g_ebook_app_cntx_p->ebook_settings_encoding_format[i++] = (U8*) GetString(STR_SETTINGS_ENCODING_FORMAT_UCS2);
- g_ebook_app_cntx_p->ebook_settings_encoding_format[i++] = (U8*) GetString(STR_SETTINGS_ENCODING_FORMAT_UTF8);
- #ifdef __MMI_CHSET_BIG5__
- g_ebook_app_cntx_p->ebook_settings_encoding_format[i++] = (U8*) GetString(STR_SETTINGS_ENCODING_FORMAT_BIG5);
- #endif
- #ifdef __MMI_CHSET_GB2312__
- g_ebook_app_cntx_p->ebook_settings_encoding_format[i++] = (U8*) GetString(STR_SETTINGS_ENCODING_FORMAT_GB2312);
- #endif
- #if 0
- #ifdef __MMI_CHSET_TURKISH_ISO__
- /* under construction !*/
- /* under construction !*/
- #endif /* __MMI_CHSET_TURKISH_ISO__ */
- /* under construction !*/
- #ifdef __MMI_CHSET_TURKISH_WIN__
- /* under construction !*/
- /* under construction !*/
- #endif /* __MMI_CHSET_TURKISH_WIN__ */
- #ifdef __MMI_CHSET_BALTIC_ISO__
- /* under construction !*/
- #endif
- #ifdef __MMI_CHSET_BALTIC_WIN__
- /* under construction !*/
- #endif
- #ifdef __MMI_CHSET_CEURO_ISO__
- /* under construction !*/
- /* under construction !*/
- #endif /* __MMI_CHSET_CEURO_ISO__ */
- #ifdef __MMI_CHSET_CEURO_WIN__
- /* under construction !*/
- #endif
- #ifdef __MMI_CHSET_GREEK_ISO__
- /* under construction !*/
- #endif
- #ifdef __MMI_CHSET_GREEK_WIN__
- /* under construction !*/
- #endif
- #ifdef __MMI_CHSET_HEBREW_ISO__
- /* under construction !*/
- #endif
- #ifdef __MMI_CHSET_HEBREW_WIN__
- /* under construction !*/
- #endif
- #ifdef __MMI_CHSET_LATIN_ISO__
- /* under construction !*/
- #endif
- #ifdef __MMI_CHSET_NORDIC_ISO__
- /* under construction !*/
- #endif
- #ifdef __MMI_CHSET_SEURO_ISO__
- /* under construction !*/
- /* under construction !*/
- #endif /* __MMI_CHSET_SEURO_ISO__ */
- #ifdef __MMI_CHSET_WESTERN_ISO__
- /* under construction !*/
- /* under construction !*/
- #endif /* __MMI_CHSET_WESTERN_ISO__ */
- #ifdef __MMI_CHSET_ARABIC_ISO__
- /* under construction !*/
- /* under construction !*/
- #endif /* __MMI_CHSET_ARABIC_ISO__ */
- #ifdef __MMI_CHSET_ARABIC_WIN__
- /* under construction !*/
- #endif
- #endif /* 0 */
- mmi_fmgr_get_exist_storage_inline_list(NULL, &status, NULL, NULL);
- g_ebook_app_cntx_p->ebook_settinsg_auto_scroll_speed[EBR_AUTO_SCROLL_SPEED_1] =
- (U8*) GetString(STR_SETTINGS_AUTO_SCROLL_SPEED_1);
- g_ebook_app_cntx_p->ebook_settinsg_auto_scroll_speed[EBR_AUTO_SCROLL_SPEED_2] =
- (U8*) GetString(STR_SETTINGS_AUTO_SCROLL_SPEED_2);
- g_ebook_app_cntx_p->ebook_settinsg_auto_scroll_speed[EBR_AUTO_SCROLL_SPEED_3] =
- (U8*) GetString(STR_SETTINGS_AUTO_SCROLL_SPEED_3);
- g_ebook_app_cntx_p->ebook_settinsg_auto_scroll_speed[EBR_AUTO_SCROLL_SPEED_4] =
- (U8*) GetString(STR_SETTINGS_AUTO_SCROLL_SPEED_4);
- g_ebook_app_cntx_p->ebook_settinsg_auto_scroll_speed[EBR_AUTO_SCROLL_SPEED_5] =
- (U8*) GetString(STR_SETTINGS_AUTO_SCROLL_SPEED_5);
- SetInlineItemActivation(&InlineStruct[0], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemCaption(&InlineStruct[0], (PU8) (U8*) GetString(STR_SETTINGS_FONT_STYLE));
- SetInlineItemActivation(&InlineStruct[2], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemCaption(&InlineStruct[2], (PU8) (U8*) GetString(STR_SETTINGS_FONT_SIZE));
- SetInlineItemActivation(&InlineStruct[4], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemCaption(&InlineStruct[4], (PU8) (U8*) GetString(STR_SETTINGS_SCROLL_BY));
- SetInlineItemActivation(&InlineStruct[6], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemCaption(&InlineStruct[6], (PU8) (U8*) GetString(STR_SETTINGS_AUTO_SCROLL));
- SetInlineItemActivation(&InlineStruct[8], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemCaption(&InlineStruct[8], (PU8) (U8*) GetString(STR_SETTINGS_AUTO_SCROLL_SPEED));
- SetInlineItemActivation(&InlineStruct[10], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemCaption(&InlineStruct[10], (PU8) (U8*) GetString(STR_SETTINGS_FULL_SCREEN));
- SetInlineItemActivation(&InlineStruct[12], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemCaption(&InlineStruct[12], (PU8) (U8*) GetString(STR_SETTINGS_ENCODING_FORMAT));
- SetInlineItemActivation(&InlineStruct[1], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemSelect(
- &InlineStruct[1],
- 3,
- g_ebook_app_cntx_p->ebook_settings_font_style,
- (S32*) & (g_ebookset_cntx_p->inlineHighligtItemFontStyle) /* CurrSelect */ );
- SetInlineItemActivation(&InlineStruct[3], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemSelect(
- &InlineStruct[3],
- 3,
- g_ebook_app_cntx_p->ebook_settings_font_size,
- (S32*) & (g_ebookset_cntx_p->inlineHighligtItemFontSize) /* CurrSelect */ );
- SetInlineItemActivation(&InlineStruct[5], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemSelect(
- &InlineStruct[5],
- 2,
- g_ebook_app_cntx_p->ebook_settings_scroll_by,
- (S32*) & (g_ebookset_cntx_p->inlineHighligtItemScrollBy) /* CurrSelect */ );
- SetInlineItemActivation(&InlineStruct[7], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemSelect(
- &InlineStruct[7],
- 2,
- g_ebook_app_cntx_p->ebook_settings_auto_scroll,
- (S32*) & (g_ebookset_cntx_p->inlineHighligtItemAutoScroll) /* CurrSelect */ );
- SetInlineItemActivation(&InlineStruct[9], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemSelect(
- &InlineStruct[9],
- 5,
- g_ebook_app_cntx_p->ebook_settinsg_auto_scroll_speed,
- (S32*) & (g_ebookset_cntx_p->inlineHighligtItemScrollSpeed) /* CurrSelect */ );
- SetInlineItemActivation(&InlineStruct[11], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemSelect(
- &InlineStruct[11],
- 2,
- g_ebook_app_cntx_p->ebook_settings_full_screen,
- (S32*) & (g_ebookset_cntx_p->inlineHighligtItemFulScreenMode) /* CurrSelect */ );
- SetInlineItemActivation(&InlineStruct[13], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemSelect(
- &InlineStruct[13],
- i,
- g_ebook_app_cntx_p->ebook_settings_encoding_format,
- (S32*) & (g_ebookset_cntx_p->inlineHighligtItemEncodingFormat) /* CurrSelect */ );
- if (g_ebook_app_cntx_p->ebr_set_local_setting_flag != 1)
- {
- if (status >= 1)
- {
- SetInlineItemActivation(&InlineStruct[14], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemCaption(&InlineStruct[14], (U8*) GetString(STR_SETTINGS_SELECT_MEMORY));
- mmi_fmgr_get_drive_name(g_ebookset_cntx_p->inlineHighligtItemSelectMemory, g_ebook_app_cntx_p->ebook_settings_memory_type, FMGR_MAX_DRIVE_NAME_LEN);
- SetInlineItemActivation(&InlineStruct[15], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemDisplayOnly(&InlineStruct[15], (U8*) g_ebook_app_cntx_p->ebook_settings_memory_type);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_mmi_ebook_exit
- * DESCRIPTION
- * exit function for Open Book
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_mmi_ebook_exit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- TurnOffBacklight();
- if (g_ebook_app_cntx_p->enable_screen_exit)
- {
- ebr_frm_ebook_exit();
- if (ebr_frm_get_current_recursive_conversion_state() == EBR_FRM_CONVERSION_UNDERWAY)
- {
- ebr_frm_stop_recursion();
- ebr_stop_please_wait_actual_screen();
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * entry_duplicate_book_mark_pop_up
- * DESCRIPTION
- * Pop Up for Duplicate Book mark
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void entry_duplicate_book_mark_pop_up()
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_DUPLICATE_BOOK_MARK),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetLeftSoftkeyFunction(ebr_frm_add_book_mark, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_delete_all_from_book_shelf
- * DESCRIPTION
- * Pop Up for Delete All
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_delete_all_from_book_shelf(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_DELETE_ALL_EBOOK_CONFIRM),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetLeftSoftkeyFunction(ebr_confirm_deletion_of_all_files, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_confirm_deletion_of_all_files
- * DESCRIPTION
- * Pop Up for Delete All
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_confirm_deletion_of_all_files(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ebr_frm_delete_all_from_book_shelf();
- DeleteNScrId(SCR_FMGR_APP_FILE_OPTION);
- DisplayPopup((PU8) GetString(STR_DELETED), IMG_GLOBAL_ACTIVATED, 1, EBR_ST_NOTIFYDURATION, SUCCESS_TONE);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_restore_default_book_settings_thru_frm
- * DESCRIPTION
- * Pop Up for Delete All
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_restore_default_book_settings_thru_frm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (ebr_frm_restore_default_book_settings())
- {
- ebr_app_display_pop_up_default_settings_for_book_restored();
- }
- else /* Error Settings could not be restored */
- {
- ebr_app_display_pop_up_default_settings_not_restored();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_restore_default_book_settings
- * DESCRIPTION
- * Confirmation screen for Restore default settings
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_restore_default_book_settings(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_RESTORE_DEFAULT_SETTINGS),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetLeftSoftkeyFunction(ebr_app_restore_default_book_settings_thru_frm, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_restore_default_book_shelf_settings_thru_frm
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_restore_default_book_shelf_settings_thru_frm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ebr_frm_restore_default_book_shelf_settings();
- ebr_app_display_pop_up_default_settings_restored();
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_restore_default_book_shelf_settings
- * DESCRIPTION
- * Confirmation screen for Restore default settings.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_restore_default_book_shelf_settings(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_RESTORE_DEFAULT_SETTINGS),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetLeftSoftkeyFunction(ebr_app_restore_default_book_shelf_settings_thru_frm, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_display_pop_up_maximum_book_marks
- * DESCRIPTION
- * Pop Up for Maximum book marks added.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_display_pop_up_maximum_book_marks(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup((PU8) GetString(STR_MAX_BOOK_MARK), IMG_GLOBAL_WARNING, 1, EBR_ST_NOTIFYDURATION, ERROR_TONE);
- DeleteUptoScrID(EBOOK_BOOK_SETTINGS_SCREENID);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_display_pop_up_book_mark_name_empty
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_display_pop_up_book_mark_name_empty(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup(
- (PU8) GetString(STR_BOOK_MARK_NAME_IS_EMPTY),
- IMG_GLOBAL_UNFINISHED,
- 1,
- EBR_ST_NOTIFYDURATION,
- ERROR_TONE);
- /* DeleteUptoScrID(EBOOK_BOOK_SETTINGS_SCREENID); */
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_display_pop_up_book_mark_sucessfully_added
- * DESCRIPTION
- * Pop Up for Book Mark added.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_display_pop_up_book_mark_sucessfully_added(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup(
- (PU8) GetString(STR_EBOOK_BOOKMARK_ADDED),
- IMG_GLOBAL_ACTIVATED,
- 1,
- EBR_ST_NOTIFYDURATION,
- SUCCESS_TONE);
- if (IsScreenPresent(EBOOK_BOOK_SETTINGS_SCREENID))
- {
- DeleteUptoScrID(EBOOK_BOOK_SETTINGS_SCREENID);
- }
- else
- {
- DeleteNScrId(EBOOK_ADD_BOOK_MARK_SCREEN_ID);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_search_result_unsucessfull
- * DESCRIPTION
- * Pop Up for Search Uncessfull
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_search_result_unsucessfull(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup(
- (U8*) GetString(STR_EBOOK_SEARCH_UN_SUCESSFULL),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- ERROR_TONE);
- DeleteUptoScrID(EBOOK_OPEN_SCREENID);
- ebr_app_search_result_successful(FALSE);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_search_result_invalid
- * DESCRIPTION
- * Pop Up for Search Invalid
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_search_result_invalid(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup(
- (U8*) GetString(STR_EBOOK_SEARCH_INVALID),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- ERROR_TONE);
- DeleteUptoScrID(EBOOK_OPEN_SCREENID);
- ebr_app_search_result_successful(FALSE);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_frm_search_string_empty
- * DESCRIPTION
- * Pop Up for Search Uncessfull
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_frm_search_string_empty(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_EMPTY),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- ERROR_TONE);
- DeleteUptoScrID(EBOOK_OPEN_SCREENID);
- ebr_app_search_result_successful(FALSE);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_display_pop_up_changed_screen_mode
- * DESCRIPTION
- * Pop Up for Screen mode changed.
- * PARAMETERS
- * screen_mode [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_display_pop_up_changed_screen_mode(S32 screen_mode)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (screen_mode == 0)
- {
- DisplayPopup(
- (PU8) GetString(STR_FULL_SCREEN_OFF),
- IMG_GLOBAL_ACTIVATED,
- 1,
- EBR_ST_NOTIFYDURATION,
- SUCCESS_TONE);
- }
- else
- {
- DisplayPopup((PU8) GetString(STR_FULL_SCREEN_ON), IMG_GLOBAL_ACTIVATED, 1, EBR_ST_NOTIFYDURATION, SUCCESS_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_display_pop_up_changed_auto_scroll
- * DESCRIPTION
- * Pop Up for Auto Scroll changed.
- * PARAMETERS
- * auto_scroll_mode [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_display_pop_up_changed_auto_scroll(S32 auto_scroll_mode)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (auto_scroll_mode == 0)
- {
- DisplayPopup(
- (PU8) GetString(STR_AUTO_SCROLL_OFF),
- IMG_GLOBAL_ACTIVATED,
- 1,
- EBR_ST_NOTIFYDURATION,
- SUCCESS_TONE);
- }
- else
- {
- DisplayPopup((PU8) GetString(STR_AUTO_SCROLL_ON), IMG_GLOBAL_ACTIVATED, 1, EBR_ST_NOTIFYDURATION, SUCCESS_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_display_pop_up_error_opening_book
- * DESCRIPTION
- * Pop Up for Error Opening book
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_display_pop_up_error_opening_book(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup((PU8) GetString(STR_ERROR_OPENINIG_BOOK), IMG_GLOBAL_UNFINISHED, 1, EBR_ST_NOTIFYDURATION, ERROR_TONE);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_display_pop_up_empty_book
- * DESCRIPTION
- * Pop Up for Error Opening book
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_display_pop_up_empty_book(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup((PU8) GetString(STR_GLOBAL_EMPTY), IMG_GLOBAL_UNFINISHED, 1, EBR_ST_NOTIFYDURATION, ERROR_TONE);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_display_pop_up_format_not_supported
- * DESCRIPTION
- * Pop Up for File fomat not supported.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_display_pop_up_format_not_supported(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup(
- (U8*) GetString(STR_EBOOK_FORMAT_NOT_SUPPORTED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- ERROR_TONE);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_display_pop_up_default_settings_restored
- * DESCRIPTION
- * Pop Up for Resore defauklt settings.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_display_pop_up_default_settings_restored(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DeleteUptoScrID(SCR_FMGR_EXPLORER);
- IsBackHistory = MMI_TRUE;
- DisplayPopupCallBack(
- (PU8) GetString(STR_SUCESSFULL_RESTORE_DEFAULT),
- IMG_GLOBAL_ACTIVATED,
- 1,
- EBR_ST_NOTIFYDURATION,
- SUCCESS_TONE,
- ebr_entry_book_shel_screen);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_display_pop_up_default_settings_not_restored
- * DESCRIPTION
- * Pop Up for DDefauklt settings unsucessfull.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_display_pop_up_default_settings_not_restored(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup(
- (PU8) GetString(STR_UNSUCESSFULL_RESTORE_DEFAULT),
- IMG_GLOBAL_UNFINISHED,
- 1,
- EBR_ST_NOTIFYDURATION + EBR_ST_NOTIFYDURATION,
- ERROR_TONE);
- DeleteUptoScrID(EBOOK_OPEN_SCREENID);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_display_pop_up_default_settings_for_book_restored
- * DESCRIPTION
- * Pop Up for Default settings restored.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_display_pop_up_default_settings_for_book_restored(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup(
- (PU8) GetString(STR_SUCESSFULL_RESTORE_DEFAULT),
- IMG_GLOBAL_ACTIVATED,
- 1,
- EBR_ST_NOTIFYDURATION + EBR_ST_NOTIFYDURATION,
- SUCCESS_TONE);
- DeleteUptoScrID(EBOOK_OPEN_SCREENID);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_delete_upto_open_book_screen_id
- * DESCRIPTION
- * History Handling
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_delete_upto_open_book_screen_id(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DeleteUptoScrID(EBOOK_OPEN_SCREENID);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_go_back_history
- * DESCRIPTION
- * History handling
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_go_back_history(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_get_nfo_id_from_fmgr
- * DESCRIPTION
- * Function to get the Nf o id for File manager
- * PARAMETERS
- * file_name [IN]
- * file_path [IN]
- * file_ext [IN]
- * is_short [IN]
- * RETURNS
- * void
- *****************************************************************************/
- S32 ebr_app_get_nfo_id_from_fmgr(S8 *file_name, S8 *file_path, S8 *file_ext, BOOL is_short)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 nfo_id = ebr_frm_fmgr_pre_entry_open_book(file_name, file_path, file_ext);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ebr_frm_fmgr_set_nfo_id(nfo_id);
- /* Check wether NFo file is present or not. If not then cretae a new nfo file */
- if (nfo_id > 0)
- {
- nfo_id = ebr_frm_check_nfo_file_present(nfo_id);
- }
- ebr_frm_fmgr_set_nfo_id(nfo_id);
- return nfo_id;
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_frm_open_book_from_file_manager
- * DESCRIPTION
- * open a file from file manager
- * PARAMETERS
- * file_name [IN]
- * file_path [IN]
- * is_short [IN]
- * file_ext(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_frm_open_book_from_file_manager(S8 *file_name, S8 *file_path, BOOL is_short)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 drive_type;
- S32 nfo_id;
- PS8 file_ext;
- ebr_memory_type_enum memory_selected;
- pBOOL is_file_valid = FALSE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- pfnUnicodeStrcpy((PS8)g_ebook_app_cntx_p->ebr_file_mgr_file_path,(PS8)file_path);
- file_ext = mmi_fmgr_extract_ext_file_name((PS8) file_name);
- ebr_frm_fmgr_set_application_type();
- drive_type = ebr_fmgr_is_book_shelf_path(g_ebook_app_cntx_p->ebr_file_mgr_file_path);
- memory_selected = ebr_frm_get_drive_type();
- ebr_frm_fmgr_set_drive_type(drive_type);
- ebr_fmgr_set_file_name((PS8) file_name);
- ebr_frm_set_file_info_from_fmgr((S8*) file_name, g_ebook_app_cntx_p->ebr_file_mgr_file_path, file_ext, is_short);
- ebr_frm_fmgr_set_file_type((S8*) file_name);
- if (drive_type < 0)
- {
- nfo_id = -1;
- }
- else
- {
- nfo_id = ebr_app_get_nfo_id_from_fmgr((S8*) file_name, g_ebook_app_cntx_p->ebr_file_mgr_file_path, file_ext, is_short);
- }
- if (nfo_id > 0)
- {
- ebr_entry_open_book();
- }
- else
- {
- if (nfo_id == 0) /* nfo file dose not exist // Ask the user if he wants to add this in the bookshelf */
- {
- ebr_app_add_to_book_shelf();
- }
- else /* Means the book is not in the ebook Folder */
- {
- #ifndef MMI_ON_HARDWARE_P
- PopupNoSupport();
- #else /* MMI_ON_HARDWARE_P */
- ebr_frm_fmgr_set_drive_type(memory_selected);
- // Check here that the file is a valid file.
- // If not a valid file pop an error and no need to move the file
- is_file_valid = ebr_frm_check_file_validity(g_ebook_app_cntx_p->ebr_file_mgr_file_path, file_name);
- if (!is_file_valid)
- {
- ebr_app_display_pop_up_format_not_supported();
- }
- else
- {
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_ADD_TO_EBOOK_FOLDER),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetLeftSoftkeyFunction(ebr_fmgr_move_to_ebook_folder, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- #endif /* MMI_ON_HARDWARE_P */
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_add_to_book_shelf
- * DESCRIPTION
- * Add files from file manager to book shelf
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_add_to_book_shelf(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (ebr_frm_check_nfo_file_size())
- {
- DeleteNScrId(SCR_FMGR_APP_FILE_OPTION);
- ebr_app_dispaly_less_memory_pop_up();
- }
- else
- {
- switch (ebr_frm_add_to_book_shelf())
- {
- case EBR_FRM_NFO_CREATE_SUCCESS:
- ebr_entry_open_book();
- break;
- case EBR_FRM_NFO_CREATE_FILE_TYPE_NOT_SUPPORTED:
- DeleteNScrId(SCR_FMGR_APP_FILE_OPTION);
- ebr_app_display_pop_up_format_not_supported();
- break;
- case EBR_FRM_EMPTY_BOOK:
- DeleteNScrId(SCR_FMGR_APP_FILE_OPTION);
- ebr_app_display_pop_up_empty_book();
- break;
- default:
- DeleteNScrId(SCR_FMGR_APP_FILE_OPTION);
- ebr_app_display_pop_up_error_opening_book();
- break;
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_display_error_pop_up
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_display_error_pop_up(S32 result)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup((PU8) GetString(GetFileSystemErrorString(result)), IMG_GLOBAL_ERROR, 0, 1000, ERROR_TONE);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_dispaly_less_memory_pop_up
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_dispaly_less_memory_pop_up(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup((PU8) GetString(STR_EBOOK_MEMORY_LESS), IMG_GLOBAL_ERROR, 0, 1000, ERROR_TONE);
- }
- #ifdef __MMI_LANG_HINDI__
- /*****************************************************************************
- * FUNCTION
- * ebr_app_show_string_incomplete_pop_up
- * DESCRIPTION
- * Display incomplete popup
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_show_string_incomplete_pop_up(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup(
- (PU8) GetString(STR_INCOMPLETE_SEARCH_STRING),
- IMG_GLOBAL_WARNING,
- 1,
- EBR_ST_NOTIFYDURATION,
- WARNING_TONE);
- }
- #endif /* __MMI_LANG_HINDI__ */
- /*****************************************************************************
- * FUNCTION
- * ebr_app_clear_all_key_handlers
- * DESCRIPTION
- * Clear All key Handlers
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ebr_app_clear_all_key_handlers(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearKeyEvents();
- ClearAllKeyHandler();
- ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ebr_app_clear_all_key_handlers
- * DESCRIPTION
- * Highlight handler of ebook setting screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ebr_highlight_setting(S32 index)
- {
- if (index == EBR_TOTAL_NUMBER_OF_ITEM_BKSHLF - 1)
- {
- ChangeLeftSoftkey(STR_GLOBAL_EDIT, 0);
- SetLeftSoftkeyFunction(mmi_ebr_entry_select_drive, KEY_EVENT_UP);
- }
- else
- {
- ChangeLeftSoftkey(NULL, 0);
- SetLeftSoftkeyFunction(NULL, KEY_EVENT_UP);
- }
- }
- void mmi_ebr_entry_select_drive(void)
- {
- mmi_fmgr_sel_drv_and_enter(APP_EXTRA, mmi_ebr_save_drive_selection, g_ebookset_cntx_p->inlineHighligtItemSelectMemory);
- }
- void mmi_ebr_save_drive_selection(S8 drive_letter)
- {
- g_ebookset_cntx_p->inlineHighligtItemSelectMemory = drive_letter;
- }
- #endif /* __MMI_EBOOK_READER__ */