wgui_categories.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:657k
源码类别:
MTK
开发平台:
C/C++
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory620History
- * DESCRIPTION
- * Gets the history buffer for the Message Received screen
- * PARAMETERS
- * history_buffer [IN] Is the buffer into which the history data is stored
- * RETURNS
- * pointer to the history buffer
- *****************************************************************************/
- U8 *GetCategory620History(U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (history_buffer);
- }
- #endif /* defined(__MMI_SMART_MESSAGE_MT__) || (defined(__MMI_SMART_MESSAGE_MO__) && !defined(__MMI_MESSAGES_EMS__)) */
- /*****************************************************************************
- * [Category166]
- *
- * This category draws a full screen animation (align at center of screen)
- * Used by power on/off animation
- * This screen also able to mimic a static image with animation's behavior
- *
- * **********************
- * * *
- * * *
- * * *
- * * *
- * * *
- * * Animation *
- * * *
- * * *
- * * *
- * * *
- * * *
- * **********************
- *
- *****************************************************************************/
- static void (*cat166_animation_complete_callback) (GDI_RESULT result);
- static PS8 cat166_animation_name;
- static U16 cat166_animation_id;
- static S32 cat166_image_offset_x;
- static S32 cat166_image_offset_y;
- static S32 cat166_image_width;
- static S32 cat166_image_height;
- static BOOL cat166_is_gif_anim;
- static U16 cat166_need_resize;
- static BOOL cat166_is_invalid;
- static GDI_HANDLE cat166_animation_handle = GDI_ERROR_HANDLE;
- /*****************************************************************************
- * FUNCTION
- * Cat166AnimationMimicTimer
- * DESCRIPTION
- * Mimic animation's play complete call back function for static images
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void Cat166AnimationMimicTimer(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Mimic GDI to return last frame callback */
- if (cat166_animation_complete_callback != NULL)
- {
- if (cat166_is_invalid)
- {
- /* error file */
- cat166_animation_complete_callback(-1);
- }
- else
- {
- cat166_animation_complete_callback(GDI_GIF_LAST_FRAME);
- gui_start_timer(1000, Cat166AnimationMimicTimer);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * DrawCate166CategoryControlArea
- * DESCRIPTION
- *
- * PARAMETERS
- * coordinate [?]
- * RETURNS
- * void
- *****************************************************************************/
- void DrawCate166CategoryControlArea(dm_coordinates *coordinate)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- RedrawCategory166Screen();
- }
- /*****************************************************************************
- * FUNCTION
- * cat166_animation_complete_callback_failed
- * DESCRIPTION
- * the animation of category screen no.166 is failed, inform application
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void cat166_animation_complete_callback_failed(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (cat166_animation_complete_callback != NULL)
- {
- cat166_animation_complete_callback(-1);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * cat166_animation_complete_callback_int
- * DESCRIPTION
- * category screen no.166 default animation callback
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void cat166_animation_complete_callback_int(GDI_RESULT result)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (result < 0)
- {
- /* animation is terminated abnormally,
- * wait for a while for redraw category no.166
- * to accomplish its job */
- gui_start_timer(200, cat166_animation_complete_callback_failed);
- }
- else
- {
- /* animation is terminated normally,
- * execute application callback */
- if (cat166_animation_complete_callback != NULL)
- {
- cat166_animation_complete_callback(result);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * RedrawCategory166Screen
- * DESCRIPTION
- * Redraws sategory 166 screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void RedrawCategory166Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- GDI_RESULT result;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_hide_animations();
- gdi_layer_clear(GDI_COLOR_BLACK);
- gui_reset_clip();
- if (cat166_animation_name != NULL)
- {
- /* source from file */
- if (cat166_is_gif_anim)
- {
- /* animation, use GDI's auto play animation */
- gdi_image_set_animation_last_frame_callback(cat166_animation_complete_callback_int);
- /* 070406 SVG support Start */
- if (cat166_need_resize)
- {
- cat166_animation_handle = GDI_ERROR_HANDLE;
- result = gdi_image_draw_animation_resized_file(
- cat166_image_offset_x,
- cat166_image_offset_y,
- cat166_image_width,
- cat166_image_height,
- (U8*) cat166_animation_name,
- &cat166_animation_handle/*NULL*/);
- }
- else
- {
- cat166_animation_handle = GDI_ERROR_HANDLE;
- result = gdi_image_draw_animation_file(
- cat166_image_offset_x,
- cat166_image_offset_y,
- (U8*) cat166_animation_name,
- &cat166_animation_handle/*NULL*/);
- }
- /* 070406 SVG support End */
- /* if is 1 frame gif, treat as still image */
- if (result == GDI_IMAGE_IS_STILL_IMAGE)
- {
- gui_start_timer(200, Cat166AnimationMimicTimer);
- }
- }
- else
- {
- if (cat166_need_resize)
- {
- /* static image */
- result = gdi_image_draw_resized_file(
- cat166_image_offset_x,
- cat166_image_offset_y,
- cat166_image_width,
- cat166_image_height,
- cat166_animation_name);
- if (result < 0)
- {
- /* invalid file */
- cat166_is_invalid = TRUE;
- }
- gui_start_timer(200, Cat166AnimationMimicTimer);
- }
- else
- {
- /* static image */
- result = gdi_image_draw_file(cat166_image_offset_x, cat166_image_offset_y, cat166_animation_name);
- if (result < 0)
- {
- /* invalid file */
- cat166_is_invalid = TRUE;
- }
- gui_start_timer(200, Cat166AnimationMimicTimer);
- }
- }
- }
- else
- {
- /* source from id */
- if (cat166_is_gif_anim)
- {
- /* animation, use GDI's auto play animation */
- gdi_image_set_animation_last_frame_callback(cat166_animation_complete_callback_int);
- cat166_animation_handle = GDI_ERROR_HANDLE;
- result = gdi_image_draw_animation(cat166_image_offset_x, cat166_image_offset_y, (U8*) GetImage(cat166_animation_id), &cat166_animation_handle/*NULL*/); /* 033105 Calvin modified */
- /* if is 1 frame gif, treat as still image */
- if (result == GDI_IMAGE_IS_STILL_IMAGE)
- {
- gui_start_timer(200, Cat166AnimationMimicTimer);
- }
- }
- else
- {
- /* static image */
- gdi_image_draw_id(cat166_image_offset_x, cat166_image_offset_y, cat166_animation_id);
- gui_start_timer(200, Cat166AnimationMimicTimer);
- }
- }
- gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory166Screen
- * DESCRIPTION
- * Show sategory 166 screen.
- * PARAMETERS
- * image_id [IN] Image id
- * image_filename [IN] Image_filename
- * animation_complete_callback [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory166Screen(U16 image_id, S8 *image_filename, void (*animation_complete_callback) (GDI_RESULT))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- S32 image_width;
- S32 image_height;
- GDI_RESULT ret;
- /* PMT DLT_FIXES_157 - TK 20060225 START */
- U16 img_type;
- /* PMT DLT_FIXES_157 - TK 20060225 END */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /*
- * If image_filename != NULL, means will use image from file as first priority.
- * We will use image_id when the file is not able to play correctly.
- */
- /* init var */
- cat166_animation_complete_callback = animation_complete_callback;
- cat166_animation_id = image_id;
- cat166_animation_name = image_filename;
- cat166_image_offset_x = 0;
- cat166_image_offset_y = 0;
- cat166_is_gif_anim = FALSE;
- cat166_need_resize = FALSE;
- cat166_is_invalid = FALSE;
- /* full screen category */
- entry_full_screen();
- /* clear all key handlers */
- clear_category_screen_key_handlers();
- clear_left_softkey();
- clear_right_softkey();
- /*** get image parameters ***/
- /* source from file */
- if (cat166_animation_name != NULL)
- {
- ret = gdi_image_get_dimension_file(cat166_animation_name, &image_width, &image_height);
- if (ret < 0)
- {
- /* set filename to NULL, will skip play this file */
- cat166_animation_name = NULL;
- gdi_layer_clear(GDI_COLOR_BLACK);
- gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
- if (cat166_animation_complete_callback != NULL)
- {
- cat166_animation_complete_callback(-1);
- }
- return;
- }
- else
- {
- /* check if is gif animation or not */
- switch (gdi_image_get_type_from_file(cat166_animation_name))
- {
- case GDI_IMAGE_TYPE_JPG_FILE:
- case GDI_IMAGE_TYPE_PNG_FILE://082906 png resize
- cat166_is_gif_anim = FALSE;
- cat166_need_resize = TRUE;
- break;
- case GDI_IMAGE_TYPE_GIF_FILE:
- case GDI_IMAGE_TYPE_SVG_FILE://070406 SVG support
- cat166_is_gif_anim = TRUE;
- cat166_need_resize = TRUE;//070406 resize screensaver
- break;
- case GDI_IMAGE_TYPE_M3D_FILE:
- cat166_is_gif_anim = TRUE;
- cat166_need_resize = FALSE;
- break;
- default:
- cat166_is_gif_anim = FALSE;
- cat166_need_resize = FALSE;
- break;
- }
- if (cat166_need_resize == TRUE)
- {
- if ((image_width <= UI_device_width) && (image_height <= UI_device_height))
- {
- cat166_need_resize = FALSE;
- }
- }
- }
- }
- /* source from ID */
- if (cat166_animation_id != 0)
- {
- /* we assume internal resource is always correct */
- gdi_image_get_dimension_id(cat166_animation_id, &image_width, &image_height);
- /* check if is gif animation or not */
- /* PMT DLT_FIXES_157 - TK 20060225 START */
- img_type = gdi_image_get_type_from_id(cat166_animation_id);
- #ifdef __MMI_DOWNLOADABLE_THEMES_SUPPORT__
- if (img_type == IMAGE_TYPE_GIF || img_type == IMAGE_TYPE_GIF_FILE_OFFSET || img_type == IMAGE_TYPE_M3D || img_type == IMAGE_TYPE_SVG)//070406 SVG support
- #else
- if (img_type == IMAGE_TYPE_GIF || img_type == IMAGE_TYPE_M3D || img_type == IMAGE_TYPE_SVG)
- #endif
- /* PMT DLT_FIXES_157 - TK 20060225 END */
- {
- cat166_is_gif_anim = TRUE;
- }
- else
- {
- cat166_is_gif_anim = FALSE; /* still image */
- }
- }
- /* calc image draw pos, check if need resize */
- if (cat166_need_resize)
- {
- gdi_image_util_fit_bbox(
- UI_device_width,
- UI_device_height,
- image_width,
- image_height,
- &cat166_image_offset_x,
- &cat166_image_offset_y,
- &cat166_image_width,
- &cat166_image_height);
- }
- else
- {
- cat166_image_offset_x = (UI_device_width - image_width) >> 1;
- cat166_image_offset_y = (UI_device_height - image_height) >> 1;
- }
- ExitCategoryFunction = ExitCategory166Screen;
- dm_data.s32CatId = MMI_CATEGORY166_ID;
- dm_data.s32flags = DM_NO_FLAGS;
- dm_data.s32ScrId = GetActiveScreenId();
- dm_setup_data(&dm_data);
- dm_register_category_controlled_callback(DrawCate166CategoryControlArea);
- dm_redraw_category_screen();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory166Screen
- * DESCRIPTION
- * Exit Category166 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory166Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* stop animtion */
- gdi_image_stop_animation_all();
- if(cat166_animation_handle != GDI_ERROR_HANDLE)
- {
- gdi_image_stop_animation(cat166_animation_handle);
- cat166_animation_handle = GDI_ERROR_HANDLE;
- }
- gui_cancel_timer(Cat166AnimationMimicTimer);
- gui_cancel_timer(cat166_animation_complete_callback_failed);
- cat166_animation_complete_callback = NULL;
- }
- /*****************************************************************************
- * FUNCTION
- * StopCategory166Animation
- * DESCRIPTION
- * Stop Category166 screen's animation
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void StopCategory166Animation(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* stop animtion */
- gdi_image_stop_animation_all();
- gui_cancel_timer(Cat166AnimationMimicTimer);
- }
- /* Category 170: SAT list menu screen (Equivalent to Cat-32) */
- /*****************************************************************************
- * FUNCTION
- * ShowCategory170Screen
- * DESCRIPTION
- * Displays the Dynamic menu screen
- * PARAMETERS
- * title [IN] Title for the screen
- * title_icon [IN] Icon displayed with the title
- * left_softkey [IN] Left softkey label
- * left_softkey_icon [IN] Left softkey icon
- * right_softkey [IN] Right softkey label
- * right_softkey_icon [IN] Right softkey icon
- * number_of_items [IN] Number of items
- * list_of_items [IN] Array of items
- * list_of_icons [IN] Array of icons
- * flags [IN] Flags (Always set to 0. Reserved for future use.)
- * highlighted_item [IN] Highlighted index
- * history_buffer [IN] History buffer
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory170Screen(
- U8 *title,
- PU8 title_icon,
- U8 *left_softkey,
- PU8 left_softkey_icon,
- U8 *right_softkey,
- PU8 right_softkey_icon,
- S32 number_of_items,
- U8 **list_of_items,
- PU8 *list_of_icons,
- S32 flags,
- S32 highlighted_item,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- S32 i;
- U8 flag = 0;
- U8 h_flag;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(flags);
- MMI_disable_title_shortcut_display = 0;
- disable_menu_shortcut_box_display = 0;
- gdi_layer_lock_frame_buffer();
- create_fixed_icontext_menuitems();
- resize_fixed_list(MMI_content_width, MMI_content_height);
- associate_fixed_icontext_list();
- ShowListCategoryScreen(
- (UI_string_type) title,
- title_icon,
- (UI_string_type) left_softkey,
- left_softkey_icon,
- (UI_string_type) right_softkey,
- right_softkey_icon,
- number_of_items);
- for (i = 0; i < number_of_items; i++)
- {
- add_fixed_icontext_item((UI_string_type) list_of_items[i], list_of_icons[i]);
- if (list_of_icons[i] != UI_NULL_IMAGE)
- {
- flag = 1;
- }
- }
- resize_fixed_icontext_menuitems(0, get_menu_item_height());
- if (flag)
- {
- set_fixed_icontext_positions(MMI_MENUITEM_HEIGHT + 2, 0, 1, 0);
- }
- else
- {
- set_fixed_icontext_positions(1, 0, 1, 0);
- MMI_fixed_icontext_menuitem.scroll_width = MMI_fixed_icontext_menuitem.width - 2;
- }
- h_flag = set_list_menu_category_history(MMI_CATEGORY170_ID, history_buffer);
- if (h_flag)
- {
- fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
- }
- else
- {
- fixed_list_goto_item_no_redraw(highlighted_item);
- }
- gdi_layer_unlock_frame_buffer();
- ExitCategoryFunction = ExitCategory170Screen;
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY170_ID;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- } /* end of ShowCategory170Screen */
- /*****************************************************************************
- * FUNCTION
- * ExitCategory170Screen
- * DESCRIPTION
- * Exits the dynamic menu screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory170Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- disable_menu_shortcut_box_display = 0;
- close_scrolling_title();
- ClearHighlightHandler();
- reset_softkeys();
- reset_menu_shortcut_handler();
- reset_fixed_list();
- } /* end of ExitCategory170Screen */
- /* Category 172: SAT Radio list (Equivalent to Cat-107) */
- /*****************************************************************************
- * FUNCTION
- * category172_list_highlight_handler
- * DESCRIPTION
- * highlight handler of category 172
- * PARAMETERS
- * item_index [IN] Index of highlighted item
- * RETURNS
- * void
- *****************************************************************************/
- void category172_list_highlight_handler(S32 item_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_menu_shortcut_number = item_index + 1;
- #ifndef __MMI_RADIO_BUTTON_HIGHLIGHT_NO_SELECT__
- radio_list_handle_item_select_no_draw(item_index);
- #endif
- MMI_highlighted_item_text = get_item_text(item_index);
- gdi_layer_lock_frame_buffer();
- MMI_list_highlight_handler(item_index);
- gdi_layer_unlock_frame_buffer();
- #if(UI_ENABLE_POP_UP_DESCRIPTIONS)
- gui_pop_up_description_stop_scroll();
- wgui_current_pop_up_description_index = item_index;
- #endif /* (UI_ENABLE_POP_UP_DESCRIPTIONS) */
- } /* end of category172_list_highlight_handler */
- /*****************************************************************************
- * FUNCTION
- * ShowCategory172Screen
- * DESCRIPTION
- * Displays the Dynamic radio list
- * PARAMETERS
- * title [IN] Title for the screen
- * title_icon [IN] Icon displayed with the title
- * left_softkey [IN] Left softkey label
- * left_softkey_icon [IN] Left softkey icon
- * right_softkey [IN] Right softkey label
- * right_softkey_icon [IN] Right softkey icon
- * number_of_items [IN] Number of items
- * list_of_items [IN] Array of items
- * flags [IN] Flags (Always set to 0. Reserved for future use.)
- * highlighted_item [IN] Highlighted index
- * history_buffer [IN] History buffer
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory172Screen(
- U8 *title,
- PU8 title_icon,
- U8 *left_softkey,
- PU8 left_softkey_icon,
- U8 *right_softkey,
- PU8 right_softkey_icon,
- S32 number_of_items,
- U8 **list_of_items,
- S32 flags,
- S32 highlighted_item,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- S32 i;
- U8 h_flag;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(flags);
- MMI_disable_title_shortcut_display = 1;
- disable_menu_shortcut_box_display = 1;
- gdi_layer_lock_frame_buffer();
- create_fixed_twostate_menuitems(get_image(RADIO_ON_IMAGE_ID), get_image(RADIO_OFF_IMAGE_ID));
- resize_fixed_list(MMI_content_width, MMI_content_height);
- associate_fixed_twostate_list();
- ShowListCategoryScreen(
- (UI_string_type) title,
- title_icon,
- (UI_string_type) left_softkey,
- left_softkey_icon,
- (UI_string_type) right_softkey,
- right_softkey_icon,
- number_of_items);
- resize_fixed_twostate_menuitems(0, MMI_MENUITEM_HEIGHT);
- set_fixed_twostate_positions(MMI_MENUITEM_HEIGHT, 0, 1, 0);
- register_hide_menu_shortcut(UI_dummy_function);
- for (i = 0; i < number_of_items; i++)
- {
- add_fixed_twostate_item((UI_string_type) list_of_items[i]);
- }
- register_fixed_list_highlight_handler(category172_list_highlight_handler);
- h_flag = set_list_menu_category_history(MMI_CATEGORY172_ID, history_buffer);
- if (h_flag)
- {
- fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
- }
- else
- {
- fixed_list_goto_item_no_redraw(highlighted_item);
- }
- select_fixed_twostate_item(MMI_fixed_list_menu.highlighted_item);
- setup_scrolling_title();
- gdi_layer_unlock_frame_buffer();
- ExitCategoryFunction = ExitCategory172Screen;
- dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY172_ID;
- dm_data.s32flags = DM_SCROLL_TITLE;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- } /* end of ShowCategory172Screen */
- /*****************************************************************************
- * FUNCTION
- * ExitCategory172Screen
- * DESCRIPTION
- * Exits the dynamic menu screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory172Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- disable_menu_shortcut_box_display = 0;
- close_scrolling_title();
- ClearHighlightHandler();
- reset_softkeys();
- reset_menu_shortcut_handler();
- reset_fixed_list();
- } /* end of ExitCategory172Screen */
- /* Category 174: SAT list menu screen (Equivalent to Cat-32), with pop up hints */
- /*****************************************************************************
- * FUNCTION
- * Category174ChangeItemText
- * DESCRIPTION
- * chaneg text of particalue menu item ofcategory 174
- * PARAMETERS
- * index [IN] Index of the menuitem
- * text [IN] String of menuitem text
- * RETURNS
- * void
- *****************************************************************************/
- void Category174ChangeItemText(S32 index, U8 *text)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_icontext_menuitems[index].item_text = (UI_string_type) text;
- } /* end of Category174ChangeItemText */
- /*****************************************************************************
- * FUNCTION
- * Category174ChangeItemIcon
- * DESCRIPTION
- * chaneg icon of particalue menu item ofcategory 174
- * PARAMETERS
- * index [IN] Index of the menuitem
- * image_ID [IN] Image id of menuitem icon
- * RETURNS
- * void
- *****************************************************************************/
- void Category174ChangeItemIcon(S32 index, U16 image_ID)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_icontext_menuitems[index].item_icon = (PU8) get_image(image_ID);
- } /* end of Category174ChangeItemIcon *//* 0331 */
- /*****************************************************************************
- * FUNCTION
- * Category174ChangeItemDescription
- * DESCRIPTION
- * chaneg description of popup of particalue menu item ofcategory 174
- * PARAMETERS
- * index [IN] Index of the menuitem
- * text [IN] String value of hint data of menuitem.
- * RETURNS
- * void
- *****************************************************************************/
- void Category174ChangeItemDescription(S32 index, U8 *text)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_pop_up_description_strings[index].text_strings[0] = (UI_string_type) text;
- #ifdef __MMI_UI_HINT_TOGGLE_TRANSITION__
- wgui_setup_pop_up_description_transition();
- #endif
- } /* end of Category174ChangeItemDescription */
- /*****************************************************************************
- * FUNCTION
- * ShowCategory174Screen
- * DESCRIPTION
- * Displays the Dynamic menu screen with description.
- * PARAMETERS
- * title [IN] Title for the screen
- * title_icon [IN] Icon displayed with the title
- * left_softkey [IN] Left softkey label
- * left_softkey_icon [IN] Left softkey icon
- * right_softkey [IN] Right softkey label
- * right_softkey_icon [IN] Right softkey icon
- * number_of_items [IN] Number of items
- * list_of_items [IN] Array of items
- * list_of_icons [IN] Array of icons
- * list_of_descriptions [IN]
- * flags [IN] Flags (Always set to 0. Reserved for future use.)
- * highlighted_item [IN] Highlighted index
- * history_buffer [IN] History buffer
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory174Screen(
- U8 *title,
- PU8 title_icon,
- U8 *left_softkey,
- PU8 left_softkey_icon,
- U8 *right_softkey,
- PU8 right_softkey_icon,
- S32 number_of_items,
- U8 **list_of_items,
- PU8 *list_of_icons,
- U8 **list_of_descriptions,
- S32 flags,
- S32 highlighted_item,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- S32 i;
- U8 flag = 0;
- U8 h_flag;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(flags);
- MMI_disable_title_shortcut_display = 1;
- disable_menu_shortcut_box_display = 1;
- gdi_layer_lock_frame_buffer();
- create_fixed_icontext_menuitems();
- associate_fixed_icontext_list();
- ShowListCategoryScreen(
- (UI_string_type) title,
- title_icon,
- (UI_string_type) left_softkey,
- left_softkey_icon,
- (UI_string_type) right_softkey,
- right_softkey_icon,
- number_of_items);
- setup_scrolling_title();
- if (list_of_descriptions == NULL)
- {
- for (i = 0; i < number_of_items; i++)
- {
- add_fixed_icontext_item((UI_string_type) list_of_items[i], (PU8) list_of_icons[i]);
- wgui_pop_up_description_strings[i].text_strings[0] = NULL;
- if (list_of_icons[i] != UI_NULL_IMAGE)
- {
- flag = 1;
- }
- }
- }
- else
- {
- for (i = 0; i < number_of_items; i++)
- {
- add_fixed_icontext_item((UI_string_type) list_of_items[i], (PU8) list_of_icons[i]);
- wgui_pop_up_description_strings[i].text_strings[0] = (UI_string_type) list_of_descriptions[i];
- if (list_of_icons[i] != UI_NULL_IMAGE)
- {
- flag = 1;
- }
- }
- }
- resize_fixed_icontext_menuitems(0, MMI_MENUITEM_HEIGHT); /* 090605 Service Calvin modified */
- if (flag)
- {
- set_fixed_icontext_positions(MMI_MENUITEM_HEIGHT + 2, 0, 1, 0);
- }
- else
- {
- set_fixed_icontext_positions(1, 0, 1, 0);
- MMI_fixed_icontext_menuitem.scroll_width = MMI_fixed_icontext_menuitem.width - 2;
- }
- h_flag = set_list_menu_category_history(MMI_CATEGORY174_ID, history_buffer);
- if (h_flag)
- {
- fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
- }
- else
- {
- fixed_list_goto_item_no_redraw(highlighted_item);
- }
- set_pop_up_descriptions(1, number_of_items, MMI_fixed_list_menu.highlighted_item);
- gdi_layer_unlock_frame_buffer();
- ExitCategoryFunction = ExitCategory174Screen;
- dm_data.s32flags = DM_SCROLL_TITLE;
- dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY174_ID;
- dm_data.s32flags |= DM_CLEAR_SCREEN_BACKGROUND;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- } /* end of ShowCategory174Screen */
- /*****************************************************************************
- * FUNCTION
- * ExitCategory174Screen
- * DESCRIPTION
- * Exits the dynamic menu screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory174Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_disable_title_shortcut_display = 0;
- disable_menu_shortcut_box_display = 0;
- close_scrolling_title();
- ClearHighlightHandler();
- reset_softkeys();
- reset_pop_up_descriptions();
- reset_menu_shortcut_handler();
- reset_fixed_list();
- } /* end of ExitCategory174Screen */
- #ifdef __J2ME__
- UI_filled_area *wgui_cat16_backup_filler = NULL;
- /* 011507 menu Start */
- void wgui_cat176_set_jui_menu_filler(void)
- {
- if (wgui_cat16_backup_filler == NULL)
- {
- wgui_cat16_backup_filler = MMI_fixed_list_menu.normal_filler;
- MMI_fixed_list_menu.normal_filler = current_MMI_theme->general_background_filler;
- }
- }
- void wgui_cat176_reset_jui_menu_filler(void)
- {
- if (wgui_cat16_backup_filler != NULL)
- {
- MMI_fixed_list_menu.normal_filler = wgui_cat16_backup_filler;
- wgui_cat16_backup_filler = NULL;
- }
- }
- /* 011507 menu End */
- /*****************************************************************************
- * FUNCTION
- * RedrawCategory176Screen
- * DESCRIPTION
- * Redraws the dynamic menu screen (For SIM Application Toolkit)
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- //////////////////////////////////////////////////////////////////////
- ///
- /// Category 176 is used by java.
- /// It is modify from Category 170..
- /// and remove keypad register, scrolling title, shortcut, blt out
- ///
- void RedrawCategory176Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- UI_filled_area *f = current_MMI_theme->general_background_filler;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- clear_buttonbar();
- gui_reset_clip();
- gui_draw_filled_area(0, 0, 24, MMI_multiline_inputbox.height, f);
- draw_title();
- //move_fixed_list(0,MMI_title_height);//120606 jui menu
- show_fixed_list();
- show_softkey_background();
- show_left_softkey();
- show_right_softkey();
- gdi_layer_unlock_frame_buffer();
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory176Screen
- * DESCRIPTION
- * Displays the Dynamic menu screen
- * PARAMETERS
- * title [IN] Title for the screen
- * title_icon [IN] Icon displayed with the title
- * left_softkey [IN] Left softkey label
- * left_softkey_icon [IN] Left softkey icon
- * right_softkey [IN] Right softkey label
- * right_softkey_icon [IN] Right softkey icon
- * number_of_items [IN] Number of items
- * list_of_items [IN] Array of items
- * list_of_icons [IN] Array of icons
- * flags [IN] Flags (Always set to 0. Reserved for future use.)
- * highlighted_item [IN] Highlighted index
- * is_full_screen [IN] is full screen or not
- * history_buffer [IN] History buffer
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory176Screen(
- U8 *title,
- PU8 title_icon,
- U8 *left_softkey,
- PU8 left_softkey_icon,
- U8 *right_softkey,
- PU8 right_softkey_icon,
- S32 number_of_items,
- U8 **list_of_items,
- PU8 *list_of_icons,
- S32 flags,
- S32 highlighted_item,
- U32 is_full_screen,//120606 jui menu
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- U8 flag = 0;
- U8 h_flag;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(flags);
- MMI_disable_title_shortcut_display = 1;
- gdi_layer_lock_frame_buffer();
- create_fixed_icontext_menuitems();
- associate_fixed_icontext_list();
- MMI_fixed_icontext_menuitem.flags &= ~UI_MENUITEM_MARQUEE_SCROLL;
- /* 011507 menu Start */
- //wgui_cat16_backup_filler = MMI_fixed_list_menu.normal_filler;
- //MMI_fixed_list_menu.normal_filler = current_MMI_theme->general_background_filler;
- /* Title */
- MMI_title_string = (UI_string_type) title;
- MMI_title_icon = title_icon;
- /* ShortCut */
- MMI_menu_shortcut_number = -1;
- /* Softkeys */
- set_left_softkey_label((UI_string_type) left_softkey);
- set_left_softkey_icon(left_softkey_icon);
- set_right_softkey_label((UI_string_type) right_softkey);
- set_right_softkey_icon(right_softkey_icon);
- /* List */
- MMI_current_menu_type = LIST_MENU;
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_block_list_effect();
- #endif
- for (i = 0; i < number_of_items; i++)
- {
- add_fixed_icontext_item((UI_string_type) list_of_items[i], list_of_icons[i]);
- if (list_of_icons[i] != UI_NULL_IMAGE)
- {
- flag = 1;
- }
- }
- move_fixed_list(0,MMI_title_height);//120606 jui menu
- if(is_full_screen)
- {
- resize_fixed_list(MMI_content_width, UI_device_height-MMI_title_height-MMI_button_bar_height);
- }
- else
- {
- resize_fixed_list(MMI_content_width, MMI_content_height);
- }
- resize_fixed_icontext_menuitems(0, MMI_ICONTEXT_MENUITEM_HEIGHT);
- if (flag)
- {
- set_fixed_icontext_positions(MMI_MENUITEM_HEIGHT + 2, 0, 1, 0);
- }
- else
- {
- set_fixed_icontext_positions(1, 0, 1, 0);
- MMI_fixed_icontext_menuitem.scroll_width = MMI_fixed_icontext_menuitem.width - 2;
- }
- h_flag = set_list_menu_category_history(MMI_CATEGORY176_ID, history_buffer);
- if (h_flag)
- {
- fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
- }
- else
- {
- fixed_list_goto_item_no_redraw(highlighted_item);
- }
- gui_set_multilayer_mask(gui_get_multilayer_mask() & ~UI_MUL_BKG_SUBMENU);
- gui_set_multilayer_mask(gui_get_multilayer_mask() & ~UI_MUL_BKG_MAINMENU);
- gdi_layer_unlock_frame_buffer();
- MMI_fixed_list_menu.act_lcd_handle = GDI_LCD_MAIN_LCD_HANDLE;
- MMI_fixed_list_menu.act_layer_handle = jui_layer_handle;
- SetListScreenFunctions(MMI_CATEGORY176_ID);
- RedrawCategoryFunction = RedrawCategory176Screen;
- ExitCategoryFunction = ExitCategory176Screen;
- RedrawCategoryFunction();
- } /* end of ShowCategory176Screen */
- /*****************************************************************************
- * FUNCTION
- * ExitCategory176Screen
- * DESCRIPTION
- * Exits the dynamic menu screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory176Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- disable_menu_shortcut_box_display = 0;
- /* 011507 menu Start */
- //MMI_fixed_list_menu.normal_filler = wgui_cat16_backup_filler;
- close_scrolling_title();
- ClearHighlightHandler();
- reset_softkeys();
- reset_menu_shortcut_handler();
- reset_fixed_list();
- MMI_fixed_list_menu.act_lcd_handle = GDI_LCD_MAIN_LCD_HANDLE;
- MMI_fixed_list_menu.act_layer_handle = GDI_LAYER_MAIN_BASE_LAYER_HANDLE;
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_unblock_list_effect();
- #endif
- }
- #endif
- /*****************************************************************************
- * FUNCTION
- * redraw_fixed_list_and_title_bar
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void redraw_fixed_list_and_title_bar(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if(UI_BLINKING_CURSOR_SUPPORT)
- StopMyTimer(BLINKING_CURSOR);
- #endif
- draw_title();
- redraw_fixed_list();
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetRightSoftkeyFunction(UI_dummy_function, KEY_EVENT_DOWN);
- }
- /* Phonebook */
- /*****************************************************************************
- * FUNCTION
- * show_phonebook_list_inputbox
- * DESCRIPTION
- *
- * PARAMETERS
- * pbName [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void show_phonebook_list_inputbox(PU8 pbName)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 inputbox_x, inputbox_y, inputbox_width, inputbox_height;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_setup_input_information(0, 1, UI_device_width >> 1, (MMI_title_y + MMI_title_height) - 2);
- inputbox_x = wgui_inputbox_information_bar_width;
- inputbox_y = 0;
- inputbox_width = UI_device_width - wgui_inputbox_information_bar_width;
- inputbox_height = MMI_title_height;
- wgui_setup_singleline_inputbox(
- inputbox_x,
- inputbox_y,
- inputbox_width,
- inputbox_height,
- pbName,
- 7,
- MMI_CATEGORY53_ID,
- get_string(STR_GLOBAL_BACK),
- get_image(IMG_GLOBAL_BACK),
- INPUT_TYPE_ALPHANUMERIC_LOWERCASE | INPUT_TYPE_USE_ENCODING_BASED_LENGTH,
- NULL,
- 1);
- wgui_singleline_inputbox_RSK_function = redraw_fixed_list_and_title_bar;
- }
- /* MTK end */
- static S32 input_box_y = 0, input_box_x = 0;
- static U16 cat200_search_img = 0;
- S32(*cat200_search_function) (U8 *);
- UI_filled_area yellowcat200wgui_color_dialog_background = {UI_FILLED_AREA_TYPE_COLOR,
- UI_NULL_IMAGE,
- NULL,
- {238, 243, 33, 100},
- {0, 0, 0, 0},
- {0, 0, 0, 100},
- {50, 50, 50, 100},
- 0
- };
- UI_filled_area cat200_inputbox_BG_filler =
- {
- UI_FILLED_AREA_TYPE_COLOR,
- UI_NULL_IMAGE,
- NULL,
- {255, 222, 255, 100},
- {0, 0, 0, 0},
- {255, 255, 255, 100},
- {255, 255, 255, 100},
- 0
- };
- /* theme of single input box of enter pin screen */
- UI_single_line_input_box_theme cat200_singleline_inputbox_theme = { &cat200_inputbox_BG_filler,
- &cat200_inputbox_BG_filler,
- &cat200_inputbox_BG_filler,
- {0, 0, 0, 100},
- {128, 128, 128, 100},
- {0, 0, 0, 100},
- {255, 255, 255, 100},
- {51, 88, 171, 100},
- {255, 0, 0, 100},
- &UI_DEFAULT_FONT,
- 1,
- UI_SINGLE_LINE_INPUT_BOX_CENTER_Y,
- '*'
- };
- /*****************************************************************************
- * FUNCTION
- * SetCategory200LeftSoftkeyFunction
- * DESCRIPTION
- * set the right soft key function handler of category 200
- * PARAMETERS
- * f [IN]
- * k [IN]
- * function(?) [IN] Pointer
- * key(?) [IN] Event type
- * RETURNS
- * void
- *****************************************************************************/
- void SetCategory200LeftSoftkeyFunction(void (*f) (void), MMI_key_event_type k)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_singleline_inputbox_LSK_function = f;
- }
- /*****************************************************************************
- * FUNCTION
- * SetCategory200RightSoftkeyFunction
- * DESCRIPTION
- * set the right soft key function handler of category 200
- * PARAMETERS
- * f [IN]
- * k [IN]
- * function(?) [IN] Pointer
- * key(?) [IN] Event type
- * RETURNS
- * void
- *****************************************************************************/
- void SetCategory200RightSoftkeyFunction(void (*f) (void), MMI_key_event_type k)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(k);
- wgui_singleline_inputbox_RSK_function = f;
- }
- /*****************************************************************************
- * FUNCTION
- * RegisterCat200SearchFunction
- * DESCRIPTION
- * search function register by application
- * PARAMETERS
- * search_function [IN]
- * function(?) [IN] Pointer
- * RETURNS
- * void
- *****************************************************************************/
- void RegisterCat200SearchFunction(S32(*search_function) (U8 *))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (search_function)
- {
- cat200_search_function = search_function;
- }
- }
- BOOL(*wgui_check_application_present) (S32 *max_number) = NULL;
- /*****************************************************************************
- * FUNCTION
- * Register_appl_present_function
- * DESCRIPTION
- *
- * PARAMETERS
- * application_present_function [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void Register_appl_present_function(BOOL(*application_present_function) (S32 *max_number))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_check_application_present = application_present_function;
- }
- /*****************************************************************************
- * FUNCTION
- * refresh_search_list_change_list
- * DESCRIPTION
- * input call back function of category200 multi tap
- * PARAMETERS
- * no_entries [IN]
- * UI_character_type(?) [IN] Inp
- * RETURNS
- * void
- *****************************************************************************/
- void refresh_search_list_change_list(S32 no_entries)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 shortcut_width;
- S32 max_entries = 0;
- BOOL showOption, application_present;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_list_menu.highlighted_item = 0;
- MMI_fixed_list_menu.n_items = no_entries;
- MMI_fixed_list_menu.displayed_items = no_entries;
- if (wgui_check_application_present)
- {
- application_present = wgui_check_application_present(&max_entries);
- }
- else
- {
- application_present = MMI_FALSE;
- }
- if (application_present)
- {
- shortcut_width = set_menu_item_count(max_entries) + 7; /* number of words goes beyond this limit, and increases at the run time */
- }
- else
- {
- shortcut_width = set_menu_item_count(no_entries) + 7;
- }
- resize_menu_shortcut_handler(shortcut_width, MMI_title_height);
- move_menu_shortcut_handler(UI_device_width - shortcut_width, MMI_title_y);
- #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
- /* to handle an issue on empty search ie no entery in phonebook of same name */
- show_softkey_background();
- #endif /* __MMI_UI_DALMATIAN_SOFTKEYS__ */
- if (application_present)
- {
- showOption = no_entries >= 0 ? MMI_TRUE : MMI_FALSE;
- }
- else
- {
- showOption = no_entries > 0 ? MMI_TRUE : MMI_FALSE;
- }
- if (showOption)
- {
- set_left_softkey_label(wgui_singleline_inputbox_LSK_label_string);
- set_left_softkey_icon(wgui_singleline_inputbox_LSK_label_icon);
- redraw_left_softkey();
- register_left_softkey_handler();
- set_left_softkey_function(wgui_singleline_inputbox_LSK_function, KEY_EVENT_UP);
- set_left_softkey_function(UI_dummy_function, KEY_EVENT_DOWN);
- dynamic_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
- draw_title();
- }
- else
- {
- set_left_softkey_label(NULL);
- set_left_softkey_icon(NULL);
- redraw_left_softkey();
- set_left_softkey_function(UI_dummy_function, KEY_EVENT_UP);
- set_left_softkey_function(UI_dummy_function, KEY_EVENT_DOWN);
- gui_fixed_icontext_menuitem_stop_scroll();
- gui_pop_up_description_stop_scroll();
- MMI_menu_shortcut_number = 0;
- draw_title();
- wgui_current_pop_up_description_index = -1;
- }
- show_dynamic_list();
- }
- /*****************************************************************************
- * FUNCTION
- * refresh_search_list_change_list_ext
- * DESCRIPTION
- *
- * PARAMETERS
- * no_entries [IN]
- * highlighted_item [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void refresh_search_list_change_list_ext(S32 no_entries, S32 highlighted_item)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 shortcut_width, max_entries = 0;
- BOOL showOption, application_present;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_list_menu.highlighted_item = highlighted_item;
- MMI_fixed_list_menu.n_items = no_entries;
- MMI_fixed_list_menu.displayed_items = no_entries;
- if (wgui_check_application_present)
- {
- application_present = wgui_check_application_present(&max_entries); /* true in case of dictionary */
- }
- else
- {
- application_present = MMI_FALSE;
- }
- if (application_present)
- {
- shortcut_width = set_menu_item_count(max_entries) + 7; /* number of words goes beyond this limit, and increases at the run time */
- }
- else
- {
- shortcut_width = set_menu_item_count(no_entries) + 7;
- }
- resize_menu_shortcut_handler(shortcut_width, MMI_title_height);
- move_menu_shortcut_handler(UI_device_width - shortcut_width, MMI_title_y);
- #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
- /* to handle an issue on empty search ie no entery in phonebook of same name */
- show_softkey_background();
- #endif /* __MMI_UI_DALMATIAN_SOFTKEYS__ */
- if (application_present)
- {
- showOption = no_entries >= 0 ? MMI_TRUE : MMI_FALSE;
- }
- else
- {
- showOption = no_entries > 0 ? MMI_TRUE : MMI_FALSE;
- }
- if (showOption)
- {
- set_left_softkey_label(wgui_singleline_inputbox_LSK_label_string);
- set_left_softkey_icon(wgui_singleline_inputbox_LSK_label_icon);
- redraw_left_softkey();
- register_left_softkey_handler();
- set_left_softkey_function(wgui_singleline_inputbox_LSK_function, KEY_EVENT_UP);
- set_left_softkey_function(UI_dummy_function, KEY_EVENT_DOWN);
- dynamic_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
- draw_title();
- }
- else
- {
- set_left_softkey_label(NULL);
- set_left_softkey_icon(NULL);
- redraw_left_softkey();
- set_left_softkey_function(UI_dummy_function, KEY_EVENT_UP);
- set_left_softkey_function(UI_dummy_function, KEY_EVENT_DOWN);
- gui_fixed_icontext_menuitem_stop_scroll();
- gui_pop_up_description_stop_scroll();
- MMI_menu_shortcut_number = 0;
- draw_title();
- wgui_current_pop_up_description_index = -1;
- }
- show_dynamic_list();
- }
- /*****************************************************************************
- * FUNCTION
- * refresh_search_list
- * DESCRIPTION
- *
- * PARAMETERS
- * name [?]
- * RETURNS
- * void
- *****************************************************************************/
- void refresh_search_list(U8 *name)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 no_entries = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- no_entries = cat200_search_function(name);
- load_dynamic_item_buffer(no_entries);
- if (no_entries >= 0)
- {
- refresh_search_list_change_list(no_entries);
- gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * Cat200multitap_inputcallback
- * DESCRIPTION
- *
- * PARAMETERS
- * inp [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void Cat200multitap_inputcallback(UI_character_type inp)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 no_entries = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (inp != 0)
- {
- gui_single_line_input_box_insert_multitap_character(&MMI_singleline_inputbox, inp);
- }
- if (!gui_single_line_input_box_test_overflow(&MMI_singleline_inputbox))
- {
- if (cat200_search_function)
- {
- no_entries = cat200_search_function(MMI_singleline_inputbox.text);
- load_dynamic_item_buffer(no_entries);
- if (no_entries >= 0)
- {
- refresh_search_list_change_list(no_entries);
- }
- singleline_inputbox_input_callback();
- redraw_singleline_inputbox();
- gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * Cat200multitap_input_complete_callback
- * DESCRIPTION
- * input call back complete function of category200 multi tap
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void Cat200multitap_input_complete_callback(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_single_line_input_box_confirm_multitap_character(&MMI_singleline_inputbox);
- singleline_inputbox_input_callback();
- redraw_singleline_inputbox();
- gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
- }
- extern void wgui_redraw_singleline_input_information_bar(void);
- #ifdef __MMI_TOUCH_SCREEN__
- /*****************************************************************************
- * FUNCTION
- * Cate200CategoryControlAreaPenDownHandler
- * DESCRIPTION
- *
- * PARAMETERS
- * point [IN]
- * RETURNS
- *
- *****************************************************************************/
- MMI_BOOL Cate200CategoryControlAreaPenDownHandler(mmi_pen_point_struct point)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_BOOL ret = MMI_FALSE;
- gui_list_pen_enum menu_event;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_fixed_list_menu.pen_redraw_menu_function = show_dynamic_list;
- gui_vertical_scrollbar_set_pen_self_scroll(&MMI_fixed_list_menu.vbar, MMI_TRUE);
- gui_fixed_list_menu_set_pen_scroll_delay(&MMI_fixed_list_menu, GUI_DYNAMIC_LIST_PEN_SCROLL_DELAY);
- ret = gui_dynamic_list_menu_translate_pen_event(
- &MMI_fixed_list_menu,
- MMI_PEN_EVENT_DOWN,
- point.x,
- point.y,
- &menu_event);
- if (ret)
- {
- if (menu_event == GUI_LIST_PEN_HIGHLIGHT_CHANGED || menu_event == GUI_LIST_PEN_NEED_REDRAW)
- {
- show_dynamic_list();
- }
- return MMI_TRUE;
- }
- return MMI_FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * Cate200CategoryControlAreaPenUpHandler
- * DESCRIPTION
- *
- * PARAMETERS
- * point [IN]
- * RETURNS
- *
- *****************************************************************************/
- MMI_BOOL Cate200CategoryControlAreaPenUpHandler(mmi_pen_point_struct point)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_BOOL ret = MMI_FALSE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_general_pen_dynamic_list_menu_hdlr(point, MMI_PEN_EVENT_UP);
- return ret;
- }
- /*****************************************************************************
- * FUNCTION
- * Cate200CategoryControlAreaPenMoveHandler
- * DESCRIPTION
- *
- * PARAMETERS
- * point [IN]
- * RETURNS
- *
- *****************************************************************************/
- MMI_BOOL Cate200CategoryControlAreaPenMoveHandler(mmi_pen_point_struct point)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_BOOL ret = MMI_FALSE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_general_pen_dynamic_list_menu_hdlr(point, MMI_PEN_EVENT_MOVE);
- return ret;
- }
- /*****************************************************************************
- * FUNCTION
- * Cate200CategoryControlAreaPenLongTapHandler
- * DESCRIPTION
- *
- * PARAMETERS
- * point [IN]
- * RETURNS
- *
- *****************************************************************************/
- MMI_BOOL Cate200CategoryControlAreaPenLongTapHandler(mmi_pen_point_struct point)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_BOOL ret = MMI_FALSE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_general_pen_dynamic_list_menu_hdlr(point, MMI_PEN_EVENT_LONG_TAP);
- return ret;
- }
- /*****************************************************************************
- * FUNCTION
- * Cate200CategoryControlAreaPenRepeatHandler
- * DESCRIPTION
- *
- * PARAMETERS
- * point [IN]
- * RETURNS
- *
- *****************************************************************************/
- MMI_BOOL Cate200CategoryControlAreaPenRepeatHandler(mmi_pen_point_struct point)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_BOOL ret = MMI_FALSE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_general_pen_dynamic_list_menu_hdlr(point, MMI_PEN_EVENT_REPEAT);
- return ret;
- }
- #endif /* __MMI_TOUCH_SCREEN__ */
- /*****************************************************************************
- * FUNCTION
- * RedrawCategoryControlledArea200Screen
- * DESCRIPTION
- * redraw category200
- * PARAMETERS
- * coordinate [?]
- * RETURNS
- * void
- *****************************************************************************/
- void RedrawCategoryControlledArea200Screen(dm_coordinates *coordinate)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color ccblack = {0, 0, 0, 100};
- color c;
- S32 temp_w = 0, temp_h = 0, image_y = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- c.r = 255;
- c.g = 255;
- c.b = 255;
- c.alpha = 100;
- gdi_layer_lock_frame_buffer();
- gui_reset_clip();
- gdi_layer_reset_clip();
- wgui_redraw_singleline_input_information_bar();
- show_dynamic_list();
- gui_reset_clip();
- #if defined(__MMI_TOUCH_SCREEN__)
- input_box_y = ((MMI_title_y + MMI_title_height) + INFORMATION_BAR_HEIGHT + MMI_fixed_list_menu.height + 1);
- gui_fill_rectangle(0, (input_box_y - 1), UI_device_width, (input_box_y + MMI_SINGLELINE_INPUTBOX_HEIGHT), c);
- #endif /* defined(__MMI_TOUCH_SCREEN__) */
- gui_draw_rectangle(
- 2,
- (input_box_y - 1),
- (UI_device_width - 2),
- (input_box_y + MMI_SINGLELINE_INPUTBOX_HEIGHT),
- ccblack);
- gdi_layer_set_clip(4, input_box_y, (input_box_x - 1), (input_box_y + MMI_SINGLELINE_INPUTBOX_HEIGHT));
- gui_measure_image(get_image(cat200_search_img), &temp_w, &temp_h);
- image_y = (10 - (temp_h >> 1));
- gui_show_image(4, (input_box_y + image_y), get_image(cat200_search_img));
- #if defined(__MMI_TOUCH_SCREEN__)
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- redraw_singleline_inputbox();
- #endif /* defined(__MMI_TOUCH_SCREEN__) */
- gdi_layer_unlock_frame_buffer();
- gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
- //In Category 200, redraw_category_screen() is being called here instead of ShowCategory,
- //since RedrawCategory200Screen is doing many other things like drawing image etc.
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory200Screen
- * DESCRIPTION
- * exit function of category200
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory200Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearHighlightHandler();
- reset_softkeys();
- reset_menu_shortcut_handler();
- reset_fixed_list();
- set_MMI_current_input_type();
- reset_multitaps();
- reset_dynamic_list();
- reset_pop_up_descriptions();
- wgui_close_singleline_inputbox();
- cat200_search_function = NULL;
- #ifdef __MMI_UI_HINTS_IN_MENUITEM__
- reset_all_force_flags_for_hints();
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_unblock_list_effect();
- #endif
- #endif /* __MMI_UI_HINTS_IN_MENUITEM__ */
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory200HistorySize
- * DESCRIPTION
- * Gets the history buffer size of category 200
- * PARAMETERS
- * void
- * RETURNS
- * size in U8s of the history buffer
- *****************************************************************************/
- S32 GetCategory200HistorySize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (((sizeof(list_menu_category_history) + 3) / 4) * 4 + sizeof(singleline_inputbox_category_history));
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory200History
- * DESCRIPTION
- * Gets the history buffer of category200
- * PARAMETERS
- * history_buffer [?]
- * RETURNS
- * return history buffer
- *****************************************************************************/
- U8 *GetCategory200History(U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 s;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- get_list_menu_category_history(MMI_CATEGORY200_ID, history_buffer);
- s = sizeof(list_menu_category_history);
- s = (s + 3) / 4;
- s *= 4;
- get_singleline_inputbox_category_history(MMI_CATEGORY200_ID, (U8*) (history_buffer + s), MMI_current_input_type);
- return (history_buffer);
- }
- /*****************************************************************************
- * FUNCTION
- * cat200_virtual_keypad_callback
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void cat200_virtual_keypad_callback(void)
- {
- #if defined(__MMI_TOUCH_SCREEN__)
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 search_box_height = MMI_SINGLELINE_INPUTBOX_HEIGHT;
- S32 fh = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- resize_fixed_list(
- MMI_content_width,
- (UI_device_height - MMI_button_bar_height - (MMI_title_y + MMI_title_height) - search_box_height - INFORMATION_BAR_HEIGHT - 2 - fh - 1 - MMI_virtual_keyboard.height - 1));
- /* W06.12 Fix Quick Search highlight issue in the last items */
- gui_dynamic_list_menu_locate_highlighted_item(&MMI_fixed_list_menu);
- input_box_y = ((MMI_title_y + MMI_title_height) + INFORMATION_BAR_HEIGHT + MMI_fixed_list_menu.height + 1 + fh);
- move_singleline_inputbox(input_box_x, input_box_y);
- RedrawCategoryControlledArea200Screen(NULL);
- #endif /* defined(__MMI_TOUCH_SCREEN__) */
- }
- /* MTK Leo end */
- /*****************************************************************************
- * FUNCTION
- * ShowCategory200Screen
- * DESCRIPTION
- * category screen of phone search
- * PARAMETERS
- * title [IN] Title id
- * title_icon [IN] Title icon
- * left_softkey [IN] Left soft key label
- * left_softkey_icon [IN] Left soft key icon
- * right_softkey [IN] Right soft key label
- * right_softkey_icon [IN] Right soft key icon
- * number_of_items [IN] Number of items
- * get_item_func [IN]
- * get_hint_func [IN]
- * highlighted_item [IN] Highlighted item index
- * search_image [IN] Seach image
- * buffer [IN] Buffer
- * buffer_max_length [IN]
- * history_buffer [IN] Histpry buffer
- * top_msg(?) [IN] Message display below title bar
- * list_of_items(?) [IN] List of items
- * max_buffer_legth(?) [IN] Max size of buffer length
- * list_of_icons1(?) [IN] List of icons
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory200Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- S32 number_of_items,
- GetItemFuncPtr get_item_func,
- GetHintFuncPtr get_hint_func,
- S32 highlighted_item,
- U16 search_image,
- U8 *buffer,
- S32 buffer_max_length,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- S32 temp_w = 0, temp_h = 0;
- S32 fh = 0;
- S32 input_box_width = 0, search_box_height = MMI_SINGLELINE_INPUTBOX_HEIGHT;
- S32 shortcut_width;
- U8 h_flag;
- U8 *img = NULL;
- BOOL application_present;
- S32 max_entries = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- MMI_menu_shortcut_number = -1;
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- SetupCategoryKeyHandlers();
- create_fixed_icontext_menuitems();
- MMI_current_menu_type = LIST_MENU;
- associate_fixed_icontext_list();
- init_dynamic_item_buffer(number_of_items, get_item_func, get_hint_func, UI_dummy_function);
- MMI_fixed_list_menu.n_items = number_of_items;
- if (wgui_check_application_present)
- {
- application_present = wgui_check_application_present(&max_entries); /* true in case of dictionary */
- }
- else
- {
- application_present = MMI_FALSE;
- }
- if (application_present)
- {
- shortcut_width = set_menu_item_count(max_entries) + 7; /* number of words goes beyond this limit, and increases at the run time */
- }
- else
- {
- shortcut_width = set_menu_item_count(number_of_items) + 7;
- }
- resize_menu_shortcut_handler(shortcut_width, MMI_title_height);
- move_menu_shortcut_handler(UI_device_width - shortcut_width, MMI_title_y);
- register_hide_menu_shortcut(gui_redraw_menu_shortcut);
- register_dynamic_list_keys();
- #ifdef __MMI_TOUCH_SCREEN__
- /* Because the list menu is resized according to virtual keyboard */
- MMI_fixed_list_menu.flags |= UI_LIST_MENU_ALIGN_TO_TOP;
- #endif /* __MMI_TOUCH_SCREEN__ */
- #ifdef __MMI_UI_LIST_CACHE_BACKGROUND__
- /* Virtual keyboard height might be changed. We cannot put menu background in layer */
- MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_BKGRND_IN_LAYER;
- #endif /* __MMI_UI_LIST_CACHE_BACKGROUND__ */
- resize_fixed_list(
- MMI_content_width,
- (UI_device_height - MMI_button_bar_height - (MMI_title_y + MMI_title_height) - search_box_height - INFORMATION_BAR_HEIGHT - 2 - fh - 1));
- input_box_y = ((MMI_title_y + MMI_title_height) + INFORMATION_BAR_HEIGHT + MMI_fixed_list_menu.height + 1 + fh);
- move_fixed_list(0, ((MMI_title_y + MMI_title_height) + fh + INFORMATION_BAR_HEIGHT));
- register_fixed_list_highlight_handler(dynamic_list_highlight_handler);
- img = (U8*) GetImage(search_image);
- gui_measure_image(img, &temp_w, &temp_h);
- input_box_width = (UI_device_width - (5 + temp_w + 1) - 4);
- input_box_x = 5 + temp_w + 1;
- h_flag = set_list_menu_category_history(MMI_CATEGORY200_ID, history_buffer);
- #ifdef __MMI_UI_HINTS_IN_MENUITEM__
- if (get_hint_func)
- {
- if (is_set_force_icon_on_highlight_only_in_menuitem())
- {
- wgui_show_icon_only_highlight_in_icontext_menuitem();
- }
- if (is_set_force_all_hints_in_menuitem())
- {
- wgui_enable_hints_in_icontext_menuitem();
- }
- else if (is_set_force_hints_on_highlight_in_menuitem())
- {
- wgui_enable_hint_highlight_in_icontext_menuitem();
- }
- else
- {
- wgui_enable_hint_highlight_in_icontext_menuitem();
- }
- if (h_flag)
- {
- set_dynamic_pop_up_descriptions(MMI_fixed_list_menu.highlighted_item);
- }
- else
- {
- set_dynamic_pop_up_descriptions(highlighted_item);
- }
- #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
- gui_block_list_effect();
- #endif
- }
- #endif /* __MMI_UI_HINTS_IN_MENUITEM__ */
- if (h_flag)
- {
- S32 s = sizeof(list_menu_category_history);
- s = (s + 3) / 4;
- s *= 4;
- dynamic_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
- wgui_setup_singleline_inputbox(
- input_box_x,
- (input_box_y),
- input_box_width,
- search_box_height,
- buffer,
- buffer_max_length,
- MMI_CATEGORY200_ID,
- get_string(right_softkey),
- get_image(right_softkey_icon),
- INPUT_TYPE_MMI_MULTITAP_BPMF,
- (U8*) (history_buffer + s),
- 1);
- if (cat200_search_function)
- {
- if (!application_present)
- {
- S32 no_entries;
- no_entries = cat200_search_function((U8*) MMI_singleline_inputbox.text);
- load_dynamic_item_buffer(no_entries);
- refresh_search_list_change_list_ext(no_entries, MMI_fixed_list_menu.highlighted_item);
- }
- }
- }
- else
- {
- dynamic_list_goto_item_no_redraw(highlighted_item);
- wgui_setup_singleline_inputbox(
- input_box_x,
- (input_box_y),
- input_box_width,
- search_box_height,
- buffer,
- buffer_max_length,
- MMI_CATEGORY200_ID,
- get_string(right_softkey),
- get_image(right_softkey_icon),
- INPUT_TYPE_MMI_MULTITAP_BPMF,
- NULL,
- 1);
- }
- #if defined(__MMI_TOUCH_SCREEN__)
- resize_fixed_list(
- MMI_content_width,
- (UI_device_height - MMI_button_bar_height - (MMI_title_y + MMI_title_height) - search_box_height - INFORMATION_BAR_HEIGHT - 2 - fh - 1 - MMI_virtual_keyboard.height - 1));
- input_box_y = ((MMI_title_y + MMI_title_height) + INFORMATION_BAR_HEIGHT + MMI_fixed_list_menu.height + 1 + fh);
- move_singleline_inputbox(input_box_x, input_box_y);
- #endif /* defined(__MMI_TOUCH_SCREEN__) */
- gui_set_single_line_input_box_theme(&MMI_singleline_inputbox, &cat200_singleline_inputbox_theme);
- cat200_search_img = search_image;
- MMI_title_string = (UI_string_type) get_string(title);
- MMI_title_icon = (PU8) get_image(title_icon);
- resize_dynamic_icontext_menuitems_to_list_width();
- set_fixed_icontext_positions(MMI_ICONTEXT_MENUITEM_HEIGHT + 2, 0, 1, 0);//111106 dynamic icontext
- if (h_flag)
- {
- set_dynamic_pop_up_descriptions(MMI_fixed_list_menu.highlighted_item);
- if (application_present)
- {
- if (MMI_fixed_list_menu.highlighted_item <= 0)
- {
- ClearKeyHandler(KEY_UP_ARROW, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_VOL_UP, KEY_EVENT_DOWN);
- }
- }
- }
- else
- {
- set_dynamic_pop_up_descriptions(highlighted_item);
- }
- singleline_inputbox_input_callback();
- wgui_singleline_inputbox_LSK_label_icon = get_image(left_softkey_icon);
- wgui_singleline_inputbox_LSK_label_string = get_string(left_softkey);
- if (!h_flag)
- {
- if (number_of_items > 0)
- {
- set_left_softkey_label(wgui_singleline_inputbox_LSK_label_string);
- set_left_softkey_icon(wgui_singleline_inputbox_LSK_label_icon);
- redraw_left_softkey();
- register_left_softkey_handler();
- set_left_softkey_function(wgui_singleline_inputbox_LSK_function, KEY_EVENT_UP);
- set_left_softkey_function(UI_dummy_function, KEY_EVENT_DOWN);
- }
- else
- {
- set_left_softkey_label(NULL);
- set_left_softkey_icon(NULL);
- redraw_left_softkey();
- set_left_softkey_function(UI_dummy_function, KEY_EVENT_UP);
- set_left_softkey_function(UI_dummy_function, KEY_EVENT_DOWN);
- }
- }
- gdi_layer_unlock_frame_buffer();
- ExitCategoryFunction = ExitCategory200Screen;
- dm_setup_category_functions(dm_redraw_category_screen, GetCategory200History, GetCategory200HistorySize); /* 102605 quick search history Calvin add */
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- dm_data.s32flags |= DM_SHOW_VKPAD;
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY200_ID;
- dm_setup_data(&dm_data);
- dm_register_category_controlled_callback(RedrawCategoryControlledArea200Screen);
- dm_register_vkpad_callback(cat200_virtual_keypad_callback);
- #ifdef __MMI_TOUCH_SCREEN__
- wgui_register_category_screen_control_area_pen_handlers(
- Cate200CategoryControlAreaPenDownHandler,
- MMI_PEN_EVENT_DOWN);
- wgui_register_category_screen_control_area_pen_handlers(Cate200CategoryControlAreaPenUpHandler, MMI_PEN_EVENT_UP);
- wgui_register_category_screen_control_area_pen_handlers(
- Cate200CategoryControlAreaPenMoveHandler,
- MMI_PEN_EVENT_MOVE);
- wgui_register_category_screen_control_area_pen_handlers(
- Cate200CategoryControlAreaPenLongTapHandler,
- MMI_PEN_EVENT_LONG_TAP);
- wgui_register_category_screen_control_area_pen_handlers(
- Cate200CategoryControlAreaPenRepeatHandler,
- MMI_PEN_EVENT_REPEAT);
- #endif /* __MMI_TOUCH_SCREEN__ */
- dm_redraw_category_screen();
- }
- /* 052206 NITZ category Calvin Start */
- #if defined ( __MMI_MAINLCD_240X320__)
- #include "worldclock.h"
- #define CAT230_TITLE_HEIGHT 28
- #define CAT230_INDEX_HEIGHT 24
- #define MAX_CAT230_INDEX 3
- #define CAT230_TIME_HEIGHT 19
- #define CAT230_CITY_HEIGHT 21
- #define CAT230_ARROW_OFFSET 5
- #ifdef __MMI_TOUCH_SCREEN__
- typedef enum
- {
- CAT230_TOUCH_NONE,
- CAT230_TOUCH_ON_LEFT_ARROW_UP,
- CAT230_TOUCH_ON_LEFT_ARROW_DOWN,
- CAT230_TOUCH_ON_RIGHT_ARROW_UP,
- CAT230_TOUCH_ON_RIGHT_ARROW_DOWN,
- CAT230_TOUCH_ON_INDEX_UP,
- CAT230_TOUCH_ON_INDEX_DOWN,
- CAT230_TOUCH_ON_PAINT_UP,
- CAT230_TOUCH_ON_PAINT_DOWN,
- CAT230_TOUCH_ON_PAINT_REPEAT,
- CAT230_TOUCH_ON_PAINT_MOVE,
- CAT230_TOUCH_ON_RSK
- } CAT230_PEN_EVENTS;
- S32 Cat230PenEvent = CAT230_TOUCH_NONE;
- #endif /* __MMI_TOUCH_SCREEN__ */
- U8 *Cat230TitleString = NULL;
- U8 *Cat230IndexInfoString[MAX_CAT230_INDEX];
- U8 Cat230NumberofIndex = 0;
- U8 Cat230HighlightedIndex = 0;
- S32 Cat230Paint_y = 0;
- S32 Cat230Paint_height = 0;
- GDI_HANDLE Cat230PaintLayer = GDI_NULL_HANDLE;
- MMI_BOOL Cat230FirstEnter = MMI_TRUE;
- color Cat230Index_bg = {254, 164, 42, 255};
- color Cat230Index_bg_highlight = {254, 210, 41, 255};
- color Cat230Index_fg = {0, 0, 0, 255};
- color Cat230Index_fg_highlight = {255, 255, 255, 255};
- void (*Cat230AppLeftKeyHandler) (U8 index_num) = UI_dummy_function_byte;
- void (*Cat230AppRightKeyHandler) (U8 index_num) = UI_dummy_function_byte;
- void (*Cat230RedrawPaint) (void) = UI_dummy_function;
- void (*Cat230GetPaintInfo) (void *paint_info) = NULL;
- static void RedrawCategory230Screen(void);
- static void Cat230RedrawPaint_WC(void);
- FuncPtr Cat230RedrawPaintArray[CAT230_SCREEN_TYPE_MAX] = { Cat230RedrawPaint_WC };
- #ifdef __MMI_TOUCH_SCREEN__
- typedef void (*Cat230PaintPenEventFuncPtr) (S32 x, S32 y, S32 event_type);
- void (*Cat230PaintPenEventHandler) (S32 x, S32 y, S32 event_type) = NULL;
- void (*Cat230AppPaintPenEventHandler) (S32 x, S32 y, S32 event_type) = NULL;
- static void Cat230PaintPenEventHandler_WC(S32 x, S32 y, S32 event_type);
- Cat230PaintPenEventFuncPtr Cat230PaintPenEventHandlerArray[CAT230_SCREEN_TYPE_MAX] = { Cat230PaintPenEventHandler_WC };
- #endif
- void SetCat230IndexInfo(U8 index_num, U8* info_string)
- {
- MMI_ASSERT(index_num < MAX_CAT230_INDEX);
- Cat230IndexInfoString[index_num] = info_string;
- }
- #ifdef __MMI_TOUCH_SCREEN__
- void RegisterCat230PaintPenEventHandler(void (*AppPaintPenEventHandler) (S32 x, S32 y, S32 event_type))
- {
- Cat230AppPaintPenEventHandler = AppPaintPenEventHandler;
- }
- #endif
- /*****************************************************************************
- * FUNCTION
- * Cat230HandleKeyRight
- * DESCRIPTION
- * Right arrow key handler of Cat230.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void Cat230HandleKeyRight(void)
- {
- MMI_ASSERT(Cat230AppRightKeyHandler!=NULL);
- Cat230AppRightKeyHandler(Cat230HighlightedIndex);
- RedrawCategory230Screen();
- }
- /*****************************************************************************
- * FUNCTION
- * Cat230HandleKeyLeft
- * DESCRIPTION
- * Left arrow key handler of Cat230.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void Cat230HandleKeyLeft(void)
- {
- MMI_ASSERT(Cat230AppLeftKeyHandler!=NULL);
- Cat230AppLeftKeyHandler(Cat230HighlightedIndex);
- RedrawCategory230Screen();
- }
- /*****************************************************************************
- * FUNCTION
- * Cat230HandleKeyUp
- * DESCRIPTION
- * Up arrow key handler of Cat230.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void Cat230HandleKeyUp(void)
- {
- if (Cat230HighlightedIndex == 0)
- {
- Cat230HighlightedIndex = Cat230NumberofIndex - 1;
- }
- else
- {
- Cat230HighlightedIndex--;
- }
- RedrawCategory230Screen();
- }
- /*****************************************************************************
- * FUNCTION
- * Cat230HandleKeyDown
- * DESCRIPTION
- * Down arrow key handler of Cat230.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void Cat230HandleKeyDown(void)
- {
- if (Cat230HighlightedIndex == Cat230NumberofIndex-1)
- {
- Cat230HighlightedIndex = 0;
- }
- else
- {
- Cat230HighlightedIndex++;
- }
- RedrawCategory230Screen();
- }
- #ifdef __MMI_TOUCH_SCREEN__
- #include "wgui_touch_screen.h"
- //#define WC_PEN_GAP 3
- /*****************************************************************************
- * FUNCTION
- * Cat230PenDownHandler
- * DESCRIPTION
- *
- * PARAMETERS
- * point [IN]
- * RETURNS
- *
- *****************************************************************************/
- static MMI_BOOL Cat230PenDownHandler(mmi_pen_point_struct point)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_component_info_struct pos;
- U8 j;
- S32 iwidth, iheight;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- //on index
- pos.pos_x = 0;
- pos.pos_y = MMI_status_bar_height+CAT230_TITLE_HEIGHT;
- pos.width = UI_device_width;
- pos.height = CAT230_INDEX_HEIGHT*Cat230NumberofIndex;
- if (wgui_test_object_position(point, pos) == MMI_TRUE) /* INDEX */
- {
- gui_measure_image(get_image(LEFT_ARROW_UP), &iwidth, &iheight);
- pos.width = iwidth;
- pos.height = iheight;
- //on left arrow
- for (j=0; j<Cat230NumberofIndex; j++)
- {
- pos.pos_x = CAT230_ARROW_OFFSET;
- pos.pos_y = MMI_status_bar_height+CAT230_TITLE_HEIGHT+CAT230_INDEX_HEIGHT*j + ((CAT230_INDEX_HEIGHT-iheight) >> 1) - 1;
- if (wgui_test_object_position(point, pos) == MMI_TRUE) /* LEFT ARROW */
- {
- Cat230PenEvent = CAT230_TOUCH_ON_LEFT_ARROW_DOWN;
- Cat230HighlightedIndex = j;
- Cat230HandleKeyLeft();
- return MMI_TRUE;
- }
- }
- //on right arrow
- for (j=0; j<Cat230NumberofIndex; j++)
- {
- pos.pos_x = UI_device_width - iwidth - 1 - CAT230_ARROW_OFFSET;
- pos.pos_y = MMI_status_bar_height+CAT230_TITLE_HEIGHT+CAT230_INDEX_HEIGHT*j + ((CAT230_INDEX_HEIGHT-iheight) >> 1) - 1;
- if (wgui_test_object_position(point, pos) == MMI_TRUE) /* RIGHT ARROW */
- {
- Cat230PenEvent = CAT230_TOUCH_ON_RIGHT_ARROW_DOWN;
- Cat230HighlightedIndex = j;
- Cat230HandleKeyRight();
- return MMI_TRUE;
- }
- }
- Cat230HighlightedIndex = ((point.y-(MMI_status_bar_height+CAT230_TITLE_HEIGHT)) / CAT230_INDEX_HEIGHT);
- Cat230PenEvent = CAT230_TOUCH_ON_INDEX_DOWN;
- RedrawCategory230Screen();
- return MMI_TRUE;
- }
- //on paint
- pos.pos_x = 0;
- pos.pos_y = Cat230Paint_y;
- pos.width = UI_device_width;
- pos.height = Cat230Paint_height;
- if (wgui_test_object_position(point, pos) == MMI_TRUE) /* Paint */
- {
- Cat230PenEvent = CAT230_TOUCH_ON_PAINT_DOWN;
- Cat230PaintPenEventHandler(point.x, point.y, Cat230PenEvent);
- return MMI_TRUE;
- }
- Cat230PenEvent = CAT230_TOUCH_NONE;
- return MMI_FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * Cat230PenUpHandler
- * DESCRIPTION
- *
- * PARAMETERS
- * point [IN]
- * RETURNS
- *
- *****************************************************************************/
- static MMI_BOOL Cat230PenUpHandler(mmi_pen_point_struct point)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_component_info_struct pos;
- S32 iwidth, iheight;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_measure_image(get_image(LEFT_ARROW_UP), &iwidth, &iheight);
- pos.width = iwidth;
- pos.height = iheight;
- /* left arrow */
- if (Cat230PenEvent == CAT230_TOUCH_ON_LEFT_ARROW_DOWN)
- {
- pos.pos_x = CAT230_ARROW_OFFSET;
- pos.pos_y = MMI_status_bar_height+CAT230_TITLE_HEIGHT+CAT230_INDEX_HEIGHT*Cat230HighlightedIndex+ ((CAT230_INDEX_HEIGHT-iheight) >> 1) - 1;
- if (wgui_test_object_position(point, pos) == MMI_TRUE) /* LEFT ARROW */
- {
- Cat230PenEvent = CAT230_TOUCH_NONE;
- RedrawCategory230Screen();
- return MMI_TRUE;
- }
- }
- /* right arrow */
- if (Cat230PenEvent == CAT230_TOUCH_ON_RIGHT_ARROW_DOWN)
- {
- pos.pos_x = UI_device_width - iwidth - 1 - CAT230_ARROW_OFFSET;
- pos.pos_y = MMI_status_bar_height+CAT230_TITLE_HEIGHT+CAT230_INDEX_HEIGHT*Cat230HighlightedIndex + ((CAT230_INDEX_HEIGHT-iheight) >> 1) - 1;
- if (wgui_test_object_position(point, pos) == MMI_TRUE) /* RIGHT ARROW */
- {
- Cat230PenEvent = CAT230_TOUCH_NONE;
- RedrawCategory230Screen();
- return MMI_TRUE;
- }
- }
- Cat230PenEvent = CAT230_TOUCH_NONE;
- return MMI_FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * Cat230PenRepeatHandler
- * DESCRIPTION
- *
- * PARAMETERS
- * point [IN]
- * RETURNS
- *
- *****************************************************************************/
- static MMI_BOOL Cat230PenRepeatHandler(mmi_pen_point_struct point)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* left arrow */
- if (Cat230PenEvent == CAT230_TOUCH_ON_LEFT_ARROW_DOWN)
- {
- Cat230HandleKeyLeft();
- return MMI_TRUE;
- }
- /* right arrow */
- if (Cat230PenEvent == CAT230_TOUCH_ON_RIGHT_ARROW_DOWN)
- {
- Cat230HandleKeyRight();
- return MMI_TRUE;
- }
- return MMI_FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * Cat230PenMoveHandler
- * DESCRIPTION
- *
- * PARAMETERS
- * point [IN]
- * RETURNS
- *
- *****************************************************************************/
- static MMI_BOOL Cat230PenMoveHandler(mmi_pen_point_struct point)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_component_info_struct pos;
- U8 highlighted_index;
- S32 iwidth, iheight;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- //on index
- pos.pos_x = 0;
- pos.pos_y = MMI_status_bar_height+CAT230_TITLE_HEIGHT;
- pos.width = UI_device_width;
- pos.height = CAT230_INDEX_HEIGHT*Cat230NumberofIndex;
- if (wgui_test_object_position(point, pos) == MMI_TRUE) /* INDEX */
- {
- gui_measure_image(get_image(LEFT_ARROW_UP), &iwidth, &iheight);
- pos.width = iwidth;
- pos.height = iheight;
- /* left arrow */
- if (Cat230PenEvent == CAT230_TOUCH_ON_LEFT_ARROW_DOWN ||
- Cat230PenEvent == CAT230_TOUCH_ON_LEFT_ARROW_UP)
- {
- pos.pos_x = CAT230_ARROW_OFFSET;
- pos.pos_y = MMI_status_bar_height+CAT230_TITLE_HEIGHT+CAT230_INDEX_HEIGHT*Cat230HighlightedIndex + ((CAT230_INDEX_HEIGHT-iheight) >> 1) - 1;
- if (wgui_test_object_position(point, pos) == MMI_TRUE) /* LEFT ARROW */
- {
- Cat230PenEvent = CAT230_TOUCH_ON_LEFT_ARROW_DOWN;
- return MMI_TRUE;
- }
- else
- {
- if (Cat230PenEvent == CAT230_TOUCH_ON_LEFT_ARROW_DOWN)
- {
- Cat230PenEvent = CAT230_TOUCH_ON_LEFT_ARROW_UP;
- RedrawCategory230Screen();
- }
- return MMI_TRUE;
- }
- }
- /* right arrow */
- if (Cat230PenEvent == CAT230_TOUCH_ON_RIGHT_ARROW_DOWN ||
- Cat230PenEvent == CAT230_TOUCH_ON_RIGHT_ARROW_UP)
- {
- pos.pos_x = UI_device_width - iwidth - 1 - CAT230_ARROW_OFFSET;
- pos.pos_y = MMI_status_bar_height+CAT230_TITLE_HEIGHT+CAT230_INDEX_HEIGHT*Cat230HighlightedIndex + ((CAT230_INDEX_HEIGHT-iheight) >> 1) - 1;
- if (wgui_test_object_position(point, pos) == MMI_TRUE) /* RIGHT ARROW */
- {
- Cat230PenEvent = CAT230_TOUCH_ON_RIGHT_ARROW_DOWN;
- return MMI_TRUE;
- }
- else
- {
- if (Cat230PenEvent == CAT230_TOUCH_ON_RIGHT_ARROW_DOWN)
- {
- Cat230PenEvent = CAT230_TOUCH_ON_RIGHT_ARROW_UP;
- RedrawCategory230Screen();
- }
- return MMI_TRUE;
- }
- }
- if (Cat230PenEvent == CAT230_TOUCH_ON_INDEX_DOWN ||
- Cat230PenEvent == CAT230_TOUCH_ON_INDEX_UP)
- {
- highlighted_index = ((point.y-(MMI_status_bar_height+CAT230_TITLE_HEIGHT)) / CAT230_INDEX_HEIGHT);
- if (highlighted_index != Cat230HighlightedIndex &&
- //highlighted_index >= 0 &&
- point.y >= (MMI_status_bar_height+CAT230_TITLE_HEIGHT) &&
- highlighted_index <= Cat230NumberofIndex)
- {
- Cat230HighlightedIndex = highlighted_index;
- Cat230PenEvent = CAT230_TOUCH_ON_INDEX_DOWN;
- RedrawCategory230Screen();
- }
- return MMI_TRUE;
- }
- }
- //on paint
- pos.pos_x = 0;
- pos.pos_y = Cat230Paint_y;
- pos.width = UI_device_width;
- pos.height = Cat230Paint_height;
- if (wgui_test_object_position(point, pos) == MMI_TRUE) /* Paint */
- {
- if (Cat230PenEvent == CAT230_TOUCH_ON_PAINT_DOWN ||
- Cat230PenEvent == CAT230_TOUCH_ON_PAINT_UP)
- {
- Cat230PenEvent = CAT230_TOUCH_ON_PAINT_DOWN;
- Cat230PaintPenEventHandler(point.x, point.y, Cat230PenEvent);
- return MMI_TRUE;
- }
- }
- if (Cat230PenEvent == CAT230_TOUCH_ON_INDEX_DOWN ||
- Cat230PenEvent == CAT230_TOUCH_ON_INDEX_UP)
- {
- Cat230PenEvent = CAT230_TOUCH_ON_INDEX_UP;
- }
- else if (Cat230PenEvent == CAT230_TOUCH_ON_PAINT_DOWN ||
- Cat230PenEvent == CAT230_TOUCH_ON_PAINT_UP)
- {
- Cat230PenEvent = CAT230_TOUCH_ON_PAINT_DOWN;
- }
- else
- {
- Cat230PenEvent = CAT230_TOUCH_NONE;
- }
- return MMI_TRUE;
- }
- static void Cat230PaintPenEventHandler_WC(S32 x, S32 y, S32 event_type)
- {
- S32 relative_x, relative_y;
- wgui_component_info_struct pos;
- mmi_pen_point_struct point;
- point.x = x;
- point.y = y;
- pos.pos_x = 0;
- pos.pos_y = Cat230Paint_y + CAT230_TIME_HEIGHT;
- pos.width = UI_device_width;
- pos.height = Cat230Paint_height-CAT230_TIME_HEIGHT*2-CAT230_CITY_HEIGHT;
- if (wgui_test_object_position(point, pos) == MMI_TRUE) /* Map */
- {
- relative_x = x;
- relative_y = y - Cat230Paint_y - CAT230_TIME_HEIGHT;
- Cat230AppPaintPenEventHandler(relative_x, relative_y, event_type);
- RedrawCategory230Screen();
- }
- }
- #endif /* __MMI_TOUCH_SCREEN__ */
- /*****************************************************************************
- * FUNCTION
- * ExitCategory230Screen
- * DESCRIPTION
- * exit function of category230
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory230Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- reset_softkeys();
- Cat230TitleString = NULL;
- for (i=0; i<MAX_CAT230_INDEX; i++)
- {
- Cat230IndexInfoString[i] = NULL;
- }
- Cat230NumberofIndex = 0;
- Cat230HighlightedIndex = 0;
- Cat230FirstEnter = MMI_TRUE;
- Cat230AppLeftKeyHandler = UI_dummy_function_byte;
- Cat230AppRightKeyHandler = UI_dummy_function_byte;
- Cat230RedrawPaint = UI_dummy_function;
- Cat230GetPaintInfo = NULL;
- #ifdef __MMI_TOUCH_SCREEN__
- Cat230PaintPenEventHandler = NULL;
- Cat230AppPaintPenEventHandler = NULL;
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory230HistorySize
- * DESCRIPTION
- * Gets the history buffer size of category 230
- * PARAMETERS
- * void
- * RETURNS
- * size in U8s of the history buffer
- *****************************************************************************/
- S32 GetCategory230HistorySize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory230History
- * DESCRIPTION
- * Gets the history buffer of category230
- * PARAMETERS
- * history_buffer [?]
- * RETURNS
- * return history buffer
- *****************************************************************************/
- U8 *GetCategory230History(U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return history_buffer;
- }
- void Cat230DrawTitle(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color cblack = {0, 0, 0, 255};
- color cwhite = {255, 255, 255, 255};
- S32 width = 0;
- S32 height = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_reset_clip();
- gui_reset_text_clip();
- gui_lock_double_buffer();
- gui_set_font(&MMI_default_font);
- gui_measure_string((UI_string_type)Cat230TitleString, &width, &height);
- gdi_draw_solid_rect(0, MMI_status_bar_height, UI_device_width-1, MMI_status_bar_height+CAT230_TITLE_HEIGHT-1, gdi_act_color_from_rgb(cblack.alpha, cblack.r, cblack.g, cblack.b));
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(((UI_device_width - width) >> 1) + width, MMI_status_bar_height + ((CAT230_TITLE_HEIGHT-height)>>1));
- }
- else
- {
- gui_move_text_cursor((UI_device_width - width) >> 1, MMI_status_bar_height + ((CAT230_TITLE_HEIGHT-height)>>1));
- }
- gui_set_text_color(cwhite);
- gui_print_text((UI_string_type)Cat230TitleString);
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(0, MMI_status_bar_height, UI_device_width-1, MMI_status_bar_height+CAT230_TITLE_HEIGHT-1);
- }