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

MTK

开发平台:

C/C++

  1. {
  2.     /*----------------------------------------------------------------*/
  3.     /* Local Variables                                                */
  4.     /*----------------------------------------------------------------*/
  5.     /*----------------------------------------------------------------*/
  6.     /* Code Body                                                      */
  7.     /*----------------------------------------------------------------*/
  8.     return (0);
  9. }
  10. /*****************************************************************************
  11.  * FUNCTION
  12.  *  GetCategory620History
  13.  * DESCRIPTION
  14.  *  Gets the history buffer for the Message Received screen
  15.  * PARAMETERS
  16.  *  history_buffer      [IN]        Is the buffer into which the history data is stored
  17.  * RETURNS
  18.  *  pointer to the history buffer
  19.  *****************************************************************************/
  20. U8 *GetCategory620History(U8 *history_buffer)
  21. {
  22.     /*----------------------------------------------------------------*/
  23.     /* Local Variables                                                */
  24.     /*----------------------------------------------------------------*/
  25.     /*----------------------------------------------------------------*/
  26.     /* Code Body                                                      */
  27.     /*----------------------------------------------------------------*/
  28.     return (history_buffer);
  29. }
  30. #endif /* defined(__MMI_SMART_MESSAGE_MT__) || (defined(__MMI_SMART_MESSAGE_MO__) && !defined(__MMI_MESSAGES_EMS__)) */ 
  31. /*****************************************************************************
  32. * [Category166]
  33. *
  34. * This category draws a full screen animation (align at center of screen)
  35. * Used by power on/off animation
  36. * This screen also able to mimic a static image with animation's behavior
  37. *
  38. *  **********************
  39. *  *                    *
  40. *  *                    *
  41. *  *                    *
  42. *  *                    *
  43. *  *                    *
  44. *  *     Animation      *
  45. *  *                    *
  46. *  *                    *
  47. *  *                    *
  48. *  *                    *
  49. *  *                    *
  50. *  **********************
  51. *
  52. *****************************************************************************/
  53. static void (*cat166_animation_complete_callback) (GDI_RESULT result);
  54. static PS8 cat166_animation_name;
  55. static U16 cat166_animation_id;
  56. static S32 cat166_image_offset_x;
  57. static S32 cat166_image_offset_y;
  58. static S32 cat166_image_width;
  59. static S32 cat166_image_height;
  60. static BOOL cat166_is_gif_anim;
  61. static U16 cat166_need_resize;
  62. static BOOL cat166_is_invalid;
  63. static GDI_HANDLE cat166_animation_handle = GDI_ERROR_HANDLE;
  64. /*****************************************************************************
  65.  * FUNCTION
  66.  *  Cat166AnimationMimicTimer
  67.  * DESCRIPTION
  68.  *  Mimic animation's play complete call back function for static images
  69.  * PARAMETERS
  70.  *  void
  71.  * RETURNS
  72.  *  void
  73.  *****************************************************************************/
  74. static void Cat166AnimationMimicTimer(void)
  75. {
  76.     /*----------------------------------------------------------------*/
  77.     /* Local Variables                                                */
  78.     /*----------------------------------------------------------------*/
  79.     /*----------------------------------------------------------------*/
  80.     /* Code Body                                                      */
  81.     /*----------------------------------------------------------------*/
  82.     /* Mimic GDI to return last frame callback */
  83.     if (cat166_animation_complete_callback != NULL)
  84.     {
  85.         if (cat166_is_invalid)
  86.         {
  87.             /* error file */
  88.             cat166_animation_complete_callback(-1);
  89.         }
  90.         else
  91.         {
  92.             cat166_animation_complete_callback(GDI_GIF_LAST_FRAME);
  93.             gui_start_timer(1000, Cat166AnimationMimicTimer);
  94.         }
  95.     }
  96. }
  97. /*****************************************************************************
  98.  * FUNCTION
  99.  *  DrawCate166CategoryControlArea
  100.  * DESCRIPTION
  101.  *  
  102.  * PARAMETERS
  103.  *  coordinate      [?]     
  104.  * RETURNS
  105.  *  void
  106.  *****************************************************************************/
  107. void DrawCate166CategoryControlArea(dm_coordinates *coordinate)
  108. {
  109.     /*----------------------------------------------------------------*/
  110.     /* Local Variables                                                */
  111.     /*----------------------------------------------------------------*/
  112.     /*----------------------------------------------------------------*/
  113.     /* Code Body                                                      */
  114.     /*----------------------------------------------------------------*/
  115.     RedrawCategory166Screen();
  116. }
  117. /*****************************************************************************
  118.  * FUNCTION
  119.  *  cat166_animation_complete_callback_failed
  120.  * DESCRIPTION
  121.  *  the animation of category screen no.166 is failed, inform application
  122.  * PARAMETERS
  123.  *  void
  124.  * RETURNS
  125.  *  void
  126.  *****************************************************************************/
  127. void cat166_animation_complete_callback_failed(void)
  128. {
  129.     /*----------------------------------------------------------------*/
  130.     /* Local Variables                                                */
  131.     /*----------------------------------------------------------------*/
  132.     /*----------------------------------------------------------------*/
  133.     /* Code Body                                                      */
  134.     /*----------------------------------------------------------------*/
  135.     if (cat166_animation_complete_callback != NULL)
  136.     {
  137.         cat166_animation_complete_callback(-1);
  138.     }
  139. }
  140. /*****************************************************************************
  141.  * FUNCTION
  142.  *  cat166_animation_complete_callback_int
  143.  * DESCRIPTION
  144.  *  category screen no.166 default animation callback
  145.  * PARAMETERS
  146.  *  void
  147.  * RETURNS
  148.  *  void
  149.  *****************************************************************************/
  150. void cat166_animation_complete_callback_int(GDI_RESULT result)
  151. {
  152.     /*----------------------------------------------------------------*/
  153.     /* Local Variables                                                */
  154.     /*----------------------------------------------------------------*/
  155.     /*----------------------------------------------------------------*/
  156.     /* Code Body                                                      */
  157.     /*----------------------------------------------------------------*/
  158.     if (result < 0)
  159.     {
  160.         /* animation is terminated abnormally,
  161.          * wait for a while for redraw category no.166
  162.          * to accomplish its job */
  163.         gui_start_timer(200, cat166_animation_complete_callback_failed);
  164.     }
  165.     else
  166.     {
  167.         /* animation is terminated normally,
  168.          * execute application callback */
  169.         if (cat166_animation_complete_callback != NULL)
  170.         {
  171.             cat166_animation_complete_callback(result);
  172.         }
  173.     }
  174. }
  175. /*****************************************************************************
  176.  * FUNCTION
  177.  *  RedrawCategory166Screen
  178.  * DESCRIPTION
  179.  *  Redraws sategory 166 screen.
  180.  * PARAMETERS
  181.  *  void
  182.  * RETURNS
  183.  *  void
  184.  *****************************************************************************/
  185. void RedrawCategory166Screen(void)
  186. {
  187.     /*----------------------------------------------------------------*/
  188.     /* Local Variables                                                */
  189.     /*----------------------------------------------------------------*/
  190.     GDI_RESULT result;
  191.     /*----------------------------------------------------------------*/
  192.     /* Code Body                                                      */
  193.     /*----------------------------------------------------------------*/
  194.     gui_hide_animations();
  195.     gdi_layer_clear(GDI_COLOR_BLACK);
  196.     gui_reset_clip();
  197.     if (cat166_animation_name != NULL)
  198.     {
  199.         /* source from file */
  200.         if (cat166_is_gif_anim)
  201.         {
  202.             /* animation, use GDI's auto play animation */
  203.             gdi_image_set_animation_last_frame_callback(cat166_animation_complete_callback_int);
  204.             
  205.             /* 070406 SVG support Start */
  206.             if (cat166_need_resize)
  207.             {
  208.                 cat166_animation_handle = GDI_ERROR_HANDLE;
  209.                 result = gdi_image_draw_animation_resized_file(
  210.                             cat166_image_offset_x,
  211.                             cat166_image_offset_y,
  212.                             cat166_image_width,
  213.                             cat166_image_height,
  214.                             (U8*) cat166_animation_name,
  215.                             &cat166_animation_handle/*NULL*/);
  216.             }
  217.             else
  218.             {
  219.                 cat166_animation_handle = GDI_ERROR_HANDLE;
  220.                 result = gdi_image_draw_animation_file(
  221.                             cat166_image_offset_x,
  222.                             cat166_image_offset_y,
  223.                             (U8*) cat166_animation_name,
  224.                             &cat166_animation_handle/*NULL*/);
  225.             }
  226.             /* 070406 SVG support End */
  227.             /* if is 1 frame gif, treat as still image */
  228.             if (result == GDI_IMAGE_IS_STILL_IMAGE)
  229.             {
  230.                 gui_start_timer(200, Cat166AnimationMimicTimer);
  231.             }
  232.         }
  233.         else
  234.         {
  235.             if (cat166_need_resize)
  236.             {
  237.                 /* static image */
  238.                 result = gdi_image_draw_resized_file(
  239.                             cat166_image_offset_x,
  240.                             cat166_image_offset_y,
  241.                             cat166_image_width,
  242.                             cat166_image_height,
  243.                             cat166_animation_name);
  244.                 if (result < 0)
  245.                 {
  246.                     /* invalid file */
  247.                     cat166_is_invalid = TRUE;
  248.                 }
  249.                 gui_start_timer(200, Cat166AnimationMimicTimer);
  250.             }
  251.             else
  252.             {
  253.                 /* static image */
  254.                 result = gdi_image_draw_file(cat166_image_offset_x, cat166_image_offset_y, cat166_animation_name);
  255.                 if (result < 0)
  256.                 {
  257.                     /* invalid file */
  258.                     cat166_is_invalid = TRUE;
  259.                 }
  260.                 gui_start_timer(200, Cat166AnimationMimicTimer);
  261.             }
  262.         }
  263.     }
  264.     else
  265.     {
  266.         /* source from id */
  267.         if (cat166_is_gif_anim)
  268.         {
  269.             /* animation, use GDI's auto play animation */
  270.             gdi_image_set_animation_last_frame_callback(cat166_animation_complete_callback_int);
  271.             cat166_animation_handle = GDI_ERROR_HANDLE;
  272.             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 */
  273.             /* if is 1 frame gif, treat as still image */
  274.             if (result == GDI_IMAGE_IS_STILL_IMAGE)
  275.             {
  276.                 gui_start_timer(200, Cat166AnimationMimicTimer);
  277.             }
  278.         }
  279.         else
  280.         {
  281.             /* static image */
  282.             gdi_image_draw_id(cat166_image_offset_x, cat166_image_offset_y, cat166_animation_id);
  283.             gui_start_timer(200, Cat166AnimationMimicTimer);
  284.         }
  285.     }
  286.     gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
  287. }
  288. /*****************************************************************************
  289.  * FUNCTION
  290.  *  ShowCategory166Screen
  291.  * DESCRIPTION
  292.  *  Show sategory 166 screen.
  293.  * PARAMETERS
  294.  *  image_id                        [IN]        Image id
  295.  *  image_filename                  [IN]        Image_filename
  296.  *  animation_complete_callback     [IN]        
  297.  * RETURNS
  298.  *  void
  299.  *****************************************************************************/
  300. void ShowCategory166Screen(U16 image_id, S8 *image_filename, void (*animation_complete_callback) (GDI_RESULT))
  301. {
  302.     /*----------------------------------------------------------------*/
  303.     /* Local Variables                                                */
  304.     /*----------------------------------------------------------------*/
  305.     dm_data_struct dm_data;
  306.     S32 image_width;
  307.     S32 image_height;
  308.     GDI_RESULT ret;
  309.     /* PMT DLT_FIXES_157 - TK 20060225 START */
  310.     U16 img_type;
  311.     /* PMT DLT_FIXES_157 - TK 20060225 END */
  312.     /*----------------------------------------------------------------*/
  313.     /* Code Body                                                      */
  314.     /*----------------------------------------------------------------*/
  315.     /* 
  316.      * If image_filename != NULL, means will use image from file as first priority.
  317.      * We will use image_id when the file is not able to play correctly. 
  318.      */
  319.     /* init var */
  320.     cat166_animation_complete_callback = animation_complete_callback;
  321.     cat166_animation_id = image_id;
  322.     cat166_animation_name = image_filename;
  323.     cat166_image_offset_x = 0;
  324.     cat166_image_offset_y = 0;
  325.     cat166_is_gif_anim = FALSE;
  326.     cat166_need_resize = FALSE;
  327.     cat166_is_invalid = FALSE;
  328.     /* full screen category */
  329.     entry_full_screen();
  330.     /* clear all key handlers */
  331.     clear_category_screen_key_handlers();
  332.     clear_left_softkey();
  333.     clear_right_softkey();
  334.    /*** get image parameters ***/
  335.     /* source from file */
  336.     if (cat166_animation_name != NULL)
  337.     {
  338.         ret = gdi_image_get_dimension_file(cat166_animation_name, &image_width, &image_height);
  339.         if (ret < 0)
  340.         {
  341.             /* set filename to NULL, will skip play this file */
  342.             cat166_animation_name = NULL;
  343.             gdi_layer_clear(GDI_COLOR_BLACK);
  344.             gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
  345.             if (cat166_animation_complete_callback != NULL)
  346.             {
  347.                 cat166_animation_complete_callback(-1);
  348.             }
  349.             return;
  350.         }
  351.         else
  352.         {
  353.             /* check if is gif animation or not */
  354.             switch (gdi_image_get_type_from_file(cat166_animation_name))
  355.             {
  356.                 case GDI_IMAGE_TYPE_JPG_FILE:
  357.                 case GDI_IMAGE_TYPE_PNG_FILE://082906 png resize
  358.                     cat166_is_gif_anim = FALSE;
  359.                     cat166_need_resize = TRUE;
  360.                     break;
  361.                 case GDI_IMAGE_TYPE_GIF_FILE:
  362.                 case GDI_IMAGE_TYPE_SVG_FILE://070406 SVG support
  363.                     cat166_is_gif_anim = TRUE;
  364.                     cat166_need_resize = TRUE;//070406 resize screensaver
  365.                     break;
  366.                 case GDI_IMAGE_TYPE_M3D_FILE:
  367.                     cat166_is_gif_anim = TRUE;
  368.                     cat166_need_resize = FALSE;
  369.                     break;
  370.                 default:
  371.                     cat166_is_gif_anim = FALSE;
  372.                     cat166_need_resize = FALSE;
  373.                     break;
  374.             }
  375.             if (cat166_need_resize == TRUE)
  376.             {
  377.                 if ((image_width <= UI_device_width) && (image_height <= UI_device_height))
  378.                 {
  379.                     cat166_need_resize = FALSE;
  380.                 }
  381.             }
  382.         }
  383.     }
  384.     /* source from ID */
  385.     if (cat166_animation_id != 0)
  386.     {
  387.         /* we assume internal resource is always correct */
  388.         gdi_image_get_dimension_id(cat166_animation_id, &image_width, &image_height);
  389.         /* check if is gif animation or not */
  390.         /* PMT DLT_FIXES_157 - TK 20060225 START */
  391.         img_type = gdi_image_get_type_from_id(cat166_animation_id);
  392.     #ifdef __MMI_DOWNLOADABLE_THEMES_SUPPORT__
  393.         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
  394.     #else 
  395.         if (img_type == IMAGE_TYPE_GIF || img_type == IMAGE_TYPE_M3D || img_type == IMAGE_TYPE_SVG)
  396.     #endif 
  397.             /* PMT DLT_FIXES_157 - TK 20060225 END */
  398.         {
  399.             cat166_is_gif_anim = TRUE;
  400.         }
  401.         else
  402.         {
  403.             cat166_is_gif_anim = FALSE; /* still image */
  404.         }
  405.     }
  406.     /* calc image draw pos, check if need resize */
  407.     if (cat166_need_resize)
  408.     {
  409.         gdi_image_util_fit_bbox(
  410.             UI_device_width,
  411.             UI_device_height,
  412.             image_width,
  413.             image_height,
  414.             &cat166_image_offset_x,
  415.             &cat166_image_offset_y,
  416.             &cat166_image_width,
  417.             &cat166_image_height);
  418.     }
  419.     else
  420.     {
  421.         cat166_image_offset_x = (UI_device_width - image_width) >> 1;
  422.         cat166_image_offset_y = (UI_device_height - image_height) >> 1;
  423.     }
  424.     ExitCategoryFunction = ExitCategory166Screen;
  425.     dm_data.s32CatId = MMI_CATEGORY166_ID;
  426.     dm_data.s32flags = DM_NO_FLAGS;
  427.     dm_data.s32ScrId = GetActiveScreenId();
  428.     dm_setup_data(&dm_data);
  429.     dm_register_category_controlled_callback(DrawCate166CategoryControlArea);
  430.     dm_redraw_category_screen();
  431. }
  432. /*****************************************************************************
  433.  * FUNCTION
  434.  *  ExitCategory166Screen
  435.  * DESCRIPTION
  436.  *  Exit Category166 screen
  437.  * PARAMETERS
  438.  *  void
  439.  * RETURNS
  440.  *  void
  441.  *****************************************************************************/
  442. void ExitCategory166Screen(void)
  443. {
  444.     /*----------------------------------------------------------------*/
  445.     /* Local Variables                                                */
  446.     /*----------------------------------------------------------------*/
  447.     /*----------------------------------------------------------------*/
  448.     /* Code Body                                                      */
  449.     /*----------------------------------------------------------------*/
  450.     /* stop animtion */
  451.     gdi_image_stop_animation_all();
  452.     if(cat166_animation_handle != GDI_ERROR_HANDLE)
  453.     {
  454.         gdi_image_stop_animation(cat166_animation_handle);
  455.         cat166_animation_handle = GDI_ERROR_HANDLE;
  456.     }
  457.     gui_cancel_timer(Cat166AnimationMimicTimer);
  458.     gui_cancel_timer(cat166_animation_complete_callback_failed);
  459.     cat166_animation_complete_callback = NULL;
  460. }
  461. /*****************************************************************************
  462.  * FUNCTION
  463.  *  StopCategory166Animation
  464.  * DESCRIPTION
  465.  *  Stop Category166 screen's animation
  466.  * PARAMETERS
  467.  *  void
  468.  * RETURNS
  469.  *  void
  470.  *****************************************************************************/
  471. void StopCategory166Animation(void)
  472. {
  473.     /*----------------------------------------------------------------*/
  474.     /* Local Variables                                                */
  475.     /*----------------------------------------------------------------*/
  476.     /*----------------------------------------------------------------*/
  477.     /* Code Body                                                      */
  478.     /*----------------------------------------------------------------*/
  479.     /* stop animtion */
  480.     gdi_image_stop_animation_all();
  481.     gui_cancel_timer(Cat166AnimationMimicTimer);
  482. }
  483. /* Category 170: SAT list menu screen (Equivalent to Cat-32)         */
  484. /*****************************************************************************
  485.  * FUNCTION
  486.  *  ShowCategory170Screen
  487.  * DESCRIPTION
  488.  *  Displays the Dynamic menu screen
  489.  * PARAMETERS
  490.  *  title                   [IN]        Title for the screen
  491.  *  title_icon              [IN]        Icon displayed with the title
  492.  *  left_softkey            [IN]        Left softkey label
  493.  *  left_softkey_icon       [IN]        Left softkey icon
  494.  *  right_softkey           [IN]        Right softkey label
  495.  *  right_softkey_icon      [IN]        Right softkey icon
  496.  *  number_of_items         [IN]        Number of items
  497.  *  list_of_items           [IN]        Array of items
  498.  *  list_of_icons           [IN]        Array of icons
  499.  *  flags                   [IN]        Flags (Always set to 0. Reserved for future use.)
  500.  *  highlighted_item        [IN]        Highlighted index
  501.  *  history_buffer          [IN]        History buffer
  502.  * RETURNS
  503.  *  void
  504.  *****************************************************************************/
  505. void ShowCategory170Screen(
  506.         U8 *title,
  507.         PU8 title_icon,
  508.         U8 *left_softkey,
  509.         PU8 left_softkey_icon,
  510.         U8 *right_softkey,
  511.         PU8 right_softkey_icon,
  512.         S32 number_of_items,
  513.         U8 **list_of_items,
  514.         PU8 *list_of_icons,
  515.         S32 flags,
  516.         S32 highlighted_item,
  517.         U8 *history_buffer)
  518. {
  519.     /*----------------------------------------------------------------*/
  520.     /* Local Variables                                                */
  521.     /*----------------------------------------------------------------*/
  522.     dm_data_struct dm_data;
  523.     S32 i;
  524.     U8 flag = 0;
  525.     U8 h_flag;
  526.     /*----------------------------------------------------------------*/
  527.     /* Code Body                                                      */
  528.     /*----------------------------------------------------------------*/
  529.     UI_UNUSED_PARAMETER(flags);
  530.     MMI_disable_title_shortcut_display = 0;
  531.     disable_menu_shortcut_box_display = 0;
  532.     gdi_layer_lock_frame_buffer();
  533.     create_fixed_icontext_menuitems();
  534.     resize_fixed_list(MMI_content_width, MMI_content_height);
  535.     associate_fixed_icontext_list();
  536.     ShowListCategoryScreen(
  537.         (UI_string_type) title,
  538.         title_icon,
  539.         (UI_string_type) left_softkey,
  540.         left_softkey_icon,
  541.         (UI_string_type) right_softkey,
  542.         right_softkey_icon,
  543.         number_of_items);
  544.     for (i = 0; i < number_of_items; i++)
  545.     {
  546.         add_fixed_icontext_item((UI_string_type) list_of_items[i], list_of_icons[i]);
  547.         if (list_of_icons[i] != UI_NULL_IMAGE)
  548.         {
  549.             flag = 1;
  550.         }
  551.     }
  552.     resize_fixed_icontext_menuitems(0, get_menu_item_height());
  553.     if (flag)
  554.     {
  555.         set_fixed_icontext_positions(MMI_MENUITEM_HEIGHT + 2, 0, 1, 0);
  556.     }
  557.     else
  558.     {
  559.         set_fixed_icontext_positions(1, 0, 1, 0);
  560.         MMI_fixed_icontext_menuitem.scroll_width = MMI_fixed_icontext_menuitem.width - 2;
  561.     }
  562.     h_flag = set_list_menu_category_history(MMI_CATEGORY170_ID, history_buffer);
  563.     if (h_flag)
  564.     {
  565.         fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
  566.     }
  567.     else
  568.     {
  569.         fixed_list_goto_item_no_redraw(highlighted_item);
  570.     }
  571.     gdi_layer_unlock_frame_buffer();
  572.     ExitCategoryFunction = ExitCategory170Screen;
  573.     dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
  574.     dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  575.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  576.     dm_data.s32CatId = MMI_CATEGORY170_ID;
  577.     dm_setup_data(&dm_data);
  578.     dm_redraw_category_screen();
  579. }   /* end of ShowCategory170Screen */
  580. /*****************************************************************************
  581.  * FUNCTION
  582.  *  ExitCategory170Screen
  583.  * DESCRIPTION
  584.  *  Exits the dynamic menu screen
  585.  * PARAMETERS
  586.  *  void
  587.  * RETURNS
  588.  *  void
  589.  *****************************************************************************/
  590. void ExitCategory170Screen(void)
  591. {
  592.     /*----------------------------------------------------------------*/
  593.     /* Local Variables                                                */
  594.     /*----------------------------------------------------------------*/
  595.     /*----------------------------------------------------------------*/
  596.     /* Code Body                                                      */
  597.     /*----------------------------------------------------------------*/
  598.     disable_menu_shortcut_box_display = 0;
  599.     close_scrolling_title();
  600.     ClearHighlightHandler();
  601.     reset_softkeys();
  602.     reset_menu_shortcut_handler();
  603.     reset_fixed_list();
  604. }   /* end of ExitCategory170Screen */
  605. /* Category 172: SAT Radio list (Equivalent to Cat-107)           */
  606. /*****************************************************************************
  607.  * FUNCTION
  608.  *  category172_list_highlight_handler
  609.  * DESCRIPTION
  610.  *  highlight handler of category 172
  611.  * PARAMETERS
  612.  *  item_index      [IN]        Index of highlighted item
  613.  * RETURNS
  614.  *  void
  615.  *****************************************************************************/
  616. void category172_list_highlight_handler(S32 item_index)
  617. {
  618.     /*----------------------------------------------------------------*/
  619.     /* Local Variables                                                */
  620.     /*----------------------------------------------------------------*/
  621.     /*----------------------------------------------------------------*/
  622.     /* Code Body                                                      */
  623.     /*----------------------------------------------------------------*/
  624.     MMI_menu_shortcut_number = item_index + 1;
  625. #ifndef __MMI_RADIO_BUTTON_HIGHLIGHT_NO_SELECT__
  626.     radio_list_handle_item_select_no_draw(item_index);
  627. #endif 
  628.     MMI_highlighted_item_text = get_item_text(item_index);
  629.     gdi_layer_lock_frame_buffer();
  630.     MMI_list_highlight_handler(item_index);
  631.     gdi_layer_unlock_frame_buffer();
  632. #if(UI_ENABLE_POP_UP_DESCRIPTIONS)
  633.     gui_pop_up_description_stop_scroll();
  634.     wgui_current_pop_up_description_index = item_index;
  635. #endif /* (UI_ENABLE_POP_UP_DESCRIPTIONS) */ 
  636. }   /* end of category172_list_highlight_handler */
  637. /*****************************************************************************
  638.  * FUNCTION
  639.  *  ShowCategory172Screen
  640.  * DESCRIPTION
  641.  *  Displays the Dynamic radio list
  642.  * PARAMETERS
  643.  *  title                   [IN]        Title for the screen
  644.  *  title_icon              [IN]        Icon displayed with the title
  645.  *  left_softkey            [IN]        Left softkey label
  646.  *  left_softkey_icon       [IN]        Left softkey icon
  647.  *  right_softkey           [IN]        Right softkey label
  648.  *  right_softkey_icon      [IN]        Right softkey icon
  649.  *  number_of_items         [IN]        Number of items
  650.  *  list_of_items           [IN]        Array of items
  651.  *  flags                   [IN]        Flags (Always set to 0. Reserved for future use.)
  652.  *  highlighted_item        [IN]        Highlighted index
  653.  *  history_buffer          [IN]        History buffer
  654.  * RETURNS
  655.  *  void
  656.  *****************************************************************************/
  657. void ShowCategory172Screen(
  658.         U8 *title,
  659.         PU8 title_icon,
  660.         U8 *left_softkey,
  661.         PU8 left_softkey_icon,
  662.         U8 *right_softkey,
  663.         PU8 right_softkey_icon,
  664.         S32 number_of_items,
  665.         U8 **list_of_items,
  666.         S32 flags,
  667.         S32 highlighted_item,
  668.         U8 *history_buffer)
  669. {
  670.     /*----------------------------------------------------------------*/
  671.     /* Local Variables                                                */
  672.     /*----------------------------------------------------------------*/
  673.     dm_data_struct dm_data;
  674.     S32 i;
  675.     U8 h_flag;
  676.     /*----------------------------------------------------------------*/
  677.     /* Code Body                                                      */
  678.     /*----------------------------------------------------------------*/
  679.     UI_UNUSED_PARAMETER(flags);
  680.     MMI_disable_title_shortcut_display = 1;
  681.     disable_menu_shortcut_box_display = 1;
  682.     gdi_layer_lock_frame_buffer();
  683.     create_fixed_twostate_menuitems(get_image(RADIO_ON_IMAGE_ID), get_image(RADIO_OFF_IMAGE_ID));
  684.     resize_fixed_list(MMI_content_width, MMI_content_height);
  685.     associate_fixed_twostate_list();
  686.     ShowListCategoryScreen(
  687.         (UI_string_type) title,
  688.         title_icon,
  689.         (UI_string_type) left_softkey,
  690.         left_softkey_icon,
  691.         (UI_string_type) right_softkey,
  692.         right_softkey_icon,
  693.         number_of_items);
  694.     resize_fixed_twostate_menuitems(0, MMI_MENUITEM_HEIGHT);
  695.     set_fixed_twostate_positions(MMI_MENUITEM_HEIGHT, 0, 1, 0);
  696.     register_hide_menu_shortcut(UI_dummy_function);
  697.     for (i = 0; i < number_of_items; i++)
  698.     {
  699.         add_fixed_twostate_item((UI_string_type) list_of_items[i]);
  700.     }
  701.     register_fixed_list_highlight_handler(category172_list_highlight_handler);
  702.     h_flag = set_list_menu_category_history(MMI_CATEGORY172_ID, history_buffer);
  703.     if (h_flag)
  704.     {
  705.         fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
  706.     }
  707.     else
  708.     {
  709.         fixed_list_goto_item_no_redraw(highlighted_item);
  710.     }
  711.     select_fixed_twostate_item(MMI_fixed_list_menu.highlighted_item);
  712.     setup_scrolling_title();
  713.     gdi_layer_unlock_frame_buffer();
  714.     ExitCategoryFunction = ExitCategory172Screen;
  715.     dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  716.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  717.     dm_data.s32CatId = MMI_CATEGORY172_ID;
  718.     dm_data.s32flags = DM_SCROLL_TITLE;
  719.     dm_setup_data(&dm_data);
  720.     dm_redraw_category_screen();
  721. }   /* end of ShowCategory172Screen */
  722. /*****************************************************************************
  723.  * FUNCTION
  724.  *  ExitCategory172Screen
  725.  * DESCRIPTION
  726.  *  Exits the dynamic menu screen
  727.  * PARAMETERS
  728.  *  void
  729.  * RETURNS
  730.  *  void
  731.  *****************************************************************************/
  732. void ExitCategory172Screen(void)
  733. {
  734.     /*----------------------------------------------------------------*/
  735.     /* Local Variables                                                */
  736.     /*----------------------------------------------------------------*/
  737.     /*----------------------------------------------------------------*/
  738.     /* Code Body                                                      */
  739.     /*----------------------------------------------------------------*/
  740.     disable_menu_shortcut_box_display = 0;
  741.     close_scrolling_title();
  742.     ClearHighlightHandler();
  743.     reset_softkeys();
  744.     reset_menu_shortcut_handler();
  745.     reset_fixed_list();
  746. }   /* end of ExitCategory172Screen */
  747. /* Category 174: SAT list menu screen (Equivalent to Cat-32), with pop up hints  */
  748. /*****************************************************************************
  749.  * FUNCTION
  750.  *  Category174ChangeItemText
  751.  * DESCRIPTION
  752.  *  chaneg text of particalue menu item ofcategory 174
  753.  * PARAMETERS
  754.  *  index       [IN]        Index of the menuitem
  755.  *  text        [IN]        String of menuitem text
  756.  * RETURNS
  757.  *  void
  758.  *****************************************************************************/
  759. void Category174ChangeItemText(S32 index, U8 *text)
  760. {
  761.     /*----------------------------------------------------------------*/
  762.     /* Local Variables                                                */
  763.     /*----------------------------------------------------------------*/
  764.     /*----------------------------------------------------------------*/
  765.     /* Code Body                                                      */
  766.     /*----------------------------------------------------------------*/
  767.     MMI_fixed_icontext_menuitems[index].item_text = (UI_string_type) text;
  768. }   /* end of Category174ChangeItemText */
  769. /*****************************************************************************
  770.  * FUNCTION
  771.  *  Category174ChangeItemIcon
  772.  * DESCRIPTION
  773.  *  chaneg icon of particalue menu item ofcategory 174
  774.  * PARAMETERS
  775.  *  index           [IN]        Index of the menuitem
  776.  *  image_ID        [IN]        Image id of menuitem icon
  777.  * RETURNS
  778.  *  void
  779.  *****************************************************************************/
  780. void Category174ChangeItemIcon(S32 index, U16 image_ID)
  781. {
  782.     /*----------------------------------------------------------------*/
  783.     /* Local Variables                                                */
  784.     /*----------------------------------------------------------------*/
  785.     /*----------------------------------------------------------------*/
  786.     /* Code Body                                                      */
  787.     /*----------------------------------------------------------------*/
  788.     MMI_fixed_icontext_menuitems[index].item_icon = (PU8) get_image(image_ID);
  789. }   /* end of Category174ChangeItemIcon *//* 0331 */
  790. /*****************************************************************************
  791.  * FUNCTION
  792.  *  Category174ChangeItemDescription
  793.  * DESCRIPTION
  794.  *  chaneg description of popup of particalue menu item ofcategory 174
  795.  * PARAMETERS
  796.  *  index       [IN]        Index of the menuitem
  797.  *  text        [IN]        String value of hint data of menuitem.
  798.  * RETURNS
  799.  *  void
  800.  *****************************************************************************/
  801. void Category174ChangeItemDescription(S32 index, U8 *text)
  802. {
  803.     /*----------------------------------------------------------------*/
  804.     /* Local Variables                                                */
  805.     /*----------------------------------------------------------------*/
  806.     /*----------------------------------------------------------------*/
  807.     /* Code Body                                                      */
  808.     /*----------------------------------------------------------------*/
  809.     wgui_pop_up_description_strings[index].text_strings[0] = (UI_string_type) text;
  810. #ifdef __MMI_UI_HINT_TOGGLE_TRANSITION__
  811.     wgui_setup_pop_up_description_transition();
  812. #endif 
  813. }   /* end of Category174ChangeItemDescription */
  814. /*****************************************************************************
  815.  * FUNCTION
  816.  *  ShowCategory174Screen
  817.  * DESCRIPTION
  818.  *  Displays the Dynamic menu screen with description.
  819.  * PARAMETERS
  820.  *  title                       [IN]        Title for the screen
  821.  *  title_icon                  [IN]        Icon displayed with the title
  822.  *  left_softkey                [IN]        Left softkey label
  823.  *  left_softkey_icon           [IN]        Left softkey icon
  824.  *  right_softkey               [IN]        Right softkey label
  825.  *  right_softkey_icon          [IN]        Right softkey icon
  826.  *  number_of_items             [IN]        Number of items
  827.  *  list_of_items               [IN]        Array of items
  828.  *  list_of_icons               [IN]        Array of icons
  829.  *  list_of_descriptions        [IN]        
  830.  *  flags                       [IN]        Flags (Always set to 0. Reserved for future use.)
  831.  *  highlighted_item            [IN]        Highlighted index
  832.  *  history_buffer              [IN]        History buffer
  833.  * RETURNS
  834.  *  void
  835.  *****************************************************************************/
  836. void ShowCategory174Screen(
  837.         U8 *title,
  838.         PU8 title_icon,
  839.         U8 *left_softkey,
  840.         PU8 left_softkey_icon,
  841.         U8 *right_softkey,
  842.         PU8 right_softkey_icon,
  843.         S32 number_of_items,
  844.         U8 **list_of_items,
  845.         PU8 *list_of_icons,
  846.         U8 **list_of_descriptions,
  847.         S32 flags,
  848.         S32 highlighted_item,
  849.         U8 *history_buffer)
  850. {
  851.     /*----------------------------------------------------------------*/
  852.     /* Local Variables                                                */
  853.     /*----------------------------------------------------------------*/
  854.     dm_data_struct dm_data;
  855.     S32 i;
  856.     U8 flag = 0;
  857.     U8 h_flag;
  858.     /*----------------------------------------------------------------*/
  859.     /* Code Body                                                      */
  860.     /*----------------------------------------------------------------*/
  861.     UI_UNUSED_PARAMETER(flags);
  862.     MMI_disable_title_shortcut_display = 1;
  863.     disable_menu_shortcut_box_display = 1;
  864.     gdi_layer_lock_frame_buffer();
  865.     create_fixed_icontext_menuitems();
  866.     associate_fixed_icontext_list();
  867.     ShowListCategoryScreen(
  868.         (UI_string_type) title,
  869.         title_icon,
  870.         (UI_string_type) left_softkey,
  871.         left_softkey_icon,
  872.         (UI_string_type) right_softkey,
  873.         right_softkey_icon,
  874.         number_of_items);
  875.     setup_scrolling_title();
  876.     if (list_of_descriptions == NULL)
  877.     {
  878.         for (i = 0; i < number_of_items; i++)
  879.         {
  880.             add_fixed_icontext_item((UI_string_type) list_of_items[i], (PU8) list_of_icons[i]);
  881.             wgui_pop_up_description_strings[i].text_strings[0] = NULL;
  882.             if (list_of_icons[i] != UI_NULL_IMAGE)
  883.             {
  884.                 flag = 1;
  885.             }
  886.         }
  887.     }
  888.     else
  889.     {
  890.         for (i = 0; i < number_of_items; i++)
  891.         {
  892.             add_fixed_icontext_item((UI_string_type) list_of_items[i], (PU8) list_of_icons[i]);
  893.             wgui_pop_up_description_strings[i].text_strings[0] = (UI_string_type) list_of_descriptions[i];
  894.             if (list_of_icons[i] != UI_NULL_IMAGE)
  895.             {
  896.                 flag = 1;
  897.             }
  898.         }
  899.     }
  900.     resize_fixed_icontext_menuitems(0, MMI_MENUITEM_HEIGHT);    /* 090605 Service Calvin modified */
  901.     if (flag)
  902.     {
  903.         set_fixed_icontext_positions(MMI_MENUITEM_HEIGHT + 2, 0, 1, 0);
  904.     }
  905.     else
  906.     {
  907.         set_fixed_icontext_positions(1, 0, 1, 0);
  908.         MMI_fixed_icontext_menuitem.scroll_width = MMI_fixed_icontext_menuitem.width - 2;
  909.     }
  910.     h_flag = set_list_menu_category_history(MMI_CATEGORY174_ID, history_buffer);
  911.     if (h_flag)
  912.     {
  913.         fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
  914.     }
  915.     else
  916.     {
  917.         fixed_list_goto_item_no_redraw(highlighted_item);
  918.     }
  919.     set_pop_up_descriptions(1, number_of_items, MMI_fixed_list_menu.highlighted_item);
  920.     gdi_layer_unlock_frame_buffer();
  921.     ExitCategoryFunction = ExitCategory174Screen;
  922.     dm_data.s32flags = DM_SCROLL_TITLE;
  923.     dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  924.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  925.     dm_data.s32CatId = MMI_CATEGORY174_ID;
  926.     dm_data.s32flags |= DM_CLEAR_SCREEN_BACKGROUND;
  927.     dm_setup_data(&dm_data);
  928.     dm_redraw_category_screen();
  929. }   /* end of ShowCategory174Screen */
  930. /*****************************************************************************
  931.  * FUNCTION
  932.  *  ExitCategory174Screen
  933.  * DESCRIPTION
  934.  *  Exits the dynamic menu screen
  935.  * PARAMETERS
  936.  *  void
  937.  * RETURNS
  938.  *  void
  939.  *****************************************************************************/
  940. void ExitCategory174Screen(void)
  941. {
  942.     /*----------------------------------------------------------------*/
  943.     /* Local Variables                                                */
  944.     /*----------------------------------------------------------------*/
  945.     /*----------------------------------------------------------------*/
  946.     /* Code Body                                                      */
  947.     /*----------------------------------------------------------------*/
  948.     MMI_disable_title_shortcut_display = 0;
  949.     disable_menu_shortcut_box_display = 0;
  950.     close_scrolling_title();
  951.     ClearHighlightHandler();
  952.     reset_softkeys();
  953.     reset_pop_up_descriptions();
  954.     reset_menu_shortcut_handler();
  955.     reset_fixed_list();
  956. }   /* end of ExitCategory174Screen */
  957. #ifdef __J2ME__
  958. UI_filled_area *wgui_cat16_backup_filler = NULL;
  959. /* 011507 menu Start */
  960. void wgui_cat176_set_jui_menu_filler(void)
  961. {
  962.     if (wgui_cat16_backup_filler == NULL)
  963.     {
  964.         wgui_cat16_backup_filler = MMI_fixed_list_menu.normal_filler;
  965.         MMI_fixed_list_menu.normal_filler = current_MMI_theme->general_background_filler;
  966.     }
  967. }
  968. void wgui_cat176_reset_jui_menu_filler(void)
  969. {
  970.     if (wgui_cat16_backup_filler != NULL)
  971.     {
  972.         MMI_fixed_list_menu.normal_filler = wgui_cat16_backup_filler;
  973.         wgui_cat16_backup_filler = NULL;
  974.     }
  975. }
  976. /* 011507 menu End */
  977. /*****************************************************************************
  978.  * FUNCTION
  979.  *  RedrawCategory176Screen
  980.  * DESCRIPTION
  981.  *  Redraws the dynamic menu screen (For SIM Application Toolkit)
  982.  * PARAMETERS
  983.  *  void
  984.  * RETURNS
  985.  *  void
  986.  *****************************************************************************/
  987. //////////////////////////////////////////////////////////////////////
  988. ///
  989. ///     Category 176 is used by java.
  990. ///                     It is modify from Category 170.. 
  991. ///                     and remove keypad register, scrolling title, shortcut, blt out
  992. ///             
  993. void RedrawCategory176Screen(void)
  994. {
  995.     /*----------------------------------------------------------------*/
  996.     /* Local Variables                                                */
  997.     /*----------------------------------------------------------------*/
  998.     UI_filled_area *f = current_MMI_theme->general_background_filler;
  999.     /*----------------------------------------------------------------*/
  1000.     /* Code Body                                                      */
  1001.     /*----------------------------------------------------------------*/
  1002.     gdi_layer_lock_frame_buffer();
  1003.     clear_buttonbar();
  1004.     gui_reset_clip();
  1005.     gui_draw_filled_area(0, 0, 24, MMI_multiline_inputbox.height, f);
  1006.     draw_title();
  1007.     //move_fixed_list(0,MMI_title_height);//120606 jui menu
  1008.     show_fixed_list();
  1009.     show_softkey_background();
  1010.     show_left_softkey();
  1011.     show_right_softkey();
  1012.     gdi_layer_unlock_frame_buffer();
  1013. }
  1014. /*****************************************************************************
  1015.  * FUNCTION
  1016.  *  ShowCategory176Screen
  1017.  * DESCRIPTION
  1018.  *  Displays the Dynamic menu screen
  1019.  * PARAMETERS
  1020.  *  title                   [IN]        Title for the screen
  1021.  *  title_icon              [IN]        Icon displayed with the title
  1022.  *  left_softkey            [IN]        Left softkey label
  1023.  *  left_softkey_icon       [IN]        Left softkey icon
  1024.  *  right_softkey           [IN]        Right softkey label
  1025.  *  right_softkey_icon      [IN]        Right softkey icon
  1026.  *  number_of_items         [IN]        Number of items
  1027.  *  list_of_items           [IN]        Array of items
  1028.  *  list_of_icons           [IN]        Array of icons
  1029.  *  flags                   [IN]        Flags (Always set to 0. Reserved for future use.)
  1030.  *  highlighted_item        [IN]        Highlighted index
  1031.  *  is_full_screen          [IN]        is full screen or not
  1032.  *  history_buffer          [IN]        History buffer
  1033.  * RETURNS
  1034.  *  void
  1035.  *****************************************************************************/
  1036. void ShowCategory176Screen(
  1037.         U8 *title,
  1038.         PU8 title_icon,
  1039.         U8 *left_softkey,
  1040.         PU8 left_softkey_icon,
  1041.         U8 *right_softkey,
  1042.         PU8 right_softkey_icon,
  1043.         S32 number_of_items,
  1044.         U8 **list_of_items,
  1045.         PU8 *list_of_icons,
  1046.         S32 flags,
  1047.         S32 highlighted_item,
  1048.         U32 is_full_screen,//120606 jui menu
  1049.         U8 *history_buffer)
  1050. {
  1051.     /*----------------------------------------------------------------*/
  1052.     /* Local Variables                                                */
  1053.     /*----------------------------------------------------------------*/
  1054.     S32 i;
  1055.     U8 flag = 0;
  1056.     U8 h_flag;
  1057.     /*----------------------------------------------------------------*/
  1058.     /* Code Body                                                      */
  1059.     /*----------------------------------------------------------------*/
  1060.     UI_UNUSED_PARAMETER(flags);
  1061.     MMI_disable_title_shortcut_display = 1;
  1062.     gdi_layer_lock_frame_buffer();
  1063.     create_fixed_icontext_menuitems();
  1064.     associate_fixed_icontext_list();
  1065.     MMI_fixed_icontext_menuitem.flags &= ~UI_MENUITEM_MARQUEE_SCROLL;
  1066.     /* 011507 menu Start */
  1067.     //wgui_cat16_backup_filler = MMI_fixed_list_menu.normal_filler;
  1068.     //MMI_fixed_list_menu.normal_filler = current_MMI_theme->general_background_filler;
  1069.     /* Title */
  1070.     MMI_title_string = (UI_string_type) title;
  1071.     MMI_title_icon = title_icon;
  1072.     /* ShortCut */
  1073.     MMI_menu_shortcut_number = -1;
  1074.     /* Softkeys */
  1075.     set_left_softkey_label((UI_string_type) left_softkey);
  1076.     set_left_softkey_icon(left_softkey_icon);
  1077.     set_right_softkey_label((UI_string_type) right_softkey);
  1078.     set_right_softkey_icon(right_softkey_icon);
  1079.     /* List */
  1080.     MMI_current_menu_type = LIST_MENU;
  1081. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1082.     gui_block_list_effect();
  1083. #endif 
  1084.     for (i = 0; i < number_of_items; i++)
  1085.     {
  1086.         add_fixed_icontext_item((UI_string_type) list_of_items[i], list_of_icons[i]);
  1087.         if (list_of_icons[i] != UI_NULL_IMAGE)
  1088.         {
  1089.             flag = 1;
  1090.         }
  1091.     }
  1092.     move_fixed_list(0,MMI_title_height);//120606 jui menu
  1093.     if(is_full_screen)
  1094.     {
  1095.         resize_fixed_list(MMI_content_width, UI_device_height-MMI_title_height-MMI_button_bar_height);
  1096.     }
  1097.     else
  1098.     {
  1099.         resize_fixed_list(MMI_content_width, MMI_content_height);
  1100.     }
  1101.     resize_fixed_icontext_menuitems(0, MMI_ICONTEXT_MENUITEM_HEIGHT);
  1102.     if (flag)
  1103.     {
  1104.         set_fixed_icontext_positions(MMI_MENUITEM_HEIGHT + 2, 0, 1, 0);
  1105.     }
  1106.     else
  1107.     {
  1108.         set_fixed_icontext_positions(1, 0, 1, 0);
  1109.         MMI_fixed_icontext_menuitem.scroll_width = MMI_fixed_icontext_menuitem.width - 2;
  1110.     }
  1111.     h_flag = set_list_menu_category_history(MMI_CATEGORY176_ID, history_buffer);
  1112.     if (h_flag)
  1113.     {
  1114.         fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
  1115.     }
  1116.     else
  1117.     {
  1118.         fixed_list_goto_item_no_redraw(highlighted_item);
  1119.     }
  1120.     gui_set_multilayer_mask(gui_get_multilayer_mask() & ~UI_MUL_BKG_SUBMENU);
  1121.     gui_set_multilayer_mask(gui_get_multilayer_mask() & ~UI_MUL_BKG_MAINMENU);
  1122.     gdi_layer_unlock_frame_buffer();
  1123.     MMI_fixed_list_menu.act_lcd_handle = GDI_LCD_MAIN_LCD_HANDLE;
  1124.     MMI_fixed_list_menu.act_layer_handle = jui_layer_handle;
  1125.     SetListScreenFunctions(MMI_CATEGORY176_ID);
  1126.     RedrawCategoryFunction = RedrawCategory176Screen;
  1127.     ExitCategoryFunction = ExitCategory176Screen;
  1128.     RedrawCategoryFunction();
  1129. }   /* end of ShowCategory176Screen */
  1130. /*****************************************************************************
  1131.  * FUNCTION
  1132.  *  ExitCategory176Screen
  1133.  * DESCRIPTION
  1134.  *  Exits the dynamic menu screen
  1135.  * PARAMETERS
  1136.  *  void
  1137.  * RETURNS
  1138.  *  void
  1139.  *****************************************************************************/
  1140. void ExitCategory176Screen(void)
  1141. {
  1142.     /*----------------------------------------------------------------*/
  1143.     /* Local Variables                                                */
  1144.     /*----------------------------------------------------------------*/
  1145.     /*----------------------------------------------------------------*/
  1146.     /* Code Body                                                      */
  1147.     /*----------------------------------------------------------------*/
  1148.     disable_menu_shortcut_box_display = 0;
  1149.     /* 011507 menu Start */
  1150.     //MMI_fixed_list_menu.normal_filler = wgui_cat16_backup_filler;
  1151.     close_scrolling_title();
  1152.     ClearHighlightHandler();
  1153.     reset_softkeys();
  1154.     reset_menu_shortcut_handler();
  1155.     reset_fixed_list();
  1156.     MMI_fixed_list_menu.act_lcd_handle = GDI_LCD_MAIN_LCD_HANDLE;
  1157.     MMI_fixed_list_menu.act_layer_handle = GDI_LAYER_MAIN_BASE_LAYER_HANDLE;
  1158. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1159.     gui_unblock_list_effect();
  1160. #endif 
  1161. }
  1162. #endif
  1163. /*****************************************************************************
  1164.  * FUNCTION
  1165.  *  redraw_fixed_list_and_title_bar
  1166.  * DESCRIPTION
  1167.  *  
  1168.  * PARAMETERS
  1169.  *  void
  1170.  * RETURNS
  1171.  *  void
  1172.  *****************************************************************************/
  1173. void redraw_fixed_list_and_title_bar(void)
  1174. {
  1175.     /*----------------------------------------------------------------*/
  1176.     /* Local Variables                                                */
  1177.     /*----------------------------------------------------------------*/
  1178.     /*----------------------------------------------------------------*/
  1179.     /* Code Body                                                      */
  1180.     /*----------------------------------------------------------------*/
  1181. #if(UI_BLINKING_CURSOR_SUPPORT)
  1182.     StopMyTimer(BLINKING_CURSOR);
  1183. #endif 
  1184.     draw_title();
  1185.     redraw_fixed_list();
  1186.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1187.     SetRightSoftkeyFunction(UI_dummy_function, KEY_EVENT_DOWN);
  1188. }
  1189. /* Phonebook   */
  1190. /*****************************************************************************
  1191.  * FUNCTION
  1192.  *  show_phonebook_list_inputbox
  1193.  * DESCRIPTION
  1194.  *  
  1195.  * PARAMETERS
  1196.  *  pbName      [IN]        
  1197.  * RETURNS
  1198.  *  void
  1199.  *****************************************************************************/
  1200. void show_phonebook_list_inputbox(PU8 pbName)
  1201. {
  1202.     /*----------------------------------------------------------------*/
  1203.     /* Local Variables                                                */
  1204.     /*----------------------------------------------------------------*/
  1205.     S32 inputbox_x, inputbox_y, inputbox_width, inputbox_height;
  1206.     /*----------------------------------------------------------------*/
  1207.     /* Code Body                                                      */
  1208.     /*----------------------------------------------------------------*/
  1209.     wgui_setup_input_information(0, 1, UI_device_width >> 1, (MMI_title_y + MMI_title_height) - 2);
  1210.     inputbox_x = wgui_inputbox_information_bar_width;
  1211.     inputbox_y = 0;
  1212.     inputbox_width = UI_device_width - wgui_inputbox_information_bar_width;
  1213.     inputbox_height = MMI_title_height;
  1214.     wgui_setup_singleline_inputbox(
  1215.         inputbox_x,
  1216.         inputbox_y,
  1217.         inputbox_width,
  1218.         inputbox_height,
  1219.         pbName,
  1220.         7,
  1221.         MMI_CATEGORY53_ID,
  1222.         get_string(STR_GLOBAL_BACK),
  1223.         get_image(IMG_GLOBAL_BACK),
  1224.         INPUT_TYPE_ALPHANUMERIC_LOWERCASE | INPUT_TYPE_USE_ENCODING_BASED_LENGTH,
  1225.         NULL,
  1226.         1);
  1227.     wgui_singleline_inputbox_RSK_function = redraw_fixed_list_and_title_bar;
  1228. }
  1229. /* MTK end */
  1230. static S32 input_box_y = 0, input_box_x = 0;
  1231. static U16 cat200_search_img = 0;
  1232. S32(*cat200_search_function) (U8 *);
  1233. UI_filled_area yellowcat200wgui_color_dialog_background = {UI_FILLED_AREA_TYPE_COLOR,
  1234.     UI_NULL_IMAGE,
  1235.     NULL,
  1236.     {238, 243, 33, 100},
  1237.     {0, 0, 0, 0},
  1238.     {0, 0, 0, 100},
  1239.     {50, 50, 50, 100},
  1240.     0
  1241. };
  1242. UI_filled_area cat200_inputbox_BG_filler = 
  1243. {
  1244.     UI_FILLED_AREA_TYPE_COLOR,
  1245.     UI_NULL_IMAGE,
  1246.     NULL,
  1247.     {255, 222, 255, 100},
  1248.     {0, 0, 0, 0},
  1249.     {255, 255, 255, 100},
  1250.     {255, 255, 255, 100},
  1251.     0
  1252. };
  1253. /* theme of single input box of enter pin screen */
  1254. UI_single_line_input_box_theme cat200_singleline_inputbox_theme = { &cat200_inputbox_BG_filler,
  1255.     &cat200_inputbox_BG_filler,
  1256.     &cat200_inputbox_BG_filler,
  1257.     {0, 0, 0, 100},
  1258.     {128, 128, 128, 100},
  1259.     {0, 0, 0, 100},
  1260.     {255, 255, 255, 100},
  1261.     {51, 88, 171, 100},
  1262.     {255, 0, 0, 100},
  1263.     &UI_DEFAULT_FONT,
  1264.     1,
  1265.     UI_SINGLE_LINE_INPUT_BOX_CENTER_Y,
  1266.     '*'
  1267. };
  1268. /*****************************************************************************
  1269.  * FUNCTION
  1270.  *  SetCategory200LeftSoftkeyFunction
  1271.  * DESCRIPTION
  1272.  *  set the right soft key function handler of category 200
  1273.  * PARAMETERS
  1274.  *  f               [IN]        
  1275.  *  k               [IN]        
  1276.  *  function(?)     [IN]        Pointer
  1277.  *  key(?)          [IN]        Event type
  1278.  * RETURNS
  1279.  *  void
  1280.  *****************************************************************************/
  1281. void SetCategory200LeftSoftkeyFunction(void (*f) (void), MMI_key_event_type k)
  1282. {
  1283.     /*----------------------------------------------------------------*/
  1284.     /* Local Variables                                                */
  1285.     /*----------------------------------------------------------------*/
  1286.     /*----------------------------------------------------------------*/
  1287.     /* Code Body                                                      */
  1288.     /*----------------------------------------------------------------*/
  1289.     wgui_singleline_inputbox_LSK_function = f;
  1290. }
  1291. /*****************************************************************************
  1292.  * FUNCTION
  1293.  *  SetCategory200RightSoftkeyFunction
  1294.  * DESCRIPTION
  1295.  *  set the right soft key function handler of category 200
  1296.  * PARAMETERS
  1297.  *  f               [IN]        
  1298.  *  k               [IN]        
  1299.  *  function(?)     [IN]        Pointer
  1300.  *  key(?)          [IN]        Event type
  1301.  * RETURNS
  1302.  *  void
  1303.  *****************************************************************************/
  1304. void SetCategory200RightSoftkeyFunction(void (*f) (void), MMI_key_event_type k)
  1305. {
  1306.     /*----------------------------------------------------------------*/
  1307.     /* Local Variables                                                */
  1308.     /*----------------------------------------------------------------*/
  1309.     /*----------------------------------------------------------------*/
  1310.     /* Code Body                                                      */
  1311.     /*----------------------------------------------------------------*/
  1312.     UI_UNUSED_PARAMETER(k);
  1313.     wgui_singleline_inputbox_RSK_function = f;
  1314. }
  1315. /*****************************************************************************
  1316.  * FUNCTION
  1317.  *  RegisterCat200SearchFunction
  1318.  * DESCRIPTION
  1319.  *  search function register by application
  1320.  * PARAMETERS
  1321.  *  search_function     [IN]        
  1322.  *  function(?)         [IN]        Pointer
  1323.  * RETURNS
  1324.  *  void
  1325.  *****************************************************************************/
  1326. void RegisterCat200SearchFunction(S32(*search_function) (U8 *))
  1327. {
  1328.     /*----------------------------------------------------------------*/
  1329.     /* Local Variables                                                */
  1330.     /*----------------------------------------------------------------*/
  1331.     /*----------------------------------------------------------------*/
  1332.     /* Code Body                                                      */
  1333.     /*----------------------------------------------------------------*/
  1334.     if (search_function)
  1335.     {
  1336.         cat200_search_function = search_function;
  1337.     }
  1338. }
  1339. BOOL(*wgui_check_application_present) (S32 *max_number) = NULL;
  1340. /*****************************************************************************
  1341.  * FUNCTION
  1342.  *  Register_appl_present_function
  1343.  * DESCRIPTION
  1344.  *  
  1345.  * PARAMETERS
  1346.  *  application_present_function        [IN]        
  1347.  * RETURNS
  1348.  *  void
  1349.  *****************************************************************************/
  1350. void Register_appl_present_function(BOOL(*application_present_function) (S32 *max_number))
  1351. {
  1352.     /*----------------------------------------------------------------*/
  1353.     /* Local Variables                                                */
  1354.     /*----------------------------------------------------------------*/
  1355.     /*----------------------------------------------------------------*/
  1356.     /* Code Body                                                      */
  1357.     /*----------------------------------------------------------------*/
  1358.     wgui_check_application_present = application_present_function;
  1359. }
  1360. /*****************************************************************************
  1361.  * FUNCTION
  1362.  *  refresh_search_list_change_list
  1363.  * DESCRIPTION
  1364.  *  input call back function of category200 multi tap
  1365.  * PARAMETERS
  1366.  *  no_entries                  [IN]        
  1367.  *  UI_character_type(?)        [IN]        Inp
  1368.  * RETURNS
  1369.  *  void
  1370.  *****************************************************************************/
  1371. void refresh_search_list_change_list(S32 no_entries)
  1372. {
  1373.     /*----------------------------------------------------------------*/
  1374.     /* Local Variables                                                */
  1375.     /*----------------------------------------------------------------*/
  1376.     S32 shortcut_width;
  1377.     S32 max_entries = 0;
  1378.     BOOL showOption, application_present;
  1379.     /*----------------------------------------------------------------*/
  1380.     /* Code Body                                                      */
  1381.     /*----------------------------------------------------------------*/
  1382.     MMI_fixed_list_menu.highlighted_item = 0;
  1383.     MMI_fixed_list_menu.n_items = no_entries;
  1384.     MMI_fixed_list_menu.displayed_items = no_entries;
  1385.     if (wgui_check_application_present)
  1386.     {
  1387.         application_present = wgui_check_application_present(&max_entries);
  1388.     }
  1389.     else
  1390.     {
  1391.         application_present = MMI_FALSE;
  1392.     }
  1393.     if (application_present)
  1394.     {
  1395.         shortcut_width = set_menu_item_count(max_entries) + 7;  /* number of words goes beyond this limit, and increases at the run time */
  1396.     }
  1397.     else
  1398.     {
  1399.         shortcut_width = set_menu_item_count(no_entries) + 7;
  1400.     }
  1401.     resize_menu_shortcut_handler(shortcut_width, MMI_title_height);
  1402.     move_menu_shortcut_handler(UI_device_width - shortcut_width, MMI_title_y);
  1403. #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  1404.     /* to handle an issue on empty search ie no entery in phonebook of same name */
  1405.     show_softkey_background();
  1406. #endif /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
  1407.     if (application_present)
  1408.     {
  1409.         showOption = no_entries >= 0 ? MMI_TRUE : MMI_FALSE;
  1410.     }
  1411.     else
  1412.     {
  1413.         showOption = no_entries > 0 ? MMI_TRUE : MMI_FALSE;
  1414.     }
  1415.     if (showOption)
  1416.     {
  1417.         set_left_softkey_label(wgui_singleline_inputbox_LSK_label_string);
  1418.         set_left_softkey_icon(wgui_singleline_inputbox_LSK_label_icon);
  1419.         redraw_left_softkey();
  1420.         register_left_softkey_handler();
  1421.         set_left_softkey_function(wgui_singleline_inputbox_LSK_function, KEY_EVENT_UP);
  1422.         set_left_softkey_function(UI_dummy_function, KEY_EVENT_DOWN);
  1423.         dynamic_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
  1424.         draw_title();
  1425.     }
  1426.     else
  1427.     {
  1428.         set_left_softkey_label(NULL);
  1429.         set_left_softkey_icon(NULL);
  1430.         redraw_left_softkey();
  1431.         set_left_softkey_function(UI_dummy_function, KEY_EVENT_UP);
  1432.         set_left_softkey_function(UI_dummy_function, KEY_EVENT_DOWN);
  1433.         gui_fixed_icontext_menuitem_stop_scroll();
  1434.         gui_pop_up_description_stop_scroll();
  1435.         MMI_menu_shortcut_number = 0;
  1436.         draw_title();
  1437.         wgui_current_pop_up_description_index = -1;
  1438.     }
  1439.     show_dynamic_list();
  1440. }
  1441. /*****************************************************************************
  1442.  * FUNCTION
  1443.  *  refresh_search_list_change_list_ext
  1444.  * DESCRIPTION
  1445.  *  
  1446.  * PARAMETERS
  1447.  *  no_entries              [IN]        
  1448.  *  highlighted_item        [IN]        
  1449.  * RETURNS
  1450.  *  void
  1451.  *****************************************************************************/
  1452. void refresh_search_list_change_list_ext(S32 no_entries, S32 highlighted_item)
  1453. {
  1454.     /*----------------------------------------------------------------*/
  1455.     /* Local Variables                                                */
  1456.     /*----------------------------------------------------------------*/
  1457.     S32 shortcut_width, max_entries = 0;
  1458.     BOOL showOption, application_present;
  1459.     /*----------------------------------------------------------------*/
  1460.     /* Code Body                                                      */
  1461.     /*----------------------------------------------------------------*/
  1462.     MMI_fixed_list_menu.highlighted_item = highlighted_item;
  1463.     MMI_fixed_list_menu.n_items = no_entries;
  1464.     MMI_fixed_list_menu.displayed_items = no_entries;
  1465.     if (wgui_check_application_present)
  1466.     {
  1467.         application_present = wgui_check_application_present(&max_entries);     /* true in case of dictionary */
  1468.     }
  1469.     else
  1470.     {
  1471.         application_present = MMI_FALSE;
  1472.     }
  1473.     if (application_present)
  1474.     {
  1475.         shortcut_width = set_menu_item_count(max_entries) + 7;  /* number of words goes beyond this limit, and increases at the run time */
  1476.     }
  1477.     else
  1478.     {
  1479.         shortcut_width = set_menu_item_count(no_entries) + 7;
  1480.     }
  1481.     resize_menu_shortcut_handler(shortcut_width, MMI_title_height);
  1482.     move_menu_shortcut_handler(UI_device_width - shortcut_width, MMI_title_y);
  1483. #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  1484.     /* to handle an issue on empty search ie no entery in phonebook of same name */
  1485.     show_softkey_background();
  1486. #endif /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
  1487.     if (application_present)
  1488.     {
  1489.         showOption = no_entries >= 0 ? MMI_TRUE : MMI_FALSE;
  1490.     }
  1491.     else
  1492.     {
  1493.         showOption = no_entries > 0 ? MMI_TRUE : MMI_FALSE;
  1494.     }
  1495.     if (showOption)
  1496.     {
  1497.         set_left_softkey_label(wgui_singleline_inputbox_LSK_label_string);
  1498.         set_left_softkey_icon(wgui_singleline_inputbox_LSK_label_icon);
  1499.         redraw_left_softkey();
  1500.         register_left_softkey_handler();
  1501.         set_left_softkey_function(wgui_singleline_inputbox_LSK_function, KEY_EVENT_UP);
  1502.         set_left_softkey_function(UI_dummy_function, KEY_EVENT_DOWN);
  1503.         dynamic_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
  1504.         draw_title();
  1505.     }
  1506.     else
  1507.     {
  1508.         set_left_softkey_label(NULL);
  1509.         set_left_softkey_icon(NULL);
  1510.         redraw_left_softkey();
  1511.         set_left_softkey_function(UI_dummy_function, KEY_EVENT_UP);
  1512.         set_left_softkey_function(UI_dummy_function, KEY_EVENT_DOWN);
  1513.         gui_fixed_icontext_menuitem_stop_scroll();
  1514.         gui_pop_up_description_stop_scroll();
  1515.         MMI_menu_shortcut_number = 0;
  1516.         draw_title();
  1517.         wgui_current_pop_up_description_index = -1;
  1518.     }
  1519.     show_dynamic_list();
  1520. }
  1521. /*****************************************************************************
  1522.  * FUNCTION
  1523.  *  refresh_search_list
  1524.  * DESCRIPTION
  1525.  *  
  1526.  * PARAMETERS
  1527.  *  name        [?]     
  1528.  * RETURNS
  1529.  *  void
  1530.  *****************************************************************************/
  1531. void refresh_search_list(U8 *name)
  1532. {
  1533.     /*----------------------------------------------------------------*/
  1534.     /* Local Variables                                                */
  1535.     /*----------------------------------------------------------------*/
  1536.     S32 no_entries = 0;
  1537.     /*----------------------------------------------------------------*/
  1538.     /* Code Body                                                      */
  1539.     /*----------------------------------------------------------------*/
  1540.     no_entries = cat200_search_function(name);
  1541.     load_dynamic_item_buffer(no_entries);
  1542.     if (no_entries >= 0)
  1543.     {
  1544.         refresh_search_list_change_list(no_entries);
  1545.         gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
  1546.     }
  1547. }
  1548. /*****************************************************************************
  1549.  * FUNCTION
  1550.  *  Cat200multitap_inputcallback
  1551.  * DESCRIPTION
  1552.  *  
  1553.  * PARAMETERS
  1554.  *  inp     [IN]        
  1555.  * RETURNS
  1556.  *  void
  1557.  *****************************************************************************/
  1558. void Cat200multitap_inputcallback(UI_character_type inp)
  1559. {
  1560.     /*----------------------------------------------------------------*/
  1561.     /* Local Variables                                                */
  1562.     /*----------------------------------------------------------------*/
  1563.     S32 no_entries = 0;
  1564.     /*----------------------------------------------------------------*/
  1565.     /* Code Body                                                      */
  1566.     /*----------------------------------------------------------------*/
  1567.     if (inp != 0)
  1568.     {
  1569.         gui_single_line_input_box_insert_multitap_character(&MMI_singleline_inputbox, inp);
  1570.     }
  1571.     if (!gui_single_line_input_box_test_overflow(&MMI_singleline_inputbox))
  1572.     {
  1573.         if (cat200_search_function)
  1574.         {
  1575.             no_entries = cat200_search_function(MMI_singleline_inputbox.text);
  1576.             load_dynamic_item_buffer(no_entries);
  1577.             if (no_entries >= 0)
  1578.             {
  1579.                 refresh_search_list_change_list(no_entries);
  1580.             }
  1581.             singleline_inputbox_input_callback();
  1582.             redraw_singleline_inputbox();
  1583.             gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
  1584.         }
  1585.     }
  1586. }
  1587. /*****************************************************************************
  1588.  * FUNCTION
  1589.  *  Cat200multitap_input_complete_callback
  1590.  * DESCRIPTION
  1591.  *  input call back complete function of category200 multi tap
  1592.  * PARAMETERS
  1593.  *  void
  1594.  * RETURNS
  1595.  *  void
  1596.  *****************************************************************************/
  1597. void Cat200multitap_input_complete_callback(void)
  1598. {
  1599.     /*----------------------------------------------------------------*/
  1600.     /* Local Variables                                                */
  1601.     /*----------------------------------------------------------------*/
  1602.     /*----------------------------------------------------------------*/
  1603.     /* Code Body                                                      */
  1604.     /*----------------------------------------------------------------*/
  1605.     gui_single_line_input_box_confirm_multitap_character(&MMI_singleline_inputbox);
  1606.     singleline_inputbox_input_callback();
  1607.     redraw_singleline_inputbox();
  1608.     gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
  1609. }
  1610. extern void wgui_redraw_singleline_input_information_bar(void);
  1611. #ifdef __MMI_TOUCH_SCREEN__
  1612. /*****************************************************************************
  1613.  * FUNCTION
  1614.  *  Cate200CategoryControlAreaPenDownHandler
  1615.  * DESCRIPTION
  1616.  *  
  1617.  * PARAMETERS
  1618.  *  point       [IN]        
  1619.  * RETURNS
  1620.  *  
  1621.  *****************************************************************************/
  1622. MMI_BOOL Cate200CategoryControlAreaPenDownHandler(mmi_pen_point_struct point)
  1623. {
  1624.     /*----------------------------------------------------------------*/
  1625.     /* Local Variables                                                */
  1626.     /*----------------------------------------------------------------*/
  1627.     MMI_BOOL ret = MMI_FALSE;
  1628.     gui_list_pen_enum menu_event;
  1629.     /*----------------------------------------------------------------*/
  1630.     /* Code Body                                                      */
  1631.     /*----------------------------------------------------------------*/
  1632.     MMI_fixed_list_menu.pen_redraw_menu_function = show_dynamic_list;
  1633.     gui_vertical_scrollbar_set_pen_self_scroll(&MMI_fixed_list_menu.vbar, MMI_TRUE);
  1634.     gui_fixed_list_menu_set_pen_scroll_delay(&MMI_fixed_list_menu, GUI_DYNAMIC_LIST_PEN_SCROLL_DELAY);
  1635.     ret = gui_dynamic_list_menu_translate_pen_event(
  1636.             &MMI_fixed_list_menu,
  1637.             MMI_PEN_EVENT_DOWN,
  1638.             point.x,
  1639.             point.y,
  1640.             &menu_event);
  1641.     if (ret)
  1642.     {
  1643.         if (menu_event == GUI_LIST_PEN_HIGHLIGHT_CHANGED || menu_event == GUI_LIST_PEN_NEED_REDRAW)
  1644.         {
  1645.             show_dynamic_list();
  1646.         }
  1647.         return MMI_TRUE;
  1648.     }
  1649.     return MMI_FALSE;
  1650. }
  1651. /*****************************************************************************
  1652.  * FUNCTION
  1653.  *  Cate200CategoryControlAreaPenUpHandler
  1654.  * DESCRIPTION
  1655.  *  
  1656.  * PARAMETERS
  1657.  *  point       [IN]        
  1658.  * RETURNS
  1659.  *  
  1660.  *****************************************************************************/
  1661. MMI_BOOL Cate200CategoryControlAreaPenUpHandler(mmi_pen_point_struct point)
  1662. {
  1663.     /*----------------------------------------------------------------*/
  1664.     /* Local Variables                                                */
  1665.     /*----------------------------------------------------------------*/
  1666.     MMI_BOOL ret = MMI_FALSE;
  1667.     /*----------------------------------------------------------------*/
  1668.     /* Code Body                                                      */
  1669.     /*----------------------------------------------------------------*/
  1670.     wgui_general_pen_dynamic_list_menu_hdlr(point, MMI_PEN_EVENT_UP);
  1671.     return ret;
  1672. }
  1673. /*****************************************************************************
  1674.  * FUNCTION
  1675.  *  Cate200CategoryControlAreaPenMoveHandler
  1676.  * DESCRIPTION
  1677.  *  
  1678.  * PARAMETERS
  1679.  *  point       [IN]        
  1680.  * RETURNS
  1681.  *  
  1682.  *****************************************************************************/
  1683. MMI_BOOL Cate200CategoryControlAreaPenMoveHandler(mmi_pen_point_struct point)
  1684. {
  1685.     /*----------------------------------------------------------------*/
  1686.     /* Local Variables                                                */
  1687.     /*----------------------------------------------------------------*/
  1688.     MMI_BOOL ret = MMI_FALSE;
  1689.     /*----------------------------------------------------------------*/
  1690.     /* Code Body                                                      */
  1691.     /*----------------------------------------------------------------*/
  1692.     wgui_general_pen_dynamic_list_menu_hdlr(point, MMI_PEN_EVENT_MOVE);
  1693.     return ret;
  1694. }
  1695. /*****************************************************************************
  1696.  * FUNCTION
  1697.  *  Cate200CategoryControlAreaPenLongTapHandler
  1698.  * DESCRIPTION
  1699.  *  
  1700.  * PARAMETERS
  1701.  *  point       [IN]        
  1702.  * RETURNS
  1703.  *  
  1704.  *****************************************************************************/
  1705. MMI_BOOL Cate200CategoryControlAreaPenLongTapHandler(mmi_pen_point_struct point)
  1706. {
  1707.     /*----------------------------------------------------------------*/
  1708.     /* Local Variables                                                */
  1709.     /*----------------------------------------------------------------*/
  1710.     MMI_BOOL ret = MMI_FALSE;
  1711.     /*----------------------------------------------------------------*/
  1712.     /* Code Body                                                      */
  1713.     /*----------------------------------------------------------------*/
  1714.     wgui_general_pen_dynamic_list_menu_hdlr(point, MMI_PEN_EVENT_LONG_TAP);
  1715.     return ret;
  1716. }
  1717. /*****************************************************************************
  1718.  * FUNCTION
  1719.  *  Cate200CategoryControlAreaPenRepeatHandler
  1720.  * DESCRIPTION
  1721.  *  
  1722.  * PARAMETERS
  1723.  *  point       [IN]        
  1724.  * RETURNS
  1725.  *  
  1726.  *****************************************************************************/
  1727. MMI_BOOL Cate200CategoryControlAreaPenRepeatHandler(mmi_pen_point_struct point)
  1728. {
  1729.     /*----------------------------------------------------------------*/
  1730.     /* Local Variables                                                */
  1731.     /*----------------------------------------------------------------*/
  1732.     MMI_BOOL ret = MMI_FALSE;
  1733.     /*----------------------------------------------------------------*/
  1734.     /* Code Body                                                      */
  1735.     /*----------------------------------------------------------------*/
  1736.     wgui_general_pen_dynamic_list_menu_hdlr(point, MMI_PEN_EVENT_REPEAT);
  1737.     return ret;
  1738. }
  1739. #endif /* __MMI_TOUCH_SCREEN__ */ 
  1740. /*****************************************************************************
  1741.  * FUNCTION
  1742.  *  RedrawCategoryControlledArea200Screen
  1743.  * DESCRIPTION
  1744.  *  redraw category200
  1745.  * PARAMETERS
  1746.  *  coordinate      [?]     
  1747.  * RETURNS
  1748.  *  void
  1749.  *****************************************************************************/
  1750. void RedrawCategoryControlledArea200Screen(dm_coordinates *coordinate)
  1751. {
  1752.     /*----------------------------------------------------------------*/
  1753.     /* Local Variables                                                */
  1754.     /*----------------------------------------------------------------*/
  1755.     color ccblack = {0, 0, 0, 100};
  1756.     color c;
  1757.     S32 temp_w = 0, temp_h = 0, image_y = 0;
  1758.     /*----------------------------------------------------------------*/
  1759.     /* Code Body                                                      */
  1760.     /*----------------------------------------------------------------*/
  1761.     c.r = 255;
  1762.     c.g = 255;
  1763.     c.b = 255;
  1764.     c.alpha = 100;
  1765.     gdi_layer_lock_frame_buffer();
  1766.     gui_reset_clip();
  1767.     gdi_layer_reset_clip();
  1768.     wgui_redraw_singleline_input_information_bar();
  1769.     show_dynamic_list();
  1770.     gui_reset_clip();
  1771. #if defined(__MMI_TOUCH_SCREEN__)
  1772.     input_box_y = ((MMI_title_y + MMI_title_height) + INFORMATION_BAR_HEIGHT + MMI_fixed_list_menu.height + 1);
  1773.     gui_fill_rectangle(0, (input_box_y - 1), UI_device_width, (input_box_y + MMI_SINGLELINE_INPUTBOX_HEIGHT), c);
  1774. #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  1775.     gui_draw_rectangle(
  1776.         2,
  1777.         (input_box_y - 1),
  1778.         (UI_device_width - 2),
  1779.         (input_box_y + MMI_SINGLELINE_INPUTBOX_HEIGHT),
  1780.         ccblack);
  1781.     gdi_layer_set_clip(4, input_box_y, (input_box_x - 1), (input_box_y + MMI_SINGLELINE_INPUTBOX_HEIGHT));
  1782.     gui_measure_image(get_image(cat200_search_img), &temp_w, &temp_h);
  1783.     image_y = (10 - (temp_h >> 1));
  1784.     gui_show_image(4, (input_box_y + image_y), get_image(cat200_search_img));
  1785. #if defined(__MMI_TOUCH_SCREEN__)
  1786.     mmi_pen_editor_clear_and_show_virtual_keyboard_area();
  1787.     redraw_singleline_inputbox();
  1788. #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  1789.     gdi_layer_unlock_frame_buffer();
  1790.     gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
  1791.     //In Category 200, redraw_category_screen() is being called here instead of ShowCategory, 
  1792.     //since RedrawCategory200Screen is doing many other things like drawing image etc.
  1793. }
  1794. /*****************************************************************************
  1795.  * FUNCTION
  1796.  *  ExitCategory200Screen
  1797.  * DESCRIPTION
  1798.  *  exit function of category200
  1799.  * PARAMETERS
  1800.  *  void
  1801.  * RETURNS
  1802.  *  void
  1803.  *****************************************************************************/
  1804. void ExitCategory200Screen(void)
  1805. {
  1806.     /*----------------------------------------------------------------*/
  1807.     /* Local Variables                                                */
  1808.     /*----------------------------------------------------------------*/
  1809.     /*----------------------------------------------------------------*/
  1810.     /* Code Body                                                      */
  1811.     /*----------------------------------------------------------------*/
  1812.     ClearHighlightHandler();
  1813.     reset_softkeys();
  1814.     reset_menu_shortcut_handler();
  1815.     reset_fixed_list();
  1816.     set_MMI_current_input_type();
  1817.     reset_multitaps();
  1818.     reset_dynamic_list();
  1819.     reset_pop_up_descriptions();
  1820.     wgui_close_singleline_inputbox();
  1821.     cat200_search_function = NULL;
  1822. #ifdef __MMI_UI_HINTS_IN_MENUITEM__
  1823.     reset_all_force_flags_for_hints();
  1824. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1825.     gui_unblock_list_effect();
  1826. #endif 
  1827. #endif /* __MMI_UI_HINTS_IN_MENUITEM__ */ 
  1828. }
  1829. /*****************************************************************************
  1830.  * FUNCTION
  1831.  *  GetCategory200HistorySize
  1832.  * DESCRIPTION
  1833.  *  Gets the history buffer size of category 200
  1834.  * PARAMETERS
  1835.  *  void
  1836.  * RETURNS
  1837.  *  size in U8s of the history buffer
  1838.  *****************************************************************************/
  1839. S32 GetCategory200HistorySize(void)
  1840. {
  1841.     /*----------------------------------------------------------------*/
  1842.     /* Local Variables                                                */
  1843.     /*----------------------------------------------------------------*/
  1844.     /*----------------------------------------------------------------*/
  1845.     /* Code Body                                                      */
  1846.     /*----------------------------------------------------------------*/
  1847.     return (((sizeof(list_menu_category_history) + 3) / 4) * 4 + sizeof(singleline_inputbox_category_history));
  1848. }
  1849. /*****************************************************************************
  1850.  * FUNCTION
  1851.  *  GetCategory200History
  1852.  * DESCRIPTION
  1853.  *  Gets the history buffer of category200
  1854.  * PARAMETERS
  1855.  *  history_buffer      [?]     
  1856.  * RETURNS
  1857.  *  return history buffer
  1858.  *****************************************************************************/
  1859. U8 *GetCategory200History(U8 *history_buffer)
  1860. {
  1861.     /*----------------------------------------------------------------*/
  1862.     /* Local Variables                                                */
  1863.     /*----------------------------------------------------------------*/
  1864.     S32 s;
  1865.     /*----------------------------------------------------------------*/
  1866.     /* Code Body                                                      */
  1867.     /*----------------------------------------------------------------*/
  1868.     get_list_menu_category_history(MMI_CATEGORY200_ID, history_buffer);
  1869.     s = sizeof(list_menu_category_history);
  1870.     s = (s + 3) / 4;
  1871.     s *= 4;
  1872.     get_singleline_inputbox_category_history(MMI_CATEGORY200_ID, (U8*) (history_buffer + s), MMI_current_input_type);
  1873.     return (history_buffer);
  1874. }
  1875. /*****************************************************************************
  1876.  * FUNCTION
  1877.  *  cat200_virtual_keypad_callback
  1878.  * DESCRIPTION
  1879.  *  
  1880.  * PARAMETERS
  1881.  *  void
  1882.  * RETURNS
  1883.  *  void
  1884.  *****************************************************************************/
  1885. void cat200_virtual_keypad_callback(void)
  1886. {
  1887. #if defined(__MMI_TOUCH_SCREEN__)
  1888.     /*----------------------------------------------------------------*/
  1889.     /* Local Variables                                                */
  1890.     /*----------------------------------------------------------------*/
  1891.     S32 search_box_height = MMI_SINGLELINE_INPUTBOX_HEIGHT;
  1892.     S32 fh = 0;
  1893.     /*----------------------------------------------------------------*/
  1894.     /* Code Body                                                      */
  1895.     /*----------------------------------------------------------------*/
  1896.     resize_fixed_list(
  1897.         MMI_content_width,
  1898.         (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));
  1899.     /* W06.12 Fix Quick Search highlight issue in the last items */
  1900.     gui_dynamic_list_menu_locate_highlighted_item(&MMI_fixed_list_menu);
  1901.     input_box_y = ((MMI_title_y + MMI_title_height) + INFORMATION_BAR_HEIGHT + MMI_fixed_list_menu.height + 1 + fh);
  1902.     move_singleline_inputbox(input_box_x, input_box_y);
  1903.     RedrawCategoryControlledArea200Screen(NULL);
  1904. #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  1905. }
  1906. /* MTK Leo end */
  1907. /*****************************************************************************
  1908.  * FUNCTION
  1909.  *  ShowCategory200Screen
  1910.  * DESCRIPTION
  1911.  *  category screen of phone search
  1912.  * PARAMETERS
  1913.  *  title                   [IN]        Title id
  1914.  *  title_icon              [IN]        Title icon
  1915.  *  left_softkey            [IN]        Left soft key label
  1916.  *  left_softkey_icon       [IN]        Left soft key icon
  1917.  *  right_softkey           [IN]        Right soft key label
  1918.  *  right_softkey_icon      [IN]        Right soft key icon
  1919.  *  number_of_items         [IN]        Number of items
  1920.  *  get_item_func           [IN]        
  1921.  *  get_hint_func           [IN]        
  1922.  *  highlighted_item        [IN]        Highlighted item index
  1923.  *  search_image            [IN]        Seach image
  1924.  *  buffer                  [IN]        Buffer
  1925.  *  buffer_max_length       [IN]        
  1926.  *  history_buffer          [IN]        Histpry buffer
  1927.  *  top_msg(?)              [IN]        Message display below title bar
  1928.  *  list_of_items(?)        [IN]        List of items
  1929.  *  max_buffer_legth(?)     [IN]        Max size of buffer length
  1930.  *  list_of_icons1(?)       [IN]        List of icons
  1931.  * RETURNS
  1932.  *  void
  1933.  *****************************************************************************/
  1934. void ShowCategory200Screen(
  1935.         U16 title,
  1936.         U16 title_icon,
  1937.         U16 left_softkey,
  1938.         U16 left_softkey_icon,
  1939.         U16 right_softkey,
  1940.         U16 right_softkey_icon,
  1941.         S32 number_of_items,
  1942.         GetItemFuncPtr get_item_func,
  1943.         GetHintFuncPtr get_hint_func,
  1944.         S32 highlighted_item,
  1945.         U16 search_image,
  1946.         U8 *buffer,
  1947.         S32 buffer_max_length,
  1948.         U8 *history_buffer)
  1949. {
  1950.     /*----------------------------------------------------------------*/
  1951.     /* Local Variables                                                */
  1952.     /*----------------------------------------------------------------*/
  1953.     dm_data_struct dm_data;
  1954.     S32 temp_w = 0, temp_h = 0;
  1955.     S32 fh = 0;
  1956.     S32 input_box_width = 0, search_box_height = MMI_SINGLELINE_INPUTBOX_HEIGHT;
  1957.     S32 shortcut_width;
  1958.     U8 h_flag;
  1959.     U8 *img = NULL;
  1960.     BOOL application_present;
  1961.     S32 max_entries = 0;
  1962.     /*----------------------------------------------------------------*/
  1963.     /* Code Body                                                      */
  1964.     /*----------------------------------------------------------------*/
  1965.     gdi_layer_lock_frame_buffer();
  1966.     MMI_menu_shortcut_number = -1;
  1967.     change_left_softkey(left_softkey, left_softkey_icon);
  1968.     change_right_softkey(right_softkey, right_softkey_icon);
  1969.     SetupCategoryKeyHandlers();
  1970.     create_fixed_icontext_menuitems();
  1971.     MMI_current_menu_type = LIST_MENU;
  1972.     associate_fixed_icontext_list();
  1973.     init_dynamic_item_buffer(number_of_items, get_item_func, get_hint_func, UI_dummy_function);
  1974.     MMI_fixed_list_menu.n_items = number_of_items;
  1975.     if (wgui_check_application_present)
  1976.     {
  1977.         application_present = wgui_check_application_present(&max_entries);     /* true in case of dictionary */
  1978.     }
  1979.     else
  1980.     {
  1981.         application_present = MMI_FALSE;
  1982.     }
  1983.     if (application_present)
  1984.     {
  1985.         shortcut_width = set_menu_item_count(max_entries) + 7;  /* number of words goes beyond this limit, and increases at the run time */
  1986.     }
  1987.     else
  1988.     {
  1989.         shortcut_width = set_menu_item_count(number_of_items) + 7;
  1990.     }
  1991.     resize_menu_shortcut_handler(shortcut_width, MMI_title_height);
  1992.     move_menu_shortcut_handler(UI_device_width - shortcut_width, MMI_title_y);
  1993.     register_hide_menu_shortcut(gui_redraw_menu_shortcut);
  1994.     register_dynamic_list_keys();
  1995. #ifdef __MMI_TOUCH_SCREEN__
  1996.     /* Because the list menu is resized according to virtual keyboard */
  1997.     MMI_fixed_list_menu.flags |= UI_LIST_MENU_ALIGN_TO_TOP;
  1998. #endif /* __MMI_TOUCH_SCREEN__ */ 
  1999. #ifdef __MMI_UI_LIST_CACHE_BACKGROUND__
  2000.     /* Virtual keyboard height might be changed. We cannot put menu background in layer */
  2001.     MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_BKGRND_IN_LAYER;
  2002. #endif /* __MMI_UI_LIST_CACHE_BACKGROUND__ */ 
  2003.     resize_fixed_list(
  2004.         MMI_content_width,
  2005.         (UI_device_height - MMI_button_bar_height - (MMI_title_y + MMI_title_height) - search_box_height - INFORMATION_BAR_HEIGHT - 2 - fh - 1));
  2006.     input_box_y = ((MMI_title_y + MMI_title_height) + INFORMATION_BAR_HEIGHT + MMI_fixed_list_menu.height + 1 + fh);
  2007.     move_fixed_list(0, ((MMI_title_y + MMI_title_height) + fh + INFORMATION_BAR_HEIGHT));
  2008.     register_fixed_list_highlight_handler(dynamic_list_highlight_handler);
  2009.     img = (U8*) GetImage(search_image);
  2010.     gui_measure_image(img, &temp_w, &temp_h);
  2011.     input_box_width = (UI_device_width - (5 + temp_w + 1) - 4);
  2012.     input_box_x = 5 + temp_w + 1;
  2013.     h_flag = set_list_menu_category_history(MMI_CATEGORY200_ID, history_buffer);
  2014. #ifdef __MMI_UI_HINTS_IN_MENUITEM__
  2015.     if (get_hint_func)
  2016.     {
  2017.         if (is_set_force_icon_on_highlight_only_in_menuitem())
  2018.         {
  2019.             wgui_show_icon_only_highlight_in_icontext_menuitem();
  2020.         }
  2021.         if (is_set_force_all_hints_in_menuitem())
  2022.         {
  2023.             wgui_enable_hints_in_icontext_menuitem();
  2024.         }
  2025.         else if (is_set_force_hints_on_highlight_in_menuitem())
  2026.         {
  2027.             wgui_enable_hint_highlight_in_icontext_menuitem();
  2028.         }
  2029.         else
  2030.         {
  2031.             wgui_enable_hint_highlight_in_icontext_menuitem();
  2032.         }
  2033.         if (h_flag)
  2034.         {
  2035.             set_dynamic_pop_up_descriptions(MMI_fixed_list_menu.highlighted_item);
  2036.         }
  2037.         else
  2038.         {
  2039.             set_dynamic_pop_up_descriptions(highlighted_item);
  2040.         }
  2041.     #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  2042.         gui_block_list_effect();
  2043.     #endif 
  2044.     }
  2045. #endif /* __MMI_UI_HINTS_IN_MENUITEM__ */ 
  2046.     if (h_flag)
  2047.     {
  2048.         S32 s = sizeof(list_menu_category_history);
  2049.         s = (s + 3) / 4;
  2050.         s *= 4;
  2051.         dynamic_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
  2052.         wgui_setup_singleline_inputbox(
  2053.             input_box_x,
  2054.             (input_box_y),
  2055.             input_box_width,
  2056.             search_box_height,
  2057.             buffer,
  2058.             buffer_max_length,
  2059.             MMI_CATEGORY200_ID,
  2060.             get_string(right_softkey),
  2061.             get_image(right_softkey_icon),
  2062.             INPUT_TYPE_MMI_MULTITAP_BPMF,
  2063.             (U8*) (history_buffer + s),
  2064.             1);
  2065.         if (cat200_search_function)
  2066.         {
  2067.             if (!application_present)
  2068.             {
  2069.                 S32 no_entries;
  2070.                 no_entries = cat200_search_function((U8*) MMI_singleline_inputbox.text);
  2071.                 load_dynamic_item_buffer(no_entries);
  2072.                 refresh_search_list_change_list_ext(no_entries, MMI_fixed_list_menu.highlighted_item);
  2073.             }
  2074.         }
  2075.     }
  2076.     else
  2077.     {
  2078.         dynamic_list_goto_item_no_redraw(highlighted_item);
  2079.         wgui_setup_singleline_inputbox(
  2080.             input_box_x,
  2081.             (input_box_y),
  2082.             input_box_width,
  2083.             search_box_height,
  2084.             buffer,
  2085.             buffer_max_length,
  2086.             MMI_CATEGORY200_ID,
  2087.             get_string(right_softkey),
  2088.             get_image(right_softkey_icon),
  2089.             INPUT_TYPE_MMI_MULTITAP_BPMF,
  2090.             NULL,
  2091.             1);
  2092.     }
  2093. #if defined(__MMI_TOUCH_SCREEN__)
  2094.     resize_fixed_list(
  2095.         MMI_content_width,
  2096.         (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));
  2097.     input_box_y = ((MMI_title_y + MMI_title_height) + INFORMATION_BAR_HEIGHT + MMI_fixed_list_menu.height + 1 + fh);
  2098.     move_singleline_inputbox(input_box_x, input_box_y);
  2099. #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  2100.     gui_set_single_line_input_box_theme(&MMI_singleline_inputbox, &cat200_singleline_inputbox_theme);
  2101.     cat200_search_img = search_image;
  2102.     MMI_title_string = (UI_string_type) get_string(title);
  2103.     MMI_title_icon = (PU8) get_image(title_icon);
  2104.     resize_dynamic_icontext_menuitems_to_list_width();
  2105.     set_fixed_icontext_positions(MMI_ICONTEXT_MENUITEM_HEIGHT + 2, 0, 1, 0);//111106 dynamic icontext
  2106.     if (h_flag)
  2107.     {
  2108.         set_dynamic_pop_up_descriptions(MMI_fixed_list_menu.highlighted_item);
  2109.         if (application_present)
  2110.         {
  2111.             if (MMI_fixed_list_menu.highlighted_item <= 0)
  2112.             {
  2113.                 ClearKeyHandler(KEY_UP_ARROW, KEY_EVENT_DOWN);
  2114.                 ClearKeyHandler(KEY_VOL_UP, KEY_EVENT_DOWN);
  2115.             }
  2116.         }
  2117.     }
  2118.     else
  2119.     {
  2120.         set_dynamic_pop_up_descriptions(highlighted_item);
  2121.     }
  2122.     singleline_inputbox_input_callback();
  2123.     wgui_singleline_inputbox_LSK_label_icon = get_image(left_softkey_icon);
  2124.     wgui_singleline_inputbox_LSK_label_string = get_string(left_softkey);
  2125.     if (!h_flag)
  2126.     {
  2127.         if (number_of_items > 0)
  2128.         {
  2129.             set_left_softkey_label(wgui_singleline_inputbox_LSK_label_string);
  2130.             set_left_softkey_icon(wgui_singleline_inputbox_LSK_label_icon);
  2131.             redraw_left_softkey();
  2132.             register_left_softkey_handler();
  2133.             set_left_softkey_function(wgui_singleline_inputbox_LSK_function, KEY_EVENT_UP);
  2134.             set_left_softkey_function(UI_dummy_function, KEY_EVENT_DOWN);
  2135.         }
  2136.         else
  2137.         {
  2138.             set_left_softkey_label(NULL);
  2139.             set_left_softkey_icon(NULL);
  2140.             redraw_left_softkey();
  2141.             set_left_softkey_function(UI_dummy_function, KEY_EVENT_UP);
  2142.             set_left_softkey_function(UI_dummy_function, KEY_EVENT_DOWN);
  2143.         }
  2144.     }
  2145.     gdi_layer_unlock_frame_buffer();
  2146.     ExitCategoryFunction = ExitCategory200Screen;
  2147.     dm_setup_category_functions(dm_redraw_category_screen, GetCategory200History, GetCategory200HistorySize);   /* 102605 quick search history Calvin add */
  2148.     dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
  2149.     dm_data.s32flags |= DM_SHOW_VKPAD;
  2150.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  2151.     dm_data.s32CatId = MMI_CATEGORY200_ID;
  2152.     dm_setup_data(&dm_data);
  2153.     dm_register_category_controlled_callback(RedrawCategoryControlledArea200Screen);
  2154.     dm_register_vkpad_callback(cat200_virtual_keypad_callback);
  2155. #ifdef __MMI_TOUCH_SCREEN__
  2156.     wgui_register_category_screen_control_area_pen_handlers(
  2157.         Cate200CategoryControlAreaPenDownHandler,
  2158.         MMI_PEN_EVENT_DOWN);
  2159.     wgui_register_category_screen_control_area_pen_handlers(Cate200CategoryControlAreaPenUpHandler, MMI_PEN_EVENT_UP);
  2160.     wgui_register_category_screen_control_area_pen_handlers(
  2161.         Cate200CategoryControlAreaPenMoveHandler,
  2162.         MMI_PEN_EVENT_MOVE);
  2163.     wgui_register_category_screen_control_area_pen_handlers(
  2164.         Cate200CategoryControlAreaPenLongTapHandler,
  2165.         MMI_PEN_EVENT_LONG_TAP);
  2166.     wgui_register_category_screen_control_area_pen_handlers(
  2167.         Cate200CategoryControlAreaPenRepeatHandler,
  2168.         MMI_PEN_EVENT_REPEAT);
  2169. #endif /* __MMI_TOUCH_SCREEN__ */ 
  2170.     dm_redraw_category_screen();
  2171. }
  2172. /* 052206 NITZ category Calvin Start */
  2173. #if defined ( __MMI_MAINLCD_240X320__)
  2174. #include "worldclock.h"
  2175. #define CAT230_TITLE_HEIGHT 28
  2176. #define CAT230_INDEX_HEIGHT 24
  2177. #define MAX_CAT230_INDEX    3
  2178. #define CAT230_TIME_HEIGHT  19
  2179. #define CAT230_CITY_HEIGHT  21
  2180. #define CAT230_ARROW_OFFSET 5
  2181. #ifdef __MMI_TOUCH_SCREEN__
  2182. typedef enum
  2183. {
  2184.     CAT230_TOUCH_NONE,
  2185.     CAT230_TOUCH_ON_LEFT_ARROW_UP,
  2186.     CAT230_TOUCH_ON_LEFT_ARROW_DOWN,
  2187.     CAT230_TOUCH_ON_RIGHT_ARROW_UP,
  2188.     CAT230_TOUCH_ON_RIGHT_ARROW_DOWN,
  2189.     CAT230_TOUCH_ON_INDEX_UP,
  2190.     CAT230_TOUCH_ON_INDEX_DOWN,
  2191.     CAT230_TOUCH_ON_PAINT_UP,
  2192.     CAT230_TOUCH_ON_PAINT_DOWN,
  2193.     CAT230_TOUCH_ON_PAINT_REPEAT,
  2194.     CAT230_TOUCH_ON_PAINT_MOVE,
  2195.     CAT230_TOUCH_ON_RSK
  2196. } CAT230_PEN_EVENTS;
  2197. S32 Cat230PenEvent = CAT230_TOUCH_NONE;
  2198. #endif /* __MMI_TOUCH_SCREEN__ */
  2199. U8 *Cat230TitleString = NULL;
  2200. U8 *Cat230IndexInfoString[MAX_CAT230_INDEX];
  2201. U8 Cat230NumberofIndex = 0;
  2202. U8 Cat230HighlightedIndex = 0;
  2203. S32 Cat230Paint_y = 0;
  2204. S32 Cat230Paint_height = 0;
  2205. GDI_HANDLE Cat230PaintLayer = GDI_NULL_HANDLE;
  2206. MMI_BOOL Cat230FirstEnter = MMI_TRUE;
  2207. color Cat230Index_bg = {254, 164, 42, 255};
  2208. color Cat230Index_bg_highlight = {254, 210, 41, 255};
  2209. color Cat230Index_fg = {0, 0, 0, 255};
  2210. color Cat230Index_fg_highlight = {255, 255, 255, 255};
  2211. void (*Cat230AppLeftKeyHandler) (U8 index_num) = UI_dummy_function_byte;
  2212. void (*Cat230AppRightKeyHandler) (U8 index_num) = UI_dummy_function_byte;
  2213. void (*Cat230RedrawPaint) (void) = UI_dummy_function;
  2214. void (*Cat230GetPaintInfo) (void *paint_info) = NULL;
  2215. static void RedrawCategory230Screen(void);
  2216. static void Cat230RedrawPaint_WC(void);
  2217. FuncPtr Cat230RedrawPaintArray[CAT230_SCREEN_TYPE_MAX] = {    Cat230RedrawPaint_WC    };
  2218. #ifdef __MMI_TOUCH_SCREEN__
  2219. typedef void (*Cat230PaintPenEventFuncPtr) (S32 x, S32 y, S32 event_type);
  2220. void (*Cat230PaintPenEventHandler) (S32 x, S32 y, S32 event_type) = NULL;
  2221. void (*Cat230AppPaintPenEventHandler) (S32 x, S32 y, S32 event_type) = NULL;
  2222. static void Cat230PaintPenEventHandler_WC(S32 x, S32 y, S32 event_type);
  2223. Cat230PaintPenEventFuncPtr Cat230PaintPenEventHandlerArray[CAT230_SCREEN_TYPE_MAX] = {  Cat230PaintPenEventHandler_WC   };
  2224. #endif
  2225. void SetCat230IndexInfo(U8 index_num, U8* info_string)
  2226. {
  2227.     MMI_ASSERT(index_num < MAX_CAT230_INDEX);
  2228.     Cat230IndexInfoString[index_num] = info_string;
  2229. }
  2230. #ifdef __MMI_TOUCH_SCREEN__
  2231. void RegisterCat230PaintPenEventHandler(void (*AppPaintPenEventHandler) (S32 x, S32 y, S32 event_type))
  2232. {
  2233.     Cat230AppPaintPenEventHandler = AppPaintPenEventHandler;
  2234. }
  2235. #endif
  2236. /*****************************************************************************
  2237.  * FUNCTION
  2238.  *  Cat230HandleKeyRight
  2239.  * DESCRIPTION
  2240.  *  Right arrow key handler of Cat230.
  2241.  * PARAMETERS
  2242.  *  void
  2243.  * RETURNS
  2244.  *  void
  2245.  *****************************************************************************/
  2246. static void Cat230HandleKeyRight(void)
  2247. {
  2248.     MMI_ASSERT(Cat230AppRightKeyHandler!=NULL);
  2249.     Cat230AppRightKeyHandler(Cat230HighlightedIndex);
  2250.     RedrawCategory230Screen();
  2251. }
  2252. /*****************************************************************************
  2253.  * FUNCTION
  2254.  *  Cat230HandleKeyLeft
  2255.  * DESCRIPTION
  2256.  *  Left arrow key handler of Cat230.
  2257.  * PARAMETERS
  2258.  *  void
  2259.  * RETURNS
  2260.  *  void
  2261.  *****************************************************************************/
  2262. static void Cat230HandleKeyLeft(void)
  2263. {
  2264.     MMI_ASSERT(Cat230AppLeftKeyHandler!=NULL);
  2265.     Cat230AppLeftKeyHandler(Cat230HighlightedIndex);
  2266.     RedrawCategory230Screen();
  2267. }
  2268. /*****************************************************************************
  2269.  * FUNCTION
  2270.  *  Cat230HandleKeyUp
  2271.  * DESCRIPTION
  2272.  *  Up arrow key handler of Cat230.
  2273.  * PARAMETERS
  2274.  *  void
  2275.  * RETURNS
  2276.  *  void
  2277.  *****************************************************************************/
  2278. static void Cat230HandleKeyUp(void)
  2279. {
  2280.     if (Cat230HighlightedIndex == 0)
  2281.     {
  2282.         Cat230HighlightedIndex = Cat230NumberofIndex - 1;
  2283.     }
  2284.     else
  2285.     {
  2286.         Cat230HighlightedIndex--;
  2287.     }
  2288.     RedrawCategory230Screen();
  2289. }
  2290. /*****************************************************************************
  2291.  * FUNCTION
  2292.  *  Cat230HandleKeyDown
  2293.  * DESCRIPTION
  2294.  *  Down arrow key handler of Cat230.
  2295.  * PARAMETERS
  2296.  *  void
  2297.  * RETURNS
  2298.  *  void
  2299.  *****************************************************************************/
  2300. static void Cat230HandleKeyDown(void)
  2301. {
  2302.     if (Cat230HighlightedIndex == Cat230NumberofIndex-1)
  2303.     {
  2304.         Cat230HighlightedIndex = 0;
  2305.     }
  2306.     else
  2307.     {
  2308.         Cat230HighlightedIndex++;
  2309.     }
  2310.     RedrawCategory230Screen();
  2311. }
  2312. #ifdef __MMI_TOUCH_SCREEN__
  2313. #include "wgui_touch_screen.h"
  2314. //#define WC_PEN_GAP   3
  2315. /*****************************************************************************
  2316.  * FUNCTION
  2317.  *  Cat230PenDownHandler
  2318.  * DESCRIPTION
  2319.  *  
  2320.  * PARAMETERS
  2321.  *  point       [IN]        
  2322.  * RETURNS
  2323.  *  
  2324.  *****************************************************************************/
  2325. static MMI_BOOL Cat230PenDownHandler(mmi_pen_point_struct point)
  2326. {
  2327.     /*----------------------------------------------------------------*/
  2328.     /* Local Variables                                                */
  2329.     /*----------------------------------------------------------------*/
  2330.     wgui_component_info_struct pos;
  2331.     U8 j;
  2332.     S32 iwidth, iheight;
  2333.     /*----------------------------------------------------------------*/
  2334.     /* Code Body                                                      */
  2335.     /*----------------------------------------------------------------*/
  2336.     //on index
  2337.     pos.pos_x = 0;
  2338.     pos.pos_y = MMI_status_bar_height+CAT230_TITLE_HEIGHT;
  2339.     pos.width = UI_device_width;
  2340.     pos.height = CAT230_INDEX_HEIGHT*Cat230NumberofIndex;
  2341.     if (wgui_test_object_position(point, pos) == MMI_TRUE)  /* INDEX */
  2342.     {
  2343.         gui_measure_image(get_image(LEFT_ARROW_UP), &iwidth, &iheight);
  2344.         pos.width = iwidth;
  2345.         pos.height = iheight;
  2346.         
  2347.         //on left arrow
  2348.         for (j=0; j<Cat230NumberofIndex; j++)
  2349.         {
  2350.             pos.pos_x = CAT230_ARROW_OFFSET;
  2351.             pos.pos_y = MMI_status_bar_height+CAT230_TITLE_HEIGHT+CAT230_INDEX_HEIGHT*j + ((CAT230_INDEX_HEIGHT-iheight) >> 1) - 1;
  2352.             if (wgui_test_object_position(point, pos) == MMI_TRUE)  /* LEFT ARROW */
  2353.             {
  2354.                 Cat230PenEvent = CAT230_TOUCH_ON_LEFT_ARROW_DOWN;
  2355.                 Cat230HighlightedIndex = j;
  2356.                 Cat230HandleKeyLeft();
  2357.                 return MMI_TRUE;
  2358.             }
  2359.         }
  2360.         //on right arrow
  2361.         for (j=0; j<Cat230NumberofIndex; j++)
  2362.         {
  2363.             pos.pos_x = UI_device_width - iwidth - 1 - CAT230_ARROW_OFFSET;
  2364.             pos.pos_y = MMI_status_bar_height+CAT230_TITLE_HEIGHT+CAT230_INDEX_HEIGHT*j + ((CAT230_INDEX_HEIGHT-iheight) >> 1) - 1;
  2365.             if (wgui_test_object_position(point, pos) == MMI_TRUE)  /* RIGHT ARROW */
  2366.             {
  2367.                 Cat230PenEvent = CAT230_TOUCH_ON_RIGHT_ARROW_DOWN;
  2368.                 Cat230HighlightedIndex = j;
  2369.                 Cat230HandleKeyRight();
  2370.                 return MMI_TRUE;
  2371.             }
  2372.         }
  2373.         Cat230HighlightedIndex = ((point.y-(MMI_status_bar_height+CAT230_TITLE_HEIGHT)) / CAT230_INDEX_HEIGHT);
  2374.         Cat230PenEvent = CAT230_TOUCH_ON_INDEX_DOWN;
  2375.         RedrawCategory230Screen();
  2376.         return MMI_TRUE;
  2377.     }
  2378.     //on paint
  2379.     pos.pos_x = 0;
  2380.     pos.pos_y = Cat230Paint_y;
  2381.     pos.width = UI_device_width;
  2382.     pos.height = Cat230Paint_height;
  2383.     if (wgui_test_object_position(point, pos) == MMI_TRUE)  /* Paint */
  2384.     {
  2385.         Cat230PenEvent = CAT230_TOUCH_ON_PAINT_DOWN;
  2386.         Cat230PaintPenEventHandler(point.x, point.y, Cat230PenEvent);
  2387.         return MMI_TRUE;
  2388.     }
  2389.     
  2390.     Cat230PenEvent = CAT230_TOUCH_NONE;
  2391.     return MMI_FALSE;
  2392. }
  2393. /*****************************************************************************
  2394.  * FUNCTION
  2395.  *  Cat230PenUpHandler
  2396.  * DESCRIPTION
  2397.  *  
  2398.  * PARAMETERS
  2399.  *  point       [IN]        
  2400.  * RETURNS
  2401.  *  
  2402.  *****************************************************************************/
  2403. static MMI_BOOL Cat230PenUpHandler(mmi_pen_point_struct point)
  2404. {
  2405.     /*----------------------------------------------------------------*/
  2406.     /* Local Variables                                                */
  2407.     /*----------------------------------------------------------------*/
  2408.     wgui_component_info_struct pos;
  2409.     S32 iwidth, iheight;
  2410.     /*----------------------------------------------------------------*/
  2411.     /* Code Body                                                      */
  2412.     /*----------------------------------------------------------------*/
  2413.     gui_measure_image(get_image(LEFT_ARROW_UP), &iwidth, &iheight);
  2414.     pos.width = iwidth;
  2415.     pos.height = iheight;
  2416.     /* left arrow */
  2417.     if (Cat230PenEvent == CAT230_TOUCH_ON_LEFT_ARROW_DOWN)
  2418.     {
  2419.         pos.pos_x = CAT230_ARROW_OFFSET;
  2420.         pos.pos_y = MMI_status_bar_height+CAT230_TITLE_HEIGHT+CAT230_INDEX_HEIGHT*Cat230HighlightedIndex+ ((CAT230_INDEX_HEIGHT-iheight) >> 1) - 1;
  2421.         if (wgui_test_object_position(point, pos) == MMI_TRUE)  /* LEFT ARROW */
  2422.         {
  2423.             Cat230PenEvent = CAT230_TOUCH_NONE;
  2424.             RedrawCategory230Screen();
  2425.             return MMI_TRUE;
  2426.         }
  2427.     }
  2428.     /* right arrow */
  2429.     if (Cat230PenEvent == CAT230_TOUCH_ON_RIGHT_ARROW_DOWN)
  2430.     {
  2431.         pos.pos_x = UI_device_width - iwidth - 1 - CAT230_ARROW_OFFSET;
  2432.         pos.pos_y = MMI_status_bar_height+CAT230_TITLE_HEIGHT+CAT230_INDEX_HEIGHT*Cat230HighlightedIndex + ((CAT230_INDEX_HEIGHT-iheight) >> 1) - 1;
  2433.         if (wgui_test_object_position(point, pos) == MMI_TRUE)  /* RIGHT ARROW */
  2434.         {
  2435.             Cat230PenEvent = CAT230_TOUCH_NONE;
  2436.             RedrawCategory230Screen();
  2437.             return MMI_TRUE;
  2438.         }
  2439.     }
  2440.     
  2441.     Cat230PenEvent = CAT230_TOUCH_NONE;
  2442.     return MMI_FALSE;
  2443. }
  2444. /*****************************************************************************
  2445.  * FUNCTION
  2446.  *  Cat230PenRepeatHandler
  2447.  * DESCRIPTION
  2448.  *  
  2449.  * PARAMETERS
  2450.  *  point       [IN]        
  2451.  * RETURNS
  2452.  *  
  2453.  *****************************************************************************/
  2454. static MMI_BOOL Cat230PenRepeatHandler(mmi_pen_point_struct point)
  2455. {
  2456.     /*----------------------------------------------------------------*/
  2457.     /* Local Variables                                                */
  2458.     /*----------------------------------------------------------------*/
  2459.     /*----------------------------------------------------------------*/
  2460.     /* Code Body                                                      */
  2461.     /*----------------------------------------------------------------*/
  2462.     /* left arrow */
  2463.     if (Cat230PenEvent == CAT230_TOUCH_ON_LEFT_ARROW_DOWN)
  2464.     {
  2465.         Cat230HandleKeyLeft();
  2466.         return MMI_TRUE;
  2467.     }
  2468.     /* right arrow */
  2469.     if (Cat230PenEvent == CAT230_TOUCH_ON_RIGHT_ARROW_DOWN)
  2470.     {
  2471.         Cat230HandleKeyRight();
  2472.         return MMI_TRUE;
  2473.     }
  2474.     return MMI_FALSE;
  2475. }
  2476. /*****************************************************************************
  2477.  * FUNCTION
  2478.  *  Cat230PenMoveHandler
  2479.  * DESCRIPTION
  2480.  *  
  2481.  * PARAMETERS
  2482.  *  point       [IN]        
  2483.  * RETURNS
  2484.  *  
  2485.  *****************************************************************************/
  2486. static MMI_BOOL Cat230PenMoveHandler(mmi_pen_point_struct point)
  2487. {
  2488.     /*----------------------------------------------------------------*/
  2489.     /* Local Variables                                                */
  2490.     /*----------------------------------------------------------------*/
  2491.     wgui_component_info_struct pos;
  2492.     U8 highlighted_index;
  2493.     S32 iwidth, iheight;
  2494.     /*----------------------------------------------------------------*/
  2495.     /* Code Body                                                      */
  2496.     /*----------------------------------------------------------------*/
  2497.     //on index
  2498.     pos.pos_x = 0;
  2499.     pos.pos_y = MMI_status_bar_height+CAT230_TITLE_HEIGHT;
  2500.     pos.width = UI_device_width;
  2501.     pos.height = CAT230_INDEX_HEIGHT*Cat230NumberofIndex;
  2502.     if (wgui_test_object_position(point, pos) == MMI_TRUE)  /* INDEX */
  2503.     {
  2504.         gui_measure_image(get_image(LEFT_ARROW_UP), &iwidth, &iheight);
  2505.         pos.width = iwidth;
  2506.         pos.height = iheight;
  2507.         /* left arrow */
  2508.         if (Cat230PenEvent == CAT230_TOUCH_ON_LEFT_ARROW_DOWN ||
  2509.             Cat230PenEvent == CAT230_TOUCH_ON_LEFT_ARROW_UP)
  2510.         {
  2511.             pos.pos_x = CAT230_ARROW_OFFSET;
  2512.             pos.pos_y = MMI_status_bar_height+CAT230_TITLE_HEIGHT+CAT230_INDEX_HEIGHT*Cat230HighlightedIndex + ((CAT230_INDEX_HEIGHT-iheight) >> 1) - 1;
  2513.             if (wgui_test_object_position(point, pos) == MMI_TRUE)  /* LEFT ARROW */
  2514.             {
  2515.                 Cat230PenEvent = CAT230_TOUCH_ON_LEFT_ARROW_DOWN;
  2516.                 return MMI_TRUE;
  2517.             }
  2518.             else
  2519.             {
  2520.                 if (Cat230PenEvent == CAT230_TOUCH_ON_LEFT_ARROW_DOWN)
  2521.                 {
  2522.                     Cat230PenEvent = CAT230_TOUCH_ON_LEFT_ARROW_UP;
  2523.                     RedrawCategory230Screen();
  2524.                 }
  2525.                 return MMI_TRUE;
  2526.             }
  2527.         }
  2528.         /* right arrow */
  2529.         if (Cat230PenEvent == CAT230_TOUCH_ON_RIGHT_ARROW_DOWN ||
  2530.             Cat230PenEvent == CAT230_TOUCH_ON_RIGHT_ARROW_UP)
  2531.         {
  2532.             pos.pos_x = UI_device_width - iwidth - 1 - CAT230_ARROW_OFFSET;
  2533.             pos.pos_y = MMI_status_bar_height+CAT230_TITLE_HEIGHT+CAT230_INDEX_HEIGHT*Cat230HighlightedIndex + ((CAT230_INDEX_HEIGHT-iheight) >> 1) - 1;
  2534.             if (wgui_test_object_position(point, pos) == MMI_TRUE)  /* RIGHT ARROW */
  2535.             {
  2536.                 Cat230PenEvent = CAT230_TOUCH_ON_RIGHT_ARROW_DOWN;
  2537.                 return MMI_TRUE;
  2538.             }
  2539.             else
  2540.             {
  2541.                 if (Cat230PenEvent == CAT230_TOUCH_ON_RIGHT_ARROW_DOWN)
  2542.                 {
  2543.                     Cat230PenEvent = CAT230_TOUCH_ON_RIGHT_ARROW_UP;
  2544.                     RedrawCategory230Screen();
  2545.                 }
  2546.                 return MMI_TRUE;
  2547.             }
  2548.         }
  2549.         if (Cat230PenEvent == CAT230_TOUCH_ON_INDEX_DOWN ||
  2550.             Cat230PenEvent == CAT230_TOUCH_ON_INDEX_UP)
  2551.         {
  2552.             highlighted_index = ((point.y-(MMI_status_bar_height+CAT230_TITLE_HEIGHT)) / CAT230_INDEX_HEIGHT);
  2553.             if (highlighted_index != Cat230HighlightedIndex &&
  2554.                 //highlighted_index >= 0 &&
  2555.                 point.y >= (MMI_status_bar_height+CAT230_TITLE_HEIGHT) &&
  2556.                 highlighted_index <= Cat230NumberofIndex)
  2557.             {
  2558.                 Cat230HighlightedIndex = highlighted_index;
  2559.                 Cat230PenEvent = CAT230_TOUCH_ON_INDEX_DOWN;
  2560.                 RedrawCategory230Screen();
  2561.             }
  2562.             return MMI_TRUE;
  2563.         }
  2564.     }
  2565.     //on paint
  2566.     pos.pos_x = 0;
  2567.     pos.pos_y = Cat230Paint_y;
  2568.     pos.width = UI_device_width;
  2569.     pos.height = Cat230Paint_height;
  2570.     if (wgui_test_object_position(point, pos) == MMI_TRUE)  /* Paint */
  2571.     {
  2572.         if (Cat230PenEvent == CAT230_TOUCH_ON_PAINT_DOWN ||
  2573.             Cat230PenEvent == CAT230_TOUCH_ON_PAINT_UP)
  2574.         {
  2575.             Cat230PenEvent = CAT230_TOUCH_ON_PAINT_DOWN;
  2576.             Cat230PaintPenEventHandler(point.x, point.y, Cat230PenEvent);
  2577.             return MMI_TRUE;
  2578.         }
  2579.     }
  2580.     if (Cat230PenEvent == CAT230_TOUCH_ON_INDEX_DOWN ||
  2581.         Cat230PenEvent == CAT230_TOUCH_ON_INDEX_UP)
  2582.     {
  2583.         Cat230PenEvent = CAT230_TOUCH_ON_INDEX_UP;
  2584.     }
  2585.     else if (Cat230PenEvent == CAT230_TOUCH_ON_PAINT_DOWN ||
  2586.         Cat230PenEvent == CAT230_TOUCH_ON_PAINT_UP)
  2587.     {
  2588.         Cat230PenEvent = CAT230_TOUCH_ON_PAINT_DOWN;
  2589.     }
  2590.     else
  2591.     {
  2592.         Cat230PenEvent = CAT230_TOUCH_NONE;
  2593.     }
  2594.     return MMI_TRUE;
  2595. }
  2596. static void Cat230PaintPenEventHandler_WC(S32 x, S32 y, S32 event_type)
  2597. {
  2598.     S32 relative_x, relative_y;
  2599.     wgui_component_info_struct pos;
  2600.     mmi_pen_point_struct point;
  2601.     point.x = x;
  2602.     point.y = y;
  2603.     pos.pos_x = 0;
  2604.     pos.pos_y = Cat230Paint_y + CAT230_TIME_HEIGHT;
  2605.     pos.width = UI_device_width;
  2606.     pos.height = Cat230Paint_height-CAT230_TIME_HEIGHT*2-CAT230_CITY_HEIGHT;
  2607.     if (wgui_test_object_position(point, pos) == MMI_TRUE)  /* Map */
  2608.     {
  2609.         relative_x = x;
  2610.         relative_y = y - Cat230Paint_y - CAT230_TIME_HEIGHT;
  2611.         Cat230AppPaintPenEventHandler(relative_x, relative_y, event_type);
  2612.         RedrawCategory230Screen();
  2613.     }
  2614. }
  2615. #endif /* __MMI_TOUCH_SCREEN__ */ 
  2616. /*****************************************************************************
  2617.  * FUNCTION
  2618.  *  ExitCategory230Screen
  2619.  * DESCRIPTION
  2620.  *  exit function of category230
  2621.  * PARAMETERS
  2622.  *  void
  2623.  * RETURNS
  2624.  *  void
  2625.  *****************************************************************************/
  2626. void ExitCategory230Screen(void)
  2627. {
  2628.     /*----------------------------------------------------------------*/
  2629.     /* Local Variables                                                */
  2630.     /*----------------------------------------------------------------*/
  2631.     U8 i;
  2632.     /*----------------------------------------------------------------*/
  2633.     /* Code Body                                                      */
  2634.     /*----------------------------------------------------------------*/
  2635.     reset_softkeys();
  2636.     Cat230TitleString = NULL;
  2637.     for (i=0; i<MAX_CAT230_INDEX; i++)
  2638.     {
  2639.         Cat230IndexInfoString[i] = NULL;
  2640.     }
  2641.     Cat230NumberofIndex = 0;
  2642.     Cat230HighlightedIndex = 0;
  2643.     Cat230FirstEnter = MMI_TRUE;
  2644.     Cat230AppLeftKeyHandler = UI_dummy_function_byte;
  2645.     Cat230AppRightKeyHandler = UI_dummy_function_byte;
  2646.     Cat230RedrawPaint = UI_dummy_function;
  2647.     Cat230GetPaintInfo = NULL;
  2648. #ifdef __MMI_TOUCH_SCREEN__
  2649.     Cat230PaintPenEventHandler = NULL;
  2650.     Cat230AppPaintPenEventHandler = NULL;
  2651. #endif
  2652. }
  2653. /*****************************************************************************
  2654.  * FUNCTION
  2655.  *  GetCategory230HistorySize
  2656.  * DESCRIPTION
  2657.  *  Gets the history buffer size of category 230
  2658.  * PARAMETERS
  2659.  *  void
  2660.  * RETURNS
  2661.  *  size in U8s of the history buffer
  2662.  *****************************************************************************/
  2663. S32 GetCategory230HistorySize(void)
  2664. {
  2665.     /*----------------------------------------------------------------*/
  2666.     /* Local Variables                                                */
  2667.     /*----------------------------------------------------------------*/
  2668.     /*----------------------------------------------------------------*/
  2669.     /* Code Body                                                      */
  2670.     /*----------------------------------------------------------------*/
  2671.     return 0;
  2672. }
  2673. /*****************************************************************************
  2674.  * FUNCTION
  2675.  *  GetCategory230History
  2676.  * DESCRIPTION
  2677.  *  Gets the history buffer of category230
  2678.  * PARAMETERS
  2679.  *  history_buffer      [?]     
  2680.  * RETURNS
  2681.  *  return history buffer
  2682.  *****************************************************************************/
  2683. U8 *GetCategory230History(U8 *history_buffer)
  2684. {
  2685.     /*----------------------------------------------------------------*/
  2686.     /* Local Variables                                                */
  2687.     /*----------------------------------------------------------------*/
  2688.     /*----------------------------------------------------------------*/
  2689.     /* Code Body                                                      */
  2690.     /*----------------------------------------------------------------*/
  2691.     return history_buffer;
  2692. }
  2693. void Cat230DrawTitle(void)
  2694. {
  2695.     /*----------------------------------------------------------------*/
  2696.     /* Local Variables                                                */
  2697.     /*----------------------------------------------------------------*/
  2698.     color cblack = {0, 0, 0, 255};
  2699.     color cwhite = {255, 255, 255, 255};
  2700.     S32 width = 0;
  2701.     S32 height = 0;
  2702.     /*----------------------------------------------------------------*/
  2703.     /* Code Body                                                      */
  2704.     /*----------------------------------------------------------------*/
  2705.     gui_reset_clip();
  2706.     gui_reset_text_clip();
  2707.     gui_lock_double_buffer();
  2708.     gui_set_font(&MMI_default_font);
  2709.     gui_measure_string((UI_string_type)Cat230TitleString, &width, &height);
  2710.     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));
  2711.     if (r2lMMIFlag)
  2712.     {
  2713.         gui_move_text_cursor(((UI_device_width - width) >> 1) + width, MMI_status_bar_height + ((CAT230_TITLE_HEIGHT-height)>>1));
  2714.     }
  2715.     else
  2716.     {
  2717.         gui_move_text_cursor((UI_device_width - width) >> 1, MMI_status_bar_height + ((CAT230_TITLE_HEIGHT-height)>>1));
  2718.     }
  2719.     gui_set_text_color(cwhite);
  2720.     gui_print_text((UI_string_type)Cat230TitleString);
  2721.     gui_unlock_double_buffer();
  2722.     gui_BLT_double_buffer(0, MMI_status_bar_height, UI_device_width-1, MMI_status_bar_height+CAT230_TITLE_HEIGHT-1);
  2723. }