wgui_inline_edit.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:887k
源码类别:
MTK
开发平台:
C/C++
- /*****************************************************************************
- * FUNCTION
- * inline_edit_phone_number_input_numeric_key_handler
- * DESCRIPTION
- *
- * PARAMETERS
- * k [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void inline_edit_phone_number_input_numeric_key_handler(MMI_key_code_type k)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- inline_text_edit_handle_multitap_input_complete(WGUI_INLINE_TEXT_EDIT_MULTITAP_ANY);
- inline_edit_singleline_inputbox_direct_input((UI_character_type) ('0' + k));
- /* MTK Elvis 20031201 */
- #ifdef __MMI_MULTITAP_KEY_0__
- SetKeyHandler(MMI_key_0_down, KEY_0, KEY_EVENT_DOWN);
- SetKeyHandler(MMI_key_0_down, KEY_0, KEY_REPEAT);
- SetKeyHandler(MMI_key_0_up, KEY_0, KEY_EVENT_UP);
- #endif /* __MMI_MULTITAP_KEY_0__ */
- /* MTK end */
- }
- /*****************************************************************************
- * FUNCTION
- * inline_singleline_inputbox_keypad_numeric_handle_star_key_down
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void inline_singleline_inputbox_keypad_numeric_handle_star_key_down(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- inline_edit_singleline_inputbox_direct_input((UI_character_type) '*');
- }
- /*****************************************************************************
- * FUNCTION
- * inline_singleline_inputbox_keypad_numeric_handle_pound_key_down
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void inline_singleline_inputbox_keypad_numeric_handle_pound_key_down(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- inline_edit_singleline_inputbox_direct_input((UI_character_type) '#');
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_inline_singleline_inputbox_decimal_numeric_handle_pound_key_down
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_inline_singleline_inputbox_decimal_numeric_handle_pound_key_down(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- UI_buffer_type p;
- UI_character_type c;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (wgui_inline_singleline_inputbox_decimal_flag)
- {
- UI_editor_play_tone_invalid_data();
- return;
- }
- if (gui_single_line_input_box_test_first_position(&MMI_inline_singleline_inputbox))
- {
- inline_edit_singleline_inputbox_direct_input((UI_character_type) '0');
- }
- inline_edit_singleline_inputbox_direct_input((UI_character_type) '.');
- p = MMI_inline_singleline_inputbox.current_text_p;
- if (p != MMI_inline_singleline_inputbox.text)
- {
- UI_STRING_GET_PREVIOUS_CHARACTER(p, c);
- if (c == (UI_character_type) '.')
- {
- wgui_inline_singleline_inputbox_decimal_flag = 1;
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * inline_text_edit_set_RSK_function
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void inline_text_edit_set_RSK_function(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((current_wgui_inline_item != NULL) && ((current_wgui_inline_item->flags & 0xff) == INLINE_ITEM_TYPE_TEXT_EDIT))
- {
- inline_text_edit_RSK_function = wgui_inline_edit_BACK_function;
- }
- }
- U8 wgui_inline_singleline_inputbox_input_mode_changed = 0;
- U8 wgui_inline_singleline_inputbox_input_type = 0;
- /*****************************************************************************
- * FUNCTION
- * wgui_inline_singleline_inputbox_change_input_mode_multitap_ABC
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_inline_singleline_inputbox_change_input_mode_multitap_ABC(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_inline_singleline_inputbox_input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE;
- wgui_inline_singleline_inputbox_input_mode_changed = 1;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_inline_singleline_inputbox_change_input_mode_multitap_abc
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_inline_singleline_inputbox_change_input_mode_multitap_abc(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_inline_singleline_inputbox_input_type = INPUT_TYPE_ALPHANUMERIC_LOWERCASE;
- wgui_inline_singleline_inputbox_input_mode_changed = 1;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_inline_singleline_inputbox_change_input_mode_multitap_numeric
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_inline_singleline_inputbox_change_input_mode_multitap_numeric(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_inline_singleline_inputbox_input_type = INPUT_TYPE_NUMERIC;
- wgui_inline_singleline_inputbox_input_mode_changed = 1;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_inline_singleline_inputbox_insert_symbol
- * DESCRIPTION
- *
- * PARAMETERS
- * symbol [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_inline_singleline_inputbox_insert_symbol(UI_character_type symbol)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- inline_edit_singleline_inputbox_direct_input(symbol);
- }
- extern void change_input_mode(void);
- /* MTK Elvis for single line input mode change */
- extern void change_singleline_input_mode(void);
- /* MTK end */
- extern void (*inputbox_change_mode) (void);
- /*****************************************************************************
- * FUNCTION
- * wgui_hide_inline_input_method
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_hide_inline_input_method(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- draw_title();
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_display_inline_input_method
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_display_inline_input_method(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 iwidth, iheight, swidth, sheight;
- UI_string_type inputmode_string = (UI_string_type) "";
- stFontAttribute *f = &MMI_small_font;
- color c = *current_MMI_theme->shortcut_indicator_text_color;
- UI_filled_area *bg = current_MMI_theme->shortcut_indicator_background_filler;
- S32 x1, y1, x2, y2, w, h;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_cancel_timer(wgui_display_inline_input_method);
- gui_cancel_timer(wgui_hide_inline_input_method);
- if (wgui_disable_inline_input_method_hints)
- {
- return;
- }
- gdi_layer_lock_frame_buffer();
- draw_title();
- gdi_layer_unlock_frame_buffer();
- switch (MMI_current_input_mode)
- {
- case 0:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_ABC_STRING_ID);
- wgui_inputbox_information_icon = get_image(WGUI_INPUT_INFORMATION_ICON1);
- break;
- case 1:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_abc_STRING_ID);
- wgui_inputbox_information_icon = get_image(WGUI_INPUT_INFORMATION_ICON1);
- break;
- case 2:
- inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_123_STRING_ID);
- wgui_inputbox_information_icon = get_image(WGUI_INPUT_INFORMATION_ICON1);
- break;
- default:
- wgui_inputbox_information_icon = NULL;
- break;
- }
- gui_measure_image(wgui_inputbox_information_icon, &iwidth, &iheight);
- gui_set_font(f);
- gui_measure_string(inputmode_string, &swidth, &sheight);
- w = swidth + iwidth + 6;
- if (w > UI_device_width)
- {
- w = UI_device_width;
- }
- h = (MMI_title_y + MMI_title_height);
- x1 = UI_device_width - w;
- x2 = UI_device_width - 1;
- y1 = MMI_title_y;
- y2 = y1 + (MMI_title_y + MMI_title_height) - 1;
- gdi_layer_set_clip(x1 + 2, y1 + 2, x2 - 2, y2 - 2);
- gui_draw_filled_area(x1, y1, x2, y2, bg);
- gui_show_transparent_image(x1 + 2, y1 + (h >> 1) - (iheight >> 1), wgui_inputbox_information_icon, 0);
- gui_set_text_color(c);
- if (r2lMMIFlag)
- {
- gui_move_text_cursor(x1 + 2 + iwidth + 2 + swidth, y1 + (h >> 1) - (sheight >> 1));
- }
- else
- {
- gui_move_text_cursor(x1 + 2 + iwidth + 2, y1 + (h >> 1) - (sheight >> 1));
- }
- gui_set_line_height(sheight);
- gui_print_text(inputmode_string);
- gdi_layer_blt_previous(x1, y1, x2, y2);
- gui_start_timer(INLINE_INPUT_METHOD_HIDE_WAIT, wgui_hide_inline_input_method);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_handle_inline_singleline_inputbox_change_input_mode
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_handle_inline_singleline_inputbox_change_input_mode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- disable_active_multitap();
- /* change_input_mode(); */
- change_singleline_input_mode();
- wgui_display_inline_input_method();
- }
- /*****************************************************************************
- * FUNCTION
- * change_inline_singleline_inputbox_input_mode
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void change_inline_singleline_inputbox_input_mode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- inline_edit_change_singleline_inputbox_mode((U8) MMI_current_input_mode);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_inline_singleline_inputbox_get_UCS2_count
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- *
- *****************************************************************************/
- S32 wgui_inline_singleline_inputbox_get_UCS2_count(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (MMI_inline_singleline_inputbox.UCS2_count);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_inline_singleline_inputbox_validation_callback
- * DESCRIPTION
- *
- * PARAMETERS
- * text [IN]
- * cursor [IN]
- * text_length [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_inline_singleline_inputbox_validation_callback(UI_buffer_type text, UI_buffer_type cursor, S32 text_length)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (wgui_inputbox_validation_callback != NULL)
- {
- wgui_inputbox_validation_callback(text, cursor, text_length);
- }
- }
- /* History implementation for inline text edit */
- typedef struct _inline_text_edit_history
- {
- U16 history_ID;
- S16 text_length;
- S16 allocated_length;
- S16 available_length;
- S16 current_position;
- S16 text_offset_x;
- S16 input_type;
- S16 dummy; /* Added for history issue on hardware */
- U32 flags;
- #if defined(__MMI_TOUCH_SCREEN__)
- S16 vk_lang_type;
- #endif
- } inline_text_edit_history;
- /*****************************************************************************
- * FUNCTION
- * inline_text_edit_get_history
- * DESCRIPTION
- *
- * PARAMETERS
- * history_buffer [?]
- * input_type [IN]
- * RETURNS
- *
- *****************************************************************************/
- U8 *inline_text_edit_get_history(U8 *history_buffer, S16 input_type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (history_buffer != NULL)
- {
- U16 hID = (U16) (INLINE_TEXT_EDIT_HISTORY_ID | 0x8000);
- inline_text_edit_history *h = (inline_text_edit_history*) history_buffer;
- h->history_ID = hID;
- h->text_length = (S16) MMI_inline_singleline_inputbox.text_length;
- h->allocated_length = (S16) MMI_inline_singleline_inputbox.allocated_length;
- h->available_length = (S16) MMI_inline_singleline_inputbox.available_length;
- h->current_position =
- (S16) (MMI_inline_singleline_inputbox.current_text_p - MMI_inline_singleline_inputbox.text);
- h->text_offset_x = (S16) MMI_inline_singleline_inputbox.text_offset_x;
- h->input_type = (S16) input_type;
- h->flags = MMI_inline_singleline_inputbox.flags;
- #if defined(__MMI_TOUCH_SCREEN__)
- if (GUI_VIRTUAL_KEYBOARD_MAX_LANG == mmi_pen_editor_history_vk_lang_type())
- {
- h->vk_lang_type = MMI_virtual_keyboard.lang_type;
- }
- else
- {
- h->vk_lang_type = mmi_pen_editor_history_vk_lang_type();
- }
- #endif /* defined(__MMI_TOUCH_SCREEN__) */
- }
- return (history_buffer);
- }
- /*****************************************************************************
- * FUNCTION
- * inline_text_edit_set_history
- * DESCRIPTION
- *
- * PARAMETERS
- * history_ID [IN]
- * history_buffer [?]
- * input_type [?]
- * RETURNS
- *
- *****************************************************************************/
- U8 inline_text_edit_set_history(U16 history_ID, U8 *history_buffer, S16 *input_type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (history_buffer != NULL)
- {
- inline_text_edit_history *h = (inline_text_edit_history*) history_buffer;
- if (history_valid(h->history_ID, history_ID))
- {
- /*
- * MTK Elvis 20040506--it is not required to restored the text length of current input box
- * * because the text_length will be set correctly in handle_inline_text_edit->create_inline_edit_singleline_inputbox_set_buffer.
- * * if restored it, will cause MMI_inline_single_line_inputbox have wrong text length(asyn with text buffer)
- * * for example,
- * * (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)
- * * (2)charger in --> popup a new window and add current screen related parameters into history including text_length
- * * (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
- * * (4)while popup dispeared, go back to (1)
- * * (5)press arrow down to go to next item, inline single line input box
- * * (6)handle_inline_text_edit->create_inline_edit_singleline_inputbox_set_buffer will calculate the length from text buffer
- * * (7)inline_text_edit_set_history will restore the text length from history
- * * (8)inline_text_edit_set_history caused text_length not sync with current input box text buffer
- * * Therefore, comment out MMI_inline_singleline_inputbox.text_length=h->text_length;
- */
- /* W05.33 Fix inline text edit history issue */
- MMI_inline_singleline_inputbox.text_length = h->text_length;
- MMI_inline_singleline_inputbox.allocated_length = h->allocated_length;
- MMI_inline_singleline_inputbox.available_length = h->available_length;
- MMI_inline_singleline_inputbox.current_text_p =
- (UI_buffer_type) (MMI_inline_singleline_inputbox.text + h->current_position);
- MMI_inline_singleline_inputbox.text_offset_x = h->text_offset_x;
- /* MTK end */
- *input_type = h->input_type;
- MMI_inline_singleline_inputbox.flags = h->flags;
- #if defined(__MMI_TOUCH_SCREEN__)
- wgui_setup_virtual_keyboard(h->vk_lang_type);
- #endif
- return (1);
- }
- }
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * handle_inline_text_edit
- * DESCRIPTION
- *
- * PARAMETERS
- * x [IN]
- * y [IN]
- * width [IN]
- * height [IN]
- * key_code [IN]
- * key_event [IN]
- * text_p [IN]
- * item [?]
- * flags [IN]
- * history_buffer [?]
- * RETURNS
- * void
- *****************************************************************************/
- void handle_inline_text_edit(
- S32 x,
- S32 y,
- S32 width,
- S32 height,
- S32 key_code,
- S32 key_event,
- U8 **text_p,
- void *item,
- U32 flags,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 l, xx;
- S16 input_type;
- S16 input_type_flags;
- U8 saved_MMI_current_input_mode;
- U32 saved_inputbox_flags;
- U8 override_history_input_type = 0;
- S16 saved_input_type;
- wgui_inline_item_text_edit *i = (wgui_inline_item_text_edit*) item;
- U8 plus_character_handling = 0;
- #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
- mmi_pen_handwriting_area_struct stroke_area;
- mmi_pen_handwriting_area_struct ext_stroke;
- #endif /* defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__) */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(key_event);
- UI_UNUSED_PARAMETER(key_code);
- UI_UNUSED_PARAMETER(flags);
- /* W05.36 Fix Vietnamese Tone Input Issue */
- set_current_input_box_type(EDITOR_INLINE_TEXT);
- wgui_inline_singleline_inputbox_buffer_size = i->buffer_size;
- if (i->input_type & INPUT_TYPE_PLUS_CHARACTER_HANDLING)
- {
- plus_character_handling = 1;
- }
- wgui_current_inline_item_type = INLINE_ITEM_TYPE_TEXT_EDIT;
- if (MMI_fixed_icontext_menuitem.text_x == 2)
- {
- xx = 0; /* ? */
- }
- else
- {
- xx = MMI_fixed_icontext_menuitem.text_x;
- }
- if (flags & INLINE_ITEM_LEFT_ALIGN)
- {
- xx = 0;
- }
- clear_inline_item_keys = clear_inline_singleline_inputbox_keys;
- register_default_hide_softkeys();
- complete_inline_item_edit = handle_inline_text_edit_complete;
- current_wgui_inline_text_edit_item = i;
- current_wgui_inline_text_edit_text_p = text_p;
- set_left_softkey_label(get_string(STR_GLOBAL_OK));
- gui_strcpy((UI_string_type) wgui_inline_text_edit_buffer, (UI_string_type) i->buffer);
- l = gui_strlen((UI_string_type) wgui_inline_text_edit_buffer);
- create_inline_edit_singleline_inputbox_set_buffer(
- (UI_string_type) wgui_inline_text_edit_buffer,
- i->buffer_size,
- l,
- l);
- switch (flags & INLINE_ITEM_JUSTIFY_MASK)
- {
- case INLINE_ITEM_RIGHT_JUSTIFY:
- MMI_inline_singleline_inputbox.flags |= UI_SINGLE_LINE_INPUT_BOX_RIGHT_JUSTIFY;
- break;
- case INLINE_ITEM_CENTER_JUSTIFY:
- MMI_inline_singleline_inputbox.flags |= UI_SINGLE_LINE_INPUT_BOX_CENTER_JUSTIFY;
- break;
- }
- if ((flags & INLINE_ITEM_BOUNDARY_MASK) == INLINE_ITEM_BOUNDARY_NEVER)
- {
- gui_set_single_line_input_box_theme(
- &MMI_inline_singleline_inputbox,
- &wgui_inline_singleline_inputbox_no_boundary_theme);
- }
- /* resize the inputbox so that the border can be drawn to have the
- 3D effect in case of default text effect is enabled. */
- #if defined(__MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__) && (defined(__MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__)) /* 122805 3D inline edit */
- if (IsInlineItemDefaultTextEnable())
- {
- inline_edit_resize_singleline_inputbox(width - xx - 4, height - 4);
- }
- else
- #endif /* defined(__MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__) && (defined(__MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__)) */
- {
- inline_edit_resize_singleline_inputbox(width - xx - 1, height);
- }
- /* move the inputbox at correct location, in case of default text effect is enabled. */
- #if defined(__MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__) && (defined(__MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__)) /* 122805 3D inline edit */
- if (IsInlineItemDefaultTextEnable())
- {
- if (r2lMMIFlag)
- {
- inline_edit_move_singleline_inputbox(x + 2, y + 2);
- }
- else
- {
- inline_edit_move_singleline_inputbox(x + xx + 2, y + 2);
- }
- }
- else
- #endif /* defined(__MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__) && (defined(__MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__)) */
- {
- if (r2lMMIFlag)
- {
- inline_edit_move_singleline_inputbox(x + 1, y);
- }
- else
- {
- inline_edit_move_singleline_inputbox(x + xx, y);
- }
- }
- register_inline_singleline_inputbox_keys();
- input_type_flags = (S16) (i->input_type & (~INPUT_TYPE_MASK));
- input_type = (S16) (i->input_type & INPUT_TYPE_MASK);
- if (input_type_flags & INPUT_TYPE_USE_ONLY_ENGLISH_MODES)
- {
- set_english_only_multitap();
- MMI_allow_only_english_input_modes = 1;
- }
- else
- {
- set_normal_multitap();
- }
- saved_input_type = input_type;
- switch (input_type & INPUT_TYPE_MASK)
- {
- case INPUT_TYPE_NUMERIC_PASSWORD:
- case INPUT_TYPE_SAT_NUMERIC_PASSWORD:
- override_history_input_type = 1;
- break;
- }
- inline_text_edit_set_history(INLINE_TEXT_EDIT_HISTORY_ID, history_buffer, &input_type);
- saved_MMI_current_input_mode = MMI_current_input_mode;
- saved_inputbox_flags = MMI_inline_singleline_inputbox.flags;
- if (override_history_input_type)
- {
- input_type = saved_input_type;
- }
- /* Get input mode from "Input Methods" list selection */
- wgui_change_inputbox_mode_multitap_ABC = wgui_inline_singleline_inputbox_change_input_mode_multitap_ABC;
- wgui_change_inputbox_mode_multitap_abc = wgui_inline_singleline_inputbox_change_input_mode_multitap_abc;
- wgui_change_inputbox_mode_mode_numeric = wgui_inline_singleline_inputbox_change_input_mode_multitap_numeric;
- wgui_inputbox_insert_symbol = wgui_inline_singleline_inputbox_insert_symbol;
- if (wgui_inline_singleline_inputbox_input_mode_changed)
- {
- input_type = wgui_inline_singleline_inputbox_input_type;
- wgui_inline_singleline_inputbox_input_mode_changed = 0;
- }
- MMI_current_input_type = input_type;
- wgui_inline_singleline_inputbox_decimal_input_mode_flag = 0;
- wgui_inputbox_UCS2_count_function = wgui_inline_singleline_inputbox_get_UCS2_count;
- if (input_type & INPUT_TYPE_USE_ENCODING_BASED_LENGTH)
- {
- MMI_inline_singleline_inputbox.flags |= UI_SINGLE_LINE_INPUT_BOX_USE_ENCODING_BASED_LENGTH;
- if (input_type & INPUT_TYPE_ONE_LESS_CHARACTER)
- {
- MMI_inline_singleline_inputbox.flags |= UI_SINGLE_LINE_INPUT_BOX_ONE_LESS_CHARACTER;
- UI_TEST_UCS2_COUNT_SET_LENGTH_TYPE2(
- MMI_inline_singleline_inputbox.UCS2_count,
- MMI_inline_singleline_inputbox.allocated_length,
- MMI_inline_singleline_inputbox.available_length);
- }
- else
- {
- UI_TEST_UCS2_COUNT_SET_LENGTH(
- MMI_inline_singleline_inputbox.UCS2_count,
- MMI_inline_singleline_inputbox.allocated_length,
- MMI_inline_singleline_inputbox.available_length);
- }
- }
- if (plus_character_handling)
- {
- MMI_inline_singleline_inputbox.flags |= UI_SINGLE_LINE_INPUT_BOX_PLUS_CHARACTER_HANDLING;
- }
- /* Input type currently cannot be changed by the user in inline edit */
- switch (input_type & INPUT_TYPE_MASK)
- {
- case INPUT_TYPE_NUMERIC_CHANGEABLE:
- set_inline_edit_singleline_inputbox_mask(0);
- inline_edit_change_singleline_inputbox_mode(INPUT_MODE_123);
- SetKeyHandler(wgui_handle_inline_singleline_inputbox_change_input_mode, KEY_POUND, KEY_EVENT_DOWN);
- inputbox_change_mode = change_inline_singleline_inputbox_input_mode;
- MMI_current_input_mode = INPUT_MODE_123;
- break;
- case INPUT_TYPE_NUMERIC:
- set_inline_edit_singleline_inputbox_mask(0);
- inline_edit_change_singleline_inputbox_mode(INPUT_MODE_123);
- MMI_current_input_mode = INPUT_MODE_123;
- break;
- case INPUT_TYPE_DECIMAL_NUMERIC:
- wgui_inline_singleline_inputbox_decimal_flag = 0;
- if (l > 0)
- {
- S32 i;
- UI_buffer_type t = *text_p;
- UI_character_type c;
- for (i = 0; i < l; i++)
- {
- UI_STRING_GET_NEXT_CHARACTER(t, c);
- if (c == (UI_character_type) '.')
- {
- wgui_inline_singleline_inputbox_decimal_flag = 1;
- break;
- }
- }
- }
- set_inline_edit_singleline_inputbox_mask(0);
- inline_edit_change_singleline_inputbox_mode(INPUT_MODE_123);
- MMI_current_input_mode = INPUT_MODE_123;
- SetKeyHandler(
- wgui_inline_singleline_inputbox_decimal_numeric_handle_pound_key_down,
- KEY_POUND,
- KEY_EVENT_DOWN);
- wgui_inline_singleline_inputbox_decimal_input_mode_flag = 1;
- break;
- case INPUT_TYPE_KEYPAD_NUMERIC:
- set_inline_edit_singleline_inputbox_mask(0);
- inline_edit_change_singleline_inputbox_mode(INPUT_MODE_123);
- SetKeyHandler(inline_singleline_inputbox_keypad_numeric_handle_star_key_down, KEY_STAR, KEY_EVENT_DOWN);
- SetKeyHandler(inline_singleline_inputbox_keypad_numeric_handle_pound_key_down, KEY_POUND, KEY_EVENT_DOWN);
- MMI_current_input_mode = INPUT_MODE_123;
- break;
- case INPUT_TYPE_ALPHANUMERIC_UPPERCASE:
- set_inline_edit_singleline_inputbox_mask(0);
- inline_edit_change_singleline_inputbox_mode(INPUT_MODE_MULTITAP_UPPERCASE_ABC);
- SetKeyHandler(wgui_handle_inline_singleline_inputbox_change_input_mode, KEY_POUND, KEY_EVENT_DOWN);
- inputbox_change_mode = change_inline_singleline_inputbox_input_mode;
- MMI_current_input_mode = INPUT_MODE_MULTITAP_UPPERCASE_ABC;
- break;
- case INPUT_TYPE_ALPHANUMERIC_LOWERCASE:
- set_inline_edit_singleline_inputbox_mask(0);
- inline_edit_change_singleline_inputbox_mode(1);
- SetKeyHandler(wgui_handle_inline_singleline_inputbox_change_input_mode, KEY_POUND, KEY_EVENT_DOWN);
- inputbox_change_mode = change_inline_singleline_inputbox_input_mode;
- MMI_current_input_mode = 1;
- break;
- case INPUT_TYPE_ALPHANUMERIC_SENTENCECASE:
- set_inline_edit_singleline_inputbox_mask(0);
- inline_edit_change_singleline_inputbox_mode(INPUT_MODE_MULTITAP_LOWERCASE_ABC);
- SetKeyHandler(wgui_handle_inline_singleline_inputbox_change_input_mode, KEY_POUND, KEY_EVENT_DOWN);
- inputbox_change_mode = change_inline_singleline_inputbox_input_mode;
- MMI_current_input_mode = INPUT_MODE_MULTITAP_LOWERCASE_ABC;
- break;
- case INPUT_TYPE_NUMERIC_PASSWORD:
- set_inline_edit_singleline_inputbox_mask(1);
- inline_edit_change_singleline_inputbox_mode(INPUT_MODE_123);
- MMI_current_input_mode = INPUT_MODE_123;
- break;
- case INPUT_TYPE_ALPHANUMERIC_PASSWORD:
- set_inline_edit_singleline_inputbox_mask(1);
- inline_edit_change_singleline_inputbox_mode(INPUT_MODE_MULTITAP_LOWERCASE_ABC);
- SetKeyHandler(wgui_handle_inline_singleline_inputbox_change_input_mode, KEY_POUND, KEY_EVENT_DOWN);
- inputbox_change_mode = change_inline_singleline_inputbox_input_mode;
- MMI_current_input_mode = INPUT_MODE_MULTITAP_LOWERCASE_ABC;
- break;
- case INPUT_TYPE_PHONE_NUMBER:
- set_inline_edit_singleline_inputbox_mask(0);
- inline_edit_change_singleline_inputbox_mode(INPUT_MODE_123);
- /* Handling of Phone number input */
- /* MTK Elvis */
- #ifdef __MMI_MULTITAP_KEY_0__
- SetKeyHandler(inline_edit_phone_number_input_handle_star_key_down, KEY_STAR, KEY_EVENT_DOWN);
- #else /* __MMI_MULTITAP_KEY_0__ */
- gui_create_multitap_input(
- &wgui_inline_text_edit_multitap_star_key,
- 0,
- 0,
- 0,
- 0,
- (UI_string_type) wgui_inline_edit_phone_number_star_key_string);
- gui_set_multitap_input_callbacks(
- &wgui_inline_text_edit_multitap_star_key,
- inline_edit_singleline_inputbox_multitap_input,
- inline_edit_singleline_inputbox_multitap_input_complete);
- SetKeyHandler(inline_edit_phone_number_input_handle_multitap_star_key_down, KEY_STAR, KEY_EVENT_DOWN);
- SetKeyHandler(inline_edit_phone_number_input_handle_multitap_star_key_up, KEY_STAR, KEY_EVENT_UP);
- #endif /* __MMI_MULTITAP_KEY_0__ */
- /* MTK end */
- SetKeyHandler(inline_edit_phone_number_input_handle_hash_key_down, KEY_POUND, KEY_EVENT_DOWN);
- register_key_down_handler(inline_edit_phone_number_input_numeric_key_handler);
- #if(ENABLE_DIALER_ZERO_KEY_MULTITAP)
- gui_create_multitap_input(
- &wgui_inline_text_edit_multitap_zero_key,
- 0,
- 0,
- 0,
- 0,
- (UI_string_type) wgui_inline_edit_phone_number_zero_key_string);
- gui_set_multitap_input_callbacks(
- &wgui_inline_text_edit_multitap_zero_key,
- inline_edit_singleline_inputbox_multitap_input,
- inline_edit_singleline_inputbox_multitap_input_complete);
- #ifdef __MMI_MULTITAP_KEY_0__
- SetKeyHandler(inline_edit_phone_number_input_handle_zero_key_long_press, KEY_0, KEY_EVENT_LONG_PRESS);
- #else /* __MMI_MULTITAP_KEY_0__ */
- SetKeyHandler(inline_edit_phone_number_input_handle_multitap_zero_key_down, KEY_0, KEY_EVENT_DOWN);
- SetKeyHandler(inline_edit_phone_number_input_handle_multitap_zero_key_up, KEY_0, KEY_EVENT_UP);
- #endif /* __MMI_MULTITAP_KEY_0__ */
- #endif /* (ENABLE_DIALER_ZERO_KEY_MULTITAP) */
- wgui_inline_text_edit_active_multitap = WGUI_INLINE_TEXT_EDIT_MULTITAP_NONE;
- MMI_current_input_mode = INPUT_MODE_123;
- break;
- default:
- set_inline_edit_singleline_inputbox_mask(0);
- inline_edit_change_singleline_inputbox_mode(INPUT_MODE_123);
- MMI_current_input_mode = INPUT_MODE_123;
- break;
- }
- if (!override_history_input_type && (saved_inputbox_flags & UI_SINGLE_LINE_INPUT_BOX_MASK_CHARACTERS))
- {
- MMI_inline_singleline_inputbox.flags |= UI_SINGLE_LINE_INPUT_BOX_MASK_CHARACTERS;
- if ((saved_input_type & INPUT_TYPE_MASK) != INPUT_TYPE_ALPHANUMERIC_PASSWORD)
- {
- ClearKeyHandler(KEY_POUND, KEY_EVENT_DOWN);
- }
- }
- /* 20051012 HIMANSHU START INLINE EDIT */
- /* shows the border with 3D effect in case of inline text edit item, when the
- default text effect is enabled. */
- #if defined(__MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__) && (defined(__MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__)) /* 122805 3D inline edit */
- if (IsInlineItemDefaultTextEnable())
- {
- inline_text_edit_show_background(&MMI_inline_singleline_inputbox);
- }
- #endif /* defined(__MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__) && (defined(__MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__)) */
- /* 20051012 HIMANSHU END INLINE EDIT */
- show_inline_singleline_inputbox();
- inline_text_edit_RSK_label_clear = 0;
- if (wgui_inline_list_menu_changed)
- {
- if (wgui_inline_list_menu_disable_done)
- {
- inline_text_edit_RSK_label_string = (UI_string_type) get_string(STR_GLOBAL_BACK);
- inline_text_edit_RSK_label_icon = NULL;
- }
- else
- {
- inline_text_edit_RSK_label_string = NULL;
- inline_text_edit_RSK_label_icon = NULL;
- }
- }
- else
- {
- inline_text_edit_RSK_label_string = wgui_inline_edit_get_RSK_string();
- inline_text_edit_RSK_label_icon = NULL;
- }
- set_right_softkey_label(inline_text_edit_RSK_label_string);
- set_right_softkey_icon(inline_text_edit_RSK_label_icon);
- register_right_softkey_handler();
- #ifdef __MMI_WITH_C_KEY__
- SetKeyHandler(handle_inline_text_edit_right_softkey_down, KEY_CLEAR, KEY_EVENT_DOWN);
- SetKeyHandler(handle_inline_text_edit_right_softkey_long_press, KEY_CLEAR, KEY_LONG_PRESS);
- set_right_softkey_function(handle_inline_text_edit_right_softkey_up, KEY_EVENT_UP);
- #else /* __MMI_WITH_C_KEY__ */
- set_right_softkey_function(handle_inline_text_edit_right_softkey_down, KEY_EVENT_DOWN);
- set_right_softkey_function(handle_inline_text_edit_right_softkey_long_press, KEY_LONG_PRESS);
- #endif /* __MMI_WITH_C_KEY__ */
- inline_edit_register_singleline_inputbox_input_callback(handle_inline_text_edit_input);
- /* inline_edit_register_singleline_inputbox_navigate_callback(handle_inline_text_edit_navigate); */
- inline_text_edit_RSK_function = wgui_inline_edit_BACK_function;
- handle_inline_text_edit_input();
- if (gui_single_line_input_box_get_text_length(&MMI_inline_singleline_inputbox) <= 0)
- {
- //#if defined(__MMI_WITH_C_KEY__)
- // SetKeyHandler(handle_inline_text_edit_right_softkey_up, KEY_CLEAR, KEY_EVENT_UP);
- //#else
- set_right_softkey_function(handle_inline_text_edit_right_softkey_up, KEY_EVENT_UP);
- // #endif
- if (wgui_inputbox_empty_callback != NULL)
- {
- wgui_inputbox_empty_callback();
- }
- }
- else if (wgui_inputbox_not_empty_callback != NULL)
- {
- wgui_inputbox_not_empty_callback();
- }
- wgui_inputbox_validation_callback = i->validation_callback;
- MMI_inline_singleline_inputbox.validation_callback = wgui_inline_singleline_inputbox_validation_callback;
- MMI_inline_singleline_inputbox.validation_callback(
- MMI_inline_singleline_inputbox.text,
- MMI_inline_singleline_inputbox.current_text_p,
- MMI_inline_singleline_inputbox.text_length);
- SetKeyHandler(inline_text_edit_handle_down_arrow, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(inline_text_edit_handle_up_arrow, KEY_UP_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(inline_text_edit_handle_down_arrow, KEY_VOL_DOWN, KEY_EVENT_DOWN);
- SetKeyHandler(inline_text_edit_handle_up_arrow, KEY_VOL_UP, KEY_EVENT_DOWN);
- redraw_left_softkey();
- redraw_right_softkey();
- redraw_current_inline_item = redraw_inline_singleline_inputbox;
- current_wgui_inline_text_edit_item->UCS2_count = MMI_inline_singleline_inputbox.UCS2_count;
- test_change_input_mode = inline_singleline_inputbox_test_change_input_mode;
- if (i->custom_setup_function != NULL)
- {
- i->custom_setup_function();
- }
- gui_start_timer(INLINE_INPUT_METHOD_DISPLAY_WAIT, wgui_display_inline_input_method);
- UI_UNUSED_PARAMETER(input_type_flags);
- UI_UNUSED_PARAMETER(saved_MMI_current_input_mode);
- #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
- ext_stroke.x1 = 0;
- ext_stroke.y1 = 0;
- ext_stroke.x2 = UI_device_width - 1;
- ext_stroke.y2 = UI_device_height - 1;
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #else /* 0 */
- stroke_area.x1 = MMI_content_x;
- stroke_area.x2 = MMI_content_x + MMI_content_width - MMI_fixed_list_menu.vbar.width;
- stroke_area.y1 = MMI_title_y;
- stroke_area.y2 = MMI_title_y + MMI_content_height + MMI_title_height;
- #endif /* 0 */
- mmi_pen_editor_setup_input_box(
- &stroke_area,
- &ext_stroke,
- MMI_current_input_type,
- MMI_FALSE,
- PEN_EDITOR_INLINE_TEXT);
- #endif /* defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__) */
- }
- /*****************************************************************************
- * FUNCTION
- * SetInlineTextEditCustomFunction
- * DESCRIPTION
- *
- * PARAMETERS
- * item [?]
- * f [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetInlineTextEditCustomFunction(InlineItem *item, void (*f) (void))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_text_edit *i = (wgui_inline_item_text_edit*) item->item;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- i->custom_setup_function = f;
- }
- /*****************************************************************************
- * FUNCTION
- * SetInlineItemTextEdit
- * DESCRIPTION
- *
- * PARAMETERS
- * item [?]
- * buffer [?]
- * buffer_size [IN]
- * input_type [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetInlineItemTextEdit(InlineItem *item, U8 *buffer, S32 buffer_size, S16 input_type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_text_edit *i;
- UI_buffer_type mask_buffer;
- S16 t = input_type & INPUT_TYPE_MASK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (n_inline_text_edit_items >= MAX_INLINE_TEXT_EDIT_ITEMS)
- {
- return;
- }
- item->item = (void*)&wgui_inline_text_edit_items[n_inline_text_edit_items];
- item->flags = INLINE_ITEM_TYPE_TEXT_EDIT;
- mask_buffer = inline_text_edit_mask_buffers[n_inline_text_edit_items];
- n_inline_text_edit_items++;
- i = (wgui_inline_item_text_edit*) item->item;
- i->max_lines = 0;
- i->buffer = buffer;
- i->buffer_size = buffer_size;
- i->flags = 0;
- i->input_type = input_type;
- item->text_p = i->buffer;
- item->handler = handle_inline_text_edit;
- i->edit_complete_callback = UI_dummy_edit_complete_handler;
- i->validation_callback = UI_dummy_validation_function;
- i->custom_setup_function = NULL;
- if ((t == INPUT_TYPE_NUMERIC_PASSWORD) || (t == INPUT_TYPE_ALPHANUMERIC_PASSWORD) ||
- (t == INPUT_TYPE_SAT_NUMERIC_PASSWORD))
- {
- inline_edit_prepare_mask_buffer(buffer, mask_buffer);
- i->mask_buffer = mask_buffer;
- item->text_p = mask_buffer;
- }
- /* UCS2_count==-1 means this field hasn't been edited */
- i->UCS2_count = -1;
- }
- /*****************************************************************************
- * FUNCTION
- * ReConfigureInlineItemTextEdit
- * DESCRIPTION
- *
- * PARAMETERS
- * item [?]
- * buffer [?]
- * buffer_size [IN]
- * input_type [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ReConfigureInlineItemTextEdit(InlineItem *item, U8 *buffer, S32 buffer_size, S16 input_type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_text_edit *i;
- UI_buffer_type mask_buffer;
- S16 t = input_type & INPUT_TYPE_MASK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((item->flags & 0xff) != INLINE_ITEM_TYPE_TEXT_EDIT)
- {
- return;
- }
- i = (wgui_inline_item_text_edit*) item->item;
- mask_buffer = i->mask_buffer;
- i->max_lines = 0;
- i->buffer = buffer;
- i->buffer_size = buffer_size;
- i->flags = 0;
- i->input_type = input_type;
- item->text_p = i->buffer;
- i->edit_complete_callback = UI_dummy_edit_complete_handler;
- i->custom_setup_function = NULL;
- if ((t == INPUT_TYPE_NUMERIC_PASSWORD) || (t == INPUT_TYPE_ALPHANUMERIC_PASSWORD) ||
- (t == INPUT_TYPE_SAT_NUMERIC_PASSWORD))
- {
- inline_edit_prepare_mask_buffer(buffer, mask_buffer);
- i->mask_buffer = mask_buffer;
- item->text_p = mask_buffer;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * RegisterInlineTextEditCompleteHandler
- * DESCRIPTION
- *
- * PARAMETERS
- * item [?]
- * f [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void RegisterInlineTextEditCompleteHandler(InlineItem *item, void (*f) (U8 *string, S32 buffer_size))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_text_edit *i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- i = (wgui_inline_item_text_edit*) item->item;
- if (f != NULL)
- {
- i->edit_complete_callback = f;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * RegisterInlineTextEditValidationFunction
- * DESCRIPTION
- *
- * PARAMETERS
- * item [?]
- * f [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void RegisterInlineTextEditValidationFunction(InlineItem *item, void (*f) (U8 *buffer, U8 *cursor, S32 text_length))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_text_edit *i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- i = (wgui_inline_item_text_edit*) item->item;
- if (f != NULL)
- {
- i->validation_callback = f;
- }
- }
- /* PMT MANISH START 20050722 */
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- /*****************************************************************************
- * FUNCTION
- * SetInlineItemTextEditDefaultItemNameIfEmpty
- * DESCRIPTION
- * Sets the pointer item->text_p to point to default item text
- * if the buffer is empty
- * PARAMETERS
- * item [IN] Is the pointer to InlineItem structure.
- * default_text_id [IN] Is the string Id of the default text.
- * RETURNS
- * void
- *****************************************************************************/
- void SetInlineItemTextEditDefaultItemNameIfEmpty(InlineItem *item, U16 default_text_id)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_text_edit *i;
- S32 sw, sh;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- i = (wgui_inline_item_text_edit*) item->item;
- i->default_item_text = (U8*) get_string(default_text_id);
- gui_measure_string((UI_string_type) i->buffer, &sw, &sh);
- if ((IsInlineItemDefaultTextEnable()) && (sw == 0))
- {
- item->text_p = i->default_item_text;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EnableInlineItemDefaultText
- * DESCRIPTION
- * Sets the global flag variable to 1.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EnableInlineItemDefaultText(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_enable_inline_item_default_text = 1;
- }
- /*****************************************************************************
- * FUNCTION
- * DisableInlineItemDefaultText
- * DESCRIPTION
- * Sets the global flag variable to 0.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void DisableInlineItemDefaultText(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_enable_inline_item_default_text = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * IsInlineItemDefaultTextEnable
- * DESCRIPTION
- * Check whether the global flag is on or off.
- * PARAMETERS
- * void
- * RETURNS
- * 1 if the flag is set otherwise 0.
- *****************************************************************************/
- U8 IsInlineItemDefaultTextEnable(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (wgui_enable_inline_item_default_text == 1);
- }
- #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */
- /* PMT MANISH END 20050722 */
- /* Displaying inline text edit as a menu item in the fixed list menu */
- single_line_input_box wgui_inline_text_edit_display_inputbox;
- /*****************************************************************************
- * FUNCTION
- * wgui_show_inline_text_edit_list_menuitem
- * DESCRIPTION
- *
- * PARAMETERS
- * x1 [IN]
- * y1 [IN]
- * width [IN]
- * height [IN]
- * item [?]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_show_inline_text_edit_list_menuitem(S32 x1, S32 y1, S32 width, S32 height, wgui_inline_item *item)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 xx, l;
- wgui_inline_item_text_edit *i = (wgui_inline_item_text_edit*) item->item;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (MMI_fixed_icontext_menuitem.text_x == 2)
- {
- xx = -1;
- }
- else
- {
- xx = MMI_fixed_icontext_menuitem.text_x;
- }
- if (item->flags & INLINE_ITEM_LEFT_ALIGN)
- {
- xx = -1;
- }
- gdi_layer_lock_frame_buffer();
- /* add check to use mask buffer in case of passwords here */
- l = gui_strlen((UI_string_type) i->buffer);
- #ifdef __UCS2_ENCODING
- gui_create_single_line_input_box_set_buffer_first_position(
- &wgui_inline_text_edit_display_inputbox,
- MMI_singleline_inputbox_x,
- MMI_singleline_inputbox_y,
- MMI_singleline_inputbox_width,
- MMI_singleline_inputbox_height,
- (UI_string_type) i->buffer,
- i->buffer_size,
- (l + 1) * 2,
- 0);
- #endif /* __UCS2_ENCODING */
- #ifdef __ASCII
- gui_create_single_line_input_box_set_buffer_first_position(
- &wgui_inline_text_edit_display_inputbox,
- MMI_singleline_inputbox_x,
- MMI_singleline_inputbox_y,
- MMI_singleline_inputbox_width,
- MMI_singleline_inputbox_height,
- (UI_string_type) i->buffer,
- i->buffer_size,
- l + 1,
- 0);
- #endif /* __ASCII */
- wgui_inline_text_edit_display_inputbox.flags |= UI_SINGLE_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW;
- switch (i->input_type & INPUT_TYPE_MASK)
- {
- case INPUT_TYPE_NUMERIC_PASSWORD:
- case INPUT_TYPE_ALPHANUMERIC_PASSWORD:
- wgui_inline_text_edit_display_inputbox.flags |= UI_SINGLE_LINE_INPUT_BOX_MASK_CHARACTERS;
- break;
- }
- switch (item->flags & INLINE_ITEM_JUSTIFY_MASK)
- {
- case INLINE_ITEM_RIGHT_JUSTIFY:
- wgui_inline_text_edit_display_inputbox.flags |= UI_SINGLE_LINE_INPUT_BOX_RIGHT_JUSTIFY;
- break;
- case INLINE_ITEM_CENTER_JUSTIFY:
- wgui_inline_text_edit_display_inputbox.flags |= UI_SINGLE_LINE_INPUT_BOX_CENTER_JUSTIFY;
- break;
- }
- wgui_inline_text_edit_display_inputbox.flags |= UI_SINGLE_LINE_INPUT_BOX_TRUNCATE_CONTENT_NO_BRIEF; /* 022405 Calvin added */
- if ((item->flags & INLINE_ITEM_BOUNDARY_MASK) == INLINE_ITEM_BOUNDARY_ALWAYS)
- {
- gui_set_single_line_input_box_theme(
- &wgui_inline_text_edit_display_inputbox,
- &wgui_inline_singleline_inputbox_unfocussed_theme);
- wgui_inline_text_edit_display_inputbox.text_font = &MMI_medium_font;
- }
- gui_resize_single_line_input_box(&wgui_inline_text_edit_display_inputbox, width - 1 - xx, height);
- gui_move_single_line_input_box(&wgui_inline_text_edit_display_inputbox, x1 + xx, y1);
- gui_show_single_line_input_box(&wgui_inline_text_edit_display_inputbox);
- redraw_left_softkey();
- redraw_right_softkey();
- gdi_layer_unlock_frame_buffer();
- }
- /*----------------------------------------------------------------------------
- Inline text edit (Full screen) implementation
- ----------------------------------------------------------------------------*/
- /* History implementation for inline text edit */
- typedef multiline_inputbox_category_history inline_full_screen_edit_history;
- /*****************************************************************************
- * FUNCTION
- * inline_full_screen_edit_get_history
- * DESCRIPTION
- *
- * PARAMETERS
- * history_buffer [?]
- * input_type [IN]
- * RETURNS
- *
- *****************************************************************************/
- U8 *inline_full_screen_edit_get_history(U8 *history_buffer, S16 input_type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- get_multiline_inputbox_category_history(INLINE_FULL_SCREEN_EDIT_HISTORY_ID, history_buffer, input_type);
- return (history_buffer);
- }
- /*****************************************************************************
- * FUNCTION
- * inline_full_screen_edit_set_history
- * DESCRIPTION
- *
- * PARAMETERS
- * history_ID [IN]
- * history_buffer [?]
- * input_type [?]
- * RETURNS
- *
- *****************************************************************************/
- U8 inline_full_screen_edit_set_history(U16 history_ID, U8 *history_buffer, S16 *input_type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (set_multiline_inputbox_category_history(INLINE_FULL_SCREEN_EDIT_HISTORY_ID, history_buffer, input_type));
- }
- /* Start Yogesh 20040814 */
- /*****************************************************************************
- * FUNCTION
- * inline_multi_line_edit_get_history
- * DESCRIPTION
- *
- * PARAMETERS
- * history_buffer [?]
- * input_type [IN]
- * RETURNS
- *
- *****************************************************************************/
- U8 *inline_multi_line_edit_get_history(U8 *history_buffer, S16 input_type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- get_multiline_inputbox_category_history(INLINE_MULTI_LINE_EDIT_HISTORY_ID, history_buffer, input_type);
- return (history_buffer);
- }
- /* End Yogesh 20040814 */
- /*****************************************************************************
- * FUNCTION
- * redraw_inline_full_screen_edit
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void redraw_inline_full_screen_edit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /* micha1111, #219 */
- #ifdef __MMI_DEFAULT_THEME_3__
- color c = {206, 206, 206, 100};
- #endif
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- /* micha1111 Chicago Feature */
- #ifdef __MMI_DEFAULT_THEME_3__
- gdi_layer_reset_clip();
- gui_fill_rectangle(0, 0, UI_device_width - 1, UI_device_height - 1, c);
- #else /* __MMI_DEFAULT_THEME_3__ */
- if (wgui_is_wallpaper_on_bottom() == MMI_TRUE)
- {
- gdi_draw_solid_rect(0, 0, UI_device_width - 1, UI_device_height - 1, GDI_COLOR_TRANSPARENT);
- }
- else
- {
- clear_screen();
- }
- #endif /* __MMI_DEFAULT_THEME_3__ */
- show_title_status_icon();
- draw_title();
- wgui_show_inputbox();
- #if defined(__MMI_TOUCH_SCREEN__)
- mmi_pen_editor_inline_full_screen_redraw_handwriting_area();
- #endif /* defined(__MMI_TOUCH_SCREEN__) */
- show_softkey_background();
- show_left_softkey();
- show_right_softkey();
- #if defined(__MMI_TOUCH_SCREEN__)
- #if defined(__MMI_WGUI_CSK_ENABLE__)
- /* W05.36 Add Center Soft Key for switching Input Method */
- show_softkey(MMI_CENTER_SOFTKEY);
- #endif /* defined(__MMI_WGUI_CSK_ENABLE__) */
- #endif /* defined(__MMI_TOUCH_SCREEN__) */
- gdi_layer_unlock_frame_buffer();
- gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
- /* MTK Elvis for redrawing spelling or candidate boxes */
- if (RedrawSpellingOrCandidateBoxesFunction)
- {
- RedrawSpellingOrCandidateBoxesFunction();
- }
- /* MTK end */
- }
- /*****************************************************************************
- * FUNCTION
- * handle_inline_full_screen_edit_complete
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void handle_inline_full_screen_edit_complete(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 input_type = current_wgui_inline_text_edit_item->input_type & INPUT_TYPE_MASK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearAllKeyHandler(); // clear all key to avoid inline edit screen use editor key handle
- /* Set Current Inline Method To Zero After Full Screen Editing Is Complete - Gurinder 3/27/2004 */
- wgui_current_inline_item_type = 0;
- current_wgui_inline_item->flags &= ~INLINE_ITEM_OPEN;
- if (inline_full_screen_edit_changed)
- {
- wgui_inline_list_menu_changed = 1;
- }
- if (current_wgui_inline_item->flags & INLINE_ITEM_CHANGED)
- {
- set_wgui_inline_list_menu_changed();
- }
- current_wgui_inline_text_edit_item->UCS2_count = MMI_multiline_inputbox.UCS2_count;
- gui_strcpy(
- (UI_string_type) current_wgui_inline_text_edit_item->buffer,
- (UI_string_type) wgui_inline_full_screen_text_edit_buffer);
- if ((input_type == INPUT_TYPE_NUMERIC_PASSWORD) || (input_type == INPUT_TYPE_ALPHANUMERIC_PASSWORD) ||
- (input_type == INPUT_TYPE_SAT_NUMERIC_PASSWORD))
- {
- inline_edit_prepare_mask_buffer(
- current_wgui_inline_text_edit_item->buffer,
- current_wgui_inline_text_edit_item->mask_buffer);
- *current_wgui_inline_text_edit_text_p = current_wgui_inline_text_edit_item->mask_buffer;
- }
- else
- {
- /* PMT MANISH START 20050722 */
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- if ((IsInlineItemDefaultTextEnable()) &&
- (gui_strlen((UI_string_type) current_wgui_inline_text_edit_item->buffer) == 0))
- {
- *current_wgui_inline_text_edit_text_p = current_wgui_inline_text_edit_item->default_item_text;
- }
- else
- #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */
- /* PMT MANISH END 20050722 */
- *current_wgui_inline_text_edit_text_p = current_wgui_inline_text_edit_item->buffer;
- /* PMT MANISH START 20050722 */
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- MMI_fixed_icontext_menuitems[wgui_inline_item_highlighted_index].item_text =
- (UI_string_type) (*current_wgui_inline_text_edit_text_p);
- #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */
- /* PMT MANISH END 20050722 */
- }
- /* set_MMI_current_input_type(); */
- reset_softkeys();
- reset_multitaps();
- wgui_close_inputbox();
- /* 101105 inline Calvin Start */
- #ifdef __MMI_WALLPAPER_ON_BOTTOM__
- if (inline_edit_scr_bg_ID != 0 || inline_edit_scr_bg_filename != NULL) /* 010606 signature Calvin */
- {
- 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 */
- inline_edit_scr_bg_ID = 0;
- inline_edit_scr_bg_filename = NULL;
- }
- #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */
- /* 101105 Calvin End */
- // #ifdef __MMI_PLUTO_GPRS__
- inline_image_text_edit_flag = 0;
- // #endif
- register_inline_fixed_list_keys();
- inline_text_edit_RSK_function = NULL;
- clear_left_softkey();
- clear_right_softkey();
- /* MTK Terry for RSK Long Press in inline full screen exit */
- set_right_softkey_function(UI_dummy_function, KEY_EVENT_LONG_PRESS);
- set_left_softkey_label(inline_full_screen_edit_saved_LSK_label);
- set_left_softkey_icon(inline_full_screen_edit_saved_LSK_icon);
- set_right_softkey_label(inline_full_screen_edit_saved_RSK_label);
- set_right_softkey_icon(inline_full_screen_edit_saved_RSK_icon);
- register_left_softkey_handler();
- register_right_softkey_handler();
- wgui_inline_item_handled = 0;
- wgui_text_menuitem_restart_scrolling();
- /* if title is changed, we should redraw title */
- if (MMI_title_icon != inline_full_screen_edit_saved_title_icon ||
- MMI_title_string != inline_full_screen_edit_saved_title)
- {
- MMI_title_icon = inline_full_screen_edit_saved_title_icon;
- MMI_title_string = inline_full_screen_edit_saved_title;
- draw_title();
- }
- current_wgui_inline_text_edit_item->edit_complete_callback(
- current_wgui_inline_text_edit_item->buffer,
- current_wgui_inline_text_edit_item->buffer_size);
- show_fixed_list();
- //MTK Leo add 0511, to reduce stack size
- // draw_title();
- //MTK Leo end
- inline_edit_current_highlight_handler(wgui_inline_item_highlighted_index);
- redraw_current_inline_item = UI_dummy_function;
- wgui_inputbox_UCS2_count_function = NULL;
- wgui_inputbox_not_empty_callback = NULL;
- wgui_inputbox_empty_callback = NULL;
- wgui_inputbox_validation_callback = NULL;
- inline_full_screen_edit_changed = 0;
- complete_inline_item_edit = UI_dummy_function;
- #if defined(__MMI_TOUCH_SCREEN__)
- #ifdef __MMI_WGUI_CSK_ENABLE__
- /* W05.38 Reset Center Sofy Key When Complete Full Screen Edit */
- set_softkey_label(NULL, MMI_CENTER_SOFTKEY);
- set_softkey_icon(NULL, MMI_CENTER_SOFTKEY);
- redraw_softkey(MMI_CENTER_SOFTKEY);
- clear_softkey_handler(MMI_CENTER_SOFTKEY);
- #endif /* __MMI_WGUI_CSK_ENABLE__ */
- if (GUI_VIRTUAL_KEYBOARD_EMPTY_TRAY != MMI_virtual_keyboard.lang_type)
- {
- resize_fixed_list(MMI_content_width, MMI_content_height - MMI_virtual_keyboard.height - 1);
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- }
- else
- {
- resize_fixed_list(MMI_content_width, MMI_content_height);
- }
- redraw_fixed_list();
- redraw_current_inline_item();
- #endif /* defined(__MMI_TOUCH_SCREEN__) */
- //gui_cancel_timer(UI_inputbox_blink_cursor);
- //MTK Elvis
- StopMyTimer(BLINKING_CURSOR);
- /* MTK end */
- }
- /*****************************************************************************
- * FUNCTION
- * handle_inline_full_screen_edit_close
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void handle_inline_full_screen_edit_close(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* MTK Terry for G12C#392 RSK Long Press roll back for side effect */
- current_wgui_inline_item->flags |= INLINE_ITEM_OPEN;
- if (inline_full_screen_edit_changed)
- {
- current_wgui_inline_item->flags |= INLINE_ITEM_CHANGED;
- }
- set_MMI_current_input_type();
- reset_softkeys();
- reset_multitaps();
- wgui_close_inputbox();
- /* 101105 inline Calvin Start */
- #ifdef __MMI_WALLPAPER_ON_BOTTOM__
- if (inline_edit_scr_bg_ID != 0 || inline_edit_scr_bg_filename != NULL) /* 010606 signature Calvin */
- {
- 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 */
- inline_edit_scr_bg_ID = 0;
- inline_edit_scr_bg_filename = NULL;
- }
- #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */
- /* 101105 Calvin End */
- wgui_inline_item_handled = 0;
- //MTK Elvis 20040609 it is wrong to reset wgui_current_inline_item_type
- // it will cause the inline full(multiline input box parameters) screen's history not be stored
- //wgui_current_inline_item_type = 0;
- //MTK end
- //W05.36 Temp Solution for Pop Screen in Full Screen Editor to check if any side effect or not
- inline_edit_current_highlight_handler(wgui_inline_item_highlighted_index);
- redraw_current_inline_item = UI_dummy_function;
- wgui_inputbox_UCS2_count_function = NULL;
- wgui_inputbox_not_empty_callback = NULL;
- wgui_inputbox_empty_callback = NULL;
- wgui_inputbox_validation_callback = NULL;
- inline_full_screen_edit_changed = 0;
- complete_inline_item_edit = UI_dummy_function;
- #if defined(__MMI_TOUCH_SCREEN__)
- #ifdef __MMI_WGUI_CSK_ENABLE__
- //W05.36 Add Center Soft Key for switching Input Method
- //W05.36 Temp Solution for Pop Screen in Full Screen Editor
- if (GetActiveScreenId() != POPUP_SCREENID
- && GetActiveScreenId() != WAP_SCREEN_MESSAGE_NOTIFICATION
- && GetActiveScreenId() != SCR_ID_POC_CM
- && GetActiveScreenId() != SCR_ID_SAT_WAITSCREEN
- && GetActiveScreenId() != SCR_POPUP_SCREEN && GetActiveScreenId() != SCR_ID_MSG_POPUP)
- {
- set_softkey_label(NULL, MMI_CENTER_SOFTKEY);
- set_softkey_icon(NULL, MMI_CENTER_SOFTKEY);
- redraw_softkey(MMI_CENTER_SOFTKEY);
- clear_softkey_handler(MMI_CENTER_SOFTKEY);
- }
- #endif /* __MMI_WGUI_CSK_ENABLE__ */
- #endif /* defined(__MMI_TOUCH_SCREEN__) */
- //gui_cancel_timer(UI_inputbox_blink_cursor);
- //MTK Elvis
- StopMyTimer(BLINKING_CURSOR);
- /* MTK end */
- }
- /*****************************************************************************
- * FUNCTION
- * handle_inline_full_screen_edit_cancel
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void handle_inline_full_screen_edit_cancel(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();//111406 inline cancel
- current_wgui_inline_item->flags &= ~INLINE_ITEM_OPEN;
- ClearAllKeyHandler(); // clear all key to avoid inline edit screen use editor key handle
- set_MMI_current_input_type();
- reset_softkeys();
- reset_multitaps();
- wgui_close_inputbox();
- /* 101105 inline Calvin Start */
- #ifdef __MMI_WALLPAPER_ON_BOTTOM__
- if (inline_edit_scr_bg_ID != 0 || inline_edit_scr_bg_filename != NULL) /* 010606 signature Calvin */
- {
- 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 */
- inline_edit_scr_bg_ID = 0;
- inline_edit_scr_bg_filename = NULL;
- }
- #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */
- /* 101105 Calvin End */
- // #ifdef __MMI_PLUTO_GPRS__
- inline_image_text_edit_flag = 0;
- // #endif
- register_inline_fixed_list_keys();
- inline_text_edit_RSK_function = NULL;
- clear_left_softkey();
- clear_right_softkey();
- #if !defined(__MMI_WITH_C_KEY__)
- ClearKeyHandler(KEY_RSK, KEY_LONG_PRESS);
- #endif
- set_left_softkey_label(inline_full_screen_edit_saved_LSK_label);
- set_left_softkey_icon(inline_full_screen_edit_saved_LSK_icon);
- set_right_softkey_label(inline_full_screen_edit_saved_RSK_label);
- set_right_softkey_icon(inline_full_screen_edit_saved_RSK_icon);
- register_left_softkey_handler();
- register_right_softkey_handler();
- wgui_inline_item_handled = 0;
- wgui_current_inline_item_type = 0;
- wgui_text_menuitem_restart_scrolling();
- /* if title is changed, we should redraw title */
- if (MMI_title_icon != inline_full_screen_edit_saved_title_icon ||
- MMI_title_string != inline_full_screen_edit_saved_title)
- {
- MMI_title_icon = inline_full_screen_edit_saved_title_icon;
- MMI_title_string = inline_full_screen_edit_saved_title;
- draw_title();
- }
- show_fixed_list();
- //MTK Leo add 0511, to reduce stack size
- // draw_title();
- //MTK Leo end
- inline_edit_current_highlight_handler(wgui_inline_item_highlighted_index);
- redraw_current_inline_item = UI_dummy_function;
- wgui_inputbox_UCS2_count_function = NULL;
- wgui_inputbox_not_empty_callback = NULL;
- wgui_inputbox_empty_callback = NULL;
- wgui_inputbox_validation_callback = NULL;
- inline_full_screen_edit_changed = 0;
- complete_inline_item_edit = UI_dummy_function;
- gdi_layer_unlock_frame_buffer();//111406 inline cancel
- gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
- #if defined(__MMI_TOUCH_SCREEN__)
- #ifdef __MMI_WGUI_CSK_ENABLE__
- /* W05.36 Add Center Soft Key for switching Input Method */
- set_softkey_label(NULL, MMI_CENTER_SOFTKEY);
- set_softkey_icon(NULL, MMI_CENTER_SOFTKEY);
- redraw_softkey(MMI_CENTER_SOFTKEY);
- clear_softkey_handler(MMI_CENTER_SOFTKEY);
- #endif /* __MMI_WGUI_CSK_ENABLE__ */
- #endif /* defined(__MMI_TOUCH_SCREEN__) */
- //gui_cancel_timer(UI_inputbox_blink_cursor);
- //MTK Elvis
- StopMyTimer(BLINKING_CURSOR);
- /* MTK end */
- }
- extern void wgui_handle_inputbox_input(void);
- /*****************************************************************************
- * FUNCTION
- * wgui_inline_edit_handle_multiline_inputbox_input
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_inline_edit_handle_multiline_inputbox_input(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_handle_inputbox_input();
- inline_full_screen_edit_changed = 1;
- #if defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__)
- if (wgui_current_inline_item_type == INLINE_ITEM_TYPE_MULTI_LINE_EDIT)
- {
- #ifdef __MMI_WITH_C_KEY__
- /* MTK for RSK display with C Key */
- /* Need to consider wgui_inline_list_menu_disable_done */
- if (wgui_inline_list_menu_changed && !(wgui_inline_list_menu_disable_done))
- {
- set_right_softkey_label(NULL);
- set_right_softkey_icon(NULL);
- redraw_right_softkey();
- }
- #else /* __MMI_WITH_C_KEY__ */
- /* MTK Terry for RSK sync in in-line multiline input box */
- if (wgui_inline_list_menu_changed && !(wgui_inline_list_menu_disable_done))
- {
- if (gui_multi_line_input_box_get_text_length(&MMI_multiline_inputbox) <= 0)
- {
- set_right_softkey_label(NULL);
- set_right_softkey_icon(NULL);
- redraw_right_softkey();
- if (MMI_right_softkey.flags & UI_BUTTON_STATE_CLICKED)
- {
- MMI_right_softkey.flags &= ~UI_BUTTON_STATE_CLICKED;
- MMI_right_softkey.flags &= ~UI_BUTTON_STATE_DOWN;
- }
- }
- }
- #endif /* __MMI_WITH_C_KEY__ */
- }
- #endif /* defined(__MMI_INSCREEN_MULTILINE_TEXTBOX__) */
- }
- /*****************************************************************************
- * FUNCTION
- * handle_inline_full_screen_edit
- * DESCRIPTION
- *
- * PARAMETERS
- * x [IN]
- * y [IN]
- * width [IN]
- * height [IN]
- * key_code [IN]
- * key_event [IN]
- * text_p [IN]
- * item [?]
- * flags [IN]
- * history_buffer [?]
- * RETURNS
- * void
- *****************************************************************************/
- void handle_inline_full_screen_edit(
- S32 x,
- S32 y,
- S32 width,
- S32 height,
- S32 key_code,
- S32 key_event,
- U8 **text_p,
- void *item,
- U32 flags,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 input_type;
- wgui_inline_item_text_edit *i = (wgui_inline_item_text_edit*) item;
- S32 inputbox_x = 0;
- S32 inputbox_y = (MMI_title_y + MMI_title_height);
- S32 inputbox_width = MMI_content_width;
- #if defined(__MMI_FULL_SCREEN_EDITOR__)
- S32 inputbox_height = MMI_content_height;
- #else
- S32 inputbox_height = MMI_content_height - MMI_multitap_height;
- #endif
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_current_input_ext_type = 0;
- UI_UNUSED_PARAMETER(x);
- UI_UNUSED_PARAMETER(y);
- UI_UNUSED_PARAMETER(width);
- UI_UNUSED_PARAMETER(height);
- UI_UNUSED_PARAMETER(key_code);
- UI_UNUSED_PARAMETER(key_event);
- UI_UNUSED_PARAMETER(flags);
- gdi_layer_lock_frame_buffer();
- wgui_text_menuitem_reset_scrolling();
- if (i->flags & INLINE_ITEM_CHANGED)
- {
- inline_full_screen_edit_changed = 1;
- }
- else
- {
- inline_full_screen_edit_changed = 0;
- }
- wgui_current_inline_item_type = INLINE_ITEM_TYPE_FULL_SCREEN_EDIT;
- current_wgui_inline_text_edit_item = i;
- current_wgui_inline_text_edit_text_p = text_p;
- input_type = i->input_type;
- if (!(i->flags & INLINE_ITEM_OPEN))
- {
- gui_strcpy((UI_string_type) wgui_inline_full_screen_text_edit_buffer, (UI_string_type) i->buffer);
- history_buffer = NULL;
- }
- i->flags &= ~INLINE_ITEM_OPEN;
- inline_full_screen_edit_saved_title = MMI_title_string;
- inline_full_screen_edit_saved_title_icon = MMI_title_icon;
- inline_full_screen_edit_saved_LSK_label = MMI_softkeys[MMI_LEFT_SOFTKEY].text;
- inline_full_screen_edit_saved_RSK_label = MMI_softkeys[MMI_RIGHT_SOFTKEY].text;
- inline_full_screen_edit_saved_LSK_icon = MMI_softkeys[MMI_LEFT_SOFTKEY].normal_up_icon;
- inline_full_screen_edit_saved_RSK_icon = MMI_softkeys[MMI_RIGHT_SOFTKEY].normal_up_icon;
- change_left_softkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- change_right_softkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- MMI_menu_shortcut_number = -1;
- MMI_disable_title_shortcut_display = 1;
- clear_key_handlers();
- change_left_softkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- change_right_softkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- clear_left_softkey();
- clear_right_softkey();
- register_left_softkey_handler();
- register_right_softkey_handler();
- register_default_hide_softkeys();
- MMI_title_string = get_string(i->title);
- MMI_title_icon = get_image(i->title_icon);
- register_hide_multitap(category5_hide_multitap);
- wgui_inputbox_validation_callback = i->validation_callback;
- if (i->custom_setup_function != NULL)
- {
- i->custom_setup_function();
- }
- /* MTK Add By Elvis for third party input module */
- #ifdef __MMI_T9__
- InuptMethodEnterCategory5();
- #elif defined __MMI_ZI__
- ZiInuptMethodEnterCategory5();
- //KP Jerry add on 2007-3-8 start
- #elif defined __MMI_CSTAR__
- CstarInputMethodEnterCategory5();
- //KP Jerry add on 2007-3-8 end
- #elif defined __MMI_KA__
- KonkaInuptMethodEnterCategory5();
- #elif defined __MMI_ITAP__
- /* under construction !*/
- #endif
- /* MTK end */
- wgui_setup_inputbox(
- inputbox_x,
- inputbox_y,
- inputbox_width,
- inputbox_height,
- wgui_inline_full_screen_text_edit_buffer,
- i->buffer_size,
- INLINE_FULL_SCREEN_EDIT_HISTORY_ID,
- get_string(STR_GLOBAL_BACK),
- get_image(IMG_GLOBAL_BACK),
- (S16) input_type,
- history_buffer,
- 1);
- /* MTK Terry for 0x81 encoding for Phone Book */
- MMI_current_input_ext_type = i->input_ext_type;
- /* Ailsa for remove new line symbol from password input type */
- if (((i->input_type & INPUT_TYPE_MASK) == INPUT_TYPE_NUMERIC_PASSWORD) ||
- ((i->input_type & INPUT_TYPE_MASK) == INPUT_TYPE_ALPHANUMERIC_PASSWORD) ||
- ((i->input_type & INPUT_TYPE_MASK) == INPUT_TYPE_SAT_NUMERIC_PASSWORD))
- {
- MMI_current_input_ext_type |= INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL;
- }
- /* it should be resize in wgui_setup_inputbox
- #if defined(__MMI_FULL_SCREEN_EDITOR__)
- inputbox_height = MMI_content_height - wgui_inputbox_information_bar_height;
- #else
- inputbox_height = MMI_content_height - MMI_multitap_height - wgui_inputbox_information_bar_height;
- #endif
- if (MMI_multiline_inputbox.height > inputbox_height)
- {
- gui_resize_multi_line_input_box(&MMI_multiline_inputbox, MMI_multiline_inputbox.width, inputbox_height);
- }
- */
- #if defined(__MMI_TOUCH_SCREEN__)
- mmi_pen_editor_resize_multiline_input_box_for_vk();
- #endif
- register_multiline_inputbox_input_callback(wgui_inline_edit_handle_multiline_inputbox_input);
- wgui_inputbox_RSK_function = handle_inline_full_screen_edit_cancel;
- redraw_current_inline_item = redraw_inline_full_screen_edit;
- /* set_left_softkey_function(handle_inline_full_screen_edit_complete,KEY_EVENT_UP); */
- /* 101105 inline Calvin Start */
- #ifdef __MMI_WALLPAPER_ON_BOTTOM__
- MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_TRANSPARENT_BACKGROUND;
- dm_get_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);
- 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 */
- #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */
- /* 101105 Calvin End */
- gdi_layer_unlock_frame_buffer();
- redraw_inline_full_screen_edit();
- complete_inline_item_edit = handle_inline_full_screen_edit_close;
- }
- /* MTK Terry for 0x81 encoding for Phone Book */
- /*****************************************************************************
- * FUNCTION
- * SetInlineItemFullScreenEdit
- * DESCRIPTION
- *
- * PARAMETERS
- * item [?]
- * title [IN]
- * title_icon [IN]
- * buffer [?]
- * buffer_size [IN]
- * input_type [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetInlineItemFullScreenEdit(
- InlineItem *item,
- U16 title,
- U16 title_icon,
- U8 *buffer,
- S32 buffer_size,
- S16 input_type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetInlineItemFullScreenEdit_ext(item, title, title_icon, buffer, buffer_size, input_type, 0);
- }
- /*****************************************************************************
- * FUNCTION
- * SetInlineItemFullScreenEdit_ext
- * DESCRIPTION
- *
- * PARAMETERS
- * item [?]
- * title [IN]
- * title_icon [IN]
- * buffer [?]
- * buffer_size [IN]
- * input_type [IN]
- * input_extended_type [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetInlineItemFullScreenEdit_ext(
- InlineItem *item,
- U16 title,
- U16 title_icon,
- U8 *buffer,
- S32 buffer_size,
- S16 input_type,
- S16 input_extended_type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_text_edit *i;
- UI_buffer_type mask_buffer;
- S16 t = input_type & INPUT_TYPE_MASK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (n_inline_text_edit_items >= MAX_INLINE_TEXT_EDIT_ITEMS)
- {
- return;
- }
- item->item = (void*)&wgui_inline_text_edit_items[n_inline_text_edit_items];
- item->flags = INLINE_ITEM_TYPE_FULL_SCREEN_EDIT;
- mask_buffer = inline_text_edit_mask_buffers[n_inline_text_edit_items];
- n_inline_text_edit_items++;
- i = (wgui_inline_item_text_edit*) item->item;
- i->max_lines = 0;
- i->title = title;
- i->title_icon = title_icon;
- i->buffer = buffer;
- i->buffer_size = buffer_size;
- i->flags = 0;
- i->input_type = input_type;
- i->input_ext_type = input_extended_type;
- item->text_p = i->buffer;
- item->handler = handle_inline_full_screen_edit;
- i->edit_complete_callback = UI_dummy_edit_complete_handler;
- i->custom_setup_function = NULL;
- i->validation_callback = UI_dummy_validation_function;
- if ((t == INPUT_TYPE_NUMERIC_PASSWORD) || (t == INPUT_TYPE_ALPHANUMERIC_PASSWORD) ||
- (t == INPUT_TYPE_SAT_NUMERIC_PASSWORD))
- {
- inline_edit_prepare_mask_buffer(buffer, mask_buffer);
- i->mask_buffer = mask_buffer;
- item->text_p = mask_buffer;
- }
- /* UCS2_count==-1 means this field hasn't been edited */
- i->UCS2_count = -1;
- }
- /*****************************************************************************
- * FUNCTION
- * ReConfigureInlineItemFullScreenEdit
- * DESCRIPTION
- *
- * PARAMETERS
- * item [?]
- * title [IN]
- * title_icon [IN]
- * buffer [?]
- * buffer_size [IN]
- * input_type [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ReConfigureInlineItemFullScreenEdit(
- InlineItem *item,
- U16 title,
- U16 title_icon,
- U8 *buffer,
- S32 buffer_size,
- S16 input_type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_text_edit *i;
- UI_buffer_type mask_buffer;
- S16 t = input_type & INPUT_TYPE_MASK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((item->flags & 0xff) != INLINE_ITEM_TYPE_FULL_SCREEN_EDIT)
- {
- return;
- }
- i = (wgui_inline_item_text_edit*) item->item;
- mask_buffer = i->mask_buffer;
- i->max_lines = 0;
- i->title = title;
- i->title_icon = title_icon;
- i->buffer = buffer;
- i->buffer_size = buffer_size;
- i->flags = 0;
- i->input_type = input_type;
- item->text_p = i->buffer;
- i->edit_complete_callback = UI_dummy_edit_complete_handler;
- i->custom_setup_function = NULL;
- if ((t == INPUT_TYPE_NUMERIC_PASSWORD) || (t == INPUT_TYPE_ALPHANUMERIC_PASSWORD) ||
- (t == INPUT_TYPE_SAT_NUMERIC_PASSWORD))
- {
- inline_edit_prepare_mask_buffer(buffer, mask_buffer);
- i->mask_buffer = mask_buffer;
- item->text_p = mask_buffer;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * SetInlineFullScreenEditCustomFunction
- * DESCRIPTION
- *
- * PARAMETERS
- * item [?]
- * f [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetInlineFullScreenEditCustomFunction(InlineItem *item, void (*f) (void))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_text_edit *i = (wgui_inline_item_text_edit*) item->item;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- i->custom_setup_function = f;
- }
- /*****************************************************************************
- * FUNCTION
- * RegisterInlineFullScreenEditCompleteHandler
- * DESCRIPTION
- *
- * PARAMETERS
- * item [?]
- * f [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void RegisterInlineFullScreenEditCompleteHandler(InlineItem *item, void (*f) (U8 *string, S32 buffer_size))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_text_edit *i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- i = (wgui_inline_item_text_edit*) item->item;
- if (f != NULL)
- {
- i->edit_complete_callback = f;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * RegisterInlineFullScreenEditValidationFunction
- * DESCRIPTION
- *
- * PARAMETERS
- * item [?]
- * f [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void RegisterInlineFullScreenEditValidationFunction(
- InlineItem *item,
- void (*f) (U8 *buffer, U8 *cursor, S32 text_length))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_text_edit *i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- i = (wgui_inline_item_text_edit*) item->item;
- if (f != NULL)
- {
- i->validation_callback = f;
- }
- }
- /*----------------------------------------------------------------------------
- Text menu items used for inline select
- ----------------------------------------------------------------------------*/
- #define MAX_INLINE_SELECT_MENU_ITEMS 60
- fixed_text_menuitem MMI_inline_select_item_common_data;
- fixed_text_menuitem_type MMI_inline_select_items[MAX_INLINE_SELECT_MENU_ITEMS];
- void *MMI_inline_select_items_p[MAX_INLINE_SELECT_MENU_ITEMS];
- S32 *inline_select_menu_n_items;
- horizontal_select MMI_inline_select_menu;
- /* Temporary images used by Inline select menu */
- const U8 inline_select_left_arrow_image[] =
- {
- 0x04, 0x01, 0x6F, 0x00, 0x00, 0x00,
- 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0C, 0x0E, 0x00, 0x00, 0x00,
- 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x00, 0x00, 0x00, 0x00, 0x34, 0x12, 0x34, 0x12,
- 0x34, 0x12, 0x34, 0x12, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12,
- 0x00, 0x00, 0xF8, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x34, 0x12, 0x34, 0x12, 0x00, 0x00, 0xF8, 0x00,
- 0xF8, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x00, 0x00, 0xF8, 0x00,
- 0xF8, 0x00, 0x00, 0x00, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x00, 0x00, 0xF8, 0x00,
- 0x00, 0x00, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x00, 0x00, 0x00, 0x00,
- 0x34, 0x12,
- };
- const U8 inline_select_right_arrow_image[] =
- {
- 0x04, 0x01, 0x6F, 0x00, 0x00, 0x00,
- 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0C, 0x0E, 0x00, 0x00, 0x00,
- 0x34, 0x12, 0x00, 0x00, 0x00, 0x00, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12,
- 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x00, 0x00,
- 0xF8, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x00, 0x00, 0xF8, 0x00,
- 0xF8, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x34, 0x12, 0x34, 0x12, 0x00, 0x00, 0xF8, 0x00, 0xF8, 0x00,
- 0x00, 0x00, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x34, 0x12,
- 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x00, 0x00, 0x00, 0x00, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12,
- 0x34, 0x12,
- };
- /*****************************************************************************
- * FUNCTION
- * wgui_show_inline_select_arrow
- * DESCRIPTION
- *
- * PARAMETERS
- * x1 [IN]
- * y1 [IN]
- * iwidth [IN]
- * iheight [IN]
- * item [?]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_show_inline_select_arrow(S32 x1, S32 y1, S32 iwidth, S32 iheight, wgui_inline_item *item)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /* START TARUN PMT 20041016 : For unwanted arrow images */
- fixed_icontext_menuitem_type *t = (fixed_icontext_menuitem_type*) item;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (t->flags & UI_MENUITEM_STATE_FOCUSSED)
- {
- draw_image_text_control(
- NULL,
- x1,
- y1,
- iwidth,
- iheight,
- item->side_img,
- (PU8) GetImage(IMG_H_SELECT_LEFT),
- (PU8) GetImage(IMG_H_SELECT_RIGHT),
- item->text_p,
- 0);
- }
- else
- {
- /* 20051012 HIMANSHU START INLINE SELECT */
- /* show the background before showing the inline select item, in case of
- default text effect is enabled. */
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- if (IsInlineItemDefaultTextEnable())
- {
- inline_item_default_text_show_background((x1 - 1), y1, (x1 - 1) + (iwidth - 1), y1 + iheight - 1);
- }
- #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */
- /* 20051012 HIMANSHU END INLINE SELECT */
- draw_image_text_control(NULL, x1, y1, iwidth, iheight, item->side_img, NULL, NULL, item->text_p, 0);
- }
- /* END TARUN PMT 20041016 */
- }
- /*****************************************************************************
- * FUNCTION
- * initialize_inline_select_menu_items
- * DESCRIPTION
- *
- * PARAMETERS
- * x [IN]
- * y [IN]
- * width [IN]
- * height [IN]
- * n_items [IN]
- * list_of_items [IN]
- * highlighted_item [?]
- * f [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void initialize_inline_select_menu_items(
- S32 x,
- S32 y,
- S32 width,
- S32 height,
- S32 n_items,
- U8 **list_of_items,
- S32 *highlighted_item,
- void (*f) (S32 item_index))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- UI_fixed_text_menuitem_theme *saved_themedata1 = current_fixed_text_menuitem_theme;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- current_fixed_text_menuitem_theme = &wgui_inline_select_fixed_text_menuitem_theme;
- gui_create_fixed_text_menuitem(&MMI_inline_select_item_common_data, width, height);
- gui_fixed_text_menuitem_set_text_position(&MMI_inline_select_item_common_data, 2, 0);
- MMI_inline_select_item_common_data.flags |= UI_MENUITEM_CENTER_TEXT_Y;
- #if(UI_TEXT_MENUITEM_SCROLL_TYPE == UI_TEXT_MENUITEM_SCROLL_TYPE_MARQUEE)
- MMI_inline_select_item_common_data.flags |= UI_MENUITEM_MARQUEE_SCROLL;
- #elif(UI_TEXT_MENUITEM_SCROLL_TYPE==UI_TEXT_MENUITEM_SCROLL_TYPE_TWO_DIRECTION)
- MMI_inline_select_item_common_data.flags |= UI_MENUITEM_TWO_DIRECTION_SCROLL;
- #endif
- wgui_text_menuitem_reset_scrolling = gui_fixed_text_menuitem_stop_scroll;
- wgui_text_menuitem_restart_scrolling = gui_fixed_text_menuitem_start_scroll;
- for (i = 0; i < n_items; i++)
- {
- MMI_inline_select_items[i].flags = UI_MENUITEM_CENTER_TEXT_X;
- MMI_inline_select_items[i].text = (UI_string_type) list_of_items[i];
- MMI_inline_select_items_p[i] = (void*)&MMI_inline_select_items[i];
- }
- temp_inline_select_menu_theme.background_filler = MMI_fixed_icontext_menuitem.focussed_filler;
- current_horizontal_select_theme = &temp_inline_select_menu_theme;
- /* PMT VIKAS START 20050817 */
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- if (line_draw)
- {
- if (r2lMMIFlag)
- /* for gap of arrow icon from the grid */
- {
- gui_create_horizontal_select(&MMI_inline_select_menu, x + 1, y + 1, width - 5, height - 1);
- }
- else
- {
- gui_create_horizontal_select(&MMI_inline_select_menu, x + 1, y + 1, width - 2, height - 1);
- }
- }
- else
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- /* PMT VIKAS END 20050817 */
- gui_create_horizontal_select(&MMI_inline_select_menu, x, y, width, height);
- MMI_inline_select_menu.flags |= UI_LIST_MENU_LOOP;
- gui_set_horizontal_select_common_item_data(&MMI_inline_select_menu, (void*)&MMI_inline_select_item_common_data);
- gui_set_horizontal_select_item_functions(
- &MMI_inline_select_menu,
- gui_show_fixed_text_menuitem,
- gui_measure_fixed_text_menuitem,
- gui_highlight_fixed_text_menuitem,
- gui_remove_highlight_fixed_text_menuitem,
- UI_fixed_menuitem_dummy_hide_function);
- gui_set_horizontal_select_images(
- &MMI_inline_select_menu,
- (U8*) GetImage(IMG_H_SELECT_LEFT),
- (U8*) GetImage(IMG_H_SELECT_RIGHT));
- if (f != NULL)
- {
- MMI_inline_select_menu.item_highlighted = f;
- }
- /* PMT VIKAS START 20050817 */
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- if (line_draw && r2lMMIFlag)
- {
- width = MMI_inline_select_menu.ix2 - MMI_inline_select_menu.ix1 - 4;
- }
- else
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- /* PMT VIKAS END 20050817 */
- width = MMI_inline_select_menu.ix2 - MMI_inline_select_menu.ix1;
- height = MMI_inline_select_menu.iy2 - MMI_inline_select_menu.iy1;
- gui_resize_fixed_text_menuitem(&MMI_inline_select_item_common_data, width, height);
- MMI_inline_select_menu.n_items = n_items;
- if (highlighted_item == NULL)
- {
- MMI_inline_select_menu.highlighted_item = 0;
- }
- else
- {
- MMI_inline_select_menu.highlighted_item = *highlighted_item;
- }
- if (MMI_inline_select_menu.highlighted_item > (MMI_inline_select_menu.n_items - 1))
- {
- MMI_inline_select_menu.highlighted_item = MMI_inline_select_menu.n_items - 1;
- }
- if (MMI_inline_select_menu.highlighted_item < 0)
- {
- MMI_inline_select_menu.highlighted_item = 0;
- }
- MMI_inline_select_menu.items = (void **)MMI_inline_select_items_p;
- MMI_inline_select_menu.item_highlight_function(
- MMI_inline_select_menu. items[MMI_inline_select_menu.highlighted_item],
- MMI_inline_select_menu.common_item_data);
- current_fixed_text_menuitem_theme = saved_themedata1;
- }
- /*****************************************************************************
- * FUNCTION
- * show_inline_select_menu
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void show_inline_select_menu(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 x = 0, width = 0, height = 0, img_y1 = 0;
- PU8 image;
- UI_fixed_text_menuitem_theme *saved_themedata1 = current_fixed_text_menuitem_theme;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- current_fixed_text_menuitem_theme = &wgui_inline_select_fixed_text_menuitem_theme;
- gui_set_fixed_text_menuitem_current_theme(&MMI_inline_select_item_common_data);
- temp_inline_select_menu_theme.background_filler = MMI_fixed_icontext_menuitem.focussed_filler;
- current_horizontal_select_theme = &temp_inline_select_menu_theme;
- gui_set_horizontal_select_current_theme(&MMI_inline_select_menu);
- /* PMT VIKAS START 20050527 */
- #ifdef __MMI_UI_TRANSPARENT_EFFECT__
- //PMT VIKAS START 20050630
- // This function call should be removed
- // gui_inline_edit_disable_transparent_effect(&MMI_inline_select_menu); // Disable for horizontel select
- //PMT VIKAS END 20050630
- #endif /* __MMI_UI_TRANSPARENT_EFFECT__ */
- //PMT VIKAS END
- //MTK Leo add, 040229
- MMI_inline_select_item_common_data.text_font = &MMI_medium_font;
- gui_show_horizontal_select(&MMI_inline_select_menu);
- if (wgui_inline_items[wgui_inline_item_highlighted_index].show_img_flag == TRUE)
- {
- image = wgui_inline_items[wgui_inline_item_highlighted_index].side_img;
- if (image)
- {
- gui_measure_image(image, &width, &height);
- img_y1 = (MMI_INLINE_EDIT_MENUITEM_HEIGHT >> 1) - (height >> 1);
- if (r2lMMIFlag)
- {
- gui_show_transparent_image(
- MMI_inline_select_menu.x + MMI_inline_select_menu.width + 2,
- (MMI_inline_select_menu.y + img_y1),
- image,
- 0);
- }
- else
- {
- gui_show_transparent_image(2, (MMI_inline_select_menu.y + img_y1), image, 0);
- }
- x = 2;
- }
- }
- else
- {
- x = MMI_inline_select_menu.x;
- }
- gdi_layer_blt_previous(
- MMI_inline_select_menu.x,
- MMI_inline_select_menu.y,
- MMI_inline_select_menu.x + MMI_inline_select_menu.width - 1,
- MMI_inline_select_menu.y + MMI_inline_select_menu.height - 1);
- current_fixed_text_menuitem_theme = saved_themedata1;
- UI_UNUSED_PARAMETER(x);
- }
- /*****************************************************************************
- * FUNCTION
- * inline_select_menu_previous_item
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void inline_select_menu_previous_item(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_horizontal_select_goto_previous_item(&MMI_inline_select_menu);
- show_inline_select_menu();
- set_wgui_inline_list_menu_changed();
- }
- /*****************************************************************************
- * FUNCTION
- * inline_select_menu_next_item
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void inline_select_menu_next_item(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_horizontal_select_goto_next_item(&MMI_inline_select_menu);
- show_inline_select_menu();
- set_wgui_inline_list_menu_changed();
- }
- /*****************************************************************************
- * FUNCTION
- * initialize_inline_user_defined_select_menu_items
- * DESCRIPTION
- *
- * PARAMETERS
- * x [IN]
- * y [IN]
- * width [IN]
- * height [IN]
- * text [?]
- * RETURNS
- * void
- *****************************************************************************/
- void initialize_inline_user_defined_select_menu_items(S32 x, S32 y, S32 width, S32 height, U8 *text)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- UI_fixed_text_menuitem_theme *saved_themedata1 = current_fixed_text_menuitem_theme;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- current_fixed_text_menuitem_theme = &wgui_inline_select_fixed_text_menuitem_theme;
- gui_create_fixed_text_menuitem(&MMI_inline_select_item_common_data, width, height);
- gui_fixed_text_menuitem_set_text_position(&MMI_inline_select_item_common_data, 2, 0);
- MMI_inline_select_item_common_data.flags |= UI_MENUITEM_CENTER_TEXT_Y;
- #if(UI_TEXT_MENUITEM_SCROLL_TYPE == UI_TEXT_MENUITEM_SCROLL_TYPE_MARQUEE)
- MMI_inline_select_item_common_data.flags |= UI_MENUITEM_MARQUEE_SCROLL;
- #elif(UI_TEXT_MENUITEM_SCROLL_TYPE==UI_TEXT_MENUITEM_SCROLL_TYPE_TWO_DIRECTION)
- MMI_inline_select_item_common_data.flags |= UI_MENUITEM_TWO_DIRECTION_SCROLL;
- #endif
- wgui_text_menuitem_reset_scrolling = gui_fixed_text_menuitem_stop_scroll;
- wgui_text_menuitem_restart_scrolling = gui_fixed_text_menuitem_start_scroll;
- MMI_inline_select_items[0].flags = UI_MENUITEM_CENTER_TEXT_X;
- MMI_inline_select_items[0].text = (UI_string_type) text;
- MMI_inline_select_items_p[0] = (void*)&MMI_inline_select_items[0];
- temp_inline_select_menu_theme.background_filler = MMI_fixed_icontext_menuitem.focussed_filler;
- current_horizontal_select_theme = &temp_inline_select_menu_theme;
- gui_create_horizontal_select(&MMI_inline_select_menu, x, y, width, height);
- MMI_inline_select_menu.flags |= UI_LIST_MENU_LOOP;
- gui_set_horizontal_select_common_item_data(&MMI_inline_select_menu, (void*)&MMI_inline_select_item_common_data);
- gui_set_horizontal_select_item_functions(
- &MMI_inline_select_menu,
- gui_show_fixed_text_menuitem,
- gui_measure_fixed_text_menuitem,
- gui_highlight_fixed_text_menuitem,
- gui_remove_highlight_fixed_text_menuitem,
- UI_fixed_menuitem_dummy_hide_function);
- gui_set_horizontal_select_images(
- &MMI_inline_select_menu,
- (U8*) GetImage(IMG_H_SELECT_LEFT),
- (U8*) GetImage(IMG_H_SELECT_RIGHT));
- width = MMI_inline_select_menu.ix2 - MMI_inline_select_menu.ix1;
- height = MMI_inline_select_menu.iy2 - MMI_inline_select_menu.iy1;
- gui_resize_fixed_text_menuitem(&MMI_inline_select_item_common_data, width, height);
- MMI_inline_select_menu.n_items = 1;
- MMI_inline_select_menu.highlighted_item = 0;
- MMI_inline_select_menu.items = (void **)MMI_inline_select_items_p;
- MMI_inline_select_menu.item_highlight_function(
- MMI_inline_select_menu. items[MMI_inline_select_menu.highlighted_item],
- MMI_inline_select_menu.common_item_data);
- current_fixed_text_menuitem_theme = saved_themedata1;
- }
- /*****************************************************************************
- * FUNCTION
- * show_inline_user_defined_select_menu
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void show_inline_user_defined_select_menu(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- UI_fixed_text_menuitem_theme *saved_themedata1 = current_fixed_text_menuitem_theme;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- current_fixed_text_menuitem_theme = &wgui_inline_select_fixed_text_menuitem_theme;
- gui_set_fixed_text_menuitem_current_theme(&MMI_inline_select_item_common_data);
- temp_inline_select_menu_theme.background_filler = MMI_fixed_icontext_menuitem.focussed_filler;
- current_horizontal_select_theme = &temp_inline_select_menu_theme;
- gui_set_horizontal_select_current_theme(&MMI_inline_select_menu);
- gui_show_horizontal_select(&MMI_inline_select_menu);
- gdi_layer_blt_previous(
- MMI_inline_select_menu.x,
- MMI_inline_select_menu.y,
- MMI_inline_select_menu.x + MMI_inline_select_menu.width - 1,
- MMI_inline_select_menu.y + MMI_inline_select_menu.height - 1);
- current_fixed_text_menuitem_theme = saved_themedata1;
- }
- /*----------------------------------------------------------------------------
- Inline select strings implementation
- ----------------------------------------------------------------------------*/
- #ifdef __MMI_DOWNLOADABLE_THEMES_SUPPORT__
- #define MAX_INLINE_SELECT_ITEMS 25 /* Made changes by Ritesh */
- #else
- #define MAX_INLINE_SELECT_ITEMS 10
- #endif
- extern S32 UI_text_menuitem_scroll_time; /* Robin Add, 1102 */
- S32 n_inline_select_items = 0;
- wgui_inline_item_select wgui_inline_select_items[MAX_INLINE_SELECT_ITEMS];
- wgui_inline_item_select *current_wgui_inline_select_item = NULL;
- S32 *current_wgui_inline_select_highlighted_item = NULL;
- U8 **current_wgui_inline_select_text_p = NULL;
- /*****************************************************************************
- * FUNCTION
- * clear_inline_select_menu_keys
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void clear_inline_select_menu_keys(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearKeyHandler(KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- clear_keyboard_key_handler();
- clear_inline_item_keys = UI_dummy_function;
- /* Robin Add, 1102 */
- UI_text_menuitem_scroll_time = UI_TEXT_MENUITEM_SCROLL_TIME;
- }
- /*****************************************************************************
- * FUNCTION
- * inline_select_menu_change_complete
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void inline_select_menu_change_complete(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_text_menuitem_reset_scrolling();
- wgui_text_menuitem_reset_scrolling = gui_fixed_icontext_menuitem_stop_scroll;
- wgui_text_menuitem_restart_scrolling = gui_fixed_icontext_menuitem_start_scroll;
- clear_inline_select_menu_keys();
- *(current_wgui_inline_select_item->highlighted_item) = MMI_inline_select_menu.highlighted_item;
- *current_wgui_inline_select_text_p =
- current_wgui_inline_select_item->list_of_strings[*(current_wgui_inline_select_item->highlighted_item)];
- MMI_fixed_icontext_menuitems[wgui_inline_item_highlighted_index].item_text =
- (UI_string_type) current_wgui_inline_select_item->
- list_of_strings[*(current_wgui_inline_select_item->highlighted_item)];
- *current_wgui_inline_select_highlighted_item = MMI_inline_select_menu.highlighted_item;
- redraw_current_inline_item = UI_dummy_function;
- #ifdef __MMI_TOUCH_SCREEN__
- wgui_current_inline_item_pen_function = UI_dummy_inline_item_pen_function;
- #endif
- current_wgui_inline_select_highlighted_item = NULL;
- wgui_inline_item_handled = 0;
- /* START TARUN PMT 20041016 : For unwanted arrow images */
- MMI_inline_select_menu.left_arrow_image = NULL;
- MMI_inline_select_menu.right_arrow_image = NULL;
- /* END TARUN PMT 20041016 */
- complete_inline_item_edit = UI_dummy_function;
- }
- /*****************************************************************************
- * FUNCTION
- * inline_select_menu_handle_up_arrow
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void inline_select_menu_handle_up_arrow(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- inline_select_menu_change_complete();
- inline_fixed_list_goto_previous_item();
- }
- /*****************************************************************************
- * FUNCTION
- * inline_select_menu_handle_down_arrow
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void inline_select_menu_handle_down_arrow(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- inline_select_menu_change_complete();
- inline_fixed_list_goto_next_item();
- }
- /*****************************************************************************
- * FUNCTION
- * inline_select_menu_keyboard_key_handler
- * DESCRIPTION
- *
- * PARAMETERS
- * vkey_code [IN]
- * key_state [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void inline_select_menu_keyboard_key_handler(S32 vkey_code, S32 key_state)
- {
- #if(MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32)
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (key_state)
- {
- switch (vkey_code)
- {
- case 37:
- inline_select_menu_previous_item();
- break;
- case 38:
- inline_select_menu_handle_up_arrow();
- break;
- case 39:
- inline_select_menu_next_item();
- break;
- case 40:
- inline_select_menu_handle_down_arrow();
- break;
- }
- }
- #else /* (MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32) */
- UI_UNUSED_PARAMETER(vkey_code);
- UI_UNUSED_PARAMETER(key_state);
- #endif /* (MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32) */
- }
- /*****************************************************************************
- * FUNCTION
- * register_inline_select_menu_keys
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void register_inline_select_menu_keys(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeyHandler(inline_select_menu_previous_item, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(inline_select_menu_next_item, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(inline_select_menu_handle_up_arrow, KEY_UP_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(inline_select_menu_handle_down_arrow, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(inline_select_menu_handle_up_arrow, KEY_VOL_UP, KEY_EVENT_DOWN);
- SetKeyHandler(inline_select_menu_handle_down_arrow, KEY_VOL_DOWN, KEY_EVENT_DOWN);
- register_keyboard_key_handler(inline_select_menu_keyboard_key_handler);
- }
- /*****************************************************************************
- * FUNCTION
- * redraw_inline_select
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void redraw_inline_select(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- show_inline_select_menu();
- }
- #ifdef __MMI_TOUCH_SCREEN__
- /*****************************************************************************
- * FUNCTION
- * inline_select_pen_handler
- * DESCRIPTION
- *
- * PARAMETERS
- * pen_event [IN]
- * x [IN]
- * y [IN]
- * item_event [?]
- * RETURNS
- *
- *****************************************************************************/
- BOOL inline_select_pen_handler(mmi_pen_event_type_enum pen_event, S16 x, S16 y, gui_inline_item_pen_enum *item_event)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- BOOL ret;
- gui_horizontal_select_pen_enum select_event;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ret = gui_horizontal_select_translate_pen_event(&MMI_inline_select_menu, pen_event, x, y, &select_event);
- if (ret)
- {
- switch (select_event)
- {
- case GUI_HORIZONTAL_SELECT_PEN_NONE:
- /* Do nothing */
- break;
- case GUI_HORIZONTAL_SELECT_PEN_PREV:
- inline_select_menu_previous_item();
- break;
- case GUI_HORIZONTAL_SELECT_PEN_NEXT:
- inline_select_menu_next_item();
- break;
- default:
- MMI_ASSERT(0);
- }
- }
- *item_event = GUI_INLINE_ITEM_PEN_NONE;
- return ret;
- }
- #endif /* __MMI_TOUCH_SCREEN__ */
- /*****************************************************************************
- * FUNCTION
- * current_inline_select_highlight_handler
- * DESCRIPTION
- *
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void current_inline_select_highlight_handler(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- *current_wgui_inline_select_highlighted_item = index;
- current_wgui_inline_select_item->item_highlighted(index);
- }
- /*****************************************************************************
- * FUNCTION
- * handle_inline_select
- * DESCRIPTION
- *
- * PARAMETERS
- * x [IN]
- * y [IN]
- * width [IN]
- * height [IN]
- * key_code [IN]
- * key_event [IN]
- * text_p [IN]
- * item [?]
- * flags [IN]
- * history_buffer [?]
- * RETURNS
- * void
- *****************************************************************************/
- void handle_inline_select(
- S32 x,
- S32 y,
- S32 width,
- S32 height,
- S32 key_code,
- S32 key_event,
- U8 **text_p,
- void *item,
- U32 flags,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_select *i = (wgui_inline_item_select*) item;
- S32 xx;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(key_event);
- UI_UNUSED_PARAMETER(key_code);
- UI_UNUSED_PARAMETER(flags);
- /* Robin Add, 1102 */
- UI_text_menuitem_scroll_time = 300;
- /* MTK Elvis for R2L characters */
- if (!r2lMMIFlag)
- {
- if (MMI_fixed_icontext_menuitem.text_x == 2)
- {
- xx = -1;