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

MTK

开发平台:

C/C++

  1. /*****************************************************************************
  2.  * FUNCTION
  3.  *  inline_edit_phone_number_input_numeric_key_handler
  4.  * DESCRIPTION
  5.  *  
  6.  * PARAMETERS
  7.  *  k       [IN]        
  8.  * RETURNS
  9.  *  void
  10.  *****************************************************************************/
  11. void inline_edit_phone_number_input_numeric_key_handler(MMI_key_code_type k)
  12. {
  13.     /*----------------------------------------------------------------*/
  14.     /* Local Variables                                                */
  15.     /*----------------------------------------------------------------*/
  16.     /*----------------------------------------------------------------*/
  17.     /* Code Body                                                      */
  18.     /*----------------------------------------------------------------*/
  19.     inline_text_edit_handle_multitap_input_complete(WGUI_INLINE_TEXT_EDIT_MULTITAP_ANY);
  20.     inline_edit_singleline_inputbox_direct_input((UI_character_type) ('0' + k));
  21.     /* MTK Elvis 20031201 */
  22. #ifdef __MMI_MULTITAP_KEY_0__
  23.     SetKeyHandler(MMI_key_0_down, KEY_0, KEY_EVENT_DOWN);
  24.     SetKeyHandler(MMI_key_0_down, KEY_0, KEY_REPEAT);
  25.     SetKeyHandler(MMI_key_0_up, KEY_0, KEY_EVENT_UP);
  26. #endif /* __MMI_MULTITAP_KEY_0__ */ 
  27.     /* MTK end */
  28. }
  29. /*****************************************************************************
  30.  * FUNCTION
  31.  *  inline_singleline_inputbox_keypad_numeric_handle_star_key_down
  32.  * DESCRIPTION
  33.  *  
  34.  * PARAMETERS
  35.  *  void
  36.  * RETURNS
  37.  *  void
  38.  *****************************************************************************/
  39. void inline_singleline_inputbox_keypad_numeric_handle_star_key_down(void)
  40. {
  41.     /*----------------------------------------------------------------*/
  42.     /* Local Variables                                                */
  43.     /*----------------------------------------------------------------*/
  44.     /*----------------------------------------------------------------*/
  45.     /* Code Body                                                      */
  46.     /*----------------------------------------------------------------*/
  47.     inline_edit_singleline_inputbox_direct_input((UI_character_type) '*');
  48. }
  49. /*****************************************************************************
  50.  * FUNCTION
  51.  *  inline_singleline_inputbox_keypad_numeric_handle_pound_key_down
  52.  * DESCRIPTION
  53.  *  
  54.  * PARAMETERS
  55.  *  void
  56.  * RETURNS
  57.  *  void
  58.  *****************************************************************************/
  59. void inline_singleline_inputbox_keypad_numeric_handle_pound_key_down(void)
  60. {
  61.     /*----------------------------------------------------------------*/
  62.     /* Local Variables                                                */
  63.     /*----------------------------------------------------------------*/
  64.     /*----------------------------------------------------------------*/
  65.     /* Code Body                                                      */
  66.     /*----------------------------------------------------------------*/
  67.     inline_edit_singleline_inputbox_direct_input((UI_character_type) '#');
  68. }
  69. /*****************************************************************************
  70.  * FUNCTION
  71.  *  wgui_inline_singleline_inputbox_decimal_numeric_handle_pound_key_down
  72.  * DESCRIPTION
  73.  *  
  74.  * PARAMETERS
  75.  *  void
  76.  * RETURNS
  77.  *  void
  78.  *****************************************************************************/
  79. void wgui_inline_singleline_inputbox_decimal_numeric_handle_pound_key_down(void)
  80. {
  81.     /*----------------------------------------------------------------*/
  82.     /* Local Variables                                                */
  83.     /*----------------------------------------------------------------*/
  84.     UI_buffer_type p;
  85.     UI_character_type c;
  86.     /*----------------------------------------------------------------*/
  87.     /* Code Body                                                      */
  88.     /*----------------------------------------------------------------*/
  89.     if (wgui_inline_singleline_inputbox_decimal_flag)
  90.     {
  91.         UI_editor_play_tone_invalid_data();
  92.         return;
  93.     }
  94.     if (gui_single_line_input_box_test_first_position(&MMI_inline_singleline_inputbox))
  95.     {
  96.         inline_edit_singleline_inputbox_direct_input((UI_character_type) '0');
  97.     }
  98.     inline_edit_singleline_inputbox_direct_input((UI_character_type) '.');
  99.     p = MMI_inline_singleline_inputbox.current_text_p;
  100.     if (p != MMI_inline_singleline_inputbox.text)
  101.     {
  102.         UI_STRING_GET_PREVIOUS_CHARACTER(p, c);
  103.         if (c == (UI_character_type) '.')
  104.         {
  105.             wgui_inline_singleline_inputbox_decimal_flag = 1;
  106.         }
  107.     }
  108. }
  109. /*****************************************************************************
  110.  * FUNCTION
  111.  *  inline_text_edit_set_RSK_function
  112.  * DESCRIPTION
  113.  *  
  114.  * PARAMETERS
  115.  *  void
  116.  * RETURNS
  117.  *  void
  118.  *****************************************************************************/
  119. void inline_text_edit_set_RSK_function(void)
  120. {
  121.     /*----------------------------------------------------------------*/
  122.     /* Local Variables                                                */
  123.     /*----------------------------------------------------------------*/
  124.     /*----------------------------------------------------------------*/
  125.     /* Code Body                                                      */
  126.     /*----------------------------------------------------------------*/
  127.     if ((current_wgui_inline_item != NULL) && ((current_wgui_inline_item->flags & 0xff) == INLINE_ITEM_TYPE_TEXT_EDIT))
  128.     {
  129.         inline_text_edit_RSK_function = wgui_inline_edit_BACK_function;
  130.     }
  131. }
  132. U8 wgui_inline_singleline_inputbox_input_mode_changed = 0;
  133. U8 wgui_inline_singleline_inputbox_input_type = 0;
  134. /*****************************************************************************
  135.  * FUNCTION
  136.  *  wgui_inline_singleline_inputbox_change_input_mode_multitap_ABC
  137.  * DESCRIPTION
  138.  *  
  139.  * PARAMETERS
  140.  *  void
  141.  * RETURNS
  142.  *  void
  143.  *****************************************************************************/
  144. void wgui_inline_singleline_inputbox_change_input_mode_multitap_ABC(void)
  145. {
  146.     /*----------------------------------------------------------------*/
  147.     /* Local Variables                                                */
  148.     /*----------------------------------------------------------------*/
  149.     /*----------------------------------------------------------------*/
  150.     /* Code Body                                                      */
  151.     /*----------------------------------------------------------------*/
  152.     wgui_inline_singleline_inputbox_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE;
  153.     wgui_inline_singleline_inputbox_input_mode_changed = 1;
  154. }
  155. /*****************************************************************************
  156.  * FUNCTION
  157.  *  wgui_inline_singleline_inputbox_change_input_mode_multitap_abc
  158.  * DESCRIPTION
  159.  *  
  160.  * PARAMETERS
  161.  *  void
  162.  * RETURNS
  163.  *  void
  164.  *****************************************************************************/
  165. void wgui_inline_singleline_inputbox_change_input_mode_multitap_abc(void)
  166. {
  167.     /*----------------------------------------------------------------*/
  168.     /* Local Variables                                                */
  169.     /*----------------------------------------------------------------*/
  170.     /*----------------------------------------------------------------*/
  171.     /* Code Body                                                      */
  172.     /*----------------------------------------------------------------*/
  173.     wgui_inline_singleline_inputbox_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE;
  174.     wgui_inline_singleline_inputbox_input_mode_changed = 1;
  175. }
  176. /*****************************************************************************
  177.  * FUNCTION
  178.  *  wgui_inline_singleline_inputbox_change_input_mode_multitap_numeric
  179.  * DESCRIPTION
  180.  *  
  181.  * PARAMETERS
  182.  *  void
  183.  * RETURNS
  184.  *  void
  185.  *****************************************************************************/
  186. void wgui_inline_singleline_inputbox_change_input_mode_multitap_numeric(void)
  187. {
  188.     /*----------------------------------------------------------------*/
  189.     /* Local Variables                                                */
  190.     /*----------------------------------------------------------------*/
  191.     /*----------------------------------------------------------------*/
  192.     /* Code Body                                                      */
  193.     /*----------------------------------------------------------------*/
  194.     wgui_inline_singleline_inputbox_input_type = INPUT_TYPE_NUMERIC;
  195.     wgui_inline_singleline_inputbox_input_mode_changed = 1;
  196. }
  197. /*****************************************************************************
  198.  * FUNCTION
  199.  *  wgui_inline_singleline_inputbox_insert_symbol
  200.  * DESCRIPTION
  201.  *  
  202.  * PARAMETERS
  203.  *  symbol      [IN]        
  204.  * RETURNS
  205.  *  void
  206.  *****************************************************************************/
  207. void wgui_inline_singleline_inputbox_insert_symbol(UI_character_type symbol)
  208. {
  209.     /*----------------------------------------------------------------*/
  210.     /* Local Variables                                                */
  211.     /*----------------------------------------------------------------*/
  212.     /*----------------------------------------------------------------*/
  213.     /* Code Body                                                      */
  214.     /*----------------------------------------------------------------*/
  215.     inline_edit_singleline_inputbox_direct_input(symbol);
  216. }
  217. extern void change_input_mode(void);
  218. /* MTK Elvis for single line input mode change */
  219. extern void change_singleline_input_mode(void);
  220. /* MTK end */
  221. extern void (*inputbox_change_mode) (void);
  222. /*****************************************************************************
  223.  * FUNCTION
  224.  *  wgui_hide_inline_input_method
  225.  * DESCRIPTION
  226.  *  
  227.  * PARAMETERS
  228.  *  void
  229.  * RETURNS
  230.  *  void
  231.  *****************************************************************************/
  232. void wgui_hide_inline_input_method(void)
  233. {
  234.     /*----------------------------------------------------------------*/
  235.     /* Local Variables                                                */
  236.     /*----------------------------------------------------------------*/
  237.     /*----------------------------------------------------------------*/
  238.     /* Code Body                                                      */
  239.     /*----------------------------------------------------------------*/
  240.     draw_title();
  241. }
  242. /*****************************************************************************
  243.  * FUNCTION
  244.  *  wgui_display_inline_input_method
  245.  * DESCRIPTION
  246.  *  
  247.  * PARAMETERS
  248.  *  void
  249.  * RETURNS
  250.  *  void
  251.  *****************************************************************************/
  252. void wgui_display_inline_input_method(void)
  253. {
  254.     /*----------------------------------------------------------------*/
  255.     /* Local Variables                                                */
  256.     /*----------------------------------------------------------------*/
  257.     S32 iwidth, iheight, swidth, sheight;
  258.     UI_string_type inputmode_string = (UI_string_type) "";
  259.     stFontAttribute *f = &MMI_small_font;
  260.     color c = *current_MMI_theme->shortcut_indicator_text_color;
  261.     UI_filled_area *bg = current_MMI_theme->shortcut_indicator_background_filler;
  262.     S32 x1, y1, x2, y2, w, h;
  263.     /*----------------------------------------------------------------*/
  264.     /* Code Body                                                      */
  265.     /*----------------------------------------------------------------*/
  266.     gui_cancel_timer(wgui_display_inline_input_method);
  267.     gui_cancel_timer(wgui_hide_inline_input_method);
  268.     if (wgui_disable_inline_input_method_hints)
  269.     {
  270.         return;
  271.     }
  272.     gdi_layer_lock_frame_buffer();
  273.     draw_title();
  274.     gdi_layer_unlock_frame_buffer();
  275.     switch (MMI_current_input_mode)
  276.     {
  277.         case 0:
  278.             inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_ABC_STRING_ID);
  279.             wgui_inputbox_information_icon = get_image(WGUI_INPUT_INFORMATION_ICON1);
  280.             break;
  281.         case 1:
  282.             inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_abc_STRING_ID);
  283.             wgui_inputbox_information_icon = get_image(WGUI_INPUT_INFORMATION_ICON1);
  284.             break;
  285.         case 2:
  286.             inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_123_STRING_ID);
  287.             wgui_inputbox_information_icon = get_image(WGUI_INPUT_INFORMATION_ICON1);
  288.             break;
  289.         default:
  290.             wgui_inputbox_information_icon = NULL;
  291.             break;
  292.     }
  293.     gui_measure_image(wgui_inputbox_information_icon, &iwidth, &iheight);
  294.     gui_set_font(f);
  295.     gui_measure_string(inputmode_string, &swidth, &sheight);
  296.     w = swidth + iwidth + 6;
  297.     if (w > UI_device_width)
  298.     {
  299.         w = UI_device_width;
  300.     }
  301.     h = (MMI_title_y + MMI_title_height);
  302.     x1 = UI_device_width - w;
  303.     x2 = UI_device_width - 1;
  304.     y1 = MMI_title_y;
  305.     y2 = y1 + (MMI_title_y + MMI_title_height) - 1;
  306.     gdi_layer_set_clip(x1 + 2, y1 + 2, x2 - 2, y2 - 2);
  307.     gui_draw_filled_area(x1, y1, x2, y2, bg);
  308.     gui_show_transparent_image(x1 + 2, y1 + (h >> 1) - (iheight >> 1), wgui_inputbox_information_icon, 0);
  309.     gui_set_text_color(c);
  310.     if (r2lMMIFlag)
  311.     {
  312.         gui_move_text_cursor(x1 + 2 + iwidth + 2 + swidth, y1 + (h >> 1) - (sheight >> 1));
  313.     }
  314.     else
  315.     {
  316.         gui_move_text_cursor(x1 + 2 + iwidth + 2, y1 + (h >> 1) - (sheight >> 1));
  317.     }
  318.     gui_set_line_height(sheight);
  319.     gui_print_text(inputmode_string);
  320.     gdi_layer_blt_previous(x1, y1, x2, y2);
  321.     gui_start_timer(INLINE_INPUT_METHOD_HIDE_WAIT, wgui_hide_inline_input_method);
  322. }
  323. /*****************************************************************************
  324.  * FUNCTION
  325.  *  wgui_handle_inline_singleline_inputbox_change_input_mode
  326.  * DESCRIPTION
  327.  *  
  328.  * PARAMETERS
  329.  *  void
  330.  * RETURNS
  331.  *  void
  332.  *****************************************************************************/
  333. void wgui_handle_inline_singleline_inputbox_change_input_mode(void)
  334. {
  335.     /*----------------------------------------------------------------*/
  336.     /* Local Variables                                                */
  337.     /*----------------------------------------------------------------*/
  338.     /*----------------------------------------------------------------*/
  339.     /* Code Body                                                      */
  340.     /*----------------------------------------------------------------*/
  341.     disable_active_multitap();
  342.     /* change_input_mode(); */
  343.     change_singleline_input_mode();
  344.     wgui_display_inline_input_method();
  345. }
  346. /*****************************************************************************
  347.  * FUNCTION
  348.  *  change_inline_singleline_inputbox_input_mode
  349.  * DESCRIPTION
  350.  *  
  351.  * PARAMETERS
  352.  *  void
  353.  * RETURNS
  354.  *  void
  355.  *****************************************************************************/
  356. void change_inline_singleline_inputbox_input_mode(void)
  357. {
  358.     /*----------------------------------------------------------------*/
  359.     /* Local Variables                                                */
  360.     /*----------------------------------------------------------------*/
  361.     /*----------------------------------------------------------------*/
  362.     /* Code Body                                                      */
  363.     /*----------------------------------------------------------------*/
  364.     inline_edit_change_singleline_inputbox_mode((U8) MMI_current_input_mode);
  365. }
  366. /*****************************************************************************
  367.  * FUNCTION
  368.  *  wgui_inline_singleline_inputbox_get_UCS2_count
  369.  * DESCRIPTION
  370.  *  
  371.  * PARAMETERS
  372.  *  void
  373.  * RETURNS
  374.  *  
  375.  *****************************************************************************/
  376. S32 wgui_inline_singleline_inputbox_get_UCS2_count(void)
  377. {
  378.     /*----------------------------------------------------------------*/
  379.     /* Local Variables                                                */
  380.     /*----------------------------------------------------------------*/
  381.     /*----------------------------------------------------------------*/
  382.     /* Code Body                                                      */
  383.     /*----------------------------------------------------------------*/
  384.     return (MMI_inline_singleline_inputbox.UCS2_count);
  385. }
  386. /*****************************************************************************
  387.  * FUNCTION
  388.  *  wgui_inline_singleline_inputbox_validation_callback
  389.  * DESCRIPTION
  390.  *  
  391.  * PARAMETERS
  392.  *  text            [IN]        
  393.  *  cursor          [IN]        
  394.  *  text_length     [IN]        
  395.  * RETURNS
  396.  *  void
  397.  *****************************************************************************/
  398. void wgui_inline_singleline_inputbox_validation_callback(UI_buffer_type text, UI_buffer_type cursor, S32 text_length)
  399. {
  400.     /*----------------------------------------------------------------*/
  401.     /* Local Variables                                                */
  402.     /*----------------------------------------------------------------*/
  403.     /*----------------------------------------------------------------*/
  404.     /* Code Body                                                      */
  405.     /*----------------------------------------------------------------*/
  406.     if (wgui_inputbox_validation_callback != NULL)
  407.     {
  408.         wgui_inputbox_validation_callback(text, cursor, text_length);
  409.     }
  410. }
  411. /* History implementation for inline text edit  */
  412. typedef struct _inline_text_edit_history
  413. {
  414.     U16 history_ID;
  415.     S16 text_length;
  416.     S16 allocated_length;
  417.     S16 available_length;
  418.     S16 current_position;
  419.     S16 text_offset_x;
  420.     S16 input_type;
  421.     S16 dummy;  /* Added for history issue on hardware */
  422.     U32 flags;
  423. #if defined(__MMI_TOUCH_SCREEN__)
  424.     S16 vk_lang_type;
  425. #endif 
  426. } inline_text_edit_history;
  427. /*****************************************************************************
  428.  * FUNCTION
  429.  *  inline_text_edit_get_history
  430.  * DESCRIPTION
  431.  *  
  432.  * PARAMETERS
  433.  *  history_buffer      [?]         
  434.  *  input_type          [IN]        
  435.  * RETURNS
  436.  *  
  437.  *****************************************************************************/
  438. U8 *inline_text_edit_get_history(U8 *history_buffer, S16 input_type)
  439. {
  440.     /*----------------------------------------------------------------*/
  441.     /* Local Variables                                                */
  442.     /*----------------------------------------------------------------*/
  443.     /*----------------------------------------------------------------*/
  444.     /* Code Body                                                      */
  445.     /*----------------------------------------------------------------*/
  446.     if (history_buffer != NULL)
  447.     {
  448.         U16 hID = (U16) (INLINE_TEXT_EDIT_HISTORY_ID | 0x8000);
  449.         inline_text_edit_history *h = (inline_text_edit_history*) history_buffer;
  450.         h->history_ID = hID;
  451.         h->text_length = (S16) MMI_inline_singleline_inputbox.text_length;
  452.         h->allocated_length = (S16) MMI_inline_singleline_inputbox.allocated_length;
  453.         h->available_length = (S16) MMI_inline_singleline_inputbox.available_length;
  454.         h->current_position =
  455.             (S16) (MMI_inline_singleline_inputbox.current_text_p - MMI_inline_singleline_inputbox.text);
  456.         h->text_offset_x = (S16) MMI_inline_singleline_inputbox.text_offset_x;
  457.         h->input_type = (S16) input_type;
  458.         h->flags = MMI_inline_singleline_inputbox.flags;
  459.     #if defined(__MMI_TOUCH_SCREEN__)
  460.         if (GUI_VIRTUAL_KEYBOARD_MAX_LANG == mmi_pen_editor_history_vk_lang_type())
  461.         {
  462.             h->vk_lang_type = MMI_virtual_keyboard.lang_type;
  463.         }
  464.         else
  465.         {
  466.             h->vk_lang_type = mmi_pen_editor_history_vk_lang_type();
  467.         }
  468.     #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  469.     }
  470.     return (history_buffer);
  471. }
  472. /*****************************************************************************
  473.  * FUNCTION
  474.  *  inline_text_edit_set_history
  475.  * DESCRIPTION
  476.  *  
  477.  * PARAMETERS
  478.  *  history_ID          [IN]        
  479.  *  history_buffer      [?]         
  480.  *  input_type          [?]         
  481.  * RETURNS
  482.  *  
  483.  *****************************************************************************/
  484. U8 inline_text_edit_set_history(U16 history_ID, U8 *history_buffer, S16 *input_type)
  485. {
  486.     /*----------------------------------------------------------------*/
  487.     /* Local Variables                                                */
  488.     /*----------------------------------------------------------------*/
  489.     /*----------------------------------------------------------------*/
  490.     /* Code Body                                                      */
  491.     /*----------------------------------------------------------------*/
  492.     if (history_buffer != NULL)
  493.     {
  494.         inline_text_edit_history *h = (inline_text_edit_history*) history_buffer;
  495.         if (history_valid(h->history_ID, history_ID))
  496.         {
  497.             /*
  498.              * MTK Elvis 20040506--it is not required to restored the text length of current input box
  499.              * *    because the text_length will be set correctly in handle_inline_text_edit->create_inline_edit_singleline_inputbox_set_buffer.
  500.              * *    if restored it, will cause MMI_inline_single_line_inputbox have wrong text length(asyn with text buffer)
  501.              * *    for example,
  502.              * *       (1)in inline editor screen and highlighted at first item(first line will lead user to full screen editor, and second item is inline single input box)
  503.              * *       (2)charger in --> popup a new window and add current screen related parameters into history including text_length
  504.              * *       (3)and the text_length maybe not correct because text_length of input boxes(inline single, single, multi line, or EMS) will not be reset
  505.              * *       (4)while popup dispeared, go back to (1)
  506.              * *       (5)press arrow down to go to next item, inline single line input box
  507.              * *       (6)handle_inline_text_edit->create_inline_edit_singleline_inputbox_set_buffer will calculate the length from text buffer
  508.              * *       (7)inline_text_edit_set_history will restore the text length from history
  509.              * *       (8)inline_text_edit_set_history caused text_length not sync with current input box text buffer
  510.              * *            Therefore, comment out MMI_inline_singleline_inputbox.text_length=h->text_length;
  511.              */
  512.             /* W05.33 Fix inline text edit history issue */
  513.             MMI_inline_singleline_inputbox.text_length = h->text_length;
  514.             MMI_inline_singleline_inputbox.allocated_length = h->allocated_length;
  515.             MMI_inline_singleline_inputbox.available_length = h->available_length;
  516.             MMI_inline_singleline_inputbox.current_text_p =
  517.                 (UI_buffer_type) (MMI_inline_singleline_inputbox.text + h->current_position);
  518.             MMI_inline_singleline_inputbox.text_offset_x = h->text_offset_x;
  519.             /* MTK end */
  520.             *input_type = h->input_type;
  521.             MMI_inline_singleline_inputbox.flags = h->flags;
  522.         #if defined(__MMI_TOUCH_SCREEN__)
  523.             wgui_setup_virtual_keyboard(h->vk_lang_type);
  524.         #endif 
  525.             return (1);
  526.         }
  527.     }
  528.     return (0);
  529. }
  530. /*****************************************************************************
  531.  * FUNCTION
  532.  *  handle_inline_text_edit
  533.  * DESCRIPTION
  534.  *  
  535.  * PARAMETERS
  536.  *  x                   [IN]        
  537.  *  y                   [IN]        
  538.  *  width               [IN]        
  539.  *  height              [IN]        
  540.  *  key_code            [IN]        
  541.  *  key_event           [IN]        
  542.  *  text_p              [IN]        
  543.  *  item                [?]         
  544.  *  flags               [IN]        
  545.  *  history_buffer      [?]         
  546.  * RETURNS
  547.  *  void
  548.  *****************************************************************************/
  549. void handle_inline_text_edit(
  550.         S32 x,
  551.         S32 y,
  552.         S32 width,
  553.         S32 height,
  554.         S32 key_code,
  555.         S32 key_event,
  556.         U8 **text_p,
  557.         void *item,
  558.         U32 flags,
  559.         U8 *history_buffer)
  560. {
  561.     /*----------------------------------------------------------------*/
  562.     /* Local Variables                                                */
  563.     /*----------------------------------------------------------------*/
  564.     S32 l, xx;
  565.     S16 input_type;
  566.     S16 input_type_flags;
  567.     U8 saved_MMI_current_input_mode;
  568.     U32 saved_inputbox_flags;
  569.     U8 override_history_input_type = 0;
  570.     S16 saved_input_type;
  571.     wgui_inline_item_text_edit *i = (wgui_inline_item_text_edit*) item;
  572.     U8 plus_character_handling = 0;
  573. #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
  574.     mmi_pen_handwriting_area_struct stroke_area;
  575.     mmi_pen_handwriting_area_struct ext_stroke;
  576. #endif /* defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__) */ 
  577.     /*----------------------------------------------------------------*/
  578.     /* Code Body                                                      */
  579.     /*----------------------------------------------------------------*/
  580.     UI_UNUSED_PARAMETER(key_event);
  581.     UI_UNUSED_PARAMETER(key_code);
  582.     UI_UNUSED_PARAMETER(flags);
  583.     /* W05.36 Fix Vietnamese Tone Input Issue */
  584.     set_current_input_box_type(EDITOR_INLINE_TEXT);
  585.     wgui_inline_singleline_inputbox_buffer_size = i->buffer_size;
  586.     if (i->input_type & INPUT_TYPE_PLUS_CHARACTER_HANDLING)
  587.     {
  588.         plus_character_handling = 1;
  589.     }
  590.     wgui_current_inline_item_type = INLINE_ITEM_TYPE_TEXT_EDIT;
  591.     if (MMI_fixed_icontext_menuitem.text_x == 2)
  592.     {
  593.         xx = 0; /* ? */
  594.     }
  595.     else
  596.     {
  597.         xx = MMI_fixed_icontext_menuitem.text_x;
  598.     }
  599.         
  600.     if (flags & INLINE_ITEM_LEFT_ALIGN)
  601.     {
  602.         xx = 0;
  603.     }
  604.     
  605.     clear_inline_item_keys = clear_inline_singleline_inputbox_keys;
  606.     register_default_hide_softkeys();
  607.     complete_inline_item_edit = handle_inline_text_edit_complete;
  608.     current_wgui_inline_text_edit_item = i;
  609.     current_wgui_inline_text_edit_text_p = text_p;
  610.     set_left_softkey_label(get_string(STR_GLOBAL_OK));
  611.     gui_strcpy((UI_string_type) wgui_inline_text_edit_buffer, (UI_string_type) i->buffer);
  612.     l = gui_strlen((UI_string_type) wgui_inline_text_edit_buffer);
  613.     create_inline_edit_singleline_inputbox_set_buffer(
  614.         (UI_string_type) wgui_inline_text_edit_buffer,
  615.         i->buffer_size,
  616.         l,
  617.         l);
  618.         
  619.     switch (flags & INLINE_ITEM_JUSTIFY_MASK)
  620.     {
  621.         case INLINE_ITEM_RIGHT_JUSTIFY:
  622.             MMI_inline_singleline_inputbox.flags |= UI_SINGLE_LINE_INPUT_BOX_RIGHT_JUSTIFY;
  623.             break;
  624.         case INLINE_ITEM_CENTER_JUSTIFY:
  625.             MMI_inline_singleline_inputbox.flags |= UI_SINGLE_LINE_INPUT_BOX_CENTER_JUSTIFY;
  626.             break;
  627.     }
  628.     
  629.     if ((flags & INLINE_ITEM_BOUNDARY_MASK) == INLINE_ITEM_BOUNDARY_NEVER)
  630.     {
  631.         gui_set_single_line_input_box_theme(
  632.             &MMI_inline_singleline_inputbox,
  633.             &wgui_inline_singleline_inputbox_no_boundary_theme);
  634.     }
  635.     /* resize the inputbox so that the border can be drawn to have the
  636.        3D effect in case of default text effect is enabled. */
  637. #if defined(__MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__) && (defined(__MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__))       /* 122805 3D inline edit */
  638.     if (IsInlineItemDefaultTextEnable())
  639.     {
  640.         inline_edit_resize_singleline_inputbox(width - xx - 4, height - 4);
  641.     }
  642.     else
  643. #endif /* defined(__MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__) && (defined(__MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__)) */ 
  644.     {
  645.         inline_edit_resize_singleline_inputbox(width - xx - 1, height);
  646.     }
  647.     /* move the inputbox at correct location, in case of default text effect is enabled. */
  648. #if defined(__MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__) && (defined(__MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__))       /* 122805 3D inline edit */
  649.     if (IsInlineItemDefaultTextEnable())
  650.     {
  651.         if (r2lMMIFlag)
  652.         {
  653.             inline_edit_move_singleline_inputbox(x + 2, y + 2);
  654.         }
  655.         else
  656.         {
  657.             inline_edit_move_singleline_inputbox(x + xx + 2, y + 2);
  658.         }
  659.     }
  660.     else
  661. #endif /* defined(__MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__) && (defined(__MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__)) */ 
  662.     {
  663.         if (r2lMMIFlag)
  664.         {
  665.             inline_edit_move_singleline_inputbox(x + 1, y);
  666.         }
  667.         else
  668.         {
  669.             inline_edit_move_singleline_inputbox(x + xx, y);
  670.         }
  671.     }
  672.     
  673.     register_inline_singleline_inputbox_keys();
  674.     input_type_flags = (S16) (i->input_type & (~INPUT_TYPE_MASK));
  675.     input_type = (S16) (i->input_type & INPUT_TYPE_MASK);
  676.     if (input_type_flags & INPUT_TYPE_USE_ONLY_ENGLISH_MODES)
  677.     {
  678.         set_english_only_multitap();
  679.         MMI_allow_only_english_input_modes = 1;
  680.     }
  681.     else
  682.     {
  683.         set_normal_multitap();
  684.     }
  685.     saved_input_type = input_type;
  686.     switch (input_type & INPUT_TYPE_MASK)
  687.     {
  688.         case INPUT_TYPE_NUMERIC_PASSWORD:
  689.         case INPUT_TYPE_SAT_NUMERIC_PASSWORD:
  690.             override_history_input_type = 1;
  691.             break;
  692.     }
  693.     inline_text_edit_set_history(INLINE_TEXT_EDIT_HISTORY_ID, history_buffer, &input_type);
  694.     saved_MMI_current_input_mode = MMI_current_input_mode;
  695.     saved_inputbox_flags = MMI_inline_singleline_inputbox.flags;
  696.     if (override_history_input_type)
  697.     {
  698.         input_type = saved_input_type;
  699.     }
  700.     /* Get input mode from "Input Methods" list selection */
  701.     wgui_change_inputbox_mode_multitap_ABC = wgui_inline_singleline_inputbox_change_input_mode_multitap_ABC;
  702.     wgui_change_inputbox_mode_multitap_abc = wgui_inline_singleline_inputbox_change_input_mode_multitap_abc;
  703.     wgui_change_inputbox_mode_mode_numeric = wgui_inline_singleline_inputbox_change_input_mode_multitap_numeric;
  704.     wgui_inputbox_insert_symbol = wgui_inline_singleline_inputbox_insert_symbol;
  705.     if (wgui_inline_singleline_inputbox_input_mode_changed)
  706.     {
  707.         input_type = wgui_inline_singleline_inputbox_input_type;
  708.         wgui_inline_singleline_inputbox_input_mode_changed = 0;
  709.     }
  710.     MMI_current_input_type = input_type;
  711.     wgui_inline_singleline_inputbox_decimal_input_mode_flag = 0;
  712.     wgui_inputbox_UCS2_count_function = wgui_inline_singleline_inputbox_get_UCS2_count;
  713.     if (input_type & INPUT_TYPE_USE_ENCODING_BASED_LENGTH)
  714.     {
  715.         MMI_inline_singleline_inputbox.flags |= UI_SINGLE_LINE_INPUT_BOX_USE_ENCODING_BASED_LENGTH;
  716.         if (input_type & INPUT_TYPE_ONE_LESS_CHARACTER)
  717.         {
  718.             MMI_inline_singleline_inputbox.flags |= UI_SINGLE_LINE_INPUT_BOX_ONE_LESS_CHARACTER;
  719.             UI_TEST_UCS2_COUNT_SET_LENGTH_TYPE2(
  720.                 MMI_inline_singleline_inputbox.UCS2_count,
  721.                 MMI_inline_singleline_inputbox.allocated_length,
  722.                 MMI_inline_singleline_inputbox.available_length);
  723.         }
  724.         else
  725.         {
  726.             UI_TEST_UCS2_COUNT_SET_LENGTH(
  727.                 MMI_inline_singleline_inputbox.UCS2_count,
  728.                 MMI_inline_singleline_inputbox.allocated_length,
  729.                 MMI_inline_singleline_inputbox.available_length);
  730.         }
  731.     }
  732.     if (plus_character_handling)
  733.     {
  734.         MMI_inline_singleline_inputbox.flags |= UI_SINGLE_LINE_INPUT_BOX_PLUS_CHARACTER_HANDLING;
  735.     }
  736.     /* Input type currently cannot be changed by the user in inline edit */
  737.     switch (input_type & INPUT_TYPE_MASK)
  738.     {
  739.         case INPUT_TYPE_NUMERIC_CHANGEABLE:
  740.             set_inline_edit_singleline_inputbox_mask(0);
  741.             inline_edit_change_singleline_inputbox_mode(INPUT_MODE_123);
  742.             SetKeyHandler(wgui_handle_inline_singleline_inputbox_change_input_mode, KEY_POUND, KEY_EVENT_DOWN);
  743.             inputbox_change_mode = change_inline_singleline_inputbox_input_mode;
  744.             MMI_current_input_mode = INPUT_MODE_123;
  745.             break;
  746.         case INPUT_TYPE_NUMERIC:
  747.             set_inline_edit_singleline_inputbox_mask(0);
  748.             inline_edit_change_singleline_inputbox_mode(INPUT_MODE_123);
  749.             MMI_current_input_mode = INPUT_MODE_123;
  750.             break;
  751.         case INPUT_TYPE_DECIMAL_NUMERIC:
  752.             wgui_inline_singleline_inputbox_decimal_flag = 0;
  753.             if (l > 0)
  754.             {
  755.                 S32 i;
  756.                 UI_buffer_type t = *text_p;
  757.                 UI_character_type c;
  758.                 for (i = 0; i < l; i++)
  759.                 {
  760.                     UI_STRING_GET_NEXT_CHARACTER(t, c);
  761.                     if (c == (UI_character_type) '.')
  762.                     {
  763.                         wgui_inline_singleline_inputbox_decimal_flag = 1;
  764.                         break;
  765.                     }
  766.                 }
  767.             }
  768.             set_inline_edit_singleline_inputbox_mask(0);
  769.             inline_edit_change_singleline_inputbox_mode(INPUT_MODE_123);
  770.             MMI_current_input_mode = INPUT_MODE_123;
  771.             SetKeyHandler(
  772.                 wgui_inline_singleline_inputbox_decimal_numeric_handle_pound_key_down,
  773.                 KEY_POUND,
  774.                 KEY_EVENT_DOWN);
  775.             wgui_inline_singleline_inputbox_decimal_input_mode_flag = 1;
  776.             break;
  777.         case INPUT_TYPE_KEYPAD_NUMERIC:
  778.             set_inline_edit_singleline_inputbox_mask(0);
  779.             inline_edit_change_singleline_inputbox_mode(INPUT_MODE_123);
  780.             SetKeyHandler(inline_singleline_inputbox_keypad_numeric_handle_star_key_down, KEY_STAR, KEY_EVENT_DOWN);
  781.             SetKeyHandler(inline_singleline_inputbox_keypad_numeric_handle_pound_key_down, KEY_POUND, KEY_EVENT_DOWN);
  782.             MMI_current_input_mode = INPUT_MODE_123;
  783.             break;
  784.         case INPUT_TYPE_ALPHANUMERIC_UPPERCASE:
  785.             set_inline_edit_singleline_inputbox_mask(0);
  786.             inline_edit_change_singleline_inputbox_mode(INPUT_MODE_MULTITAP_UPPERCASE_ABC);
  787.             SetKeyHandler(wgui_handle_inline_singleline_inputbox_change_input_mode, KEY_POUND, KEY_EVENT_DOWN);
  788.             inputbox_change_mode = change_inline_singleline_inputbox_input_mode;
  789.             MMI_current_input_mode = INPUT_MODE_MULTITAP_UPPERCASE_ABC;
  790.             break;
  791.         case INPUT_TYPE_ALPHANUMERIC_LOWERCASE:
  792.             set_inline_edit_singleline_inputbox_mask(0);
  793.             inline_edit_change_singleline_inputbox_mode(1);
  794.             SetKeyHandler(wgui_handle_inline_singleline_inputbox_change_input_mode, KEY_POUND, KEY_EVENT_DOWN);
  795.             inputbox_change_mode = change_inline_singleline_inputbox_input_mode;
  796.             MMI_current_input_mode = 1;
  797.             break;
  798.         case INPUT_TYPE_ALPHANUMERIC_SENTENCECASE:
  799.             set_inline_edit_singleline_inputbox_mask(0);
  800.             inline_edit_change_singleline_inputbox_mode(INPUT_MODE_MULTITAP_LOWERCASE_ABC);
  801.             SetKeyHandler(wgui_handle_inline_singleline_inputbox_change_input_mode, KEY_POUND, KEY_EVENT_DOWN);
  802.             inputbox_change_mode = change_inline_singleline_inputbox_input_mode;
  803.             MMI_current_input_mode = INPUT_MODE_MULTITAP_LOWERCASE_ABC;
  804.             break;
  805.         case INPUT_TYPE_NUMERIC_PASSWORD:
  806.             set_inline_edit_singleline_inputbox_mask(1);
  807.             inline_edit_change_singleline_inputbox_mode(INPUT_MODE_123);
  808.             MMI_current_input_mode = INPUT_MODE_123;
  809.             break;
  810.         case INPUT_TYPE_ALPHANUMERIC_PASSWORD:
  811.             set_inline_edit_singleline_inputbox_mask(1);
  812.             inline_edit_change_singleline_inputbox_mode(INPUT_MODE_MULTITAP_LOWERCASE_ABC);
  813.             SetKeyHandler(wgui_handle_inline_singleline_inputbox_change_input_mode, KEY_POUND, KEY_EVENT_DOWN);
  814.             inputbox_change_mode = change_inline_singleline_inputbox_input_mode;
  815.             MMI_current_input_mode = INPUT_MODE_MULTITAP_LOWERCASE_ABC;
  816.             break;
  817.         case INPUT_TYPE_PHONE_NUMBER:
  818.             set_inline_edit_singleline_inputbox_mask(0);
  819.             inline_edit_change_singleline_inputbox_mode(INPUT_MODE_123);
  820.             /* Handling of Phone number input   */
  821.             /* MTK Elvis */
  822.         #ifdef __MMI_MULTITAP_KEY_0__
  823.             SetKeyHandler(inline_edit_phone_number_input_handle_star_key_down, KEY_STAR, KEY_EVENT_DOWN);
  824.         #else /* __MMI_MULTITAP_KEY_0__ */ 
  825.             gui_create_multitap_input(
  826.                 &wgui_inline_text_edit_multitap_star_key,
  827.                 0,
  828.                 0,
  829.                 0,
  830.                 0,
  831.                 (UI_string_type) wgui_inline_edit_phone_number_star_key_string);
  832.             gui_set_multitap_input_callbacks(
  833.                 &wgui_inline_text_edit_multitap_star_key,
  834.                 inline_edit_singleline_inputbox_multitap_input,
  835.                 inline_edit_singleline_inputbox_multitap_input_complete);
  836.             SetKeyHandler(inline_edit_phone_number_input_handle_multitap_star_key_down, KEY_STAR, KEY_EVENT_DOWN);
  837.             SetKeyHandler(inline_edit_phone_number_input_handle_multitap_star_key_up, KEY_STAR, KEY_EVENT_UP);
  838.         #endif /* __MMI_MULTITAP_KEY_0__ */ 
  839.             /* MTK end */
  840.             SetKeyHandler(inline_edit_phone_number_input_handle_hash_key_down, KEY_POUND, KEY_EVENT_DOWN);
  841.             register_key_down_handler(inline_edit_phone_number_input_numeric_key_handler);
  842.         #if(ENABLE_DIALER_ZERO_KEY_MULTITAP)
  843.             gui_create_multitap_input(
  844.                 &wgui_inline_text_edit_multitap_zero_key,
  845.                 0,
  846.                 0,
  847.                 0,
  848.                 0,
  849.                 (UI_string_type) wgui_inline_edit_phone_number_zero_key_string);
  850.             gui_set_multitap_input_callbacks(
  851.                 &wgui_inline_text_edit_multitap_zero_key,
  852.                 inline_edit_singleline_inputbox_multitap_input,
  853.                 inline_edit_singleline_inputbox_multitap_input_complete);
  854.         #ifdef __MMI_MULTITAP_KEY_0__
  855.             SetKeyHandler(inline_edit_phone_number_input_handle_zero_key_long_press, KEY_0, KEY_EVENT_LONG_PRESS);
  856.         #else /* __MMI_MULTITAP_KEY_0__ */ 
  857.             SetKeyHandler(inline_edit_phone_number_input_handle_multitap_zero_key_down, KEY_0, KEY_EVENT_DOWN);
  858.             SetKeyHandler(inline_edit_phone_number_input_handle_multitap_zero_key_up, KEY_0, KEY_EVENT_UP);
  859.         #endif /* __MMI_MULTITAP_KEY_0__ */ 
  860.         #endif /* (ENABLE_DIALER_ZERO_KEY_MULTITAP) */ 
  861.             wgui_inline_text_edit_active_multitap = WGUI_INLINE_TEXT_EDIT_MULTITAP_NONE;
  862.             MMI_current_input_mode = INPUT_MODE_123;
  863.             break;
  864.         default:
  865.             set_inline_edit_singleline_inputbox_mask(0);
  866.             inline_edit_change_singleline_inputbox_mode(INPUT_MODE_123);
  867.             MMI_current_input_mode = INPUT_MODE_123;
  868.             break;
  869.     }
  870.     if (!override_history_input_type && (saved_inputbox_flags & UI_SINGLE_LINE_INPUT_BOX_MASK_CHARACTERS))
  871.     {
  872.         MMI_inline_singleline_inputbox.flags |= UI_SINGLE_LINE_INPUT_BOX_MASK_CHARACTERS;
  873.         if ((saved_input_type & INPUT_TYPE_MASK) != INPUT_TYPE_ALPHANUMERIC_PASSWORD)
  874.         {
  875.             ClearKeyHandler(KEY_POUND, KEY_EVENT_DOWN);
  876.         }
  877.     }
  878.     /* 20051012 HIMANSHU START INLINE EDIT */
  879.     /* shows the border with 3D effect in case of inline text edit item, when the
  880.        default text effect is enabled. */
  881. #if defined(__MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__) && (defined(__MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__))       /* 122805 3D inline edit */
  882.     if (IsInlineItemDefaultTextEnable())
  883.     {
  884.         inline_text_edit_show_background(&MMI_inline_singleline_inputbox);
  885.     }
  886. #endif /* defined(__MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__) && (defined(__MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__)) */ 
  887.     /* 20051012 HIMANSHU END INLINE EDIT */
  888.     show_inline_singleline_inputbox();
  889.     inline_text_edit_RSK_label_clear = 0;
  890.     if (wgui_inline_list_menu_changed)
  891.     {
  892.         if (wgui_inline_list_menu_disable_done)
  893.         {
  894.             inline_text_edit_RSK_label_string = (UI_string_type) get_string(STR_GLOBAL_BACK);
  895.             inline_text_edit_RSK_label_icon = NULL;
  896.         }
  897.         else
  898.         {
  899.             inline_text_edit_RSK_label_string = NULL;
  900.             inline_text_edit_RSK_label_icon = NULL;
  901.         }
  902.     }
  903.     else
  904.     {
  905.         inline_text_edit_RSK_label_string = wgui_inline_edit_get_RSK_string();
  906.         inline_text_edit_RSK_label_icon = NULL;
  907.     }
  908.     set_right_softkey_label(inline_text_edit_RSK_label_string);
  909.     set_right_softkey_icon(inline_text_edit_RSK_label_icon);
  910.     register_right_softkey_handler();
  911. #ifdef __MMI_WITH_C_KEY__
  912.     SetKeyHandler(handle_inline_text_edit_right_softkey_down, KEY_CLEAR, KEY_EVENT_DOWN);
  913.     SetKeyHandler(handle_inline_text_edit_right_softkey_long_press, KEY_CLEAR, KEY_LONG_PRESS);
  914.     set_right_softkey_function(handle_inline_text_edit_right_softkey_up, KEY_EVENT_UP);
  915. #else /* __MMI_WITH_C_KEY__ */ 
  916.     set_right_softkey_function(handle_inline_text_edit_right_softkey_down, KEY_EVENT_DOWN);
  917.     set_right_softkey_function(handle_inline_text_edit_right_softkey_long_press, KEY_LONG_PRESS);
  918. #endif /* __MMI_WITH_C_KEY__ */ 
  919.     inline_edit_register_singleline_inputbox_input_callback(handle_inline_text_edit_input);
  920.     /* inline_edit_register_singleline_inputbox_navigate_callback(handle_inline_text_edit_navigate); */
  921.     inline_text_edit_RSK_function = wgui_inline_edit_BACK_function;
  922.     handle_inline_text_edit_input();
  923.     if (gui_single_line_input_box_get_text_length(&MMI_inline_singleline_inputbox) <= 0)
  924.     {
  925.         //#if defined(__MMI_WITH_C_KEY__)
  926.         //     SetKeyHandler(handle_inline_text_edit_right_softkey_up, KEY_CLEAR, KEY_EVENT_UP);
  927.         //#else
  928.         set_right_softkey_function(handle_inline_text_edit_right_softkey_up, KEY_EVENT_UP);
  929.         // #endif
  930.         if (wgui_inputbox_empty_callback != NULL)
  931.         {
  932.             wgui_inputbox_empty_callback();
  933.         }
  934.     }
  935.     else if (wgui_inputbox_not_empty_callback != NULL)
  936.     {
  937.         wgui_inputbox_not_empty_callback();
  938.     }
  939.     wgui_inputbox_validation_callback = i->validation_callback;
  940.     MMI_inline_singleline_inputbox.validation_callback = wgui_inline_singleline_inputbox_validation_callback;
  941.     MMI_inline_singleline_inputbox.validation_callback(
  942.                                     MMI_inline_singleline_inputbox.text,
  943.                                     MMI_inline_singleline_inputbox.current_text_p,
  944.                                     MMI_inline_singleline_inputbox.text_length);
  945.     SetKeyHandler(inline_text_edit_handle_down_arrow, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
  946.     SetKeyHandler(inline_text_edit_handle_up_arrow, KEY_UP_ARROW, KEY_EVENT_DOWN);
  947.     SetKeyHandler(inline_text_edit_handle_down_arrow, KEY_VOL_DOWN, KEY_EVENT_DOWN);
  948.     SetKeyHandler(inline_text_edit_handle_up_arrow, KEY_VOL_UP, KEY_EVENT_DOWN);
  949.     redraw_left_softkey();
  950.     redraw_right_softkey();
  951.     redraw_current_inline_item = redraw_inline_singleline_inputbox;
  952.     current_wgui_inline_text_edit_item->UCS2_count = MMI_inline_singleline_inputbox.UCS2_count;
  953.     test_change_input_mode = inline_singleline_inputbox_test_change_input_mode;
  954.     if (i->custom_setup_function != NULL)
  955.     {
  956.         i->custom_setup_function();
  957.     }
  958.     gui_start_timer(INLINE_INPUT_METHOD_DISPLAY_WAIT, wgui_display_inline_input_method);
  959.     UI_UNUSED_PARAMETER(input_type_flags);
  960.     UI_UNUSED_PARAMETER(saved_MMI_current_input_mode);
  961. #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
  962.     ext_stroke.x1 = 0;
  963.     ext_stroke.y1 = 0;
  964.     ext_stroke.x2 = UI_device_width - 1;
  965.     ext_stroke.y2 = UI_device_height - 1;
  966. #if 0
  967. /* under construction !*/
  968. /* under construction !*/
  969. /* under construction !*/
  970. /* under construction !*/
  971. #else /* 0 */ 
  972.     stroke_area.x1 = MMI_content_x;
  973.     stroke_area.x2 = MMI_content_x + MMI_content_width - MMI_fixed_list_menu.vbar.width;
  974.     stroke_area.y1 = MMI_title_y;
  975.     stroke_area.y2 = MMI_title_y + MMI_content_height + MMI_title_height;
  976. #endif /* 0 */ 
  977.     mmi_pen_editor_setup_input_box(
  978.         &stroke_area,
  979.         &ext_stroke,
  980.         MMI_current_input_type,
  981.         MMI_FALSE,
  982.         PEN_EDITOR_INLINE_TEXT);
  983. #endif /* defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__) */ 
  984. }
  985. /*****************************************************************************
  986.  * FUNCTION
  987.  *  SetInlineTextEditCustomFunction
  988.  * DESCRIPTION
  989.  *  
  990.  * PARAMETERS
  991.  *  item        [?]         
  992.  *  f           [IN]        
  993.  * RETURNS
  994.  *  void
  995.  *****************************************************************************/
  996. void SetInlineTextEditCustomFunction(InlineItem *item, void (*f) (void))
  997. {
  998.     /*----------------------------------------------------------------*/
  999.     /* Local Variables                                                */
  1000.     /*----------------------------------------------------------------*/
  1001.     wgui_inline_item_text_edit *i = (wgui_inline_item_text_edit*) item->item;
  1002.     /*----------------------------------------------------------------*/
  1003.     /* Code Body                                                      */
  1004.     /*----------------------------------------------------------------*/
  1005.     i->custom_setup_function = f;
  1006. }
  1007. /*****************************************************************************
  1008.  * FUNCTION
  1009.  *  SetInlineItemTextEdit
  1010.  * DESCRIPTION
  1011.  *  
  1012.  * PARAMETERS
  1013.  *  item            [?]         
  1014.  *  buffer          [?]         
  1015.  *  buffer_size     [IN]        
  1016.  *  input_type      [IN]        
  1017.  * RETURNS
  1018.  *  void
  1019.  *****************************************************************************/
  1020. void SetInlineItemTextEdit(InlineItem *item, U8 *buffer, S32 buffer_size, S16 input_type)
  1021. {
  1022.     /*----------------------------------------------------------------*/
  1023.     /* Local Variables                                                */
  1024.     /*----------------------------------------------------------------*/
  1025.     wgui_inline_item_text_edit *i;
  1026.     UI_buffer_type mask_buffer;
  1027.     S16 t = input_type & INPUT_TYPE_MASK;
  1028.     /*----------------------------------------------------------------*/
  1029.     /* Code Body                                                      */
  1030.     /*----------------------------------------------------------------*/
  1031.     if (n_inline_text_edit_items >= MAX_INLINE_TEXT_EDIT_ITEMS)
  1032.     {
  1033.         return;
  1034.     }
  1035.     item->item = (void*)&wgui_inline_text_edit_items[n_inline_text_edit_items];
  1036.     item->flags = INLINE_ITEM_TYPE_TEXT_EDIT;
  1037.     mask_buffer = inline_text_edit_mask_buffers[n_inline_text_edit_items];
  1038.     n_inline_text_edit_items++;
  1039.     i = (wgui_inline_item_text_edit*) item->item;
  1040.     i->max_lines = 0;
  1041.     i->buffer = buffer;
  1042.     i->buffer_size = buffer_size;
  1043.     i->flags = 0;
  1044.     i->input_type = input_type;
  1045.     item->text_p = i->buffer;
  1046.     item->handler = handle_inline_text_edit;
  1047.     i->edit_complete_callback = UI_dummy_edit_complete_handler;
  1048.     i->validation_callback = UI_dummy_validation_function;
  1049.     i->custom_setup_function = NULL;
  1050.     if ((t == INPUT_TYPE_NUMERIC_PASSWORD) || (t == INPUT_TYPE_ALPHANUMERIC_PASSWORD) ||
  1051.         (t == INPUT_TYPE_SAT_NUMERIC_PASSWORD))
  1052.     {
  1053.         inline_edit_prepare_mask_buffer(buffer, mask_buffer);
  1054.         i->mask_buffer = mask_buffer;
  1055.         item->text_p = mask_buffer;
  1056.     }
  1057.     /* UCS2_count==-1 means this field hasn't been edited */
  1058.     i->UCS2_count = -1;
  1059. }
  1060. /*****************************************************************************
  1061.  * FUNCTION
  1062.  *  ReConfigureInlineItemTextEdit
  1063.  * DESCRIPTION
  1064.  *  
  1065.  * PARAMETERS
  1066.  *  item            [?]         
  1067.  *  buffer          [?]         
  1068.  *  buffer_size     [IN]        
  1069.  *  input_type      [IN]        
  1070.  * RETURNS
  1071.  *  void
  1072.  *****************************************************************************/
  1073. void ReConfigureInlineItemTextEdit(InlineItem *item, U8 *buffer, S32 buffer_size, S16 input_type)
  1074. {
  1075.     /*----------------------------------------------------------------*/
  1076.     /* Local Variables                                                */
  1077.     /*----------------------------------------------------------------*/
  1078.     wgui_inline_item_text_edit *i;
  1079.     UI_buffer_type mask_buffer;
  1080.     S16 t = input_type & INPUT_TYPE_MASK;
  1081.     /*----------------------------------------------------------------*/
  1082.     /* Code Body                                                      */
  1083.     /*----------------------------------------------------------------*/
  1084.     if ((item->flags & 0xff) != INLINE_ITEM_TYPE_TEXT_EDIT)
  1085.     {
  1086.         return;
  1087.     }
  1088.     i = (wgui_inline_item_text_edit*) item->item;
  1089.     mask_buffer = i->mask_buffer;
  1090.     i->max_lines = 0;
  1091.     i->buffer = buffer;
  1092.     i->buffer_size = buffer_size;
  1093.     i->flags = 0;
  1094.     i->input_type = input_type;
  1095.     item->text_p = i->buffer;
  1096.     i->edit_complete_callback = UI_dummy_edit_complete_handler;
  1097.     i->custom_setup_function = NULL;
  1098.     if ((t == INPUT_TYPE_NUMERIC_PASSWORD) || (t == INPUT_TYPE_ALPHANUMERIC_PASSWORD) ||
  1099.         (t == INPUT_TYPE_SAT_NUMERIC_PASSWORD))
  1100.     {
  1101.         inline_edit_prepare_mask_buffer(buffer, mask_buffer);
  1102.         i->mask_buffer = mask_buffer;
  1103.         item->text_p = mask_buffer;
  1104.     }
  1105. }
  1106. /*****************************************************************************
  1107.  * FUNCTION
  1108.  *  RegisterInlineTextEditCompleteHandler
  1109.  * DESCRIPTION
  1110.  *  
  1111.  * PARAMETERS
  1112.  *  item        [?]         
  1113.  *  f           [IN]        
  1114.  * RETURNS
  1115.  *  void
  1116.  *****************************************************************************/
  1117. void RegisterInlineTextEditCompleteHandler(InlineItem *item, void (*f) (U8 *string, S32 buffer_size))
  1118. {
  1119.     /*----------------------------------------------------------------*/
  1120.     /* Local Variables                                                */
  1121.     /*----------------------------------------------------------------*/
  1122.     wgui_inline_item_text_edit *i;
  1123.     /*----------------------------------------------------------------*/
  1124.     /* Code Body                                                      */
  1125.     /*----------------------------------------------------------------*/
  1126.     i = (wgui_inline_item_text_edit*) item->item;
  1127.     if (f != NULL)
  1128.     {
  1129.         i->edit_complete_callback = f;
  1130.     }
  1131. }
  1132. /*****************************************************************************
  1133.  * FUNCTION
  1134.  *  RegisterInlineTextEditValidationFunction
  1135.  * DESCRIPTION
  1136.  *  
  1137.  * PARAMETERS
  1138.  *  item        [?]         
  1139.  *  f           [IN]        
  1140.  * RETURNS
  1141.  *  void
  1142.  *****************************************************************************/
  1143. void RegisterInlineTextEditValidationFunction(InlineItem *item, void (*f) (U8 *buffer, U8 *cursor, S32 text_length))
  1144. {
  1145.     /*----------------------------------------------------------------*/
  1146.     /* Local Variables                                                */
  1147.     /*----------------------------------------------------------------*/
  1148.     wgui_inline_item_text_edit *i;
  1149.     /*----------------------------------------------------------------*/
  1150.     /* Code Body                                                      */
  1151.     /*----------------------------------------------------------------*/
  1152.     i = (wgui_inline_item_text_edit*) item->item;
  1153.     if (f != NULL)
  1154.     {
  1155.         i->validation_callback = f;
  1156.     }
  1157. }
  1158. /* PMT  MANISH  START  20050722 */
  1159. #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
  1160. /*****************************************************************************
  1161.  * FUNCTION
  1162.  *  SetInlineItemTextEditDefaultItemNameIfEmpty
  1163.  * DESCRIPTION
  1164.  *  Sets the pointer item->text_p to point to default item text
  1165.  *  if the buffer is empty
  1166.  * PARAMETERS
  1167.  *  item                [IN]        Is the pointer to InlineItem structure.
  1168.  *  default_text_id     [IN]        Is the string Id of the default text.
  1169.  * RETURNS
  1170.  *  void
  1171.  *****************************************************************************/
  1172. void SetInlineItemTextEditDefaultItemNameIfEmpty(InlineItem *item, U16 default_text_id)
  1173. {
  1174.     /*----------------------------------------------------------------*/
  1175.     /* Local Variables                                                */
  1176.     /*----------------------------------------------------------------*/
  1177.     wgui_inline_item_text_edit *i;
  1178.     S32 sw, sh;
  1179.     /*----------------------------------------------------------------*/
  1180.     /* Code Body                                                      */
  1181.     /*----------------------------------------------------------------*/
  1182.     i = (wgui_inline_item_text_edit*) item->item;
  1183.     i->default_item_text = (U8*) get_string(default_text_id);
  1184.     gui_measure_string((UI_string_type) i->buffer, &sw, &sh);
  1185.     if ((IsInlineItemDefaultTextEnable()) && (sw == 0))
  1186.     {
  1187.         item->text_p = i->default_item_text;
  1188.     }
  1189. }
  1190. /*****************************************************************************
  1191.  * FUNCTION
  1192.  *  EnableInlineItemDefaultText
  1193.  * DESCRIPTION
  1194.  *  Sets the global flag variable to 1.
  1195.  * PARAMETERS
  1196.  *  void
  1197.  * RETURNS
  1198.  *  void
  1199.  *****************************************************************************/
  1200. void EnableInlineItemDefaultText(void)
  1201. {
  1202.     /*----------------------------------------------------------------*/
  1203.     /* Local Variables                                                */
  1204.     /*----------------------------------------------------------------*/
  1205.     /*----------------------------------------------------------------*/
  1206.     /* Code Body                                                      */
  1207.     /*----------------------------------------------------------------*/
  1208.     wgui_enable_inline_item_default_text = 1;
  1209. }
  1210. /*****************************************************************************
  1211.  * FUNCTION
  1212.  *  DisableInlineItemDefaultText
  1213.  * DESCRIPTION
  1214.  *  Sets the global flag variable to 0.
  1215.  * PARAMETERS
  1216.  *  void
  1217.  * RETURNS
  1218.  *  void
  1219.  *****************************************************************************/
  1220. void DisableInlineItemDefaultText(void)
  1221. {
  1222.     /*----------------------------------------------------------------*/
  1223.     /* Local Variables                                                */
  1224.     /*----------------------------------------------------------------*/
  1225.     /*----------------------------------------------------------------*/
  1226.     /* Code Body                                                      */
  1227.     /*----------------------------------------------------------------*/
  1228.     wgui_enable_inline_item_default_text = 0;
  1229. }
  1230. /*****************************************************************************
  1231.  * FUNCTION
  1232.  *  IsInlineItemDefaultTextEnable
  1233.  * DESCRIPTION
  1234.  *  Check whether the global flag is on or off.
  1235.  * PARAMETERS
  1236.  *  void
  1237.  * RETURNS
  1238.  *  1 if the flag is set otherwise 0.
  1239.  *****************************************************************************/
  1240. U8 IsInlineItemDefaultTextEnable(void)
  1241. {
  1242.     /*----------------------------------------------------------------*/
  1243.     /* Local Variables                                                */
  1244.     /*----------------------------------------------------------------*/
  1245.     /*----------------------------------------------------------------*/
  1246.     /* Code Body                                                      */
  1247.     /*----------------------------------------------------------------*/
  1248.     return (wgui_enable_inline_item_default_text == 1);
  1249. }
  1250. #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */ 
  1251. /* PMT  MANISH  END  20050722 */
  1252. /* Displaying inline text edit as a menu item in the fixed list menu */
  1253. single_line_input_box wgui_inline_text_edit_display_inputbox;
  1254. /*****************************************************************************
  1255.  * FUNCTION
  1256.  *  wgui_show_inline_text_edit_list_menuitem
  1257.  * DESCRIPTION
  1258.  *  
  1259.  * PARAMETERS
  1260.  *  x1          [IN]        
  1261.  *  y1          [IN]        
  1262.  *  width       [IN]        
  1263.  *  height      [IN]        
  1264.  *  item        [?]         
  1265.  * RETURNS
  1266.  *  void
  1267.  *****************************************************************************/
  1268. void wgui_show_inline_text_edit_list_menuitem(S32 x1, S32 y1, S32 width, S32 height, wgui_inline_item *item)
  1269. {
  1270.     /*----------------------------------------------------------------*/
  1271.     /* Local Variables                                                */
  1272.     /*----------------------------------------------------------------*/
  1273.     S32 xx, l;
  1274.     wgui_inline_item_text_edit *i = (wgui_inline_item_text_edit*) item->item;
  1275.     /*----------------------------------------------------------------*/
  1276.     /* Code Body                                                      */
  1277.     /*----------------------------------------------------------------*/
  1278.     if (MMI_fixed_icontext_menuitem.text_x == 2)
  1279.     {
  1280.         xx = -1;
  1281.     }
  1282.     else
  1283.     {
  1284.         xx = MMI_fixed_icontext_menuitem.text_x;
  1285.     }
  1286.     if (item->flags & INLINE_ITEM_LEFT_ALIGN)
  1287.     {
  1288.         xx = -1;
  1289.     }
  1290.     gdi_layer_lock_frame_buffer();
  1291.     /* add check to use mask buffer in case of passwords here   */
  1292.     l = gui_strlen((UI_string_type) i->buffer);
  1293. #ifdef __UCS2_ENCODING
  1294.     gui_create_single_line_input_box_set_buffer_first_position(
  1295.         &wgui_inline_text_edit_display_inputbox,
  1296.         MMI_singleline_inputbox_x,
  1297.         MMI_singleline_inputbox_y,
  1298.         MMI_singleline_inputbox_width,
  1299.         MMI_singleline_inputbox_height,
  1300.         (UI_string_type) i->buffer,
  1301.         i->buffer_size,
  1302.         (l + 1) * 2,
  1303.         0);
  1304. #endif /* __UCS2_ENCODING */ 
  1305. #ifdef __ASCII
  1306.     gui_create_single_line_input_box_set_buffer_first_position(
  1307.         &wgui_inline_text_edit_display_inputbox,
  1308.         MMI_singleline_inputbox_x,
  1309.         MMI_singleline_inputbox_y,
  1310.         MMI_singleline_inputbox_width,
  1311.         MMI_singleline_inputbox_height,
  1312.         (UI_string_type) i->buffer,
  1313.         i->buffer_size,
  1314.         l + 1,
  1315.         0);
  1316. #endif /* __ASCII */ 
  1317.     wgui_inline_text_edit_display_inputbox.flags |= UI_SINGLE_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW;
  1318.     switch (i->input_type & INPUT_TYPE_MASK)
  1319.     {
  1320.         case INPUT_TYPE_NUMERIC_PASSWORD:
  1321.         case INPUT_TYPE_ALPHANUMERIC_PASSWORD:
  1322.             wgui_inline_text_edit_display_inputbox.flags |= UI_SINGLE_LINE_INPUT_BOX_MASK_CHARACTERS;
  1323.             break;
  1324.     }
  1325.     switch (item->flags & INLINE_ITEM_JUSTIFY_MASK)
  1326.     {
  1327.         case INLINE_ITEM_RIGHT_JUSTIFY:
  1328.             wgui_inline_text_edit_display_inputbox.flags |= UI_SINGLE_LINE_INPUT_BOX_RIGHT_JUSTIFY;
  1329.             break;
  1330.         case INLINE_ITEM_CENTER_JUSTIFY:
  1331.             wgui_inline_text_edit_display_inputbox.flags |= UI_SINGLE_LINE_INPUT_BOX_CENTER_JUSTIFY;
  1332.             break;
  1333.     }
  1334.     wgui_inline_text_edit_display_inputbox.flags |= UI_SINGLE_LINE_INPUT_BOX_TRUNCATE_CONTENT_NO_BRIEF; /* 022405 Calvin added */
  1335.     if ((item->flags & INLINE_ITEM_BOUNDARY_MASK) == INLINE_ITEM_BOUNDARY_ALWAYS)
  1336.     {
  1337.         gui_set_single_line_input_box_theme(
  1338.             &wgui_inline_text_edit_display_inputbox,
  1339.             &wgui_inline_singleline_inputbox_unfocussed_theme);
  1340.         wgui_inline_text_edit_display_inputbox.text_font = &MMI_medium_font;
  1341.     }
  1342.     gui_resize_single_line_input_box(&wgui_inline_text_edit_display_inputbox, width - 1 - xx, height);
  1343.     gui_move_single_line_input_box(&wgui_inline_text_edit_display_inputbox, x1 + xx, y1);
  1344.     gui_show_single_line_input_box(&wgui_inline_text_edit_display_inputbox);
  1345.     redraw_left_softkey();
  1346.     redraw_right_softkey();
  1347.     gdi_layer_unlock_frame_buffer();
  1348. }
  1349. /*----------------------------------------------------------------------------
  1350.    Inline text edit (Full screen) implementation
  1351. ----------------------------------------------------------------------------*/
  1352. /* History implementation for inline text edit  */
  1353. typedef multiline_inputbox_category_history inline_full_screen_edit_history;
  1354. /*****************************************************************************
  1355.  * FUNCTION
  1356.  *  inline_full_screen_edit_get_history
  1357.  * DESCRIPTION
  1358.  *  
  1359.  * PARAMETERS
  1360.  *  history_buffer      [?]         
  1361.  *  input_type          [IN]        
  1362.  * RETURNS
  1363.  *  
  1364.  *****************************************************************************/
  1365. U8 *inline_full_screen_edit_get_history(U8 *history_buffer, S16 input_type)
  1366. {
  1367.     /*----------------------------------------------------------------*/
  1368.     /* Local Variables                                                */
  1369.     /*----------------------------------------------------------------*/
  1370.     /*----------------------------------------------------------------*/
  1371.     /* Code Body                                                      */
  1372.     /*----------------------------------------------------------------*/
  1373.     get_multiline_inputbox_category_history(INLINE_FULL_SCREEN_EDIT_HISTORY_ID, history_buffer, input_type);
  1374.     return (history_buffer);
  1375. }
  1376. /*****************************************************************************
  1377.  * FUNCTION
  1378.  *  inline_full_screen_edit_set_history
  1379.  * DESCRIPTION
  1380.  *  
  1381.  * PARAMETERS
  1382.  *  history_ID          [IN]        
  1383.  *  history_buffer      [?]         
  1384.  *  input_type          [?]         
  1385.  * RETURNS
  1386.  *  
  1387.  *****************************************************************************/
  1388. U8 inline_full_screen_edit_set_history(U16 history_ID, U8 *history_buffer, S16 *input_type)
  1389. {
  1390.     /*----------------------------------------------------------------*/
  1391.     /* Local Variables                                                */
  1392.     /*----------------------------------------------------------------*/
  1393.     /*----------------------------------------------------------------*/
  1394.     /* Code Body                                                      */
  1395.     /*----------------------------------------------------------------*/
  1396.     return (set_multiline_inputbox_category_history(INLINE_FULL_SCREEN_EDIT_HISTORY_ID, history_buffer, input_type));
  1397. }
  1398. /* Start Yogesh 20040814 */
  1399. /*****************************************************************************
  1400.  * FUNCTION
  1401.  *  inline_multi_line_edit_get_history
  1402.  * DESCRIPTION
  1403.  *  
  1404.  * PARAMETERS
  1405.  *  history_buffer      [?]         
  1406.  *  input_type          [IN]        
  1407.  * RETURNS
  1408.  *  
  1409.  *****************************************************************************/
  1410. U8 *inline_multi_line_edit_get_history(U8 *history_buffer, S16 input_type)
  1411. {
  1412.     /*----------------------------------------------------------------*/
  1413.     /* Local Variables                                                */
  1414.     /*----------------------------------------------------------------*/
  1415.     /*----------------------------------------------------------------*/
  1416.     /* Code Body                                                      */
  1417.     /*----------------------------------------------------------------*/
  1418.     get_multiline_inputbox_category_history(INLINE_MULTI_LINE_EDIT_HISTORY_ID, history_buffer, input_type);
  1419.     return (history_buffer);
  1420. }
  1421. /* End Yogesh 20040814 */
  1422. /*****************************************************************************
  1423.  * FUNCTION
  1424.  *  redraw_inline_full_screen_edit
  1425.  * DESCRIPTION
  1426.  *  
  1427.  * PARAMETERS
  1428.  *  void
  1429.  * RETURNS
  1430.  *  void
  1431.  *****************************************************************************/
  1432. void redraw_inline_full_screen_edit(void)
  1433. {
  1434.     /*----------------------------------------------------------------*/
  1435.     /* Local Variables                                                */
  1436.     /*----------------------------------------------------------------*/
  1437.     /* micha1111, #219 */
  1438. #ifdef __MMI_DEFAULT_THEME_3__
  1439.     color c = {206, 206, 206, 100};
  1440. #endif 
  1441.     /*----------------------------------------------------------------*/
  1442.     /* Code Body                                                      */
  1443.     /*----------------------------------------------------------------*/
  1444.     gdi_layer_lock_frame_buffer();
  1445.     /* micha1111 Chicago Feature */
  1446. #ifdef __MMI_DEFAULT_THEME_3__
  1447.     gdi_layer_reset_clip();
  1448.     gui_fill_rectangle(0, 0, UI_device_width - 1, UI_device_height - 1, c);
  1449. #else /* __MMI_DEFAULT_THEME_3__ */ 
  1450.     if (wgui_is_wallpaper_on_bottom() == MMI_TRUE)
  1451.     {
  1452.         gdi_draw_solid_rect(0, 0, UI_device_width - 1, UI_device_height - 1, GDI_COLOR_TRANSPARENT);
  1453.     }
  1454.     else
  1455.     {
  1456.         clear_screen();
  1457.     }
  1458. #endif /* __MMI_DEFAULT_THEME_3__ */ 
  1459.     show_title_status_icon();
  1460.     draw_title();
  1461.     wgui_show_inputbox();
  1462. #if defined(__MMI_TOUCH_SCREEN__)
  1463.     mmi_pen_editor_inline_full_screen_redraw_handwriting_area();
  1464. #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  1465.     show_softkey_background();
  1466.     show_left_softkey();
  1467.     show_right_softkey();
  1468. #if defined(__MMI_TOUCH_SCREEN__)
  1469. #if defined(__MMI_WGUI_CSK_ENABLE__)
  1470.     /* W05.36 Add Center Soft Key for switching Input Method */
  1471.     show_softkey(MMI_CENTER_SOFTKEY);
  1472. #endif /* defined(__MMI_WGUI_CSK_ENABLE__) */ 
  1473. #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  1474.     gdi_layer_unlock_frame_buffer();
  1475.     gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
  1476.     /* MTK Elvis for redrawing spelling or candidate boxes */
  1477.     if (RedrawSpellingOrCandidateBoxesFunction)
  1478.     {
  1479.         RedrawSpellingOrCandidateBoxesFunction();
  1480.     }
  1481.     /* MTK end */
  1482. }
  1483. /*****************************************************************************
  1484.  * FUNCTION
  1485.  *  handle_inline_full_screen_edit_complete
  1486.  * DESCRIPTION
  1487.  *  
  1488.  * PARAMETERS
  1489.  *  void
  1490.  * RETURNS
  1491.  *  void
  1492.  *****************************************************************************/
  1493. void handle_inline_full_screen_edit_complete(void)
  1494. {
  1495.     /*----------------------------------------------------------------*/
  1496.     /* Local Variables                                                */
  1497.     /*----------------------------------------------------------------*/
  1498.     S32 input_type = current_wgui_inline_text_edit_item->input_type & INPUT_TYPE_MASK;
  1499.     /*----------------------------------------------------------------*/
  1500.     /* Code Body                                                      */
  1501.     /*----------------------------------------------------------------*/
  1502.     
  1503.     ClearAllKeyHandler(); // clear all key to avoid inline edit screen use editor key handle
  1504.     
  1505.     /* Set Current Inline Method To Zero After Full Screen Editing Is Complete - Gurinder 3/27/2004 */
  1506.     wgui_current_inline_item_type = 0;
  1507.     current_wgui_inline_item->flags &= ~INLINE_ITEM_OPEN;
  1508.     if (inline_full_screen_edit_changed)
  1509.     {
  1510.         wgui_inline_list_menu_changed = 1;
  1511.     }
  1512.     if (current_wgui_inline_item->flags & INLINE_ITEM_CHANGED)
  1513.     {
  1514.         set_wgui_inline_list_menu_changed();
  1515.     }
  1516.     current_wgui_inline_text_edit_item->UCS2_count = MMI_multiline_inputbox.UCS2_count;
  1517.     gui_strcpy(
  1518.         (UI_string_type) current_wgui_inline_text_edit_item->buffer,
  1519.         (UI_string_type) wgui_inline_full_screen_text_edit_buffer);
  1520.     if ((input_type == INPUT_TYPE_NUMERIC_PASSWORD) || (input_type == INPUT_TYPE_ALPHANUMERIC_PASSWORD) ||
  1521.         (input_type == INPUT_TYPE_SAT_NUMERIC_PASSWORD))
  1522.     {
  1523.         inline_edit_prepare_mask_buffer(
  1524.             current_wgui_inline_text_edit_item->buffer,
  1525.             current_wgui_inline_text_edit_item->mask_buffer);
  1526.         *current_wgui_inline_text_edit_text_p = current_wgui_inline_text_edit_item->mask_buffer;
  1527.     }
  1528.     else
  1529.     {
  1530.         /* PMT  MANISH  START  20050722 */
  1531.     #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
  1532.         if ((IsInlineItemDefaultTextEnable()) &&
  1533.             (gui_strlen((UI_string_type) current_wgui_inline_text_edit_item->buffer) == 0))
  1534.         {
  1535.             *current_wgui_inline_text_edit_text_p = current_wgui_inline_text_edit_item->default_item_text;
  1536.         }
  1537.         else
  1538.     #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */ 
  1539.             /* PMT  MANISH  END  20050722 */
  1540.             *current_wgui_inline_text_edit_text_p = current_wgui_inline_text_edit_item->buffer;
  1541.         /* PMT  MANISH  START  20050722 */
  1542.     #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
  1543.         MMI_fixed_icontext_menuitems[wgui_inline_item_highlighted_index].item_text =
  1544.             (UI_string_type) (*current_wgui_inline_text_edit_text_p);
  1545.     #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */ 
  1546.         /* PMT  MANISH  END  20050722 */
  1547.     }
  1548.     /* set_MMI_current_input_type(); */
  1549.     reset_softkeys();
  1550.     reset_multitaps();
  1551.     wgui_close_inputbox();
  1552.     /* 101105 inline Calvin Start */
  1553. #ifdef __MMI_WALLPAPER_ON_BOTTOM__
  1554.     if (inline_edit_scr_bg_ID != 0 || inline_edit_scr_bg_filename != NULL)      /* 010606 signature Calvin */
  1555.     {
  1556.         dm_set_scr_bg_image(inline_edit_scr_bg_ID, inline_edit_scr_bg_filename, inline_edit_scr_bg_x, inline_edit_scr_bg_y, inline_edit_scr_bg_opacity);        /* 110105 editor opacity Calvin changed */
  1557.         inline_edit_scr_bg_ID = 0;
  1558.         inline_edit_scr_bg_filename = NULL;
  1559.     }
  1560. #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */ 
  1561.     /* 101105 Calvin End */
  1562.     // #ifdef __MMI_PLUTO_GPRS__
  1563.     inline_image_text_edit_flag = 0;
  1564.     // #endif
  1565.     register_inline_fixed_list_keys();
  1566.     inline_text_edit_RSK_function = NULL;
  1567.     clear_left_softkey();
  1568.     clear_right_softkey();
  1569.     /* MTK Terry for RSK Long Press in inline full screen exit */
  1570.     set_right_softkey_function(UI_dummy_function, KEY_EVENT_LONG_PRESS);
  1571.     set_left_softkey_label(inline_full_screen_edit_saved_LSK_label);
  1572.     set_left_softkey_icon(inline_full_screen_edit_saved_LSK_icon);
  1573.     set_right_softkey_label(inline_full_screen_edit_saved_RSK_label);
  1574.     set_right_softkey_icon(inline_full_screen_edit_saved_RSK_icon);
  1575.     register_left_softkey_handler();
  1576.     register_right_softkey_handler();
  1577.     wgui_inline_item_handled = 0;
  1578.     wgui_text_menuitem_restart_scrolling();
  1579.     /* if title is changed, we should redraw title */
  1580.     if (MMI_title_icon != inline_full_screen_edit_saved_title_icon ||
  1581.         MMI_title_string != inline_full_screen_edit_saved_title)
  1582.     {
  1583.         MMI_title_icon = inline_full_screen_edit_saved_title_icon;
  1584.         MMI_title_string = inline_full_screen_edit_saved_title;
  1585.         draw_title();
  1586.     }
  1587.     current_wgui_inline_text_edit_item->edit_complete_callback(
  1588.                                             current_wgui_inline_text_edit_item->buffer,
  1589.                                             current_wgui_inline_text_edit_item->buffer_size);
  1590.     show_fixed_list();
  1591.     //MTK Leo add 0511, to reduce stack size
  1592.     // draw_title();
  1593.     //MTK Leo end
  1594.     inline_edit_current_highlight_handler(wgui_inline_item_highlighted_index);
  1595.     redraw_current_inline_item = UI_dummy_function;
  1596.     wgui_inputbox_UCS2_count_function = NULL;
  1597.     wgui_inputbox_not_empty_callback = NULL;
  1598.     wgui_inputbox_empty_callback = NULL;
  1599.     wgui_inputbox_validation_callback = NULL;
  1600.     inline_full_screen_edit_changed = 0;
  1601.     complete_inline_item_edit = UI_dummy_function;
  1602. #if defined(__MMI_TOUCH_SCREEN__)
  1603. #ifdef __MMI_WGUI_CSK_ENABLE__
  1604.     /* W05.38 Reset Center Sofy Key When Complete Full Screen Edit */
  1605.     set_softkey_label(NULL, MMI_CENTER_SOFTKEY);
  1606.     set_softkey_icon(NULL, MMI_CENTER_SOFTKEY);
  1607.     redraw_softkey(MMI_CENTER_SOFTKEY);
  1608.     clear_softkey_handler(MMI_CENTER_SOFTKEY);
  1609. #endif /* __MMI_WGUI_CSK_ENABLE__ */ 
  1610.     if (GUI_VIRTUAL_KEYBOARD_EMPTY_TRAY != MMI_virtual_keyboard.lang_type)
  1611.     {
  1612.         resize_fixed_list(MMI_content_width, MMI_content_height - MMI_virtual_keyboard.height - 1);
  1613.         mmi_pen_editor_clear_and_show_virtual_keyboard_area();
  1614.     }
  1615.     else
  1616.     {
  1617.         resize_fixed_list(MMI_content_width, MMI_content_height);
  1618.     }
  1619.     redraw_fixed_list();
  1620.     redraw_current_inline_item();
  1621. #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  1622.     //gui_cancel_timer(UI_inputbox_blink_cursor);
  1623.     //MTK Elvis
  1624.     StopMyTimer(BLINKING_CURSOR);
  1625.     /* MTK end */
  1626. }
  1627. /*****************************************************************************
  1628.  * FUNCTION
  1629.  *  handle_inline_full_screen_edit_close
  1630.  * DESCRIPTION
  1631.  *  
  1632.  * PARAMETERS
  1633.  *  void
  1634.  * RETURNS
  1635.  *  void
  1636.  *****************************************************************************/
  1637. void handle_inline_full_screen_edit_close(void)
  1638. {
  1639.     /*----------------------------------------------------------------*/
  1640.     /* Local Variables                                                */
  1641.     /*----------------------------------------------------------------*/
  1642.     /*----------------------------------------------------------------*/
  1643.     /* Code Body                                                      */
  1644.     /*----------------------------------------------------------------*/
  1645.     /* MTK Terry for G12C#392 RSK Long Press roll back for side effect */
  1646.     current_wgui_inline_item->flags |= INLINE_ITEM_OPEN;
  1647.     if (inline_full_screen_edit_changed)
  1648.     {
  1649.         current_wgui_inline_item->flags |= INLINE_ITEM_CHANGED;
  1650.     }
  1651.     set_MMI_current_input_type();
  1652.     reset_softkeys();
  1653.     reset_multitaps();
  1654.     wgui_close_inputbox();
  1655.     /* 101105 inline Calvin Start */
  1656. #ifdef __MMI_WALLPAPER_ON_BOTTOM__
  1657.     if (inline_edit_scr_bg_ID != 0 || inline_edit_scr_bg_filename != NULL)      /* 010606 signature Calvin */
  1658.     {
  1659.         dm_set_scr_bg_image(inline_edit_scr_bg_ID, inline_edit_scr_bg_filename, inline_edit_scr_bg_x, inline_edit_scr_bg_y, inline_edit_scr_bg_opacity);        /* 110105 editor opacity Calvin changed */
  1660.         inline_edit_scr_bg_ID = 0;
  1661.         inline_edit_scr_bg_filename = NULL;
  1662.     }
  1663. #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */ 
  1664.     /* 101105 Calvin End */
  1665.     wgui_inline_item_handled = 0;
  1666.     //MTK Elvis 20040609 it is wrong to reset wgui_current_inline_item_type
  1667.     // it will cause the inline full(multiline input box parameters) screen's history not be stored
  1668.     //wgui_current_inline_item_type = 0;
  1669.     //MTK end
  1670.     //W05.36 Temp Solution for Pop Screen in Full Screen Editor to check if any side effect or not
  1671.     inline_edit_current_highlight_handler(wgui_inline_item_highlighted_index);
  1672.     redraw_current_inline_item = UI_dummy_function;
  1673.     wgui_inputbox_UCS2_count_function = NULL;
  1674.     wgui_inputbox_not_empty_callback = NULL;
  1675.     wgui_inputbox_empty_callback = NULL;
  1676.     wgui_inputbox_validation_callback = NULL;
  1677.     inline_full_screen_edit_changed = 0;
  1678.     complete_inline_item_edit = UI_dummy_function;
  1679. #if defined(__MMI_TOUCH_SCREEN__)
  1680. #ifdef __MMI_WGUI_CSK_ENABLE__
  1681.     //W05.36 Add Center Soft Key for switching Input Method
  1682.     //W05.36 Temp Solution for Pop Screen in Full Screen Editor
  1683.     if (GetActiveScreenId() != POPUP_SCREENID
  1684.         && GetActiveScreenId() != WAP_SCREEN_MESSAGE_NOTIFICATION
  1685.         && GetActiveScreenId() != SCR_ID_POC_CM
  1686.         && GetActiveScreenId() != SCR_ID_SAT_WAITSCREEN
  1687.         && GetActiveScreenId() != SCR_POPUP_SCREEN && GetActiveScreenId() != SCR_ID_MSG_POPUP)
  1688.     {
  1689.         set_softkey_label(NULL, MMI_CENTER_SOFTKEY);
  1690.         set_softkey_icon(NULL, MMI_CENTER_SOFTKEY);
  1691.         redraw_softkey(MMI_CENTER_SOFTKEY);
  1692.         clear_softkey_handler(MMI_CENTER_SOFTKEY);
  1693.     }
  1694. #endif /* __MMI_WGUI_CSK_ENABLE__ */ 
  1695. #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  1696.     //gui_cancel_timer(UI_inputbox_blink_cursor);
  1697.     //MTK Elvis
  1698.     StopMyTimer(BLINKING_CURSOR);
  1699.     /* MTK end */
  1700. }
  1701. /*****************************************************************************
  1702.  * FUNCTION
  1703.  *  handle_inline_full_screen_edit_cancel
  1704.  * DESCRIPTION
  1705.  *  
  1706.  * PARAMETERS
  1707.  *  void
  1708.  * RETURNS
  1709.  *  void
  1710.  *****************************************************************************/
  1711. void handle_inline_full_screen_edit_cancel(void)
  1712. {
  1713.     /*----------------------------------------------------------------*/
  1714.     /* Local Variables                                                */
  1715.     /*----------------------------------------------------------------*/
  1716.     /*----------------------------------------------------------------*/
  1717.     /* Code Body                                                      */
  1718.     /*----------------------------------------------------------------*/
  1719.     gdi_layer_lock_frame_buffer();//111406 inline cancel
  1720.     current_wgui_inline_item->flags &= ~INLINE_ITEM_OPEN;
  1721.     ClearAllKeyHandler(); // clear all key to avoid inline edit screen use editor key handle
  1722.     set_MMI_current_input_type();
  1723.     reset_softkeys();
  1724.     reset_multitaps();
  1725.     wgui_close_inputbox();
  1726.     /* 101105 inline Calvin Start */
  1727. #ifdef __MMI_WALLPAPER_ON_BOTTOM__
  1728.     if (inline_edit_scr_bg_ID != 0 || inline_edit_scr_bg_filename != NULL)      /* 010606 signature Calvin */
  1729.     {
  1730.         dm_set_scr_bg_image(inline_edit_scr_bg_ID, inline_edit_scr_bg_filename, inline_edit_scr_bg_x, inline_edit_scr_bg_y, inline_edit_scr_bg_opacity);        /* 110105 editor opacity Calvin changed */
  1731.         inline_edit_scr_bg_ID = 0;
  1732.         inline_edit_scr_bg_filename = NULL;
  1733.     }
  1734. #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */ 
  1735.     /* 101105 Calvin End */
  1736.     // #ifdef __MMI_PLUTO_GPRS__
  1737.     inline_image_text_edit_flag = 0;
  1738.     // #endif
  1739.     register_inline_fixed_list_keys();
  1740.     inline_text_edit_RSK_function = NULL;
  1741.     clear_left_softkey();
  1742.     clear_right_softkey();
  1743. #if !defined(__MMI_WITH_C_KEY__)
  1744.     ClearKeyHandler(KEY_RSK, KEY_LONG_PRESS);
  1745. #endif 
  1746.     set_left_softkey_label(inline_full_screen_edit_saved_LSK_label);
  1747.     set_left_softkey_icon(inline_full_screen_edit_saved_LSK_icon);
  1748.     set_right_softkey_label(inline_full_screen_edit_saved_RSK_label);
  1749.     set_right_softkey_icon(inline_full_screen_edit_saved_RSK_icon);
  1750.     register_left_softkey_handler();
  1751.     register_right_softkey_handler();
  1752.     wgui_inline_item_handled = 0;
  1753.     wgui_current_inline_item_type = 0;
  1754.     wgui_text_menuitem_restart_scrolling();
  1755.     /* if title is changed, we should redraw title */
  1756.     if (MMI_title_icon != inline_full_screen_edit_saved_title_icon ||
  1757.         MMI_title_string != inline_full_screen_edit_saved_title)
  1758.     {
  1759.         MMI_title_icon = inline_full_screen_edit_saved_title_icon;
  1760.         MMI_title_string = inline_full_screen_edit_saved_title;
  1761.         draw_title();
  1762.     }
  1763.     show_fixed_list();
  1764.     //MTK Leo add 0511, to reduce stack size
  1765.     // draw_title();
  1766.     //MTK Leo end
  1767.     inline_edit_current_highlight_handler(wgui_inline_item_highlighted_index);
  1768.     redraw_current_inline_item = UI_dummy_function;
  1769.     wgui_inputbox_UCS2_count_function = NULL;
  1770.     wgui_inputbox_not_empty_callback = NULL;
  1771.     wgui_inputbox_empty_callback = NULL;
  1772.     wgui_inputbox_validation_callback = NULL;
  1773.     inline_full_screen_edit_changed = 0;
  1774.     complete_inline_item_edit = UI_dummy_function;
  1775.     gdi_layer_unlock_frame_buffer();//111406 inline cancel
  1776.     gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
  1777. #if defined(__MMI_TOUCH_SCREEN__)
  1778. #ifdef __MMI_WGUI_CSK_ENABLE__
  1779.     /* W05.36 Add Center Soft Key for switching Input Method */
  1780.     set_softkey_label(NULL, MMI_CENTER_SOFTKEY);
  1781.     set_softkey_icon(NULL, MMI_CENTER_SOFTKEY);
  1782.     redraw_softkey(MMI_CENTER_SOFTKEY);
  1783.     clear_softkey_handler(MMI_CENTER_SOFTKEY);
  1784. #endif /* __MMI_WGUI_CSK_ENABLE__ */ 
  1785. #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  1786.     //gui_cancel_timer(UI_inputbox_blink_cursor);
  1787.     //MTK Elvis
  1788.     StopMyTimer(BLINKING_CURSOR);
  1789.     /* MTK end */
  1790. }
  1791. extern void wgui_handle_inputbox_input(void);
  1792. /*****************************************************************************
  1793.  * FUNCTION
  1794.  *  wgui_inline_edit_handle_multiline_inputbox_input
  1795.  * DESCRIPTION
  1796.  *  
  1797.  * PARAMETERS
  1798.  *  void
  1799.  * RETURNS
  1800.  *  void
  1801.  *****************************************************************************/
  1802. void wgui_inline_edit_handle_multiline_inputbox_input(void)
  1803. {
  1804.     /*----------------------------------------------------------------*/
  1805.     /* Local Variables                                                */
  1806.     /*----------------------------------------------------------------*/
  1807.     /*----------------------------------------------------------------*/
  1808.     /* Code Body                                                      */
  1809.     /*----------------------------------------------------------------*/
  1810.     wgui_handle_inputbox_input();
  1811.     inline_full_screen_edit_changed = 1;
  1812. #if defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__)
  1813.     if (wgui_current_inline_item_type == INLINE_ITEM_TYPE_MULTI_LINE_EDIT)
  1814.     {
  1815.     #ifdef __MMI_WITH_C_KEY__
  1816.         /* MTK for RSK display with C Key */
  1817.         /* Need to consider wgui_inline_list_menu_disable_done */
  1818.         if (wgui_inline_list_menu_changed && !(wgui_inline_list_menu_disable_done))
  1819.         {
  1820.             set_right_softkey_label(NULL);
  1821.             set_right_softkey_icon(NULL);
  1822.             redraw_right_softkey();
  1823.         }
  1824.     #else /* __MMI_WITH_C_KEY__ */ 
  1825.         /* MTK Terry for RSK sync in in-line multiline input box */
  1826.         if (wgui_inline_list_menu_changed && !(wgui_inline_list_menu_disable_done))
  1827.         {
  1828.             if (gui_multi_line_input_box_get_text_length(&MMI_multiline_inputbox) <= 0)
  1829.             {
  1830.                 set_right_softkey_label(NULL);
  1831.                 set_right_softkey_icon(NULL);
  1832.                 redraw_right_softkey();
  1833.                 if (MMI_right_softkey.flags & UI_BUTTON_STATE_CLICKED)
  1834.                 {
  1835.                     MMI_right_softkey.flags &= ~UI_BUTTON_STATE_CLICKED;
  1836.                     MMI_right_softkey.flags &= ~UI_BUTTON_STATE_DOWN;
  1837.                 }
  1838.             }
  1839.         }
  1840.     #endif /* __MMI_WITH_C_KEY__ */ 
  1841.     }
  1842. #endif /* defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__) */ 
  1843. }
  1844. /*****************************************************************************
  1845.  * FUNCTION
  1846.  *  handle_inline_full_screen_edit
  1847.  * DESCRIPTION
  1848.  *  
  1849.  * PARAMETERS
  1850.  *  x                   [IN]        
  1851.  *  y                   [IN]        
  1852.  *  width               [IN]        
  1853.  *  height              [IN]        
  1854.  *  key_code            [IN]        
  1855.  *  key_event           [IN]        
  1856.  *  text_p              [IN]        
  1857.  *  item                [?]         
  1858.  *  flags               [IN]        
  1859.  *  history_buffer      [?]         
  1860.  * RETURNS
  1861.  *  void
  1862.  *****************************************************************************/
  1863. void handle_inline_full_screen_edit(
  1864.         S32 x,
  1865.         S32 y,
  1866.         S32 width,
  1867.         S32 height,
  1868.         S32 key_code,
  1869.         S32 key_event,
  1870.         U8 **text_p,
  1871.         void *item,
  1872.         U32 flags,
  1873.         U8 *history_buffer)
  1874. {
  1875.     /*----------------------------------------------------------------*/
  1876.     /* Local Variables                                                */
  1877.     /*----------------------------------------------------------------*/
  1878.     S32 input_type;
  1879.     wgui_inline_item_text_edit *i = (wgui_inline_item_text_edit*) item;
  1880.     S32 inputbox_x = 0;
  1881.     S32 inputbox_y = (MMI_title_y + MMI_title_height);
  1882.     S32 inputbox_width = MMI_content_width;
  1883. #if defined(__MMI_FULL_SCREEN_EDITOR__)
  1884.     S32 inputbox_height = MMI_content_height;
  1885. #else 
  1886.     S32 inputbox_height = MMI_content_height - MMI_multitap_height;
  1887. #endif 
  1888.     /*----------------------------------------------------------------*/
  1889.     /* Code Body                                                      */
  1890.     /*----------------------------------------------------------------*/
  1891.     MMI_current_input_ext_type = 0;
  1892.     UI_UNUSED_PARAMETER(x);
  1893.     UI_UNUSED_PARAMETER(y);
  1894.     UI_UNUSED_PARAMETER(width);
  1895.     UI_UNUSED_PARAMETER(height);
  1896.     UI_UNUSED_PARAMETER(key_code);
  1897.     UI_UNUSED_PARAMETER(key_event);
  1898.     UI_UNUSED_PARAMETER(flags);
  1899.     gdi_layer_lock_frame_buffer();
  1900.     wgui_text_menuitem_reset_scrolling();
  1901.     if (i->flags & INLINE_ITEM_CHANGED)
  1902.     {
  1903.         inline_full_screen_edit_changed = 1;
  1904.     }
  1905.     else
  1906.     {
  1907.         inline_full_screen_edit_changed = 0;
  1908.     }
  1909.     wgui_current_inline_item_type = INLINE_ITEM_TYPE_FULL_SCREEN_EDIT;
  1910.     current_wgui_inline_text_edit_item = i;
  1911.     current_wgui_inline_text_edit_text_p = text_p;
  1912.     input_type = i->input_type;
  1913.     if (!(i->flags & INLINE_ITEM_OPEN))
  1914.     {
  1915.         gui_strcpy((UI_string_type) wgui_inline_full_screen_text_edit_buffer, (UI_string_type) i->buffer);
  1916.         history_buffer = NULL;
  1917.     }
  1918.     i->flags &= ~INLINE_ITEM_OPEN;
  1919.     inline_full_screen_edit_saved_title = MMI_title_string;
  1920.     inline_full_screen_edit_saved_title_icon = MMI_title_icon;
  1921.     inline_full_screen_edit_saved_LSK_label = MMI_softkeys[MMI_LEFT_SOFTKEY].text;
  1922.     inline_full_screen_edit_saved_RSK_label = MMI_softkeys[MMI_RIGHT_SOFTKEY].text;
  1923.     inline_full_screen_edit_saved_LSK_icon = MMI_softkeys[MMI_LEFT_SOFTKEY].normal_up_icon;
  1924.     inline_full_screen_edit_saved_RSK_icon = MMI_softkeys[MMI_RIGHT_SOFTKEY].normal_up_icon;
  1925.     change_left_softkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  1926.     change_right_softkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  1927.     MMI_menu_shortcut_number = -1;
  1928.     MMI_disable_title_shortcut_display = 1;
  1929.     clear_key_handlers();
  1930.     change_left_softkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  1931.     change_right_softkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  1932.     clear_left_softkey();
  1933.     clear_right_softkey();
  1934.     register_left_softkey_handler();
  1935.     register_right_softkey_handler();
  1936.     register_default_hide_softkeys();
  1937.     MMI_title_string = get_string(i->title);
  1938.     MMI_title_icon = get_image(i->title_icon);
  1939.     register_hide_multitap(category5_hide_multitap);
  1940.     wgui_inputbox_validation_callback = i->validation_callback;
  1941.     if (i->custom_setup_function != NULL)
  1942.     {
  1943.         i->custom_setup_function();
  1944.     }
  1945.     /* MTK Add By Elvis for third party input module */
  1946. #ifdef __MMI_T9__
  1947.     InuptMethodEnterCategory5();
  1948. #elif defined __MMI_ZI__
  1949.     ZiInuptMethodEnterCategory5();
  1950. //KP Jerry add on 2007-3-8 start
  1951. #elif defined __MMI_CSTAR__
  1952.     CstarInputMethodEnterCategory5();
  1953. //KP Jerry add on 2007-3-8 end
  1954. #elif defined __MMI_KA__
  1955.     KonkaInuptMethodEnterCategory5();
  1956. #elif defined __MMI_ITAP__
  1957. /* under construction !*/
  1958. #endif 
  1959.     /* MTK end */
  1960.     wgui_setup_inputbox(
  1961.         inputbox_x,
  1962.         inputbox_y,
  1963.         inputbox_width,
  1964.         inputbox_height,
  1965.         wgui_inline_full_screen_text_edit_buffer,
  1966.         i->buffer_size,
  1967.         INLINE_FULL_SCREEN_EDIT_HISTORY_ID,
  1968.         get_string(STR_GLOBAL_BACK),
  1969.         get_image(IMG_GLOBAL_BACK),
  1970.         (S16) input_type,
  1971.         history_buffer,
  1972.         1);
  1973.     /* MTK Terry for 0x81 encoding for Phone Book */
  1974.     MMI_current_input_ext_type = i->input_ext_type;
  1975.     /* Ailsa for remove new line symbol from password input type */
  1976.     if (((i->input_type & INPUT_TYPE_MASK) == INPUT_TYPE_NUMERIC_PASSWORD) ||
  1977.         ((i->input_type & INPUT_TYPE_MASK) == INPUT_TYPE_ALPHANUMERIC_PASSWORD) ||
  1978.         ((i->input_type & INPUT_TYPE_MASK) == INPUT_TYPE_SAT_NUMERIC_PASSWORD))
  1979.     {
  1980.         MMI_current_input_ext_type |= INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL;
  1981.     }
  1982. /* it should be resize in wgui_setup_inputbox    
  1983. #if defined(__MMI_FULL_SCREEN_EDITOR__)
  1984.     inputbox_height = MMI_content_height - wgui_inputbox_information_bar_height;
  1985. #else 
  1986.     inputbox_height = MMI_content_height - MMI_multitap_height - wgui_inputbox_information_bar_height;
  1987. #endif 
  1988.     if (MMI_multiline_inputbox.height > inputbox_height)
  1989.     {
  1990.         gui_resize_multi_line_input_box(&MMI_multiline_inputbox, MMI_multiline_inputbox.width, inputbox_height);
  1991.     }
  1992. */    
  1993. #if defined(__MMI_TOUCH_SCREEN__)
  1994.     mmi_pen_editor_resize_multiline_input_box_for_vk();
  1995. #endif 
  1996.     register_multiline_inputbox_input_callback(wgui_inline_edit_handle_multiline_inputbox_input);
  1997.     wgui_inputbox_RSK_function = handle_inline_full_screen_edit_cancel;
  1998.     redraw_current_inline_item = redraw_inline_full_screen_edit;
  1999.     /* set_left_softkey_function(handle_inline_full_screen_edit_complete,KEY_EVENT_UP); */
  2000.     /* 101105 inline Calvin Start */
  2001. #ifdef __MMI_WALLPAPER_ON_BOTTOM__
  2002.     MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_TRANSPARENT_BACKGROUND;
  2003.     dm_get_scr_bg_image(
  2004.         &inline_edit_scr_bg_ID,
  2005.         &inline_edit_scr_bg_filename,
  2006.         &inline_edit_scr_bg_x,
  2007.         &inline_edit_scr_bg_y,
  2008.         &inline_edit_scr_bg_opacity);
  2009.     dm_set_scr_bg_image(inline_edit_scr_bg_ID, inline_edit_scr_bg_filename, inline_edit_scr_bg_x, inline_edit_scr_bg_y, current_MMI_theme->bg_opacity_low); /* 100605 editor opacity Calvin */
  2010. #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */ 
  2011.     /* 101105 Calvin End */
  2012.     gdi_layer_unlock_frame_buffer();
  2013.     redraw_inline_full_screen_edit();
  2014.     complete_inline_item_edit = handle_inline_full_screen_edit_close;
  2015. }
  2016. /* MTK Terry for 0x81 encoding for Phone Book */
  2017. /*****************************************************************************
  2018.  * FUNCTION
  2019.  *  SetInlineItemFullScreenEdit
  2020.  * DESCRIPTION
  2021.  *  
  2022.  * PARAMETERS
  2023.  *  item            [?]         
  2024.  *  title           [IN]        
  2025.  *  title_icon      [IN]        
  2026.  *  buffer          [?]         
  2027.  *  buffer_size     [IN]        
  2028.  *  input_type      [IN]        
  2029.  * RETURNS
  2030.  *  void
  2031.  *****************************************************************************/
  2032. void SetInlineItemFullScreenEdit(
  2033.         InlineItem *item,
  2034.         U16 title,
  2035.         U16 title_icon,
  2036.         U8 *buffer,
  2037.         S32 buffer_size,
  2038.         S16 input_type)
  2039. {
  2040.     /*----------------------------------------------------------------*/
  2041.     /* Local Variables                                                */
  2042.     /*----------------------------------------------------------------*/
  2043.     /*----------------------------------------------------------------*/
  2044.     /* Code Body                                                      */
  2045.     /*----------------------------------------------------------------*/
  2046.     SetInlineItemFullScreenEdit_ext(item, title, title_icon, buffer, buffer_size, input_type, 0);
  2047. }
  2048. /*****************************************************************************
  2049.  * FUNCTION
  2050.  *  SetInlineItemFullScreenEdit_ext
  2051.  * DESCRIPTION
  2052.  *  
  2053.  * PARAMETERS
  2054.  *  item                    [?]         
  2055.  *  title                   [IN]        
  2056.  *  title_icon              [IN]        
  2057.  *  buffer                  [?]         
  2058.  *  buffer_size             [IN]        
  2059.  *  input_type              [IN]        
  2060.  *  input_extended_type     [IN]        
  2061.  * RETURNS
  2062.  *  void
  2063.  *****************************************************************************/
  2064. void SetInlineItemFullScreenEdit_ext(
  2065.         InlineItem *item,
  2066.         U16 title,
  2067.         U16 title_icon,
  2068.         U8 *buffer,
  2069.         S32 buffer_size,
  2070.         S16 input_type,
  2071.         S16 input_extended_type)
  2072. {
  2073.     /*----------------------------------------------------------------*/
  2074.     /* Local Variables                                                */
  2075.     /*----------------------------------------------------------------*/
  2076.     wgui_inline_item_text_edit *i;
  2077.     UI_buffer_type mask_buffer;
  2078.     S16 t = input_type & INPUT_TYPE_MASK;
  2079.     /*----------------------------------------------------------------*/
  2080.     /* Code Body                                                      */
  2081.     /*----------------------------------------------------------------*/
  2082.     if (n_inline_text_edit_items >= MAX_INLINE_TEXT_EDIT_ITEMS)
  2083.     {
  2084.         return;
  2085.     }
  2086.     item->item = (void*)&wgui_inline_text_edit_items[n_inline_text_edit_items];
  2087.     item->flags = INLINE_ITEM_TYPE_FULL_SCREEN_EDIT;
  2088.     mask_buffer = inline_text_edit_mask_buffers[n_inline_text_edit_items];
  2089.     n_inline_text_edit_items++;
  2090.     i = (wgui_inline_item_text_edit*) item->item;
  2091.     i->max_lines = 0;
  2092.     i->title = title;
  2093.     i->title_icon = title_icon;
  2094.     i->buffer = buffer;
  2095.     i->buffer_size = buffer_size;
  2096.     i->flags = 0;
  2097.     i->input_type = input_type;
  2098.     i->input_ext_type = input_extended_type;
  2099.     item->text_p = i->buffer;
  2100.     item->handler = handle_inline_full_screen_edit;
  2101.     i->edit_complete_callback = UI_dummy_edit_complete_handler;
  2102.     i->custom_setup_function = NULL;
  2103.     i->validation_callback = UI_dummy_validation_function;
  2104.     if ((t == INPUT_TYPE_NUMERIC_PASSWORD) || (t == INPUT_TYPE_ALPHANUMERIC_PASSWORD) ||
  2105.         (t == INPUT_TYPE_SAT_NUMERIC_PASSWORD))
  2106.     {
  2107.         inline_edit_prepare_mask_buffer(buffer, mask_buffer);
  2108.         i->mask_buffer = mask_buffer;
  2109.         item->text_p = mask_buffer;
  2110.     }
  2111.     /* UCS2_count==-1 means this field hasn't been edited */
  2112.     i->UCS2_count = -1;
  2113. }
  2114. /*****************************************************************************
  2115.  * FUNCTION
  2116.  *  ReConfigureInlineItemFullScreenEdit
  2117.  * DESCRIPTION
  2118.  *  
  2119.  * PARAMETERS
  2120.  *  item            [?]         
  2121.  *  title           [IN]        
  2122.  *  title_icon      [IN]        
  2123.  *  buffer          [?]         
  2124.  *  buffer_size     [IN]        
  2125.  *  input_type      [IN]        
  2126.  * RETURNS
  2127.  *  void
  2128.  *****************************************************************************/
  2129. void ReConfigureInlineItemFullScreenEdit(
  2130.         InlineItem *item,
  2131.         U16 title,
  2132.         U16 title_icon,
  2133.         U8 *buffer,
  2134.         S32 buffer_size,
  2135.         S16 input_type)
  2136. {
  2137.     /*----------------------------------------------------------------*/
  2138.     /* Local Variables                                                */
  2139.     /*----------------------------------------------------------------*/
  2140.     wgui_inline_item_text_edit *i;
  2141.     UI_buffer_type mask_buffer;
  2142.     S16 t = input_type & INPUT_TYPE_MASK;
  2143.     /*----------------------------------------------------------------*/
  2144.     /* Code Body                                                      */
  2145.     /*----------------------------------------------------------------*/
  2146.     if ((item->flags & 0xff) != INLINE_ITEM_TYPE_FULL_SCREEN_EDIT)
  2147.     {
  2148.         return;
  2149.     }
  2150.     i = (wgui_inline_item_text_edit*) item->item;
  2151.     mask_buffer = i->mask_buffer;
  2152.     i->max_lines = 0;
  2153.     i->title = title;
  2154.     i->title_icon = title_icon;
  2155.     i->buffer = buffer;
  2156.     i->buffer_size = buffer_size;
  2157.     i->flags = 0;
  2158.     i->input_type = input_type;
  2159.     item->text_p = i->buffer;
  2160.     i->edit_complete_callback = UI_dummy_edit_complete_handler;
  2161.     i->custom_setup_function = NULL;
  2162.     if ((t == INPUT_TYPE_NUMERIC_PASSWORD) || (t == INPUT_TYPE_ALPHANUMERIC_PASSWORD) ||
  2163.         (t == INPUT_TYPE_SAT_NUMERIC_PASSWORD))
  2164.     {
  2165.         inline_edit_prepare_mask_buffer(buffer, mask_buffer);
  2166.         i->mask_buffer = mask_buffer;
  2167.         item->text_p = mask_buffer;
  2168.     }
  2169. }
  2170. /*****************************************************************************
  2171.  * FUNCTION
  2172.  *  SetInlineFullScreenEditCustomFunction
  2173.  * DESCRIPTION
  2174.  *  
  2175.  * PARAMETERS
  2176.  *  item        [?]         
  2177.  *  f           [IN]        
  2178.  * RETURNS
  2179.  *  void
  2180.  *****************************************************************************/
  2181. void SetInlineFullScreenEditCustomFunction(InlineItem *item, void (*f) (void))
  2182. {
  2183.     /*----------------------------------------------------------------*/
  2184.     /* Local Variables                                                */
  2185.     /*----------------------------------------------------------------*/
  2186.     wgui_inline_item_text_edit *i = (wgui_inline_item_text_edit*) item->item;
  2187.     /*----------------------------------------------------------------*/
  2188.     /* Code Body                                                      */
  2189.     /*----------------------------------------------------------------*/
  2190.     i->custom_setup_function = f;
  2191. }
  2192. /*****************************************************************************
  2193.  * FUNCTION
  2194.  *  RegisterInlineFullScreenEditCompleteHandler
  2195.  * DESCRIPTION
  2196.  *  
  2197.  * PARAMETERS
  2198.  *  item        [?]         
  2199.  *  f           [IN]        
  2200.  * RETURNS
  2201.  *  void
  2202.  *****************************************************************************/
  2203. void RegisterInlineFullScreenEditCompleteHandler(InlineItem *item, void (*f) (U8 *string, S32 buffer_size))
  2204. {
  2205.     /*----------------------------------------------------------------*/
  2206.     /* Local Variables                                                */
  2207.     /*----------------------------------------------------------------*/
  2208.     wgui_inline_item_text_edit *i;
  2209.     /*----------------------------------------------------------------*/
  2210.     /* Code Body                                                      */
  2211.     /*----------------------------------------------------------------*/
  2212.     i = (wgui_inline_item_text_edit*) item->item;
  2213.     if (f != NULL)
  2214.     {
  2215.         i->edit_complete_callback = f;
  2216.     }
  2217. }
  2218. /*****************************************************************************
  2219.  * FUNCTION
  2220.  *  RegisterInlineFullScreenEditValidationFunction
  2221.  * DESCRIPTION
  2222.  *  
  2223.  * PARAMETERS
  2224.  *  item        [?]         
  2225.  *  f           [IN]        
  2226.  * RETURNS
  2227.  *  void
  2228.  *****************************************************************************/
  2229. void RegisterInlineFullScreenEditValidationFunction(
  2230.         InlineItem *item,
  2231.         void (*f) (U8 *buffer, U8 *cursor, S32 text_length))
  2232. {
  2233.     /*----------------------------------------------------------------*/
  2234.     /* Local Variables                                                */
  2235.     /*----------------------------------------------------------------*/
  2236.     wgui_inline_item_text_edit *i;
  2237.     /*----------------------------------------------------------------*/
  2238.     /* Code Body                                                      */
  2239.     /*----------------------------------------------------------------*/
  2240.     i = (wgui_inline_item_text_edit*) item->item;
  2241.     if (f != NULL)
  2242.     {
  2243.         i->validation_callback = f;
  2244.     }
  2245. }
  2246. /*----------------------------------------------------------------------------
  2247.    Text menu items used for inline select
  2248. ----------------------------------------------------------------------------*/
  2249. #define  MAX_INLINE_SELECT_MENU_ITEMS  60
  2250. fixed_text_menuitem MMI_inline_select_item_common_data;
  2251. fixed_text_menuitem_type MMI_inline_select_items[MAX_INLINE_SELECT_MENU_ITEMS];
  2252. void *MMI_inline_select_items_p[MAX_INLINE_SELECT_MENU_ITEMS];
  2253. S32 *inline_select_menu_n_items;
  2254. horizontal_select MMI_inline_select_menu;
  2255. /* Temporary images used by Inline select menu  */
  2256. const U8 inline_select_left_arrow_image[] = 
  2257. {
  2258.     0x04, 0x01, 0x6F, 0x00, 0x00, 0x00,
  2259.     0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0C, 0x0E, 0x00, 0x00, 0x00,
  2260.     0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x00, 0x00, 0x00, 0x00, 0x34, 0x12, 0x34, 0x12,
  2261.     0x34, 0x12, 0x34, 0x12, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12,
  2262.     0x00, 0x00, 0xF8, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x34, 0x12, 0x34, 0x12, 0x00, 0x00, 0xF8, 0x00,
  2263.     0xF8, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x00, 0x00, 0xF8, 0x00,
  2264.     0xF8, 0x00, 0x00, 0x00, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x00, 0x00, 0xF8, 0x00,
  2265.     0x00, 0x00, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x00, 0x00, 0x00, 0x00,
  2266.     0x34, 0x12,
  2267. };
  2268. const U8 inline_select_right_arrow_image[] = 
  2269. {
  2270.     0x04, 0x01, 0x6F, 0x00, 0x00, 0x00,
  2271.     0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0C, 0x0E, 0x00, 0x00, 0x00,
  2272.     0x34, 0x12, 0x00, 0x00, 0x00, 0x00, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12,
  2273.     0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x00, 0x00,
  2274.     0xF8, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x00, 0x00, 0xF8, 0x00,
  2275.     0xF8, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x34, 0x12, 0x34, 0x12, 0x00, 0x00, 0xF8, 0x00, 0xF8, 0x00,
  2276.     0x00, 0x00, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x34, 0x12,
  2277.     0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x00, 0x00, 0x00, 0x00, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12,
  2278.     0x34, 0x12,
  2279. };
  2280. /*****************************************************************************
  2281.  * FUNCTION
  2282.  *  wgui_show_inline_select_arrow
  2283.  * DESCRIPTION
  2284.  *  
  2285.  * PARAMETERS
  2286.  *  x1          [IN]        
  2287.  *  y1          [IN]        
  2288.  *  iwidth      [IN]        
  2289.  *  iheight     [IN]        
  2290.  *  item        [?]         
  2291.  * RETURNS
  2292.  *  void
  2293.  *****************************************************************************/
  2294. void wgui_show_inline_select_arrow(S32 x1, S32 y1, S32 iwidth, S32 iheight, wgui_inline_item *item)
  2295. {
  2296.     /*----------------------------------------------------------------*/
  2297.     /* Local Variables                                                */
  2298.     /*----------------------------------------------------------------*/
  2299.     /* START TARUN PMT 20041016 : For unwanted arrow images */
  2300.     fixed_icontext_menuitem_type *t = (fixed_icontext_menuitem_type*) item;
  2301.     /*----------------------------------------------------------------*/
  2302.     /* Code Body                                                      */
  2303.     /*----------------------------------------------------------------*/
  2304.     if (t->flags & UI_MENUITEM_STATE_FOCUSSED)
  2305.     {
  2306.         draw_image_text_control(
  2307.             NULL,
  2308.             x1,
  2309.             y1,
  2310.             iwidth,
  2311.             iheight,
  2312.             item->side_img,
  2313.             (PU8) GetImage(IMG_H_SELECT_LEFT),
  2314.             (PU8) GetImage(IMG_H_SELECT_RIGHT),
  2315.             item->text_p,
  2316.             0);
  2317.     }
  2318.     else
  2319.     {
  2320.         /* 20051012 HIMANSHU START INLINE SELECT */
  2321.         /* show the background before showing the inline select item, in case of
  2322.            default text effect is enabled. */
  2323.     #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
  2324.         if (IsInlineItemDefaultTextEnable())
  2325.         {
  2326.             inline_item_default_text_show_background((x1 - 1), y1, (x1 - 1) + (iwidth - 1), y1 + iheight - 1);
  2327.         }
  2328.     #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */ 
  2329.         /* 20051012 HIMANSHU END INLINE SELECT */
  2330.         draw_image_text_control(NULL, x1, y1, iwidth, iheight, item->side_img, NULL, NULL, item->text_p, 0);
  2331.     }
  2332.     /* END TARUN PMT 20041016 */
  2333. }
  2334. /*****************************************************************************
  2335.  * FUNCTION
  2336.  *  initialize_inline_select_menu_items
  2337.  * DESCRIPTION
  2338.  *  
  2339.  * PARAMETERS
  2340.  *  x                       [IN]        
  2341.  *  y                       [IN]        
  2342.  *  width                   [IN]        
  2343.  *  height                  [IN]        
  2344.  *  n_items                 [IN]        
  2345.  *  list_of_items           [IN]        
  2346.  *  highlighted_item        [?]         
  2347.  *  f                       [IN]        
  2348.  * RETURNS
  2349.  *  void
  2350.  *****************************************************************************/
  2351. void initialize_inline_select_menu_items(
  2352.         S32 x,
  2353.         S32 y,
  2354.         S32 width,
  2355.         S32 height,
  2356.         S32 n_items,
  2357.         U8 **list_of_items,
  2358.         S32 *highlighted_item,
  2359.         void (*f) (S32 item_index))
  2360. {
  2361.     /*----------------------------------------------------------------*/
  2362.     /* Local Variables                                                */
  2363.     /*----------------------------------------------------------------*/
  2364.     S32 i;
  2365.     UI_fixed_text_menuitem_theme *saved_themedata1 = current_fixed_text_menuitem_theme;
  2366.     /*----------------------------------------------------------------*/
  2367.     /* Code Body                                                      */
  2368.     /*----------------------------------------------------------------*/
  2369.     current_fixed_text_menuitem_theme = &wgui_inline_select_fixed_text_menuitem_theme;
  2370.     gui_create_fixed_text_menuitem(&MMI_inline_select_item_common_data, width, height);
  2371.     gui_fixed_text_menuitem_set_text_position(&MMI_inline_select_item_common_data, 2, 0);
  2372.     MMI_inline_select_item_common_data.flags |= UI_MENUITEM_CENTER_TEXT_Y;
  2373. #if(UI_TEXT_MENUITEM_SCROLL_TYPE == UI_TEXT_MENUITEM_SCROLL_TYPE_MARQUEE)
  2374.     MMI_inline_select_item_common_data.flags |= UI_MENUITEM_MARQUEE_SCROLL;
  2375. #elif(UI_TEXT_MENUITEM_SCROLL_TYPE==UI_TEXT_MENUITEM_SCROLL_TYPE_TWO_DIRECTION)
  2376.     MMI_inline_select_item_common_data.flags |= UI_MENUITEM_TWO_DIRECTION_SCROLL;
  2377. #endif 
  2378.     wgui_text_menuitem_reset_scrolling = gui_fixed_text_menuitem_stop_scroll;
  2379.     wgui_text_menuitem_restart_scrolling = gui_fixed_text_menuitem_start_scroll;
  2380.     for (i = 0; i < n_items; i++)
  2381.     {
  2382.         MMI_inline_select_items[i].flags = UI_MENUITEM_CENTER_TEXT_X;
  2383.         MMI_inline_select_items[i].text = (UI_string_type) list_of_items[i];
  2384.         MMI_inline_select_items_p[i] = (void*)&MMI_inline_select_items[i];
  2385.     }
  2386.     temp_inline_select_menu_theme.background_filler = MMI_fixed_icontext_menuitem.focussed_filler;
  2387.     current_horizontal_select_theme = &temp_inline_select_menu_theme;
  2388.     /* PMT VIKAS START 20050817 */
  2389. #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
  2390.     if (line_draw)
  2391.     {
  2392.         if (r2lMMIFlag)
  2393.             /* for gap of arrow icon from the grid */
  2394.         {
  2395.             gui_create_horizontal_select(&MMI_inline_select_menu, x + 1, y + 1, width - 5, height - 1);
  2396.         }
  2397.         else
  2398.         {
  2399.             gui_create_horizontal_select(&MMI_inline_select_menu, x + 1, y + 1, width - 2, height - 1);
  2400.         }
  2401.     }
  2402.     else
  2403. #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */ 
  2404.         /* PMT VIKAS END 20050817 */
  2405.         gui_create_horizontal_select(&MMI_inline_select_menu, x, y, width, height);
  2406.     MMI_inline_select_menu.flags |= UI_LIST_MENU_LOOP;
  2407.     gui_set_horizontal_select_common_item_data(&MMI_inline_select_menu, (void*)&MMI_inline_select_item_common_data);
  2408.     gui_set_horizontal_select_item_functions(
  2409.         &MMI_inline_select_menu,
  2410.         gui_show_fixed_text_menuitem,
  2411.         gui_measure_fixed_text_menuitem,
  2412.         gui_highlight_fixed_text_menuitem,
  2413.         gui_remove_highlight_fixed_text_menuitem,
  2414.         UI_fixed_menuitem_dummy_hide_function);
  2415.     gui_set_horizontal_select_images(
  2416.         &MMI_inline_select_menu,
  2417.         (U8*) GetImage(IMG_H_SELECT_LEFT),
  2418.         (U8*) GetImage(IMG_H_SELECT_RIGHT));
  2419.     if (f != NULL)
  2420.     {
  2421.         MMI_inline_select_menu.item_highlighted = f;
  2422.     }
  2423.     /* PMT VIKAS START 20050817 */
  2424. #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
  2425.     if (line_draw && r2lMMIFlag)
  2426.     {
  2427.         width = MMI_inline_select_menu.ix2 - MMI_inline_select_menu.ix1 - 4;
  2428.     }
  2429.     else
  2430. #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */ 
  2431.         /* PMT VIKAS END 20050817 */
  2432.         width = MMI_inline_select_menu.ix2 - MMI_inline_select_menu.ix1;
  2433.     height = MMI_inline_select_menu.iy2 - MMI_inline_select_menu.iy1;
  2434.     gui_resize_fixed_text_menuitem(&MMI_inline_select_item_common_data, width, height);
  2435.     MMI_inline_select_menu.n_items = n_items;
  2436.     if (highlighted_item == NULL)
  2437.     {
  2438.         MMI_inline_select_menu.highlighted_item = 0;
  2439.     }
  2440.     else
  2441.     {
  2442.         MMI_inline_select_menu.highlighted_item = *highlighted_item;
  2443.     }
  2444.     if (MMI_inline_select_menu.highlighted_item > (MMI_inline_select_menu.n_items - 1))
  2445.     {
  2446.         MMI_inline_select_menu.highlighted_item = MMI_inline_select_menu.n_items - 1;
  2447.     }
  2448.     if (MMI_inline_select_menu.highlighted_item < 0)
  2449.     {
  2450.         MMI_inline_select_menu.highlighted_item = 0;
  2451.     }
  2452.     MMI_inline_select_menu.items = (void **)MMI_inline_select_items_p;
  2453.     MMI_inline_select_menu.item_highlight_function(
  2454.                             MMI_inline_select_menu. items[MMI_inline_select_menu.highlighted_item],
  2455.                             MMI_inline_select_menu.common_item_data);
  2456.     current_fixed_text_menuitem_theme = saved_themedata1;
  2457. }
  2458. /*****************************************************************************
  2459.  * FUNCTION
  2460.  *  show_inline_select_menu
  2461.  * DESCRIPTION
  2462.  *  
  2463.  * PARAMETERS
  2464.  *  void
  2465.  * RETURNS
  2466.  *  void
  2467.  *****************************************************************************/
  2468. void show_inline_select_menu(void)
  2469. {
  2470.     /*----------------------------------------------------------------*/
  2471.     /* Local Variables                                                */
  2472.     /*----------------------------------------------------------------*/
  2473.     S32 x = 0, width = 0, height = 0, img_y1 = 0;
  2474.     PU8 image;
  2475.     UI_fixed_text_menuitem_theme *saved_themedata1 = current_fixed_text_menuitem_theme;
  2476.     /*----------------------------------------------------------------*/
  2477.     /* Code Body                                                      */
  2478.     /*----------------------------------------------------------------*/
  2479.     current_fixed_text_menuitem_theme = &wgui_inline_select_fixed_text_menuitem_theme;
  2480.     gui_set_fixed_text_menuitem_current_theme(&MMI_inline_select_item_common_data);
  2481.     temp_inline_select_menu_theme.background_filler = MMI_fixed_icontext_menuitem.focussed_filler;
  2482.     current_horizontal_select_theme = &temp_inline_select_menu_theme;
  2483.     gui_set_horizontal_select_current_theme(&MMI_inline_select_menu);
  2484.     /* PMT VIKAS START 20050527 */
  2485. #ifdef __MMI_UI_TRANSPARENT_EFFECT__
  2486.     //PMT VIKAS START 20050630  
  2487.     // This function call should be removed      
  2488.     // gui_inline_edit_disable_transparent_effect(&MMI_inline_select_menu);  // Disable for horizontel select
  2489.     //PMT VIKAS END 20050630
  2490. #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */ 
  2491.     //PMT VIKAS END
  2492.     //MTK Leo add, 040229
  2493.     MMI_inline_select_item_common_data.text_font = &MMI_medium_font;
  2494.     gui_show_horizontal_select(&MMI_inline_select_menu);
  2495.     if (wgui_inline_items[wgui_inline_item_highlighted_index].show_img_flag == TRUE)
  2496.     {
  2497.         image = wgui_inline_items[wgui_inline_item_highlighted_index].side_img;
  2498.         if (image)
  2499.         {
  2500.             gui_measure_image(image, &width, &height);
  2501.             img_y1 = (MMI_INLINE_EDIT_MENUITEM_HEIGHT >> 1) - (height >> 1);
  2502.             if (r2lMMIFlag)
  2503.             {
  2504.                 gui_show_transparent_image(
  2505.                     MMI_inline_select_menu.x + MMI_inline_select_menu.width + 2,
  2506.                     (MMI_inline_select_menu.y + img_y1),
  2507.                     image,
  2508.                     0);
  2509.             }
  2510.             else
  2511.             {
  2512.                 gui_show_transparent_image(2, (MMI_inline_select_menu.y + img_y1), image, 0);
  2513.             }
  2514.             x = 2;
  2515.         }
  2516.     }
  2517.     else
  2518.     {
  2519.         x = MMI_inline_select_menu.x;
  2520.     }
  2521.     gdi_layer_blt_previous(
  2522.         MMI_inline_select_menu.x,
  2523.         MMI_inline_select_menu.y,
  2524.         MMI_inline_select_menu.x + MMI_inline_select_menu.width - 1,
  2525.         MMI_inline_select_menu.y + MMI_inline_select_menu.height - 1);
  2526.     current_fixed_text_menuitem_theme = saved_themedata1;
  2527.     UI_UNUSED_PARAMETER(x);
  2528. }
  2529. /*****************************************************************************
  2530.  * FUNCTION
  2531.  *  inline_select_menu_previous_item
  2532.  * DESCRIPTION
  2533.  *  
  2534.  * PARAMETERS
  2535.  *  void
  2536.  * RETURNS
  2537.  *  void
  2538.  *****************************************************************************/
  2539. void inline_select_menu_previous_item(void)
  2540. {
  2541.     /*----------------------------------------------------------------*/
  2542.     /* Local Variables                                                */
  2543.     /*----------------------------------------------------------------*/
  2544.     /*----------------------------------------------------------------*/
  2545.     /* Code Body                                                      */
  2546.     /*----------------------------------------------------------------*/
  2547.     gui_horizontal_select_goto_previous_item(&MMI_inline_select_menu);
  2548.     show_inline_select_menu();
  2549.     set_wgui_inline_list_menu_changed();
  2550. }
  2551. /*****************************************************************************
  2552.  * FUNCTION
  2553.  *  inline_select_menu_next_item
  2554.  * DESCRIPTION
  2555.  *  
  2556.  * PARAMETERS
  2557.  *  void
  2558.  * RETURNS
  2559.  *  void
  2560.  *****************************************************************************/
  2561. void inline_select_menu_next_item(void)
  2562. {
  2563.     /*----------------------------------------------------------------*/
  2564.     /* Local Variables                                                */
  2565.     /*----------------------------------------------------------------*/
  2566.     /*----------------------------------------------------------------*/
  2567.     /* Code Body                                                      */
  2568.     /*----------------------------------------------------------------*/
  2569.     gui_horizontal_select_goto_next_item(&MMI_inline_select_menu);
  2570.     show_inline_select_menu();
  2571.     set_wgui_inline_list_menu_changed();
  2572. }
  2573. /*****************************************************************************
  2574.  * FUNCTION
  2575.  *  initialize_inline_user_defined_select_menu_items
  2576.  * DESCRIPTION
  2577.  *  
  2578.  * PARAMETERS
  2579.  *  x           [IN]        
  2580.  *  y           [IN]        
  2581.  *  width       [IN]        
  2582.  *  height      [IN]        
  2583.  *  text        [?]         
  2584.  * RETURNS
  2585.  *  void
  2586.  *****************************************************************************/
  2587. void initialize_inline_user_defined_select_menu_items(S32 x, S32 y, S32 width, S32 height, U8 *text)
  2588. {
  2589.     /*----------------------------------------------------------------*/
  2590.     /* Local Variables                                                */
  2591.     /*----------------------------------------------------------------*/
  2592.     UI_fixed_text_menuitem_theme *saved_themedata1 = current_fixed_text_menuitem_theme;
  2593.     /*----------------------------------------------------------------*/
  2594.     /* Code Body                                                      */
  2595.     /*----------------------------------------------------------------*/
  2596.     current_fixed_text_menuitem_theme = &wgui_inline_select_fixed_text_menuitem_theme;
  2597.     gui_create_fixed_text_menuitem(&MMI_inline_select_item_common_data, width, height);
  2598.     gui_fixed_text_menuitem_set_text_position(&MMI_inline_select_item_common_data, 2, 0);
  2599.     MMI_inline_select_item_common_data.flags |= UI_MENUITEM_CENTER_TEXT_Y;
  2600. #if(UI_TEXT_MENUITEM_SCROLL_TYPE == UI_TEXT_MENUITEM_SCROLL_TYPE_MARQUEE)
  2601.     MMI_inline_select_item_common_data.flags |= UI_MENUITEM_MARQUEE_SCROLL;
  2602. #elif(UI_TEXT_MENUITEM_SCROLL_TYPE==UI_TEXT_MENUITEM_SCROLL_TYPE_TWO_DIRECTION)
  2603.     MMI_inline_select_item_common_data.flags |= UI_MENUITEM_TWO_DIRECTION_SCROLL;
  2604. #endif 
  2605.     wgui_text_menuitem_reset_scrolling = gui_fixed_text_menuitem_stop_scroll;
  2606.     wgui_text_menuitem_restart_scrolling = gui_fixed_text_menuitem_start_scroll;
  2607.     MMI_inline_select_items[0].flags = UI_MENUITEM_CENTER_TEXT_X;
  2608.     MMI_inline_select_items[0].text = (UI_string_type) text;
  2609.     MMI_inline_select_items_p[0] = (void*)&MMI_inline_select_items[0];
  2610.     temp_inline_select_menu_theme.background_filler = MMI_fixed_icontext_menuitem.focussed_filler;
  2611.     current_horizontal_select_theme = &temp_inline_select_menu_theme;
  2612.     gui_create_horizontal_select(&MMI_inline_select_menu, x, y, width, height);
  2613.     MMI_inline_select_menu.flags |= UI_LIST_MENU_LOOP;
  2614.     gui_set_horizontal_select_common_item_data(&MMI_inline_select_menu, (void*)&MMI_inline_select_item_common_data);
  2615.     gui_set_horizontal_select_item_functions(
  2616.         &MMI_inline_select_menu,
  2617.         gui_show_fixed_text_menuitem,
  2618.         gui_measure_fixed_text_menuitem,
  2619.         gui_highlight_fixed_text_menuitem,
  2620.         gui_remove_highlight_fixed_text_menuitem,
  2621.         UI_fixed_menuitem_dummy_hide_function);
  2622.     gui_set_horizontal_select_images(
  2623.         &MMI_inline_select_menu,
  2624.         (U8*) GetImage(IMG_H_SELECT_LEFT),
  2625.         (U8*) GetImage(IMG_H_SELECT_RIGHT));
  2626.     width = MMI_inline_select_menu.ix2 - MMI_inline_select_menu.ix1;
  2627.     height = MMI_inline_select_menu.iy2 - MMI_inline_select_menu.iy1;
  2628.     gui_resize_fixed_text_menuitem(&MMI_inline_select_item_common_data, width, height);
  2629.     MMI_inline_select_menu.n_items = 1;
  2630.     MMI_inline_select_menu.highlighted_item = 0;
  2631.     MMI_inline_select_menu.items = (void **)MMI_inline_select_items_p;
  2632.     MMI_inline_select_menu.item_highlight_function(
  2633.                             MMI_inline_select_menu. items[MMI_inline_select_menu.highlighted_item],
  2634.                             MMI_inline_select_menu.common_item_data);
  2635.     current_fixed_text_menuitem_theme = saved_themedata1;
  2636. }
  2637. /*****************************************************************************
  2638.  * FUNCTION
  2639.  *  show_inline_user_defined_select_menu
  2640.  * DESCRIPTION
  2641.  *  
  2642.  * PARAMETERS
  2643.  *  void
  2644.  * RETURNS
  2645.  *  void
  2646.  *****************************************************************************/
  2647. void show_inline_user_defined_select_menu(void)
  2648. {
  2649.     /*----------------------------------------------------------------*/
  2650.     /* Local Variables                                                */
  2651.     /*----------------------------------------------------------------*/
  2652.     UI_fixed_text_menuitem_theme *saved_themedata1 = current_fixed_text_menuitem_theme;
  2653.     /*----------------------------------------------------------------*/
  2654.     /* Code Body                                                      */
  2655.     /*----------------------------------------------------------------*/
  2656.     current_fixed_text_menuitem_theme = &wgui_inline_select_fixed_text_menuitem_theme;
  2657.     gui_set_fixed_text_menuitem_current_theme(&MMI_inline_select_item_common_data);
  2658.     temp_inline_select_menu_theme.background_filler = MMI_fixed_icontext_menuitem.focussed_filler;
  2659.     current_horizontal_select_theme = &temp_inline_select_menu_theme;
  2660.     gui_set_horizontal_select_current_theme(&MMI_inline_select_menu);
  2661.     gui_show_horizontal_select(&MMI_inline_select_menu);
  2662.     gdi_layer_blt_previous(
  2663.         MMI_inline_select_menu.x,
  2664.         MMI_inline_select_menu.y,
  2665.         MMI_inline_select_menu.x + MMI_inline_select_menu.width - 1,
  2666.         MMI_inline_select_menu.y + MMI_inline_select_menu.height - 1);
  2667.     current_fixed_text_menuitem_theme = saved_themedata1;
  2668. }
  2669. /*----------------------------------------------------------------------------
  2670.    Inline select strings implementation
  2671. ----------------------------------------------------------------------------*/
  2672. #ifdef __MMI_DOWNLOADABLE_THEMES_SUPPORT__
  2673. #define MAX_INLINE_SELECT_ITEMS        25       /* Made changes by Ritesh */
  2674. #else 
  2675. #define MAX_INLINE_SELECT_ITEMS        10
  2676. #endif 
  2677. extern S32 UI_text_menuitem_scroll_time;    /* Robin Add, 1102 */
  2678. S32 n_inline_select_items = 0;
  2679. wgui_inline_item_select wgui_inline_select_items[MAX_INLINE_SELECT_ITEMS];
  2680. wgui_inline_item_select *current_wgui_inline_select_item = NULL;
  2681. S32 *current_wgui_inline_select_highlighted_item = NULL;
  2682. U8 **current_wgui_inline_select_text_p = NULL;
  2683. /*****************************************************************************
  2684.  * FUNCTION
  2685.  *  clear_inline_select_menu_keys
  2686.  * DESCRIPTION
  2687.  *  
  2688.  * PARAMETERS
  2689.  *  void
  2690.  * RETURNS
  2691.  *  void
  2692.  *****************************************************************************/
  2693. void clear_inline_select_menu_keys(void)
  2694. {
  2695.     /*----------------------------------------------------------------*/
  2696.     /* Local Variables                                                */
  2697.     /*----------------------------------------------------------------*/
  2698.     /*----------------------------------------------------------------*/
  2699.     /* Code Body                                                      */
  2700.     /*----------------------------------------------------------------*/
  2701.     ClearKeyHandler(KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  2702.     ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2703.     clear_keyboard_key_handler();
  2704.     clear_inline_item_keys = UI_dummy_function;
  2705.     /* Robin Add, 1102 */
  2706.     UI_text_menuitem_scroll_time = UI_TEXT_MENUITEM_SCROLL_TIME;
  2707. }
  2708. /*****************************************************************************
  2709.  * FUNCTION
  2710.  *  inline_select_menu_change_complete
  2711.  * DESCRIPTION
  2712.  *  
  2713.  * PARAMETERS
  2714.  *  void
  2715.  * RETURNS
  2716.  *  void
  2717.  *****************************************************************************/
  2718. void inline_select_menu_change_complete(void)
  2719. {
  2720.     /*----------------------------------------------------------------*/
  2721.     /* Local Variables                                                */
  2722.     /*----------------------------------------------------------------*/
  2723.     /*----------------------------------------------------------------*/
  2724.     /* Code Body                                                      */
  2725.     /*----------------------------------------------------------------*/
  2726.     wgui_text_menuitem_reset_scrolling();
  2727.     wgui_text_menuitem_reset_scrolling = gui_fixed_icontext_menuitem_stop_scroll;
  2728.     wgui_text_menuitem_restart_scrolling = gui_fixed_icontext_menuitem_start_scroll;
  2729.     clear_inline_select_menu_keys();
  2730.     *(current_wgui_inline_select_item->highlighted_item) = MMI_inline_select_menu.highlighted_item;
  2731.     *current_wgui_inline_select_text_p =
  2732.         current_wgui_inline_select_item->list_of_strings[*(current_wgui_inline_select_item->highlighted_item)];
  2733.     MMI_fixed_icontext_menuitems[wgui_inline_item_highlighted_index].item_text =
  2734.         (UI_string_type) current_wgui_inline_select_item->
  2735.         list_of_strings[*(current_wgui_inline_select_item->highlighted_item)];
  2736.     *current_wgui_inline_select_highlighted_item = MMI_inline_select_menu.highlighted_item;
  2737.     redraw_current_inline_item = UI_dummy_function;
  2738. #ifdef __MMI_TOUCH_SCREEN__
  2739.     wgui_current_inline_item_pen_function = UI_dummy_inline_item_pen_function;
  2740. #endif 
  2741.     current_wgui_inline_select_highlighted_item = NULL;
  2742.     wgui_inline_item_handled = 0;
  2743.     /* START TARUN PMT 20041016 : For unwanted arrow images */
  2744.     MMI_inline_select_menu.left_arrow_image = NULL;
  2745.     MMI_inline_select_menu.right_arrow_image = NULL;
  2746.     /* END TARUN PMT 20041016 */
  2747.     complete_inline_item_edit = UI_dummy_function;
  2748. }
  2749. /*****************************************************************************
  2750.  * FUNCTION
  2751.  *  inline_select_menu_handle_up_arrow
  2752.  * DESCRIPTION
  2753.  *  
  2754.  * PARAMETERS
  2755.  *  void
  2756.  * RETURNS
  2757.  *  void
  2758.  *****************************************************************************/
  2759. void inline_select_menu_handle_up_arrow(void)
  2760. {
  2761.     /*----------------------------------------------------------------*/
  2762.     /* Local Variables                                                */
  2763.     /*----------------------------------------------------------------*/
  2764.     /*----------------------------------------------------------------*/
  2765.     /* Code Body                                                      */
  2766.     /*----------------------------------------------------------------*/
  2767.     inline_select_menu_change_complete();
  2768.     inline_fixed_list_goto_previous_item();
  2769. }
  2770. /*****************************************************************************
  2771.  * FUNCTION
  2772.  *  inline_select_menu_handle_down_arrow
  2773.  * DESCRIPTION
  2774.  *  
  2775.  * PARAMETERS
  2776.  *  void
  2777.  * RETURNS
  2778.  *  void
  2779.  *****************************************************************************/
  2780. void inline_select_menu_handle_down_arrow(void)
  2781. {
  2782.     /*----------------------------------------------------------------*/
  2783.     /* Local Variables                                                */
  2784.     /*----------------------------------------------------------------*/
  2785.     /*----------------------------------------------------------------*/
  2786.     /* Code Body                                                      */
  2787.     /*----------------------------------------------------------------*/
  2788.     inline_select_menu_change_complete();
  2789.     inline_fixed_list_goto_next_item();
  2790. }
  2791. /*****************************************************************************
  2792.  * FUNCTION
  2793.  *  inline_select_menu_keyboard_key_handler
  2794.  * DESCRIPTION
  2795.  *  
  2796.  * PARAMETERS
  2797.  *  vkey_code       [IN]        
  2798.  *  key_state       [IN]        
  2799.  * RETURNS
  2800.  *  void
  2801.  *****************************************************************************/
  2802. void inline_select_menu_keyboard_key_handler(S32 vkey_code, S32 key_state)
  2803. {
  2804. #if(MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32)
  2805.     /*----------------------------------------------------------------*/
  2806.     /* Local Variables                                                */
  2807.     /*----------------------------------------------------------------*/
  2808.     /*----------------------------------------------------------------*/
  2809.     /* Code Body                                                      */
  2810.     /*----------------------------------------------------------------*/
  2811.     if (key_state)
  2812.     {
  2813.         switch (vkey_code)
  2814.         {
  2815.             case 37:
  2816.                 inline_select_menu_previous_item();
  2817.                 break;
  2818.             case 38:
  2819.                 inline_select_menu_handle_up_arrow();
  2820.                 break;
  2821.             case 39:
  2822.                 inline_select_menu_next_item();
  2823.                 break;
  2824.             case 40:
  2825.                 inline_select_menu_handle_down_arrow();
  2826.                 break;
  2827.         }
  2828.     }
  2829. #else /* (MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32) */ 
  2830.     UI_UNUSED_PARAMETER(vkey_code);
  2831.     UI_UNUSED_PARAMETER(key_state);
  2832. #endif /* (MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32) */ 
  2833. }
  2834. /*****************************************************************************
  2835.  * FUNCTION
  2836.  *  register_inline_select_menu_keys
  2837.  * DESCRIPTION
  2838.  *  
  2839.  * PARAMETERS
  2840.  *  void
  2841.  * RETURNS
  2842.  *  void
  2843.  *****************************************************************************/
  2844. void register_inline_select_menu_keys(void)
  2845. {
  2846.     /*----------------------------------------------------------------*/
  2847.     /* Local Variables                                                */
  2848.     /*----------------------------------------------------------------*/
  2849.     /*----------------------------------------------------------------*/
  2850.     /* Code Body                                                      */
  2851.     /*----------------------------------------------------------------*/
  2852.     SetKeyHandler(inline_select_menu_previous_item, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  2853.     SetKeyHandler(inline_select_menu_next_item, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2854.     SetKeyHandler(inline_select_menu_handle_up_arrow, KEY_UP_ARROW, KEY_EVENT_DOWN);
  2855.     SetKeyHandler(inline_select_menu_handle_down_arrow, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
  2856.     SetKeyHandler(inline_select_menu_handle_up_arrow, KEY_VOL_UP, KEY_EVENT_DOWN);
  2857.     SetKeyHandler(inline_select_menu_handle_down_arrow, KEY_VOL_DOWN, KEY_EVENT_DOWN);
  2858.     register_keyboard_key_handler(inline_select_menu_keyboard_key_handler);
  2859. }
  2860. /*****************************************************************************
  2861.  * FUNCTION
  2862.  *  redraw_inline_select
  2863.  * DESCRIPTION
  2864.  *  
  2865.  * PARAMETERS
  2866.  *  void
  2867.  * RETURNS
  2868.  *  void
  2869.  *****************************************************************************/
  2870. void redraw_inline_select(void)
  2871. {
  2872.     /*----------------------------------------------------------------*/
  2873.     /* Local Variables                                                */
  2874.     /*----------------------------------------------------------------*/
  2875.     /*----------------------------------------------------------------*/
  2876.     /* Code Body                                                      */
  2877.     /*----------------------------------------------------------------*/
  2878.     show_inline_select_menu();
  2879. }
  2880. #ifdef __MMI_TOUCH_SCREEN__
  2881. /*****************************************************************************
  2882.  * FUNCTION
  2883.  *  inline_select_pen_handler
  2884.  * DESCRIPTION
  2885.  *  
  2886.  * PARAMETERS
  2887.  *  pen_event       [IN]        
  2888.  *  x               [IN]        
  2889.  *  y               [IN]        
  2890.  *  item_event      [?]         
  2891.  * RETURNS
  2892.  *  
  2893.  *****************************************************************************/
  2894. BOOL inline_select_pen_handler(mmi_pen_event_type_enum pen_event, S16 x, S16 y, gui_inline_item_pen_enum *item_event)
  2895. {
  2896.     /*----------------------------------------------------------------*/
  2897.     /* Local Variables                                                */
  2898.     /*----------------------------------------------------------------*/
  2899.     BOOL ret;
  2900.     gui_horizontal_select_pen_enum select_event;
  2901.     /*----------------------------------------------------------------*/
  2902.     /* Code Body                                                      */
  2903.     /*----------------------------------------------------------------*/
  2904.     ret = gui_horizontal_select_translate_pen_event(&MMI_inline_select_menu, pen_event, x, y, &select_event);
  2905.     if (ret)
  2906.     {
  2907.         switch (select_event)
  2908.         {
  2909.             case GUI_HORIZONTAL_SELECT_PEN_NONE:
  2910.                 /* Do nothing */
  2911.                 break;
  2912.             case GUI_HORIZONTAL_SELECT_PEN_PREV:
  2913.                 inline_select_menu_previous_item();
  2914.                 break;
  2915.             case GUI_HORIZONTAL_SELECT_PEN_NEXT:
  2916.                 inline_select_menu_next_item();
  2917.                 break;
  2918.             default:
  2919.                 MMI_ASSERT(0);
  2920.         }
  2921.     }
  2922.     *item_event = GUI_INLINE_ITEM_PEN_NONE;
  2923.     return ret;
  2924. }
  2925. #endif /* __MMI_TOUCH_SCREEN__ */ 
  2926. /*****************************************************************************
  2927.  * FUNCTION
  2928.  *  current_inline_select_highlight_handler
  2929.  * DESCRIPTION
  2930.  *  
  2931.  * PARAMETERS
  2932.  *  index       [IN]        
  2933.  * RETURNS
  2934.  *  void
  2935.  *****************************************************************************/
  2936. void current_inline_select_highlight_handler(S32 index)
  2937. {
  2938.     /*----------------------------------------------------------------*/
  2939.     /* Local Variables                                                */
  2940.     /*----------------------------------------------------------------*/
  2941.     /*----------------------------------------------------------------*/
  2942.     /* Code Body                                                      */
  2943.     /*----------------------------------------------------------------*/
  2944.     *current_wgui_inline_select_highlighted_item = index;
  2945.     current_wgui_inline_select_item->item_highlighted(index);
  2946. }
  2947. /*****************************************************************************
  2948.  * FUNCTION
  2949.  *  handle_inline_select
  2950.  * DESCRIPTION
  2951.  *  
  2952.  * PARAMETERS
  2953.  *  x                   [IN]        
  2954.  *  y                   [IN]        
  2955.  *  width               [IN]        
  2956.  *  height              [IN]        
  2957.  *  key_code            [IN]        
  2958.  *  key_event           [IN]        
  2959.  *  text_p              [IN]        
  2960.  *  item                [?]         
  2961.  *  flags               [IN]        
  2962.  *  history_buffer      [?]         
  2963.  * RETURNS
  2964.  *  void
  2965.  *****************************************************************************/
  2966. void handle_inline_select(
  2967.         S32 x,
  2968.         S32 y,
  2969.         S32 width,
  2970.         S32 height,
  2971.         S32 key_code,
  2972.         S32 key_event,
  2973.         U8 **text_p,
  2974.         void *item,
  2975.         U32 flags,
  2976.         U8 *history_buffer)
  2977. {
  2978.     /*----------------------------------------------------------------*/
  2979.     /* Local Variables                                                */
  2980.     /*----------------------------------------------------------------*/
  2981.     wgui_inline_item_select *i = (wgui_inline_item_select*) item;
  2982.     S32 xx;
  2983.     /*----------------------------------------------------------------*/
  2984.     /* Code Body                                                      */
  2985.     /*----------------------------------------------------------------*/
  2986.     UI_UNUSED_PARAMETER(key_event);
  2987.     UI_UNUSED_PARAMETER(key_code);
  2988.     UI_UNUSED_PARAMETER(flags);
  2989.     /* Robin Add, 1102 */
  2990.     UI_text_menuitem_scroll_time = 300;
  2991.     /* MTK Elvis for R2L characters */
  2992.     if (!r2lMMIFlag)
  2993.     {
  2994.         if (MMI_fixed_icontext_menuitem.text_x == 2)
  2995.         {
  2996.             xx = -1;