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

MTK

开发平台:

C/C++

  1.     dm_setup_data(&dm_data);
  2.     dm_redraw_category_screen();
  3. }   /* end of ShowCategory32Screen */
  4. /*****************************************************************************
  5.  * FUNCTION
  6.  *  ExitCategory32Screen
  7.  * DESCRIPTION
  8.  *  Exits the dynamic menu screen
  9.  * PARAMETERS
  10.  *  void
  11.  * RETURNS
  12.  *  void
  13.  *****************************************************************************/
  14. void ExitCategory32Screen(void)
  15. {
  16.     /*----------------------------------------------------------------*/
  17.     /* Local Variables                                                */
  18.     /*----------------------------------------------------------------*/
  19.     /*----------------------------------------------------------------*/
  20.     /* Code Body                                                      */
  21.     /*----------------------------------------------------------------*/
  22.     disable_menu_shortcut_box_display = 0;
  23. #if(UI_BLINKING_CURSOR_SUPPORT)
  24.     StopMyTimer(BLINKING_CURSOR);
  25. #endif 
  26.     ClearHighlightHandler();
  27.     reset_softkeys();
  28.     reset_menu_shortcut_handler();
  29.     reset_fixed_list();
  30. }   /* end of ExitCategory32Screen */
  31. /*****************************************************************************
  32.  * FUNCTION
  33.  *  GetCategory32History
  34.  * DESCRIPTION
  35.  *  Get category32 history.
  36.  * PARAMETERS
  37.  *  history_buffer      [IN]        History buffer
  38.  * RETURNS
  39.  *  hitsory buffer
  40.  *****************************************************************************/
  41. U8 *GetCategory32History(U8 *history_buffer)
  42. {
  43.     /*----------------------------------------------------------------*/
  44.     /* Local Variables                                                */
  45.     /*----------------------------------------------------------------*/
  46.     /*----------------------------------------------------------------*/
  47.     /* Code Body                                                      */
  48.     /*----------------------------------------------------------------*/
  49.     get_list_menu_category_history(MMI_CATEGORY32_ID, history_buffer);
  50.     return (history_buffer);
  51. }   /* end of GetCategory32History */
  52. /*****************************************************************************
  53.  * FUNCTION
  54.  *  ShowCategory36Screen
  55.  * DESCRIPTION
  56.  *  Displays the Dynamic radio list screen
  57.  * PARAMETERS
  58.  *  title                   [IN]        Title for the screen
  59.  *  title_icon              [IN]        Icon shown with the title
  60.  *  left_softkey            [IN]        Left softkey label
  61.  *  left_softkey_icon       [IN]        Icon for the left softkey
  62.  *  right_softkey           [IN]        Right softkey label
  63.  *  right_softkey_icon      [IN]        Icon for the right softkey
  64.  *  number_of_items         [IN]        Number of items
  65.  *  list_of_items           [IN]        List of text items
  66.  *  highlighted_item        [IN]        Zero based index of the highlighed item (used if there is no history)
  67.  *  history_buffer          [IN]        History buffer
  68.  * RETURNS
  69.  *  void
  70.  *****************************************************************************/
  71. void ShowCategory36Screen(
  72.         U16 title,
  73.         U16 title_icon,
  74.         U16 left_softkey,
  75.         U16 left_softkey_icon,
  76.         U16 right_softkey,
  77.         U16 right_softkey_icon,
  78.         S32 number_of_items,
  79.         U8 **list_of_items,
  80.         U16 highlighted_item,
  81.         U8 *history_buffer)
  82. {
  83.     /*----------------------------------------------------------------*/
  84.     /* Local Variables                                                */
  85.     /*----------------------------------------------------------------*/
  86.     dm_data_struct dm_data;
  87.     S32 i;
  88.     U8 h_flag;
  89.     /*----------------------------------------------------------------*/
  90.     /* Code Body                                                      */
  91.     /*----------------------------------------------------------------*/
  92.     gdi_layer_lock_frame_buffer();
  93.     create_fixed_twostate_menuitems(get_image(RADIO_ON_IMAGE_ID), get_image(RADIO_OFF_IMAGE_ID));
  94.     associate_fixed_twostate_list();
  95.     ShowListCategoryScreen(
  96.         get_string(title),
  97.         get_image(title_icon),
  98.         get_string(left_softkey),
  99.         get_image(left_softkey_icon),
  100.         get_string(right_softkey),
  101.         get_image(right_softkey_icon),
  102.         number_of_items);
  103.     resize_fixed_twostate_menuitems(0, MMI_MENUITEM_HEIGHT);
  104.     set_fixed_twostate_positions(MMI_MENUITEM_HEIGHT, 0, 1, 0);
  105.     for (i = 0; i < number_of_items; i++)
  106.     {
  107.         add_fixed_twostate_item((UI_string_type) list_of_items[i]);
  108.     }
  109.     register_fixed_list_highlight_handler(standard_radio_list_highlight_handler);
  110.     h_flag = set_list_menu_category_history(MMI_CATEGORY36_ID, history_buffer);
  111.     if (h_flag)
  112.     {
  113.         fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
  114.     }
  115.     else
  116.     {
  117.         fixed_list_goto_item_no_redraw(highlighted_item);
  118.     }
  119.     select_fixed_twostate_item(MMI_fixed_list_menu.highlighted_item);
  120.     resize_fixed_twostate_menuitems_to_list_width();
  121.     gdi_layer_unlock_frame_buffer();
  122.     ExitCategoryFunction = ExitListCategoryScreen;
  123.     RedrawCategoryFunction = dm_redraw_category_screen;
  124.     GetCategoryHistory = dm_get_category_history;
  125.     GetCategoryHistorySize = dm_get_category_history_size;
  126.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  127.     dm_data.s32CatId = MMI_CATEGORY36_ID;
  128.     dm_data.s32flags = 0;
  129.     dm_setup_data(&dm_data);
  130.     dm_redraw_category_screen();
  131. }   /* end of ShowCategory36Screen */
  132. /*****************************************************************************
  133. * Category52ChangeItemText
  134. *  GetCategory32History
  135. *
  136. * DESCRIPTION
  137. *   change the text of menu item of particular index of category52.
  138. *
  139. * PARAMETERS
  140. *  index IN item index
  141. *  text  IN item text
  142. *
  143. * RETURNS
  144. *  hitsory buffer
  145. *
  146. * GLOBALS AFFECTED
  147. *****************************************************************************/
  148. /*****************************************************************************
  149.  * FUNCTION
  150.  *  Category52ChangeItemText
  151.  * DESCRIPTION
  152.  *  
  153.  * PARAMETERS
  154.  *  index       [IN]        
  155.  *  text        [?]         
  156.  * RETURNS
  157.  *  void
  158.  *****************************************************************************/
  159. void Category52ChangeItemText(S32 index, U8 *text)
  160. {
  161.     /*----------------------------------------------------------------*/
  162.     /* Local Variables                                                */
  163.     /*----------------------------------------------------------------*/
  164.     /*----------------------------------------------------------------*/
  165.     /* Code Body                                                      */
  166.     /*----------------------------------------------------------------*/
  167.     MMI_fixed_icontext_menuitems[index].item_text = (UI_string_type) text;
  168. }   /* end of Category52ChangeItemText */
  169. /*****************************************************************************
  170. * Category52ChangeItemText
  171. *  Category52ChangeItemIcon
  172. *
  173. * DESCRIPTION
  174. *   change the icon of menu item of particular index of category52
  175. *
  176. * PARAMETERS
  177. *  index IN item index
  178. *  image_ID IN item image_ID
  179. *
  180. * RETURNS
  181. *  hitsory buffer
  182. *
  183. * GLOBALS AFFECTED
  184. *****************************************************************************/
  185. /*****************************************************************************
  186.  * FUNCTION
  187.  *  Category52ChangeItemIcon
  188.  * DESCRIPTION
  189.  *  
  190.  * PARAMETERS
  191.  *  index           [IN]        
  192.  *  image_ID        [IN]        
  193.  * RETURNS
  194.  *  void
  195.  *****************************************************************************/
  196. void Category52ChangeItemIcon(S32 index, U16 image_ID)
  197. {
  198.     /*----------------------------------------------------------------*/
  199.     /* Local Variables                                                */
  200.     /*----------------------------------------------------------------*/
  201.     /*----------------------------------------------------------------*/
  202.     /* Code Body                                                      */
  203.     /*----------------------------------------------------------------*/
  204.     MMI_fixed_icontext_menuitems[index].item_icon = (PU8) get_image(image_ID);
  205. }   /* end of Category52ChangeItemIcon */
  206. /*****************************************************************************
  207.  * FUNCTION
  208.  *  Category52ChangeItemDescription
  209.  * DESCRIPTION
  210.  *  change the popup text of menu item of particular index of category52
  211.  * PARAMETERS
  212.  *  index       [IN]        Item index
  213.  *  text        [IN]        Description text
  214.  * RETURNS
  215.  *  hitsory buffer(?)
  216.  *****************************************************************************/
  217. void Category52ChangeItemDescription(S32 index, U8 *text)
  218. {
  219.     /*----------------------------------------------------------------*/
  220.     /* Local Variables                                                */
  221.     /*----------------------------------------------------------------*/
  222.     /*----------------------------------------------------------------*/
  223.     /* Code Body                                                      */
  224.     /*----------------------------------------------------------------*/
  225.     wgui_pop_up_description_strings[index].text_strings[0] = (UI_string_type) text;
  226. #ifdef __MMI_UI_HINT_TOGGLE_TRANSITION__
  227.     wgui_setup_pop_up_description_transition();
  228. #endif 
  229. }   /* end of Category52ChangeItemDescription */
  230. /*****************************************************************************
  231.  * FUNCTION
  232.  *  Category52ChangeItemDescriptionNoAnimation
  233.  * DESCRIPTION
  234.  *  change the popup text of menu item of particular index of category52 but
  235.  *  we do not start transition animation even if __MMI_UI_HINT_TOGGLE_TRANSITION__
  236.  * PARAMETERS
  237.  *  index       [IN]        Item index
  238.  *  text        [IN]        Description text
  239.  * RETURNS
  240.  *  hitsory buffer(?)
  241.  *****************************************************************************/
  242. void Category52ChangeItemDescriptionNoAnimation(S32 index, U8 *text)
  243. {
  244.     /*----------------------------------------------------------------*/
  245.     /* Local Variables                                                */
  246.     /*----------------------------------------------------------------*/
  247.     /*----------------------------------------------------------------*/
  248.     /* Code Body                                                      */
  249.     /*----------------------------------------------------------------*/
  250.     wgui_pop_up_description_strings[index].text_strings[0] = (UI_string_type) text;
  251. }   /* end of Category52ChangeItemDescriptionNoAnimation */
  252. /*****************************************************************************
  253.  * FUNCTION
  254.  *  Category52DisablePenMove
  255.  * DESCRIPTION
  256.  *  Forcefully disable pen move for a particular menu
  257.  * PARAMETERS
  258.  *  none
  259.  * RETURNS
  260.  *  hitsory buffer(?)
  261.  *****************************************************************************/
  262. void Category52DisablePenMove(void)
  263. {
  264. #ifdef __MMI_TOUCH_SCREEN__
  265.    gui_set_fixed_list_menu_item_pen_function(
  266.         &MMI_fixed_list_menu,
  267.         gui_fixed_icontext_menuitem_translate_pen_event,
  268.         MMI_TRUE,
  269.         MMI_FALSE);
  270. #endif /* __MMI_TOUCH_SCREEN__ */ 
  271. }
  272. /*****************************************************************************
  273.  * FUNCTION
  274.  *  ShowCategory52Screen
  275.  * DESCRIPTION
  276.  *  Displays the category52 screen ( List menu with description )
  277.  * PARAMETERS
  278.  *  title                       [IN]        Title for the screen
  279.  *  title_icon                  [IN]        Icon displayed with the title
  280.  *  left_softkey                [IN]        Left softkey label
  281.  *  left_softkey_icon           [IN]        Left softkey icon
  282.  *  right_softkey               [IN]        Right softkey label
  283.  *  right_softkey_icon          [IN]        Right softkey icon
  284.  *  number_of_items             [IN]        Number of items in the menu
  285.  *  list_of_items               [IN]        Array of items
  286.  *  list_of_icons               [IN]        Array of icons
  287.  *  list_of_descriptions        [IN]        Array of Pop up description strings
  288.  *  flags                       [IN]        Flags (see explanation below)
  289.  *  highlighted_item            [IN]        Default item to be highlighted (if there is no history)
  290.  *  history_buffer              [IN]        History buffer
  291.  * RETURNS
  292.  *  void
  293.  *****************************************************************************/
  294. void ShowCategory52Screen(
  295.         U16 title,
  296.         U16 title_icon,
  297.         U16 left_softkey,
  298.         U16 left_softkey_icon,
  299.         U16 right_softkey,
  300.         U16 right_softkey_icon,
  301.         S32 number_of_items,
  302.         U16 *list_of_items,
  303.         U16 *list_of_icons,
  304.         U8 **list_of_descriptions,
  305.         S32 flags,
  306.         S32 highlighted_item,
  307.         U8 *history_buffer)
  308. {
  309.     /*----------------------------------------------------------------*/
  310.     /* Local Variables                                                */
  311.     /*----------------------------------------------------------------*/
  312.     U8 i = 0;
  313.     /*----------------------------------------------------------------*/
  314.     /* Code Body                                                      */
  315.     /*----------------------------------------------------------------*/
  316.     for (i = 0; i < number_of_items; i++)
  317.     {
  318.         subMenuDataPtrs[i] = (PU8) get_string(list_of_items[i]);
  319.     }
  320.     ShowCategory353Screen(
  321.         (U8*) GetString(title),
  322.         title_icon,
  323.         left_softkey,
  324.         left_softkey_icon,
  325.         right_softkey,
  326.         right_softkey_icon,
  327.         number_of_items,
  328.         subMenuDataPtrs,
  329.         list_of_icons,
  330.         list_of_descriptions,
  331.         flags,
  332.         highlighted_item,
  333.         history_buffer);
  334. }   /* end of ShowCategory52Screen */
  335. /*****************************************************************************
  336. * Category53ChangeItemText
  337. *  Category53ChangeItemDescription
  338. *
  339. * DESCRIPTION
  340. *   change the popup text of menu item of particular index of category53
  341. *
  342. * PARAMETERS
  343. *  index IN item index
  344. *  text  IN description text
  345. *
  346. * RETURNS
  347. *  hitsory buffer
  348. *
  349. * GLOBALS AFFECTED
  350. *****************************************************************************/
  351. /*****************************************************************************
  352.  * FUNCTION
  353.  *  Category53ChangeItemDescription
  354.  * DESCRIPTION
  355.  *  
  356.  * PARAMETERS
  357.  *  index       [IN]        
  358.  *  text        [?]         
  359.  * RETURNS
  360.  *  void
  361.  *****************************************************************************/
  362. void Category53ChangeItemDescription(S32 index, U8 *text)
  363. {
  364.     /*----------------------------------------------------------------*/
  365.     /* Local Variables                                                */
  366.     /*----------------------------------------------------------------*/
  367.     /*----------------------------------------------------------------*/
  368.     /* Code Body                                                      */
  369.     /*----------------------------------------------------------------*/
  370.     wgui_pop_up_description_strings[index].text_strings[0] = (UI_string_type) text;
  371. #ifdef __MMI_UI_HINT_TOGGLE_TRANSITION__
  372.     wgui_setup_pop_up_description_transition();
  373. #endif 
  374. }
  375. /*****************************************************************************
  376.  * FUNCTION
  377.  *  ShowCategory53Screen
  378.  * DESCRIPTION
  379.  *  Displays the category53 screen ( List menu with description )
  380.  * PARAMETERS
  381.  *  title                       [IN]        Title for the screen
  382.  *  title_icon                  [IN]        Icon displayed with the title
  383.  *  left_softkey                [IN]        Left softkey label
  384.  *  left_softkey_icon           [IN]        Left softkey icon
  385.  *  right_softkey               [IN]        Right softkey label
  386.  *  right_softkey_icon          [IN]        Right softkey icon
  387.  *  number_of_items             [IN]        Number of items in the menu
  388.  *  list_of_items               [IN]        Array of items
  389.  *  list_of_icons               [IN]        Array of icons
  390.  *  list_of_descriptions        [IN]        Array of Pop up description strings
  391.  *  flags                       [IN]        Flags (see explanation below)
  392.  *  highlighted_item            [IN]        Default item to be highlighted (if there is no history)
  393.  *  history_buffer              [IN]        History buffer
  394.  * RETURNS
  395.  *  void
  396.  *****************************************************************************/
  397. void ShowCategory53Screen(
  398.         U16 title,
  399.         U16 title_icon,
  400.         U16 left_softkey,
  401.         U16 left_softkey_icon,
  402.         U16 right_softkey,
  403.         U16 right_softkey_icon,
  404.         S32 number_of_items,
  405.         U8 **list_of_items,
  406.         U16 *list_of_icons,
  407.         U8 **list_of_descriptions,
  408.         S32 flags,
  409.         S32 highlighted_item,
  410.         U8 *history_buffer)
  411. {
  412.     /*----------------------------------------------------------------*/
  413.     /* Local Variables                                                */
  414.     /*----------------------------------------------------------------*/
  415.     /*----------------------------------------------------------------*/
  416.     /* Code Body                                                      */
  417.     /*----------------------------------------------------------------*/
  418.     ShowCategory353Screen(
  419.         (U8*) GetString(title),
  420.         title_icon,
  421.         left_softkey,
  422.         left_softkey_icon,
  423.         right_softkey,
  424.         right_softkey_icon,
  425.         number_of_items,
  426.         list_of_items,
  427.         list_of_icons,
  428.         list_of_descriptions,
  429.         flags,
  430.         highlighted_item,
  431.         history_buffer);
  432. }   /* end of ShowCategory53Screen */
  433. #if defined __MMI_DRAW_MANAGER__ && defined __MMI_UI_TAB_PANE__
  434. void dm_list_category_controlled_area(dm_coordinates *coordinate)
  435. {
  436. show_tab_pane();
  437. }
  438. #endif
  439. /*****************************************************************************
  440.  * FUNCTION
  441.  *  ShowCategory353Screen
  442.  * DESCRIPTION
  443.  *  Displays the category353 screen ( List menu with description )
  444.  * PARAMETERS
  445.  *  title                       [IN]        Title for the screen
  446.  *  title_icon                  [IN]        Icon displayed with the title
  447.  *  left_softkey                [IN]        Left softkey label
  448.  *  left_softkey_icon           [IN]        Left softkey icon
  449.  *  right_softkey               [IN]        Right softkey label
  450.  *  right_softkey_icon          [IN]        Right softkey icon
  451.  *  number_of_items             [IN]        Number of items in the menu
  452.  *  list_of_items               [IN]        Array of items
  453.  *  list_of_icons               [IN]        Array of icons
  454.  *  list_of_descriptions        [IN]        Array of Pop up description strings
  455.  *  flags                       [IN]        Flags (see explanation below)
  456.  *  highlighted_item            [IN]        Default item to be highlighted (if there is no history)
  457.  *  history_buffer              [IN]        History buffer
  458.  * RETURNS
  459.  *  void
  460.  *****************************************************************************/
  461. void ShowCategory353Screen(
  462.         U8 *title,
  463.         U16 title_icon,
  464.         U16 left_softkey,
  465.         U16 left_softkey_icon,
  466.         U16 right_softkey,
  467.         U16 right_softkey_icon,
  468.         S32 number_of_items,
  469.         U8 **list_of_items,
  470.         U16 *list_of_icons,
  471.         U8 **list_of_descriptions,
  472.         S32 flags,
  473.         S32 highlighted_item,
  474.         U8 *history_buffer)
  475. {
  476.     /*----------------------------------------------------------------*/
  477.     /* Local Variables                                                */
  478.     /*----------------------------------------------------------------*/
  479.     dm_data_struct dm_data;
  480.     S32 i;
  481.     U8 h_flag,mm_bg_flags;
  482.     /*----------------------------------------------------------------*/
  483.     /* Code Body                                                      */
  484.     /*----------------------------------------------------------------*/
  485.     gdi_layer_lock_frame_buffer();
  486.     create_fixed_icontext_menuitems();
  487.     associate_fixed_icontext_list();
  488. MMI_disable_title_shortcut_display = 1;
  489. MMI_fixed_list_menu.flags |= UI_LIST_MENU_LOOP | UI_LIST_MENU_DISABLE_BACKGROUND | UI_LIST_MENU_DISABLE_BKGRND_IN_LAYER;
  490.     ShowListCategoryScreen(
  491.         (UI_string_type) title,
  492.         get_image(title_icon),
  493.         get_string(left_softkey),
  494.         get_image(left_softkey_icon),
  495.         get_string(right_softkey),
  496.         get_image(right_softkey_icon),
  497.         number_of_items);
  498.     if (list_of_descriptions == NULL)
  499.     {
  500.         for (i = 0; i < number_of_items; i++)
  501.         {
  502.             add_fixed_icontext_item((UI_string_type) list_of_items[i], wgui_get_list_menu_icon(i, list_of_icons[i]));
  503.             wgui_pop_up_description_strings[i].text_strings[0] = NULL;
  504.         }
  505.     }
  506.     else
  507.     {
  508.         for (i = 0; i < number_of_items; i++)
  509.         {
  510.             add_fixed_icontext_item((UI_string_type) list_of_items[i], wgui_get_list_menu_icon(i, list_of_icons[i]));
  511.             wgui_pop_up_description_strings[i].text_strings[0] = (UI_string_type) list_of_descriptions[i];
  512.         }
  513.     }
  514. h_flag = set_list_menu_category_history(MMI_CATEGORY52_ID, history_buffer);
  515. #ifdef __MMI_UI_HINTS_IN_MENUITEM__
  516.     if (list_of_descriptions != NULL)
  517.     {
  518.         S32 hints = 0;
  519.         for (i = 0; i < number_of_items; i++)
  520.         {
  521.             if (wgui_pop_up_description_strings[i].text_strings[0])
  522.             {
  523.                 hints = 1;
  524.                 break;
  525.             }
  526.         }
  527.         if (hints)
  528.         {
  529.             if (is_set_force_icon_on_highlight_only_in_menuitem())
  530.             {
  531.                 wgui_show_icon_only_highlight_in_icontext_menuitem();
  532.             }
  533.             if (is_set_force_all_hints_in_menuitem())
  534.             {
  535.                 wgui_enable_hints_in_icontext_menuitem();
  536.             }
  537.             else if (is_set_force_hints_on_highlight_in_menuitem())
  538.             {
  539.                 wgui_enable_hint_highlight_in_icontext_menuitem();
  540.             }
  541.             else
  542.             {
  543.                 wgui_enable_hint_highlight_in_icontext_menuitem();
  544.             }
  545.             set_pop_up_descriptions(1, number_of_items, MMI_fixed_list_menu.highlighted_item);
  546.         #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  547.             gui_block_list_effect();
  548.         #endif 
  549.         }
  550.     }
  551. #endif /* __MMI_UI_HINTS_IN_MENUITEM__ */ 
  552.     if (h_flag)
  553.     {
  554.         fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
  555.     }
  556.     else
  557.     {
  558.         fixed_list_goto_item_no_redraw(highlighted_item);
  559.     }
  560.     MMI_title_string = (UI_string_type) title;
  561.     MMI_title_icon = (PU8) get_image(title_icon);
  562.     set_pop_up_descriptions(1, number_of_items, MMI_fixed_list_menu.highlighted_item);
  563.     gdi_layer_unlock_frame_buffer();
  564. disable_softkey_background();
  565. wgui_set_title_bknd_display(MMI_FALSE);
  566. dm_set_scr_bg_image(IMG_GLOBAL_SUB_MENU_BG_2, NULL, -1, -1, current_MMI_theme->bg_opacity_full);
  567.     dm_get_scr_bg_flag(&mm_bg_flags);
  568.     dm_set_scr_bg_flag(mm_bg_flags | DM_SCR_BG_FORCE_SHOW);
  569.     ExitCategoryFunction = ExitListCategoryScreen;
  570.     dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  571.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  572. #ifdef __MMI_UI_TAB_PANE__
  573.     if(is_enabled_tab_pane())
  574.     {
  575.         if(MMI_tab_control.type == TAB_CONTROL_WITH_THREE_ICON 
  576.             || MMI_tab_control.type == TAB_CONTROL_WITH_FOUR_ICON)
  577.         {
  578.             dm_data.s32CatId = MMI_CATEGORY54_ID;
  579.             dm_register_category_controlled_callback(dm_list_category_controlled_area);
  580.         }
  581.         else if(MMI_tab_control.type == TAB_CONTROL_WITH_ONE_ICON)
  582.         {
  583.             dm_data.s32CatId = MMI_CATEGORY55_ID;
  584.         }
  585.     }
  586.     else
  587. #endif
  588.     dm_data.s32CatId = MMI_CATEGORY52_ID;
  589.     dm_data.s32flags |= DM_CLEAR_SCREEN_BACKGROUND | DM_NO_STATUS_BAR | DM_BUTTON_DISABLE_BACKGROUND;
  590.     dm_setup_data(&dm_data);
  591.     dm_redraw_category_screen();
  592. }   /* end of ShowCategory353Screen */
  593. /*****************************************************************************
  594.  * FUNCTION
  595.  *  ShowCategory55Screen
  596.  * DESCRIPTION
  597.  *  Displays the category55 screen
  598.  * PARAMETERS
  599.  *  title                       [IN]        Title for the screen
  600.  *  title_icon                  [IN]        Icon shown with the title
  601.  *  left_softkey                [IN]        Left softkey label
  602.  *  left_softkey_icon           [IN]        Icon for the left softkey
  603.  *  right_softkey               [IN]        Right softkey label
  604.  *  right_softkey_icon          [IN]        Icon for the right softkey
  605.  *  number_of_items             [IN]        Number of items
  606.  *  list_of_items               [IN]        List of text items.
  607.  *  list_of_descriptions        [IN]        
  608.  *  highlighted_item            [IN]        This is the default item that will be highlighted (if there is no history)
  609.  *  history_buffer              [IN]        History buffer
  610.  * RETURNS
  611.  *  void
  612.  *****************************************************************************/
  613. void ShowCategory55Screen(
  614.         U16 title,
  615.         U16 title_icon,
  616.         U16 left_softkey,
  617.         U16 left_softkey_icon,
  618.         U16 right_softkey,
  619.         U16 right_softkey_icon,
  620.         S32 number_of_items,
  621.         U16 *list_of_items,
  622.         U8 **list_of_descriptions,
  623.         S32 highlighted_item,
  624.         U8 *history_buffer)
  625. {
  626.     /*----------------------------------------------------------------*/
  627.     /* Local Variables                                                */
  628.     /*----------------------------------------------------------------*/
  629.     U8 i = 0;
  630.     /*----------------------------------------------------------------*/
  631.     /* Code Body                                                      */
  632.     /*----------------------------------------------------------------*/
  633.     for (i = 0; i < number_of_items; i++)
  634.     {
  635.         subMenuDataPtrs[i] = (PU8) get_string(list_of_items[i]);
  636.     }
  637.     ShowCategory6Screen(
  638.         title,
  639.         title_icon,
  640.         left_softkey,
  641.         left_softkey_icon,
  642.         right_softkey,
  643.         right_softkey_icon,
  644.         number_of_items,
  645.         subMenuDataPtrs,
  646.         list_of_descriptions,
  647.         highlighted_item,
  648.         history_buffer);
  649. }   /* end of ShowCategory55Screen */
  650. /*****************************************************************************
  651.  * FUNCTION
  652.  *  ShowCategory56Screen
  653.  * DESCRIPTION
  654.  *  Displays the category56 screen
  655.  * PARAMETERS
  656.  *  title                       [IN]        Title for the screen
  657.  *  title_icon                  [IN]        Icon shown with the title
  658.  *  left_softkey                [IN]        Left softkey label
  659.  *  left_softkey_icon           [IN]        Icon for the left softkey
  660.  *  right_softkey               [IN]        Right softkey label
  661.  *  right_softkey_icon          [IN]        Icon for the right softkey
  662.  *  number_of_items             [IN]        Number of items
  663.  *  list_of_items               [IN]        List of text items.
  664.  *  list_of_descriptions        [IN]        
  665.  *  highlighted_item            [IN]        This is the default item that will be highlighted (if there is no history)
  666.  *  history_buffer              [IN]        History buffer
  667.  * RETURNS
  668.  *  void
  669.  *****************************************************************************/
  670. void ShowCategory56Screen(
  671.         U16 title,
  672.         U16 title_icon,
  673.         U16 left_softkey,
  674.         U16 left_softkey_icon,
  675.         U16 right_softkey,
  676.         U16 right_softkey_icon,
  677.         S32 number_of_items,
  678.         U8 **list_of_items,
  679.         U8 **list_of_descriptions,
  680.         S32 highlighted_item,
  681.         U8 *history_buffer)
  682. {
  683.     /*----------------------------------------------------------------*/
  684.     /* Local Variables                                                */
  685.     /*----------------------------------------------------------------*/
  686.     /*----------------------------------------------------------------*/
  687.     /* Code Body                                                      */
  688.     /*----------------------------------------------------------------*/
  689.     ShowCategory6Screen(
  690.         title,
  691.         title_icon,
  692.         left_softkey,
  693.         left_softkey_icon,
  694.         right_softkey,
  695.         right_softkey_icon,
  696.         number_of_items,
  697.         list_of_items,
  698.         list_of_descriptions,
  699.         highlighted_item,
  700.         history_buffer);
  701. }   /* end of ShowCategory56Screen */
  702. /*****************************************************************************
  703.  * FUNCTION
  704.  *  ShowCategory59Screen
  705.  * DESCRIPTION
  706.  *  Displays the category59 screen ( confirm image with text )
  707.  * PARAMETERS
  708.  *  title                   [IN]        Title for the screen
  709.  *  title_icon              [IN]        Icon displayed with the title
  710.  *  left_softkey            [IN]        Left softkey label
  711.  *  left_softkey_icon       [IN]        Left softkey icon
  712.  *  right_softkey           [IN]        Right softkey label
  713.  *  right_softkey_icon      [IN]        Right softkey icon
  714.  *  message                 [IN]        Notification message
  715.  *  message_icon            [IN]        
  716.  *  history_buffer          [IN]        History buffer
  717.  *  image(?)                [IN]        Notification image
  718.  * RETURNS
  719.  *  void
  720.  *****************************************************************************/
  721. void ShowCategory59Screen(
  722.         U16 title,
  723.         U16 title_icon,
  724.         U16 left_softkey,
  725.         U16 left_softkey_icon,
  726.         U16 right_softkey,
  727.         U16 right_softkey_icon,
  728.         U8 *message,
  729.         U16 message_icon,
  730.         U8 *history_buffer)
  731. {
  732.     /*----------------------------------------------------------------*/
  733.     /* Local Variables                                                */
  734.     /*----------------------------------------------------------------*/
  735.     dm_data_struct dm_data;
  736.     S32 l;
  737.     /*----------------------------------------------------------------*/
  738.     /* Code Body                                                      */
  739.     /*----------------------------------------------------------------*/
  740.     dm_reset_context();
  741.     gdi_layer_lock_frame_buffer();
  742.     MMI_menu_shortcut_number = -1;
  743.     change_left_softkey(left_softkey, left_softkey_icon);
  744.     change_right_softkey(right_softkey, right_softkey_icon);
  745.     SetupCategoryKeyHandlers();
  746.     MMI_title_string = (UI_string_type) get_string(title);
  747.     MMI_title_icon = (PU8) get_image(title_icon);
  748.     MMI_message_string = (UI_string_type) message;
  749.     l = gui_strlen(MMI_message_string);
  750.     create_multiline_inputbox_set_buffer(MMI_message_string, l, l, 0);
  751.     dm_add_image(get_image(message_icon), NULL, NULL);
  752.     MMI_multiline_inputbox.flags |=
  753.         (UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW | UI_MULTI_LINE_INPUT_BOX_DISABLE_BACKGROUND |
  754.          UI_MULTI_LINE_INPUT_BOX_DISABLE_SCROLLBAR | UI_MULTI_LINE_INPUT_BOX_CENTER_JUSTIFY);
  755.     gdi_layer_unlock_frame_buffer();
  756.     dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  757.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  758.     dm_data.s32CatId = MMI_CATEGORY59_ID;
  759.     dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
  760.     dm_setup_data(&dm_data);
  761.     dm_redraw_category_screen();
  762. }   /* end of ShowCategory59Screen */
  763. /*****************************************************************************
  764.  * FUNCTION
  765.  *  ExitCategory59Screen
  766.  * DESCRIPTION
  767.  *  Exits the category59 screen
  768.  * PARAMETERS
  769.  *  void
  770.  * RETURNS
  771.  *  void
  772.  *****************************************************************************/
  773. void ExitCategory59Screen(void)
  774. {
  775.     /*----------------------------------------------------------------*/
  776.     /* Local Variables                                                */
  777.     /*----------------------------------------------------------------*/
  778.     /*----------------------------------------------------------------*/
  779.     /* Code Body                                                      */
  780.     /*----------------------------------------------------------------*/
  781.     gui_hide_animations();
  782. }   /* end of ExitCategory59Screen */
  783. /*****************************************************************************
  784.  * FUNCTION
  785.  *  ShowCategory61Screen
  786.  * DESCRIPTION
  787.  *  Displays the category61 screen (Aphorisms screen)
  788.  * PARAMETERS
  789.  *  message             [IN]        Message string
  790.  *  message_icon        [IN]        Message icon
  791.  *  history_buffer      [IN]        History buffer
  792.  * RETURNS
  793.  *  void
  794.  *****************************************************************************/
  795. void ShowCategory61Screen(U8 *message, U16 message_icon, U8 *history_buffer)
  796. {
  797.     /*----------------------------------------------------------------*/
  798.     /* Local Variables                                                */
  799.     /*----------------------------------------------------------------*/
  800.     dm_data_struct dm_data;
  801.     S32 l, width, height;
  802.     /*----------------------------------------------------------------*/
  803.     /* Code Body                                                      */
  804.     /*----------------------------------------------------------------*/
  805.     dm_reset_context();
  806.     UI_UNUSED_PARAMETER(history_buffer);
  807.     gdi_layer_lock_frame_buffer();
  808.     entry_full_screen();
  809.     MMI_menu_shortcut_number = -1;
  810.     clear_category_screen_key_handlers();
  811.     clear_left_softkey();
  812.     clear_right_softkey();
  813.     MMI_message_string = (UI_string_type) message;
  814.     MMI_message_icon = (PU8) get_image(message_icon);
  815.     gui_measure_image(MMI_message_icon, &width, &height);
  816.     l = gui_strlen(MMI_message_string);
  817.     create_multiline_inputbox_set_buffer(MMI_message_string, l, l, 0);
  818.     MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW
  819.         | UI_MULTI_LINE_INPUT_BOX_CENTER_JUSTIFY
  820.         | UI_MULTI_LINE_INPUT_BOX_DISABLE_BACKGROUND
  821.         | UI_MULTI_LINE_INPUT_BOX_DISABLE_SCROLLBAR | UI_MULTI_LINE_INPUT_BOX_VIEW_MODE;
  822.     dm_add_image(MMI_message_icon, NULL, NULL);
  823.     gdi_layer_unlock_frame_buffer();
  824.     ExitCategoryFunction = MMI_dummy_function;
  825.     dm_setup_category_functions(dm_redraw_category_screen, dummy_get_history, dummy_get_history_size);
  826.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  827.     dm_data.s32CatId = MMI_CATEGORY61_ID;
  828.     dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
  829.     dm_setup_data(&dm_data);
  830.     dm_redraw_category_screen();
  831. }   /* end of ShowCategory61Screen */
  832. /* 101205 irda Calvin Start */
  833. #ifdef __MMI_MAINLCD_240X320__
  834. extern UI_filled_area wgui_pop_up_dialog_background;
  835. #endif 
  836. /*****************************************************************************
  837.  * FUNCTION
  838.  *  cat66_update_progress_string
  839.  * DESCRIPTION
  840.  *  Update status of progress for category66screen
  841.  * PARAMETERS
  842.  *  void
  843.  * RETURNS
  844.  *  void
  845.  *****************************************************************************/
  846. void cat66_update_progress_string(void)
  847. {
  848.     /*----------------------------------------------------------------*/
  849.     /* Local Variables                                                */
  850.     /*----------------------------------------------------------------*/
  851.     /*----------------------------------------------------------------*/
  852.     /* Code Body                                                      */
  853.     /*----------------------------------------------------------------*/
  854.     gdi_layer_lock_frame_buffer();
  855.     gdi_layer_push_clip();
  856.     gdi_layer_set_clip(
  857.         MMI_multiline_inputbox.x,
  858.         MMI_multiline_inputbox.y,
  859.         MMI_multiline_inputbox.x + MMI_multiline_inputbox.width - 1,
  860.         MMI_multiline_inputbox.y + MMI_multiline_inputbox.height - 1);
  861. #ifdef __MMI_MAINLCD_240X320__
  862.     gui_fill_rectangle(
  863.         MMI_multiline_inputbox.x,
  864.         MMI_multiline_inputbox.y,
  865.         MMI_multiline_inputbox.x + MMI_multiline_inputbox.width - 1,
  866.         MMI_multiline_inputbox.y + MMI_multiline_inputbox.height - 1,
  867.         wgui_pop_up_dialog_background.c);
  868. #else /* __MMI_MAINLCD_240X320__ */ 
  869.     gui_fill_rectangle(
  870.         MMI_multiline_inputbox.x,
  871.         MMI_multiline_inputbox.y,
  872.         MMI_multiline_inputbox.x + MMI_multiline_inputbox.width - 1,
  873.         MMI_multiline_inputbox.y + MMI_multiline_inputbox.height - 1,
  874.         UI_COLOR_WHITE);
  875. #endif /* __MMI_MAINLCD_240X320__ */ 
  876.     show_multiline_inputbox();
  877.     gdi_layer_pop_clip();
  878.     gdi_layer_unlock_frame_buffer();
  879.     gdi_layer_blt_previous(
  880.         MMI_multiline_inputbox.x,
  881.         MMI_multiline_inputbox.y,
  882.         MMI_multiline_inputbox.x + MMI_multiline_inputbox.width - 1,
  883.         MMI_multiline_inputbox.y + MMI_multiline_inputbox.height - 1);
  884. }   /* end of cat66_update_progress_string */
  885. /* 101205 irda Calvin Start */
  886. /*****************************************************************************
  887.  * FUNCTION
  888.  *  ShowCategory66Screen
  889.  * DESCRIPTION
  890.  *  Displays the category66 screen
  891.  * PARAMETERS
  892.  *  title                   [IN]        Title for the screen
  893.  *  title_icon              [IN]        Icon shown with the title
  894.  *  left_softkey            [IN]        Left softkey label
  895.  *  left_softkey_icon       [IN]        Icon for the left softkey
  896.  *  right_softkey           [IN]        Right softkey label
  897.  *  right_softkey_icon      [IN]        Icon for the right softkey
  898.  *  message                 [IN]        Notification message
  899.  *  message_icon            [IN]        
  900.  *  history_buffer          [IN]        History buffer
  901.  *  image(?)                [IN]        Notification image
  902.  * RETURNS
  903.  *  void
  904.  *****************************************************************************/
  905. void ShowCategory66Screen(
  906.         U16 title,
  907.         U16 title_icon,
  908.         U16 left_softkey,
  909.         U16 left_softkey_icon,
  910.         U16 right_softkey,
  911.         U16 right_softkey_icon,
  912.         U8 *message,
  913.         U16 message_icon,
  914.         U8 *history_buffer)
  915. {
  916.     /*----------------------------------------------------------------*/
  917.     /* Local Variables                                                */
  918.     /*----------------------------------------------------------------*/
  919.     dm_data_struct dm_data;
  920.     U8 dm_screen_type = DM_TITLE_AREA_NORMAL;
  921.     S32 l = 0;
  922.     PU8 image;
  923.     /*----------------------------------------------------------------*/
  924.     /* Code Body                                                      */
  925.     /*----------------------------------------------------------------*/
  926.     dm_reset_context();
  927. #if defined (__MMI_MAINLCD_240X320__) && defined(__MMI_UI_SMALL_SCREEN_SUPPORT__)
  928.     set_small_screen();
  929.     entry_full_screen();
  930. #endif /* defined (__MMI_MAINLCD_240X320__) && defined(__MMI_UI_SMALL_SCREEN_SUPPORT__) */ 
  931.     UI_UNUSED_PARAMETER(history_buffer);
  932.     gdi_layer_lock_frame_buffer();
  933.     MMI_menu_shortcut_number = -1;
  934.     clear_category_screen_key_handlers();
  935.     clear_left_softkey();
  936.     clear_right_softkey();
  937.     dm_data.s32flags = 0;
  938.     if ((left_softkey == 0) && (left_softkey_icon == 0) && (right_softkey == 0) && (right_softkey_icon == 0))
  939.     {
  940.         dm_data.s32flags |= DM_NO_SOFTKEY;
  941.     }
  942.     else
  943.     {
  944.         dm_data.s32flags &= ~DM_NO_SOFTKEY;
  945.         change_left_softkey(left_softkey, left_softkey_icon);
  946.         change_right_softkey(right_softkey, right_softkey_icon);
  947.         register_left_softkey_handler();
  948.         register_right_softkey_handler();
  949.         register_default_hide_softkeys();
  950.     }
  951.     if ((title == 0) && (title_icon == 0))
  952.     {
  953.         dm_screen_type = DM_TITLE_AREA_STATUS_ICON_ONLY;
  954.         ShowStatusIconsTitle();
  955.     }
  956.     else if (!((title == 0xffff) && (title_icon == 0xffff)))
  957.     {
  958.         dm_screen_type = DM_TITLE_AREA_NORMAL;
  959.         MMI_title_string = (UI_string_type) get_string(title);
  960.         MMI_title_icon = (PU8) get_image(title_icon);
  961.     }
  962.     else
  963.     {
  964.         dm_screen_type = DM_TITLE_AREA_NONE;
  965.     }
  966.     MMI_message_string = (UI_string_type) message;
  967.     image = (PU8) get_image(message_icon);
  968.     l = gui_strlen(MMI_message_string);
  969.     create_multiline_inputbox_set_buffer(MMI_message_string, l, l, 0);
  970.     MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW
  971.         | UI_MULTI_LINE_INPUT_BOX_CENTER_JUSTIFY
  972.         | UI_MULTI_LINE_INPUT_BOX_DISABLE_BACKGROUND
  973.         | UI_MULTI_LINE_INPUT_BOX_DISABLE_SCROLLBAR | UI_MULTI_LINE_INPUT_BOX_VIEW_MODE;
  974.     dm_add_image(image, NULL, NULL);
  975.     gdi_layer_unlock_frame_buffer();
  976.     ExitCategoryFunction = ExitCategory66Screen;
  977.     dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  978.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  979.     switch (dm_screen_type)
  980.     {
  981.         case DM_TITLE_AREA_NONE:
  982.             dm_data.s32CatId = MMI_CATEGORY66_NONE_ID;
  983.             break;
  984.         case DM_TITLE_AREA_STATUS_ICON_ONLY:
  985.             dm_data.s32CatId = MMI_CATEGORY66_STATUS_ICON_ID;
  986.             break;
  987.         case DM_TITLE_AREA_NORMAL:
  988.             dm_data.s32CatId = MMI_CATEGORY66_NORMAL_ID;
  989.             break;
  990.     }
  991. #ifndef __MMI_MAINLCD_240X320__
  992.     dm_data.s32flags |= DM_CLEAR_SCREEN_BACKGROUND;
  993. #endif 
  994.     dm_setup_data(&dm_data);
  995.     dm_redraw_category_screen();
  996. }   /* end of ShowCategory66Screen */
  997. /*****************************************************************************
  998.  * FUNCTION
  999.  *  ExitCategory66Screen
  1000.  * DESCRIPTION
  1001.  *  Exits the category66 screen
  1002.  * PARAMETERS
  1003.  *  void
  1004.  * RETURNS
  1005.  *  void
  1006.  *****************************************************************************/
  1007. void ExitCategory66Screen(void)
  1008. {
  1009.     /*----------------------------------------------------------------*/
  1010.     /* Local Variables                                                */
  1011.     /*----------------------------------------------------------------*/
  1012.     /*----------------------------------------------------------------*/
  1013.     /* Code Body                                                      */
  1014.     /*----------------------------------------------------------------*/
  1015. #if defined (__MMI_MAINLCD_240X320__) && defined(__MMI_UI_SMALL_SCREEN_SUPPORT__)
  1016.     reset_small_screen();
  1017. #endif 
  1018.     close_status_icons();
  1019.     gui_hide_animations();
  1020.     wgui_category_screen_no_buttons = 0;
  1021.     category_screen_layout_flags = 0;
  1022. }   /* end of ExitCategory66Screen */
  1023. /*****************************************************************************
  1024.  * FUNCTION
  1025.  *  wgui_hide_multitap
  1026.  * DESCRIPTION
  1027.  *  Hide function for multitap
  1028.  * PARAMETERS
  1029.  *  void
  1030.  * RETURNS
  1031.  *  void
  1032.  *****************************************************************************/
  1033. void wgui_hide_multitap(void)
  1034. {
  1035.     /*----------------------------------------------------------------*/
  1036.     /* Local Variables                                                */
  1037.     /*----------------------------------------------------------------*/
  1038.     color c;
  1039.     /*----------------------------------------------------------------*/
  1040.     /* Code Body                                                      */
  1041.     /*----------------------------------------------------------------*/
  1042.     c.r = 255;
  1043.     c.g = 255;
  1044.     c.b = 255;
  1045.     c.alpha = 100;
  1046.     gui_reset_clip();
  1047.     gui_fill_rectangle(
  1048.         MMI_multitap_x,
  1049.         MMI_multitap_y,
  1050.         MMI_multitap_x + MMI_multitap_width + 1,
  1051.         MMI_multitap_y + MMI_multitap_height + 1,
  1052.         c);
  1053. }   /* end of wgui_hide_multitap */
  1054. /*****************************************************************************
  1055.  * FUNCTION
  1056.  *  SetCategory69RightSoftkeyFunction
  1057.  * DESCRIPTION
  1058.  *  
  1059.  * PARAMETERS
  1060.  *  f       [IN]        
  1061.  *  k       [IN]        
  1062.  * RETURNS
  1063.  *  void
  1064.  *****************************************************************************/
  1065. void SetCategory69RightSoftkeyFunction(void (*f) (void), MMI_key_event_type k)
  1066. {
  1067.     /*----------------------------------------------------------------*/
  1068.     /* Local Variables                                                */
  1069.     /*----------------------------------------------------------------*/
  1070.     /*----------------------------------------------------------------*/
  1071.     /* Code Body                                                      */
  1072.     /*----------------------------------------------------------------*/
  1073.     UI_UNUSED_PARAMETER(k);
  1074.     wgui_singleline_inputbox_RSK_function = f;
  1075. }
  1076. /*****************************************************************************
  1077.  * FUNCTION
  1078.  *  cat69_virtual_keypad_callback
  1079.  * DESCRIPTION
  1080.  *  Displays the category69 screen
  1081.  * PARAMETERS
  1082.  *  void
  1083.  *  BYTE(?)                                     [IN]        *        history_buffer    history buffer
  1084.  *  INPUT_TYPE_ALPHANUMERIC_SENTENCECASE(?)     [IN]        
  1085.  *  INPUT_TYPE(?)                               [IN]        Can take the following values:
  1086.  *  INPUT_TYPE_ALPHANUMERIC_LOWERCASE(?)        [IN]        
  1087.  *  INPUT_TYPE_NUMERIC(?)                       [IN]        
  1088.  *  below(?)                                    [IN]        
  1089.  *  INPUT_TYPE_ALPHANUMERIC_PASSWORD(?)         [IN]        (rare).
  1090.  *  INT(?)                                      [IN]        Buffer_size       Size of the buffer.
  1091.  *  INPUT_TYPE_ALPHANUMERIC_UPPERCASE(?)        [IN]        
  1092.  *  MMI_ID_TYPE(?)                              [IN]        Message,       Message
  1093.  *  INPUT_TYPE_NUMERIC_PASSWORD(?)              [IN]        
  1094.  *  For(?)                                      [IN]        Example, 5 means only 5 characters can be input in this screen.
  1095.  *  BUFFER(?)                                   [IN]        Buffer            Buffer the input box should use.
  1096.  * RETURNS
  1097.  *  void
  1098.  *****************************************************************************/
  1099. extern void ZiInuptMethodEnterSinglelineInputBox(void);
  1100. void cat69_virtual_keypad_callback(void)
  1101. {
  1102.     /*----------------------------------------------------------------*/
  1103.     /* Local Variables                                                */
  1104.     /*----------------------------------------------------------------*/
  1105.     /*----------------------------------------------------------------*/
  1106.     /* Code Body                                                      */
  1107.     /*----------------------------------------------------------------*/
  1108. #if defined(__MMI_TOUCH_SCREEN__)
  1109.     mmi_pen_editor_clear_and_show_virtual_keyboard_area();
  1110. #endif 
  1111. }
  1112. /*****************************************************************************
  1113.  * FUNCTION
  1114.  *  ShowCategory69Screen
  1115.  * DESCRIPTION
  1116.  *  
  1117.  * PARAMETERS
  1118.  *  title                   [IN]        
  1119.  *  title_icon              [IN]        
  1120.  *  left_softkey            [IN]        
  1121.  *  left_softkey_icon       [IN]        
  1122.  *  right_softkey           [IN]        
  1123.  *  right_softkey_icon      [IN]        
  1124.  *  message                 [IN]        
  1125.  *  input_type              [IN]        
  1126.  *  buffer                  [?]         
  1127.  *  buffer_size             [IN]        
  1128.  *  history_buffer          [?]         
  1129.  * RETURNS
  1130.  *  void
  1131.  *****************************************************************************/
  1132. void ShowCategory69Screen(
  1133.         U16 title,
  1134.         U16 title_icon,
  1135.         U16 left_softkey,
  1136.         U16 left_softkey_icon,
  1137.         U16 right_softkey,
  1138.         U16 right_softkey_icon,
  1139.         U16 message,
  1140.         S16 input_type,
  1141.         U8 *buffer,
  1142.         S32 buffer_size,
  1143.         U8 *history_buffer)
  1144. {
  1145.     /*----------------------------------------------------------------*/
  1146.     /* Local Variables                                                */
  1147.     /*----------------------------------------------------------------*/
  1148.     dm_data_struct dm_data;
  1149.     S32 h = 0, len;
  1150.     /*----------------------------------------------------------------*/
  1151.     /* Code Body                                                      */
  1152.     /*----------------------------------------------------------------*/
  1153.     UI_UNUSED_PARAMETER(message);
  1154.     gdi_layer_lock_frame_buffer();
  1155. #ifdef __MMI_ZI__
  1156.     ZiInuptMethodEnterSinglelineInputBox();
  1157. #endif 
  1158.     change_left_softkey(left_softkey, left_softkey_icon);
  1159.     change_right_softkey(right_softkey, right_softkey_icon);
  1160.     SetupCategoryKeyHandlers();
  1161.     MMI_menu_shortcut_number = -1;
  1162.     MMI_disable_title_shortcut_display = 1;
  1163.     if (title == 0)
  1164.     {
  1165.         dm_data.s32flags = DM_NO_TITLE;
  1166.     }
  1167.     else
  1168.     {
  1169.         dm_data.s32flags = 0;
  1170.         MMI_title_string = get_string(title);
  1171.         MMI_title_icon = get_image(title_icon);
  1172.     }
  1173.     MMI_message_string = (UI_string_type) get_string(message);
  1174.     len = gui_strlen(MMI_message_string);
  1175.     create_multiline_inputbox_set_buffer(MMI_message_string, len, len, 0);
  1176.     MMI_multiline_inputbox.flags |=
  1177.         (UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW | UI_MULTI_LINE_INPUT_BOX_CENTER_JUSTIFY |
  1178.          UI_MULTI_LINE_INPUT_BOX_DISABLE_BACKGROUND | UI_MULTI_LINE_INPUT_BOX_DISABLE_SCROLLBAR);
  1179.     wgui_setup_singleline_inputbox(
  1180.         4,
  1181.         MMI_multiline_inputbox.y + MMI_multiline_inputbox.height,
  1182.         UI_device_width - 8,
  1183.         h,
  1184.         buffer,
  1185.         buffer_size,
  1186.         MMI_CATEGORY111_ID,
  1187.         get_string(right_softkey),
  1188.         get_image(right_softkey_icon),
  1189.         input_type,
  1190.         history_buffer,
  1191.         0);
  1192.     register_hide_multitap(wgui_hide_multitap);
  1193.     gdi_layer_unlock_frame_buffer();
  1194.     ExitCategoryFunction = ExitCategory69Screen;
  1195.     dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  1196.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  1197.     dm_data.s32CatId = MMI_CATEGORY69_ID;
  1198.     dm_data.s32flags |= DM_CLEAR_SCREEN_BACKGROUND;
  1199.     dm_data.s32flags |= DM_SHOW_VKPAD;
  1200.     dm_register_vkpad_callback(cat69_virtual_keypad_callback);
  1201.     dm_setup_data(&dm_data);
  1202.     dm_redraw_category_screen();
  1203. }   /* end of ShowCategory69Screen */
  1204. /*****************************************************************************
  1205.  * FUNCTION
  1206.  *  ExitCategory69Screen
  1207.  * DESCRIPTION
  1208.  *  Exits the category69 screen
  1209.  * PARAMETERS
  1210.  *  void
  1211.  * RETURNS
  1212.  *  void
  1213.  *****************************************************************************/
  1214. void ExitCategory69Screen(void)
  1215. {
  1216.     /*----------------------------------------------------------------*/
  1217.     /* Local Variables                                                */
  1218.     /*----------------------------------------------------------------*/
  1219.     /*----------------------------------------------------------------*/
  1220.     /* Code Body                                                      */
  1221.     /*----------------------------------------------------------------*/
  1222.     set_MMI_current_input_type();
  1223.     wgui_switch_title_with_status_bar = 0;
  1224.     reset_softkeys();
  1225.     reset_multitaps();
  1226.     reset_multiline_inputbox();
  1227.     wgui_close_singleline_inputbox();
  1228. }   /* end of ExitCategory69Screen */
  1229. /* Temporary hardcoded filler for Pop up dialog screens  */
  1230. UI_filled_area bluewgui_color_dialog_background = {UI_FILLED_AREA_TYPE_COLOR,
  1231.     UI_NULL_IMAGE,
  1232.     NULL,
  1233.     {159, 159, 255, 100},
  1234.     {0, 0, 0, 0},
  1235.     {0, 0, 0, 100},
  1236.     {50, 50, 50, 100},
  1237.     0
  1238. };
  1239. #ifdef __MMI_MENSTRUAL__
  1240. /* Only used in cat72(Menstrual) */
  1241. UI_filled_area greygui_pop_up_dialog_background = {UI_FILLED_AREA_TYPE_COLOR | UI_FILLED_AREA_SINGLE_BORDER,
  1242.     UI_NULL_IMAGE,
  1243.     NULL,
  1244.     {192, 192, 192, 100},
  1245.     {0, 0, 0, 0},
  1246.     {0, 0, 0, 100},
  1247.     {50, 50, 50, 100},
  1248.     0
  1249. };
  1250. /* Only used in cat72(Menstrual) */
  1251. UI_filled_area purplegui_pop_up_dialog_background = {UI_FILLED_AREA_TYPE_COLOR | UI_FILLED_AREA_SINGLE_BORDER,
  1252.     UI_NULL_IMAGE,
  1253.     NULL,
  1254.     {149, 43, 255, 100},
  1255.     {0, 0, 0, 0},
  1256.     {0, 0, 0, 100},
  1257.     {50, 50, 50, 100},
  1258.     0
  1259. };
  1260. /* Only used in cat72(Menstrual) */
  1261. UI_filled_area whitegui_pop_up_dialog_background = {UI_FILLED_AREA_TYPE_COLOR | UI_FILLED_AREA_SINGLE_BORDER,
  1262.     UI_NULL_IMAGE,
  1263.     NULL,
  1264.     {255, 255, 255, 100},
  1265.     {0, 0, 0, 0},
  1266.     {0, 0, 0, 100},
  1267.     {50, 50, 50, 100},
  1268.     0
  1269. };
  1270. /*****************************************************************************
  1271.  * FUNCTION
  1272.  *  DrawCate72CategoryControlArea
  1273.  * DESCRIPTION
  1274.  *  Draws the category72 category control area
  1275.  * PARAMETERS
  1276.  *  coordinate      [IN/OUT]        Coordinates of category controlled area.
  1277.  * RETURNS
  1278.  *  void
  1279.  *****************************************************************************/
  1280. void DrawCate72CategoryControlArea(dm_coordinates *coordinate)
  1281. {
  1282.     /*----------------------------------------------------------------*/
  1283.     /* Local Variables                                                */
  1284.     /*----------------------------------------------------------------*/
  1285.     /*----------------------------------------------------------------*/
  1286.     /* Code Body                                                      */
  1287.     /*----------------------------------------------------------------*/
  1288.     RedrawCategory72Screen();
  1289. }
  1290. /*****************************************************************************
  1291.  * FUNCTION
  1292.  *  RedrawCategory72Screen
  1293.  * DESCRIPTION
  1294.  *  Redraws the category 72 screen
  1295.  * PARAMETERS
  1296.  *  void
  1297.  * RETURNS
  1298.  *  void
  1299.  *****************************************************************************/
  1300. void RedrawCategory72Screen(void)
  1301. {
  1302.     /*----------------------------------------------------------------*/
  1303.     /* Local Variables                                                */
  1304.     /*----------------------------------------------------------------*/
  1305.     S32 x2 = 0, w = 0, h = 0;
  1306.     S8 ascii_percent[50];
  1307.     S8 uni_percent[100];
  1308.     /*----------------------------------------------------------------*/
  1309.     /* Code Body                                                      */
  1310.     /*----------------------------------------------------------------*/
  1311.     memset(ascii_percent, 0, 50);
  1312.     gdi_layer_reset_clip();
  1313.     if (wgui_is_wallpaper_on_bottom() == MMI_TRUE)
  1314.     {
  1315.         gdi_draw_solid_rect(
  1316.             0,
  1317.             (MMI_title_y + MMI_title_height),
  1318.             UI_device_width,
  1319.             (UI_device_height - MMI_button_bar_height - 1),
  1320.             GDI_COLOR_TRANSPARENT);
  1321.     }
  1322.     else
  1323.     {
  1324.         gui_draw_filled_area(
  1325.             0,
  1326.             (MMI_title_y + MMI_title_height),
  1327.             UI_device_width,
  1328.             (UI_device_height - MMI_button_bar_height - 1),
  1329.             &greygui_pop_up_dialog_background);
  1330.     }
  1331.     gui_draw_filled_area(
  1332.         wgui_image_clip_x1,
  1333.         wgui_image_clip_y1,
  1334.         wgui_image_clip_x2,
  1335.         wgui_image_clip_y2,
  1336.         &whitegui_pop_up_dialog_background);
  1337.     x2 = wgui_image_clip_x1 + no_of_pixel;
  1338.     gui_draw_filled_area(
  1339.         wgui_image_clip_x1,
  1340.         wgui_image_clip_y1,
  1341.         x2,
  1342.         wgui_image_clip_y2,
  1343.         &purplegui_pop_up_dialog_background);
  1344.     sprintf((PS8) ascii_percent, "%d", (S16) no_of_pixel);
  1345.     strcat((PS8) ascii_percent, (PS8) "%");
  1346.     gui_set_text_color(UI_COLOR_BLACK);
  1347.     gui_measure_string((UI_string_type) uni_percent, &w, &h);
  1348.     if (r2lMMIFlag)
  1349.     {
  1350.         gui_move_text_cursor(((UI_device_width >> 1) - 10) + w, (wgui_image_clip_y2 + 5));
  1351.     }
  1352.     else
  1353.     {
  1354.         gui_move_text_cursor(((UI_device_width >> 1) - 10), (wgui_image_clip_y2 + 5));
  1355.     }
  1356.     memset(uni_percent, 0, 100);
  1357.     AnsiiToUnicodeString((PS8) uni_percent, (PS8) ascii_percent);
  1358.     gui_print_text((UI_string_type) uni_percent);
  1359.     show_multiline_inputbox();
  1360. }
  1361. /*****************************************************************************
  1362.  * FUNCTION
  1363.  *  ShowCategory72Screen
  1364.  * DESCRIPTION
  1365.  *  Displays the category72 screen
  1366.  * PARAMETERS
  1367.  *  title                   [IN]        Title for the screen
  1368.  *  title_icon              [IN]        Icon shown with the title
  1369.  *  left_softkey            [IN]        Left softkey label
  1370.  *  left_softkey_icon       [IN]        Icon for the Left softkey
  1371.  *  right_softkey           [IN]        Right softkey label
  1372.  *  right_softkey_icon      [IN]        Icon for the right softkey
  1373.  *  message                 [IN]        Message string
  1374.  *  percentage_value        [IN]        Percentage value (0 to 100)
  1375.  *  history_buffer          [IN]        History buffer
  1376.  * RETURNS
  1377.  *  void
  1378.  *****************************************************************************/
  1379. void ShowCategory72Screen(
  1380.         U16 title,
  1381.         U16 title_icon,
  1382.         U16 left_softkey,
  1383.         U16 left_softkey_icon,
  1384.         U16 right_softkey,
  1385.         U16 right_softkey_icon,
  1386.         U8 *message,
  1387.         S32 percentage_value,
  1388.         U8 *history_buffer)
  1389. {
  1390.     /*----------------------------------------------------------------*/
  1391.     /* Local Variables                                                */
  1392.     /*----------------------------------------------------------------*/
  1393.     dm_data_struct dm_data;
  1394.     S32 l, fh;
  1395.     /*----------------------------------------------------------------*/
  1396.     /* Code Body                                                      */
  1397.     /*----------------------------------------------------------------*/
  1398.     UI_UNUSED_PARAMETER(history_buffer);
  1399.     gdi_layer_lock_frame_buffer();
  1400.     MMI_menu_shortcut_number = -1;
  1401.     change_left_softkey(left_softkey, left_softkey_icon);
  1402.     change_right_softkey(right_softkey, right_softkey_icon);
  1403.     SetupCategoryKeyHandlers();
  1404.     MMI_title_string = (UI_string_type) get_string(title);
  1405.     MMI_title_icon = (PU8) get_image(title_icon);
  1406.     MMI_message_string = (UI_string_type) message;
  1407.     l = gui_strlen(MMI_message_string);
  1408.     create_multiline_inputbox_set_buffer(MMI_message_string, l, l, 0);
  1409.     MMI_multiline_inputbox.flags |=
  1410.         (UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW | UI_MULTI_LINE_INPUT_BOX_CENTER_JUSTIFY |
  1411.          UI_MULTI_LINE_INPUT_BOX_DISABLE_BACKGROUND | UI_MULTI_LINE_INPUT_BOX_DISABLE_SCROLLBAR);
  1412.     move_multiline_inputbox(0, (MMI_title_y + MMI_title_height) + 2);
  1413.     resize_multiline_inputbox(MMI_multiline_inputbox.width, MMI_content_height);
  1414.     show_multiline_inputbox_no_draw();
  1415.     gui_set_font(MMI_multiline_inputbox.text_font);
  1416.     fh = get_multiline_inputbox_line_height();
  1417.     resize_multiline_inputbox(
  1418.         MMI_multiline_inputbox.width,
  1419.         (MMI_multiline_inputbox.n_lines * fh) + MULTILINE_INPUTBOX_HEIGHT_PAD + MMI_multiline_inputbox.text_y);
  1420.     wgui_image_clip_x1 = ((UI_device_width >> 1) - 50);
  1421.     wgui_image_clip_y1 = (U16) (MMI_multiline_inputbox.y + MMI_multiline_inputbox.height);
  1422.     wgui_image_clip_x2 = ((UI_device_width >> 1) + 50);
  1423.     wgui_image_clip_y2 = (wgui_image_clip_y1 + 20);
  1424.     no_of_pixel = percentage_value;
  1425.     gdi_layer_unlock_frame_buffer();
  1426.     ExitCategoryFunction = ExitCategory72Screen;
  1427.     dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  1428.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  1429.     dm_data.s32CatId = MMI_CATEGORY72_ID;
  1430.     dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
  1431.     dm_setup_data(&dm_data);
  1432.     dm_register_category_controlled_callback(DrawCate72CategoryControlArea);
  1433.     dm_redraw_category_screen();
  1434. }
  1435. /*****************************************************************************
  1436.  * FUNCTION
  1437.  *  ExitCategory72Screen
  1438.  * DESCRIPTION
  1439.  *  Exits the category72 screen
  1440.  * PARAMETERS
  1441.  *  void
  1442.  * RETURNS
  1443.  *  void
  1444.  *****************************************************************************/
  1445. void ExitCategory72Screen(void)
  1446. {
  1447.     /*----------------------------------------------------------------*/
  1448.     /* Local Variables                                                */
  1449.     /*----------------------------------------------------------------*/
  1450.     /*----------------------------------------------------------------*/
  1451.     /* Code Body                                                      */
  1452.     /*----------------------------------------------------------------*/
  1453.     gui_hide_animations();
  1454. }
  1455. #endif /* __MMI_MENSTRUAL__ */ 
  1456. /*****************************************************************************
  1457.  * FUNCTION
  1458.  *  Category73RedrawScreen
  1459.  * DESCRIPTION
  1460.  *  Draw category 73 screen without invoking animation effect again
  1461.  *  It can be used to update the display content of category 73
  1462.  *
  1463.  *  Remark: this function only support ICON_ICON_TEXT style; other styles unsupported yet
  1464.  *
  1465.  * PARAMETERS
  1466.  *  void
  1467.  * RETURNS
  1468.  *  void
  1469.  *****************************************************************************/
  1470. static CAT73DISPLAY g_wgui_cat73_display_flag;
  1471. void Category73RedrawScreen(void)
  1472. {
  1473.     /*----------------------------------------------------------------*/
  1474.     /* Local Variables                                                */
  1475.     /*----------------------------------------------------------------*/
  1476.     /*----------------------------------------------------------------*/
  1477.     /* Code Body                                                      */
  1478.     /*----------------------------------------------------------------*/
  1479. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1480.     gui_block_list_effect();
  1481. #endif
  1482.     /* Recalculate icon/text coordinates if icon is changed */
  1483.     if (g_wgui_cat73_display_flag == ICON_ICON_TEXT)
  1484.     {
  1485.         S32 i, w1 = 0, w2 = 0, h1 = 0, h2 = 0, iw, ih;
  1486.         PU8 img;
  1487.         for (i = 0; i < MMI_fixed_list_menu.n_items; i++)
  1488.         {
  1489.             img = MMI_fixed_icontext_list_menuitems[i].item_icons[0];
  1490.             if (img)
  1491.             {
  1492.                 gui_measure_image(img, &iw, &ih);
  1493.                 if (iw > w1)
  1494.                 {
  1495.                     w1 = iw; 
  1496.                 }
  1497.                 if (ih > h1)
  1498.                 {
  1499.                     h1 = ih;
  1500.                 }
  1501.             }
  1502.             img = MMI_fixed_icontext_list_menuitems[i].item_icons[1];
  1503.             if (img)
  1504.             {
  1505.                 gui_measure_image(img, &iw, &ih);
  1506.                 if (iw > w2)
  1507.                 {
  1508.                     w2 = iw; 
  1509.                 }
  1510.                 if (ih > h2)
  1511.                 {
  1512.                     h2 = ih;
  1513.                 }
  1514.             }            
  1515.         }
  1516.         if (!w1 || !h1)
  1517.         {
  1518.             w1 = 9;
  1519.             h1 = 18;
  1520.         }
  1521.         if (!w2 || !h2)
  1522.         {
  1523.             w2 = 9;
  1524.             h2 = 18;
  1525.         }
  1526.     
  1527.         set_fixed_icontext_list_icon_coordinates(0, 2, 0, w1, h1);
  1528.         set_fixed_icontext_list_icon_coordinates(1, (w1 + 5), 0, w2, h2);
  1529.         set_fixed_icontext_list_text_coordinates(
  1530.             0,
  1531.             (w1 + w2 + 10),
  1532.             0,
  1533.             UI_device_width - (w1 + w2 + 10) - MMI_fixed_list_menu.vbar.width,
  1534.             MMI_MENUITEM_HEIGHT);
  1535.     }
  1536.     RedrawCategoryFunction();
  1537. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  1538.     gui_unblock_list_effect();
  1539. #endif
  1540. }
  1541. /*****************************************************************************
  1542.  * FUNCTION
  1543.  *  Category73ChangeItemIcon
  1544.  * DESCRIPTION
  1545.  *  Change the icon of category 73
  1546.  *  Please use Category73RedrawScreen() to redraw after data changed
  1547.  * PARAMETERS
  1548.  *  item_index      [IN]    menu item index
  1549.  *  icon_index      [IN]    icon index (0 or 1)
  1550.  *  icon            [IN]    icon image
  1551.  * RETURNS
  1552.  *  void
  1553.  *****************************************************************************/
  1554. void Category73ChangeItemIcon(S32 item_index, S32 icon_index, PU8 icon)
  1555. {
  1556.     /*----------------------------------------------------------------*/
  1557.     /* Local Variables                                                */
  1558.     /*----------------------------------------------------------------*/
  1559.     /*----------------------------------------------------------------*/
  1560.     /* Code Body                                                      */
  1561.     /*----------------------------------------------------------------*/
  1562.     if (icon_index < 2)
  1563.     {
  1564.         MMI_fixed_icontext_list_menuitems[item_index].item_icons[icon_index] = icon;
  1565.     }
  1566. }
  1567. /*****************************************************************************
  1568.  * FUNCTION
  1569.  *  ShowCategory73Screen
  1570.  * DESCRIPTION
  1571.  *  Displays the category73 screen
  1572.  * PARAMETERS
  1573.  *  title                   [IN]        Title for the screen
  1574.  *  title_icon              [IN]        Icon shown with the title
  1575.  *  left_softkey            [IN]        Left softkey label
  1576.  *  left_softkey_icon       [IN]        Icon for the Left softkey
  1577.  *  right_softkey           [IN]        Right softkey label
  1578.  *  right_softkey_icon      [IN]        Icon for the right softkey
  1579.  *  number_of_items         [IN]        Number of items
  1580.  *  list_of_items           [IN]        List of text items
  1581.  *  list_of_icons1          [IN]        List for first column of icons
  1582.  *  list_of_icons2          [IN]        List for second column of icons
  1583.  *  highlighted_item        [IN]        Default item to be highlighted(if there is no history)
  1584.  *  history_buffer          [IN]        History buffer
  1585.  *  u8display_flag          [IN]        
  1586.  * RETURNS
  1587.  *  void
  1588.  *****************************************************************************/
  1589. void ShowCategory73Screen(
  1590.         U16 title,
  1591.         U16 title_icon,
  1592.         U16 left_softkey,
  1593.         U16 left_softkey_icon,
  1594.         U16 right_softkey,
  1595.         U16 right_softkey_icon,
  1596.         S32 number_of_items,
  1597.         U8 **list_of_items,
  1598.         U16 *list_of_icons1,
  1599.         U16 *list_of_icons2,
  1600.         S32 highlighted_item,
  1601.         U8 *history_buffer,
  1602.         U8 u8display_flag)
  1603. {
  1604.     /*----------------------------------------------------------------*/
  1605.     /* Local Variables                                                */
  1606.     /*----------------------------------------------------------------*/
  1607.     dm_data_struct dm_data;
  1608.     S32 text_width;
  1609.     S32 i = 0, w1 = 0, w2 = 0, h1 = 0, h2 = 0, temp_w = 0, temp_h = 0;
  1610.     U8 h_flag, mm_bg_flags;
  1611.     U8 *img = NULL;
  1612.     /*----------------------------------------------------------------*/
  1613.     /* Code Body                                                      */
  1614.     /*----------------------------------------------------------------*/
  1615.     g_wgui_cat73_display_flag = u8display_flag;
  1616.     
  1617.     gdi_layer_lock_frame_buffer();
  1618.     create_fixed_icontext_list_menuitems(1, 2);
  1619.     associate_fixed_icontext_list_list();
  1620. MMI_disable_title_shortcut_display = 1;
  1621. MMI_fixed_list_menu.flags |= UI_LIST_MENU_LOOP | UI_LIST_MENU_DISABLE_BACKGROUND | UI_LIST_MENU_DISABLE_BKGRND_IN_LAYER;
  1622.                
  1623.     ShowListCategoryScreen(
  1624.         get_string(title),
  1625.         get_image(title_icon),
  1626.         get_string(left_softkey),
  1627.         get_image(left_softkey_icon),
  1628.         get_string(right_softkey),
  1629.         get_image(right_softkey_icon),
  1630.         number_of_items);
  1631.     resize_fixed_icontext_list_menuitems(0, MMI_MENUITEM_HEIGHT);
  1632.     text_width = (UI_device_width - MMI_fixed_list_menu.vbar.width - 57);
  1633.     img = (U8*) GetImage(list_of_icons1[0]);
  1634.     gui_measure_image(img, &w1, &h1);
  1635.     for (i = 1; i < number_of_items; i++)
  1636.     {
  1637.         img = (U8*) GetImage(list_of_icons1[i]);
  1638.         gui_measure_image(img, &temp_w, &temp_h);
  1639.         if (temp_w > w1)
  1640.         {
  1641.             w1 = temp_w;
  1642.         }
  1643.         if (temp_h > h1)
  1644.         {
  1645.             h1 = temp_h;
  1646.         }
  1647.     }
  1648.     if (w1 == 0)
  1649.     {
  1650.         w1 = 9;
  1651.     }
  1652.     if (h1 == 0)
  1653.     {
  1654.         h1 = 18;
  1655.     }
  1656.     temp_w = temp_h = 0;
  1657.     img = (U8*) GetImage(list_of_icons2[0]);
  1658.     gui_measure_image(img, &w2, &h2);
  1659.     for (i = 1; i < number_of_items; i++)
  1660.     {
  1661.         img = (U8*) GetImage(list_of_icons2[i]);
  1662.         gui_measure_image(img, &temp_w, &temp_h);
  1663.         if (temp_w > w2)
  1664.         {
  1665.             w2 = temp_w;
  1666.         }
  1667.         if (temp_h > h2)
  1668.         {
  1669.             h2 = temp_h;
  1670.         }
  1671.     }
  1672.     switch (u8display_flag)
  1673.     {
  1674.         case ICON_TEXT_ICON:
  1675.             set_fixed_icontext_list_icon_coordinates(0, 2, 0, w1, h1);
  1676.             if ((w2 == 0) && (h2 == 0))
  1677.             {
  1678.                 text_width = (UI_device_width - MMI_fixed_list_menu.vbar.width - (w1 + 10));
  1679.             }
  1680.             /* PMT HIMANSHU START 20051028 */
  1681.             set_fixed_icontext_list_text_coordinates(0, (w1 + 5), 0, text_width, MMI_MENUITEM_HEIGHT);
  1682.             /* PMT HIMANSHU END 20051028 */
  1683.             if ((w2 > 0) && (h2 > 0))
  1684.             {
  1685.                 set_fixed_icontext_list_icon_coordinates(1, (w1 + 10 + text_width), 0, w2, h2);
  1686.             }
  1687.             break;
  1688.         case ICON_ICON_TEXT:
  1689.             if (w2 == 0)
  1690.             {
  1691.                 w2 = 9;
  1692.             }
  1693.             if (h2 == 0)
  1694.             {
  1695.                 h2 = 18;
  1696.             }
  1697.             set_fixed_icontext_list_icon_coordinates(0, 2, 0, w1, h1);
  1698.             set_fixed_icontext_list_icon_coordinates(1, (w1 + 5), 0, w2, h2);
  1699.             /* PMT HIMANSHU START 20051028 */
  1700.             set_fixed_icontext_list_text_coordinates(
  1701.                 0,
  1702.                 (w1 + w2 + 10),
  1703.                 0,
  1704.                 UI_device_width - (w1 + w2 + 10) - MMI_fixed_list_menu.vbar.width,
  1705.                 MMI_MENUITEM_HEIGHT);
  1706.             /* PMT HIMANSHU END 20051028 */
  1707.             break;
  1708.         case TEXT_ICON_ICON:
  1709.             if (w2 == 0)
  1710.             {
  1711.                 w2 = 9;
  1712.             }
  1713.             if (h2 == 0)
  1714.             {
  1715.                 h2 = 18;
  1716.             }
  1717.             /* PMT HIMANSHU START 20051028 */
  1718.             set_fixed_icontext_list_text_coordinates(0, 2, 0, text_width, MMI_MENUITEM_HEIGHT);
  1719.             /* PMT HIMANSHU END 20051028 */
  1720.             set_fixed_icontext_list_icon_coordinates(1, (text_width + 5), 0, w1, h1);
  1721.             set_fixed_icontext_list_icon_coordinates(0, (w1 + text_width + 10), 0, w2, h2);
  1722.             break;
  1723.     }
  1724.     for (i = 0; i < number_of_items; i++)
  1725.     {
  1726.         fixed_icontext_list_item_insert(i);
  1727.         add_fixed_icontext_list_item_text(i, 0, (UI_string_type) list_of_items[i]);
  1728.         add_fixed_icontext_list_item_icon(i, 0, get_image(list_of_icons1[i]));
  1729.         add_fixed_icontext_list_item_icon(i, 1, wgui_get_list_menu_icon_if_not_empty(i, list_of_icons2[i]));
  1730.     }
  1731.     MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_RIGHT_JUSTIFY;
  1732.     h_flag = set_list_menu_category_history(MMI_CATEGORY73_ID, history_buffer);
  1733.     if (h_flag)
  1734.     {
  1735.         fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
  1736.     }
  1737.     else
  1738.     {
  1739.         fixed_list_goto_item_no_redraw(highlighted_item);
  1740.     }
  1741.     gdi_layer_unlock_frame_buffer();
  1742. wgui_set_title_bknd_display(MMI_FALSE);
  1743. dm_set_scr_bg_image(IMG_GLOBAL_SUB_MENU_BG_2, NULL, -1, -1, current_MMI_theme->bg_opacity_full);
  1744.     dm_get_scr_bg_flag(&mm_bg_flags);
  1745. dm_set_scr_bg_flag(mm_bg_flags | DM_SCR_BG_FORCE_SHOW);
  1746.     ExitCategoryFunction = ExitListCategoryScreen;
  1747.     dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  1748.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  1749.     dm_data.s32CatId = MMI_CATEGORY73_ID;
  1750.     dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND | DM_NO_STATUS_BAR;;
  1751.     dm_setup_data(&dm_data);
  1752.     dm_redraw_category_screen();
  1753. }
  1754. /*****************************************************************************
  1755.  * FUNCTION
  1756.  *  ChangeCategory74MessageString
  1757.  * DESCRIPTION
  1758.  *  Change the content of string used in category74.
  1759.  * PARAMETERS
  1760.  *  new_string      [IN]        New content of string
  1761.  * RETURNS
  1762.  *  void
  1763.  *****************************************************************************/
  1764. void ChangeCategory74MessageString(U8 *new_string)
  1765. {
  1766.     /*----------------------------------------------------------------*/
  1767.     /* Local Variables                                                */
  1768.     /*----------------------------------------------------------------*/
  1769.     /*----------------------------------------------------------------*/
  1770.     /* Code Body                                                      */
  1771.     /*----------------------------------------------------------------*/
  1772.     MMI_multiline_inputbox.text = (UI_buffer_type) new_string;
  1773.     MMI_multiline_inputbox.cursor_p = new_string;
  1774.     MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW;
  1775.     gui_show_multi_line_input_box(&MMI_multiline_inputbox);
  1776.     MMI_multiline_inputbox.flags &= ~UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW;
  1777. }   /* end of ChangeCategory74MessageString */
  1778. /*****************************************************************************
  1779.  * FUNCTION
  1780.  *  ShowCategory74Screen
  1781.  * DESCRIPTION
  1782.  *  Displays the category74 screen
  1783.  * PARAMETERS
  1784.  *  title                   [IN]        Title for the screen
  1785.  *  title_icon              [IN]        Icon shown with the title
  1786.  *  left_softkey            [IN]        Left softkey label
  1787.  *  left_softkey_icon       [IN]        Icon for the Left softkey
  1788.  *  right_softkey           [IN]        Right softkey label
  1789.  *  right_softkey_icon      [IN]        Icon for the right softkey
  1790.  *  buffer                  [IN]        Buffer the input box should use
  1791.  *  buffer_size             [IN]        Size of the buffer
  1792.  *  history_buffer          [IN]        History buffer
  1793.  * RETURNS
  1794.  *  void
  1795.  *****************************************************************************/
  1796. void ShowCategory74Screen(
  1797.         U16 title,
  1798.         U16 title_icon,
  1799.         U16 left_softkey,
  1800.         U16 left_softkey_icon,
  1801.         U16 right_softkey,
  1802.         U16 right_softkey_icon,
  1803.         U8 *buffer,
  1804.         S32 buffer_size,
  1805.         U8 *history_buffer)
  1806. {
  1807.     /*----------------------------------------------------------------*/
  1808.     /* Local Variables                                                */
  1809.     /*----------------------------------------------------------------*/
  1810.     dm_data_struct dm_data;
  1811.     S32 l;
  1812.     S16 input_type = 0;
  1813.     /*----------------------------------------------------------------*/
  1814.     /* Code Body                                                      */
  1815.     /*----------------------------------------------------------------*/
  1816.     gdi_layer_lock_frame_buffer();
  1817.     MMI_menu_shortcut_number = -1;
  1818.     MMI_disable_title_shortcut_display = 1;
  1819.     change_left_softkey(left_softkey, left_softkey_icon);
  1820.     change_right_softkey(right_softkey, right_softkey_icon);
  1821.     SetupCategoryKeyHandlers();
  1822.     MMI_title_string = (UI_string_type) get_string(title);
  1823.     MMI_title_icon = (PU8) get_image(title_icon);
  1824.     l = gui_strlen((UI_string_type) buffer);
  1825.     create_multiline_inputbox_set_buffer((UI_string_type) buffer, buffer_size, l, 0);
  1826.     register_multiline_inputbox_viewer_keys();
  1827.     MMI_multiline_inputbox.flags |= (UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW | UI_MULTI_LINE_INPUT_BOX_VIEW_MODE);
  1828. #ifdef __MMI_WALLPAPER_ON_BOTTOM__
  1829.     MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_TRANSPARENT_BACKGROUND;
  1830. #endif 
  1831.     set_multiline_inputbox_category_history(MMI_CATEGORY74_ID, history_buffer, &input_type);
  1832.     gdi_layer_unlock_frame_buffer();
  1833.     ExitCategoryFunction = ExitCategory74Screen;
  1834.     dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  1835.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  1836.     dm_data.s32CatId = MMI_CATEGORY74_ID;
  1837.     dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
  1838.     dm_setup_data(&dm_data);
  1839.     dm_redraw_category_screen();
  1840. }   /* end of ShowCategory74Screen */
  1841. /*****************************************************************************
  1842.  * FUNCTION
  1843.  *  ExitCategory74Screen
  1844.  * DESCRIPTION
  1845.  *  Exits the category74 screen
  1846.  * PARAMETERS
  1847.  *  void
  1848.  * RETURNS
  1849.  *  void
  1850.  *****************************************************************************/
  1851. void ExitCategory74Screen(void)
  1852. {
  1853.     /*----------------------------------------------------------------*/
  1854.     /* Local Variables                                                */
  1855.     /*----------------------------------------------------------------*/
  1856.     /*----------------------------------------------------------------*/
  1857.     /* Code Body                                                      */
  1858.     /*----------------------------------------------------------------*/
  1859.     reset_softkeys();
  1860.     reset_multitaps();
  1861.     reset_multiline_inputbox();
  1862. }   /* end of ExitCategory74Screen */
  1863. #ifdef __UI_PAGING_IN_MULTILINE_EDITOR__
  1864. #ifdef __MMI_TOUCH_SCREEN__
  1865. S32 MMI_content_height_prev;
  1866. S32 MMI_content_y_prev;
  1867. #endif 
  1868. /*****************************************************************************
  1869.  * FUNCTION
  1870.  *  ShowCategory75Screen
  1871.  * DESCRIPTION
  1872.  *  Displays the category75 screen
  1873.  * PARAMETERS
  1874.  *  name                    [?]         
  1875.  *  title_icon              [IN]        Icon shown with the title
  1876.  *  left_softkey            [IN]        Left softkey label
  1877.  *  left_softkey_icon       [IN]        Icon for the Left softkey
  1878.  *  right_softkey           [IN]        Right softkey label
  1879.  *  right_softkey_icon      [IN]        Icon for the right softkey
  1880.  *  buffer                  [IN]        Buffer the input box should use
  1881.  *  buffer_size             [IN]        Size of the buffer
  1882.  *  history_buffer          [IN]        History buffer
  1883.  *  page_info_app           [IN]        
  1884.  *  title(?)                [IN]        Title for the screen
  1885.  * RETURNS
  1886.  *  void
  1887.  *****************************************************************************/
  1888. void ShowCategory75Screen(
  1889.         U16 *name,
  1890.         U16 title_icon,
  1891.         U16 left_softkey,
  1892.         U16 left_softkey_icon,
  1893.         U16 right_softkey,
  1894.         U16 right_softkey_icon,
  1895.         U8 *buffer,
  1896.         S32 buffer_size,
  1897.         U8 *history_buffer,
  1898.         gui_page_info_app **page_info_app)
  1899. {
  1900.     /*----------------------------------------------------------------*/
  1901.     /* Local Variables                                                */
  1902.     /*----------------------------------------------------------------*/
  1903.     dm_data_struct dm_data;
  1904.     S32 l;
  1905.     S16 input_type = 0;
  1906.     gui_page_info_app *page_info_d = *page_info_app;
  1907.     dm_coordinates gui_multiline_get_coordinates;
  1908.     S32 shortcut_width;
  1909. #if defined(__MMI_TOUCH_SCREEN__)
  1910.     mmi_pen_handwriting_area_struct stroke_area;
  1911.     S32 inputbox_y = (MMI_title_y + MMI_title_height);
  1912.     const gui_virtual_keyboard_pen_enum disable_backspace_list[] = {GUI_VKBD_PEN_BAKSPACE, GUI_VKBD_PEN_NONE};
  1913. #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  1914.     /*----------------------------------------------------------------*/
  1915.     /* Code Body                                                      */
  1916.     /*----------------------------------------------------------------*/
  1917. #ifdef __MMI_TOUCH_SCREEN__
  1918.     wgui_paging_set_full_screen_flag(FALSE);
  1919. #endif 
  1920.     dm_get_control_coordinates_from_category(
  1921.         -1,
  1922.         MMI_CATEGORY74_ID,
  1923.         DM_MULTILINE_INPUTBOX1,
  1924.         -1,
  1925.         &gui_multiline_get_coordinates);
  1926. #ifdef __MMI_TOUCH_SCREEN__
  1927.     gui_multiline_get_coordinates.s16Height = gui_multiline_get_coordinates.s16Height - MMI_title_y - 4;
  1928. #endif 
  1929.     wgui_dm_set_multiline_data(&gui_multiline_get_coordinates);
  1930.     gui_lock_double_buffer();
  1931.     MMI_multiline_inputbox.jump_to_offset_flag = 0;
  1932.     MMI_menu_shortcut_number = -1;
  1933.     shortcut_width = set_menu_item_count(100)+7;
  1934.     resize_menu_shortcut_handler(shortcut_width, MMI_title_height);
  1935.     MMI_disable_title_shortcut_display = 0;
  1936.     change_left_softkey(left_softkey, left_softkey_icon);
  1937.     change_right_softkey(right_softkey, right_softkey_icon);
  1938.     SetupCategoryKeyHandlers();
  1939.     MMI_title_string = (UI_string_type) name;
  1940.     MMI_title_icon = (PU8) get_image(title_icon);
  1941.     l = gui_strlen((UI_string_type) buffer);
  1942.     create_multiline_inputbox_set_buffer((UI_string_type) buffer, buffer_size, l, 0);
  1943. #ifdef __MMI_TOUCH_SCREEN__
  1944.     stroke_area.x1 = 0;
  1945.     stroke_area.x2 = 0 + MMI_content_width - MMI_fixed_list_menu.vbar.width;
  1946.     stroke_area.y1 = 0;
  1947.     stroke_area.y2 = inputbox_y;
  1948.     register_keyboard_input_handler(singleline_inputbox_numeric_keyboard_input_handler);
  1949.     mmi_pen_editor_set_vk_keys(MMI_FALSE, NULL, disable_backspace_list);
  1950.     mmi_pen_editor_setup_input_box(
  1951.         &stroke_area,
  1952.         NULL,
  1953.         INPUT_TYPE_NUMERIC,
  1954.         MMI_FALSE,
  1955.         PEN_EDITOR_PAGING_IN_MULTLINE_EDITOR);
  1956. #endif /* __MMI_TOUCH_SCREEN__ */ 
  1957.     wgui_paging_multiline_set_page(page_info_d->start_id, page_info_d->end_id);
  1958.     wgui_paging_multiline_set_font(page_info_d->font_size, page_info_d->font_style);
  1959.     register_multiline_inputbox_viewer_keys();
  1960.     MMI_multiline_inputbox.flags |= (UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW | UI_MULTI_LINE_INPUT_BOX_VIEW_MODE);  /* |UI_MULTI_LINE_INPUT_BOX_DISABLE_BACKGROUND); */
  1961.     if (page_info_d->highlight_string == 1)
  1962.     {
  1963.         MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_WORD_HIGHLIGHT;
  1964.         wgui_paging_highlight_search_string(page_info_d->jump_offset_from_app, page_info_d->search_str_len);
  1965.     }
  1966. #ifdef __MMI_WALLPAPER_ON_BOTTOM__
  1967.     MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_TRANSPARENT_BACKGROUND;
  1968. #endif 
  1969.     MMI_multiline_inputbox.ext_flags |= GUI_MULTI_LINE_INPUT_BOX_VIEW_PAGING_MODE;
  1970.     MMI_multiline_inputbox.page_offset = page_info_d->text_offset;
  1971.     MMI_multiline_inputbox.jump_offset_from_app = page_info_d->jump_offset_from_app;
  1972.     MMI_multiline_inputbox.search_flag_is_on = page_info_d->search_flag_is_on;
  1973.     show_multiline_inputbox_no_draw();
  1974.     wgui_paging_set_scrollbar_range(page_info_d->doc_size);
  1975.     set_multiline_inputbox_category_history(MMI_CATEGORY74_ID, history_buffer, &input_type);
  1976.     gui_unlock_double_buffer();
  1977.     ExitCategoryFunction = ExitCategory75Screen;
  1978.     wgui_paging_multiline_set_scroll_info(&page_info_d);
  1979.     wgui_paging_set_show_percentage_flag();
  1980.     if (page_info_d->text_offset)
  1981.     {
  1982.         wgui_paging_multiline_set_percentage(page_info_d->start_id, page_info_d->text_offset);
  1983.     }
  1984.     else
  1985.     {
  1986.         show_multiline_inputbox_no_draw();
  1987.         if (MMI_multiline_inputbox.search_flag_is_on)
  1988.         {
  1989.             wgui_paging_multiline_set_percentage(page_info_d->start_id, (S16)MMI_multiline_inputbox.text_offset);//110606 compile warning
  1990.         }
  1991.         else
  1992.         {
  1993.             wgui_paging_multiline_set_percentage(page_info_d->start_id, page_info_d->jump_offset_from_app);
  1994.         }
  1995.     }
  1996.     if (page_info_d->jump_to_end == 0)
  1997.     {
  1998.         show_multiline_inputbox_no_draw();
  1999.         wgui_paging_jump_to_end();
  2000.         wgui_paging_multiline_inputbox_set_percentage_scale(COMPLETE_PERCENTAGE_SCALE);
  2001.     }
  2002.     wgui_paging_reset_show_percentage_flag();
  2003.     if (page_info_d->text_offset != 0)
  2004.     {
  2005.         if (MMI_multiline_inputbox.text_offset_y != page_info_d->last_text_offset_y)
  2006.         {
  2007.             MMI_multiline_inputbox.text_offset_y = page_info_d->last_text_offset_y;
  2008.         }
  2009.     }
  2010. #ifdef __MMI_TOUCH_SCREEN__
  2011.     dm_register_category_controlled_callback(RedrawCategoryControlledArea75Screen);
  2012.     wgui_register_category_screen_control_area_pen_handlers(wgui_paging_pen_down_hdlr, MMI_PEN_EVENT_DOWN);
  2013.     wgui_register_category_screen_control_area_pen_handlers(wgui_paging_pen_up_hdlr, MMI_PEN_EVENT_UP);
  2014.     wgui_register_category_screen_control_area_pen_handlers(wgui_paging_pen_move_hdlr, MMI_PEN_EVENT_MOVE);
  2015. #endif /* __MMI_TOUCH_SCREEN__ */ 
  2016.     dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  2017.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  2018. #ifdef __MMI_TOUCH_SCREEN__
  2019.     dm_data.s32CatId = MMI_CATEGORY75_ID;
  2020. #else 
  2021.     dm_data.s32CatId = MMI_CATEGORY74_ID;
  2022. #endif 
  2023.     dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
  2024. #ifdef __MMI_TOUCH_SCREEN__
  2025.     dm_data.s32flags |= DM_SHOW_VKPAD;
  2026.     dm_register_vkpad_callback(wgui_paging_virtual_keypad_callback);
  2027. #endif /* __MMI_TOUCH_SCREEN__ */ 
  2028.     dm_setup_data(&dm_data);
  2029.     dm_redraw_category_screen();
  2030.     MMI_multiline_inputbox.page_offset = MMI_multiline_inputbox.jump_offset_from_app = 0;
  2031.     /* wgui_paging_multiline_set_scroll_info(&page_info_d); */
  2032.     if (page_info_d->scroll_flag == WGUI_PAGING_AUTO_SCROLL_ON && page_info_d->scroll_speed != 0)
  2033.     {
  2034.         wgui_paging_start_text_scroll();
  2035.     }
  2036.     else
  2037.     {
  2038.         wgui_paging_stop_text_scroll();
  2039.     }
  2040.     MMI_multiline_inputbox.flags &= ~UI_MULTI_LINE_INPUT_BOX_WORD_HIGHLIGHT;
  2041.     if (page_info_d->scroll_type == WGUI_PAGING_SCROLL_LINE_BY_LINE)
  2042.     {
  2043.         SetKeyHandler(wgui_paging_multiline_inputbox_previous_line_in_paging, KEY_UP_ARROW, KEY_EVENT_DOWN);
  2044.         SetKeyHandler(wgui_paging_multiline_inputbox_next_line_in_paging_scroll, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
  2045.         SetKeyHandler(wgui_paging_multiline_inputbox_previous_line_in_paging, KEY_VOL_UP, KEY_EVENT_DOWN);
  2046.         SetKeyHandler(wgui_paging_multiline_inputbox_next_line_in_paging_scroll, KEY_VOL_DOWN, KEY_EVENT_DOWN);
  2047.     }
  2048.     else
  2049.     {
  2050.         SetKeyHandler(wgui_paging_multiline_inputbox_previous_page, KEY_UP_ARROW, KEY_EVENT_DOWN);
  2051.         SetKeyHandler(wgui_paging_multiline_inputbox_next_page, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
  2052.         SetKeyHandler(wgui_paging_multiline_inputbox_previous_page, KEY_VOL_UP, KEY_EVENT_DOWN);
  2053.         SetKeyHandler(wgui_paging_multiline_inputbox_next_page, KEY_VOL_DOWN, KEY_EVENT_DOWN);
  2054.     }
  2055. }   /* end of ShowCategory75Screen */
  2056. #ifdef __MMI_TOUCH_SCREEN__
  2057. /*****************************************************************************
  2058.  * FUNCTION
  2059.  *  RedrawCategoryControlledArea75Screen
  2060.  * DESCRIPTION
  2061.  *  redraw function for category 75 in touch screen
  2062.  * PARAMETERS
  2063.  *  coordinate      [IN]     
  2064.  * RETURNS
  2065.  *  void
  2066.  *****************************************************************************/
  2067. void RedrawCategoryControlledArea75Screen(dm_coordinates *coordinate)
  2068. {
  2069.     /*----------------------------------------------------------------*/
  2070.     /* Local Variables                                                */
  2071.     /*----------------------------------------------------------------*/
  2072.     /*----------------------------------------------------------------*/
  2073.     /* Code Body                                                      */
  2074.     /*----------------------------------------------------------------*/
  2075.     redraw_multiline_inputbox();
  2076. }
  2077. #endif /* __MMI_TOUCH_SCREEN__ */ 
  2078. /*****************************************************************************
  2079.  * FUNCTION
  2080.  *  ExitCategory75Screen
  2081.  * DESCRIPTION
  2082.  *  Exits the category75 screen
  2083.  * PARAMETERS
  2084.  *  void
  2085.  * RETURNS
  2086.  *  void
  2087.  *****************************************************************************/
  2088. void ExitCategory75Screen(void)
  2089. {
  2090.     /*----------------------------------------------------------------*/
  2091.     /* Local Variables                                                */
  2092.     /*----------------------------------------------------------------*/
  2093.     /*----------------------------------------------------------------*/
  2094.     /* Code Body                                                      */
  2095.     /*----------------------------------------------------------------*/
  2096.     reset_softkeys();
  2097.     reset_multitaps();
  2098.     reset_multiline_inputbox();
  2099.     MMI_multiline_inputbox.previous_shared_bytes = 0;
  2100.     MMI_disable_title_shortcut_display = 1;
  2101.     wgui_paging_reset_show_percentage_flag();
  2102.     wgui_paging_stop_text_scroll();
  2103. #ifdef __MMI_TOUCH_SCREEN__
  2104.     mmi_pen_editor_close_input_box();
  2105. #endif 
  2106.     MMI_multiline_inputbox.ext_flags &= ~GUI_MULTI_LINE_INPUT_BOX_VIEW_PAGING_MODE;
  2107. }   /* end of ExitCategory75Screen */
  2108. /*****************************************************************************
  2109.  * FUNCTION
  2110.  *  ShowCategory77Screen
  2111.  * DESCRIPTION
  2112.  *  
  2113.  * PARAMETERS
  2114.  *  name                    [?]         
  2115.  *  title_icon              [IN]        
  2116.  *  left_softkey            [IN]        
  2117.  *  left_softkey_icon       [IN]        
  2118.  *  right_softkey           [IN]        
  2119.  *  right_softkey_icon      [IN]        
  2120.  *  buffer                  [?]         
  2121.  *  buffer_size             [IN]        
  2122.  *  history_buffer          [?]         
  2123.  *  page_info_app           [IN]        
  2124.  * RETURNS
  2125.  *  void
  2126.  *****************************************************************************/
  2127. void ShowCategory77Screen(
  2128.         U16 *name,
  2129.         U16 title_icon,
  2130.         U16 left_softkey,
  2131.         U16 left_softkey_icon,
  2132.         U16 right_softkey,
  2133.         U16 right_softkey_icon,
  2134.         U8 *buffer,
  2135.         S32 buffer_size,
  2136.         U8 *history_buffer,
  2137.         gui_page_info_app **page_info_app)
  2138. {
  2139.     /*----------------------------------------------------------------*/
  2140.     /* Local Variables                                                */
  2141.     /*----------------------------------------------------------------*/
  2142.     dm_data_struct dm_data;
  2143.     S32 l;
  2144.     S16 input_type = 0;
  2145.     gui_page_info_app *page_info_d = *page_info_app;
  2146.     dm_coordinates gui_multiline_get_coordinates;
  2147. #if defined(__MMI_TOUCH_SCREEN__)
  2148.     mmi_pen_handwriting_area_struct stroke_area;
  2149.     const gui_virtual_keyboard_pen_enum disable_backspace_list[] = {GUI_VKBD_PEN_BAKSPACE, GUI_VKBD_PEN_NONE};
  2150. #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  2151.     /*----------------------------------------------------------------*/
  2152.     /* Code Body                                                      */
  2153.     /*----------------------------------------------------------------*/
  2154. #ifdef __MMI_TOUCH_SCREEN__
  2155.     S32 inputbox_y = MMI_title_y + MMI_title_height;
  2156.     wgui_paging_set_full_screen_flag(TRUE);
  2157.     gui_multiline_get_coordinates.s16X = 0;
  2158.     gui_multiline_get_coordinates.s16Y = 0;
  2159.     gui_multiline_get_coordinates.s16Width = MAIN_LCD_DEVICE_WIDTH;
  2160.     gui_multiline_get_coordinates.s16Height = MAIN_LCD_DEVICE_HEIGHT - MMI_title_y - 3;
  2161.     MMI_content_height_prev = MMI_content_height;
  2162.     MMI_content_y_prev = MMI_content_y;
  2163.     MMI_content_y = 0;
  2164.     MMI_content_height = MAIN_LCD_DEVICE_HEIGHT;
  2165. #else /* __MMI_TOUCH_SCREEN__ */ 
  2166.     dm_get_control_coordinates_from_category(
  2167.         -1,
  2168.         MMI_CATEGORY77_ID,
  2169.         DM_MULTILINE_INPUTBOX1,
  2170.         -1,
  2171.         &gui_multiline_get_coordinates);
  2172. #endif /* __MMI_TOUCH_SCREEN__ */ 
  2173.     wgui_dm_set_multiline_data(&gui_multiline_get_coordinates);
  2174.     gui_lock_double_buffer();
  2175.     entry_full_screen();
  2176.     MMI_menu_shortcut_number = -1;
  2177.     MMI_disable_title_shortcut_display = 0;
  2178.     change_left_softkey(left_softkey, left_softkey_icon);
  2179.     change_right_softkey(right_softkey, right_softkey_icon);
  2180.     SetupCategoryKeyHandlers();
  2181.     MMI_title_string = (UI_string_type) name;
  2182.     MMI_title_icon = (PU8) get_image(title_icon);
  2183.     l = gui_strlen((UI_string_type) buffer);
  2184.     MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_DISABLE_SCROLLBAR;
  2185.     create_multiline_inputbox_set_buffer((UI_string_type) buffer, buffer_size, l, 0);
  2186. #ifdef __MMI_TOUCH_SCREEN__
  2187.     stroke_area.x1 = 0;
  2188.     stroke_area.x2 = 0 + MMI_content_width - MMI_fixed_list_menu.vbar.width;
  2189.     stroke_area.y1 = 0;
  2190.     stroke_area.y2 = inputbox_y;
  2191.     register_keyboard_input_handler(singleline_inputbox_numeric_keyboard_input_handler);
  2192.     mmi_pen_editor_set_vk_keys(MMI_FALSE, NULL, disable_backspace_list);
  2193.     mmi_pen_editor_setup_input_box(
  2194.         &stroke_area,
  2195.         NULL,
  2196.         INPUT_TYPE_NUMERIC,
  2197.         MMI_FALSE,
  2198.         PEN_EDITOR_PAGING_IN_MULTLINE_EDITOR);
  2199. #endif /* __MMI_TOUCH_SCREEN__ */ 
  2200.     wgui_paging_multiline_set_page(page_info_d->start_id, page_info_d->end_id);
  2201.     wgui_paging_multiline_set_font(page_info_d->font_size, page_info_d->font_style);
  2202.     register_multiline_inputbox_viewer_keys();
  2203.     MMI_multiline_inputbox.flags |= (UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW | UI_MULTI_LINE_INPUT_BOX_VIEW_MODE);  /* |UI_MULTI_LINE_INPUT_BOX_DISABLE_BACKGROUND); */
  2204. #ifdef __MMI_WALLPAPER_ON_BOTTOM__
  2205.     MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_TRANSPARENT_BACKGROUND;
  2206. #endif 
  2207.     MMI_multiline_inputbox.ext_flags |= GUI_MULTI_LINE_INPUT_BOX_VIEW_PAGING_MODE;
  2208.     if (page_info_d->highlight_string == 1)
  2209.     {
  2210.         MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_WORD_HIGHLIGHT;
  2211.         wgui_paging_highlight_search_string(page_info_d->jump_offset_from_app, page_info_d->search_str_len);
  2212.     }
  2213.     /* MMI_multiline_inputbox.ext_flags |=GUI_MULTI_LINE_INPUT_BOX_FULL_SCREEN; */
  2214.     MMI_multiline_inputbox.page_offset = page_info_d->text_offset;
  2215.     MMI_multiline_inputbox.jump_offset_from_app = page_info_d->jump_offset_from_app;
  2216.     show_multiline_inputbox_no_draw();
  2217.     wgui_paging_set_scrollbar_range(page_info_d->doc_size);
  2218.     wgui_paging_set_show_percentage_flag();
  2219.     if (page_info_d->jump_to_end == 0)
  2220.     {
  2221.         wgui_paging_jump_to_end();
  2222.     }
  2223.     set_multiline_inputbox_category_history(MMI_CATEGORY77_ID, history_buffer, &input_type);
  2224.     gui_unlock_double_buffer();
  2225.     ExitCategoryFunction = ExitCategory77Screen;
  2226.     wgui_paging_multiline_set_scroll_info(&page_info_d);
  2227.     if (page_info_d->text_offset)
  2228.     {
  2229.         wgui_paging_multiline_set_percentage(page_info_d->start_id, page_info_d->text_offset);
  2230.     }
  2231.     else
  2232.     {
  2233.         show_multiline_inputbox_no_draw();
  2234.         if (MMI_multiline_inputbox.search_flag_is_on)
  2235.         {
  2236.             wgui_paging_multiline_set_percentage(page_info_d->start_id, (S16)MMI_multiline_inputbox.text_offset);//110606 compile warning
  2237.         }
  2238.         else
  2239.         {
  2240.             wgui_paging_multiline_set_percentage(page_info_d->start_id, page_info_d->jump_offset_from_app);
  2241.         }
  2242.     }
  2243.     if (page_info_d->text_offset != 0)
  2244.     {
  2245.         if (MMI_multiline_inputbox.text_offset_y != page_info_d->last_text_offset_y)
  2246.         {
  2247.             MMI_multiline_inputbox.text_offset_y = page_info_d->last_text_offset_y;
  2248.         }
  2249.     }
  2250. #ifdef __MMI_TOUCH_SCREEN__
  2251.     dm_register_category_controlled_callback(RedrawCategoryControlledArea75Screen);
  2252.     wgui_register_category_screen_control_area_pen_handlers(wgui_paging_pen_down_hdlr, MMI_PEN_EVENT_DOWN);
  2253.     wgui_register_category_screen_control_area_pen_handlers(wgui_paging_pen_move_hdlr, MMI_PEN_EVENT_MOVE);
  2254.     wgui_register_category_screen_control_area_pen_handlers(wgui_paging_pen_up_hdlr, MMI_PEN_EVENT_UP);
  2255. #endif /* __MMI_TOUCH_SCREEN__ */ 
  2256.     dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  2257.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  2258.     dm_data.s32CatId = MMI_CATEGORY77_ID;
  2259.     dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
  2260. #ifdef __MMI_TOUCH_SCREEN__
  2261.     dm_data.s32flags |= DM_SHOW_VKPAD;
  2262.     dm_register_vkpad_callback(wgui_paging_virtual_keypad_callback);
  2263. #endif /* __MMI_TOUCH_SCREEN__ */ 
  2264.     dm_setup_data(&dm_data);
  2265.     dm_redraw_category_screen();
  2266.     /* wgui_paging_multiline_set_scroll_info(&page_info_d); */
  2267.     MMI_multiline_inputbox.flags &= ~UI_MULTI_LINE_INPUT_BOX_WORD_HIGHLIGHT;
  2268.     if (page_info_d->scroll_type == WGUI_PAGING_SCROLL_LINE_BY_LINE)
  2269.     {
  2270.         SetKeyHandler(wgui_paging_multiline_inputbox_previous_line_in_paging, KEY_UP_ARROW, KEY_EVENT_DOWN);
  2271.         SetKeyHandler(wgui_paging_multiline_inputbox_next_line_in_paging_scroll, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
  2272.         SetKeyHandler(wgui_paging_multiline_inputbox_previous_line_in_paging, KEY_VOL_UP, KEY_EVENT_DOWN);
  2273.         SetKeyHandler(wgui_paging_multiline_inputbox_next_line_in_paging_scroll, KEY_VOL_DOWN, KEY_EVENT_DOWN);
  2274.     }
  2275.     else
  2276.     {
  2277.         SetKeyHandler(wgui_paging_multiline_inputbox_previous_page, KEY_UP_ARROW, KEY_EVENT_DOWN);
  2278.         SetKeyHandler(wgui_paging_multiline_inputbox_next_page, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
  2279.         SetKeyHandler(wgui_paging_multiline_inputbox_previous_page, KEY_VOL_UP, KEY_EVENT_DOWN);
  2280.         SetKeyHandler(wgui_paging_multiline_inputbox_next_page, KEY_VOL_DOWN, KEY_EVENT_DOWN);
  2281.     }
  2282.     if (page_info_d->scroll_flag == WGUI_PAGING_AUTO_SCROLL_ON && page_info_d->scroll_speed != 0)
  2283.     {
  2284.         wgui_paging_start_text_scroll();
  2285.     }
  2286.     else
  2287.     {
  2288.         wgui_paging_stop_text_scroll();
  2289.     }
  2290. }   /* end of ShowCategory77Screen */
  2291. /*****************************************************************************
  2292.  * FUNCTION
  2293.  *  ExitCategory77Screen
  2294.  * DESCRIPTION
  2295.  *  
  2296.  * PARAMETERS
  2297.  *  void
  2298.  * RETURNS
  2299.  *  void
  2300.  *****************************************************************************/
  2301. void ExitCategory77Screen(void)
  2302. {
  2303.     /*----------------------------------------------------------------*/
  2304.     /* Local Variables                                                */
  2305.     /*----------------------------------------------------------------*/
  2306.     /*----------------------------------------------------------------*/
  2307.     /* Code Body                                                      */
  2308.     /*----------------------------------------------------------------*/
  2309.     reset_softkeys();
  2310.     reset_multitaps();
  2311.     reset_multiline_inputbox();
  2312.     leave_full_screen();
  2313.     MMI_multiline_inputbox.previous_shared_bytes = 0;
  2314.     MMI_disable_title_shortcut_display = 1;
  2315.     wgui_paging_stop_text_scroll();
  2316.     wgui_paging_reset_show_percentage_flag();
  2317. #ifdef __MMI_TOUCH_SCREEN__
  2318.     MMI_content_height = MMI_content_height_prev;
  2319.     MMI_content_y = MMI_content_y_prev;
  2320.     mmi_pen_editor_close_input_box();
  2321. #endif /* __MMI_TOUCH_SCREEN__ */ 
  2322.     MMI_multiline_inputbox.ext_flags &= ~GUI_MULTI_LINE_INPUT_BOX_VIEW_PAGING_MODE;
  2323. }   /* end of ExitCategory77Screen */
  2324. #endif /* __UI_PAGING_IN_MULTILINE_EDITOR__ */ 
  2325. /*****************************************************************************
  2326.  * FUNCTION
  2327.  *  ShowCategory76Screen
  2328.  * DESCRIPTION
  2329.  *  Displays the category74 screen
  2330.  * PARAMETERS
  2331.  *  title                   [IN]        Title for the screen
  2332.  *  title_icon              [IN]        Icon shown with the title
  2333.  *  left_softkey            [IN]        Left softkey label
  2334.  *  left_softkey_icon       [IN]        Icon for the Left softkey
  2335.  *  right_softkey           [IN]        Right softkey label
  2336.  *  right_softkey_icon      [IN]        Icon for the right softkey
  2337.  *  buffer                  [IN]        Buffer the input box should use
  2338.  *  buffer_size             [IN]        Size of the buffer
  2339.  *  history_buffer          [IN]        History buffer
  2340.  * RETURNS
  2341.  *  void
  2342.  *****************************************************************************/
  2343. void ShowCategory76Screen(
  2344.         U16 title,
  2345.         U16 title_icon,
  2346.         U16 left_softkey,
  2347.         U16 left_softkey_icon,
  2348.         U16 right_softkey,
  2349.         U16 right_softkey_icon,
  2350.         U8 *buffer,
  2351.         S32 buffer_size,
  2352.         U8 *history_buffer)
  2353. {
  2354.     /*----------------------------------------------------------------*/
  2355.     /* Local Variables                                                */
  2356.     /*----------------------------------------------------------------*/
  2357.     dm_data_struct dm_data;
  2358.     S32 l;
  2359.     S16 input_type = 0;
  2360.     /*----------------------------------------------------------------*/
  2361.     /* Code Body                                                      */
  2362.     /*----------------------------------------------------------------*/
  2363.     gdi_layer_lock_frame_buffer();
  2364.     MMI_menu_shortcut_number = -1;
  2365.     MMI_disable_title_shortcut_display = 1;
  2366.     change_left_softkey(left_softkey, left_softkey_icon);
  2367.     change_right_softkey(right_softkey, right_softkey_icon);
  2368.     SetupCategoryKeyHandlers();
  2369.     MMI_title_string = (UI_string_type) get_string(title);
  2370.     MMI_title_icon = (PU8) get_image(title_icon);
  2371.     l = gui_strlen((UI_string_type) buffer);
  2372.     create_multiline_inputbox_set_buffer((UI_string_type) buffer, buffer_size, l, 0);
  2373.     MMI_multiline_inputbox.flags |=
  2374.         (UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW | UI_MULTI_LINE_INPUT_BOX_VIEW_MODE |
  2375.          UI_MULTI_LINE_INPUT_BOX_DRAW_SEPARATOR);
  2376.     register_multiline_inputbox_viewer_keys();
  2377.     set_multiline_inputbox_category_history(MMI_CATEGORY76_ID, history_buffer, &input_type);
  2378.     gdi_layer_unlock_frame_buffer();
  2379.     ExitCategoryFunction = ExitCategory74Screen;
  2380.     dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  2381.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  2382.     dm_data.s32CatId = MMI_CATEGORY76_ID;
  2383.     dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
  2384.     dm_setup_data(&dm_data);
  2385.     dm_redraw_category_screen();
  2386. }   /* end of ShowCategory76Screen */
  2387. /*****************************************************************************
  2388.  * FUNCTION
  2389.  *  GetCategory76History
  2390.  * DESCRIPTION
  2391.  *  Gets the history buffer for category76 screen
  2392.  * PARAMETERS
  2393.  *  history_buffer      [IN]        Is the buffer into which the history data is stored (pre-allocated)
  2394.  * RETURNS
  2395.  *  Pointer to the history buffer
  2396.  *****************************************************************************/
  2397. U8 *GetCategory76History(U8 *history_buffer)
  2398. {
  2399.     /*----------------------------------------------------------------*/
  2400.     /* Local Variables                                                */
  2401.     /*----------------------------------------------------------------*/
  2402.     /*----------------------------------------------------------------*/
  2403.     /* Code Body                                                      */
  2404.     /*----------------------------------------------------------------*/
  2405.     get_multiline_inputbox_category_history(MMI_CATEGORY74_ID, history_buffer, MMI_current_input_type);
  2406.     return (history_buffer);
  2407. }
  2408. /*****************************************************************************
  2409.  * FUNCTION
  2410.  *  ChangeCategory78MessageString
  2411.  * DESCRIPTION
  2412.  *  
  2413.  * PARAMETERS
  2414.  *  new_string      [?]     
  2415.  * RETURNS
  2416.  *  void
  2417.  *****************************************************************************/
  2418. void ChangeCategory78MessageString(U8 *new_string)
  2419. {
  2420.     /*----------------------------------------------------------------*/
  2421.     /* Local Variables                                                */
  2422.     /*----------------------------------------------------------------*/
  2423.     /*----------------------------------------------------------------*/
  2424.     /* Code Body                                                      */
  2425.     /*----------------------------------------------------------------*/
  2426.     MMI_multiline_inputbox.text = (UI_buffer_type) new_string;
  2427.     MMI_multiline_inputbox.cursor_p = new_string;
  2428.     MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW;
  2429.     gui_show_multi_line_input_box(&MMI_multiline_inputbox);
  2430.     MMI_multiline_inputbox.flags &= ~UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW;
  2431. }
  2432. /*****************************************************************************
  2433.  * FUNCTION
  2434.  *  ShowCategory78Screen
  2435.  * DESCRIPTION
  2436.  *  Displays the category78 screen
  2437.  * PARAMETERS
  2438.  *  title                   [IN]        Title for the screen
  2439.  *  title_icon              [IN]        Icon shown with the title
  2440.  *  left_softkey            [IN]        Left softkey label
  2441.  *  left_softkey_icon       [IN]        Icon for the left softkey
  2442.  *  right_softkey           [IN]        Right softkey label
  2443.  *  right_softkey_icon      [IN]        Icon for the right softkey
  2444.  *  icon_callback           [IN]        
  2445.  *  buffer                  [IN]        Buffer the input box should use.
  2446.  *  buffer_size             [IN]        Size of the buffer.
  2447.  *  history_buffer          [IN]        History buffer
  2448.  * RETURNS
  2449.  *  void
  2450.  *****************************************************************************/
  2451. void ShowCategory78Screen(
  2452.         U16 title,
  2453.         U16 title_icon,
  2454.         U16 left_softkey,
  2455.         U16 left_softkey_icon,
  2456.         U16 right_softkey,
  2457.         U16 right_softkey_icon,
  2458.         multi_line_input_box_icon_hdlr icon_callback,
  2459.         U8 *buffer,
  2460.         S32 buffer_size,
  2461.         U8 *history_buffer)
  2462. {
  2463.     /*----------------------------------------------------------------*/
  2464.     /* Local Variables                                                */
  2465.     /*----------------------------------------------------------------*/
  2466.     dm_data_struct dm_data;
  2467.     S32 l;
  2468.     S16 input_type = 0;
  2469.     /*----------------------------------------------------------------*/
  2470.     /* Code Body                                                      */
  2471.     /*----------------------------------------------------------------*/
  2472.     gdi_layer_lock_frame_buffer();
  2473.     MMI_menu_shortcut_number = -1;
  2474.     MMI_disable_title_shortcut_display = 1;
  2475.     change_left_softkey(left_softkey, left_softkey_icon);
  2476.     change_right_softkey(right_softkey, right_softkey_icon);
  2477.     SetupCategoryKeyHandlers();
  2478.     MMI_title_string = (UI_string_type) get_string(title);
  2479.     MMI_title_icon = (PU8) get_image(title_icon);
  2480.     l = gui_strlen((UI_string_type) buffer);
  2481.     create_multiline_inputbox_set_buffer((UI_string_type) buffer, buffer_size, l, 0);
  2482.     MMI_multiline_inputbox.flags |= (UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW |
  2483.                                      UI_MULTI_LINE_INPUT_BOX_RICHTEXT | UI_MULTI_LINE_INPUT_BOX_VIEW_MODE);
  2484.     MMI_multiline_inputbox.icon_callback = icon_callback;
  2485.     register_multiline_inputbox_viewer_keys();
  2486.     set_multiline_inputbox_category_history(MMI_CATEGORY78_ID, history_buffer, &input_type);
  2487.     gdi_layer_unlock_frame_buffer();
  2488.     ExitCategoryFunction = ExitCategory78Screen;
  2489.     dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  2490.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  2491.     dm_data.s32CatId = MMI_CATEGORY78_ID;
  2492.     dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
  2493.     dm_setup_data(&dm_data);
  2494.     dm_redraw_category_screen();
  2495. }
  2496. /*****************************************************************************
  2497.  * FUNCTION
  2498.  *  ExitCategory78Screen
  2499.  * DESCRIPTION
  2500.  *  Exits the category78 screen
  2501.  * PARAMETERS
  2502.  *  void
  2503.  * RETURNS
  2504.  *  void
  2505.  *****************************************************************************/
  2506. void ExitCategory78Screen(void)
  2507. {
  2508.     /*----------------------------------------------------------------*/
  2509.     /* Local Variables                                                */
  2510.     /*----------------------------------------------------------------*/
  2511.     /*----------------------------------------------------------------*/
  2512.     /* Code Body                                                      */
  2513.     /*----------------------------------------------------------------*/
  2514.     reset_softkeys();
  2515.     reset_multitaps();
  2516.     reset_multiline_inputbox();
  2517. }
  2518. /*****************************************************************************
  2519.  * FUNCTION
  2520.  *  ShowCategory105Screen
  2521.  * DESCRIPTION
  2522.  *  Displays the category105 screen
  2523.  * PARAMETERS
  2524.  *  title                   [IN]        Title for the screen
  2525.  *  title_icon              [IN]        Icon shown with the title
  2526.  *  left_softkey            [IN]        Left softkey label
  2527.  *  left_softkey_icon       [IN]        Icon for the Left softkey
  2528.  *  right_softkey           [IN]        Right softkey label
  2529.  *  right_softkey_icon      [IN]        Icon for the right softkey
  2530.  *  volume_level            [?]         
  2531.  *  history_buffer          [IN]        History buffer
  2532.  *  volume_level_UI(?)      [IN]        Volume level
  2533.  * RETURNS
  2534.  *  void
  2535.  *****************************************************************************/
  2536. void ShowCategory105Screen(
  2537.         U16 title,
  2538.         U16 title_icon,
  2539.         U16 left_softkey,
  2540.         U16 left_softkey_icon,
  2541.         U16 right_softkey,
  2542.         U16 right_softkey_icon,
  2543.         S32 *volume_level,
  2544.         U8 *history_buffer)
  2545. {
  2546.     /*----------------------------------------------------------------*/
  2547.     /* Local Variables                                                */
  2548.     /*----------------------------------------------------------------*/
  2549.     dm_data_struct dm_data;
  2550. #if defined(__MMI_WALLPAPER_ON_BOTTOM__)
  2551.     U16 btn_up_id, btn_down_id;
  2552. #endif 
  2553.     /*----------------------------------------------------------------*/
  2554.     /* Code Body                                                      */
  2555.     /*----------------------------------------------------------------*/
  2556.     dm_reset_context();
  2557.     UI_UNUSED_PARAMETER(history_buffer);
  2558.     gdi_layer_lock_frame_buffer();
  2559.     change_left_softkey(left_softkey, left_softkey_icon);
  2560.     change_right_softkey(right_softkey, right_softkey_icon);
  2561.     SetupCategoryKeyHandlers();
  2562.     MMI_title_string = (UI_string_type) get_string(title);
  2563.     MMI_title_icon = (PU8) get_image(title_icon);
  2564.     MMI_menu_shortcut_number = -1;
  2565.     volume_level_UI = (*volume_level);
  2566.     if (volume_level_UI < 0)
  2567.     {
  2568.         volume_level_UI = 0;
  2569.     }
  2570.     if (volume_level_UI > 6)
  2571.     {
  2572.         volume_level_UI = 6;
  2573.     }
  2574.     dm_data.s32flags = 0;
  2575. //KP Jerry disable for add softkey display volume-adjust screen on 2006-12-22 start
  2576. /*
  2577.     if ((left_softkey == 0) && (left_softkey_icon == 0) && (right_softkey == 0) && (right_softkey_icon == 0))
  2578.     {
  2579.         dm_data.s32flags |= DM_NO_SOFTKEY;
  2580.     }
  2581.     else
  2582. */
  2583. //KP Jerry disable for add softkey display volume-adjust screen on 2006-12-22 end
  2584.     {
  2585.         dm_data.s32flags &= ~DM_NO_SOFTKEY;
  2586.     }
  2587.     /* PMT HIMANSHU START 20050729 */
  2588. #if defined(__MMI_WALLPAPER_ON_BOTTOM__)
  2589.     dm_get_scr_bg_image(&idle_scr_bg_ID, &idle_scr_bg_filename, &idle_scr_bg_x, &idle_scr_bg_y, &idle_scr_bg_opacity);
  2590.     dm_set_scr_bg_image((MMI_ID_TYPE) (WGUI_VOLUME_LEVEL1 + volume_level_UI), NULL, -1, -1, current_MMI_theme->bg_opacity_full);
  2591.     dm_get_scr_bg_flag(&idle_scr_bg_flags);//082906 scr_bg
  2592.     dm_set_scr_bg_flag(idle_scr_bg_flags | DM_SCR_BG_FORCE_SHOW);
  2593. #else /* defined(__MMI_WALLPAPER_ON_BOTTOM__) */ 
  2594.     switch (volume_level_UI)
  2595.     {
  2596.         case 0:
  2597.             dm_add_image(get_image(WGUI_VOLUME_LEVEL1), NULL, NULL);
  2598.             break;
  2599.         case 1:
  2600.             dm_add_image(get_image(WGUI_VOLUME_LEVEL2), NULL, NULL);
  2601.             break;
  2602.         case 2:
  2603.             dm_add_image(get_image(WGUI_VOLUME_LEVEL3), NULL, NULL);
  2604.             break;
  2605.         case 3:
  2606.             dm_add_image(get_image(WGUI_VOLUME_LEVEL4), NULL, NULL);
  2607.             break;
  2608.         case 4:
  2609.             dm_add_image(get_image(WGUI_VOLUME_LEVEL5), NULL, NULL);
  2610.             break;
  2611.         case 5:
  2612.             dm_add_image(get_image(WGUI_VOLUME_LEVEL6), NULL, NULL);
  2613.             break;
  2614.         case 6:
  2615.             dm_add_image(get_image(WGUI_VOLUME_LEVEL7), NULL, NULL);
  2616.             break;
  2617.     }
  2618. #endif /* defined(__MMI_TOUCH_SCREEN__) && defined(__MMI_WALLPAPER_ON_BOTTOM__) */ 
  2619.     /* PMT HIMANSHU END 20050729 */
  2620.     SetKeyHandler(show_vertical_bar_previous, KEY_VOL_DOWN, KEY_EVENT_DOWN);
  2621.     SetKeyHandler(show_vertical_bar_next, KEY_VOL_UP, KEY_EVENT_DOWN);
  2622.     gdi_layer_unlock_frame_buffer();
  2623.     /* PMT HIMANSHU START 20050729 */
  2624. #if defined(__MMI_WALLPAPER_ON_BOTTOM__)
  2625.     btn_up_id = dm_add_button(
  2626.                     NULL,
  2627.                     get_image(WGUI_VOLUME_UP_UP_IMAGE_ID),
  2628.                     get_image(WGUI_VOLUME_UP_DOWN_IMAGE_ID),
  2629.                     NULL);
  2630.     btn_down_id = dm_add_button(
  2631.                     NULL,
  2632.                     get_image(WGUI_VOLUME_DOWN_UP_IMAGE_ID),
  2633.                     get_image(WGUI_VOLUME_DOWN_DOWN_IMAGE_ID),
  2634.                     NULL);
  2635.     ExitCategoryFunction = ExitCategory105Screen;
  2636. #else /* defined(__MMI_WALLPAPER_ON_BOTTOM__) */ 
  2637.     ExitCategoryFunction = UI_dummy_function;
  2638. #endif /* defined(__MMI_WALLPAPER_ON_BOTTOM__) */ 
  2639.     /* PMT HIMANSHU END 20050729 */
  2640.     dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
  2641.     /* PMT HIMANSHU START 20050729 */
  2642. #if defined(__MMI_TOUCH_SCREEN__) && defined(__MMI_WALLPAPER_ON_BOTTOM__)
  2643.     dm_register_button_functions(btn_up_id, KEY_EVENT_UP, ResetCallbackTimer);
  2644.     dm_register_button_functions(btn_up_id, KEY_EVENT_DOWN, ShowVerticalBarUp);
  2645.     dm_register_button_functions(btn_up_id, KEY_REPEAT, CallShowVerticalBarMax);
  2646.     dm_register_button_functions(btn_down_id, KEY_EVENT_UP, ResetCallbackTimer);
  2647.     dm_register_button_functions(btn_down_id, KEY_EVENT_DOWN, ShowVerticalBarDown);
  2648.     dm_register_button_functions(btn_down_id, KEY_REPEAT, CallShowVerticalBarMin);
  2649. #endif /* defined(__MMI_TOUCH_SCREEN__) && defined(__MMI_WALLPAPER_ON_BOTTOM__) */ 
  2650.     /* PMT HIMANSHU END 20050729 */
  2651.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  2652.     dm_data.s32CatId = MMI_CATEGORY105_ID;
  2653.     dm_data.s32flags |= DM_CLEAR_SCREEN_BACKGROUND;
  2654.     dm_setup_data(&dm_data);
  2655.     dm_redraw_category_screen();
  2656. }
  2657. #if defined(__MMI_WALLPAPER_ON_BOTTOM__)
  2658. /*****************************************************************************
  2659.  * FUNCTION
  2660.  *  ExitCategory105Screen
  2661.  * DESCRIPTION
  2662.  *  
  2663.  * PARAMETERS
  2664.  *  void
  2665.  * RETURNS
  2666.  *  void
  2667.  *****************************************************************************/
  2668. void ExitCategory105Screen(void)
  2669. {
  2670.     /*----------------------------------------------------------------*/
  2671.     /* Local Variables                                                */
  2672.     /*----------------------------------------------------------------*/
  2673.     /*----------------------------------------------------------------*/
  2674.     /* Code Body                                                      */
  2675.     /*----------------------------------------------------------------*/
  2676.     dm_set_scr_bg_flag(idle_scr_bg_flags);//082906 scr_bg
  2677.     dm_set_scr_bg_image_no_draw(
  2678.         idle_scr_bg_ID,
  2679.         idle_scr_bg_filename,
  2680.         idle_scr_bg_x,
  2681.         idle_scr_bg_y,
  2682.         idle_scr_bg_opacity);
  2683. }
  2684. #endif /* defined(__MMI_WALLPAPER_ON_BOTTOM__) */ 
  2685. /*****************************************************************************
  2686.  * FUNCTION
  2687.  *  change_cat105_image
  2688.  * DESCRIPTION
  2689.  *  
  2690.  * PARAMETERS
  2691.  *  img     [IN]        
  2692.  * RETURNS
  2693.  *  void
  2694.  *****************************************************************************/
  2695. void change_cat105_image(PU8 img)
  2696. {
  2697.     /*----------------------------------------------------------------*/
  2698.     /* Local Variables                                                */
  2699.     /*----------------------------------------------------------------*/
  2700.     /*----------------------------------------------------------------*/
  2701.     /* Code Body                                                      */
  2702.     /*----------------------------------------------------------------*/
  2703.     dm_change_image(img, NULL, 0);
  2704. }
  2705. /***************************************************************************** 
  2706. * Vertical_Bar Related Functions.
  2707. *****************************************************************************/
  2708. /*****************************************************************************
  2709.  * FUNCTION
  2710.  *  show_vertical_bar
  2711.  * DESCRIPTION
  2712.  *  Show volume vertical bar
  2713.  * PARAMETERS
  2714.  *  volume_level        [IN]        Volume level
  2715.  * RETURNS
  2716.  *  void
  2717.  *****************************************************************************/
  2718. void show_vertical_bar(S32 volume_level)
  2719. {
  2720.     /*----------------------------------------------------------------*/
  2721.     /* Local Variables                                                */
  2722.     /*----------------------------------------------------------------*/
  2723.     /*----------------------------------------------------------------*/
  2724.     /* Code Body                                                      */
  2725.     /*----------------------------------------------------------------*/
  2726.     volume_level_UI = volume_level;
  2727.     if (volume_level_UI < 0)
  2728.     {
  2729.         volume_level_UI = 0;
  2730.     }
  2731.     if (volume_level_UI > 6)
  2732.     {
  2733.         volume_level_UI = 6;
  2734.     }
  2735.     /* PMT HIMANSHU START 20050729 */
  2736. #if defined(__MMI_WALLPAPER_ON_BOTTOM__)
  2737.     dm_set_scr_bg_image((MMI_ID_TYPE) (WGUI_VOLUME_LEVEL1 + volume_level_UI), NULL, -1, -1, current_MMI_theme->bg_opacity_full);
  2738.     gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
  2739. #else /* defined(__MMI_WALLPAPER_ON_BOTTOM__) */ 
  2740.     switch (volume_level_UI)
  2741.     {
  2742.         case 0:
  2743.             change_cat105_image(get_image(WGUI_VOLUME_LEVEL1));
  2744.             break;
  2745.         case 1:
  2746.             change_cat105_image(get_image(WGUI_VOLUME_LEVEL2));
  2747.             break;
  2748.         case 2:
  2749.             change_cat105_image(get_image(WGUI_VOLUME_LEVEL3));
  2750.             break;
  2751.         case 3: