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

MTK

开发平台:

C/C++

  1.                 if (ii->input_type & INPUT_TYPE_PLUS_CHARACTER_HANDLING)
  2.                 {
  3.                     l += ENCODING_LENGTH;
  4.                 }
  5.                 size = INLINE_ITEM_DATA_ID_LENGTH + INLINE_ITEM_DATA_SIZE_LENGTH + sizeof(S32) + l;
  6.             }
  7.                 break;
  8.             case INLINE_ITEM_TYPE_FULL_SCREEN_EDIT:
  9.             {
  10.                 S32 l;
  11.                 wgui_inline_item_text_edit *ii = (wgui_inline_item_text_edit*) wgui_inline_items[i].item;
  12.                 l = ii->buffer_size * ENCODING_LENGTH;
  13.                 if (ii->input_type & INPUT_TYPE_PLUS_CHARACTER_HANDLING)
  14.                 {
  15.                     l += ENCODING_LENGTH;
  16.                 }
  17.                 size = INLINE_ITEM_DATA_ID_LENGTH + INLINE_ITEM_DATA_SIZE_LENGTH + sizeof(U32) + sizeof(S32) + (l << 1);
  18.             }
  19.                 break;
  20.             case INLINE_ITEM_TYPE_SELECT:
  21.             {
  22.                 size = INLINE_ITEM_DATA_ID_LENGTH + 2;
  23.             }
  24.                 break;
  25.                 /* Gurinder - 30/4/2004 - Att. Control History */
  26.             case INLINE_ITEM_ATTACH_IMAGE:
  27.             {
  28.                 size = INLINE_ITEM_DATA_ID_LENGTH + 2;
  29.             }
  30.                 break;
  31.             case INLINE_ITEM_TYPE_DATE:
  32.             {
  33.                 size = INLINE_ITEM_DATA_ID_LENGTH + 5 * ENCODING_LENGTH + 3 * ENCODING_LENGTH + 3 * ENCODING_LENGTH;
  34.             }
  35.                 break;
  36.             case INLINE_ITEM_TYPE_TIME:
  37.             {
  38.                 size = INLINE_ITEM_DATA_ID_LENGTH + 3 * ENCODING_LENGTH + 3 * ENCODING_LENGTH;
  39.             }
  40.                 break;
  41.             case INLINE_ITEM_TYPE_TIME_PERIOD:
  42.             {
  43.                 size =
  44.                     INLINE_ITEM_DATA_ID_LENGTH + 3 * ENCODING_LENGTH + 3 * ENCODING_LENGTH + 3 * ENCODING_LENGTH +
  45.                     3 * ENCODING_LENGTH;
  46.             }
  47.                 break;
  48.             case INLINE_ITEM_TYPE_IP4_EDIT:
  49.             {
  50.                 size =
  51.                     INLINE_ITEM_DATA_ID_LENGTH + 4 * ENCODING_LENGTH + 4 * ENCODING_LENGTH + 4 * ENCODING_LENGTH +
  52.                     4 * ENCODING_LENGTH;
  53.             }
  54.                 break;
  55.             case INLINE_ITEM_TYPE_DOW_SELECT:
  56.             {
  57.                 size = INLINE_ITEM_DATA_ID_LENGTH + 7;
  58.             }
  59.                 break;
  60.         #if defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__) /* 4/5 */
  61.             case INLINE_ITEM_TYPE_MULTI_LINE_EDIT:
  62.             case INLINE_ITEM_TYPE_MULTI_LINE_RD_ONLY:
  63.             {
  64.                 size = INLINE_ITEM_DATA_ID_LENGTH + sizeof(multiline_inputbox_category_history);
  65.             }
  66.                 break;
  67.         #endif /* defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__) */ 
  68.             case INLINE_ITEM_TYPE_COLOR_SELECT:
  69.             {
  70.                 size = INLINE_ITEM_DATA_ID_LENGTH + 4;
  71.             }
  72.                 break;
  73.         }
  74.         total_size += size;
  75.     }
  76.     return (total_size);
  77. }
  78. /* Gurinder - 14/5/2004- Added For Append Function InlineItemText */
  79. /*****************************************************************************
  80.  * FUNCTION
  81.  *  get_inline_item_text_edit_offset
  82.  * DESCRIPTION
  83.  *  
  84.  * PARAMETERS
  85.  *  list_of_items       [?]         
  86.  *  last_item           [IN]        
  87.  *  flag                [IN]        
  88.  * RETURNS
  89.  *  
  90.  *****************************************************************************/
  91. S32 get_inline_item_text_edit_offset(InlineItem *list_of_items, S32 last_item, U8 flag)
  92. {
  93.     /*----------------------------------------------------------------*/
  94.     /* Local Variables                                                */
  95.     /*----------------------------------------------------------------*/
  96.     S32 i, total_size = 0, size;
  97.     /*----------------------------------------------------------------*/
  98.     /* Code Body                                                      */
  99.     /*----------------------------------------------------------------*/
  100.     for (i = 0; i <= last_item - flag; i++)
  101.     {
  102.         size = 0;
  103.         switch (list_of_items[i].flags & 0xff)
  104.         {
  105.             case INLINE_ITEM_TYPE_CAPTION:
  106.             case INLINE_ITEM_TYPE_DISPLAY_ONLY:
  107.             case INLINE_ITEM_TYPE_USER_DEFINED_SELECT:
  108.                 break;
  109.             case INLINE_ITEM_TYPE_TEXT_EDIT:
  110.             {
  111.                 S32 l;
  112.                 wgui_inline_item_text_edit *ii = (wgui_inline_item_text_edit*) list_of_items[i].item;
  113.                 l = ii->buffer_size * ENCODING_LENGTH;
  114.                 if (ii->input_type & INPUT_TYPE_PLUS_CHARACTER_HANDLING)
  115.                 {
  116.                     l += ENCODING_LENGTH;
  117.                 }
  118.                 if (i == last_item)
  119.                 {
  120.                     size = INLINE_ITEM_DATA_ID_LENGTH + INLINE_ITEM_DATA_SIZE_LENGTH + sizeof(S32);
  121.                 }
  122.                 else
  123.                 {
  124.                     size = INLINE_ITEM_DATA_ID_LENGTH + INLINE_ITEM_DATA_SIZE_LENGTH + sizeof(S32) + l;
  125.                 }
  126.             }
  127.                 break;
  128.             case INLINE_ITEM_TYPE_FULL_SCREEN_EDIT:
  129.             {
  130.                 S32 l;
  131.                 wgui_inline_item_text_edit *ii = (wgui_inline_item_text_edit*) list_of_items[i].item;
  132.                 l = ii->buffer_size * ENCODING_LENGTH;
  133.                 if (ii->input_type & INPUT_TYPE_PLUS_CHARACTER_HANDLING)
  134.                 {
  135.                     l += ENCODING_LENGTH;
  136.                 }
  137.                 size = INLINE_ITEM_DATA_ID_LENGTH + INLINE_ITEM_DATA_SIZE_LENGTH + sizeof(U32) + sizeof(S32) + (l << 1);
  138.             }
  139.                 break;
  140.             case INLINE_ITEM_TYPE_SELECT:
  141.             {
  142.                 size = INLINE_ITEM_DATA_ID_LENGTH + 2;
  143.             }
  144.                 break;
  145.             case INLINE_ITEM_ATTACH_IMAGE:
  146.             {
  147.                 size = INLINE_ITEM_DATA_ID_LENGTH + 2;
  148.             }
  149.                 break;
  150.             case INLINE_ITEM_TYPE_DATE:
  151.             {
  152.                 size = INLINE_ITEM_DATA_ID_LENGTH + 5 * ENCODING_LENGTH + 3 * ENCODING_LENGTH + 3 * ENCODING_LENGTH;
  153.             }
  154.                 break;
  155.             case INLINE_ITEM_TYPE_TIME:
  156.             {
  157.                 size = INLINE_ITEM_DATA_ID_LENGTH + 3 * ENCODING_LENGTH + 3 * ENCODING_LENGTH;
  158.             }
  159.                 break;
  160.             case INLINE_ITEM_TYPE_TIME_PERIOD:
  161.             {
  162.                 size =
  163.                     INLINE_ITEM_DATA_ID_LENGTH + 3 * ENCODING_LENGTH + 3 * ENCODING_LENGTH + 3 * ENCODING_LENGTH +
  164.                     3 * ENCODING_LENGTH;
  165.             }
  166.                 break;
  167.             case INLINE_ITEM_TYPE_IP4_EDIT:
  168.             {
  169.                 size =
  170.                     INLINE_ITEM_DATA_ID_LENGTH + 4 * ENCODING_LENGTH + 4 * ENCODING_LENGTH + 4 * ENCODING_LENGTH +
  171.                     4 * ENCODING_LENGTH;
  172.             }
  173.                 break;
  174.             case INLINE_ITEM_TYPE_DOW_SELECT:
  175.             {
  176.                 size = INLINE_ITEM_DATA_ID_LENGTH + 7;
  177.             }
  178.                 break;
  179.         #if defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__)
  180.             case INLINE_ITEM_TYPE_MULTI_LINE_EDIT:
  181.             case INLINE_ITEM_TYPE_MULTI_LINE_RD_ONLY:
  182.             {
  183.                 size = INLINE_ITEM_DATA_ID_LENGTH + sizeof(multiline_inputbox_category_history);
  184.             }
  185.                 break;
  186.         #endif /* defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__) */ 
  187.             case INLINE_ITEM_TYPE_COLOR_SELECT:
  188.             {
  189.                 size = INLINE_ITEM_DATA_ID_LENGTH + 4;
  190.             }
  191.                 break;
  192.         }
  193.         total_size += size;
  194.     }
  195.     return (total_size);
  196. }
  197. /* Gurinder - 14/5/2004- Added For Append Function InlineItemText */
  198. /*****************************************************************************
  199.  * FUNCTION
  200.  *  AppendInlineItemTextEditString
  201.  * DESCRIPTION
  202.  *  
  203.  * PARAMETERS
  204.  *  input_type          [IN]        
  205.  *  buffer              [?]         
  206.  *  list_of_items       [?]         
  207.  *  number_of_items     [IN]        
  208.  *  size                [?]         
  209.  *  history             [?]         
  210.  *  plus_handling       [IN]        
  211.  * RETURNS
  212.  *  
  213.  *****************************************************************************/
  214. S32 AppendInlineItemTextEditString(
  215.         S16 input_type,
  216.         U8 *buffer,
  217.         InlineItem *list_of_items,
  218.         S32 number_of_items,
  219.         S32 *size,
  220.         history *history,
  221.         U8 plus_handling)
  222. {
  223.     /*----------------------------------------------------------------*/
  224.     /* Local Variables                                                */
  225.     /*----------------------------------------------------------------*/
  226.     U8 *gui_buffer;
  227.     U8 *input_buffer;
  228.     U8 *data_buffer;
  229.     /* U32 *flags; */
  230.     S32 s;
  231.     /*----------------------------------------------------------------*/
  232.     /* Code Body                                                      */
  233.     /*----------------------------------------------------------------*/
  234.     /* byte list_menu_changed=1; */
  235.     gui_buffer = history->guiBuffer;
  236.     input_buffer = history->inputBuffer;
  237.     if (!set_list_menu_category_history(MMI_CATEGORY57_ID, gui_buffer))
  238.     {
  239.         return -1;
  240.     }
  241.     if (MMI_fixed_list_menu.highlighted_item > number_of_items)
  242.     {
  243.         return -1;
  244.     }
  245.     s = sizeof(list_menu_category_history);
  246.     s = (s + 3) / 4;
  247.     s *= 4;
  248.     /* Gurinder - 14/6/2004 - History Problem In Append. */
  249.     gdi_layer_lock_frame_buffer();
  250.     set_wgui_inline_list_menu_changed();
  251.     gdi_layer_unlock_frame_buffer();
  252.     memcpy(gui_buffer + s, &wgui_inline_list_menu_changed, sizeof(U32));
  253.     /* End Gurinder 14/6/2004 */
  254.     inline_text_edit_set_history(INLINE_TEXT_EDIT_HISTORY_ID, (gui_buffer + s + sizeof(U32)), &input_type);
  255.     data_buffer =
  256.         input_buffer + get_inline_item_text_edit_offset(list_of_items, MMI_fixed_list_menu.highlighted_item, 0);
  257.     /* For Append String */
  258.     if (plus_handling == 1)
  259.     {
  260.         if (MMI_inline_singleline_inputbox.text_length == 2)
  261.         {
  262.             if (buffer[0] != '+')
  263.             {
  264.                 plus_handling = 0;
  265.             }
  266.         }
  267.         else
  268.         {
  269.             if (data_buffer[0] != '+')
  270.             {
  271.                 plus_handling = 0;
  272.             }
  273.         }
  274.     }
  275.     else
  276.     {
  277.         plus_handling = 0;
  278.     }
  279.     if ((MMI_inline_singleline_inputbox.allocated_length - MMI_inline_singleline_inputbox.text_length) >=
  280.         (pfnUnicodeStrlen((PS8) buffer) - plus_handling) * ENCODING_LENGTH)
  281.     {
  282.         memcpy(
  283.             data_buffer + MMI_inline_singleline_inputbox.text_length - ENCODING_LENGTH,
  284.             buffer,
  285.             (pfnUnicodeStrlen((PS8) buffer) + 1) * ENCODING_LENGTH);
  286.     }
  287.     else
  288.     {
  289.         memcpy(
  290.             data_buffer + MMI_inline_singleline_inputbox.text_length - ENCODING_LENGTH,
  291.             buffer,
  292.             MMI_inline_singleline_inputbox.allocated_length - MMI_inline_singleline_inputbox.text_length - ENCODING_LENGTH);
  293.         memcpy(data_buffer + MMI_inline_singleline_inputbox.allocated_length - ENCODING_LENGTH, '', ENCODING_LENGTH);
  294.     }
  295.     /*
  296.      * For Set String
  297.      * if(MMI_inline_singleline_inputbox.allocated_length-ENCODING_LENGTH>pfnUnicodeStrlen((PS8)buffer)*ENCODING_LENGTH)
  298.      * {
  299.      * memcpy(data_buffer, buffer, (pfnUnicodeStrlen((PS8)buffer)+1)*ENCODING_LENGTH);
  300.      * }
  301.      * else
  302.      * {
  303.      * memcpy(data_buffer,buffer,MMI_inline_singleline_inputbox.allocated_length-ENCODING_LENGTH);
  304.      * memcpy(data_buffer+MMI_inline_singleline_inputbox.allocated_length-ENCODING_LENGTH,'',ENCODING_LENGTH);
  305.      * }
  306.      */
  307.     MMI_inline_singleline_inputbox.text_length = pfnUnicodeStrlen((PS8) data_buffer) * ENCODING_LENGTH + ENCODING_LENGTH;
  308.     MMI_inline_singleline_inputbox.text = data_buffer;
  309.     MMI_inline_singleline_inputbox.current_text_p = MMI_inline_singleline_inputbox.text;        /* (UI_buffer_type)(MMI_inline_singleline_inputbox.text+(MMI_inline_singleline_inputbox.text_length-ENCODING_LENGTH)); */
  310.     inline_text_edit_get_history((U8*) (gui_buffer + s + sizeof(U32)), MMI_current_input_type);
  311.     *size = get_inline_item_text_edit_offset(list_of_items, number_of_items, 1);
  312.     return 0;
  313. }
  314. /*****************************************************************************
  315.  * FUNCTION
  316.  *  wgui_get_inline_data
  317.  * DESCRIPTION
  318.  *  
  319.  * PARAMETERS
  320.  *  data        [?]     
  321.  * RETURNS
  322.  *  
  323.  *****************************************************************************/
  324. U8 *wgui_get_inline_data(U8 *data)
  325. {
  326.     /*----------------------------------------------------------------*/
  327.     /* Local Variables                                                */
  328.     /*----------------------------------------------------------------*/
  329.     S32 i, offset = 0, size;
  330.     /*----------------------------------------------------------------*/
  331.     /* Code Body                                                      */
  332.     /*----------------------------------------------------------------*/
  333.     for (i = 0; i < wgui_n_inline_items; i++)
  334.     {
  335.         size = 0;
  336.         switch (wgui_inline_items[i].flags & 0xff)
  337.         {
  338.             case INLINE_ITEM_TYPE_CAPTION:
  339.             case INLINE_ITEM_TYPE_DISPLAY_ONLY:
  340.             case INLINE_ITEM_TYPE_USER_DEFINED_SELECT:
  341.                 break;
  342.             case INLINE_ITEM_TYPE_TEXT_EDIT:
  343.             {
  344.                 S32 l;
  345.                 U16 ID = INLINE_ITEM_TEXT_EDIT_DATA_ID;
  346.                 wgui_inline_item_text_edit *ii = (wgui_inline_item_text_edit*) wgui_inline_items[i].item;
  347.                 l = ii->buffer_size * ENCODING_LENGTH;
  348.                 if (ii->input_type & INPUT_TYPE_PLUS_CHARACTER_HANDLING)
  349.                 {
  350.                     l += ENCODING_LENGTH;
  351.                 }
  352.                 size = INLINE_ITEM_DATA_ID_LENGTH + INLINE_ITEM_DATA_SIZE_LENGTH + sizeof(S32) + l;
  353.                 gui_memcpy((U8*) & data[offset], (U8*) & ID, INLINE_ITEM_DATA_ID_LENGTH);
  354.                 gui_memcpy(
  355.                     (U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH],
  356.                     (U8*) & l,
  357.                     INLINE_ITEM_DATA_SIZE_LENGTH);
  358.                 gui_memcpy(
  359.                     (U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + INLINE_ITEM_DATA_SIZE_LENGTH],
  360.                     (U8*) & (ii->UCS2_count),
  361.                     sizeof(S32));
  362.                 gui_memcpy(
  363.                     (U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + INLINE_ITEM_DATA_SIZE_LENGTH + sizeof(S32)],
  364.                     (U8*) ii->buffer,
  365.                     l);
  366.             }
  367.                 break;
  368.             case INLINE_ITEM_TYPE_FULL_SCREEN_EDIT:
  369.             {
  370.                 S32 l;
  371.                 U16 ID = INLINE_ITEM_FULL_SCREEN_EDIT_DATA_ID;
  372.                 wgui_inline_item_text_edit *ii = (wgui_inline_item_text_edit*) wgui_inline_items[i].item;
  373.                 U32 flags = 0;
  374.                 S32 flags_size = sizeof(U32);
  375.                 flags = (U32) (wgui_inline_items[i].flags >> 8);
  376.                 l = ii->buffer_size * ENCODING_LENGTH;
  377.                 if (ii->input_type & INPUT_TYPE_PLUS_CHARACTER_HANDLING)
  378.                 {
  379.                     l += ENCODING_LENGTH;
  380.                 }
  381.                 size = INLINE_ITEM_DATA_ID_LENGTH + INLINE_ITEM_DATA_SIZE_LENGTH + flags_size + (l << 1) + sizeof(S32);
  382.                 gui_memcpy((U8*) & data[offset], (U8*) & ID, INLINE_ITEM_DATA_ID_LENGTH);
  383.                 gui_memcpy((U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH], (U8*) & flags, flags_size);
  384.                 gui_memcpy(
  385.                     (U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + flags_size],
  386.                     (U8*) & l,
  387.                     INLINE_ITEM_DATA_SIZE_LENGTH);
  388.                 gui_memcpy(
  389.                     (U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + flags_size + INLINE_ITEM_DATA_SIZE_LENGTH],
  390.                     (U8*) & (ii->UCS2_count),
  391.                     sizeof(S32));
  392.                 gui_memcpy(
  393.                     (U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + INLINE_ITEM_DATA_SIZE_LENGTH + flags_size + sizeof(S32)],
  394.                     (U8*) wgui_inline_full_screen_text_edit_buffer,
  395.                     l);
  396.                 gui_memcpy(
  397.                     (U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + INLINE_ITEM_DATA_SIZE_LENGTH + flags_size + sizeof(S32) + l],
  398.                     (U8*) ii->buffer,
  399.                     l);
  400.             }
  401.                 break;
  402.             case INLINE_ITEM_TYPE_SELECT:
  403.             {
  404.                 U16 ID = INLINE_ITEM_SELECT_DATA_ID;
  405.                 S32 highlighted_item;
  406.                 wgui_inline_item_select *ii = (wgui_inline_item_select*) wgui_inline_items[i].item;
  407.                 size = INLINE_ITEM_DATA_ID_LENGTH + 2;
  408.                 highlighted_item = *ii->highlighted_item;
  409.                 gui_memcpy((U8*) & data[offset], (U8*) & ID, INLINE_ITEM_DATA_ID_LENGTH);
  410.                 gui_memcpy((U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH], (U8*) & highlighted_item, 2);
  411.             }
  412.                 break;
  413.                 /* Gurinder - 30/4/2004 - Att. Control History */
  414.             case INLINE_ITEM_ATTACH_IMAGE:
  415.             {
  416.                 U16 ID = INLINE_ITEM_ATTACH_IMAGE_DATA_ID;
  417.                 S32 higlighted_item;
  418.                 wgui_inline_image_attachment *ii = (wgui_inline_image_attachment*) wgui_inline_items[i].item;
  419.                 size = INLINE_ITEM_DATA_ID_LENGTH + 2;
  420.                 higlighted_item = ii->highlited_image;
  421.                 gui_memcpy((U8*) & data[offset], (U8*) & ID, INLINE_ITEM_DATA_ID_LENGTH);
  422.                 gui_memcpy((U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH], (U8*) & higlighted_item, 2);
  423.             }
  424.                 break;
  425.             case INLINE_ITEM_TYPE_DATE:
  426.             {
  427.                 U16 ID = INLINE_ITEM_DATE_DATA_ID;
  428.                 wgui_inline_item_date *ii = (wgui_inline_item_date*) wgui_inline_items[i].item;
  429.                 size = INLINE_ITEM_DATA_ID_LENGTH + 5 * ENCODING_LENGTH + 3 * ENCODING_LENGTH + 3 * ENCODING_LENGTH;
  430.                 gui_memcpy((U8*) & data[offset], (U8*) & ID, INLINE_ITEM_DATA_ID_LENGTH);
  431.                 gui_strcpy(
  432.                     (UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH],
  433.                     (UI_string_type) ii->year_buffer);
  434.                 gui_strcpy(
  435.                     (UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + 5 * ENCODING_LENGTH],
  436.                     (UI_string_type) ii->month_buffer);
  437.                 gui_strcpy(
  438.                     (UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + 5 * ENCODING_LENGTH + 3 * ENCODING_LENGTH],
  439.                     (UI_string_type) ii->day_buffer);
  440.             }
  441.                 break;
  442.             case INLINE_ITEM_TYPE_TIME:
  443.             {
  444.                 U16 ID = INLINE_ITEM_TIME_DATA_ID;
  445.                 wgui_inline_item_time *ii = (wgui_inline_item_time*) wgui_inline_items[i].item;
  446.                 size = INLINE_ITEM_DATA_ID_LENGTH + 3 * ENCODING_LENGTH + 3 * ENCODING_LENGTH;
  447.                 gui_memcpy((U8*) & data[offset], (U8*) & ID, INLINE_ITEM_DATA_ID_LENGTH);
  448.                 gui_strcpy(
  449.                     (UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH],
  450.                     (UI_string_type) ii->hours_buffer);
  451.                 gui_strcpy(
  452.                     (UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + 3 * ENCODING_LENGTH],
  453.                     (UI_string_type) ii->minutes_buffer);
  454.             }
  455.                 break;
  456.             case INLINE_ITEM_TYPE_TIME_PERIOD:
  457.             {
  458.                 U16 ID = INLINE_ITEM_TIME_PERIOD_DATA_ID;
  459.                 wgui_inline_item_time_period *ii = (wgui_inline_item_time_period*) wgui_inline_items[i].item;
  460.                 size =
  461.                     INLINE_ITEM_DATA_ID_LENGTH + 3 * ENCODING_LENGTH + 3 * ENCODING_LENGTH + 3 * ENCODING_LENGTH +
  462.                     3 * ENCODING_LENGTH;
  463.                 gui_memcpy((U8*) & data[offset], (U8*) & ID, INLINE_ITEM_DATA_ID_LENGTH);
  464.                 gui_strcpy(
  465.                     (UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH],
  466.                     (UI_string_type) ii->hours_buffer1);
  467.                 gui_strcpy(
  468.                     (UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + 3 * ENCODING_LENGTH],
  469.                     (UI_string_type) ii->minutes_buffer1);
  470.                 gui_strcpy(
  471.                     (UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + 3 * ENCODING_LENGTH + 3 * ENCODING_LENGTH],
  472.                     (UI_string_type) ii->hours_buffer2);
  473.                 gui_strcpy(
  474.                     (UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + 3 * ENCODING_LENGTH + 3 * ENCODING_LENGTH + 3 * ENCODING_LENGTH],
  475.                     (UI_string_type) ii->minutes_buffer2);
  476.             }
  477.                 break;
  478.             case INLINE_ITEM_TYPE_IP4_EDIT:
  479.             {
  480.                 U16 ID = INLINE_ITEM_IP4_EDIT_DATA_ID;
  481.                 wgui_inline_item_IP4 *ii = (wgui_inline_item_IP4*) wgui_inline_items[i].item;
  482.                 size =
  483.                     INLINE_ITEM_DATA_ID_LENGTH + 4 * ENCODING_LENGTH + 4 * ENCODING_LENGTH + 4 * ENCODING_LENGTH +
  484.                     4 * ENCODING_LENGTH;
  485.                 gui_memcpy((U8*) & data[offset], (U8*) & ID, INLINE_ITEM_DATA_ID_LENGTH);
  486.                 gui_strcpy((UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH], (UI_string_type) ii->b1);
  487.                 gui_strcpy(
  488.                     (UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + 4 * ENCODING_LENGTH],
  489.                     (UI_string_type) ii->b2);
  490.                 gui_strcpy(
  491.                     (UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + 4 * ENCODING_LENGTH + 4 * ENCODING_LENGTH],
  492.                     (UI_string_type) ii->b3);
  493.                 gui_strcpy(
  494.                     (UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + 4 * ENCODING_LENGTH + 4 * ENCODING_LENGTH + 4 * ENCODING_LENGTH],
  495.                     (UI_string_type) ii->b4);
  496.             }
  497.                 break;
  498.             case INLINE_ITEM_TYPE_DOW_SELECT:
  499.             {
  500.                 U16 ID = INLINE_ITEM_DOW_SELECT_DATA_ID;
  501.                 wgui_inline_item_DOW_select *ii = (wgui_inline_item_DOW_select*) wgui_inline_items[i].item;
  502.                 size = INLINE_ITEM_DATA_ID_LENGTH + 7;
  503.                 gui_memcpy((U8*) & data[offset], (U8*) & ID, INLINE_ITEM_DATA_ID_LENGTH);
  504.                 gui_memcpy((U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH], (U8*) ii->list_of_states, 7);
  505.             }
  506.                 break;
  507.         #if defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__) /* 4/5 */
  508.             case INLINE_ITEM_TYPE_MULTI_LINE_EDIT:
  509.             case INLINE_ITEM_TYPE_MULTI_LINE_RD_ONLY:
  510.             {
  511.                 /* U16 ID=INLINE_ITEM_TYPE_MULTI_LINE_DATA_ID; */
  512.                 size = INLINE_ITEM_DATA_ID_LENGTH + sizeof(multiline_inputbox_category_history);
  513.                 get_multiline_inputbox_category_history(
  514.                     MMI_INLINE_BOX_HISTORY_ID,
  515.                     &data[offset + INLINE_ITEM_DATA_ID_LENGTH],
  516.                     MMI_current_input_type);
  517.             }
  518.                 break;
  519.         #endif /* defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__) */ 
  520.             case INLINE_ITEM_TYPE_COLOR_SELECT:
  521.             {
  522.                 U16 ID = INLINE_ITEM_COLOR_SELECT_DATA_ID;
  523.                 S32 highlighted_index;
  524.                 S32 start_index;
  525.                 wgui_inline_item_color_select *ii = (wgui_inline_item_color_select*) wgui_inline_items[i].item;
  526.                 size = INLINE_ITEM_DATA_ID_LENGTH + 4;
  527.                 highlighted_index = ii->highlighted_index;
  528.                 start_index = ii->start_index;
  529.                 gui_memcpy((U8*) & data[offset], (U8*) & ID, INLINE_ITEM_DATA_ID_LENGTH);
  530.                 gui_memcpy((U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH], (U8*) & highlighted_index, 2);
  531.                 gui_memcpy((U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + 2], (U8*) & start_index, 2);
  532.             }
  533.                 break;
  534.         }
  535.         offset += size;
  536.     }
  537.     return (data);
  538. }
  539. #define reverse_pixtel_UI_memcpy(b1,b2,n) gui_memcpy((b2),(b1),(n))
  540. #define reverse_pixtel_UI_strcpy(s1,s2)      gui_strcpy(s2,s1)
  541. /*****************************************************************************
  542.  * FUNCTION
  543.  *  wgui_set_inline_data
  544.  * DESCRIPTION
  545.  *  
  546.  * PARAMETERS
  547.  *  inline_items        [?]         
  548.  *  n_items             [IN]        
  549.  *  data                [?]         
  550.  * RETURNS
  551.  *  void
  552.  *****************************************************************************/
  553. void wgui_set_inline_data(wgui_inline_item *inline_items, S32 n_items, U8 *data)
  554. {
  555.     /*----------------------------------------------------------------*/
  556.     /* Local Variables                                                */
  557.     /*----------------------------------------------------------------*/
  558.     S32 i, offset = 0, size;
  559.     /*----------------------------------------------------------------*/
  560.     /* Code Body                                                      */
  561.     /*----------------------------------------------------------------*/
  562.     if (data == NULL)
  563.     {
  564.         return;
  565.     }
  566.     for (i = 0; i < n_items; i++)
  567.     {
  568.         size = 0;
  569.         switch (inline_items[i].flags & 0xff)
  570.         {
  571.             case INLINE_ITEM_TYPE_CAPTION:
  572.             case INLINE_ITEM_TYPE_DISPLAY_ONLY:
  573.             case INLINE_ITEM_TYPE_USER_DEFINED_SELECT:
  574.                 break;
  575.             case INLINE_ITEM_TYPE_TEXT_EDIT:
  576.             {
  577.                 S32 l;
  578.                 U16 ID = INLINE_ITEM_TEXT_EDIT_DATA_ID;
  579.                 wgui_inline_item_text_edit *ii = (wgui_inline_item_text_edit*) inline_items[i].item;
  580.                 l = ii->buffer_size * ENCODING_LENGTH;
  581.                 if (ii->input_type & INPUT_TYPE_PLUS_CHARACTER_HANDLING)
  582.                 {
  583.                     l += ENCODING_LENGTH;
  584.                 }
  585.                 size = INLINE_ITEM_DATA_ID_LENGTH + INLINE_ITEM_DATA_SIZE_LENGTH + sizeof(S32) + l;
  586.                 reverse_pixtel_UI_memcpy((U8*) & data[offset], (U8*) & ID, INLINE_ITEM_DATA_ID_LENGTH);
  587.                 reverse_pixtel_UI_memcpy(
  588.                     (U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH],
  589.                     (U8*) & l,
  590.                     INLINE_ITEM_DATA_SIZE_LENGTH);
  591.                 reverse_pixtel_UI_memcpy(
  592.                     (U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + INLINE_ITEM_DATA_SIZE_LENGTH],
  593.                     (U8*) & (ii->UCS2_count),
  594.                     sizeof(S32));
  595.                 reverse_pixtel_UI_memcpy(
  596.                     (U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + INLINE_ITEM_DATA_SIZE_LENGTH + sizeof(S32)],
  597.                     (U8*) ii->buffer,
  598.                     l);
  599.             }
  600.                 break;
  601.             case INLINE_ITEM_TYPE_FULL_SCREEN_EDIT:
  602.             {
  603.                 S32 l;
  604.                 U16 ID = INLINE_ITEM_FULL_SCREEN_EDIT_DATA_ID;
  605.                 U32 flags;
  606.                 S32 flags_size = sizeof(U32);
  607.                 wgui_inline_item_text_edit *ii = (wgui_inline_item_text_edit*) inline_items[i].item;
  608.                 l = ii->buffer_size * ENCODING_LENGTH;
  609.                 if (ii->input_type & INPUT_TYPE_PLUS_CHARACTER_HANDLING)
  610.                 {
  611.                     l += ENCODING_LENGTH;
  612.                 }
  613.                 size = INLINE_ITEM_DATA_ID_LENGTH + INLINE_ITEM_DATA_SIZE_LENGTH + flags_size + (l << 1) + sizeof(S32);
  614.                 reverse_pixtel_UI_memcpy((U8*) & data[offset], (U8*) & ID, INLINE_ITEM_DATA_ID_LENGTH);
  615.                 reverse_pixtel_UI_memcpy(
  616.                     (U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH],
  617.                     (U8*) & flags,
  618.                     flags_size);
  619.                 reverse_pixtel_UI_memcpy(
  620.                     (U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + flags_size],
  621.                     (U8*) & l,
  622.                     INLINE_ITEM_DATA_SIZE_LENGTH);
  623.                 reverse_pixtel_UI_memcpy(
  624.                     (U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + flags_size + INLINE_ITEM_DATA_SIZE_LENGTH],
  625.                     (U8*) & (ii->UCS2_count),
  626.                     sizeof(S32));
  627.                 reverse_pixtel_UI_memcpy(
  628.                     (U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + INLINE_ITEM_DATA_SIZE_LENGTH + flags_size + sizeof(S32)],
  629.                     (U8*) wgui_inline_full_screen_text_edit_buffer,
  630.                     l);
  631.                 reverse_pixtel_UI_memcpy(
  632.                     (U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + INLINE_ITEM_DATA_SIZE_LENGTH + flags_size + sizeof(S32) + l],
  633.                     (U8*) ii->buffer,
  634.                     l);
  635.                 inline_items[i].flags &= 0x000000ff;
  636.                 inline_items[i].flags |= flags << 8;
  637.                 ii->flags |= (inline_items[i].flags & 0xffffff00);
  638.             }
  639.                 break;
  640.             case INLINE_ITEM_TYPE_SELECT:
  641.             {
  642.                 U16 ID = INLINE_ITEM_SELECT_DATA_ID;
  643.                 S32 highlighted_item = 0;
  644.                 wgui_inline_item_select *ii = (wgui_inline_item_select*) inline_items[i].item;
  645.                 size = INLINE_ITEM_DATA_ID_LENGTH + 2;
  646.                 reverse_pixtel_UI_memcpy((U8*) & data[offset], (U8*) & ID, INLINE_ITEM_DATA_ID_LENGTH);
  647.                 reverse_pixtel_UI_memcpy(
  648.                     (U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH],
  649.                     (U8*) & highlighted_item,
  650.                     2);
  651.                 *ii->highlighted_item = highlighted_item;
  652.                 if ((highlighted_item >= 0) && (highlighted_item < ii->n_items))
  653.                 {
  654.                     inline_items[i].text_p = ii->list_of_strings[highlighted_item];
  655.                 }
  656.             }
  657.                 break;
  658.                 /* Gurinder - 30/4/2004 - Att. Control History */
  659.             case INLINE_ITEM_ATTACH_IMAGE:
  660.             {
  661.                 U16 ID = INLINE_ITEM_ATTACH_IMAGE_DATA_ID;
  662.                 S32 highlighted_item = 0;
  663.                 //wgui_inline_image_attachment *ii = (wgui_inline_image_attachment*) inline_items[i].item;
  664.                 size = INLINE_ITEM_DATA_ID_LENGTH + 2;
  665.                 reverse_pixtel_UI_memcpy((U8*) & data[offset], (U8*) & ID, INLINE_ITEM_DATA_ID_LENGTH);
  666.                 reverse_pixtel_UI_memcpy(
  667.                     (U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH],
  668.                     (U8*) & highlighted_item,
  669.                     2);
  670.                 /* do not apply history, application will set index */
  671.                 //ii->highlited_image = (S16) highlighted_item;
  672.             }
  673.                 break;
  674.             case INLINE_ITEM_TYPE_DATE:
  675.             {
  676.                 U16 ID = INLINE_ITEM_DATE_DATA_ID;
  677.                 wgui_inline_item_date *ii = (wgui_inline_item_date*) inline_items[i].item;
  678.                 size = INLINE_ITEM_DATA_ID_LENGTH + 5 * ENCODING_LENGTH + 3 * ENCODING_LENGTH + 3 * ENCODING_LENGTH;
  679.                 reverse_pixtel_UI_memcpy((U8*) & data[offset], (U8*) & ID, INLINE_ITEM_DATA_ID_LENGTH);
  680.                 reverse_pixtel_UI_strcpy(
  681.                     (UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH],
  682.                     (UI_string_type) ii->year_buffer);
  683.                 reverse_pixtel_UI_strcpy(
  684.                     (UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + 5 * ENCODING_LENGTH],
  685.                     (UI_string_type) ii->month_buffer);
  686.                 reverse_pixtel_UI_strcpy(
  687.                     (UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + 5 * ENCODING_LENGTH + 3 * ENCODING_LENGTH],
  688.                     (UI_string_type) ii->day_buffer);
  689.                 ii->string_construct_callback(
  690.                         inline_items[i].text_p,
  691.                         ii->day_buffer,
  692.                         ii->month_buffer,
  693.                         ii->year_buffer);
  694.             }
  695.                 break;
  696.             case INLINE_ITEM_TYPE_TIME:
  697.             {
  698.                 U16 ID = INLINE_ITEM_TIME_DATA_ID;
  699.                 wgui_inline_item_time *ii = (wgui_inline_item_time*) inline_items[i].item;
  700.                 size = INLINE_ITEM_DATA_ID_LENGTH + 3 * ENCODING_LENGTH + 3 * ENCODING_LENGTH;
  701.                 reverse_pixtel_UI_memcpy((U8*) & data[offset], (U8*) & ID, INLINE_ITEM_DATA_ID_LENGTH);
  702.                 reverse_pixtel_UI_strcpy(
  703.                     (UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH],
  704.                     (UI_string_type) ii->hours_buffer);
  705.                 reverse_pixtel_UI_strcpy(
  706.                     (UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + 3 * ENCODING_LENGTH],
  707.                     (UI_string_type) ii->minutes_buffer);
  708.                 ii->string_construct_callback(
  709.                         inline_items[i].text_p,
  710.                         ii->hours_buffer,
  711.                         ii->minutes_buffer,
  712.                         ii->AM_PM_flag);
  713.             }
  714.                 break;
  715.             case INLINE_ITEM_TYPE_TIME_PERIOD:
  716.             {
  717.                 U16 ID = INLINE_ITEM_TIME_PERIOD_DATA_ID;
  718.                 wgui_inline_item_time_period *ii = (wgui_inline_item_time_period*) inline_items[i].item;
  719.                 size =
  720.                     INLINE_ITEM_DATA_ID_LENGTH + 3 * ENCODING_LENGTH + 3 * ENCODING_LENGTH + 3 * ENCODING_LENGTH +
  721.                     3 * ENCODING_LENGTH;
  722.                 reverse_pixtel_UI_memcpy((U8*) & data[offset], (U8*) & ID, INLINE_ITEM_DATA_ID_LENGTH);
  723.                 reverse_pixtel_UI_strcpy(
  724.                     (UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH],
  725.                     (UI_string_type) ii->hours_buffer1);
  726.                 reverse_pixtel_UI_strcpy(
  727.                     (UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + 3 * ENCODING_LENGTH],
  728.                     (UI_string_type) ii->minutes_buffer1);
  729.                 reverse_pixtel_UI_strcpy(
  730.                     (UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + 3 * ENCODING_LENGTH + 3 * ENCODING_LENGTH],
  731.                     (UI_string_type) ii->hours_buffer2);
  732.                 reverse_pixtel_UI_strcpy(
  733.                     (UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + 3 * ENCODING_LENGTH + 3 * ENCODING_LENGTH + 3 * ENCODING_LENGTH],
  734.                     (UI_string_type) ii->minutes_buffer2);
  735.                 ii->string_construct_callback(
  736.                         inline_items[i].text_p,
  737.                         ii->hours_buffer1,
  738.                         ii->minutes_buffer1,
  739.                         ii->AM_PM_flag1,
  740.                         ii->hours_buffer2,
  741.                         ii->minutes_buffer2,
  742.                         ii->AM_PM_flag2);
  743.             }
  744.                 break;
  745.             case INLINE_ITEM_TYPE_IP4_EDIT:
  746.             {
  747.                 U16 ID = INLINE_ITEM_IP4_EDIT_DATA_ID;
  748.                 wgui_inline_item_IP4 *ii = (wgui_inline_item_IP4*) inline_items[i].item;
  749.                 size =
  750.                     INLINE_ITEM_DATA_ID_LENGTH + 4 * ENCODING_LENGTH + 4 * ENCODING_LENGTH + 4 * ENCODING_LENGTH +
  751.                     4 * ENCODING_LENGTH;
  752.                 reverse_pixtel_UI_memcpy((U8*) & data[offset], (U8*) & ID, INLINE_ITEM_DATA_ID_LENGTH);
  753.                 reverse_pixtel_UI_strcpy(
  754.                     (UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH],
  755.                     (UI_string_type) ii->b1);
  756.                 reverse_pixtel_UI_strcpy(
  757.                     (UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + 4 * ENCODING_LENGTH],
  758.                     (UI_string_type) ii->b2);
  759.                 reverse_pixtel_UI_strcpy(
  760.                     (UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + 4 * ENCODING_LENGTH + 4 * ENCODING_LENGTH],
  761.                     (UI_string_type) ii->b3);
  762.                 reverse_pixtel_UI_strcpy(
  763.                     (UI_string_type) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + 4 * ENCODING_LENGTH + 4 * ENCODING_LENGTH + 4 * ENCODING_LENGTH],
  764.                     (UI_string_type) ii->b4);
  765.                 ii->string_construct_callback(inline_items[i].text_p, ii->b1, ii->b2, ii->b3, ii->b4);
  766.             }
  767.                 break;
  768.             case INLINE_ITEM_TYPE_DOW_SELECT:
  769.             {
  770.                 U16 ID = INLINE_ITEM_DOW_SELECT_DATA_ID;
  771.                 wgui_inline_item_DOW_select *ii = (wgui_inline_item_DOW_select*) inline_items[i].item;
  772.                 size = INLINE_ITEM_DATA_ID_LENGTH + 7;
  773.                 reverse_pixtel_UI_memcpy((U8*) & data[offset], (U8*) & ID, INLINE_ITEM_DATA_ID_LENGTH);
  774.                 reverse_pixtel_UI_memcpy(
  775.                     (U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH],
  776.                     (U8*) ii->list_of_states,
  777.                     7);
  778.             }
  779.                 break;
  780.         #if defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__) /* 4/5 */
  781.             case INLINE_ITEM_TYPE_MULTI_LINE_EDIT:
  782.             case INLINE_ITEM_TYPE_MULTI_LINE_RD_ONLY:
  783.             {
  784.                 /* Start Yogesh 20040813 */
  785.                 wgui_inline_item_text_edit *ii = (wgui_inline_item_text_edit*) inline_items[i].item;
  786.                 size = INLINE_ITEM_DATA_ID_LENGTH + sizeof(multiline_inputbox_category_history);
  787.                 set_multiline_inputbox_category_history(
  788.                     MMI_INLINE_BOX_HISTORY_ID,
  789.                     &data[offset + INLINE_ITEM_DATA_ID_LENGTH],
  790.                     (S16*) & MMI_current_input_type);
  791.                 ii->input_type = MMI_current_input_type;
  792.                 flag_use_current_input_type = TRUE;
  793.                 /* End Yogesh 20040813 */
  794.             }
  795.                 break;
  796.         #endif /* defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__) */ 
  797.             case INLINE_ITEM_TYPE_COLOR_SELECT:
  798.             {
  799.                 U16 ID = INLINE_ITEM_SELECT_DATA_ID;
  800.                 S32 highlighted_index = 0;
  801.                 S32 start_index = 0;
  802.                 wgui_inline_item_color_select *ii = (wgui_inline_item_color_select*) inline_items[i].item;
  803.                 size = INLINE_ITEM_DATA_ID_LENGTH + 4;
  804.                 reverse_pixtel_UI_memcpy((U8*) & data[offset], (U8*) & ID, INLINE_ITEM_DATA_ID_LENGTH);
  805.                 reverse_pixtel_UI_memcpy(
  806.                     (U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH],
  807.                     (U8*) & highlighted_index,
  808.                     2);
  809.                 reverse_pixtel_UI_memcpy(
  810.                     (U8*) & data[offset + INLINE_ITEM_DATA_ID_LENGTH + 2],
  811.                     (U8*) & start_index,
  812.                     2);
  813.                 ii->highlighted_index = (U16) (highlighted_index);
  814.                 ii->start_index = (U16) (start_index);
  815.             }
  816.                 break;
  817.         }
  818.         offset += size;
  819.     }
  820. }
  821. /*****************************************************************************
  822.  * FUNCTION
  823.  *  wgui_update_inline_data
  824.  * DESCRIPTION
  825.  *  To update inline buffer to user buffer before complete the inline item
  826.  * PARAMETERS
  827.  *  void
  828.  * RETURNS
  829.  *  void
  830.  *****************************************************************************/
  831. void wgui_update_inline_data(void)
  832. {
  833.     /*----------------------------------------------------------------*/
  834.     /* Local Variables                                                */
  835.     /*----------------------------------------------------------------*/
  836.     S32 i = 0;
  837.     /*----------------------------------------------------------------*/
  838.     /* Code Body                                                      */
  839.     /*----------------------------------------------------------------*/
  840.     for (i = 0; i < wgui_n_inline_items; i++)
  841.     {
  842.         switch (wgui_inline_items[i].flags & 0xff)
  843.         {
  844.             case INLINE_ITEM_TYPE_CAPTION:
  845.             case INLINE_ITEM_TYPE_DISPLAY_ONLY:
  846.             case INLINE_ITEM_TYPE_USER_DEFINED_SELECT:
  847.                 break;
  848.             case INLINE_ITEM_TYPE_TEXT_EDIT:
  849.                 gui_strcpy(
  850.                     (UI_string_type) current_wgui_inline_text_edit_item->buffer,
  851.                     (UI_string_type) wgui_inline_text_edit_buffer);
  852.                 break;
  853.             case INLINE_ITEM_TYPE_FULL_SCREEN_EDIT:
  854.                 gui_strcpy(
  855.                     (UI_string_type) current_wgui_inline_text_edit_item->buffer,
  856.                     (UI_string_type) wgui_inline_full_screen_text_edit_buffer);
  857.                 break;
  858.             case INLINE_ITEM_TYPE_SELECT:
  859.                 break;
  860.             case INLINE_ITEM_ATTACH_IMAGE:
  861.                 break;
  862.             case INLINE_ITEM_TYPE_DATE:
  863.                 gui_strcpy(
  864.                     (UI_string_type) current_wgui_inline_date_item->day_buffer,
  865.                     (UI_string_type) wgui_inline_date_edit_day_buffer);
  866.                 gui_strcpy(
  867.                     (UI_string_type) current_wgui_inline_date_item->month_buffer,
  868.                     (UI_string_type) wgui_inline_date_edit_month_buffer);
  869.                 gui_strcpy(
  870.                     (UI_string_type) current_wgui_inline_date_item->year_buffer,
  871.                     (UI_string_type) wgui_inline_date_edit_year_buffer);
  872.                 break;
  873.             case INLINE_ITEM_TYPE_TIME:
  874.                 gui_strcpy(
  875.                     (UI_string_type) current_wgui_inline_time_item->hours_buffer,
  876.                     (UI_string_type) wgui_inline_time_edit_hours_buffer);
  877.                 gui_strcpy(
  878.                     (UI_string_type) current_wgui_inline_time_item->minutes_buffer,
  879.                     (UI_string_type) wgui_inline_time_edit_minutes_buffer);
  880.                 gui_strcpy(
  881.                     (UI_string_type) current_wgui_inline_time_item->seconds_buffer,
  882.                     (UI_string_type) wgui_inline_time_edit_seconds_buffer);
  883.                 break;
  884.             case INLINE_ITEM_TYPE_TIME_PERIOD:
  885.                 gui_strcpy(
  886.                     (UI_string_type) current_wgui_inline_time_period_item->hours_buffer1,
  887.                     (UI_string_type) wgui_inline_time_period_edit_hours_buffer1);
  888.                 gui_strcpy(
  889.                     (UI_string_type) current_wgui_inline_time_period_item->minutes_buffer1,
  890.                     (UI_string_type) wgui_inline_time_period_edit_minutes_buffer1);
  891.                 gui_strcpy(
  892.                     (UI_string_type) current_wgui_inline_time_period_item->hours_buffer2,
  893.                     (UI_string_type) wgui_inline_time_period_edit_hours_buffer2);
  894.                 gui_strcpy(
  895.                     (UI_string_type) current_wgui_inline_time_period_item->minutes_buffer2,
  896.                     (UI_string_type) wgui_inline_time_period_edit_minutes_buffer2);
  897.                 break;
  898.             case INLINE_ITEM_TYPE_IP4_EDIT:
  899.                 gui_strcpy(
  900.                     (UI_string_type) current_wgui_inline_IP4_item->b1,
  901.                     (UI_string_type) wgui_inline_IP4_edit_buffer1);
  902.                 gui_strcpy(
  903.                     (UI_string_type) current_wgui_inline_IP4_item->b2,
  904.                     (UI_string_type) wgui_inline_IP4_edit_buffer2);
  905.                 gui_strcpy(
  906.                     (UI_string_type) current_wgui_inline_IP4_item->b3,
  907.                     (UI_string_type) wgui_inline_IP4_edit_buffer3);
  908.                 gui_strcpy(
  909.                     (UI_string_type) current_wgui_inline_IP4_item->b4,
  910.                     (UI_string_type) wgui_inline_IP4_edit_buffer4);
  911.                 break;
  912.             case INLINE_ITEM_TYPE_DOW_SELECT:
  913.                 break;
  914.         #if defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__)
  915.             case INLINE_ITEM_TYPE_MULTI_LINE_EDIT:
  916.                 gui_strcpy(
  917.                     (UI_string_type) current_wgui_inline_text_edit_item->buffer,
  918.                     (UI_string_type) wgui_inline_full_screen_text_edit_buffer);
  919.                 break;
  920.             case INLINE_ITEM_TYPE_MULTI_LINE_RD_ONLY:
  921.                 break;
  922.         #endif /* defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__) */ 
  923.             case INLINE_ITEM_TYPE_COLOR_SELECT:
  924.                 break;
  925.         }
  926.     }
  927. }
  928. /*****************************************************************************
  929.  * FUNCTION
  930.  *  GetInlineEditUCS2Count
  931.  * DESCRIPTION
  932.  *  
  933.  * PARAMETERS
  934.  *  i       [?]     
  935.  * RETURNS
  936.  *  
  937.  *****************************************************************************/
  938. S32 GetInlineEditUCS2Count(wgui_inline_item *i)
  939. {
  940.     /*----------------------------------------------------------------*/
  941.     /* Local Variables                                                */
  942.     /*----------------------------------------------------------------*/
  943.     S32 r = 0;
  944.     /*----------------------------------------------------------------*/
  945.     /* Code Body                                                      */
  946.     /*----------------------------------------------------------------*/
  947.     switch (i->flags & 0xff)
  948.     {
  949.         case INLINE_ITEM_TYPE_TEXT_EDIT:
  950.         case INLINE_ITEM_TYPE_FULL_SCREEN_EDIT:
  951.         {
  952.             wgui_inline_item_text_edit *p = (wgui_inline_item_text_edit*) i->item;
  953.             r = p->UCS2_count;
  954.         }
  955.             break;
  956.     }
  957.     return (r);
  958. }
  959. /*----------------------------------------------------------------------------
  960.    Default unhighlight handler used for inline editing menu
  961. ----------------------------------------------------------------------------*/
  962. /*****************************************************************************
  963.  * FUNCTION
  964.  *  wgui_inline_edit_default_list_unhighlight_handler
  965.  * DESCRIPTION
  966.  *  
  967.  * PARAMETERS
  968.  *  item_index      [IN]        
  969.  * RETURNS
  970.  *  void
  971.  *****************************************************************************/
  972. void wgui_inline_edit_default_list_unhighlight_handler(S32 item_index)
  973. {
  974.     /*----------------------------------------------------------------*/
  975.     /* Local Variables                                                */
  976.     /*----------------------------------------------------------------*/
  977.     /*----------------------------------------------------------------*/
  978.     /* Code Body                                                      */
  979.     /*----------------------------------------------------------------*/
  980.     /* W05.33 Fix inline text edit history issue */
  981.     wgui_current_inline_item_type = 0;
  982.     if (item_index > 0 &&
  983.         ((wgui_inline_items[item_index].flags & INLINE_ITEM_TYPE_MULTI_LINE_EDIT) == INLINE_ITEM_TYPE_MULTI_LINE_EDIT))
  984.     {
  985.         reset_multiline_inputbox_vertical_scroll();
  986.     }
  987. }
  988. /*----------------------------------------------------------------------------
  989.    Default highlight handler used for inline editing menu
  990. ----------------------------------------------------------------------------*/
  991. /*****************************************************************************
  992.  * FUNCTION
  993.  *  wgui_inline_edit_default_list_highlight_handler
  994.  * DESCRIPTION
  995.  *  
  996.  * PARAMETERS
  997.  *  item_index      [IN]        
  998.  * RETURNS
  999.  *  void
  1000.  *****************************************************************************/
  1001. void wgui_inline_edit_default_list_highlight_handler(S32 item_index)
  1002. {
  1003.     /*----------------------------------------------------------------*/
  1004.     /* Local Variables                                                */
  1005.     /*----------------------------------------------------------------*/
  1006.     /*----------------------------------------------------------------*/
  1007.     /* Code Body                                                      */
  1008.     /*----------------------------------------------------------------*/
  1009.     MMI_menu_shortcut_number = item_index + 1;
  1010.     MMI_highlighted_item_text = get_item_text(item_index);
  1011.     wgui_inline_item_handled = 0;
  1012.     wgui_inline_item_highlighted_index = item_index;
  1013.     register_default_hide_softkeys();
  1014.     complete_inline_item_edit = UI_dummy_function;
  1015.     current_wgui_inline_item = &wgui_inline_items[item_index];
  1016.     if (wgui_inline_items[item_index].flags & INLINE_ITEM_DISABLED)
  1017.     {
  1018.         if (wgui_inline_edit_arrow_key_flag == CATEGORY57_UP_ARROW_KEY_FLAG)
  1019.         {
  1020.             gui_fixed_list_menu_goto_previous_item(&MMI_fixed_list_menu);
  1021.         }
  1022.         else if (wgui_inline_edit_arrow_key_flag == CATEGORY57_DOWN_ARROW_KEY_FLAG)
  1023.         {
  1024.             gui_fixed_list_menu_goto_next_item(&MMI_fixed_list_menu);
  1025.         }
  1026.         else
  1027.         {
  1028.             gui_fixed_list_menu_goto_next_item(&MMI_fixed_list_menu);
  1029.         }
  1030.         return;
  1031.     }
  1032.     else if (wgui_inline_items[item_index].flags & INLINE_ITEM_FOLLOW_DOWN)
  1033.     {
  1034.         void (*saved_highlight_handler) (S32) = MMI_fixed_list_menu.item_highlighted;
  1035.         S32 display_position = MMI_fixed_list_menu.highlighted_item - MMI_fixed_list_menu.first_displayed_item + 1;
  1036.         /* PMT HIMANSHU START 20051021 */
  1037.         /* correct the check so that the menuitem will be displayed which is just below
  1038.            (follow down) the current menuitem, when the display position of current
  1039.            menuitem is greater than equal to the no of displayed menuitems. */
  1040.         /* if(display_position==MMI_fixed_list_menu.displayed_items) */
  1041.         if (display_position >= MMI_fixed_list_menu.displayed_items)
  1042.             /* PMT HIMANSHU END 20051021 */
  1043.         {
  1044.             MMI_fixed_list_menu.item_highlighted = UI_dummy_function_s32;
  1045.             gui_fixed_list_menu_goto_next_item(&MMI_fixed_list_menu);
  1046.             gui_fixed_list_menu_goto_previous_item(&MMI_fixed_list_menu);
  1047.             MMI_fixed_list_menu.item_highlighted = saved_highlight_handler;
  1048.         }
  1049.     }
  1050.     else if (wgui_inline_items[item_index].flags & INLINE_ITEM_FOLLOW_UP)
  1051.     {
  1052.         void (*saved_highlight_handler) (S32) = MMI_fixed_list_menu.item_highlighted;
  1053.         if (MMI_fixed_list_menu.highlighted_item == MMI_fixed_list_menu.first_displayed_item)
  1054.         {
  1055.             MMI_fixed_list_menu.item_highlighted = UI_dummy_function_s32;
  1056.             gui_fixed_list_menu_goto_previous_item(&MMI_fixed_list_menu);
  1057.             gui_fixed_list_menu_goto_next_item(&MMI_fixed_list_menu);
  1058.             MMI_fixed_list_menu.item_highlighted = saved_highlight_handler;
  1059.         }
  1060.     }
  1061.     /* Change the softkey functions and labels   */
  1062. #if defined(__MMI_TOUCH_SCREEN__)
  1063.     /* W06.05 Do not draw fixed list in category57 because of virtual keyboard */
  1064.     if (!mmi_pen_editor_is_closecategory57 && mmi_pen_editor_get_list_menu_height())
  1065.     {
  1066.         wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_EMPTY_TRAY);
  1067.         resize_fixed_list(MMI_content_width, mmi_pen_editor_get_list_menu_height());
  1068.     }
  1069. #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  1070.     switch (wgui_inline_items[item_index].flags & 0xff)
  1071.     {
  1072.         case INLINE_ITEM_TYPE_CAPTION:
  1073.         {
  1074.             if (wgui_inline_edit_arrow_key_flag == CATEGORY57_UP_ARROW_KEY_FLAG)
  1075.             {
  1076.                 gui_fixed_list_menu_goto_previous_item(&MMI_fixed_list_menu);
  1077.             }
  1078.             else if (wgui_inline_edit_arrow_key_flag == CATEGORY57_DOWN_ARROW_KEY_FLAG)
  1079.             {
  1080.                 gui_fixed_list_menu_goto_next_item(&MMI_fixed_list_menu);
  1081.             }
  1082.             else
  1083.             {
  1084.                 gui_fixed_list_menu_goto_next_item(&MMI_fixed_list_menu);
  1085.             }
  1086.             return;
  1087.         }
  1088.         case INLINE_ITEM_TYPE_DISPLAY_ONLY:
  1089.         {
  1090.             if (MMI_fixed_list_menu.first_displayed_item == item_index &&
  1091.                 (wgui_inline_items[item_index - 1].flags == INLINE_ITEM_TYPE_CAPTION))
  1092.             {
  1093.                 MMI_fixed_list_menu.first_displayed_item = item_index - 1;
  1094.             }
  1095.             clear_left_softkey_handler();
  1096.             set_left_softkey_label(NULL);
  1097.             set_left_softkey_icon(NULL);
  1098.             set_right_softkey_label(wgui_inline_edit_get_RSK_string());
  1099.             set_right_softkey_icon(NULL);
  1100.             register_right_softkey_handler();
  1101.             set_right_softkey_function(execute_wgui_inline_edit_RSK_function, KEY_EVENT_UP);
  1102.         }
  1103.             break;
  1104.         case INLINE_ITEM_TYPE_TEXT_EDIT:
  1105.         {
  1106.             if (MMI_fixed_list_menu.first_displayed_item == item_index &&
  1107.                 (wgui_inline_items[item_index - 1].flags == INLINE_ITEM_TYPE_CAPTION))
  1108.             {
  1109.                 MMI_fixed_list_menu.first_displayed_item = item_index - 1;
  1110.             }
  1111.             set_left_softkey_label(get_string(STR_GLOBAL_OK));
  1112.             set_left_softkey_icon(NULL);
  1113.             register_left_softkey_handler();
  1114.             /* Modified for LSK calling "Back" or "Done" functions based on dirty flag          */
  1115.             /* set_left_softkey_function(execute_wgui_inline_edit_DONE_function,KEY_EVENT_UP);     */
  1116.             /* set_left_softkey_function(execute_wgui_inline_edit_RSK_function,KEY_EVENT_UP); */
  1117.             /* MTK Terry Temp solution for in line LSK issue */
  1118.             if (wgui_inline_list_menu_disable_done)
  1119.             {
  1120.                 set_left_softkey_function(execute_wgui_inline_edit_DONE_function, KEY_EVENT_UP);
  1121.             #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
  1122.                 mmi_pen_editor_set_inputbox_LSK_Function(execute_wgui_inline_edit_DONE_function);
  1123.             #endif 
  1124.             }
  1125.             else
  1126.             {
  1127.                 set_left_softkey_function(execute_wgui_inline_edit_RSK_function, KEY_EVENT_UP);
  1128.             #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
  1129.                 mmi_pen_editor_set_inputbox_LSK_Function(execute_wgui_inline_edit_RSK_function);
  1130.             #endif 
  1131.             }
  1132.         #if defined(__MMI_TOUCH_SCREEN__)
  1133.             /* W06.05 Do not draw fixed list in category57 because of virtual keyboard */
  1134.             if (!mmi_pen_editor_is_closecategory57)
  1135.             {
  1136.                 /* W06.18 Check history id before setting the type of virtual keyboard */
  1137.                 inline_text_edit_history *h = (inline_text_edit_history*) wgui_current_history_buffer;
  1138.                 if (wgui_current_history_buffer && history_valid(h->history_ID, INLINE_TEXT_EDIT_HISTORY_ID))
  1139.                 {
  1140.                     wgui_setup_virtual_keyboard(h->vk_lang_type);
  1141.                 }
  1142.                 else
  1143.                 {
  1144.                     wgui_inline_item_text_edit *i = (wgui_inline_item_text_edit*) wgui_inline_items[item_index].item;
  1145.                     U16 input_type_only = i->input_type & INPUT_TYPE_MASK;
  1146.                     switch (input_type_only)
  1147.                     {
  1148.                         case INPUT_TYPE_ALPHANUMERIC_LOWERCASE:
  1149.                     #ifdef __MMI_EDITOR_PEN_VK_UNFOLD__
  1150.                             wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH);
  1151.                             break;
  1152.                     #endif
  1153.                         case INPUT_TYPE_ALPHANUMERIC_UPPERCASE:
  1154.                     #ifdef __MMI_EDITOR_PEN_VK_UNFOLD__
  1155.                             wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH_UPPERCASE);
  1156.                             break;
  1157.                     #endif
  1158.                         default:
  1159.                             wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_TRAY);
  1160.                             break;
  1161.                         case INPUT_TYPE_PHONE_NUMBER:
  1162.                             wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_PHONE_NUMBER);
  1163.                             break;
  1164.                         case INPUT_TYPE_SAT_NUMERIC_PASSWORD:
  1165.                         case INPUT_TYPE_KEYPAD_NUMERIC:
  1166.                             wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_PHONE_NUMBER);
  1167.                             break;
  1168.                         case INPUT_TYPE_DECIMAL_NUMERIC:
  1169.                             wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_NUMBER_DOT_TRAY);
  1170.                             break;
  1171.                         case INPUT_TYPE_NUMERIC:
  1172.                         case INPUT_TYPE_NUMERIC_PASSWORD:
  1173.                             wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_NUMBER_TRAY);
  1174.                             break;
  1175.                     }
  1176.                 }
  1177.             }
  1178.         #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  1179.         }
  1180.             break;
  1181.         case INLINE_ITEM_TYPE_MULTI_LINE_EDIT:
  1182.         {
  1183.             if (MMI_fixed_list_menu.first_displayed_item == item_index &&
  1184.                 (wgui_inline_items[item_index - 1].flags == INLINE_ITEM_TYPE_CAPTION))
  1185.             {
  1186.                 MMI_fixed_list_menu.first_displayed_item = item_index - 1;
  1187.             }
  1188.         #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
  1189.             MMI_fixed_list_menu.first_displayed_item = MMI_fixed_list_menu.highlighted_item;
  1190.         #endif 
  1191.         #if defined(__MMI_MULTITAP_FOR_STAR_AND_POUND__)
  1192.             set_left_softkey_label((UI_string_type) get_string(STR_GLOBAL_OPTIONS));
  1193.             set_left_softkey_icon(NULL);
  1194.         #else /* defined(__MMI_MULTITAP_FOR_STAR_AND_POUND__) */ 
  1195.             set_left_softkey_label(get_string(STR_GLOBAL_OK));
  1196.             set_left_softkey_icon(NULL);
  1197.         #endif /* defined(__MMI_MULTITAP_FOR_STAR_AND_POUND__) */ 
  1198.             register_left_softkey_handler();
  1199.             set_left_softkey_function(execute_wgui_inline_edit_RSK_function, KEY_EVENT_UP);
  1200.         #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
  1201.             mmi_pen_editor_set_inputbox_LSK_Function(execute_wgui_inline_edit_RSK_function);
  1202.         #endif 
  1203.             if (wgui_inline_list_menu_changed)
  1204.             {
  1205.                 if (wgui_inline_list_menu_disable_done)
  1206.                 {
  1207.                     inline_text_edit_RSK_label_string = (UI_string_type) get_string(STR_GLOBAL_BACK);
  1208.                     inline_text_edit_RSK_label_icon = NULL;
  1209.                 }
  1210.                 else
  1211.                 {
  1212.                     inline_text_edit_RSK_label_string = NULL;
  1213.                     inline_text_edit_RSK_label_icon = NULL;
  1214.                 }
  1215.             }
  1216.             else
  1217.             {
  1218.                 inline_text_edit_RSK_label_string = wgui_inline_edit_get_RSK_string();
  1219.                 inline_text_edit_RSK_label_icon = NULL;
  1220.             }
  1221.             set_right_softkey_label(inline_text_edit_RSK_label_string);
  1222.             set_right_softkey_icon(inline_text_edit_RSK_label_icon);
  1223.         #if defined(__MMI_TOUCH_SCREEN__)
  1224.             /* W06.05 Do not draw fixed list in category57 because of virtual keyboard */
  1225.             if (!mmi_pen_editor_is_closecategory57)
  1226.             {
  1227.                 /* W06.18 Check history id before setting the type of virtual keyboard */
  1228.                 multiline_inputbox_category_history *h =
  1229.                     (multiline_inputbox_category_history*) wgui_current_history_buffer;
  1230.                 if (wgui_current_history_buffer && history_valid(h->history_ID, INLINE_FULL_SCREEN_EDIT_HISTORY_ID))
  1231.                 {
  1232.                     wgui_setup_virtual_keyboard(h->vk_lang_type);
  1233.                 }
  1234.                 else
  1235.                 {
  1236.                     wgui_inline_item_text_edit *i = (wgui_inline_item_text_edit*) wgui_inline_items[item_index].item;
  1237.                     U16 input_type_only = i->input_type & INPUT_TYPE_MASK;
  1238.                     switch (input_type_only)
  1239.                     {
  1240.                         case INPUT_TYPE_ALPHANUMERIC_LOWERCASE:
  1241.                         case INPUT_TYPE_ALPHANUMERIC_UPPERCASE:
  1242.                         default:
  1243.                             wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_TRAY);
  1244.                             break;
  1245.                         case INPUT_TYPE_PHONE_NUMBER:
  1246.                             wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_PHONE_NUMBER);
  1247.                             break;
  1248.                         case INPUT_TYPE_SAT_NUMERIC_PASSWORD:
  1249.                         case INPUT_TYPE_KEYPAD_NUMERIC:
  1250.                             wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_PHONE_NUMBER);
  1251.                             break;
  1252.                         case INPUT_TYPE_DECIMAL_NUMERIC:
  1253.                             wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_NUMBER_DOT_TRAY);
  1254.                             break;
  1255.                         case INPUT_TYPE_NUMERIC:
  1256.                         case INPUT_TYPE_NUMERIC_PASSWORD:
  1257.                             wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_NUMBER_TRAY);
  1258.                             break;
  1259.                     }
  1260.                 }
  1261.             }
  1262.         #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  1263.         }
  1264.             break;
  1265.         case INLINE_ITEM_TYPE_FULL_SCREEN_EDIT:
  1266.         {
  1267.             if (MMI_fixed_list_menu.first_displayed_item == item_index &&
  1268.                 (wgui_inline_items[item_index - 1].flags == INLINE_ITEM_TYPE_CAPTION))
  1269.             {
  1270.                 MMI_fixed_list_menu.first_displayed_item = item_index - 1;
  1271.             }
  1272.             set_left_softkey_label(get_string(WGUI_CATEGORY_EDIT_STRING_ID));
  1273.             set_left_softkey_icon(NULL);
  1274.             register_left_softkey_handler();
  1275.             set_right_softkey_label(wgui_inline_edit_get_RSK_string());
  1276.             set_right_softkey_icon(NULL);
  1277.             register_right_softkey_handler();
  1278.             set_right_softkey_function(execute_wgui_inline_edit_RSK_function, KEY_EVENT_UP);
  1279.         #if defined(__MMI_TOUCH_SCREEN__)
  1280.             /* W06.08 Reset wgui_current_history_buffer if !INLINE_ITEM_OPEN to avoid incorrect use */
  1281.             if (!(wgui_inline_items[item_index].flags & INLINE_ITEM_OPEN))
  1282.             {
  1283.                 wgui_current_history_buffer = NULL;
  1284.             }
  1285.         #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  1286.         }
  1287.             break;
  1288.             // #ifdef __MMI_PLUTO_GPRS__
  1289.         case INLINE_ITEM_IMAGE_TEXT_TYPE:
  1290.         {
  1291.             if (MMI_fixed_list_menu.first_displayed_item == item_index &&
  1292.                 (wgui_inline_items[item_index - 1].flags == INLINE_ITEM_TYPE_CAPTION))
  1293.             {
  1294.                 MMI_fixed_list_menu.first_displayed_item = item_index - 1;
  1295.             }
  1296.             set_left_softkey_label(get_string(WGUI_CATEGORY_EDIT_STRING_ID));
  1297.             set_left_softkey_icon(NULL);
  1298.             register_left_softkey_handler();
  1299.             set_right_softkey_label(wgui_inline_edit_get_RSK_string());
  1300.             set_right_softkey_icon(NULL);
  1301.             register_right_softkey_handler();
  1302.             set_right_softkey_function(execute_wgui_inline_edit_RSK_function, KEY_EVENT_UP);
  1303.         }
  1304.             break;
  1305.         case INLINE_ITEM_ATTACH_IMAGE:
  1306.         {
  1307.             if (MMI_fixed_list_menu.first_displayed_item == item_index &&
  1308.                 (wgui_inline_items[item_index - 1].flags == INLINE_ITEM_TYPE_CAPTION))
  1309.             {
  1310.                 MMI_fixed_list_menu.first_displayed_item = item_index - 1;
  1311.             }
  1312.             set_left_softkey_label(get_string(WGUI_CATEGORY_EDIT_STRING_ID));
  1313.             set_left_softkey_icon(NULL);
  1314.             register_left_softkey_handler();
  1315.             set_right_softkey_label(wgui_inline_edit_get_RSK_string());
  1316.             set_right_softkey_icon(NULL);
  1317.             register_right_softkey_handler();
  1318.             set_right_softkey_function(execute_wgui_inline_edit_RSK_function, KEY_EVENT_UP);
  1319.         }
  1320.             break;
  1321.             /* Issue 50, 55(External) : Gurinder - 23/4/2004 */
  1322.         case INLINE_ITEM_TYPE_MULTI_LINE_RD_ONLY:
  1323.         {
  1324.             if (MMI_fixed_list_menu.first_displayed_item == item_index &&
  1325.                 (wgui_inline_items[item_index - 1].flags == INLINE_ITEM_TYPE_CAPTION))
  1326.             {
  1327.                 MMI_fixed_list_menu.first_displayed_item = item_index - 1;
  1328.             }
  1329.             set_right_softkey_label(wgui_inline_edit_get_RSK_string());
  1330.             set_right_softkey_icon(NULL);
  1331.             register_right_softkey_handler();
  1332.             set_right_softkey_function(execute_wgui_inline_edit_RSK_function, KEY_EVENT_UP);
  1333.         }
  1334.             break;
  1335.             // #endif
  1336.         case INLINE_ITEM_TYPE_SELECT:
  1337.         {
  1338.             if (MMI_fixed_list_menu.first_displayed_item == item_index &&
  1339.                 (wgui_inline_items[item_index - 1].flags == INLINE_ITEM_TYPE_CAPTION))
  1340.             {
  1341.                 MMI_fixed_list_menu.first_displayed_item = item_index - 1;
  1342.             }
  1343.             clear_left_softkey_handler();
  1344.             set_left_softkey_label(NULL);
  1345.             set_left_softkey_icon(NULL);
  1346.             set_right_softkey_label(wgui_inline_edit_get_RSK_string());
  1347.             set_right_softkey_icon(NULL);
  1348.             register_right_softkey_handler();
  1349.             set_right_softkey_function(execute_wgui_inline_edit_RSK_function, KEY_EVENT_UP);
  1350.         }
  1351.             break;
  1352.         case INLINE_ITEM_TYPE_USER_DEFINED_SELECT:
  1353.         {
  1354.             if (MMI_fixed_list_menu.first_displayed_item == item_index &&
  1355.                 (wgui_inline_items[item_index - 1].flags == INLINE_ITEM_TYPE_CAPTION))
  1356.             {
  1357.                 MMI_fixed_list_menu.first_displayed_item = item_index - 1;
  1358.             }
  1359.             clear_left_softkey_handler();
  1360.             set_left_softkey_label(NULL);
  1361.             set_left_softkey_icon(NULL);
  1362.             set_right_softkey_label(wgui_inline_edit_get_RSK_string());
  1363.             set_right_softkey_icon(NULL);
  1364.             register_right_softkey_handler();
  1365.             set_right_softkey_function(execute_wgui_inline_edit_RSK_function, KEY_EVENT_UP);
  1366.         }
  1367.             break;
  1368.         case INLINE_ITEM_TYPE_DATE:
  1369.         {
  1370.             if (MMI_fixed_list_menu.first_displayed_item == item_index &&
  1371.                 (wgui_inline_items[item_index - 1].flags == INLINE_ITEM_TYPE_CAPTION))
  1372.             {
  1373.                 MMI_fixed_list_menu.first_displayed_item = item_index - 1;
  1374.             }
  1375.             set_left_softkey_label(NULL);
  1376.             set_left_softkey_icon(NULL);
  1377.             register_left_softkey_handler();
  1378.             set_right_softkey_label(wgui_inline_edit_get_RSK_string());
  1379.             set_right_softkey_icon(NULL);
  1380.             register_right_softkey_handler();
  1381.             set_right_softkey_function(execute_wgui_inline_edit_RSK_function, KEY_EVENT_UP);
  1382.         #if defined(__MMI_TOUCH_SCREEN__)
  1383.             /* W06.05 Do not draw fixed list in category57 because of virtual keyboard */
  1384.             wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_NUMBER_TRAY);
  1385.         #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  1386.         }
  1387.             break;
  1388.         case INLINE_ITEM_TYPE_TIME:
  1389.         {
  1390.             if (MMI_fixed_list_menu.first_displayed_item == item_index &&
  1391.                 (wgui_inline_items[item_index - 1].flags == INLINE_ITEM_TYPE_CAPTION))
  1392.             {
  1393.                 MMI_fixed_list_menu.first_displayed_item = item_index - 1;
  1394.             }
  1395.             set_left_softkey_label(NULL);
  1396.             set_left_softkey_icon(NULL);
  1397.             register_left_softkey_handler();
  1398.             set_right_softkey_label(wgui_inline_edit_get_RSK_string());
  1399.             set_right_softkey_icon(NULL);
  1400.             register_right_softkey_handler();
  1401.             set_right_softkey_function(execute_wgui_inline_edit_RSK_function, KEY_EVENT_UP);
  1402.         #if defined(__MMI_TOUCH_SCREEN__)
  1403.             /* W06.05 Do not draw fixed list in category57 because of virtual keyboard */
  1404.             wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_NUMBER_TRAY);
  1405.         #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  1406.         }
  1407.             break;
  1408.         case INLINE_ITEM_TYPE_TIME_PERIOD:
  1409.         {
  1410.             if (MMI_fixed_list_menu.first_displayed_item == item_index &&
  1411.                 (wgui_inline_items[item_index - 1].flags == INLINE_ITEM_TYPE_CAPTION))
  1412.             {
  1413.                 MMI_fixed_list_menu.first_displayed_item = item_index - 1;
  1414.             }
  1415.             set_left_softkey_label(NULL);
  1416.             set_left_softkey_icon(NULL);
  1417.             register_left_softkey_handler();
  1418.             set_right_softkey_label(wgui_inline_edit_get_RSK_string());
  1419.             set_right_softkey_icon(NULL);
  1420.             register_right_softkey_handler();
  1421.             set_right_softkey_function(execute_wgui_inline_edit_RSK_function, KEY_EVENT_UP);
  1422.         #if defined(__MMI_TOUCH_SCREEN__)
  1423.             /* W06.05 Do not draw fixed list in category57 because of virtual keyboard */
  1424.             wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_NUMBER_TRAY);
  1425.         #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  1426.         }
  1427.             break;
  1428.         case INLINE_ITEM_TYPE_DOW_SELECT:
  1429.         {
  1430.             if (MMI_fixed_list_menu.first_displayed_item == item_index &&
  1431.                 (wgui_inline_items[item_index - 1].flags == INLINE_ITEM_TYPE_CAPTION))
  1432.             {
  1433.                 MMI_fixed_list_menu.first_displayed_item = item_index - 1;
  1434.             }
  1435.             if (MMI_inline_DOW_select.states[MMI_inline_DOW_select.highlighted_cell])
  1436.             {
  1437.                 set_left_softkey_label(get_string(WGUI_CATEGORY_OFF_STRING_ID));
  1438.             }
  1439.             else
  1440.             {
  1441.                 set_left_softkey_label(get_string(WGUI_CATEGORY_ON_STRING_ID));
  1442.             }
  1443.             set_left_softkey_icon(NULL);
  1444.             register_left_softkey_handler();
  1445.             set_left_softkey_function(handle_inline_DOW_select_LSK_up, KEY_EVENT_UP);
  1446.         #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
  1447.             mmi_pen_editor_set_inputbox_LSK_Function(handle_inline_DOW_select_LSK_up);
  1448.         #endif 
  1449.             set_right_softkey_label(wgui_inline_edit_get_RSK_string());
  1450.             set_right_softkey_icon(NULL);
  1451.             register_right_softkey_handler();
  1452.             set_right_softkey_function(execute_wgui_inline_edit_RSK_function, KEY_EVENT_UP);
  1453.         }
  1454.             break;
  1455.         case INLINE_ITEM_TYPE_IP4_EDIT:
  1456.         {
  1457.             if (MMI_fixed_list_menu.first_displayed_item == item_index &&
  1458.                 (wgui_inline_items[item_index - 1].flags == INLINE_ITEM_TYPE_CAPTION))
  1459.             {
  1460.                 MMI_fixed_list_menu.first_displayed_item = item_index - 1;
  1461.             }
  1462.             set_left_softkey_label(NULL);
  1463.             set_left_softkey_icon(NULL);
  1464.             register_left_softkey_handler();
  1465.             set_right_softkey_label(wgui_inline_edit_get_RSK_string());
  1466.             set_right_softkey_icon(NULL);
  1467.             register_right_softkey_handler();
  1468.             set_right_softkey_function(execute_wgui_inline_edit_RSK_function, KEY_EVENT_UP);
  1469.         #if defined(__MMI_TOUCH_SCREEN__)
  1470.             /* W06.05 Do not draw fixed list in category57 because of virtual keyboard */
  1471.             wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_NUMBER_TRAY);
  1472.         #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  1473.         }
  1474.             break;
  1475.         case INLINE_ITEM_TYPE_COLOR_SELECT:
  1476.         {
  1477.             if (MMI_fixed_list_menu.first_displayed_item == item_index &&
  1478.                 (wgui_inline_items[item_index - 1].flags == INLINE_ITEM_TYPE_CAPTION))
  1479.             {
  1480.                 MMI_fixed_list_menu.first_displayed_item = item_index - 1;
  1481.             }
  1482.             clear_left_softkey_handler();
  1483.             set_left_softkey_label(NULL);
  1484.             set_left_softkey_icon(NULL);
  1485.             set_right_softkey_label(wgui_inline_edit_get_RSK_string());
  1486.             set_right_softkey_icon(NULL);
  1487.             register_right_softkey_handler();
  1488.             set_right_softkey_function(execute_wgui_inline_edit_RSK_function, KEY_EVENT_UP);
  1489.         }
  1490.             break;
  1491.     }
  1492. #if defined(__MMI_TOUCH_SCREEN__)
  1493.     /* W06.05 Do not draw fixed list in category57 because of virtual keyboard */
  1494.     if (!mmi_pen_editor_is_closecategory57)
  1495.     {
  1496.         if ((GUI_VIRTUAL_KEYBOARD_EMPTY_TRAY != MMI_virtual_keyboard.lang_type)
  1497.             && (!((current_wgui_inline_item->flags & INLINE_ITEM_TYPE_MASK) == INLINE_ITEM_TYPE_FULL_SCREEN_EDIT)))
  1498.         {
  1499.             mmi_pen_editor_list_menu_highlight_resize();
  1500.         }
  1501.         gui_fixed_list_menu_locate_highlighted_item(&MMI_fixed_list_menu);
  1502.         /* W06.08 Move INLINE_ITEM_TYPE_MULTI_LINE_EDIT to the first displayed item */
  1503.         if (INLINE_ITEM_TYPE_MULTI_LINE_EDIT == (wgui_inline_items[item_index].flags & 0xff))
  1504.         {
  1505.             MMI_fixed_list_menu.first_displayed_item = item_index;
  1506.         }
  1507.     }
  1508. #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  1509.     gdi_layer_lock_frame_buffer();
  1510.     MMI_list_highlight_handler(item_index);
  1511.     if (!(MMI_fixed_list_menu.n_items == 2 && wgui_inline_items[0].flags == INLINE_ITEM_TYPE_CAPTION))
  1512.     {
  1513.         /* MTK Terry don't redraw softkey if popup window show up */
  1514.         /* W05.36 Temp Solution for Pop Screen in Full Screen Editor */
  1515.         if (GetActiveScreenId() != POPUP_SCREENID
  1516.             && GetActiveScreenId() != WAP_SCREEN_MESSAGE_NOTIFICATION
  1517.             && GetActiveScreenId() != SCR_ID_POC_CM
  1518.             && GetActiveScreenId() != SCR_ID_SAT_WAITSCREEN
  1519.             && GetActiveScreenId() != SCR_POPUP_SCREEN && GetActiveScreenId() != SCR_ID_MSG_POPUP)
  1520.         {
  1521.         #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  1522.             show_softkey_background();
  1523.         #endif 
  1524.             redraw_left_softkey();
  1525.             redraw_right_softkey();
  1526.         }
  1527.     }
  1528.     gdi_layer_unlock_frame_buffer();
  1529.     gdi_layer_blt_previous(0, UI_device_height - MMI_button_bar_height, UI_device_width - 1, UI_device_height - 1);
  1530. }
  1531. /*****************************************************************************
  1532.  * FUNCTION
  1533.  *  category_inline_edit_menuitem_flags
  1534.  * DESCRIPTION
  1535.  *  
  1536.  * PARAMETERS
  1537.  *  void
  1538.  * RETURNS
  1539.  *  void
  1540.  *****************************************************************************/
  1541. void category_inline_edit_menuitem_flags(void)
  1542. {
  1543.     /*----------------------------------------------------------------*/
  1544.     /* Local Variables                                                */
  1545.     /*----------------------------------------------------------------*/
  1546.     S32 i;
  1547.     /*----------------------------------------------------------------*/
  1548.     /* Code Body                                                      */
  1549.     /*----------------------------------------------------------------*/
  1550.     for (i = 0; i < MAX_INLINE_ITEMS; i++)
  1551.     {
  1552.         MMI_fixed_icontext_menuitems[i].flags &= ~UI_MENUITEM_INLINE_EDIT_OBJECT;
  1553.     }
  1554. }
  1555. /*****************************************************************************
  1556.  * FUNCTION
  1557.  *  wgui_show_inline_edit_menuitem
  1558.  * DESCRIPTION
  1559.  *  
  1560.  * PARAMETERS
  1561.  *  x           [IN]        
  1562.  *  y           [IN]        
  1563.  *  width       [IN]        
  1564.  *  height      [IN]        
  1565.  * RETURNS
  1566.  *  void
  1567.  *****************************************************************************/
  1568. void wgui_show_inline_edit_menuitem(S32 x, S32 y, S32 width, S32 height)
  1569. {
  1570.     /*----------------------------------------------------------------*/
  1571.     /* Local Variables                                                */
  1572.     /*----------------------------------------------------------------*/
  1573.     /*----------------------------------------------------------------*/
  1574.     /* Code Body                                                      */
  1575.     /*----------------------------------------------------------------*/
  1576.     if ((current_fixed_list_menuitem_display_index < 0) ||
  1577.         (current_fixed_list_menuitem_display_index > (MMI_fixed_list_menu.n_items - 1)))
  1578.     {
  1579.         return;
  1580.     }
  1581.     switch (wgui_inline_items[current_fixed_list_menuitem_display_index].flags & 0xff)
  1582.     {
  1583.         case INLINE_ITEM_TYPE_DOW_SELECT:
  1584.             wgui_show_DOW_list_menuitem(
  1585.                 x,
  1586.                 y,
  1587.                 width,
  1588.                 height,
  1589.                 &wgui_inline_items[current_fixed_list_menuitem_display_index]);
  1590.             break;
  1591.         case INLINE_ITEM_TYPE_TEXT_EDIT:
  1592.             wgui_show_inline_text_edit_list_menuitem(
  1593.                 x,
  1594.                 y,
  1595.                 width,
  1596.                 height,
  1597.                 &wgui_inline_items[current_fixed_list_menuitem_display_index]);
  1598.             break;
  1599.         case INLINE_ITEM_TYPE_DATE:
  1600.             wgui_show_inline_date_list_menuitem(
  1601.                 x,
  1602.                 y,
  1603.                 width,
  1604.                 height,
  1605.                 &wgui_inline_items[current_fixed_list_menuitem_display_index]);
  1606.             break;
  1607.         case INLINE_ITEM_TYPE_TIME:
  1608.             wgui_show_inline_time_list_menuitem(
  1609.                 x,
  1610.                 y,
  1611.                 width,
  1612.                 height,
  1613.                 &wgui_inline_items[current_fixed_list_menuitem_display_index]);
  1614.             break;
  1615.         case INLINE_ITEM_TYPE_TIME_PERIOD:
  1616.             wgui_show_inline_time_period_list_menuitem(
  1617.                 x,
  1618.                 y,
  1619.                 width,
  1620.                 height,
  1621.                 &wgui_inline_items[current_fixed_list_menuitem_display_index]);
  1622.             break;
  1623.         case INLINE_ITEM_TYPE_IP4_EDIT:
  1624.             wgui_show_inline_IP4_list_menuitem(
  1625.                 x,
  1626.                 y,
  1627.                 width,
  1628.                 height,
  1629.                 &wgui_inline_items[current_fixed_list_menuitem_display_index]);
  1630.             break;
  1631.             // #ifdef __MMI_PLUTO_GPRS__
  1632.         case INLINE_ITEM_IMAGE_TEXT_TYPE:
  1633.             wgui_show_image_text_item(
  1634.                 x,
  1635.                 y,
  1636.                 width,
  1637.                 height,
  1638.                 &wgui_inline_items[current_fixed_list_menuitem_display_index]);
  1639.             break;
  1640.         case INLINE_ITEM_ATTACH_IMAGE:
  1641.             wgui_show_image_attachment_item(
  1642.                 x,
  1643.                 y,
  1644.                 width,
  1645.                 height,
  1646.                 &wgui_inline_items[current_fixed_list_menuitem_display_index]);
  1647.             break;
  1648.             // #endif
  1649.         case INLINE_ITEM_TYPE_SELECT:
  1650.             wgui_show_inline_select_arrow(
  1651.                 x,
  1652.                 y,
  1653.                 width,
  1654.                 height,
  1655.                 &wgui_inline_items[current_fixed_list_menuitem_display_index]);
  1656.             break;
  1657.     #if defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__)
  1658.         case INLINE_ITEM_TYPE_MULTI_LINE_EDIT:
  1659.             wgui_show_inline_inscreen_multi_line_edit(
  1660.                 x,
  1661.                 y,
  1662.                 width,
  1663.                 height,
  1664.                 &wgui_inline_items[current_fixed_list_menuitem_display_index]);
  1665.             break;
  1666.         case INLINE_ITEM_TYPE_MULTI_LINE_RD_ONLY:
  1667.             wgui_show_inline_multi_line_rd_only(
  1668.                 x,
  1669.                 y,
  1670.                 width,
  1671.                 height,
  1672.                 &wgui_inline_items[current_fixed_list_menuitem_display_index]);
  1673.             break;
  1674.     #endif /* defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__) */ 
  1675.         case INLINE_ITEM_TYPE_COLOR_SELECT:
  1676.             wgui_show_highlighted_inline_color_select_menuitemitem(
  1677.                 x,
  1678.                 y,
  1679.                 width,
  1680.                 height,
  1681.                 &wgui_inline_items [current_fixed_list_menuitem_display_index]);
  1682.             break;
  1683.     }
  1684. }
  1685. /*****************************************************************************
  1686.  * FUNCTION
  1687.  *  wgui_setup_inline_edit_themes
  1688.  * DESCRIPTION
  1689.  *  
  1690.  * PARAMETERS
  1691.  *  void
  1692.  * RETURNS
  1693.  *  void
  1694.  *****************************************************************************/
  1695. void wgui_setup_inline_edit_themes(void)
  1696. {
  1697.     /*----------------------------------------------------------------*/
  1698.     /* Local Variables                                                */
  1699.     /*----------------------------------------------------------------*/
  1700.     /*----------------------------------------------------------------*/
  1701.     /* Code Body                                                      */
  1702.     /*----------------------------------------------------------------*/
  1703.     wgui_set_date_time_input_focussed_theme();
  1704.     temp_inline_edit_background_filler = date_time_input_background_filler;
  1705.     temp_inline_edit_background_filler3 = date_time_input_background_filler;
  1706.     temp_inline_edit_background_filler3.flags &= 0x00000fff;
  1707.     wgui_inline_select_fixed_text_menuitem_theme.normal_filler =
  1708.         wgui_inline_fixed_icontext_menuitem_theme.normal_filler;
  1709.     wgui_inline_select_fixed_text_menuitem_theme.disabled_filler =
  1710.         wgui_inline_fixed_icontext_menuitem_theme.disabled_filler;
  1711.     wgui_inline_select_fixed_text_menuitem_theme.selected_filler =
  1712.         wgui_inline_fixed_icontext_menuitem_theme.selected_filler;
  1713.     wgui_inline_select_fixed_text_menuitem_theme.focussed_filler =
  1714.         wgui_inline_fixed_icontext_menuitem_theme.focussed_filler;
  1715.     wgui_inline_select_fixed_text_menuitem_theme.normal_text_color =
  1716.         wgui_inline_fixed_icontext_menuitem_theme.normal_text_color;
  1717.     wgui_inline_select_fixed_text_menuitem_theme.disabled_text_color =
  1718.         wgui_inline_fixed_icontext_menuitem_theme.disabled_text_color;
  1719.     wgui_inline_select_fixed_text_menuitem_theme.selected_text_color =
  1720.         wgui_inline_fixed_icontext_menuitem_theme.selected_text_color;
  1721.     wgui_inline_select_fixed_text_menuitem_theme.focussed_text_color =
  1722.         wgui_inline_fixed_icontext_menuitem_theme.focussed_text_color;
  1723.     current_UI_theme->fixed_text_menuitem_theme = &wgui_inline_select_fixed_text_menuitem_theme;
  1724. }
  1725. /*****************************************************************************
  1726.  * FUNCTION
  1727.  *  DisableInlineInputMethodHints
  1728.  * DESCRIPTION
  1729.  *  
  1730.  * PARAMETERS
  1731.  *  void
  1732.  * RETURNS
  1733.  *  void
  1734.  *****************************************************************************/
  1735. void DisableInlineInputMethodHints(void)
  1736. {
  1737.     /*----------------------------------------------------------------*/
  1738.     /* Local Variables                                                */
  1739.     /*----------------------------------------------------------------*/
  1740.     /*----------------------------------------------------------------*/
  1741.     /* Code Body                                                      */
  1742.     /*----------------------------------------------------------------*/
  1743.     wgui_disable_inline_input_method_hints = 1;
  1744. }
  1745. /*----------------------------------------------------------------------------
  1746.    Category 57 specific functions for inline editing
  1747. ----------------------------------------------------------------------------*/
  1748. #define CAT57_APPEND_NONE                    0x00000000
  1749. #define CAT57_APPEND_TOP_INFO_BOX            0x00000001
  1750. #define CAT57_APPEND_BUTTOM_INFO_BOX         0x00000002 /* no implement */
  1751. #define CAT57_APPEND_TOP_MULTILINE_BOX       0x00000003 /* no implement */
  1752. #define CAT57_APPEND_BUTTOM_MULTILINE_BOX    0x00000004 /* no implement */
  1753. /* parameter from caller */
  1754. static U16 cat57_append_type = CAT57_APPEND_NONE;
  1755. static void (*cat57_draw_info_callback) (S32 idx, S32 x1, S32 y1, S32 x2, S32 y2) = NULL;
  1756. static void (*cat57_hide_info_callback) (S32 idx) = NULL;
  1757. static BOOL cat57_is_draw_once; /* will one callback once */
  1758. static U16 cat57_info_row_count;
  1759. /* inner parameters */
  1760. static S32 cat57_pos_x1;
  1761. static S32 cat57_pos_y1;
  1762. static S32 cat57_pos_x2;
  1763. static S32 cat57_pos_y2;
  1764. static BOOL cat57_is_need_draw;
  1765. /*****************************************************************************
  1766.  * FUNCTION
  1767.  *  InitializeCategory57Screen
  1768.  * DESCRIPTION
  1769.  *  
  1770.  * PARAMETERS
  1771.  *  void
  1772.  * RETURNS
  1773.  *  void
  1774.  *****************************************************************************/
  1775. void InitializeCategory57Screen(void)
  1776. {
  1777.     /*----------------------------------------------------------------*/
  1778.     /* Local Variables                                                */
  1779.     /*----------------------------------------------------------------*/
  1780.     /*----------------------------------------------------------------*/
  1781.     /* Code Body                                                      */
  1782.     /*----------------------------------------------------------------*/
  1783.     n_inline_text_edit_items = 0;
  1784.     n_inline_select_items = 0;
  1785.     n_inline_date_items = 0;
  1786.     n_inline_time_items = 0;
  1787.     n_inline_user_defined_select_items = 0;
  1788.     n_inline_IP4_items = 0;
  1789.     n_inline_DOW_items = 0;
  1790.     n_inline_time_period_items = 0;
  1791.     wgui_n_inline_items = 0;
  1792.     // #ifdef __MMI_PLUTO_GPRS__
  1793.     n_inline_image_text = 0;
  1794.     n_inline_attach_items = 0;
  1795.     n_inline_color_select_items = 0;
  1796.     current_attach_control = NULL;
  1797.     attach_disable_flag = MMI_FALSE;
  1798.     // #endif
  1799.     wgui_inline_item_highlighted_index = -1;
  1800.     wgui_inline_edit_DONE_function = NULL;
  1801.     wgui_inline_edit_BACK_function = NULL;
  1802.     wgui_inline_list_menu_changed = 0;
  1803.     current_wgui_inline_item = NULL;
  1804.     wgui_inline_edit_arrow_key_flag = CATEGORY57_NO_KEY_FLAG;
  1805.     /* START TARUN PMT 20040930 Added to enable the scoll bar in sent or insent items */
  1806.     flag_scroll = FALSE;
  1807.     //END TARUN PMT 20040930
  1808.     //PMT VIKAS START 20050707    
  1809. #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
  1810.     /* To enable line display */
  1811.     gui_enable_inline_bottom_line_draw();
  1812.     gui_enable_fixed_list_line_draw();
  1813. #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */ 
  1814.     /* PMT VIKAS END 20050707 */
  1815.     wgui_disable_inline_input_method_hints = 1;
  1816.     /* 101104 MTK Calvin added to clean up wgui_inline_items */
  1817.     memset(wgui_inline_items, 0, sizeof(wgui_inline_item) * MAX_INLINE_ITEMS);
  1818.     /* MTK Calvin end */
  1819.     /* MTK Leo start 20051001, for sending inline items' change notify to application */
  1820.     inline_item_changed_handler = NULL;
  1821.     /* MTK Leo end */
  1822. }
  1823. /*****************************************************************************
  1824.  * FUNCTION
  1825.  *  SetCategory57RightSoftkeyFunctions
  1826.  * DESCRIPTION
  1827.  *  
  1828.  * PARAMETERS
  1829.  *  done_function       [IN]        
  1830.  *  back_function       [IN]        
  1831.  * RETURNS
  1832.  *  void
  1833.  *****************************************************************************/
  1834. void SetCategory57RightSoftkeyFunctions(void (*done_function) (void), void (*back_function) (void))
  1835. {
  1836.     /*----------------------------------------------------------------*/
  1837.     /* Local Variables                                                */
  1838.     /*----------------------------------------------------------------*/
  1839.     /*----------------------------------------------------------------*/
  1840.     /* Code Body                                                      */
  1841.     /*----------------------------------------------------------------*/
  1842.     wgui_inline_edit_DONE_function = done_function;
  1843.     wgui_inline_edit_BACK_function = back_function;
  1844.     inline_text_edit_set_RSK_function();
  1845. }
  1846. /*****************************************************************************
  1847.  * FUNCTION
  1848.  *  SetCategory57LeftSoftkeyFunction
  1849.  * DESCRIPTION
  1850.  *  
  1851.  * PARAMETERS
  1852.  *  LSK_function        [IN]        
  1853.  * RETURNS
  1854.  *  void
  1855.  *****************************************************************************/
  1856. void SetCategory57LeftSoftkeyFunction(void (*LSK_function) (void))
  1857. {
  1858.     /*----------------------------------------------------------------*/
  1859.     /* Local Variables                                                */
  1860.     /*----------------------------------------------------------------*/
  1861.     /*----------------------------------------------------------------*/
  1862.     /* Code Body                                                      */
  1863.     /*----------------------------------------------------------------*/
  1864.     register_left_softkey_handler();
  1865.     set_left_softkey_function(execute_wgui_inline_edit_LSK_function, KEY_EVENT_UP);
  1866. #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
  1867.     mmi_pen_editor_set_inputbox_LSK_Function(execute_wgui_inline_edit_LSK_function);
  1868. #endif 
  1869.     wgui_inline_edit_LSK_function = LSK_function;
  1870. }
  1871. /*****************************************************************************
  1872.  * FUNCTION
  1873.  *  DisableCategory57ScreenDone
  1874.  * DESCRIPTION
  1875.  *  
  1876.  * PARAMETERS
  1877.  *  void
  1878.  * RETURNS
  1879.  *  void
  1880.  *****************************************************************************/
  1881. void DisableCategory57ScreenDone(void)
  1882. {
  1883.     /*----------------------------------------------------------------*/
  1884.     /* Local Variables                                                */
  1885.     /*----------------------------------------------------------------*/
  1886.     /*----------------------------------------------------------------*/
  1887.     /* Code Body                                                      */
  1888.     /*----------------------------------------------------------------*/
  1889.     wgui_inline_list_menu_disable_done = 1;
  1890. }
  1891. /*****************************************************************************
  1892.  * FUNCTION
  1893.  *  EnableCategory57ScreenDone
  1894.  * DESCRIPTION
  1895.  *  
  1896.  * PARAMETERS
  1897.  *  void
  1898.  * RETURNS
  1899.  *  void
  1900.  *****************************************************************************/
  1901. void EnableCategory57ScreenDone(void)
  1902. {
  1903.     /*----------------------------------------------------------------*/
  1904.     /* Local Variables                                                */
  1905.     /*----------------------------------------------------------------*/
  1906.     /*----------------------------------------------------------------*/
  1907.     /* Code Body                                                      */
  1908.     /*----------------------------------------------------------------*/
  1909.     wgui_inline_list_menu_disable_done = 0;
  1910. }
  1911. /* Max: set RSK to "Clear" */
  1912. /*****************************************************************************
  1913.  * FUNCTION
  1914.  *  SetCategory57ScreenRSKClear
  1915.  * DESCRIPTION
  1916.  *  
  1917.  * PARAMETERS
  1918.  *  void
  1919.  * RETURNS
  1920.  *  void
  1921.  *****************************************************************************/
  1922. void SetCategory57ScreenRSKClear(void)
  1923. {
  1924.     /*----------------------------------------------------------------*/
  1925.     /* Local Variables                                                */
  1926.     /*----------------------------------------------------------------*/
  1927.     /*----------------------------------------------------------------*/
  1928.     /* Code Body                                                      */
  1929.     /*----------------------------------------------------------------*/
  1930.     wgui_inline_list_menu_disable_done = 2; /* clear */
  1931. }
  1932. /*****************************************************************************
  1933.  * FUNCTION
  1934.  *  cat257_virtual_keypad_callback
  1935.  * DESCRIPTION
  1936.  *  Redraws the category57 screen
  1937.  * PARAMETERS
  1938.  *  void
  1939.  * RETURNS
  1940.  *  void
  1941.  *****************************************************************************/
  1942. /* MTK Leo add 040229 */
  1943. UI_font_type cat57_f1;
  1944. UI_font_type cat57_f2;
  1945. //----------------------------------------------------------------------------
  1946. //MTK Leo add 20040413, add category257 for currency convertor
  1947. U16 cat57_img;
  1948. void cat257_virtual_keypad_callback(void)
  1949. {
  1950. #if defined(__MMI_TOUCH_SCREEN__)
  1951.     /*----------------------------------------------------------------*/
  1952.     /* Local Variables                                                */
  1953.     /*----------------------------------------------------------------*/
  1954.     /*----------------------------------------------------------------*/
  1955.     /* Code Body                                                      */
  1956.     /*----------------------------------------------------------------*/
  1957.     if (GUI_VIRTUAL_KEYBOARD_EMPTY_TRAY != MMI_virtual_keyboard.lang_type)
  1958.     {
  1959.         mmi_pen_editor_clear_and_show_virtual_keyboard_area();
  1960.     }
  1961.     else
  1962.     {
  1963.     }
  1964. #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  1965. }
  1966. /* extern color wgui_transparent_color;//112205 transparent color Calvin */
  1967. /*****************************************************************************
  1968.  * FUNCTION
  1969.  *  ShowCategory257Screen
  1970.  * DESCRIPTION
  1971.  *  
  1972.  * PARAMETERS
  1973.  *  title                   [IN]        
  1974.  *  title_icon              [IN]        
  1975.  *  left_softkey            [IN]        
  1976.  *  left_softkey_icon       [IN]        
  1977.  *  right_softkey           [IN]        
  1978.  *  right_softkey_icon      [IN]        
  1979.  *  ImgId                   [IN]        
  1980.  *  number_of_items         [IN]        
  1981.  *  list_of_icons           [?]         
  1982.  *  list_of_items           [?]         
  1983.  *  highlighted_item        [IN]        
  1984.  *  history_buffer          [?]         
  1985.  * RETURNS
  1986.  *  void
  1987.  *****************************************************************************/
  1988. void ShowCategory257Screen(
  1989.         U16 title,
  1990.         U16 title_icon,
  1991.         U16 left_softkey,
  1992.         U16 left_softkey_icon,
  1993.         U16 right_softkey,
  1994.         U16 right_softkey_icon,
  1995.         U16 ImgId,
  1996.         S32 number_of_items,
  1997.         U16 *list_of_icons,
  1998.         InlineItem *list_of_items,
  1999.         S32 highlighted_item,
  2000.         U8 *history_buffer)
  2001. {
  2002.     /*----------------------------------------------------------------*/
  2003.     /* Local Variables                                                */
  2004.     /*----------------------------------------------------------------*/
  2005.     dm_data_struct dm_data;
  2006. #ifdef __MMI_WALLPAPER_ON_BOTTOM__
  2007.     color c = {0, 0, 255, 100}; /* 112205 transparent color Calvin */
  2008. #else 
  2009.     color c = {255, 255, 255, 100};
  2010. #endif 
  2011.     /*----------------------------------------------------------------*/
  2012.     /* Code Body                                                      */
  2013.     /*----------------------------------------------------------------*/
  2014. #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
  2015.     /* to avoid grid display on this cateory screen */
  2016.     gui_disable_fixed_list_line_draw();
  2017. #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */ 
  2018.     gdi_layer_lock_frame_buffer();
  2019. #if defined(__MMI_TOUCH_SCREEN__)
  2020.     wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_EMPTY_TRAY);
  2021. #endif 
  2022.     ShowCommonCategoryInlineEdit(
  2023.         (UI_string_type) get_string(title),
  2024.         title_icon,
  2025.         left_softkey,
  2026.         left_softkey_icon,
  2027.         right_softkey,
  2028.         right_softkey_icon,
  2029.         number_of_items,
  2030.         list_of_icons,
  2031.         list_of_items,
  2032.         highlighted_item,
  2033.         history_buffer,
  2034.         wgui_inline_edit_default_list_highlight_handler,
  2035.         wgui_inline_edit_default_list_unhighlight_handler,
  2036.         MMI_CATEGORY57_ID);
  2037.     gdi_layer_unlock_frame_buffer();
  2038.     if (list_of_icons == NULL)
  2039.     {
  2040.         set_fixed_icontext_positions(4, 0, 1, 0);
  2041.     }
  2042.     else
  2043.     {
  2044.         set_fixed_icontext_positions(MMI_INLINE_EDIT_MENUITEM_HEIGHT + 2, 0, 1, 0);
  2045.     }
  2046.     MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_SCROLLBAR | UI_LIST_MENU_DISABLE_BACKGROUND;
  2047. #ifdef __MMI_UI_LIST_CACHE_BACKGROUND__
  2048.     /* W06.05 Do not draw fixed list in category57 because of virtual keyboard */
  2049.     MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_BKGRND_IN_LAYER;
  2050. #endif /* __MMI_UI_LIST_CACHE_BACKGROUND__ */ 
  2051.     SetCategory57ScreenRSKClear();
  2052.     SetCategory57RightSoftkeyFunctions(NULL, GoBackHistory);
  2053.     ExitCategoryFunction = ExitCategory57Screen;
  2054.     GetCategoryHistory = GetCategory57History;
  2055.     GetCategoryHistorySize = GetCategory57HistorySize;
  2056.     RedrawCategoryFunction = dm_redraw_category_screen;
  2057.     dm_add_image(get_image(ImgId), NULL, NULL);
  2058.     dm_add_rectangle(c, 1);
  2059.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  2060.     dm_data.s32CatId = MMI_CATEGORY257_ID;
  2061.     dm_data.s32flags = DM_SHOW_VKPAD;
  2062.     dm_setup_data(&dm_data);
  2063.     dm_register_vkpad_callback(cat57_virtual_keypad_callback);
  2064.     dm_redraw_category_screen();
  2065. }
  2066. /*****************************************************************************
  2067. *
  2068. * Category 57
  2069. *
  2070. *****************************************************************************/
  2071. /*****************************************************************************
  2072.  * FUNCTION
  2073.  *  Cat57DrawTopInfoBox
  2074.  * DESCRIPTION
  2075.  *  
  2076.  * PARAMETERS
  2077.  *  void
  2078.  * RETURNS
  2079.  *  void
  2080.  *****************************************************************************/
  2081. static void Cat57DrawTopInfoBox(void)
  2082. {
  2083.     /*----------------------------------------------------------------*/
  2084.     /* Local Variables                                                */
  2085.     /*----------------------------------------------------------------*/
  2086.     /*----------------------------------------------------------------*/
  2087.     /* Code Body                                                      */
  2088.     /*----------------------------------------------------------------*/
  2089.     gdi_layer_push_clip();
  2090.     gui_set_clip(cat57_pos_x1, cat57_pos_y1, cat57_pos_x2, cat57_pos_y2);
  2091.     gui_fill_rectangle(
  2092.         cat57_pos_x1,
  2093.         cat57_pos_y1,
  2094.         cat57_pos_x2,
  2095.         cat57_pos_y2,
  2096.         current_MMI_theme->list_selected_item_filler->c);
  2097.     gui_pop_clip();
  2098. }
  2099. /*****************************************************************************
  2100.  * FUNCTION
  2101.  *  RedrawCategory57Screen
  2102.  * DESCRIPTION
  2103.  *  Category57 redraw function
  2104.  * PARAMETERS
  2105.  *  void
  2106.  * RETURNS
  2107.  *  void
  2108.  *****************************************************************************/
  2109. void RedrawCategory57Screen(void)
  2110. {
  2111.     /*----------------------------------------------------------------*/
  2112.     /* Local Variables                                                */
  2113.     /*----------------------------------------------------------------*/
  2114.     /*----------------------------------------------------------------*/
  2115.     /* Code Body                                                      */
  2116.     /*----------------------------------------------------------------*/
  2117.     dm_redraw_category_screen();
  2118. }
  2119. /*****************************************************************************
  2120.  * FUNCTION
  2121.  *  dm_category57_controlled_area
  2122.  * DESCRIPTION
  2123.  *  Category 57 controlled area callback called by draw manager
  2124.  * PARAMETERS
  2125.  *  coordinate      [IN/OUT]        It specifies the area in which the category will start the drawing. Also modifies it.
  2126.  * RETURNS
  2127.  *  void
  2128.  *****************************************************************************/
  2129. void dm_category57_controlled_area(dm_coordinates *coordinate)
  2130. {
  2131.     /*----------------------------------------------------------------*/
  2132.     /* Local Variables                                                */
  2133.     /*----------------------------------------------------------------*/
  2134.     /*----------------------------------------------------------------*/
  2135.     /* Code Body                                                      */
  2136.     /*----------------------------------------------------------------*/
  2137.     if (cat57_append_type == CAT57_APPEND_TOP_INFO_BOX)
  2138.     {
  2139.         cat57_is_need_draw = TRUE;
  2140.         coordinate->s16Height = MMI_menuitem_height * cat57_info_row_count;
  2141.         /* draw top info box */
  2142.         Cat57DrawTopInfoBox();
  2143.         if (cat57_draw_info_callback != NULL)
  2144.         {
  2145.             cat57_draw_info_callback(
  2146.                 MMI_fixed_list_menu.highlighted_item,
  2147.                 cat57_pos_x1,
  2148.                 cat57_pos_y1,
  2149.                 cat57_pos_x2,
  2150.                 cat57_pos_y2);
  2151.         }
  2152.     }
  2153.     else
  2154.     {
  2155.         coordinate->s16Width = 0;
  2156.         coordinate->s16Height = 0;
  2157.     }
  2158. }
  2159. /*****************************************************************************
  2160.  * FUNCTION
  2161.  *  Cat57HighlightHandler
  2162.  * DESCRIPTION
  2163.  *  
  2164.  * PARAMETERS
  2165.  *  item_index      [IN]        
  2166.  * RETURNS
  2167.  *  void
  2168.  *****************************************************************************/
  2169. static void Cat57HighlightHandler(S32 item_index)
  2170. {
  2171.     /*----------------------------------------------------------------*/
  2172.     /* Local Variables                                                */
  2173.     /*----------------------------------------------------------------*/
  2174.     /*----------------------------------------------------------------*/
  2175.     /* Code Body                                                      */
  2176.     /*----------------------------------------------------------------*/
  2177.     gdi_layer_lock_frame_buffer();
  2178.     wgui_inline_edit_default_list_highlight_handler(item_index);
  2179.     if (cat57_append_type == CAT57_APPEND_TOP_INFO_BOX)
  2180.     {
  2181.         if (!(wgui_inline_items[item_index].flags & INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT))
  2182.         {
  2183.             if (cat57_draw_info_callback != NULL && cat57_is_draw_once == FALSE)
  2184.             {
  2185.                 Cat57DrawTopInfoBox();
  2186.                 cat57_draw_info_callback(item_index, cat57_pos_x1, cat57_pos_y1, cat57_pos_x2, cat57_pos_y2);
  2187.             }
  2188.         }
  2189.     }
  2190.     gdi_layer_unlock_frame_buffer();
  2191.     gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
  2192. }
  2193. /*****************************************************************************
  2194.  * FUNCTION
  2195.  *  Cat57UnHighlightHandler
  2196.  * DESCRIPTION
  2197.  *  
  2198.  * PARAMETERS
  2199.  *  item_index      [IN]        
  2200.  * RETURNS
  2201.  *  void
  2202.  *****************************************************************************/
  2203. static void Cat57UnHighlightHandler(S32 item_index)
  2204. {
  2205.     /*----------------------------------------------------------------*/
  2206.     /* Local Variables                                                */
  2207.     /*----------------------------------------------------------------*/
  2208.     /*----------------------------------------------------------------*/
  2209.     /* Code Body                                                      */
  2210.     /*----------------------------------------------------------------*/
  2211.     wgui_inline_edit_default_list_unhighlight_handler(item_index);
  2212.     if (cat57_hide_info_callback != NULL && cat57_is_draw_once == FALSE)
  2213.     {
  2214.         cat57_hide_info_callback(item_index);
  2215.     }
  2216. }
  2217. /*****************************************************************************
  2218.  * FUNCTION
  2219.  *  cat57_virtual_keypad_callback
  2220.  * DESCRIPTION
  2221.  *  
  2222.  * PARAMETERS
  2223.  *  void
  2224.  * RETURNS
  2225.  *  void
  2226.  *****************************************************************************/
  2227. void cat57_virtual_keypad_callback(void)
  2228. {
  2229. #if defined(__MMI_TOUCH_SCREEN__)
  2230.     /*----------------------------------------------------------------*/
  2231.     /* Local Variables                                                */
  2232.     /*----------------------------------------------------------------*/
  2233.     /*----------------------------------------------------------------*/
  2234.     /* Code Body                                                      */
  2235.     /*----------------------------------------------------------------*/
  2236.     //W06.05 Do not draw fixed list in category57 because of virtual keyboard
  2237.     //if (MMI_FALSE == dm_is_redraw_screen())
  2238.     //{
  2239.     //   mmi_pen_editor_store_list_menu_height(MMI_fixed_list_menu.height - 1);
  2240.     //}
  2241.     //W05.35 For In Line Full Screen Editor Virtual Keyboard Issue
  2242.     if ((GUI_VIRTUAL_KEYBOARD_EMPTY_TRAY != MMI_virtual_keyboard.lang_type)
  2243.         && (!((current_wgui_inline_item->flags & INLINE_ITEM_TYPE_MASK) == INLINE_ITEM_TYPE_FULL_SCREEN_EDIT)))
  2244.     {
  2245.         //W05.40 Resize the fixed list menu and adjust the highlighted item position by mmi_pen_editor_vk_list_menu_resize
  2246.         //resize_fixed_list(MMI_content_width,mmi_pen_editor_get_list_menu_height() - MMI_virtual_keyboard.height - 1);
  2247.         //mmi_pen_editor_vk_list_menu_resize();
  2248.         if ((current_wgui_inline_item->flags & INLINE_ITEM_TYPE_MASK) == INLINE_ITEM_TYPE_MULTI_LINE_EDIT)
  2249.         {
  2250.             mmi_pen_editor_resize_multiline_input_box_for_vk();
  2251.         }
  2252.         else
  2253.         {
  2254.             mmi_pen_editor_clear_and_show_virtual_keyboard_area();
  2255.         }
  2256.     }
  2257.     //else
  2258.     //{
  2259.     //   resize_fixed_list(MMI_content_width,mmi_pen_editor_get_list_menu_height());
  2260.     //   redraw_fixed_list();
  2261.     //}
  2262.     //redraw_current_inline_item();
  2263. #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  2264. }
  2265. /* 101205 BMI Calvin Start */
  2266. //#if defined (__MMI_WALLPAPER_ON_BOTTOM__)     //KP Jerry disable on 2006-11-3
  2267. static U8 cat357_scr_bg_opacity;
  2268. static BOOL cat357_opacity_changed = FALSE;
  2269. /*****************************************************************************
  2270.  * FUNCTION
  2271.  *  ShowCategory357Screen
  2272.  * DESCRIPTION
  2273.  *  Redraws the category357 screen
  2274.  * PARAMETERS
  2275.  *  title                   [IN]        Title for the screen
  2276.  *  title_icon              [IN]        Icon shown with the title
  2277.  *  left_softkey            [IN]        Left softkey label
  2278.  *  left_softkey_icon       [IN]        Icon for the left softkey
  2279.  *  right_softkey           [IN]        Right softkey label
  2280.  *  right_softkey_icon      [IN]        Icon for the right softkey
  2281.  *  ImgId                   [IN]        Image shown on top of list
  2282.  *  number_of_items         [IN]        Number of items
  2283.  *  list_of_icons           [IN]        List of icons
  2284.  *  list_of_items           [IN]        See InlineItem structure.
  2285.  *  highlighted_item        [IN]        Default item to be highlighted (if there is no history)
  2286.  *  history_buffer          [IN]        History buffer
  2287.  * RETURNS
  2288.  *  void
  2289.  *****************************************************************************/
  2290. void ShowCategory357Screen(
  2291.         U16 title,
  2292.         U16 title_icon,
  2293.         U16 left_softkey,
  2294.         U16 left_softkey_icon,
  2295.         U16 right_softkey,
  2296.         U16 right_softkey_icon,
  2297.         U16 ImgId,
  2298.         S32 number_of_items,
  2299.         U16 *list_of_icons,
  2300.         InlineItem *list_of_items,
  2301.         S32 highlighted_item,
  2302.         U8 *history_buffer)
  2303. {
  2304.     /*----------------------------------------------------------------*/
  2305.     /* Local Variables                                                */
  2306.     /*----------------------------------------------------------------*/
  2307.     dm_data_struct dm_data;
  2308.     /*----------------------------------------------------------------*/
  2309.     /* Code Body                                                      */
  2310.     /*----------------------------------------------------------------*/
  2311.     //U16    list_height;//111605 warning Calvin
  2312.     //U16 list_offset_y;
  2313. #if defined(__MMI_UI_DALMATIAN_FIXEDLIST__)
  2314.     gui_disable_fixed_list_line_draw();
  2315. #endif 
  2316.     gdi_layer_lock_frame_buffer();
  2317. #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
  2318.     wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_EMPTY_TRAY);
  2319. #endif 
  2320.     ShowCommonCategoryInlineEdit(
  2321.         (UI_string_type) get_string(title),
  2322.         title_icon,
  2323.         left_softkey,
  2324.         left_softkey_icon,
  2325.         right_softkey,
  2326.         right_softkey_icon,
  2327.         number_of_items,
  2328.         list_of_icons,
  2329.         list_of_items,
  2330.         highlighted_item,
  2331.         history_buffer,
  2332.         Cat57HighlightHandler,
  2333.         Cat57UnHighlightHandler,
  2334.         MMI_CATEGORY57_ID);
  2335.     if (flag_scroll)
  2336.     {
  2337.         MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_SCROLLBAR;
  2338.     }
  2339.     dm_add_image(get_image(ImgId), NULL, NULL);
  2340.     dm_get_scr_bg_opacity(&cat357_scr_bg_opacity);
  2341.     dm_set_scr_bg_opacity(0);
  2342.     cat357_opacity_changed = TRUE;
  2343.     gdi_layer_unlock_frame_buffer();
  2344.     ExitCategoryFunction = ExitCategory57Screen;
  2345.     RedrawCategoryFunction = dm_redraw_category_screen;
  2346.     GetCategoryHistory = GetCategory57History;
  2347.     GetCategoryHistorySize = GetCategory57HistorySize;
  2348.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  2349.     dm_data.s32CatId = MMI_CATEGORY357_ID;
  2350.     dm_data.s32flags = 0;
  2351.     dm_data.s32flags |= DM_SHOW_VKPAD;
  2352.     dm_setup_data(&dm_data);
  2353.     dm_register_category_controlled_callback(dm_category57_controlled_area);
  2354.     dm_register_vkpad_callback(cat57_virtual_keypad_callback);
  2355.     dm_redraw_category_screen();
  2356. }
  2357. //#endif /* defined (__MMI_WALLPAPER_ON_BOTTOM__) */       //KP Jerry disable on 2006-11-3
  2358. /* 101205 BMI Calvin End */
  2359. /*****************************************************************************
  2360.  * FUNCTION
  2361.  *  ShowCategory57Screen
  2362.  * DESCRIPTION
  2363.  *  Redraws the category57 screen
  2364.  * PARAMETERS
  2365.  *  title                   [IN]        Title for the screen
  2366.  *  title_icon              [IN]        Icon shown with the title
  2367.  *  left_softkey            [IN]        Left softkey label
  2368.  *  left_softkey_icon       [IN]        Icon for the left softkey
  2369.  *  right_softkey           [IN]        Right softkey label
  2370.  *  right_softkey_icon      [IN]        Icon for the right softkey
  2371.  *  number_of_items         [IN]        Number of items
  2372.  *  list_of_icons           [IN]        List of icons
  2373.  *  list_of_items           [IN]        See InlineItem structure.
  2374.  *  highlighted_item        [IN]        Default item to be highlighted (if there is no history)
  2375.  *  history_buffer          [IN]        History buffer
  2376.  * RETURNS
  2377.  *  void
  2378.  *****************************************************************************/
  2379. void ShowCategory57Screen(
  2380.         U16 title,
  2381.         U16 title_icon,
  2382.         U16 left_softkey,
  2383.         U16 left_softkey_icon,
  2384.         U16 right_softkey,
  2385.         U16 right_softkey_icon,
  2386.         S32 number_of_items,
  2387.         U16 *list_of_icons,
  2388.         InlineItem *list_of_items,
  2389.         S32 highlighted_item,
  2390.         U8 *history_buffer)
  2391. {
  2392.     /*----------------------------------------------------------------*/
  2393.     /* Local Variables                                                */
  2394.     /*----------------------------------------------------------------*/
  2395.     dm_data_struct dm_data;
  2396.     U16 list_height;
  2397.     U16 list_offset_y;
  2398.     /*----------------------------------------------------------------*/
  2399.     /* Code Body                                                      */
  2400.     /*----------------------------------------------------------------*/
  2401.     /* init append related parameters */
  2402.     if (cat57_append_type == CAT57_APPEND_TOP_INFO_BOX)
  2403.     {
  2404.         list_height = MMI_content_height - MMI_menuitem_height * cat57_info_row_count;
  2405.         list_offset_y = MMI_title_y + MMI_title_height + MMI_menuitem_height * cat57_info_row_count;
  2406.         cat57_pos_x1 = 0;
  2407.         cat57_pos_y1 = MMI_title_y + MMI_title_height;
  2408.         cat57_pos_x2 = UI_device_width - 1;
  2409.         cat57_pos_y2 = MMI_title_y + MMI_title_height + MMI_menuitem_height * cat57_info_row_count - 1;
  2410.         cat57_is_need_draw = FALSE;
  2411.     }
  2412. #if defined(__MMI_UI_DALMATIAN_FIXEDLIST__)
  2413.     gui_disable_fixed_list_line_draw();
  2414. #endif 
  2415.     gdi_layer_lock_frame_buffer();
  2416. #if defined(__MMI_TOUCH_SCREEN__)
  2417.     wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_EMPTY_TRAY);
  2418. #endif 
  2419.     ShowCommonCategoryInlineEdit(
  2420.         (UI_string_type) get_string(title),
  2421.         title_icon,
  2422.         left_softkey,
  2423.         left_softkey_icon,
  2424.         right_softkey,
  2425.         right_softkey_icon,
  2426.         number_of_items,
  2427.         list_of_icons,
  2428.         list_of_items,
  2429.         highlighted_item,
  2430.         history_buffer,
  2431.         Cat57HighlightHandler,
  2432.         Cat57UnHighlightHandler,
  2433.         MMI_CATEGORY57_ID);
  2434.     if (flag_scroll)
  2435.     {
  2436.         MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_SCROLLBAR;
  2437.     }
  2438. #ifdef __MMI_UI_LIST_CACHE_BACKGROUND__
  2439.     /* W06.05 Do not draw fixed list in category57 because of virtual keyboard */
  2440.     MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_BKGRND_IN_LAYER;
  2441. #endif /* __MMI_UI_LIST_CACHE_BACKGROUND__ */ 
  2442.     gdi_layer_unlock_frame_buffer();
  2443.     ExitCategoryFunction = ExitCategory57Screen;
  2444.     RedrawCategoryFunction = dm_redraw_category_screen;
  2445.     GetCategoryHistory = GetCategory57History;
  2446.     GetCategoryHistorySize = GetCategory57HistorySize;
  2447.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  2448.     dm_data.s32CatId = MMI_CATEGORY57_ID;
  2449.     dm_data.s32flags = 0;
  2450.     dm_data.s32flags |= DM_SHOW_VKPAD;
  2451.     dm_setup_data(&dm_data);
  2452.     dm_register_category_controlled_callback(dm_category57_controlled_area);
  2453.     dm_register_vkpad_callback(cat57_virtual_keypad_callback);
  2454.     dm_redraw_category_screen();
  2455. }
  2456. /*****************************************************************************
  2457.  * FUNCTION
  2458.  *  Category57AppendTopInfoBox
  2459.  * DESCRIPTION
  2460.  *  Append top info box to Category screen 57.
  2461.  *  [NOTIC!] call this function before calling ShowCategory57Screen
  2462.  * PARAMETERS
  2463.  *  num_of_info_box_rows        [IN]        
  2464.  *  draw_info_callback          [IN]        
  2465.  *  hide_info_callback          [IN]        
  2466.  *  is_draw_once                [IN]        
  2467.  *  U16(?)                      [IN]        Row count for info box
  2468.  * RETURNS
  2469.  *  void
  2470.  *****************************************************************************/
  2471. void Category57AppendTopInfoBox(
  2472.         U16 num_of_info_box_rows,
  2473.         void (*draw_info_callback) (S32 idx, S32 x1, S32 y1, S32 x2, S32 y2),
  2474.         void (*hide_info_callback) (S32 idx),
  2475.         BOOL is_draw_once)
  2476. {
  2477.     /*----------------------------------------------------------------*/
  2478.     /* Local Variables                                                */
  2479.     /*----------------------------------------------------------------*/
  2480.     /*----------------------------------------------------------------*/
  2481.     /* Code Body                                                      */
  2482.     /*----------------------------------------------------------------*/
  2483.     cat57_append_type = CAT57_APPEND_TOP_INFO_BOX;
  2484.     cat57_draw_info_callback = draw_info_callback;
  2485.     cat57_hide_info_callback = hide_info_callback;
  2486.     cat57_info_row_count = num_of_info_box_rows;
  2487.     cat57_is_draw_once = is_draw_once;
  2488. }
  2489. /*****************************************************************************
  2490.  * FUNCTION
  2491.  *  CloseCategory57Screen
  2492.  * DESCRIPTION
  2493.  *  Exits the category57 screen
  2494.  * PARAMETERS
  2495.  *  void
  2496.  * RETURNS
  2497.  *  void
  2498.  *****************************************************************************/
  2499. extern void reset_pop_up_descriptions(void);
  2500. void CloseCategory57Screen(void)
  2501. {
  2502.     /*----------------------------------------------------------------*/
  2503.     /* Local Variables                                                */
  2504.     /*----------------------------------------------------------------*/
  2505.     /*----------------------------------------------------------------*/
  2506.     /* Code Body                                                      */
  2507.     /*----------------------------------------------------------------*/
  2508.     gdi_layer_lock_frame_buffer();
  2509. #if defined(__MMI_TOUCH_SCREEN__)
  2510.     mmi_pen_editor_is_closecategory57 = MMI_TRUE;
  2511. #endif 
  2512.     complete_inline_item_edit();
  2513. #if defined(__MMI_TOUCH_SCREEN__)
  2514.     mmi_pen_editor_is_closecategory57 = MMI_FALSE;
  2515. #endif 
  2516.     gdi_layer_unlock_frame_buffer();
  2517. }
  2518. extern void UI_dummy_menuitem_displayed_function(S32 index, S32 x1, S32 y1, S32 x2, S32 y2);
  2519. /*****************************************************************************
  2520.  * FUNCTION
  2521.  *  ExitCategory57Screen
  2522.  * DESCRIPTION
  2523.  *  
  2524.  * PARAMETERS
  2525.  *  void
  2526.  * RETURNS
  2527.  *  void
  2528.  *****************************************************************************/
  2529. void ExitCategory57Screen(void)
  2530. {
  2531.     /*----------------------------------------------------------------*/
  2532.     /* Local Variables                                                */
  2533.     /*----------------------------------------------------------------*/
  2534.     /*----------------------------------------------------------------*/
  2535.     /* Code Body                                                      */
  2536.     /*----------------------------------------------------------------*/
  2537. #if defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__)
  2538.     MMI_multiline_inputbox.flags &= ~UI_MULTI_LINE_INPUT_BOX_INSIDE_INLINE_MENU;
  2539. #endif 
  2540. #if(UI_BLINKING_CURSOR_SUPPORT)
  2541.     //gui_cancel_timer(UI_inputbox_blink_cursor);
  2542.     //MTK Elvis
  2543.     StopMyTimer(BLINKING_CURSOR);
  2544.     /* MTK end */
  2545. #endif /* (UI_BLINKING_CURSOR_SUPPORT) */ 
  2546.     /* PMT  MANISH  START  20050722 */
  2547. #if defined(__MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__) && defined(__MMI_UI_DALMATIAN_FIXEDLIST__)
  2548.     if (IsInlineItemDefaultTextEnable())
  2549.     {
  2550.         gui_enable_fixed_list_line_draw();
  2551.     }
  2552. #endif /* defined(__MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__) && defined(__MMI_UI_DALMATIAN_FIXEDLIST__) */ 
  2553. #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
  2554.     DisableInlineItemDefaultText();
  2555. #endif 
  2556.     /* PMT  MANISH  END  20050722 */
  2557.     MMI_disable_title_shortcut_display = 0;
  2558.     wgui_inline_edit_arrow_key_flag = CATEGORY57_NO_KEY_FLAG;
  2559.     gui_set_fixed_list_menu_current_theme(&MMI_fixed_list_menu);
  2560.     current_wgui_inline_item = NULL;
  2561.     wgui_n_inline_items = 0;
  2562.     /* PMT VIKAS START 20050707 */
  2563. #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
  2564.     /* reset the original settings for grid display */
  2565.     gui_disable_inline_bottom_line_draw();
  2566.     gui_enable_fixed_list_line_draw();
  2567. #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */ 
  2568.     //PMT VIKAS END 20050707
  2569.     //Start Yogesh 20040816 
  2570.     flag_use_current_input_type = FALSE;
  2571.     /* End Yogesh 20040816 */
  2572.     wgui_inline_item_highlighted_index = -1;
  2573.     wgui_inline_list_menu_changed = 0;
  2574.     wgui_inline_list_menu_disable_done = 0;
  2575.     MMI_multi_line_inputbox_present = 0;
  2576.     /* Start Yogesh 20040820 */
  2577.     wgui_inputbox_information_flag = 0;
  2578.     /* End Yogesh 20040820 */
  2579.     wgui_inline_edit_DONE_function = NULL;
  2580.     wgui_inline_edit_BACK_function = NULL;
  2581.     complete_inline_item_edit = UI_dummy_function;
  2582.     category_inline_edit_menuitem_flags();
  2583.     clear_inline_item_keys();
  2584.     wgui_text_menuitem_reset_scrolling();
  2585.     /* ifdef __MMI_PLUTO_GPRS__ */
  2586.     clear_inline_image_text_item();
  2587.     clear_inline_image_attachment_item();
  2588.     //endif
  2589.     //Reset The Change Flag - Gurinder - 15/4/2004
  2590.     MMI_multiline_inputbox.editor_changed = 0;
  2591.     reset_pop_up_descriptions();
  2592.     redraw_current_inline_item = UI_dummy_function;
  2593. #ifdef __MMI_TOUCH_SCREEN__
  2594.     wgui_current_inline_item_pen_function = UI_dummy_inline_item_pen_function;
  2595. #endif 
  2596.     ClearHighlightHandler();
  2597.     reset_softkeys();
  2598.     reset_menu_shortcut_handler();
  2599.     reset_fixed_list();
  2600.     MMI_fixed_list_menu.item_displayed_callback = UI_dummy_menuitem_displayed_function;
  2601.     ExitCategoryFunction = MMI_dummy_function;
  2602.     RedrawCategoryFunction = MMI_dummy_function;
  2603.     GetCategoryHistory = dummy_get_history;
  2604.     GetCategoryHistorySize = dummy_get_history_size;
  2605.     inline_edit_current_highlight_handler = MMI_dummy_highlight_handler;
  2606.     MMI_fixed_icontext_menuitem.text_font = cat57_f1;
  2607.     MMI_fixed_text_menuitem.text_font = cat57_f2;
  2608.     /* reset append */
  2609.     cat57_append_type = CAT57_APPEND_NONE;
  2610.     cat57_draw_info_callback = NULL;
  2611.     cat57_hide_info_callback = NULL;
  2612.     cat57_info_row_count = 0;
  2613. #ifdef __MMI_WALLPAPER_ON_BOTTOM__
  2614.     if (cat357_opacity_changed)
  2615.     {
  2616.         dm_set_scr_bg_opacity(cat357_scr_bg_opacity);
  2617.     }
  2618. #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */ 
  2619.     /* PMT VIKAS START 20050720 */
  2620. #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
  2621.     gui_unblock_list_effect();
  2622. #endif 
  2623.     /* PMT VIKAS END 20050720 */
  2624.     /* PMT VIKAS START 20050630 */
  2625. #ifdef __MMI_UI_TRANSPARENT_EFFECT__
  2626.     enable_fixed_icontext_menuitem_transparent_effect();
  2627. #endif 
  2628.     /* PMT VIKAS END 20050630 */
  2629.     /* MTK Leo start 20051001, for sending inline items' change notify to application */
  2630.     inline_item_changed_handler = NULL;
  2631.     /* MTK Leo end */
  2632. }
  2633. /*****************************************************************************
  2634.  * FUNCTION
  2635.  *  GetCategory57HistorySize
  2636.  * DESCRIPTION
  2637.  *  Gets the size of the history buffer for the category57 screen
  2638.  * PARAMETERS
  2639.  *  void
  2640.  * RETURNS
  2641.  *  size of history buffer in U8s
  2642.  *****************************************************************************/
  2643. S32 GetCategory57HistorySize(void)
  2644. {
  2645.     /*----------------------------------------------------------------*/
  2646.     /* Local Variables                                                */
  2647.     /*----------------------------------------------------------------*/
  2648.     /*----------------------------------------------------------------*/
  2649.     /* Code Body                                                      */
  2650.     /*----------------------------------------------------------------*/
  2651.     return (wgui_get_inline_history_size());
  2652. }
  2653. /*****************************************************************************
  2654.  * FUNCTION
  2655.  *  GetCategory57History
  2656.  * DESCRIPTION
  2657.  *  Gets the history buffer for the category57 screen
  2658.  * PARAMETERS
  2659.  *  history_buffer      [IN]        Is the buffer into which the history data is stored (pre-allocated)
  2660.  * RETURNS
  2661.  *  pointer to the history buffer
  2662.  *****************************************************************************/
  2663. U8 *GetCategory57History(U8 *history_buffer)
  2664. {
  2665.     /*----------------------------------------------------------------*/
  2666.     /* Local Variables                                                */
  2667.     /*----------------------------------------------------------------*/
  2668.     /*----------------------------------------------------------------*/
  2669.     /* Code Body                                                      */
  2670.     /*----------------------------------------------------------------*/
  2671.     return (wgui_get_inline_history(MMI_CATEGORY57_ID, history_buffer));
  2672. }
  2673. /*****************************************************************************
  2674.  * FUNCTION
  2675.  *  Category57ChangeItemText
  2676.  * DESCRIPTION
  2677.  *  
  2678.  * PARAMETERS
  2679.  *  index       [IN]        
  2680.  *  text        [?]         
  2681.  * RETURNS
  2682.  *  void
  2683.  *****************************************************************************/
  2684. void Category57ChangeItemText(S32 index, U8 *text)
  2685. {
  2686.     /*----------------------------------------------------------------*/
  2687.     /* Local Variables                                                */
  2688.     /*----------------------------------------------------------------*/
  2689.     /*----------------------------------------------------------------*/
  2690.     /* Code Body                                                      */
  2691.     /*----------------------------------------------------------------*/
  2692.     MMI_fixed_icontext_menuitems[index].item_text = (UI_string_type) text;
  2693. }
  2694. /*****************************************************************************
  2695.  * FUNCTION
  2696.  *  Category57ChangeItemIcon
  2697.  * DESCRIPTION
  2698.  *  
  2699.  * PARAMETERS
  2700.  *  index           [IN]        
  2701.  *  image_ID        [IN]        
  2702.  * RETURNS
  2703.  *  void
  2704.  *****************************************************************************/
  2705. void Category57ChangeItemIcon(S32 index, U16 image_ID)
  2706. {
  2707.     /*----------------------------------------------------------------*/
  2708.     /* Local Variables                                                */
  2709.     /*----------------------------------------------------------------*/
  2710.     /*----------------------------------------------------------------*/
  2711.     /* Code Body                                                      */
  2712.     /*----------------------------------------------------------------*/
  2713.     /* FIXME. There is potential problem that some inline items does not have icon. */
  2714.     MMI_fixed_icontext_menuitems[index].item_icon = wgui_get_list_menu_icon(index, image_ID);
  2715. }
  2716. /*****************************************************************************
  2717.  * FUNCTION
  2718.  *  GetCategory57DataSize
  2719.  * DESCRIPTION
  2720.  *  
  2721.  * PARAMETERS
  2722.  *  void
  2723.  * RETURNS
  2724.  *  
  2725.  *****************************************************************************/
  2726. S32 GetCategory57DataSize(void)
  2727. {
  2728.     /*----------------------------------------------------------------*/
  2729.     /* Local Variables                                                */
  2730.     /*----------------------------------------------------------------*/
  2731.     /*----------------------------------------------------------------*/
  2732.     /* Code Body                                                      */
  2733.     /*----------------------------------------------------------------*/
  2734.     return (wgui_get_inline_data_size());
  2735. }
  2736. /*****************************************************************************
  2737.  * FUNCTION
  2738.  *  GetCategory57Data
  2739.  * DESCRIPTION
  2740.  *  
  2741.  * PARAMETERS
  2742.  *  data        [?]     
  2743.  * RETURNS
  2744.  *  
  2745.  *****************************************************************************/
  2746. U8 *GetCategory57Data(U8 *data)
  2747. {
  2748.     /*----------------------------------------------------------------*/
  2749.     /* Local Variables                                                */
  2750.     /*----------------------------------------------------------------*/
  2751.     /*----------------------------------------------------------------*/
  2752.     /* Code Body                                                      */
  2753.     /*----------------------------------------------------------------*/
  2754.     return (wgui_get_inline_data(data));
  2755. }
  2756. /*****************************************************************************
  2757.  * FUNCTION
  2758.  *  SetCategory57Data
  2759.  * DESCRIPTION
  2760.  *  
  2761.  * PARAMETERS
  2762.  *  list_of_items       [?]         
  2763.  *  number_of_items     [IN]        
  2764.  *  data                [?]         
  2765.  * RETURNS
  2766.  *  void
  2767.  *****************************************************************************/
  2768. void SetCategory57Data(InlineItem *list_of_items, S32 number_of_items, U8 *data)
  2769. {
  2770.     /*----------------------------------------------------------------*/
  2771.     /* Local Variables                                                */
  2772.     /*----------------------------------------------------------------*/
  2773.     /*----------------------------------------------------------------*/
  2774.     /* Code Body                                                      */
  2775.     /*----------------------------------------------------------------*/
  2776.     wgui_set_inline_data(list_of_items, number_of_items, data);
  2777. }
  2778. /*----------------------------------------------------------------------------
  2779.    Category 157 specific functions for inline editing
  2780. ----------------------------------------------------------------------------*/
  2781. /*****************************************************************************
  2782.  * FUNCTION
  2783.  *  InitializeCategory157Screen
  2784.  * DESCRIPTION
  2785.  *  
  2786.  * PARAMETERS
  2787.  *  void
  2788.  * RETURNS
  2789.  *  void
  2790.  *****************************************************************************/
  2791. void InitializeCategory157Screen(void)
  2792. {
  2793.     /*----------------------------------------------------------------*/
  2794.     /* Local Variables                                                */
  2795.     /*----------------------------------------------------------------*/
  2796.     /*----------------------------------------------------------------*/
  2797.     /* Code Body                                                      */
  2798.     /*----------------------------------------------------------------*/
  2799.     n_inline_text_edit_items = 0;
  2800.     n_inline_select_items = 0;
  2801.     n_inline_date_items = 0;
  2802.     n_inline_time_items = 0;
  2803.     n_inline_user_defined_select_items = 0;
  2804.     n_inline_IP4_items = 0;
  2805.     n_inline_DOW_items = 0;
  2806.     n_inline_time_period_items = 0;
  2807.     wgui_n_inline_items = 0;
  2808.     wgui_inline_item_highlighted_index = -1;
  2809.     wgui_inline_edit_DONE_function = NULL;
  2810.     wgui_inline_edit_BACK_function = NULL;
  2811.     wgui_inline_list_menu_changed = 0;
  2812.     current_wgui_inline_item = NULL;
  2813.     wgui_inline_edit_arrow_key_flag = CATEGORY57_NO_KEY_FLAG;
  2814.     wgui_disable_inline_input_method_hints = 1;
  2815.     /* MTK Leo start 20051001, for sending inline items' change notify to application */
  2816.     inline_item_changed_handler = NULL;
  2817.     /* MTK Leo end */
  2818. }
  2819. /*****************************************************************************
  2820.  * FUNCTION
  2821.  *  SetCategory157RightSoftkeyFunctions
  2822.  * DESCRIPTION
  2823.  *  
  2824.  * PARAMETERS
  2825.  *  done_function       [IN]        
  2826.  *  back_function       [IN]        
  2827.  * RETURNS
  2828.  *  void
  2829.  *****************************************************************************/
  2830. void SetCategory157RightSoftkeyFunctions(void (*done_function) (void), void (*back_function) (void))
  2831. {
  2832.     /*----------------------------------------------------------------*/
  2833.     /* Local Variables                                                */
  2834.     /*----------------------------------------------------------------*/
  2835.     /*----------------------------------------------------------------*/
  2836.     /* Code Body                                                      */
  2837.     /*----------------------------------------------------------------*/
  2838.     wgui_inline_edit_DONE_function = done_function;
  2839.     wgui_inline_edit_BACK_function = back_function;
  2840.     inline_text_edit_set_RSK_function();
  2841. }
  2842. /*****************************************************************************
  2843.  * FUNCTION
  2844.  *  SetCategory157LeftSoftkeyFunction
  2845.  * DESCRIPTION
  2846.  *  
  2847.  * PARAMETERS
  2848.  *  LSK_function        [IN]        
  2849.  * RETURNS
  2850.  *  void
  2851.  *****************************************************************************/
  2852. void SetCategory157LeftSoftkeyFunction(void (*LSK_function) (void))
  2853. {
  2854.     /*----------------------------------------------------------------*/
  2855.     /* Local Variables                                                */
  2856.     /*----------------------------------------------------------------*/
  2857.     /*----------------------------------------------------------------*/
  2858.     /* Code Body                                                      */
  2859.     /*----------------------------------------------------------------*/
  2860.     register_left_softkey_handler();
  2861.     set_left_softkey_function(execute_wgui_inline_edit_LSK_function, KEY_EVENT_UP);
  2862. #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
  2863.     mmi_pen_editor_set_inputbox_LSK_Function(execute_wgui_inline_edit_LSK_function);
  2864. #endif 
  2865.     wgui_inline_edit_LSK_function = LSK_function;
  2866. }
  2867. /*****************************************************************************
  2868.  * FUNCTION
  2869.  *  DisableCategory157ScreenDone
  2870.  * DESCRIPTION
  2871.  *  
  2872.  * PARAMETERS
  2873.  *  void
  2874.  * RETURNS
  2875.  *  void
  2876.  *****************************************************************************/
  2877. void DisableCategory157ScreenDone(void)
  2878. {
  2879.     /*----------------------------------------------------------------*/
  2880.     /* Local Variables                                                */
  2881.     /*----------------------------------------------------------------*/
  2882.     /*----------------------------------------------------------------*/
  2883.     /* Code Body                                                      */
  2884.     /*----------------------------------------------------------------*/
  2885.     wgui_inline_list_menu_disable_done = 1;
  2886. }
  2887. /*****************************************************************************
  2888.  * FUNCTION
  2889.  *  ShowCategory157Screen
  2890.  * DESCRIPTION
  2891.  *  Redraws the category157 screen
  2892.  * PARAMETERS
  2893.  *  title                   [IN]        Title for the screen
  2894.  *  title_icon              [IN]        Icon shown with the title
  2895.  *  left_softkey            [IN]        Left softkey label
  2896.  *  left_softkey_icon       [IN]        Icon for the left softkey
  2897.  *  right_softkey           [IN]        Right softkey label
  2898.  *  right_softkey_icon      [IN]        Icon for the right softkey
  2899.  *  number_of_items         [IN]        Number of items
  2900.  *  list_of_icons           [IN]        List of icons
  2901.  *  list_of_items           [IN]        See InlineItem structure.
  2902.  *  highlighted_item        [IN]        Default item to be highlighted (if there is no history)
  2903.  *  history_buffer          [IN]        History buffer
  2904.  * RETURNS
  2905.  *  void
  2906.  *****************************************************************************/
  2907. void ShowCategory157Screen(
  2908.         U8 *title,
  2909.         U16 title_icon,
  2910.         U16 left_softkey,
  2911.         U16 left_softkey_icon,
  2912.         U16 right_softkey,
  2913.         U16 right_softkey_icon,
  2914.         S32 number_of_items,
  2915.         U16 *list_of_icons,
  2916.         InlineItem *list_of_items,
  2917.         S32 highlighted_item,
  2918.         U8 *history_buffer)
  2919. {
  2920.     /*----------------------------------------------------------------*/
  2921.     /* Local Variables                                                */
  2922.     /*----------------------------------------------------------------*/
  2923.     dm_data_struct dm_data;
  2924.     /*----------------------------------------------------------------*/
  2925.     /* Code Body                                                      */
  2926.     /*----------------------------------------------------------------*/
  2927.     ShowCommonCategoryInlineEdit(
  2928.         (UI_string_type) title,
  2929.         title_icon,
  2930.         left_softkey,
  2931.         left_softkey_icon,
  2932.         right_softkey,
  2933.         right_softkey_icon,
  2934.         number_of_items,
  2935.         list_of_icons,
  2936.         list_of_items,
  2937.         highlighted_item,
  2938.         history_buffer,
  2939.         wgui_inline_edit_default_list_highlight_handler,
  2940.         wgui_inline_edit_default_list_unhighlight_handler,
  2941.         MMI_CATEGORY57_ID);
  2942.     ExitCategoryFunction = ExitCategory157Screen;
  2943.     GetCategoryHistory = GetCategory57History;
  2944.     GetCategoryHistorySize = GetCategory57HistorySize;
  2945.     RedrawCategoryFunction = dm_redraw_category_screen;
  2946.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  2947.     dm_data.s32CatId = MMI_CATEGORY157_ID;
  2948.     dm_setup_data(&dm_data);
  2949.     dm_redraw_category_screen();
  2950. }
  2951. /*****************************************************************************
  2952.  * FUNCTION
  2953.  *  CloseCategory157Screen
  2954.  * DESCRIPTION
  2955.  *  Exits the category157 screen
  2956.  * PARAMETERS
  2957.  *  void
  2958.  * RETURNS
  2959.  *  void
  2960.  *****************************************************************************/
  2961. extern void reset_pop_up_descriptions(void);
  2962. void CloseCategory157Screen(void)
  2963. {
  2964.     /*----------------------------------------------------------------*/
  2965.     /* Local Variables                                                */
  2966.     /*----------------------------------------------------------------*/
  2967.     /*----------------------------------------------------------------*/
  2968.     /* Code Body                                                      */
  2969.     /*----------------------------------------------------------------*/
  2970.     gdi_layer_lock_frame_buffer();
  2971.     complete_inline_item_edit();
  2972.     gdi_layer_unlock_frame_buffer();
  2973. }
  2974. /*****************************************************************************
  2975.  * FUNCTION
  2976.  *  ExitCategory157Screen
  2977.  * DESCRIPTION
  2978.  *  
  2979.  * PARAMETERS
  2980.  *  void
  2981.  * RETURNS
  2982.  *  void
  2983.  *****************************************************************************/
  2984. void ExitCategory157Screen(void)
  2985. {
  2986.     /*----------------------------------------------------------------*/
  2987.     /* Local Variables                                                */