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

MTK

开发平台:

C/C++

  1.             change_cat105_image(get_image(WGUI_VOLUME_LEVEL4));
  2.             break;
  3.         case 4:
  4.             change_cat105_image(get_image(WGUI_VOLUME_LEVEL5));
  5.             break;
  6.         case 5:
  7.             change_cat105_image(get_image(WGUI_VOLUME_LEVEL6));
  8.             break;
  9.         case 6:
  10.             change_cat105_image(get_image(WGUI_VOLUME_LEVEL7));
  11.             break;
  12.     }
  13.     RedrawCategoryFunction();
  14. #endif /* defined(__MMI_WALLPAPER_ON_BOTTOM__) */ 
  15. }   /* end of show_vertical_bar */
  16. /*****************************************************************************
  17.  * FUNCTION
  18.  *  show_vertical_bar_previous
  19.  * DESCRIPTION
  20.  *  Show volume vertical bar downgraded by 1
  21.  * PARAMETERS
  22.  *  void
  23.  * RETURNS
  24.  *  void
  25.  *****************************************************************************/
  26. void show_vertical_bar_previous(void)
  27. {
  28.     /*----------------------------------------------------------------*/
  29.     /* Local Variables                                                */
  30.     /*----------------------------------------------------------------*/
  31.     /*----------------------------------------------------------------*/
  32.     /* Code Body                                                      */
  33.     /*----------------------------------------------------------------*/
  34.     show_vertical_bar(--volume_level_UI);
  35. }
  36. /*****************************************************************************
  37.  * FUNCTION
  38.  *  show_vertical_bar_next
  39.  * DESCRIPTION
  40.  *  Show volume vertical bar upgraded by 1
  41.  * PARAMETERS
  42.  *  void
  43.  * RETURNS
  44.  *  void
  45.  *****************************************************************************/
  46. void show_vertical_bar_next(void)
  47. {
  48.     /*----------------------------------------------------------------*/
  49.     /* Local Variables                                                */
  50.     /*----------------------------------------------------------------*/
  51.     /*----------------------------------------------------------------*/
  52.     /* Code Body                                                      */
  53.     /*----------------------------------------------------------------*/
  54.     show_vertical_bar(++volume_level_UI);
  55. }
  56. /*****************************************************************************
  57.  * FUNCTION
  58.  *  ExitCategory120Screen
  59.  * DESCRIPTION
  60.  *  Exits the Network searching screen
  61.  * PARAMETERS
  62.  *  void
  63.  * RETURNS
  64.  *  void
  65.  *****************************************************************************/
  66. void ExitCategory120Screen(void)
  67. {
  68.     /*----------------------------------------------------------------*/
  69.     /* Local Variables                                                */
  70.     /*----------------------------------------------------------------*/
  71.     /*----------------------------------------------------------------*/
  72.     /* Code Body                                                      */
  73.     /*----------------------------------------------------------------*/
  74.     /* PMT VIKAS START 20051202 */
  75. #if defined(__MMI_UI_STATUS_BAR_AT_BOTTOM__)
  76.     //START VIJAY PMT 20060105      
  77.     //in_network_search_screen=0;
  78.     reset_status_bar_at_bottom();
  79.     /* END VIJAY PMT 20060105 */
  80.     set_status_icon_bar_clip(0, 0, 0, UI_device_width - 1, MMI_status_bar_height - 1);
  81.     arrange_status_icons();
  82. #endif /* defined(__MMI_UI_STATUS_BAR_AT_BOTTOM__) */ 
  83.     /* PMT VIKAS END 20051202 */
  84.     close_main_LCD_dt_display();
  85.     gui_hide_animations();
  86.     reset_softkeys();
  87.     register_hide_status_icon_bar(1, MMI_dummy_function);
  88.     close_status_icons();
  89. }
  90. /*****************************************************************************
  91.  * FUNCTION
  92.  *  cat_120_hide_date_time_display
  93.  * DESCRIPTION
  94.  *  hide function of date/time of category120
  95.  * PARAMETERS
  96.  *  x1      [IN]        Start x position
  97.  *  y1      [IN]        Start y position
  98.  *  x2      [IN]        End x position
  99.  *  y2      [IN]        End y position
  100.  * RETURNS
  101.  *  void
  102.  *****************************************************************************/
  103. void cat_120_hide_date_time_display(S32 x1, S32 y1, S32 x2, S32 y2)
  104. {
  105.     /*----------------------------------------------------------------*/
  106.     /* Local Variables                                                */
  107.     /*----------------------------------------------------------------*/
  108.     UI_filled_area *f = current_MMI_theme->network_screen_background_filler;
  109.     /*----------------------------------------------------------------*/
  110.     /* Code Body                                                      */
  111.     /*----------------------------------------------------------------*/
  112.     gdi_layer_push_clip();
  113.     gdi_layer_set_clip(x1, y1, x2, y2);
  114.     gui_draw_filled_area(0, 0, UI_device_width - 1, UI_device_height - 1, f);
  115.     gdi_layer_pop_clip();
  116. }
  117. /*****************************************************************************
  118.  * FUNCTION
  119.  *  ShowCategory120Screen
  120.  * DESCRIPTION
  121.  *  Displays the category120 screen
  122.  * PARAMETERS
  123.  *  left_softkey            [IN]        Left softkey label
  124.  *  left_softkey_icon       [IN]        Icon for the Left softkey
  125.  *  right_softkey           [IN]        Right softkey label
  126.  *  right_softkey_icon      [IN]        Icon for the right softkey
  127.  *  message                 [IN]        Id of message to be displayed
  128.  *  message_icon            [IN]        Id of message image to be displayed
  129.  *  history_buffer          [IN]        History buffer
  130.  * RETURNS
  131.  *  void
  132.  *****************************************************************************/
  133. void ShowCategory120Screen(
  134.         U16 left_softkey,
  135.         U16 left_softkey_icon,
  136.         U16 right_softkey,
  137.         U16 right_softkey_icon,
  138.         U16 message,
  139.         U16 message_icon,
  140.         U8 *history_buffer)
  141. {
  142.     /*----------------------------------------------------------------*/
  143.     /* Local Variables                                                */
  144.     /*----------------------------------------------------------------*/
  145.     dm_data_struct dm_data;
  146.     S32 l;
  147.     /*----------------------------------------------------------------*/
  148.     /* Code Body                                                      */
  149.     /*----------------------------------------------------------------*/
  150.     dm_reset_context();
  151.     UI_UNUSED_PARAMETER(history_buffer);
  152.     gdi_layer_lock_frame_buffer();
  153.     MMI_menu_shortcut_number = -1;
  154.     change_left_softkey(left_softkey, left_softkey_icon);
  155.     change_right_softkey(right_softkey, right_softkey_icon);
  156.     SetupCategoryKeyHandlers();
  157.     set_main_LCD_dt_date_hide_function(cat_120_hide_date_time_display);
  158.     set_main_LCD_dt_time_hide_function(cat_120_hide_date_time_display);
  159.     /* PMT VIKAS START 20051202 */
  160. #if defined(__MMI_UI_STATUS_BAR_AT_BOTTOM__)
  161.     set_dt_display(DT_IDLE_SCREEN_2);
  162.     //START VIJAY PMT 20060105      
  163.     //in_network_search_screen=1;
  164.     set_status_bar_at_bottom();
  165.     /* END VIJAY PMT 20060105 */
  166. #else /* defined(__MMI_UI_STATUS_BAR_AT_BOTTOM__) */ 
  167.     set_dt_display(DT_NETWORK_SEARCH);
  168. #endif /* defined(__MMI_UI_STATUS_BAR_AT_BOTTOM__) */ 
  169.     /* PMT VIKAS END 20051202 */
  170.     MMI_message_string = (UI_string_type) get_string(message);
  171.     l = gui_strlen(MMI_message_string);
  172.     create_multiline_inputbox_set_buffer(MMI_message_string, l, l, 0);
  173.     MMI_multiline_inputbox.flags |=
  174.         (UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW | UI_MULTI_LINE_INPUT_BOX_CENTER_JUSTIFY |
  175.          UI_MULTI_LINE_INPUT_BOX_DISABLE_BACKGROUND | UI_MULTI_LINE_INPUT_BOX_DISABLE_SCROLLBAR);
  176.     dm_add_image(get_image(message_icon), NULL, NULL);
  177.     dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
  178.     /* PMT VIKAS START 20050707 */
  179. #ifdef __MMI_UI_DALMATIAN_STATUSBAR__
  180.     ShowStatusIconsTitle();
  181. #else /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
  182.     register_hide_status_icon_bar(0, hide_status_icons_bar0);
  183.     register_hide_status_icon_bar(1, hide_status_icons_bar1);
  184.     /* PMT VIKAS START 20051202 */
  185. #ifdef __MMI_UI_STATUS_BAR_AT_BOTTOM__
  186.     set_status_icon_bar_clip(
  187.         0,
  188.         0,
  189.         UI_device_height - 1 - MMI_button_bar_height - MMI_status_bar_height,
  190.         UI_device_width - 1,
  191.         UI_device_height - 1 - MMI_button_bar_height - 1);
  192.     set_status_icon_bar_clip(
  193.         1,
  194.         UI_device_width - 16,
  195.         MMI_status_bar_height,
  196.         UI_device_width - 1,
  197.         UI_device_height - 1 - MMI_button_bar_height - MMI_status_bar_height - (STATUS_ICON_Y_GAP << 1) - 1);
  198.     arrange_status_icons();
  199. #else /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */ 
  200.     set_status_icon_bar_clip(0, 0, 0, UI_device_width - 1, MMI_status_bar_height - 1);
  201. #endif /* __MMI_UI_STATUS_BAR_AT_BOTTOM__ */ 
  202.     /* PMT VIKAS END 20051202 */
  203.     show_status_icon_bar(0);
  204.     show_status_icon_bar(1);
  205. #endif /* __MMI_UI_DALMATIAN_STATUSBAR__ */ 
  206.     /* PMT VIKAS END 20050707 */
  207.     gdi_layer_unlock_frame_buffer();
  208.     ExitCategoryFunction = ExitCategory120Screen;
  209.     dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  210.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  211.     dm_data.s32CatId = MMI_CATEGORY120_ID;
  212.     dm_setup_data(&dm_data);
  213.     dm_redraw_category_screen();
  214. }
  215. #ifdef __MMI_BMI__
  216. /* PMT HIMANSHU START 20051018 */
  217. /* For properly placing the strings, images and boxes, the screen is divided
  218.    into blocks. */
  219. #define NUMBER_OF_X_BLOCKS 7
  220. #define NUMBER_OF_Y_BLOCKS 15
  221. /* PMT HIMANSHU END 20051018 */
  222. /* Only used in cat122(BMI) */
  223. UI_filled_area pinkwgui_pop_up_dialog_background = {UI_FILLED_AREA_TYPE_COLOR,
  224.     UI_NULL_IMAGE,
  225.     NULL,
  226.     {255, 236, 255, 100},
  227.     {0, 0, 0, 0},
  228.     {0, 0, 0, 100},
  229.     {50, 50, 50, 100},
  230.     0
  231. };
  232. /* Used in cat122(BMI) */
  233. UI_filled_area yellowwgui_pop_up_dialog_background = {UI_FILLED_AREA_TYPE_COLOR | UI_FILLED_AREA_SINGLE_BORDER,
  234.     UI_NULL_IMAGE,
  235.     NULL,
  236.     {249, 244, 171, 100},
  237.     {0, 0, 0, 0},
  238.     {0, 0, 0, 100},
  239.     {50, 50, 50, 100},
  240.     0
  241. };
  242. /* Only used in cat122(BMI) */
  243. UI_filled_area orangewgui_without_boder_pop_up_dialog_background = {UI_FILLED_AREA_TYPE_COLOR,
  244.     UI_NULL_IMAGE,
  245.     NULL,
  246.     {242, 174, 33, 100},
  247.     {0, 0, 0, 0},
  248.     {0, 0, 0, 100},
  249.     {50, 50, 50, 100},
  250.     0
  251. };
  252. /*****************************************************************************
  253.  * FUNCTION
  254.  *  DrawCate122CategoryControlArea
  255.  * DESCRIPTION
  256.  *  Draws the category122 category control area
  257.  * PARAMETERS
  258.  *  coordinate      [IN/OUT]        Coordinates of category controlled area.
  259.  * RETURNS
  260.  *  void
  261.  *****************************************************************************/
  262. void DrawCate122CategoryControlArea(dm_coordinates *coordinate)
  263. {
  264.     /*----------------------------------------------------------------*/
  265.     /* Local Variables                                                */
  266.     /*----------------------------------------------------------------*/
  267.     /*----------------------------------------------------------------*/
  268.     /* Code Body                                                      */
  269.     /*----------------------------------------------------------------*/
  270.     RedrawCategory122Screen();
  271. }
  272. /*****************************************************************************
  273.  * FUNCTION
  274.  *  RedrawCategory122Screen
  275.  * DESCRIPTION
  276.  *  
  277.  * PARAMETERS
  278.  *  void
  279.  * RETURNS
  280.  *  void
  281.  *****************************************************************************/
  282. void RedrawCategory122Screen(void)
  283. {
  284.     /*----------------------------------------------------------------*/
  285.     /* Local Variables                                                */
  286.     /*----------------------------------------------------------------*/
  287.     S32 TempHeight;     //KP Jerry add for sovling result text algin on 2006-12-31
  288.     S32 fh, fw;
  289.     S32 x1, y1, x2, y2;
  290.     S32 block_size_x = MMI_content_width / NUMBER_OF_X_BLOCKS;
  291.     S32 block_size_y = MMI_content_height / NUMBER_OF_Y_BLOCKS;
  292.     S32 gap_x = (MMI_content_width % NUMBER_OF_X_BLOCKS) >> 1;
  293.     S32 gap_y = (MMI_content_height % NUMBER_OF_Y_BLOCKS) >> 1;
  294.     color c = *current_MMI_theme->title_text_color;
  295.     color bc = *current_MMI_theme->title_text_border_color;//082606 calendar text
  296.     stFontAttribute *f = &MMI_medium_font;
  297.     /*----------------------------------------------------------------*/
  298.     /* Code Body                                                      */
  299.     /*----------------------------------------------------------------*/
  300.     gui_set_font(f);
  301.     gui_set_text_color(c);
  302.     gui_set_text_border_color(bc);
  303.     gdi_layer_lock_frame_buffer();
  304.     gdi_layer_push_clip();
  305.     gdi_layer_reset_clip();
  306.     wgui_show_transparent_animation();
  307.     y1 = MMI_content_y + gap_y + block_size_y;
  308.     y2 = y1 + (3 * block_size_y) - 1;
  309.     gui_measure_image(_MMI_animated_icon, &fw, &fh);
  310.     x1 = _MMI_animated_icon_x;
  311.     if (fw > 0)
  312.     {
  313.         x1 += (fw + 10);
  314.     }
  315.     gui_measure_string(MMI_message_string, &fw, &fh);
  316. TempHeight = fh;    //KP Jerry add for sovling result text algin on 2006-12-31
  317.     if (r2lMMIFlag)
  318.     {
  319.         gui_move_text_cursor(x1 + fw, y2 - fh);
  320.     }
  321.     else
  322.     {
  323.         gui_move_text_cursor(x1, y2 - fh);
  324.     }
  325.     //gui_print_text(MMI_message_string);
  326.     gui_print_bordered_text(MMI_message_string);
  327.     x1 += fw + 5;
  328.     gui_measure_string((UI_string_type) disp_barstr, &fw, &fh);
  329. fh = TempHeight;    //KP Jerry add for sovling result text algin on 2006-12-31
  330.     if (r2lMMIFlag)
  331.     {
  332.         gui_move_text_cursor(x1 + fw, y2 - fh);
  333.     }
  334.     else
  335.     {
  336.         gui_move_text_cursor(x1, y2 - fh);
  337.     }
  338.     //gui_print_text((UI_string_type) disp_barstr);
  339.     gui_print_bordered_text((UI_string_type) disp_barstr);
  340.     x1 = MMI_content_x + gap_x + (block_size_x / 2);
  341.     y1 = y2 + (block_size_y);
  342.     x2 = x1 + (6 * block_size_x) - 1;
  343.     y2 = y1 + (3 * block_size_y) - 1;
  344.     gui_draw_filled_area(
  345.         x1 + (2 * block_size_x) - 5,
  346.         y1,
  347.         x2 - (2 * block_size_x) + 5,
  348.         y2,
  349.         &yellowwgui_pop_up_dialog_background);
  350.     gui_measure_string((UI_string_type) disp_valuestr, &fw, &fh);
  351.     if (r2lMMIFlag)
  352.     {
  353.         gui_move_text_cursor(x1 + (3 * block_size_x) + (fw >> 1), ((y1 >> 1) + (y2 >> 1)) - (fh >> 1));
  354.     }
  355.     else
  356.     {
  357.         gui_move_text_cursor(x1 + (3 * block_size_x) - (fw >> 1), ((y1 >> 1) + (y2 >> 1)) - (fh >> 1));
  358.     }
  359.     //gui_print_text((UI_string_type) disp_valuestr);
  360.     gui_print_bordered_text((UI_string_type) disp_valuestr);
  361.     x1 = MMI_content_x + gap_x + (block_size_x / 2);
  362.     y1 = MMI_content_y + gap_y + (9 * block_size_y);
  363.     x2 = x1 + (6 * block_size_x);
  364.     y2 = y1 + (3 * block_size_y) - 1;
  365.     gui_draw_filled_area(x1, y1, x2, y2, &yellowwgui_pop_up_dialog_background);
  366.     //gui_draw_vertical_line(y1, y2, x1 + (2 * block_size_x), c);
  367.     //gui_draw_vertical_line(y1, y2, x1 + (4 * block_size_x), c);
  368.     gui_draw_vertical_line(y1, y2, x1 + (2 * block_size_x), yellowwgui_pop_up_dialog_background.border_color);//082606 calendar line
  369.     gui_draw_vertical_line(y1, y2, x1 + (4 * block_size_x), yellowwgui_pop_up_dialog_background.border_color);
  370.     /* wgui_image_clip_x1 stores the percentage value for deciding the position
  371.        of highlighted block. */
  372.     x1 = x1 + (wgui_image_clip_x1 * (2 * block_size_x)) + 1;
  373.     x2 = x1 + (2 * block_size_x) - 2;
  374.     gui_draw_filled_area(x1, y1 + 1, x2, y2 - 1, &orangewgui_without_boder_pop_up_dialog_background);
  375.     x1 = MMI_content_x + gap_x + (block_size_x / 2);
  376.     y1 = y1 + (4 * block_size_y);
  377.     x2 = x1 + (6 * block_size_x) - 1;
  378.     y2 = y1 + block_size_y;
  379.     gui_measure_string((UI_string_type) left_value, &fw, &fh);
  380.     if (r2lMMIFlag)
  381.     {
  382.         gui_move_text_cursor(x1 + (2 * block_size_x) + (fw >> 1), y1);
  383.     }
  384.     else
  385.     {
  386.         gui_move_text_cursor(x1 + (2 * block_size_x) - (fw >> 1), y1);
  387.     }
  388.     //gui_print_text((UI_string_type) left_value);
  389.     gui_print_bordered_text((UI_string_type) left_value);
  390.     gui_measure_string((UI_string_type) right_value, &fw, &fh);
  391.     if (r2lMMIFlag)
  392.     {
  393.         gui_move_text_cursor(x1 + (4 * block_size_x) + (fw >> 1), y1);
  394.     }
  395.     else
  396.     {
  397.         gui_move_text_cursor(x1 + (4 * block_size_x) - (fw >> 1), y1);
  398.     }
  399.     //gui_print_text((UI_string_type) right_value);
  400.     gui_print_bordered_text((UI_string_type) right_value);
  401.     gdi_layer_pop_clip();
  402.     gdi_layer_unlock_frame_buffer();
  403.     gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
  404. }
  405. /*****************************************************************************
  406.  * FUNCTION
  407.  *  ShowCategory122Screen
  408.  * DESCRIPTION
  409.  *  
  410.  * PARAMETERS
  411.  *  title                   [IN]        
  412.  *  title_icon              [IN]        
  413.  *  left_softkey            [IN]        
  414.  *  left_softkey_icon       [IN]        
  415.  *  right_softkey           [IN]        
  416.  *  right_softkey_icon      [IN]        
  417.  *  message                 [IN]        
  418.  *  percentage_value        [IN]        
  419.  *  history_buffer          [?]         
  420.  *  disp_val                [?]         
  421.  *  bar_status              [?]         
  422.  *  side_icon               [IN]        
  423.  *  left_limit              [?]         
  424.  *  right_limit             [?]         
  425.  * RETURNS
  426.  *  void
  427.  *****************************************************************************/
  428. void ShowCategory122Screen(
  429.         U16 title,
  430.         U16 title_icon,
  431.         U16 left_softkey,
  432.         U16 left_softkey_icon,
  433.         U16 right_softkey,
  434.         U16 right_softkey_icon,
  435.         U16 message,
  436.         S32 percentage_value,
  437.         U8 *history_buffer,
  438.         S8 *disp_val,
  439.         U8 *bar_status,
  440.         U16 side_icon,
  441.         U8 *left_limit,
  442.         U8 *right_limit)
  443. {
  444.     /*----------------------------------------------------------------*/
  445.     /* Local Variables                                                */
  446.     /*----------------------------------------------------------------*/
  447.     dm_data_struct dm_data;
  448.     S32 fw, fh;
  449.     S32 total_width = 0;
  450.     /*----------------------------------------------------------------*/
  451.     /* Code Body                                                      */
  452.     /*----------------------------------------------------------------*/
  453.     UI_UNUSED_PARAMETER(history_buffer);
  454.     MMI_menu_shortcut_number = -1;
  455.     clear_category_screen_key_handlers();
  456.     clear_left_softkey();
  457.     clear_right_softkey();
  458.     change_left_softkey(left_softkey, left_softkey_icon);
  459.     change_right_softkey(right_softkey, right_softkey_icon);
  460.     register_left_softkey_handler();
  461.     register_right_softkey_handler();
  462.     register_default_hide_softkeys();
  463.     MMI_title_string = (UI_string_type) get_string(title);
  464.     MMI_title_icon = (PU8) get_image(title_icon);
  465.     MMI_message_string = (UI_string_type) get_string(message);
  466.     disp_valuestr = (PU8) disp_val;
  467.     disp_barstr = (PU8) bar_status;
  468.     /* store the percentage value in Global variable, so that is can be used
  469.        in the redraw category. */
  470.     wgui_image_clip_x1 = percentage_value;
  471.     left_value = (PU8) left_limit;
  472.     right_value = (PU8) right_limit;
  473.     gui_measure_string(MMI_message_string, &fw, &fh);
  474.     total_width += fw;
  475.     gui_measure_string((UI_string_type) disp_barstr, &fw, &fh);
  476.     total_width += fw;
  477.     gui_measure_image((PU8) get_image(side_icon), &fw, &fh);
  478.     total_width += fw;
  479.     /* add gaps between image and strings */
  480.     if (fw > 0)
  481.     {
  482.         total_width += (10 + 5);
  483.     }
  484.     else
  485.     {
  486.         total_width += 5;
  487.     }
  488.     wgui_set_animation_y(
  489.         (UI_device_width >> 1) - (total_width >> 1) + (fw >> 1),
  490.         MMI_content_y + ((MMI_content_height % NUMBER_OF_Y_BLOCKS) >> 1) + (4 * (MMI_content_height / NUMBER_OF_Y_BLOCKS)) - 1 - fh,
  491.         side_icon);
  492.     ExitCategoryFunction = ExitCategory122Screen;
  493.     ExitCategoryFunction = UI_dummy_function;
  494.     dm_setup_category_functions(dm_redraw_category_screen, dummy_get_history, dummy_get_history_size);
  495.     dm_register_category_controlled_callback(DrawCate122CategoryControlArea);
  496.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  497.     dm_data.s32CatId = MMI_CATEGORY122_ID;
  498.     dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
  499.     dm_setup_data(&dm_data);
  500.     dm_redraw_category_screen();
  501. }
  502. /* PMT HIMANSHU END 20051018 */
  503. /*****************************************************************************
  504.  * FUNCTION
  505.  *  ExitCategory122Screen
  506.  * DESCRIPTION
  507.  *  Exits the category122 screen
  508.  * PARAMETERS
  509.  *  void
  510.  * RETURNS
  511.  *  void
  512.  *****************************************************************************/
  513. void ExitCategory122Screen(void)
  514. {
  515.     /*----------------------------------------------------------------*/
  516.     /* Local Variables                                                */
  517.     /*----------------------------------------------------------------*/
  518.     /*----------------------------------------------------------------*/
  519.     /* Code Body                                                      */
  520.     /*----------------------------------------------------------------*/
  521.     gui_hide_animations();
  522.     reset_softkeys();
  523. }
  524. #endif /* __MMI_BMI__ */ 
  525. #ifdef __MMI_CALORIE__
  526. /* under construction !*/
  527. /* under construction !*/
  528. /* under construction !*/
  529. /* under construction !*/
  530. /* under construction !*/
  531. /* under construction !*/
  532. /* under construction !*/
  533. /* under construction !*/
  534. /* under construction !*/
  535. /* under construction !*/
  536. /* under construction !*/
  537. /* under construction !*/
  538. /* under construction !*/
  539. /* under construction !*/
  540. /* under construction !*/
  541. /* under construction !*/
  542. /* under construction !*/
  543. /* under construction !*/
  544. /* under construction !*/
  545. /* under construction !*/
  546. /* under construction !*/
  547. /* under construction !*/
  548. /* under construction !*/
  549. /* under construction !*/
  550. /* under construction !*/
  551. /* under construction !*/
  552. /* under construction !*/
  553. /* under construction !*/
  554. /* under construction !*/
  555. /* under construction !*/
  556. /* under construction !*/
  557. /* under construction !*/
  558. /* under construction !*/
  559. /* under construction !*/
  560. /* under construction !*/
  561. /* under construction !*/
  562. /* under construction !*/
  563. /* under construction !*/
  564. /* under construction !*/
  565. /* under construction !*/
  566. /* under construction !*/
  567. /* under construction !*/
  568. /* under construction !*/
  569. /* under construction !*/
  570. /* under construction !*/
  571. /* under construction !*/
  572. /* under construction !*/
  573. /* under construction !*/
  574. /* under construction !*/
  575. /* under construction !*/
  576. /* under construction !*/
  577. /* under construction !*/
  578. /* under construction !*/
  579. /* under construction !*/
  580. /* under construction !*/
  581. /* under construction !*/
  582. /* under construction !*/
  583. /* under construction !*/
  584. /* under construction !*/
  585. /* under construction !*/
  586. /* under construction !*/
  587. /* under construction !*/
  588. /* under construction !*/
  589. /* under construction !*/
  590. /* under construction !*/
  591. /* under construction !*/
  592. /* under construction !*/
  593. /* under construction !*/
  594. /* under construction !*/
  595. /* under construction !*/
  596. /* under construction !*/
  597. /* under construction !*/
  598. /* under construction !*/
  599. /* under construction !*/
  600. /* under construction !*/
  601. /* under construction !*/
  602. /* under construction !*/
  603. /* under construction !*/
  604. /* under construction !*/
  605. /* under construction !*/
  606. /* under construction !*/
  607. /* under construction !*/
  608. /* under construction !*/
  609. /* under construction !*/
  610. /* under construction !*/
  611. /* under construction !*/
  612. /* under construction !*/
  613. /* under construction !*/
  614. /* under construction !*/
  615. /* under construction !*/
  616. /* under construction !*/
  617. /* under construction !*/
  618. /* under construction !*/
  619. /* under construction !*/
  620. /* under construction !*/
  621. /* under construction !*/
  622. /* under construction !*/
  623. /* under construction !*/
  624. /* under construction !*/
  625. /* under construction !*/
  626. /* under construction !*/
  627. /* under construction !*/
  628. /* under construction !*/
  629. /* under construction !*/
  630. /* under construction !*/
  631. /* under construction !*/
  632. /* under construction !*/
  633. /* under construction !*/
  634. /* under construction !*/
  635. /* under construction !*/
  636. /* under construction !*/
  637. /* under construction !*/
  638. /* under construction !*/
  639. /* under construction !*/
  640. /* under construction !*/
  641. /* under construction !*/
  642. /* under construction !*/
  643. /* under construction !*/
  644. /* under construction !*/
  645. /* under construction !*/
  646. /* under construction !*/
  647. /* under construction !*/
  648. /* under construction !*/
  649. /* under construction !*/
  650. /* under construction !*/
  651. /* under construction !*/
  652. /* under construction !*/
  653. /* under construction !*/
  654. /* under construction !*/
  655. /* under construction !*/
  656. /* under construction !*/
  657. /* under construction !*/
  658. /* under construction !*/
  659. /* under construction !*/
  660. /* under construction !*/
  661. /* under construction !*/
  662. /* under construction !*/
  663. /* under construction !*/
  664. /* under construction !*/
  665. /* under construction !*/
  666. /* under construction !*/
  667. /* under construction !*/
  668. /* under construction !*/
  669. /* under construction !*/
  670. /* under construction !*/
  671. /* under construction !*/
  672. /* under construction !*/
  673. /* under construction !*/
  674. /* under construction !*/
  675. /* under construction !*/
  676. /* under construction !*/
  677. /* under construction !*/
  678. /* under construction !*/
  679. /* under construction !*/
  680. /* under construction !*/
  681. /* under construction !*/
  682. /* under construction !*/
  683. /* under construction !*/
  684. /* under construction !*/
  685. /* under construction !*/
  686. /* under construction !*/
  687. /* under construction !*/
  688. /* under construction !*/
  689. /* under construction !*/
  690. /* under construction !*/
  691. /* under construction !*/
  692. /* under construction !*/
  693. /* under construction !*/
  694. /* under construction !*/
  695. /* under construction !*/
  696. /* under construction !*/
  697. /* under construction !*/
  698. /* under construction !*/
  699. /* under construction !*/
  700. /* under construction !*/
  701. /* under construction !*/
  702. /* under construction !*/
  703. /* under construction !*/
  704. /* under construction !*/
  705. /* under construction !*/
  706. /* under construction !*/
  707. /* under construction !*/
  708. /* under construction !*/
  709. /* under construction !*/
  710. /* under construction !*/
  711. /* under construction !*/
  712. /* under construction !*/
  713. /* under construction !*/
  714. /* under construction !*/
  715. /* under construction !*/
  716. /* under construction !*/
  717. /* under construction !*/
  718. /* under construction !*/
  719. /* under construction !*/
  720. /* under construction !*/
  721. /* under construction !*/
  722. /* under construction !*/
  723. /* under construction !*/
  724. /* under construction !*/
  725. /* under construction !*/
  726. /* under construction !*/
  727. /* under construction !*/
  728. /* under construction !*/
  729. /* under construction !*/
  730. /* under construction !*/
  731. /* under construction !*/
  732. /* under construction !*/
  733. /* under construction !*/
  734. /* under construction !*/
  735. /* under construction !*/
  736. /* under construction !*/
  737. /* under construction !*/
  738. /* under construction !*/
  739. /* under construction !*/
  740. /* under construction !*/
  741. /* under construction !*/
  742. /* under construction !*/
  743. /* under construction !*/
  744. /* under construction !*/
  745. /* under construction !*/
  746. /* under construction !*/
  747. /* under construction !*/
  748. /* under construction !*/
  749. /* under construction !*/
  750. /* under construction !*/
  751. /* under construction !*/
  752. /* under construction !*/
  753. /* under construction !*/
  754. /* under construction !*/
  755. /* under construction !*/
  756. /* under construction !*/
  757. /* under construction !*/
  758. /* under construction !*/
  759. /* under construction !*/
  760. /* under construction !*/
  761. /* under construction !*/
  762. /* under construction !*/
  763. /* under construction !*/
  764. /* under construction !*/
  765. /* under construction !*/
  766. /* under construction !*/
  767. /* under construction !*/
  768. /* under construction !*/
  769. /* under construction !*/
  770. /* under construction !*/
  771. /* under construction !*/
  772. /* under construction !*/
  773. /* under construction !*/
  774. /* under construction !*/
  775. /* under construction !*/
  776. /* under construction !*/
  777. /* under construction !*/
  778. /* under construction !*/
  779. /* under construction !*/
  780. /* under construction !*/
  781. /* under construction !*/
  782. /* under construction !*/
  783. /* under construction !*/
  784. /* under construction !*/
  785. /* under construction !*/
  786. /* under construction !*/
  787. /* under construction !*/
  788. /* under construction !*/
  789. /* under construction !*/
  790. /* under construction !*/
  791. /* under construction !*/
  792. /* under construction !*/
  793. /* under construction !*/
  794. /* under construction !*/
  795. /* under construction !*/
  796. /* under construction !*/
  797. /* under construction !*/
  798. /* under construction !*/
  799. /* under construction !*/
  800. /* under construction !*/
  801. /* under construction !*/
  802. /* under construction !*/
  803. /* under construction !*/
  804. /* under construction !*/
  805. /* under construction !*/
  806. /* under construction !*/
  807. /* under construction !*/
  808. /* under construction !*/
  809. /* under construction !*/
  810. /* under construction !*/
  811. /* under construction !*/
  812. /* under construction !*/
  813. /* under construction !*/
  814. /* under construction !*/
  815. /* under construction !*/
  816. /* under construction !*/
  817. /* under construction !*/
  818. /* under construction !*/
  819. /* under construction !*/
  820. /* under construction !*/
  821. /* under construction !*/
  822. /* under construction !*/
  823. /* under construction !*/
  824. /* under construction !*/
  825. /* under construction !*/
  826. /* under construction !*/
  827. /* under construction !*/
  828. /* under construction !*/
  829. /* under construction !*/
  830. /* under construction !*/
  831. /* under construction !*/
  832. /* under construction !*/
  833. /* under construction !*/
  834. /* under construction !*/
  835. /* under construction !*/
  836. /* under construction !*/
  837. /* under construction !*/
  838. /* under construction !*/
  839. /* under construction !*/
  840. /* under construction !*/
  841. /* under construction !*/
  842. /* under construction !*/
  843. /* under construction !*/
  844. /* under construction !*/
  845. /* under construction !*/
  846. /* under construction !*/
  847. /* under construction !*/
  848. /* under construction !*/
  849. /* under construction !*/
  850. /* under construction !*/
  851. /* under construction !*/
  852. /* under construction !*/
  853. /* under construction !*/
  854. /* under construction !*/
  855. /* under construction !*/
  856. #endif /* __MMI_CALORIE__ */ 
  857. /*****************************************************************************
  858.  * FUNCTION
  859.  *  ShowCategory184Screen
  860.  * DESCRIPTION
  861.  *  Displays the category184 screen
  862.  * PARAMETERS
  863.  *  title                   [IN]        Title for the screen
  864.  *  title_icon              [IN]        Icon shown with the title
  865.  *  left_softkey            [IN]        Left softkey label
  866.  *  left_softkey_icon       [IN]        Icon for the Left softkey
  867.  *  right_softkey           [IN]        Right softkey label
  868.  *  right_softkey_icon      [IN]        Icon for the right softkey
  869.  *  number_of_items         [IN]        Number of items to be displayed
  870.  *  get_item_func           [IN]        Function pointer to get next displayed items
  871.  *  get_hint_func           [IN]        Function pointer to get next displayed hint data
  872.  *  highlighted_item        [IN]        Index of item to be highlighted
  873.  *  history_buffer          [IN]        History buffer
  874.  * RETURNS
  875.  *  void
  876.  *****************************************************************************/
  877. void ShowCategory184Screen(
  878.         U16 title,
  879.         U16 title_icon,
  880.         U16 left_softkey,
  881.         U16 left_softkey_icon,
  882.         U16 right_softkey,
  883.         U16 right_softkey_icon,
  884.         S32 number_of_items,
  885.         GetItemFuncPtr get_item_func,
  886.         GetHintFuncPtr get_hint_func,
  887.         S32 highlighted_item,
  888.         U8 *history_buffer)
  889. {
  890.     /*----------------------------------------------------------------*/
  891.     /* Local Variables                                                */
  892.     /*----------------------------------------------------------------*/
  893.     /*----------------------------------------------------------------*/
  894.     /* Code Body                                                      */
  895.     /*----------------------------------------------------------------*/
  896.     ShowCategory185Screen(
  897.         title,
  898.         title_icon,
  899.         left_softkey,
  900.         left_softkey_icon,
  901.         right_softkey,
  902.         right_softkey_icon,
  903.         number_of_items,
  904.         get_item_func,
  905.         get_hint_func,
  906.         highlighted_item,
  907.         MMI_FALSE,
  908.         UI_dummy_function,
  909.         history_buffer);
  910. }
  911. /*****************************************************************************
  912.  * FUNCTION
  913.  *  ShowCategory185Screen
  914.  * DESCRIPTION
  915.  *  Similar to Category 184 but data caching is disabled in dynamic list menu.
  916.  *  
  917.  *  Designed for JAM (Java application manager) because Java adopts special architecture.
  918.  * PARAMETERS
  919.  *  title                   [IN]        
  920.  *  title_icon              [IN]        
  921.  *  left_softkey            [IN]        
  922.  *  left_softkey_icon       [IN]        
  923.  *  right_softkey           [IN]        
  924.  *  right_softkey_icon      [IN]        
  925.  *  number_of_items         [IN]        
  926.  *  get_item_func           [IN]        
  927.  *  get_hint_func           [IN]        
  928.  *  highlighted_item        [IN]        
  929.  *  disable_data_cache      [IN]        Whether caching of dynamic data is disabled
  930.  *  flush_data_callback     [IN]        Callback function invoked before data is reloaded
  931.  *  history_buffer          [?]         
  932.  * RETURNS
  933.  *  void
  934.  *****************************************************************************/
  935. void ShowCategory185Screen(
  936.         U16 title,
  937.         U16 title_icon,
  938.         U16 left_softkey,
  939.         U16 left_softkey_icon,
  940.         U16 right_softkey,
  941.         U16 right_softkey_icon,
  942.         S32 number_of_items,
  943.         GetItemFuncPtr get_item_func,
  944.         GetHintFuncPtr get_hint_func,
  945.         S32 highlighted_item,
  946.         MMI_BOOL disable_data_cache,
  947.         void (*flush_data_callback) (void),
  948.         U8 *history_buffer)
  949. {
  950.     /*----------------------------------------------------------------*/
  951.     /* Local Variables                                                */
  952.     /*----------------------------------------------------------------*/
  953.     dm_data_struct dm_data;
  954.     S32 shortcut_width;
  955.     U8 h_flag;
  956.     /*----------------------------------------------------------------*/
  957.     /* Code Body                                                      */
  958.     /*----------------------------------------------------------------*/
  959.     gdi_layer_lock_frame_buffer();
  960.     MMI_title_string = (UI_string_type) get_string(title);
  961.     MMI_title_icon = (PU8) get_image(title_icon);
  962.     MMI_menu_shortcut_number = -1;
  963.     change_left_softkey(left_softkey, left_softkey_icon);
  964.     change_right_softkey(right_softkey, right_softkey_icon);
  965.     SetupCategoryKeyHandlers();
  966.     create_fixed_icontext_menuitems();
  967.     MMI_current_menu_type = LIST_MENU;
  968.     resize_fixed_list(MMI_content_width, MMI_content_height);
  969.     associate_fixed_icontext_list();
  970.     if (disable_data_cache)
  971.     {
  972.         MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_CACHE_DYNAMIC_DATA;
  973.     }
  974.     init_dynamic_item_buffer(number_of_items, get_item_func, get_hint_func, flush_data_callback);
  975.     MMI_fixed_list_menu.n_items = number_of_items;
  976.     register_dynamic_list_shortcut_handler();
  977.     register_dynamic_list_keys();
  978.     shortcut_width = set_menu_item_count(number_of_items) + 7;
  979.     resize_menu_shortcut_handler(shortcut_width, (MMI_title_height));
  980.     move_menu_shortcut_handler(UI_device_width - MMI_menu_shortcut_box.width, MMI_title_y);
  981.     register_hide_menu_shortcut(draw_title);
  982.     resize_fixed_icontext_menuitems(0, MMI_MENUITEM_HEIGHT);
  983.     set_fixed_icontext_positions(MMI_ICONTEXT_MENUITEM_HEIGHT + 2, 0, 1, 0);
  984.     register_fixed_list_highlight_handler(dynamic_list_highlight_handler);
  985.     h_flag = set_list_menu_category_history(MMI_CATEGORY184_ID, history_buffer);
  986. #ifdef __MMI_UI_HINTS_IN_MENUITEM__
  987.     if (get_hint_func)
  988.     {
  989.         if (is_set_force_icon_on_highlight_only_in_menuitem())
  990.         {
  991.             wgui_show_icon_only_highlight_in_icontext_menuitem();
  992.         }
  993.         if (is_set_force_all_hints_in_menuitem())
  994.         {
  995.             wgui_enable_hints_in_icontext_menuitem();
  996.         }
  997.         else if (is_set_force_hints_on_highlight_in_menuitem())
  998.         {
  999.             wgui_enable_hint_highlight_in_icontext_menuitem();
  1000.         }
  1001.         else
  1002.         {
  1003.             wgui_enable_hint_highlight_in_icontext_menuitem();
  1004.         }
  1005.         set_dynamic_pop_up_descriptions(h_flag ? MMI_fixed_list_menu.highlighted_item : highlighted_item);      /* ????? */
  1006.     #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1007.         gui_block_list_effect();    /* 072305 Calvin added */
  1008.     #endif 
  1009.     }
  1010. #endif /* __MMI_UI_HINTS_IN_MENUITEM__ */ 
  1011.     dynamic_list_goto_item_no_redraw(h_flag ? MMI_fixed_list_menu.highlighted_item : highlighted_item);
  1012.     set_dynamic_pop_up_descriptions(h_flag ? MMI_fixed_list_menu.highlighted_item : highlighted_item);  /* ????? */
  1013.     gdi_layer_unlock_frame_buffer();
  1014.     ExitCategoryFunction = ExitCategory184Screen;
  1015.     dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  1016.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  1017.     dm_data.s32CatId = MMI_CATEGORY184_ID;
  1018.     dm_data.s32flags = 0;
  1019.     dm_setup_data(&dm_data);
  1020.     dm_redraw_category_screen();
  1021. }   /* end of ShowCategory184Screen */
  1022. /*****************************************************************************
  1023.  * FUNCTION
  1024.  *  ExitCategory184Screen
  1025.  * DESCRIPTION
  1026.  *  Exits category 184 screen
  1027.  * PARAMETERS
  1028.  *  void
  1029.  * RETURNS
  1030.  *  void
  1031.  *****************************************************************************/
  1032. void ExitCategory184Screen(void)
  1033. {
  1034.     /*----------------------------------------------------------------*/
  1035.     /* Local Variables                                                */
  1036.     /*----------------------------------------------------------------*/
  1037.     /*----------------------------------------------------------------*/
  1038.     /* Code Body                                                      */
  1039.     /*----------------------------------------------------------------*/
  1040.     ClearHighlightHandler();
  1041.     reset_softkeys();
  1042.     reset_menu_shortcut_handler();
  1043.     reset_dynamic_list();
  1044.     reset_pop_up_descriptions();
  1045.     dynamic_item_text_align_left = FALSE;
  1046. #ifdef __MMI_UI_HINTS_IN_MENUITEM__
  1047.     reset_all_force_flags_for_hints();
  1048. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1049.     gui_unblock_list_effect();
  1050. #endif 
  1051. #endif /* __MMI_UI_HINTS_IN_MENUITEM__ */ 
  1052. }
  1053. /*****************************************************************************
  1054. * Category 284
  1055. *****************************************************************************/
  1056. /*****************************************************************************
  1057.  * FUNCTION
  1058.  *  ShowCategory284Screen
  1059.  * DESCRIPTION
  1060.  *  
  1061.  * PARAMETERS
  1062.  *  title                   [IN]        
  1063.  *  title_icon              [IN]        
  1064.  *  left_softkey            [IN]        
  1065.  *  left_softkey_icon       [IN]        
  1066.  *  right_softkey           [IN]        
  1067.  *  right_softkey_icon      [IN]        
  1068.  *  number_of_items         [IN]        
  1069.  *  get_item_func           [IN]        
  1070.  *  get_hint_func           [IN]        
  1071.  *  highlighted_item        [IN]        
  1072.  *  history_buffer          [?]         
  1073.  * RETURNS
  1074.  *  void
  1075.  *****************************************************************************/
  1076. void ShowCategory284Screen(
  1077.         U16 title,
  1078.         U16 title_icon,
  1079.         U16 left_softkey,
  1080.         U16 left_softkey_icon,
  1081.         U16 right_softkey,
  1082.         U16 right_softkey_icon,
  1083.         S32 number_of_items,
  1084.         GetItemFuncPtr get_item_func,
  1085.         GetHintFuncPtr get_hint_func,
  1086.         S32 highlighted_item,
  1087.         U8 *history_buffer)
  1088. {
  1089.     /*----------------------------------------------------------------*/
  1090.     /* Local Variables                                                */
  1091.     /*----------------------------------------------------------------*/
  1092.     /*----------------------------------------------------------------*/
  1093.     /* Code Body                                                      */
  1094.     /*----------------------------------------------------------------*/
  1095.     dynamic_item_text_align_left = TRUE;
  1096.     ShowCategory184Screen(
  1097.         title,
  1098.         title_icon,
  1099.         left_softkey,
  1100.         left_softkey_icon,
  1101.         right_softkey,
  1102.         right_softkey_icon,
  1103.         number_of_items,
  1104.         get_item_func,
  1105.         get_hint_func,
  1106.         highlighted_item,
  1107.         history_buffer);
  1108. }
  1109. /*****************************************************************************
  1110. * Category 186
  1111. * Dynamic list menu supporting on/off toggling
  1112. *****************************************************************************/
  1113. /* Context of category 186 */
  1114. typedef struct
  1115. {
  1116.     /* Array of 0-1 states */
  1117.     U8 *states;
  1118.     /* callback function to get text  */
  1119.       pBOOL(*get_text_callback) (S32 item_index, UI_string_type str_buff);
  1120.     /* Whether data is modified */
  1121.     MMI_BOOL modified;
  1122. } wgui_cat186_context_struct;
  1123. /* Context pointer of category 186 */
  1124. static wgui_cat186_context_struct *wgui_cat186_p;
  1125. /* Function Pointer to save the extra LSK handler function for Category187 */
  1126. FuncPtr wgui_cat_187_lsk_handler = NULL;
  1127. /*****************************************************************************
  1128.  * FUNCTION
  1129.  *  Category186GetItem
  1130.  * DESCRIPTION
  1131.  *  Common dynamic item data callback for Category 186
  1132.  * PARAMETERS
  1133.  *  item_index          [IN]        Menu item index
  1134.  *  str_buff            [IN]        Text buffer
  1135.  *  img_buff_p          [IN]        Pointer to image buffer
  1136.  *  str_img_mask        [IN]        Mask (unused)
  1137.  * RETURNS
  1138.  *  pBOOL
  1139.  *****************************************************************************/
  1140. pBOOL Category186GetItem(S32 item_index, UI_string_type str_buff, PU8 *img_buff_p, U8 str_img_mask)
  1141. {
  1142.     /*----------------------------------------------------------------*/
  1143.     /* Local Variables                                                */
  1144.     /*----------------------------------------------------------------*/
  1145.     /*----------------------------------------------------------------*/
  1146.     /* Code Body                                                      */
  1147.     /*----------------------------------------------------------------*/
  1148.     MMI_ASSERT(wgui_cat186_p);
  1149.     UI_UNUSED_PARAMETER(str_img_mask);
  1150.     if (wgui_cat186_p->states[item_index])
  1151.     {
  1152.         *img_buff_p = get_image(CHECKBOX_ON_IMAGE_ID);
  1153.     }
  1154.     else
  1155.     {
  1156.         *img_buff_p = get_image(CHECKBOX_OFF_IMAGE_ID);
  1157.     }
  1158.     return wgui_cat186_p->get_text_callback(item_index, str_buff);
  1159. }
  1160. /*****************************************************************************
  1161.  * FUNCTION
  1162.  *  Category186ToggleCheckBox
  1163.  * DESCRIPTION
  1164.  *  Toggle on/off of the current highlighted checkbox
  1165.  * PARAMETERS
  1166.  *  void
  1167.  * RETURNS
  1168.  *  void
  1169.  *****************************************************************************/
  1170. void Category186ToggleCheckBox(void)
  1171. {
  1172.     /*----------------------------------------------------------------*/
  1173.     /* Local Variables                                                */
  1174.     /*----------------------------------------------------------------*/
  1175.     S32 index = GetHighlightedItem();
  1176.     U8 state;
  1177.     /*----------------------------------------------------------------*/
  1178.     /* Code Body                                                      */
  1179.     /*----------------------------------------------------------------*/
  1180.     MMI_ASSERT(wgui_cat186_p);
  1181.     if (wgui_cat186_p->states[index])
  1182.     {
  1183.         state = wgui_cat186_p->states[index] = 0;
  1184.     }
  1185.     else
  1186.     {
  1187.         state = wgui_cat186_p->states[index] = 1;
  1188.     }
  1189.     if (!wgui_cat186_p->modified)
  1190.     {
  1191.         wgui_cat186_p->modified = MMI_TRUE;
  1192.         ChangeRightSoftkey(WGUI_CATEGORY_DONE_STRING_ID, 0);
  1193.         set_right_softkey_function(checkbox_toggle_DONE_RSK_function, KEY_EVENT_UP);
  1194.     }
  1195.     /* Reload data & invoke list highlight handler */
  1196.     dynamic_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
  1197.     show_dynamic_list();
  1198.     
  1199.     if(wgui_cat_187_lsk_handler != NULL)
  1200.     {
  1201.         wgui_cat_187_lsk_handler();
  1202.     }
  1203. }
  1204. /*****************************************************************************
  1205.  * FUNCTION
  1206.  *  Category186ListHighlightHdlr
  1207.  * DESCRIPTION
  1208.  *  Exit category function for category 186
  1209.  * PARAMETERS
  1210.  *  item_index      [IN]        
  1211.  * RETURNS
  1212.  *  void
  1213.  *****************************************************************************/
  1214. void Category186ListHighlightHdlr(S32 item_index)
  1215. {
  1216.     /*----------------------------------------------------------------*/
  1217.     /* Local Variables                                                */
  1218.     /*----------------------------------------------------------------*/
  1219.     /*----------------------------------------------------------------*/
  1220.     /* Code Body                                                      */
  1221.     /*----------------------------------------------------------------*/
  1222.     MMI_ASSERT(wgui_cat186_p);
  1223.     if (wgui_cat186_p->states[item_index])
  1224.     {
  1225.         ChangeLeftSoftkey(WGUI_CATEGORY_OFF_STRING_ID, 0);
  1226.     }
  1227.     else
  1228.     {
  1229.         ChangeLeftSoftkey(WGUI_CATEGORY_ON_STRING_ID, 0);
  1230.     }
  1231.     dynamic_list_highlight_handler(item_index);
  1232. }
  1233. /*****************************************************************************
  1234.  * FUNCTION
  1235.  *  GetCategory186History
  1236.  * DESCRIPTION
  1237.  *  Get history data of category 186
  1238.  * PARAMETERS
  1239.  *  history_buffer      [IN]        Buffer to store history data
  1240.  * RETURNS
  1241.  *  void
  1242.  *****************************************************************************/
  1243. U8 *GetCategory186History(U8 *history_buffer)
  1244. {
  1245.     /*----------------------------------------------------------------*/
  1246.     /* Local Variables                                                */
  1247.     /*----------------------------------------------------------------*/
  1248.     /*----------------------------------------------------------------*/
  1249.     /* Code Body                                                      */
  1250.     /*----------------------------------------------------------------*/
  1251.     MMI_ASSERT(wgui_cat186_p);
  1252.     if (wgui_cat186_p->modified)
  1253.     {
  1254.         *((S32*) history_buffer) = 1;
  1255.     }
  1256.     else
  1257.     {
  1258.         *((S32*) history_buffer) = 0;
  1259.     }
  1260.     get_list_menu_category_history(MMI_CATEGORY186_ID, history_buffer + sizeof(S32));
  1261.     return history_buffer;
  1262. }
  1263. /*****************************************************************************
  1264.  * FUNCTION
  1265.  *  GetCategory186HistorySize
  1266.  * DESCRIPTION
  1267.  *  Get history data of category 186
  1268.  * PARAMETERS
  1269.  *  void
  1270.  * RETURNS
  1271.  *  
  1272.  *****************************************************************************/
  1273. S32 GetCategory186HistorySize(void)
  1274. {
  1275.     /*----------------------------------------------------------------*/
  1276.     /* Local Variables                                                */
  1277.     /*----------------------------------------------------------------*/
  1278.     /*----------------------------------------------------------------*/
  1279.     /* Code Body                                                      */
  1280.     /*----------------------------------------------------------------*/
  1281.     return sizeof(S32) + get_list_menu_category_history_size();
  1282. }
  1283. /*****************************************************************************
  1284.  * FUNCTION
  1285.  *  SetCategory186History
  1286.  * DESCRIPTION
  1287.  *  Set history data of category 186
  1288.  * PARAMETERS
  1289.  *  history_buffer      [IN]        Buffer to store history data
  1290.  * RETURNS
  1291.  *  Whether the operation succeeds
  1292.  *****************************************************************************/
  1293. U8 SetCategory186History(U8 *history_buffer)
  1294. {
  1295.     /*----------------------------------------------------------------*/
  1296.     /* Local Variables                                                */
  1297.     /*----------------------------------------------------------------*/
  1298.     /*----------------------------------------------------------------*/
  1299.     /* Code Body                                                      */
  1300.     /*----------------------------------------------------------------*/
  1301.     MMI_ASSERT(wgui_cat186_p);
  1302.     if (history_buffer)
  1303.     {
  1304.         if (*((S32*) history_buffer))
  1305.         {
  1306.             wgui_cat186_p->modified = MMI_TRUE;
  1307.         }
  1308.         else
  1309.         {
  1310.             wgui_cat186_p->modified = MMI_FALSE;
  1311.         }
  1312.         return set_list_menu_category_history(MMI_CATEGORY186_ID, history_buffer + sizeof(S32));
  1313.     }
  1314.     else
  1315.     {
  1316.         return 0;
  1317.     }
  1318. }
  1319. /*****************************************************************************
  1320.  * FUNCTION
  1321.  *  ExitCategory186Screen
  1322.  * DESCRIPTION
  1323.  *  Exit category function for category 186
  1324.  * PARAMETERS
  1325.  *  void
  1326.  * RETURNS
  1327.  *  void
  1328.  *****************************************************************************/
  1329. void ExitCategory186Screen(void)
  1330. {
  1331.     /*----------------------------------------------------------------*/
  1332.     /* Local Variables                                                */
  1333.     /*----------------------------------------------------------------*/
  1334.     /*----------------------------------------------------------------*/
  1335.     /* Code Body                                                      */
  1336.     /*----------------------------------------------------------------*/
  1337.     MMI_ASSERT(wgui_cat186_p);
  1338.     ExitCategory184Screen();
  1339.     OslMfree(wgui_cat186_p);
  1340.     wgui_cat186_p = NULL;
  1341. }
  1342. #ifdef __MMI_TOUCH_SCREEN__
  1343. /*****************************************************************************
  1344.  * FUNCTION
  1345.  *  Category186MenuItemTranslatePenEvent
  1346.  * DESCRIPTION
  1347.  *  Pen event handler for menu item because we want to emulate twostate menu item
  1348.  *  with icontext menu item
  1349.  *  
  1350.  *  Reference: gui_fixed_twostate_menuitem_translate_pen_event()
  1351.  * PARAMETERS
  1352.  *  item                    [?]         
  1353.  *  common_item_data        [?]         
  1354.  *  item_x                  [IN]        
  1355.  *  item_y                  [IN]        
  1356.  *  pen_event               [IN]        
  1357.  *  x                       [IN]        
  1358.  *  y                       [IN]        
  1359.  *  menuitem_event          [?]         
  1360.  *  menuitem_param          [?]         
  1361.  * RETURNS
  1362.  * BOOL
  1363.  *****************************************************************************/
  1364. BOOL Category186MenuItemTranslatePenEvent(
  1365.         void *item,
  1366.         void *common_item_data,
  1367.         S32 item_x,
  1368.         S32 item_y,
  1369.         mmi_pen_event_type_enum pen_event,
  1370.         S16 x,
  1371.         S16 y,
  1372.         gui_list_pen_enum *menuitem_event,
  1373.         gui_pen_event_param_struct *menuitem_param)
  1374. {
  1375.     /*----------------------------------------------------------------*/
  1376.     /* Local Variables                                                */
  1377.     /*----------------------------------------------------------------*/
  1378.     BOOL ret = MMI_TRUE, pen_inside = MMI_FALSE;
  1379.     S32 iwidth, iheight;
  1380.     fixed_icontext_menuitem *m = (fixed_icontext_menuitem*) common_item_data;
  1381.     /*----------------------------------------------------------------*/
  1382.     /* Code Body                                                      */
  1383.     /*----------------------------------------------------------------*/
  1384.     UI_UNUSED_PARAMETER(item);
  1385.     *menuitem_event = GUI_LIST_PEN_NONE;
  1386.     GUI_PEN_EVENT_PARAM_SET_VOID(menuitem_param);
  1387.     gui_measure_image((PU8) get_image(CHECKBOX_OFF_IMAGE_ID), &iwidth, &iheight);
  1388.     item_x += m->icon_x;
  1389.     item_y += m->icon_y;
  1390.     if (PEN_CHECK_BOUND(x, y, item_x, item_y, iwidth, iheight))
  1391.     {
  1392.         pen_inside = MMI_TRUE;
  1393.     }
  1394.     if (pen_event == MMI_PEN_EVENT_DOWN)
  1395.     {
  1396.         if (!pen_inside)
  1397.         {
  1398.             /* The following pen events will not be directed to twostate menuitem */
  1399.             ret = MMI_FALSE;
  1400.         }
  1401.     }
  1402.     else if (pen_event == MMI_PEN_EVENT_UP)
  1403.     {
  1404.         if (pen_inside)
  1405.         {
  1406.             /* Outside of the image, it is not controlled by menuitem */
  1407.             *menuitem_event = GUI_TWOSTATE_PEN_TOGGLE;
  1408.         }
  1409.     }
  1410.     return ret;
  1411. }
  1412. #endif /* __MMI_TOUCH_SCREEN__ */ 
  1413. /*****************************************************************************
  1414.  * FUNCTION
  1415.  *  ShowCategory186Screen
  1416.  * DESCRIPTION
  1417.  *  Displays the category186 screen. A dynamic menu handling on/off toggling.
  1418.  *  Use SetCheckboxToggleRightSoftkeyFunctions() *before* this function.
  1419.  *  
  1420.  *  Reference: ShowCategory185Screen(), ShowCategory140Screen()
  1421.  * PARAMETERS
  1422.  *  title                   [IN]        Title for the screen
  1423.  *  title_icon              [IN]        Icon shown with the title
  1424.  *  number_of_items         [IN]        Number of items to be displayed
  1425.  *  get_text_callback       [IN]        Callback function to get the text of menu item
  1426.  *  get_hint_func           [IN]        Function pointer to get next displayed hint data
  1427.  *  list_of_states          [IN]        On/off states
  1428.  *  highlighted_item        [IN]        Index of item to be highlighted
  1429.  *  history_buffer          [IN]        History buffer
  1430.  * RETURNS
  1431.  *  void
  1432.  *****************************************************************************/
  1433. void ShowCategory186Screen(
  1434.         U16 title,
  1435.         U16 title_icon,
  1436.         S32 number_of_items,
  1437.         pBOOL(*get_text_callback) (S32 item_index, UI_string_type str_buff),
  1438.         GetHintFuncPtr get_hint_func,
  1439.         U8 *list_of_states,
  1440.         S32 highlighted_item,
  1441.         U8 *history_buffer)
  1442. {
  1443.     /*----------------------------------------------------------------*/
  1444.     /* Local Variables                                                */
  1445.     /*----------------------------------------------------------------*/
  1446.     /*----------------------------------------------------------------*/
  1447.     /* Code Body                                                      */
  1448.     /*----------------------------------------------------------------*/
  1449. ShowCategory187Screen(
  1450.         title,
  1451.         title_icon,
  1452.         number_of_items,
  1453.         get_text_callback,
  1454.         get_hint_func,
  1455.         list_of_states,
  1456.         highlighted_item,
  1457. NULL,
  1458.         history_buffer);
  1459. }
  1460. /*****************************************************************************
  1461.  * FUNCTION
  1462.  *  ShowCategory187Screen
  1463.  * DESCRIPTION
  1464.  *  Displays the category187 screen. A dynamic menu handling on/off toggling.
  1465.  *  Use SetCheckboxToggleRightSoftkeyFunctions() *before* this function.
  1466.  *  
  1467.  *  Reference: ShowCategory185Screen(), ShowCategory140Screen()
  1468.  * PARAMETERS
  1469.  *  title                   [IN]        Title for the screen
  1470.  *  title_icon              [IN]        Icon shown with the title
  1471.  *  number_of_items         [IN]        Number of items to be displayed
  1472.  *  get_text_callback       [IN]        Callback function to get the text of menu item
  1473.  *  get_hint_func           [IN]        Function pointer to get next displayed hint data
  1474.  *  list_of_states          [IN]        On/off states
  1475.  *  highlighted_item        [IN]        Index of item to be highlighted
  1476.  *  lsk_handler_func        [IN]        This is an extra lsk handler.Needs to be registered to add extra functionality along with toggle.
  1477.  *  history_buffer          [IN]        History buffer
  1478.  * RETURNS
  1479.  *  void
  1480.  *****************************************************************************/
  1481. void ShowCategory187Screen(
  1482.         U16 title,
  1483.         U16 title_icon,
  1484.         S32 number_of_items,
  1485.         pBOOL(*get_text_callback) (S32 item_index, UI_string_type str_buff),
  1486.         GetHintFuncPtr get_hint_func,
  1487.         U8 *list_of_states,
  1488.         S32 highlighted_item,
  1489. FuncPtr lsk_handler_func,
  1490.         U8 *history_buffer)
  1491. {
  1492.     /*----------------------------------------------------------------*/
  1493.     /* Local Variables                                                */
  1494.     /*----------------------------------------------------------------*/
  1495.     dm_data_struct dm_data;
  1496.     S32 shortcut_width;
  1497.     U8 h_flag;
  1498.     /*----------------------------------------------------------------*/
  1499.     /* Code Body                                                      */
  1500.     /*----------------------------------------------------------------*/
  1501.     /* Setup context */
  1502.     if (!wgui_cat186_p)
  1503.     {
  1504.         wgui_cat186_p = OslMalloc(sizeof(wgui_cat186_context_struct));
  1505.     }
  1506.     wgui_cat186_p->get_text_callback = get_text_callback;
  1507.     wgui_cat186_p->states = list_of_states;
  1508.     wgui_cat186_p->modified = MMI_FALSE;
  1509.     /* Draw screen */
  1510.     gdi_layer_lock_frame_buffer();
  1511.     MMI_title_string = (UI_string_type) get_string(title);
  1512.     MMI_title_icon = (PU8) get_image(title_icon);
  1513.     MMI_menu_shortcut_number = -1;
  1514.     change_left_softkey(STR_GLOBAL_ON, 0);
  1515.     change_right_softkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  1516.     SetupCategoryKeyHandlers();
  1517.     create_fixed_icontext_menuitems();
  1518.     MMI_current_menu_type = LIST_MENU;
  1519.     resize_fixed_list(MMI_content_width, MMI_content_height);
  1520.     associate_fixed_icontext_list();
  1521. #ifdef __MMI_TOUCH_SCREEN__
  1522.     gui_set_fixed_list_menu_item_pen_function(
  1523.         &MMI_fixed_list_menu,
  1524.         Category186MenuItemTranslatePenEvent,
  1525.         MMI_FALSE,
  1526.         MMI_TRUE);
  1527. #endif /* __MMI_TOUCH_SCREEN__ */ 
  1528.     /* Since we need to change on/off image frequently */
  1529.     MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_CACHE_DYNAMIC_DATA;
  1530.     init_dynamic_item_buffer(number_of_items, Category186GetItem, get_hint_func, UI_dummy_function);
  1531.     MMI_fixed_list_menu.n_items = number_of_items;
  1532.     register_dynamic_list_shortcut_handler();
  1533.     register_dynamic_list_keys();
  1534.     shortcut_width = set_menu_item_count(number_of_items) + 7;
  1535.     resize_menu_shortcut_handler(shortcut_width, (MMI_title_height));
  1536.     move_menu_shortcut_handler(UI_device_width - MMI_menu_shortcut_box.width, MMI_title_y);
  1537.     register_hide_menu_shortcut(draw_title);
  1538.     resize_fixed_icontext_menuitems(0, MMI_MENUITEM_HEIGHT);
  1539.     set_fixed_icontext_positions(MMI_ICONTEXT_MENUITEM_HEIGHT + 2, 0, 1, 0);
  1540.     register_fixed_list_highlight_handler(Category186ListHighlightHdlr);
  1541.     h_flag = SetCategory186History(history_buffer);
  1542. #ifdef __MMI_UI_HINTS_IN_MENUITEM__
  1543.     if (get_hint_func)
  1544.     {
  1545.         if (is_set_force_icon_on_highlight_only_in_menuitem())
  1546.         {
  1547.             wgui_show_icon_only_highlight_in_icontext_menuitem();
  1548.         }
  1549.         if (is_set_force_all_hints_in_menuitem())
  1550.         {
  1551.             wgui_enable_hints_in_icontext_menuitem();
  1552.         }
  1553.         else if (is_set_force_hints_on_highlight_in_menuitem())
  1554.         {
  1555.             wgui_enable_hint_highlight_in_icontext_menuitem();
  1556.         }
  1557.         else
  1558.         {
  1559.             wgui_enable_hint_highlight_in_icontext_menuitem();
  1560.         }
  1561.         set_dynamic_pop_up_descriptions(h_flag ? MMI_fixed_list_menu.highlighted_item : highlighted_item);      /* ????? */
  1562.     #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1563.         gui_block_list_effect();
  1564.     #endif 
  1565.     }
  1566. #endif /* __MMI_UI_HINTS_IN_MENUITEM__ */ 
  1567.     if(lsk_handler_func != NULL)
  1568.     {
  1569.         wgui_cat_187_lsk_handler = lsk_handler_func;
  1570.     }
  1571.     else
  1572.     {
  1573.         wgui_cat_187_lsk_handler = NULL;
  1574.     }
  1575.     set_left_softkey_function(Category186ToggleCheckBox, KEY_EVENT_UP);
  1576.     if (wgui_cat186_p->modified)
  1577.     {
  1578.         ChangeRightSoftkey(WGUI_CATEGORY_DONE_STRING_ID, 0);
  1579.         set_right_softkey_function(checkbox_toggle_DONE_RSK_function, KEY_EVENT_UP);
  1580.     }
  1581.     else
  1582.     {
  1583.         ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  1584.         set_right_softkey_function(checkbox_toggle_BACK_RSK_function, KEY_EVENT_UP);
  1585.     }
  1586.     dynamic_list_goto_item_no_redraw(h_flag ? MMI_fixed_list_menu.highlighted_item : highlighted_item);
  1587.     set_dynamic_pop_up_descriptions(h_flag ? MMI_fixed_list_menu.highlighted_item : highlighted_item);  /* ????? */
  1588.     gdi_layer_unlock_frame_buffer();
  1589.     ExitCategoryFunction = ExitCategory186Screen;
  1590.     dm_setup_category_functions(dm_redraw_category_screen, GetCategory186History, GetCategory186HistorySize);
  1591.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  1592.     dm_data.s32CatId = MMI_CATEGORY186_ID;
  1593.     dm_data.s32flags = 0;
  1594.     dm_setup_data(&dm_data);
  1595.     dm_redraw_category_screen();
  1596. }
  1597. /*****************************************************************************
  1598. * Category 84
  1599. *****************************************************************************/
  1600. /*****************************************************************************
  1601.  * FUNCTION
  1602.  *  ShowCategory84Screen
  1603.  * DESCRIPTION
  1604.  *  Displays the category84 screen
  1605.  * PARAMETERS
  1606.  *  title                   [IN]        Title for the screen
  1607.  *  title_icon              [IN]        Icon shown with the title
  1608.  *  left_softkey            [IN]        Left softkey label
  1609.  *  left_softkey_icon       [IN]        Icon for the Left softkey
  1610.  *  right_softkey           [IN]        Right softkey label
  1611.  *  right_softkey_icon      [IN]        Icon for the right softkey
  1612.  *  number_of_items         [IN]        Number of items to be displayed
  1613.  *  list_of_items           [IN]        Array of items to be displayed.
  1614.  *  list_of_icons           [IN]        Array of icons to be displayed.
  1615.  *  flags                   [IN]        Represent the type of the menu. LIST_MENU, MATRIX_MENU
  1616.  *  highlighted_item        [IN]        Index of item to be highlighted
  1617.  *  history_buffer          [IN]        History buffer
  1618.  *  Values allowed for these 8 bits are:(?)
  1619.  * RETURNS
  1620.  *  void
  1621.  *****************************************************************************/
  1622. void ShowCategory84Screen(
  1623.         U16 title,
  1624.         U16 title_icon,
  1625.         U16 left_softkey,
  1626.         U16 left_softkey_icon,
  1627.         U16 right_softkey,
  1628.         U16 right_softkey_icon,
  1629.         S32 number_of_items,
  1630.         U8 **list_of_items,
  1631.         U16 *list_of_icons,
  1632.         S32 flags,
  1633.         S32 highlighted_item,
  1634.         U8 *history_buffer)
  1635. {
  1636.     /*----------------------------------------------------------------*/
  1637.     /* Local Variables                                                */
  1638.     /*----------------------------------------------------------------*/
  1639.     dm_data_struct dm_data;
  1640.     S32 i;
  1641.     U8 h_flag, mm_bg_flags;
  1642.     /*----------------------------------------------------------------*/
  1643.     /* Code Body                                                      */
  1644.     /*----------------------------------------------------------------*/
  1645.     gdi_layer_lock_frame_buffer();
  1646.     create_fixed_icontext_menuitems();
  1647.     associate_fixed_icontext_list();
  1648. MMI_disable_title_shortcut_display = 1;
  1649. MMI_fixed_list_menu.flags |= UI_LIST_MENU_LOOP | UI_LIST_MENU_DISABLE_BACKGROUND | UI_LIST_MENU_DISABLE_BKGRND_IN_LAYER;
  1650.                 
  1651.     ShowListCategoryScreen(
  1652.         get_string(title),
  1653.         get_image(title_icon),
  1654.         get_string(left_softkey),
  1655.         get_image(left_softkey_icon),
  1656.         get_string(right_softkey),
  1657.         get_image(right_softkey_icon),
  1658.         number_of_items);
  1659.     for (i = 0; i < number_of_items; i++)
  1660.     {
  1661.         add_fixed_icontext_item((UI_string_type) list_of_items[i], wgui_get_list_menu_icon(i, list_of_icons[i]));
  1662.     }
  1663.     resize_fixed_icontext_menuitems(0, MMI_MENUITEM_HEIGHT);
  1664.     set_fixed_icontext_positions(MMI_ICONTEXT_MENUITEM_HEIGHT + 2, 0, 1, 0);
  1665.     MMI_current_menu_type = LIST_MENU;
  1666.     h_flag = set_list_menu_category_history(MMI_CATEGORY84_ID, history_buffer);
  1667.     if (h_flag)
  1668.     {
  1669.         fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
  1670.     }
  1671.     else
  1672.     {
  1673.         fixed_list_goto_item_no_redraw(highlighted_item);
  1674.     }
  1675.     gdi_layer_unlock_frame_buffer();
  1676. dm_set_scr_bg_image(IMG_GLOBAL_SUB_MENU_BG_2, NULL, -1, -1, current_MMI_theme->bg_opacity_full);
  1677. dm_get_scr_bg_flag(&mm_bg_flags);
  1678. dm_set_scr_bg_flag(mm_bg_flags | DM_SCR_BG_FORCE_SHOW);
  1679.     ExitCategoryFunction = ExitListCategoryScreen;
  1680.     dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  1681.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  1682.     dm_data.s32CatId = MMI_CATEGORY84_ID;
  1683.     dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND | DM_NO_STATUS_BAR;;
  1684.     dm_setup_data(&dm_data);
  1685.     dm_redraw_category_screen();
  1686. }   /* end of ShowCategory84Screen */
  1687. /*****************************************************************************
  1688.  * FUNCTION
  1689.  *  SetCategory111RightSoftkeyFunction
  1690.  * DESCRIPTION
  1691.  *  Register RSK function handler of category111 screen
  1692.  * PARAMETERS
  1693.  *  f               [IN]        
  1694.  *  k               [IN]        
  1695.  *  function(?)     [IN]        Pointer
  1696.  * RETURNS
  1697.  *  void
  1698.  *****************************************************************************/
  1699. void SetCategory111RightSoftkeyFunction(void (*f) (void), MMI_key_event_type k)
  1700. {
  1701.     /*----------------------------------------------------------------*/
  1702.     /* Local Variables                                                */
  1703.     /*----------------------------------------------------------------*/
  1704.     /*----------------------------------------------------------------*/
  1705.     /* Code Body                                                      */
  1706.     /*----------------------------------------------------------------*/
  1707.     UI_UNUSED_PARAMETER(k);
  1708.     wgui_singleline_inputbox_RSK_function = f;
  1709. }
  1710. /* filled colr scheme for category111 */
  1711. UI_filled_area PIN_inputbox_BG_filler = 
  1712. {
  1713.     UI_FILLED_AREA_TYPE_COLOR | UI_FILLED_AREA_SINGLE_BORDER | UI_FILLED_AREA_SHADOW,
  1714.     UI_NULL_IMAGE,
  1715.     NULL,
  1716.     {255, 222, 255, 100},
  1717.     {0, 0, 0, 0},
  1718.     {255, 0, 0, 100},
  1719.     {255, 0, 0, 100},
  1720.     0
  1721. };
  1722. /* theme of single input box of enter pin screen */
  1723. UI_single_line_input_box_theme PIN_singleline_inputbox_theme = { &PIN_inputbox_BG_filler,
  1724.     &PIN_inputbox_BG_filler,
  1725.     &PIN_inputbox_BG_filler,
  1726.     {0, 0, 0, 100},
  1727.     {128, 128, 128, 100},
  1728.     {0, 0, 0, 100},
  1729.     {255, 255, 255, 100},
  1730.     {51, 88, 171, 100},
  1731.     {255, 0, 0, 100},
  1732.     &UI_DEFAULT_FONT,
  1733.     1,
  1734.     UI_SINGLE_LINE_INPUT_BOX_CENTER_Y,
  1735.     '*'
  1736. };
  1737. #ifdef __MMI_TOUCH_SCREEN__
  1738. S32 passwd_keybd_width;
  1739. S32 passwd_keybd_height;
  1740. /*****************************************************************************
  1741.  * FUNCTION
  1742.  *  DrawCate111CategoryControlArea
  1743.  * DESCRIPTION
  1744.  *  Draws the category111 category control area
  1745.  * PARAMETERS
  1746.  *  coordinate      [IN/OUT]        Coordinates of category controlled area.
  1747.  * RETURNS
  1748.  *  void
  1749.  *****************************************************************************/
  1750. void DrawCate111CategoryControlArea(dm_coordinates *coordinate)
  1751. {
  1752.     /*----------------------------------------------------------------*/
  1753.     /* Local Variables                                                */
  1754.     /*----------------------------------------------------------------*/
  1755.     S32 passwd_keybd_start_x = 0, passwd_keybd_start_y = 0;
  1756.     /*----------------------------------------------------------------*/
  1757.     /* Code Body                                                      */
  1758.     /*----------------------------------------------------------------*/
  1759.     gdi_image_get_dimension_id(IMG_PASSWD_KEYBOARD, &passwd_keybd_width, &passwd_keybd_height);
  1760.     passwd_keybd_start_x = (UI_device_width - passwd_keybd_width) >> 1;
  1761.     passwd_keybd_start_y = UI_device_height - MMI_button_bar_height - 1 - passwd_keybd_height;
  1762.     gdi_image_draw(passwd_keybd_start_x, passwd_keybd_start_y, get_image(IMG_PASSWD_KEYBOARD));
  1763. }
  1764. /*****************************************************************************
  1765.  * FUNCTION
  1766.  *  Cate111CategoryControlAreaPenDownHandler
  1767.  * DESCRIPTION
  1768.  *  
  1769.  * PARAMETERS
  1770.  *  point       [IN]        
  1771.  * RETURNS
  1772.  *  
  1773.  *****************************************************************************/
  1774. MMI_BOOL Cate111CategoryControlAreaPenDownHandler(mmi_pen_point_struct point)
  1775. {
  1776.     /*----------------------------------------------------------------*/
  1777.     /* Local Variables                                                */
  1778.     /*----------------------------------------------------------------*/
  1779.     S32 key_number = -1;
  1780.     S32 passwd_keybd_start_x = (UI_device_width - passwd_keybd_width) >> 1;
  1781.     S32 passwd_keybd_start_y = UI_device_height - MMI_button_bar_height - 1 - passwd_keybd_height;
  1782.     S32 offset_x = point.x - passwd_keybd_start_x;
  1783.     S32 offset_y = point.y - passwd_keybd_start_y;
  1784.     S32 pressed_area_x1 = 0, pressed_area_x2 = 0;
  1785.     S32 pressed_area_y1 = 0, pressed_area_y2 = 0;
  1786.     /*----------------------------------------------------------------*/
  1787.     /* Code Body                                                      */
  1788.     /*----------------------------------------------------------------*/
  1789.     if (MMI_singleline_inputbox.text_length >= MMI_singleline_inputbox.available_length)
  1790.     {
  1791.         return MMI_FALSE;
  1792.     }
  1793.     if (offset_x < 0 || offset_y < 0 || offset_x >= passwd_keybd_width || offset_y >= passwd_keybd_height)
  1794.     {
  1795.         return MMI_FALSE;
  1796.     }
  1797.     gdi_layer_lock_frame_buffer();
  1798.     if (offset_x == passwd_keybd_width - 1)
  1799.     {
  1800.         key_number = 4;
  1801.     }
  1802.     else
  1803.     {
  1804.         key_number = offset_x / (passwd_keybd_width / 5);
  1805.     }
  1806.     if (offset_y > (passwd_keybd_height >> 1))
  1807.     {
  1808.         key_number += 5;
  1809.     }
  1810.     if (key_number < 5)
  1811.     {
  1812.         pressed_area_x1 = passwd_keybd_start_x + key_number * (passwd_keybd_width / 5);
  1813.         pressed_area_x2 = passwd_keybd_start_x + (key_number + 1) * (passwd_keybd_width / 5);
  1814.         pressed_area_y1 = passwd_keybd_start_y;
  1815.         pressed_area_y2 = passwd_keybd_start_y + (passwd_keybd_height >> 1);
  1816.     }
  1817.     else
  1818.     {
  1819.         pressed_area_x1 = passwd_keybd_start_x + (key_number - 5) * (passwd_keybd_width / 5);
  1820.         pressed_area_x2 = passwd_keybd_start_x + (key_number - 5 + 1) * (passwd_keybd_width / 5);
  1821.         pressed_area_y1 = passwd_keybd_start_y + (passwd_keybd_height >> 1);
  1822.         pressed_area_y2 = passwd_keybd_start_y + passwd_keybd_height;
  1823.     }
  1824.     gdi_layer_push_clip();
  1825.     gdi_layer_set_clip(pressed_area_x1, pressed_area_y1, pressed_area_x2, pressed_area_y2);
  1826.     gdi_image_draw(passwd_keybd_start_x, passwd_keybd_start_y, get_image(IMG_PASSWD_KEYBOARD_PRESS));
  1827.     gdi_layer_pop_clip();
  1828.     gdi_layer_unlock_frame_buffer();
  1829.     gdi_layer_blt_previous(pressed_area_x1, pressed_area_y1, pressed_area_x2, pressed_area_y2);
  1830.     singleline_inputbox_handle_key_down(KEY_0 + key_number);
  1831.     return MMI_TRUE;
  1832. }
  1833. /*****************************************************************************
  1834.  * FUNCTION
  1835.  *  Cate111CategoryControlAreaPenUpHandler
  1836.  * DESCRIPTION
  1837.  *  
  1838.  * PARAMETERS
  1839.  *  point       [IN]        
  1840.  * RETURNS
  1841.  *  
  1842.  *****************************************************************************/
  1843. MMI_BOOL Cate111CategoryControlAreaPenUpHandler(mmi_pen_point_struct point)
  1844. {
  1845.     /*----------------------------------------------------------------*/
  1846.     /* Local Variables                                                */
  1847.     /*----------------------------------------------------------------*/
  1848.     S32 passwd_keybd_start_x = (UI_device_width - passwd_keybd_width) >> 1;
  1849.     S32 passwd_keybd_start_y = UI_device_height - MMI_button_bar_height - 1 - passwd_keybd_height;
  1850.     /*----------------------------------------------------------------*/
  1851.     /* Code Body                                                      */
  1852.     /*----------------------------------------------------------------*/
  1853.     if (MMI_singleline_inputbox.text_length > MMI_singleline_inputbox.available_length)
  1854.     {
  1855.         return MMI_FALSE;
  1856.     }
  1857.     gdi_layer_lock_frame_buffer();
  1858.     gdi_layer_push_clip();
  1859.     gdi_layer_set_clip(
  1860.         passwd_keybd_start_x,
  1861.         passwd_keybd_start_y,
  1862.         passwd_keybd_start_x + passwd_keybd_width,
  1863.         passwd_keybd_start_y + passwd_keybd_height);
  1864.     gdi_image_draw(passwd_keybd_start_x, passwd_keybd_start_y, get_image(IMG_PASSWD_KEYBOARD));
  1865.     gdi_layer_pop_clip();
  1866.     gdi_layer_unlock_frame_buffer();
  1867.     gdi_layer_blt_previous(
  1868.         passwd_keybd_start_x,
  1869.         passwd_keybd_start_y,
  1870.         passwd_keybd_start_x + passwd_keybd_width,
  1871.         passwd_keybd_start_y + passwd_keybd_height);
  1872.     return MMI_TRUE;
  1873. }
  1874. #endif /* __MMI_TOUCH_SCREEN__ */ 
  1875. /* START VIJAY PMT 20050930 */
  1876. #ifdef UI_SMALL_PIN_EDITOR_SCREEN
  1877. UI_filled_area small_pin_editor_background_filler;
  1878. /*****************************************************************************
  1879.  * FUNCTION
  1880.  *  cat112_virtual_keypad_callback
  1881.  * DESCRIPTION
  1882.  *  
  1883.  * PARAMETERS
  1884.  *  void
  1885.  * RETURNS
  1886.  *  void
  1887.  *****************************************************************************/
  1888. void cat112_virtual_keypad_callback(void)
  1889. {
  1890.     /*----------------------------------------------------------------*/
  1891.     /* Local Variables                                                */
  1892.     /*----------------------------------------------------------------*/
  1893.     /*----------------------------------------------------------------*/
  1894.     /* Code Body                                                      */
  1895.     /*----------------------------------------------------------------*/
  1896. #if defined(__MMI_TOUCH_SCREEN__)
  1897.     mmi_pen_editor_resize_multiline_input_box_for_vk();
  1898. #endif 
  1899. }
  1900. /*****************************************************************************
  1901.  * FUNCTION
  1902.  *  ShowCategory112Screen
  1903.  * DESCRIPTION
  1904.  *  Displays the category112 screen:- main used for enter pin screen
  1905.  * PARAMETERS
  1906.  *  left_softkey            [IN]        Left softkey label
  1907.  *  left_softkey_icon       [IN]        Icon for the Left softkey
  1908.  *  right_softkey           [IN]        Right softkey label
  1909.  *  right_softkey_icon      [IN]        Icon for the right softkey
  1910.  *  message                 [IN]        Message
  1911.  *  input_type              [IN]        Type of input to use (See the list below)
  1912.  *  buffer                  [IN]        Buffer the input box should use.
  1913.  *  buffer_size             [IN]        Size of the buffer.
  1914.  *  message2                [?]         
  1915.  *  history_buffer          [IN]        History buffer INPUT_TYPE_NUMERIC INPUT_TYPE_ALPHANUMERIC_UPPERCASE INPUT_TYPE_ALPHANUMERIC_LOWERCASE INPUT_TYPE_ALPHANUMERIC_SENTENCECASE INPUT_TYPE_NUMERIC_PASSWORD INPUT_TYPE_ALPHANUMERIC_PASSWORD (rare).
  1916.  *  title_icon(?)           [IN]        Icon shown with the title
  1917.  *  title(?)                [IN]        Title for the screen
  1918.  *  INPUT_TYPE can take the following values:(?)
  1919.  * RETURNS
  1920.  *  void
  1921.  *****************************************************************************/
  1922. void ShowCategory112Screen(
  1923.         U16 left_softkey,
  1924.         U16 left_softkey_icon,
  1925.         U16 right_softkey,
  1926.         U16 right_softkey_icon,
  1927.         U8 *message,
  1928.         S16 input_type,
  1929.         U8 *buffer,
  1930.         S32 buffer_size,
  1931.         U8 *message2,
  1932.         U8 *history_buffer)
  1933. {
  1934.     /*----------------------------------------------------------------*/
  1935.     /* Local Variables                                                */
  1936.     /*----------------------------------------------------------------*/
  1937.     dm_data_struct dm_data;
  1938.     color c = *(current_MMI_theme->UI_black_color);
  1939.     S32 len;
  1940.     S32 single_line_inputbox_height = 22;
  1941.     S32 dialog_width = 0, dialog_height = 0, dialog_x = 0, dialog_y = 0;
  1942.     /*----------------------------------------------------------------*/
  1943.     /* Code Body                                                      */
  1944.     /*----------------------------------------------------------------*/
  1945.     gdi_layer_lock_frame_buffer();
  1946. #ifdef __MMI_ZI__
  1947.     ZiInuptMethodEnterSinglelineInputBox();
  1948. #endif 
  1949. #ifdef __MMI_UI_SMALL_SCREEN_SUPPORT__
  1950.     set_small_screen();
  1951.     /* START VIJAY PMT 20051202 */
  1952.     gui_add_cleanup_hook(disable_resized_small_screen);
  1953.     /* END VIJAY PMT 20051202 */
  1954. #endif /* __MMI_UI_SMALL_SCREEN_SUPPORT__ */ 
  1955.     hide_status_icon_bar(0);//052906 early status icon
  1956.     dialog_height =
  1957.         UI_device_height - (MMI_title_y + MMI_title_height + 2 * MMI_SMALL_SCREEN_Y_OFFSET + MMI_button_bar_height);
  1958.     dialog_width = UI_device_width - 2 * MMI_SMALL_SCREEN_X_OFFSET;
  1959.     dialog_x = MMI_SMALL_SCREEN_X_OFFSET;
  1960.     dialog_y = MMI_title_y + MMI_title_height + MMI_SMALL_SCREEN_Y_OFFSET;
  1961.     MMI_menu_shortcut_number = -1;
  1962.     MMI_disable_title_shortcut_display = 1;
  1963.     SetupCategoryKeyHandlers();
  1964.     change_left_softkey(left_softkey, left_softkey_icon);
  1965.     change_right_softkey(right_softkey, right_softkey_icon);
  1966.     MMI_message_string = (UI_string_type) message;
  1967.     len = gui_strlen(MMI_message_string);
  1968.     create_multiline_inputbox_set_buffer(MMI_message_string, len, len, 0);
  1969.     small_pin_editor_background_filler = *current_MMI_theme->PIN_screen_background_filler;
  1970.     small_pin_editor_background_filler.flags =
  1971.         UI_FILLED_AREA_TYPE_COLOR | UI_FILLED_AREA_SINGLE_BORDER | UI_FILLED_AREA_ROUNDED_BORDER;
  1972.     MMI_multiline_inputbox.flags |=
  1973.         UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW /*| UI_MULTI_LINE_INPUT_BOX_CENTER_JUSTIFY */|//081206 enter pin
  1974.         UI_MULTI_LINE_INPUT_BOX_DISABLE_BACKGROUND | UI_MULTI_LINE_INPUT_BOX_DISABLE_SCROLLBAR |
  1975.         UI_MULTI_LINE_INPUT_BOX_VIEW_MODE;
  1976.     dm_add_string((UI_string_type) message2, &MMI_medium_font, UI_COLOR_BLACK, UI_COLOR_BLACK, NULL);
  1977.     dm_data.s32flags = DM_NO_FLAGS;
  1978.     wgui_setup_singleline_inputbox(
  1979.         dialog_x + 4,
  1980.         MMI_multiline_inputbox.y + MMI_multiline_inputbox.height,
  1981.         dialog_width - 8,
  1982.         single_line_inputbox_height,
  1983.         buffer,
  1984.         buffer_size,
  1985.         MMI_CATEGORY112_ID,
  1986.         get_string(right_softkey),
  1987.         get_image(right_softkey_icon),
  1988.         input_type,
  1989.         history_buffer,
  1990.         0);
  1991.     gui_set_single_line_input_box_theme(&MMI_singleline_inputbox, &PIN_singleline_inputbox_theme);
  1992.     register_hide_multitap(wgui_hide_multitap);
  1993.     gdi_layer_unlock_frame_buffer();
  1994.     ExitCategoryFunction = ExitCategory112Screen;
  1995.     dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  1996.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  1997.     dm_data.s32CatId = MMI_CATEGORY112_ID;
  1998.     dm_data.s32flags |= DM_SHOW_VKPAD;
  1999.     dm_add_back_fill_area(&small_pin_editor_background_filler);
  2000.     dm_add_rectangle(c, DM_RECTANGLE_FILL_GRAYSCALE);
  2001.     dm_setup_data(&dm_data);
  2002.     dm_register_vkpad_callback(cat112_virtual_keypad_callback);
  2003.     dm_redraw_category_screen();
  2004. }   /* end of ShowCategory112Screen */
  2005. /*****************************************************************************
  2006.  * FUNCTION
  2007.  *  ExitCategory112Screen
  2008.  * DESCRIPTION
  2009.  *  Exits category 182 screen
  2010.  * PARAMETERS
  2011.  *  void
  2012.  * RETURNS
  2013.  *  void
  2014.  *****************************************************************************/
  2015. void ExitCategory112Screen(void)
  2016. {
  2017.     /*----------------------------------------------------------------*/
  2018.     /* Local Variables                                                */
  2019.     /*----------------------------------------------------------------*/
  2020.     /*----------------------------------------------------------------*/
  2021.     /* Code Body                                                      */
  2022.     /*----------------------------------------------------------------*/
  2023. #ifdef __MMI_UI_SMALL_SCREEN_SUPPORT__
  2024.     reset_small_screen();
  2025. #endif 
  2026.     show_status_icon_bar(0);//052906 early status icon
  2027.     reset_multiline_inputbox();
  2028.     set_MMI_current_input_type();
  2029.     reset_softkeys();
  2030.     reset_multitaps();
  2031.     ExitCategoryFunction = MMI_dummy_function;
  2032.     RedrawCategoryFunction = MMI_dummy_function;
  2033.     GetCategoryHistory = dummy_get_history;
  2034.     GetCategoryHistorySize = dummy_get_history_size;
  2035.     gui_set_single_line_input_box_current_theme(&MMI_singleline_inputbox);
  2036.     wgui_close_singleline_inputbox();
  2037.     entry_full_screen();
  2038. }
  2039. #endif /* UI_SMALL_PIN_EDITOR_SCREEN */ 
  2040. /* END VIJAY PMT 20050930 */
  2041. /* 011706 countdown Calvin Start */
  2042. S32 Cat111CountDownValue;
  2043. FuncPtr Cat111TimerExpireCallBack = UI_dummy_function;
  2044. UI_filled_area pin_editor_background_filler;//083106 pin editor
  2045. /*****************************************************************************
  2046.  * FUNCTION
  2047.  *  SetCat111TimerExpireFunc
  2048.  * DESCRIPTION
  2049.  *  Set cat 111 countdown callback function
  2050.  * PARAMETERS
  2051.  *  f       [IN]        
  2052.  * RETURNS
  2053.  *  void
  2054.  *****************************************************************************/
  2055. void SetCat111TimerExpireFunc(FuncPtr f)
  2056. {
  2057.     /*----------------------------------------------------------------*/
  2058.     /* Local Variables                                                */
  2059.     /*----------------------------------------------------------------*/
  2060.     /*----------------------------------------------------------------*/
  2061.     /* Code Body                                                      */
  2062.     /*----------------------------------------------------------------*/
  2063.     Cat111TimerExpireCallBack = f;
  2064. }
  2065. /*****************************************************************************
  2066.  * FUNCTION
  2067.  *  Cat111CountDownCallBack
  2068.  * DESCRIPTION
  2069.  *  cat 111 countdown callback function
  2070.  * PARAMETERS
  2071.  *  void
  2072.  * RETURNS
  2073.  *  void
  2074.  *****************************************************************************/
  2075. extern UI_font_type UI_font;
  2076. extern color UI_text_color;
  2077. void Cat111CountDownCallBack(void)
  2078. {
  2079.     /*----------------------------------------------------------------*/
  2080.     /* Local Variables                                                */
  2081.     /*----------------------------------------------------------------*/
  2082.     U8 buf[6];
  2083.     UI_font_type saved_font = UI_font;
  2084.     color saved_color = UI_text_color;
  2085.     S32 count_y;
  2086.     S32 sw, sh;
  2087.     /*----------------------------------------------------------------*/
  2088.     /* Code Body                                                      */
  2089.     /*----------------------------------------------------------------*/
  2090.     if (Cat111CountDownValue == 0)
  2091.     {
  2092.         StopTimer(POPUP_TIMER);
  2093.         if (Cat111TimerExpireCallBack != NULL)
  2094.         {
  2095.             Cat111TimerExpireCallBack();
  2096.         }
  2097.         Cat111TimerExpireCallBack = UI_dummy_function;
  2098.     }
  2099.     else
  2100.     {
  2101.         gui_itoa(Cat111CountDownValue, (UI_string_type) buf, 10);
  2102.         gui_set_font(&MMI_medium_font);
  2103.         gui_set_text_color(UI_COLOR_BLACK);
  2104.         gui_measure_string((UI_string_type) buf, &sw, &sh);
  2105.     #ifdef __MMI_TOUCH_SCREEN__
  2106.         count_y = UI_device_height - MMI_button_bar_height - passwd_keybd_height - sh - (UI_device_height / 10);
  2107.     #else 
  2108.         count_y = UI_device_height - MMI_button_bar_height - sh - 1;
  2109.     #endif 
  2110.         gdi_layer_push_clip();
  2111.     
  2112.     #if (defined (__MMI_MAINLCD_176X220__)) || (defined (__MMI_MAINLCD_240X320__))//083106 pin editor
  2113.         if (wgui_is_wallpaper_on_bottom())
  2114.         {
  2115.             gdi_draw_solid_rect(0, count_y, UI_device_width - 1, count_y + sh - 1, GDI_COLOR_TRANSPARENT);
  2116.         }
  2117.         else
  2118.         {
  2119.             gdi_draw_solid_rect(0, count_y, UI_device_width - 1, count_y + sh - 1, GDI_COLOR_WHITE);
  2120.         }
  2121.     #else
  2122.         gui_draw_filled_area(0, count_y, UI_device_width - 1, count_y + sh - 1, &pin_editor_background_filler);
  2123.     #endif
  2124.         gui_move_text_cursor((UI_device_width - sw) >> 1, count_y);
  2125.         gui_print_text((UI_string_type) buf);
  2126.         gdi_layer_pop_clip();
  2127.         gui_BLT_double_buffer(0, count_y, UI_device_width - 1, count_y + sh - 1);
  2128.         gui_set_font(saved_font);
  2129.         gui_set_text_color(saved_color);
  2130.         Cat111CountDownValue--;
  2131.         StartTimer(POPUP_TIMER, 1000, Cat111CountDownCallBack);
  2132.     }
  2133. }
  2134. /* 011706 countdown Calvin End */
  2135. /*****************************************************************************
  2136.  * FUNCTION
  2137.  *  ShowCategory111Screen
  2138.  * DESCRIPTION
  2139.  *  Displays the category111 screen:- main used for enter pin screen
  2140.  * PARAMETERS
  2141.  *  left_softkey            [IN]        Left softkey label
  2142.  *  left_softkey_icon       [IN]        Icon for the Left softkey
  2143.  *  right_softkey           [IN]        Right softkey label
  2144.  *  right_softkey_icon      [IN]        Icon for the right softkey
  2145.  *  message                 [IN]        Message
  2146.  *  input_type              [IN]        Type of input to use (See the list below)
  2147.  *  buffer                  [IN]        Buffer the input box should use.
  2148.  *  buffer_size             [IN]        Size of the buffer.
  2149.  *  message2                [?]         
  2150.  *  history_buffer          [IN]        History buffer INPUT_TYPE_NUMERIC INPUT_TYPE_ALPHANUMERIC_UPPERCASE INPUT_TYPE_ALPHANUMERIC_LOWERCASE INPUT_TYPE_ALPHANUMERIC_SENTENCECASE INPUT_TYPE_NUMERIC_PASSWORD INPUT_TYPE_ALPHANUMERIC_PASSWORD (rare).
  2151.  *  title_icon(?)           [IN]        Icon shown with the title
  2152.  *  title(?)                [IN]        Title for the screen
  2153.  *  INPUT_TYPE can take the following values:(?)
  2154.  * RETURNS
  2155.  *  void
  2156.  *****************************************************************************/
  2157. /* 011706 countdown Calvin Start */
  2158. void ShowCategory111Screen(
  2159.         U16 left_softkey,
  2160.         U16 left_softkey_icon,
  2161.         U16 right_softkey,
  2162.         U16 right_softkey_icon,
  2163.         U16 message,
  2164.         S16 input_type,
  2165.         U8 *buffer,
  2166.         S32 buffer_size,
  2167.         U8 *message2,
  2168.         U8 *history_buffer)
  2169. {
  2170.     /*----------------------------------------------------------------*/
  2171.     /* Local Variables                                                */
  2172.     /*----------------------------------------------------------------*/
  2173.     /*----------------------------------------------------------------*/
  2174.     /* Code Body                                                      */
  2175.     /*----------------------------------------------------------------*/
  2176.     ShowCategory111Screen_ext(
  2177.         left_softkey,
  2178.         left_softkey_icon,
  2179.         right_softkey,
  2180.         right_softkey_icon,
  2181.         (U8*) get_string(message),
  2182.         input_type,
  2183.         buffer,
  2184.         buffer_size,
  2185.         message2,
  2186.         0,
  2187.         history_buffer);
  2188. }
  2189. /*****************************************************************************
  2190.  * FUNCTION
  2191.  *  ShowCategory111Screen_ext
  2192.  * DESCRIPTION
  2193.  *  
  2194.  * PARAMETERS
  2195.  *  left_softkey            [IN]        
  2196.  *  left_softkey_icon       [IN]        
  2197.  *  right_softkey           [IN]        
  2198.  *  right_softkey_icon      [IN]        
  2199.  *  message                 [?]         
  2200.  *  input_type              [IN]        
  2201.  *  buffer                  [?]         
  2202.  *  buffer_size             [IN]        
  2203.  *  message2                [?]         
  2204.  *  duration                [IN]        
  2205.  *  history_buffer          [?]         
  2206.  * RETURNS
  2207.  *  void
  2208.  *****************************************************************************/
  2209. void ShowCategory111Screen_ext(
  2210.         U16 left_softkey,
  2211.         U16 left_softkey_icon,
  2212.         U16 right_softkey,
  2213.         U16 right_softkey_icon,
  2214.         U8 *message,
  2215.         S16 input_type,
  2216.         U8 *buffer,
  2217.         S32 buffer_size,
  2218.         U8 *message2,
  2219.         S32 duration,
  2220.         U8 *history_buffer)
  2221. {
  2222. #ifdef UI_SMALL_PIN_EDITOR_SCREEN
  2223.     /*----------------------------------------------------------------*/
  2224.     /* Local Variables                                                */
  2225.     /*----------------------------------------------------------------*/
  2226.     /* START VIJAY PMT 20051202 */
  2227.     if (whether_no_small_screen())
  2228.         /* END VIJAY PMT 20051202 */
  2229.     {
  2230.         ShowCategory112Screen(
  2231.             left_softkey,
  2232.             left_softkey_icon,
  2233.             right_softkey,
  2234.             right_softkey_icon,
  2235.             message,
  2236.             input_type,
  2237.             buffer,
  2238.             buffer_size,
  2239.             message2,
  2240.             history_buffer);
  2241.     }
  2242.     else
  2243. #endif /* UI_SMALL_PIN_EDITOR_SCREEN */ 
  2244.     {
  2245.         /*----------------------------------------------------------------*/
  2246.         /* Local Variables                                                */
  2247.         /*----------------------------------------------------------------*/
  2248.         dm_data_struct dm_data;
  2249.         S32 h, len;
  2250.         /*----------------------------------------------------------------*/
  2251.         /* Code Body                                                      */
  2252.         /*----------------------------------------------------------------*/
  2253.         dm_reset_context();
  2254.         gdi_layer_lock_frame_buffer();
  2255.     #ifdef __MMI_ZI__
  2256.         ZiInuptMethodEnterSinglelineInputBox();
  2257.     #endif 
  2258.         MMI_menu_shortcut_number = -1;
  2259.         MMI_disable_title_shortcut_display = 1;
  2260.         change_left_softkey(left_softkey, left_softkey_icon);
  2261.         change_right_softkey(right_softkey, right_softkey_icon);
  2262.         SetupCategoryKeyHandlers();
  2263.         ShowStatusIconsTitle();
  2264.         
  2265.     #if (!defined (__MMI_MAINLCD_176X220__)) && (!defined (__MMI_MAINLCD_240X320__))
  2266.         pin_editor_background_filler = *current_MMI_theme->PIN_screen_background_filler;//083106 pin editor
  2267.         pin_editor_background_filler.flags = UI_FILLED_AREA_TYPE_COLOR;
  2268.         dm_add_back_fill_area(&pin_editor_background_filler);
  2269.     #endif
  2270.         
  2271.         /* code added vandana mehtani 09 june for incorporating the message */
  2272.         MMI_message_string = (UI_string_type) message;
  2273.         len = gui_strlen(MMI_message_string);
  2274.         create_multiline_inputbox_set_buffer(MMI_message_string, len, len, 0);
  2275.         MMI_multiline_inputbox.flags |=
  2276.             (UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW | UI_MULTI_LINE_INPUT_BOX_DISABLE_BACKGROUND |
  2277.              UI_MULTI_LINE_INPUT_BOX_DISABLE_SCROLLBAR | UI_MULTI_LINE_INPUT_BOX_VIEW_MODE);
  2278.         h = 22;
  2279.         wgui_setup_singleline_inputbox(
  2280.             4,
  2281.             MMI_multiline_inputbox.y + MMI_multiline_inputbox.height,
  2282.             UI_device_width - 8,
  2283.             h,
  2284.             buffer,
  2285.             buffer_size,
  2286.             MMI_CATEGORY111_ID,
  2287.             get_string(right_softkey),
  2288.             get_image(right_softkey_icon),
  2289.             input_type,
  2290.             history_buffer,
  2291.             0);
  2292.         gui_set_single_line_input_box_theme(&MMI_singleline_inputbox, &PIN_singleline_inputbox_theme);
  2293.         dm_add_string((UI_string_type) message2, &MMI_medium_font, UI_COLOR_BLACK, UI_COLOR_BLACK, NULL);
  2294.         register_hide_multitap(wgui_hide_multitap);
  2295.         gdi_layer_unlock_frame_buffer();
  2296.         ExitCategoryFunction = ExitCategory111Screen;
  2297.         dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  2298.     #ifdef __MMI_TOUCH_SCREEN__
  2299.         dm_register_category_controlled_callback(DrawCate111CategoryControlArea);
  2300.         wgui_register_category_screen_control_area_pen_handlers(
  2301.             Cate111CategoryControlAreaPenDownHandler,
  2302.             MMI_PEN_EVENT_DOWN);
  2303.         wgui_register_category_screen_control_area_pen_handlers(
  2304.             Cate111CategoryControlAreaPenUpHandler,
  2305.             MMI_PEN_EVENT_UP);
  2306.     #endif /* __MMI_TOUCH_SCREEN__ */ 
  2307.         dm_data.s32ScrId = (S32) GetActiveScreenId();
  2308.         dm_data.s32CatId = MMI_CATEGORY111_ID;
  2309.         dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND | DM_NO_TITLE;
  2310.         dm_setup_data(&dm_data);
  2311.         dm_redraw_category_screen();
  2312.     
  2313.         Cat111CountDownValue = duration;
  2314.         if (Cat111CountDownValue != 0)
  2315.         {
  2316.             Cat111CountDownCallBack();
  2317.         }
  2318.     }
  2319. }   /* end of ShowCategory111Screen */
  2320. /*****************************************************************************
  2321.  * FUNCTION
  2322.  *  ExitCategory111Screen
  2323.  * DESCRIPTION
  2324.  *  Exits category 184 screen
  2325.  * PARAMETERS
  2326.  *  void
  2327.  * RETURNS
  2328.  *  void
  2329.  *****************************************************************************/
  2330. void ExitCategory111Screen(void)
  2331. {
  2332.     /*----------------------------------------------------------------*/
  2333.     /* Local Variables                                                */
  2334.     /*----------------------------------------------------------------*/
  2335.     /*----------------------------------------------------------------*/
  2336.     /* Code Body                                                      */
  2337.     /*----------------------------------------------------------------*/
  2338.     reset_multiline_inputbox();
  2339.     set_MMI_current_input_type();
  2340.     Cat111TimerExpireCallBack = UI_dummy_function;
  2341.     reset_softkeys();
  2342.     clear_left_softkey();
  2343.     clear_right_softkey();
  2344.     reset_multitaps();
  2345.     close_status_icons();
  2346.     gui_set_single_line_input_box_current_theme(&MMI_singleline_inputbox);
  2347.     wgui_close_singleline_inputbox();
  2348.     /* START VIJAY PMT 20050930 */
  2349. #ifdef UI_SMALL_LIST_SCREEN
  2350.     restore_small_screen();
  2351. #endif 
  2352.     /* END VIJAY PMT 20050930 */
  2353. }
  2354. #ifdef __MMI_ENGINEER_MODE__
  2355. /*****************************************************************************
  2356.  * FUNCTION
  2357.  *  ShowCategory204Screen
  2358.  * DESCRIPTION
  2359.  *  Displays the category204 screen
  2360.  * PARAMETERS
  2361.  *  left_softkey                [IN]        Left softkey label
  2362.  *  left_softkey_icon           [IN]        Icon for the Left softkey
  2363.  *  right_softkey               [IN]        Right softkey label
  2364.  *  right_softkey_icon          [IN]        Icon for the right softkey
  2365.  *  NotificationStringId        [IN]        Id of string displayed in title
  2366.  *  value                       [IN]        The value of string displayed in single-line inputbox
  2367.  *  imageId                     [IN]        Id of image to be displayed.
  2368.  *  history_buffer              [IN]        History buffer
  2369.  * RETURNS
  2370.  *  void
  2371.  *****************************************************************************/
  2372. void ShowCategory204Screen(
  2373.         U16 left_softkey,
  2374.         U16 left_softkey_icon,
  2375.         U16 right_softkey,
  2376.         U16 right_softkey_icon,
  2377.         U16 NotificationStringId,
  2378.         U16 value,
  2379.         U16 imageId,
  2380.         U8 *history_buffer)
  2381. {
  2382.     /*----------------------------------------------------------------*/
  2383.     /* Local Variables                                                */
  2384.     /*----------------------------------------------------------------*/
  2385.     dm_data_struct dm_data;
  2386.     UI_string_type text[5];
  2387.     /*----------------------------------------------------------------*/
  2388.     /* Code Body                                                      */
  2389.     /*----------------------------------------------------------------*/
  2390.     UI_UNUSED_PARAMETER(history_buffer);
  2391.     gdi_layer_lock_frame_buffer();
  2392.     change_left_softkey(left_softkey, left_softkey_icon);
  2393.     change_right_softkey(right_softkey, right_softkey_icon);
  2394.     SetupCategoryKeyHandlers();
  2395.     MMI_title_string = (UI_string_type) get_string(NotificationStringId);
  2396.     gui_itoa(value, (UI_string_type) text, 10);
  2397.     create_singleline_inputbox_set_buffer(
  2398.         (UI_string_type) text,
  2399.         gui_strlen((UI_string_type) text) + 1,
  2400.         gui_strlen((UI_string_type) text),
  2401.         gui_strlen((UI_string_type) text));
  2402.     set_singleline_inputbox_mask(0);
  2403.     MMI_singleline_inputbox.flags |=
  2404.         (UI_SINGLE_LINE_INPUT_BOX_DISABLE_BACKGROUND | UI_SINGLE_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW |
  2405.          UI_SINGLE_LINE_INPUT_BOX_CENTER_JUSTIFY);
  2406.     gdi_layer_unlock_frame_buffer();
  2407.     ExitCategoryFunction = ExitCategory204Screen;
  2408.     dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  2409.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  2410.     dm_data.s32CatId = MMI_CATEGORY204_ID;
  2411.     dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
  2412.     dm_setup_data(&dm_data);
  2413.     dm_redraw_category_screen();
  2414. }   /* ShowCategory204Screen */
  2415. /*****************************************************************************
  2416.  * FUNCTION
  2417.  *  ExitCategory204Screen
  2418.  * DESCRIPTION
  2419.  *  Exits the category204 screen
  2420.  * PARAMETERS
  2421.  *  void
  2422.  * RETURNS
  2423.  *  void
  2424.  *****************************************************************************/
  2425. void ExitCategory204Screen(void)
  2426. {
  2427.     /*----------------------------------------------------------------*/
  2428.     /* Local Variables                                                */
  2429.     /*----------------------------------------------------------------*/
  2430.     /*----------------------------------------------------------------*/
  2431.     /* Code Body                                                      */
  2432.     /*----------------------------------------------------------------*/
  2433.     gui_hide_animations();
  2434.     reset_softkeys();
  2435.     reset_singleline_inputbox();
  2436. }   /* end of ExitCategory204Screen */
  2437. /* temp solution */
  2438. #ifdef __MMI_DRAW_MANAGER__
  2439. #undef __MMI_DRAW_MANAGER__
  2440. #define __MMI_DIS_DRAW_MANAGER__
  2441. #endif /* __MMI_DRAW_MANAGER__ */ 
  2442. #ifndef __MMI_DRAW_MANAGER__
  2443. /* 081206 cat205 Start */
  2444. extern PU8 _MMI_animated_icon;
  2445. extern S32 _MMI_animated_icon_x;
  2446. extern S32 _MMI_animated_icon_y;
  2447. /* 081206 cat205 End */
  2448. /*****************************************************************************
  2449.  * FUNCTION
  2450.  *  RedrawCategory205Screen
  2451.  * DESCRIPTION
  2452.  *  redraw category 205
  2453.  * PARAMETERS
  2454.  *  void
  2455.  * RETURNS
  2456.  *  void
  2457.  *****************************************************************************/
  2458. void RedrawCategory205Screen(void)
  2459. {
  2460.     /*----------------------------------------------------------------*/
  2461.     /* Local Variables                                                */
  2462.     /*----------------------------------------------------------------*/
  2463.     /*----------------------------------------------------------------*/
  2464.     /* Code Body                                                      */
  2465.     /*----------------------------------------------------------------*/
  2466.     gdi_layer_lock_frame_buffer();
  2467.     gui_hide_animations();
  2468.     clear_screen();
  2469.     gdi_layer_push_clip();
  2470.     gdi_layer_set_clip(0, 0, UI_device_width - 1, UI_device_height - MMI_button_bar_height - 1);
  2471.     gdi_layer_reset_clip();
  2472.     //wgui_show_transparent_animation();//081206 cat205
  2473.     gdi_image_draw(_MMI_animated_icon_x, _MMI_animated_icon_y, (U8*) _MMI_animated_icon);
  2474.     gdi_layer_pop_clip();
  2475.     show_multiline_inputbox();
  2476.     show_softkey_background();
  2477.     show_left_softkey();
  2478.     show_right_softkey();
  2479.     gdi_layer_unlock_frame_buffer();
  2480.     gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
  2481. }
  2482. #endif /* __MMI_DRAW_MANAGER__ */ 
  2483. /*****************************************************************************
  2484.  * FUNCTION
  2485.  *  ExitCategory205Screen
  2486.  * DESCRIPTION
  2487.  *  Exits the category205 screen
  2488.  * PARAMETERS
  2489.  *  void
  2490.  * RETURNS
  2491.  *  void
  2492.  *****************************************************************************/
  2493. void ExitCategory205Screen(void)
  2494. {
  2495.     /*----------------------------------------------------------------*/
  2496.     /* Local Variables                                                */
  2497.     /*----------------------------------------------------------------*/
  2498.     /*----------------------------------------------------------------*/
  2499.     /* Code Body                                                      */
  2500.     /*----------------------------------------------------------------*/
  2501.     gui_hide_animations();
  2502.     reset_softkeys();
  2503.     close_status_icons();
  2504. }   /* end of ExitCategory205Screen */
  2505. /*****************************************************************************
  2506.  * FUNCTION
  2507.  *  ShowCategory205Screen
  2508.  * DESCRIPTION
  2509.  *  Displays the category205 screen
  2510.  * PARAMETERS
  2511.  *  left_softkey            [IN]        Left softkey label
  2512.  *  left_softkey_icon       [IN]        Icon for the Left softkey
  2513.  *  right_softkey           [IN]        Right softkey label
  2514.  *  right_softkey_icon      [IN]        Icon for the right softkey
  2515.  *  message                 [IN]        String to be displayed.
  2516.  *  message_icon            [IN]        Id of image to be displayed.
  2517.  *  history_buffer          [IN]        History buffer
  2518.  * RETURNS
  2519.  *  void
  2520.  *****************************************************************************/
  2521. void ShowCategory205Screen(
  2522.         U16 left_softkey,
  2523.         U16 left_softkey_icon,
  2524.         U16 right_softkey,
  2525.         U16 right_softkey_icon,
  2526.         UI_string_type message,
  2527.         U16 message_icon,
  2528.         U8 *history_buffer)
  2529. {
  2530.     /*----------------------------------------------------------------*/
  2531.     /* Local Variables                                                */
  2532.     /*----------------------------------------------------------------*/
  2533. #ifdef __MMI_DRAW_MANAGER__
  2534.     dm_data_struct dm_data;
  2535. #endif 
  2536.     S32 l, fh;
  2537.     /*----------------------------------------------------------------*/
  2538.     /* Code Body                                                      */
  2539.     /*----------------------------------------------------------------*/
  2540. #ifdef __MMI_DRAW_MANAGER__
  2541.     dm_reset_context();
  2542. #endif 
  2543.     UI_UNUSED_PARAMETER(history_buffer);
  2544.     gdi_layer_lock_frame_buffer();
  2545.     MMI_menu_shortcut_number = -1;
  2546.     change_left_softkey(left_softkey, left_softkey_icon);
  2547.     change_right_softkey(right_softkey, right_softkey_icon);
  2548.     SetupCategoryKeyHandlers();
  2549.     MMI_message_string = (UI_string_type) message;
  2550.     l = gui_strlen(MMI_message_string);
  2551.     create_multiline_inputbox_set_buffer(MMI_message_string, l, l, 0);
  2552.     MMI_multiline_inputbox.flags |=
  2553.         (UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW | UI_MULTI_LINE_INPUT_BOX_CENTER_JUSTIFY |
  2554.          UI_MULTI_LINE_INPUT_BOX_DISABLE_BACKGROUND | UI_MULTI_LINE_INPUT_BOX_DISABLE_SCROLLBAR);
  2555.     gui_set_font(MMI_multiline_inputbox.text_font);
  2556. #ifdef __MMI_DRAW_MANAGER__
  2557.     dm_add_image(get_image(message_icon), NULL, NULL);
  2558. #else /* __MMI_DRAW_MANAGER__ */ 
  2559.     move_multiline_inputbox(0, (MMI_title_y + MMI_title_height) + 2);
  2560.     resize_multiline_inputbox(MMI_multiline_inputbox.width, MMI_content_height);
  2561.     show_multiline_inputbox_no_draw();
  2562.     fh = get_multiline_inputbox_line_height();
  2563.     resize_multiline_inputbox(
  2564.         MMI_multiline_inputbox.width,
  2565.         (MMI_multiline_inputbox.n_lines * fh) + MULTILINE_INPUTBOX_HEIGHT_PAD + MMI_multiline_inputbox.text_y);
  2566.     wgui_set_animation((UI_device_width >> 1), ((UI_device_height - MMI_button_bar_height) >> 1), message_icon);
  2567. #endif /* __MMI_DRAW_MANAGER__ */ 
  2568.     register_hide_status_icon_bar(0, MMI_dummy_function);
  2569.     register_hide_status_icon_bar(1, MMI_dummy_function);
  2570.     gdi_layer_unlock_frame_buffer();
  2571.     ExitCategoryFunction = ExitCategory205Screen;
  2572. #ifdef __MMI_DRAW_MANAGER__
  2573.     dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  2574.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  2575.     dm_data.s32CatId = MMI_CATEGORY205_ID;
  2576.     dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
  2577.     dm_setup_data(&dm_data);
  2578.     dm_redraw_category_screen();
  2579. #else /* __MMI_DRAW_MANAGER__ */ 
  2580.     RedrawCategoryFunction = RedrawCategory205Screen;
  2581.     GetCategoryHistory = dummy_get_history;
  2582.     GetCategoryHistorySize = dummy_get_history_size;
  2583.     RedrawCategoryFunction();
  2584. #endif /* __MMI_DRAW_MANAGER__ */ 
  2585. }   /* end of ShowCategory205Screen */
  2586. #endif /* __MMI_ENGINEER_MODE__ */ 
  2587. #ifdef __MMI_DIS_DRAW_MANAGER__
  2588. #define __MMI_DRAW_MANAGER__
  2589. #undef __MMI_DIS_DRAW_MANAGER__
  2590. #endif /* __MMI_DIS_DRAW_MANAGER__ */ 
  2591. /*****************************************************************************
  2592.  * FUNCTION
  2593.  *  ShowCategory109Screen
  2594.  * DESCRIPTION
  2595.  *  (twostate menuitem with hint, and no LSK function)
  2596.  *  Displays the category109 screen
  2597.  * PARAMETERS
  2598.  *  title                       [IN]        Title for the screen
  2599.  *  title_icon                  [IN]        Icon shown with the title
  2600.  *  left_softkey                [IN]        Left softkey label
  2601.  *  left_softkey_icon           [IN]        Icon for the Left softkey
  2602.  *  right_softkey               [IN]        Right softkey label
  2603.  *  right_softkey_icon          [IN]        Icon for the right softkey
  2604.  *  number_of_items             [IN]        
  2605.  *  list_of_items               [IN]        
  2606.  *  list_of_descriptions        [IN]        
  2607.  *  highlighted_item            [IN]        
  2608.  *  history_buffer              [IN]        History buffer
  2609.  *  buffer(?)                   [IN]        Buffer the input box should use
  2610.  *  buffer_size(?)              [IN]        Size of the buffer
  2611.  * RETURNS
  2612.  *  void
  2613.  *****************************************************************************/
  2614. void ShowCategory109Screen(
  2615.         U16 title,
  2616.         U16 title_icon,
  2617.         U16 left_softkey,
  2618.         U16 left_softkey_icon,
  2619.         U16 right_softkey,
  2620.         U16 right_softkey_icon,
  2621.         S32 number_of_items,
  2622.         U8 **list_of_items,
  2623.         U8 **list_of_descriptions,
  2624.         S32 highlighted_item,
  2625.         U8 *history_buffer)
  2626. {
  2627.     /*----------------------------------------------------------------*/
  2628.     /* Local Variables                                                */
  2629.     /*----------------------------------------------------------------*/
  2630.     dm_data_struct dm_data;
  2631.     S32 i;
  2632.     U8 h_flag;
  2633.     /*----------------------------------------------------------------*/
  2634.     /* Code Body                                                      */
  2635.     /*----------------------------------------------------------------*/
  2636.     gdi_layer_lock_frame_buffer();
  2637.     create_fixed_twostate_menuitems(get_image(RADIO_ON_IMAGE_ID), get_image(RADIO_OFF_IMAGE_ID));
  2638.     associate_fixed_twostate_list();
  2639.     ShowListCategoryScreen(
  2640.         get_string(title),
  2641.         get_image(title_icon),
  2642.         get_string(left_softkey),
  2643.         get_image(left_softkey_icon),
  2644.         get_string(right_softkey),
  2645.         get_image(right_softkey_icon),
  2646.         number_of_items);
  2647.     resize_fixed_twostate_menuitems(0, MMI_MENUITEM_HEIGHT);
  2648.     set_fixed_twostate_positions(MMI_MENUITEM_HEIGHT, 0, 1, 0);
  2649.     /* Softkeys */
  2650.     clear_left_softkey_handler();
  2651.     if (list_of_descriptions == NULL)
  2652.     {
  2653.         for (i = 0; i < number_of_items; i++)
  2654.         {
  2655.             add_fixed_twostate_item((UI_string_type) list_of_items[i]);
  2656.             wgui_pop_up_description_strings[i].text_strings[0] = NULL;
  2657.         }
  2658.     }
  2659.     else
  2660.     {
  2661.         for (i = 0; i < number_of_items; i++)
  2662.         {
  2663.             add_fixed_twostate_item((UI_string_type) list_of_items[i]);
  2664.             wgui_pop_up_description_strings[i].text_strings[0] = (UI_string_type) list_of_descriptions[i];
  2665.         }
  2666.     }
  2667.     register_fixed_list_highlight_handler(standard_radio_list_highlight_handler);
  2668.     h_flag = set_list_menu_category_history(MMI_CATEGORY109_ID, history_buffer);
  2669.     if (h_flag)
  2670.     {
  2671.         fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
  2672.     }
  2673.     else
  2674.     {
  2675.         fixed_list_goto_item_no_redraw(highlighted_item);
  2676.     }
  2677.     select_fixed_twostate_item(MMI_fixed_list_menu.highlighted_item);
  2678.     set_pop_up_descriptions(1, number_of_items, MMI_fixed_list_menu.highlighted_item);
  2679.     gdi_layer_unlock_frame_buffer();
  2680.     ExitCategoryFunction = ExitListCategoryScreen;
  2681.     dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  2682.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  2683.     dm_data.s32CatId = MMI_CATEGORY109_ID;
  2684.     dm_data.s32flags = 0;
  2685.     dm_setup_data(&dm_data);
  2686.     dm_redraw_category_screen();
  2687. }   /* end of ShowCategory109Screen */
  2688. /*****************************************************************************
  2689.  * FUNCTION
  2690.  *  category88_handle_down_key
  2691.  * DESCRIPTION
  2692.  *  handle key down of category88
  2693.  * PARAMETERS
  2694.  *  void
  2695.  * RETURNS
  2696.  *  void
  2697.  *****************************************************************************/
  2698. void category88_handle_down_key(void)
  2699. {
  2700.     /*----------------------------------------------------------------*/
  2701.     /* Local Variables                                                */
  2702.     /*----------------------------------------------------------------*/
  2703.     /*----------------------------------------------------------------*/
  2704.     /* Code Body                                                      */
  2705.     /*----------------------------------------------------------------*/
  2706.     wgui_hide_slide_control_focus();
  2707.     if (MMI_current_slide_control == &MMI_slide_control[dm_get_slide_control_count() - 1])
  2708.     {
  2709.         MMI_current_slide_control = &MMI_slide_control[0];
  2710.     }
  2711.     else
  2712.     {
  2713.         MMI_current_slide_control++;
  2714.     }
  2715.     wgui_slide_control_set_focus(MMI_current_slide_control);
  2716.     wgui_show_slide_control_focus();
  2717. }   /* end of category88_handle_down_key */
  2718. /*****************************************************************************
  2719.  * FUNCTION
  2720.  *  category88_handle_up_key
  2721.  * DESCRIPTION
  2722.  *  handle key up of category88
  2723.  * PARAMETERS
  2724.  *  void
  2725.  * RETURNS
  2726.  *  void
  2727.  *****************************************************************************/
  2728. void category88_handle_up_key(void)
  2729. {
  2730.     /*----------------------------------------------------------------*/
  2731.     /* Local Variables                                                */
  2732.     /*----------------------------------------------------------------*/
  2733.     /*----------------------------------------------------------------*/
  2734.     /* Code Body                                                      */
  2735.     /*----------------------------------------------------------------*/
  2736.     wgui_hide_slide_control_focus();
  2737.     if (MMI_current_slide_control == &MMI_slide_control[0])
  2738.     {
  2739.         MMI_current_slide_control = &MMI_slide_control[dm_get_slide_control_count() - 1];
  2740.     }
  2741.     else
  2742.     {
  2743.         MMI_current_slide_control--;
  2744.     }
  2745.     wgui_slide_control_set_focus(MMI_current_slide_control);
  2746.     wgui_show_slide_control_focus();
  2747. }   /* end of category88_handle_up_key */
  2748. /*****************************************************************************
  2749.  * FUNCTION
  2750.  *  RegisterCategory88ChangeCallbacks
  2751.  * DESCRIPTION
  2752.  *  register category88 chaneg call back functions
  2753.  * PARAMETERS
  2754.  *  f1          [IN]        
  2755.  *  f2          [IN]        Callback2 function pointer
  2756.  *  f(?)        [IN]        Callback1 function pointer
  2757.  * RETURNS
  2758.  *  void
  2759.  *****************************************************************************/
  2760. void RegisterCategory88ChangeCallbacks(void (*f1) (S32 value), void (*f2) (S32 value))
  2761. {
  2762.     /*----------------------------------------------------------------*/
  2763.     /* Local Variables                                                */
  2764.     /*----------------------------------------------------------------*/
  2765.     /*----------------------------------------------------------------*/