EditorPen.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:513k
源码类别:
MTK
开发平台:
C/C++
- *****************************************************************************/
- void mmi_pen_editor_smart_bpmf_pinyin_get_syllable_next(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((g_pen_editor_composition_index < PEN_EDITOR_MAX_SYLLABLE_CANDIDATE_SIZE - 1) &&
- g_pen_editor_syllable_table[g_pen_editor_composition_index + 1][0] != ' ')
- {
- g_pen_editor_composition_index++;
- }
- else if (g_pen_editor_composition_index == PEN_EDITOR_MAX_SYLLABLE_CANDIDATE_SIZE - 1)
- {
- g_pen_editor_composition_index = 0;
- g_pen_editor_composition_page++;
- if (!mmi_pen_editor_smart_bpmf_pinyin_get_candidates_by_key_sequence(&g_pen_editor_key_sequence, MMI_FALSE))
- {
- g_pen_editor_composition_index = PEN_EDITOR_MAX_SYLLABLE_CANDIDATE_SIZE - 1;
- g_pen_editor_composition_page--;
- }
- mmi_pen_editor_smart_bpmf_pinyin_get_candidates_by_key_sequence(&g_pen_editor_key_sequence, MMI_FALSE);
- }
- else
- {
- return;
- }
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_smart_bpmf_pinyin_set_syllable_by_index(g_pen_editor_composition_index);
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_smart_bpmf_pinyin_confirm_syllable
- * DESCRIPTION
- * Confirm the selected syllable and do the related action
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_smart_bpmf_pinyin_confirm_syllable(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- int i = 0, num = 0;
- UI_character_type candidate_buffer[PEN_EDITOR_MAX_CANDIDATE_SIZE];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- if (g_pen_editor_composition_state.candidate_state == PEN_EDITOR_CANDIDATE_ON_AND_FOCUS)
- {
- g_pen_editor_composition_state.candidate_state = PEN_EDITOR_CANDIDATE_ON_NOT_FOCUS;
- }
- gui_single_line_input_box_delete_all(&g_pen_editor_composition_input_box);
- for (i = 0;; i++)
- {
- if (g_pen_editor_syllable_table[g_pen_editor_composition_index][i])
- {
- gui_single_line_input_box_insert_character(
- &g_pen_editor_composition_input_box,
- g_pen_editor_syllable_table[g_pen_editor_composition_index][i]);
- }
- else
- {
- gui_single_line_input_box_insert_character(&g_pen_editor_composition_input_box, 0x20);
- break;
- }
- }
- mmi_pen_editor_show_composition_area(MMI_FALSE, PEN_EDITOR_CANDIDATE_ON_NOT_FOCUS);
- num = mmi_ime_get_candidates_by_composition(
- g_pen_editor_syllable_table[g_pen_editor_composition_index],
- candidate_buffer);
- gui_single_line_input_box_delete_all(&gPenEditorCandidateInputBox);
- for (i = 0; i < num; i++)
- {
- gui_single_line_input_box_insert_character(&gPenEditorCandidateInputBox, candidate_buffer[i]);
- }
- gui_single_line_input_box_goto_first_character(&gPenEditorCandidateInputBox);
- gui_single_line_input_box_next(&gPenEditorCandidateInputBox);
- mmi_pen_editor_show_candidate_area(MMI_TRUE, PEN_EDITOR_CANDIDATE_ON_AND_FOCUS);
- mmi_pen_editor_register_arrow_keys();
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_smart_bpmf_pinyin_set_syllable_by_index
- * DESCRIPTION
- * Set the smart BPMF/PinYin syllable by index
- * PARAMETERS
- * index [IN] The index of the syllable
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_smart_bpmf_pinyin_set_syllable_by_index(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 i = 0, num = 0;
- UI_character_type candidate_buffer[PEN_EDITOR_MAX_CANDIDATE_SIZE];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_pen_editor_hide_composition_area();
- gui_single_line_input_box_goto_first_character(&g_pen_editor_composition_input_box);
- for (i = 0;;)
- {
- UI_character_type ch, ch1, ch2;
- ch1 = *(g_pen_editor_composition_input_box.current_text_p - 2);
- ch2 = *(g_pen_editor_composition_input_box.current_text_p - 1);
- ch = ch1 | (ch2 << 8);
- if (ch == 0x20)
- {
- i++;
- }
- if (i == g_pen_editor_composition_index)
- {
- for (i = 0; i < g_pen_editor_key_sequence.KeyLength + 1; i++)
- {
- gui_single_line_input_box_next(&g_pen_editor_composition_input_box);
- }
- break;
- }
- gui_single_line_input_box_next(&g_pen_editor_composition_input_box);
- }
- gui_single_line_input_box_previous(&g_pen_editor_composition_input_box);
- gui_single_line_input_box_highlight_cursor_number(
- &g_pen_editor_composition_input_box,
- g_pen_editor_key_sequence.KeyLength);
- mmi_pen_editor_show_composition_area(MMI_TRUE, PEN_EDITOR_CANDIDATE_ON_AND_FOCUS);
- num = mmi_ime_get_candidates_by_composition(g_pen_editor_syllable_table[index], candidate_buffer);
- gui_single_line_input_box_delete_all(&gPenEditorCandidateInputBox);
- for (i = 0; i < num; i++)
- {
- gui_single_line_input_box_insert_character(&gPenEditorCandidateInputBox, candidate_buffer[i]);
- }
- gui_single_line_input_box_goto_first_character(&gPenEditorCandidateInputBox);
- gui_single_line_input_box_next(&gPenEditorCandidateInputBox);
- mmi_pen_editor_show_candidate_area(MMI_TRUE, PEN_EDITOR_CANDIDATE_ON_NOT_FOCUS);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_smart_bpmf_pinyin_set_syllable_by_position
- * DESCRIPTION
- * Get the syllable index by cursor position (Pen Down)
- * PARAMETERS
- * void
- * RETURNS
- * The syllable index
- *****************************************************************************/
- S32 mmi_pen_editor_smart_bpmf_pinyin_set_syllable_by_position(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- int i = 0;
- UI_buffer_type position;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (position = g_pen_editor_composition_input_box.text;;)
- {
- UI_character_type ch, ch1, ch2;
- ch1 = *(position);
- ch2 = *(position + 1);
- ch = ch1 | (ch2 << 8);
- if (ch == 0x20)
- {
- i++;
- }
- if (position == g_pen_editor_composition_input_box.current_text_p)
- {
- if (0 == ch || 0x20 == ch)
- {
- i--;
- }
- return i;
- }
- position += 2;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_set_inline_text_item
- * DESCRIPTION
- * Set the virtual keyboard and resize by in-line text item (Not Used Now)
- * PARAMETERS
- * i [IN] The inline text item
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_set_inline_text_item(const wgui_inline_item *i)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- int changed_height = 0;
- wgui_inline_item_text_edit *item_text =
- (wgui_inline_item_text_edit*) wgui_inline_items[wgui_inline_item_highlighted_index].item;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- changed_height = MMI_virtual_keyboard.height;
- switch ((item_text->input_type) & INPUT_TYPE_MASK)
- {
- case INPUT_TYPE_ALPHANUMERIC_LOWERCASE:
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH);
- break;
- case INPUT_TYPE_PHONE_NUMBER:
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_PHONE_NUMBER);
- break;
- case INPUT_TYPE_SAT_NUMERIC_PASSWORD:
- case INPUT_TYPE_KEYPAD_NUMERIC:
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_PHONE_NUMBER);
- break;
- case INPUT_TYPE_DECIMAL_NUMERIC:
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_NUMBER_DOT_TRAY);
- break;
- case INPUT_TYPE_NUMERIC:
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_NUMBER_TRAY);
- break;
- default:
- MMI_ASSERT(0);
- break;
- }
- changed_height -= MMI_virtual_keyboard.height;
- gPenEditorInputBoxType = PEN_EDITOR_INLINE_TEXT;
- mmi_pen_editor_resize_content_area(changed_height);
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_right_soft_key_handler
- * DESCRIPTION
- * Do the corresponding action for RSK according the state
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_right_soft_key_handler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- int candidatelength = 0;
- UI_character_type candidate_buffer[PEN_EDITOR_MAX_CANDIDATE_SIZE];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_pen_editor_smart_latin_pre_candidate_length)
- {
- if (mmi_pen_editor_del_key_sequence(&g_pen_editor_key_sequence))
- {
- gdi_layer_lock_frame_buffer();
- if (g_pen_editor_key_sequence.KeyLength)
- {
- candidatelength = mmi_ime_smart_latin_get_candidates_by_key_sequence(
- g_pen_editor_key_sequence.KeySequence,
- g_pen_editor_key_sequence.KeyLength,
- candidate_buffer);
- if (candidatelength)
- {
- mmi_pen_editor_smart_latin_replace_candidate(candidate_buffer, candidatelength);
- }
- }
- else
- {
- mmi_pen_editor_smart_latin_unhighlight_candidate(MMI_TRUE);
- mmi_pen_editor_set_left_soft_key();
- mmi_pen_editor_backspace();
- g_pen_editor_smart_latin_candidate_index = 0;
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_EMS_INPUT_BOX:
- register_EMS_inputbox_keys();
- handle_category28_input();
- wgui_set_EMS_inputbox_RSK();
- break;
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- register_multiline_inputbox_keys();
- wgui_handle_inputbox_input();
- wgui_set_RSK();
- break;
- default:
- break;
- }
- }
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- }
- return;
- }
- if (g_pen_editor_composition_state.candidate_state == PEN_EDITOR_CANDIDATE_ON_NOT_FOCUS &&
- (MMI_current_input_mode == INPUT_MODE_TR_STROKE || MMI_current_input_mode == INPUT_MODE_SM_STROKE))
- {
- if (mmi_pen_editor_del_key_sequence(&g_pen_editor_key_sequence))
- {
- gdi_layer_lock_frame_buffer();
- if (g_pen_editor_key_sequence.KeyLength)
- {
- mmi_pen_editor_chinese_stroke_get_candidates_by_key_sequence(&g_pen_editor_key_sequence);
- }
- else
- {
- int change_height = 0;
- g_pen_editor_composition_state.candidate_state = PEN_EDITOR_CANDIDATE_OFF;
- change_height += g_pen_editor_composition_input_box.height;
- mmi_pen_editor_resize_content_area(change_height);
- mmi_pen_editor_set_left_soft_key();
- gPenEditorVKState = PEN_EDITOR_VK_ON;
- gPenEditorSelectCandidate = MMI_FALSE;
- mmi_pen_editor_hide_candidate_area();
- mmi_pen_editor_change_handwriting_area();
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_EMS_INPUT_BOX:
- register_EMS_inputbox_keys();
- handle_category28_input();
- wgui_set_EMS_inputbox_RSK();
- break;
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- register_multiline_inputbox_keys();
- wgui_handle_inputbox_input();
- wgui_set_RSK();
- break;
- default:
- break;
- }
- }
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- }
- return;
- }
- if (g_pen_editor_composition_state.candidate_state != PEN_EDITOR_CANDIDATE_OFF &&
- (MMI_current_input_mode == INPUT_MODE_TR_BOPOMO || MMI_current_input_mode == INPUT_MODE_SM_PINYIN))
- {
- gdi_layer_lock_frame_buffer();
- if (g_pen_editor_composition_state.candidate_state == PEN_EDITOR_CANDIDATE_ON_AND_FOCUS)
- {
- if (mmi_pen_editor_del_key_sequence(&g_pen_editor_key_sequence))
- {
- if (g_pen_editor_key_sequence.KeyLength)
- {
- mmi_pen_editor_smart_bpmf_pinyin_get_candidates_by_key_sequence(
- &g_pen_editor_key_sequence,
- MMI_TRUE);
- mmi_pen_editor_show_composition_area(MMI_TRUE, PEN_EDITOR_CANDIDATE_ON_AND_FOCUS);
- }
- else
- {
- int change_height = 0;
- g_pen_editor_composition_state.candidate_state = PEN_EDITOR_CANDIDATE_OFF;
- change_height += g_pen_editor_composition_input_box.height;
- mmi_pen_editor_resize_content_area(change_height);
- mmi_pen_editor_set_left_soft_key();
- gPenEditorVKState = PEN_EDITOR_VK_ON;
- gPenEditorSelectCandidate = MMI_FALSE;
- mmi_pen_editor_hide_candidate_area();
- mmi_pen_editor_change_handwriting_area();
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_EMS_INPUT_BOX:
- register_EMS_inputbox_keys();
- handle_category28_input();
- wgui_set_EMS_inputbox_RSK();
- break;
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- register_multiline_inputbox_keys();
- wgui_handle_inputbox_input();
- wgui_set_RSK();
- break;
- default:
- break;
- }
- }
- }
- }
- else if (g_pen_editor_composition_state.candidate_state == PEN_EDITOR_CANDIDATE_ON_NOT_FOCUS)
- {
- mmi_pen_editor_smart_bpmf_pinyin_get_candidates_by_key_sequence(&g_pen_editor_key_sequence, MMI_FALSE);
- g_pen_editor_composition_state.candidate_state = PEN_EDITOR_CANDIDATE_ON_AND_FOCUS;
- mmi_pen_editor_show_composition_area(MMI_TRUE, PEN_EDITOR_CANDIDATE_ON_AND_FOCUS);
- mmi_pen_editor_smart_bpmf_pinyin_register_arrow_keys();
- }
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- return;
- }
- if (gPenEditorSelectCandidate && (0 == gPenEditorVKText.TextLength))
- {
- gdi_layer_lock_frame_buffer();
- gPenEditorSelectCandidate = MMI_FALSE;
- /* W05.50 Reset candidate index */
- mmi_pen_editor_reset_candidate_index();
- /* Temp Solution for LSK Text Update */
- mmi_pen_editor_set_left_soft_key();
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_EMS_INPUT_BOX:
- if (UI_EMS_INPUT_BOX_STATE_MULTITAP & MMI_EMS_inputbox.flags)
- {
- EMS_inputbox_multitap_input_complete();
- mmi_pen_editor_backspace();
- }
- register_EMS_inputbox_keys();
- wgui_set_EMS_inputbox_RSK();
- break;
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- if (UI_MULTI_LINE_INPUT_BOX_STATE_MULTITAP & MMI_multiline_inputbox.flags)
- {
- multiline_inputbox_multitap_input_complete();
- mmi_pen_editor_backspace();
- }
- register_multiline_inputbox_keys();
- if (PEN_EDITOR_DICT_MULTILINE_INPUT_BOX == gPenEditorInputBoxType)
- {
- cat201_register_key_func();
- }
- wgui_set_RSK();
- break;
- case PEN_EDITOR_SINGLE_LINE_INPU_BOX:
- wgui_singleline_inputbox_RSK_label_clear = 0;
- if (UI_SINGLE_LINE_INPUT_BOX_STATE_MULTITAP & MMI_singleline_inputbox.flags)
- {
- singleline_inputbox_multitap_input_complete();
- mmi_pen_editor_backspace();
- }
- register_singleline_inputbox_keys();
- wgui_set_singleline_RSK();
- break;
- case PEN_EDITOR_INLINE_TEXT:
- if (UI_SINGLE_LINE_INPUT_BOX_STATE_MULTITAP & MMI_inline_singleline_inputbox.flags)
- {
- inline_edit_singleline_inputbox_multitap_input_complete();
- mmi_pen_editor_backspace();
- }
- mmi_pen_editor_set_right_soft_key_inline_text();
- break;
- case PEN_EDITOR_DATE:
- case PEN_EDITOR_IP4:
- case PEN_EDITOR_TIME:
- case PEN_EDITOR_TIME_PERIOD:
- set_right_softkey_label(wgui_inline_edit_get_RSK_string());
- set_right_softkey_icon(NULL);
- register_right_softkey_handler();
- set_right_softkey_function(execute_wgui_inline_edit_RSK_function, KEY_EVENT_UP);
- redraw_right_softkey();
- break;
- default:
- break;
- }
- /* W05.35 For Candidates Lsit Issue */
- mmi_pen_editor_hide_candidate_area();
- if (PEN_EDITOR_VK_OFF == gPenEditorVKState)
- {
- int changed_height = 0;
- gPenEditorVKState = PEN_EDITOR_VK_ON;
- /* W05.47 Change the Input Control Height when the VK is not Tray Type */
- if (!(GUI_VIRTUAL_KEYBOARD_TRAY == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_EMPTY_TRAY == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_NUMBER_TRAY == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_NUMBER_DOT_TRAY == MMI_virtual_keyboard.lang_type)
- && !(PEN_EDITOR_HANDWRITING_STYLE_MULTI_BLOCK == mmi_pen_editor_get_handwriting_style()))
- {
- changed_height -= MMI_virtual_keyboard.height;
- if (!gPenEditorVKCandidate)
- {
- changed_height += gPenEditorCandidateInputBox.height;
- }
- if (PEN_EDITOR_DICT_MULTILINE_INPUT_BOX != gPenEditorInputBoxType)
- {
- mmi_pen_editor_resize_content_area(changed_height);
- }
- /* W05.36 For Clear Candidates Lsit Area when it need to display */
- if (gPenEditorVKCandidate)
- {
- gui_move_single_line_input_box(
- &gPenEditorCandidateInputBox,
- gPenEditorCandidateInputBox.x,
- MMI_virtual_keyboard.y - gPenEditorCandidateInputBox.height - 2);
- /* W05.35 For Candidates Lsit Issue */
- mmi_pen_editor_hide_candidate_area();
- }
- }
- /* W05.50 Exclude Virtual Keyboard Area from Handwriting Area */
- mmi_pen_editor_change_handwriting_area();
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- }
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- return;
- }
- if ((GUI_VIRTUAL_KEYBOARD_BOPOMO == MMI_virtual_keyboard.lang_type)
- || GUI_VIRTUAL_KEYBOARD_PINYIN == MMI_virtual_keyboard.lang_type)
- {
- if (INPUT_MODE_MMI_MULTITAP_BPMF == MMI_current_input_mode
- || INPUT_MODE_MMI_MULTITAP_PINYIN == MMI_current_input_mode)
- {
- mmi_pen_editor_backspace();
- }
- else
- {
- if (mmi_pen_editor_vk_delete_character(&gPenEditorVKText))
- {
- /* W05.35 Temp Solution for Candidate Index Issue */
- mmi_pen_editor_reset_candidate_index();
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_hide_candidate_area();
- gdi_layer_unlock_frame_buffer();
- if (mmi_pen_editor_get_candidates_by_vk())
- {
- gPenEditorSelectCandidate = MMI_TRUE;
- /* Temp Solution for LSK Text Update */
- //W05.35 For LSK Text Issue
- //mmi_pen_editor_store_LSK_Text();
- mmi_pen_editor_set_left_soft_key_select();
- set_left_softkey_function(mmi_pen_editor_left_soft_key_handler, KEY_EVENT_UP);
- set_left_softkey_function(mmi_pen_editor_hold_confirm, KEY_EVENT_DOWN);
- mmi_pen_editor_register_arrow_keys();
- }
- else
- {
- gPenEditorSelectCandidate = MMI_FALSE;
- /* Temp Solution for LSK Text Update */
- mmi_pen_editor_set_left_soft_key();
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_EMS_INPUT_BOX:
- register_EMS_inputbox_keys();
- break;
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- register_multiline_inputbox_keys();
- if (PEN_EDITOR_DICT_MULTILINE_INPUT_BOX == gPenEditorInputBoxType)
- {
- cat201_register_key_func();
- }
- break;
- default:
- break;
- }
- }
- wgui_set_virtual_keyboard_display_area((U8*) gPenEditorVKText.VKText, MMI_TRUE);
- if (0 == gPenEditorVKText.TextLength)
- {
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_EMS_INPUT_BOX:
- handle_category28_input();
- wgui_set_EMS_inputbox_RSK();
- break;
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- wgui_handle_inputbox_input();
- wgui_set_RSK();
- break;
- default:
- break;
- }
- }
- }
- else
- {
- mmi_pen_editor_backspace();
- }
- }
- }
- else
- {
- mmi_pen_editor_backspace();
- }
- /* W05.50 Exclude Virtual Keyboard Area from Handwriting Area */
- mmi_pen_editor_change_handwriting_area();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_left_soft_key_handler
- * DESCRIPTION
- * Do the corresponding action for LSK according the state
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_left_soft_key_handler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_ASSERT(!(mmi_pen_editor_left_soft_key_handler == gPenEditorLSKfunction));
- if (g_pen_editor_smart_latin_pre_candidate_length)
- {
- mmi_pen_editor_smart_latin_confirm_select();
- mmi_pen_editor_set_left_soft_key();
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_EMS_INPUT_BOX:
- register_EMS_inputbox_keys();
- handle_category28_input();
- wgui_set_EMS_inputbox_RSK();
- break;
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- register_multiline_inputbox_keys();
- wgui_handle_inputbox_input();
- wgui_set_RSK();
- break;
- default:
- break;
- }
- gdi_lcd_repaint_all();
- }
- else if (g_pen_editor_composition_state.candidate_state == PEN_EDITOR_CANDIDATE_ON_AND_FOCUS)
- {
- mmi_pen_editor_smart_bpmf_pinyin_confirm_syllable();
- }
- else if (gPenEditorSelectCandidate)
- {
- UI_character_type ch, ch1, ch2;
- g_pen_editor_hold_confirm = MMI_FALSE;
- gdi_layer_lock_frame_buffer();
- gui_cancel_timer(mmi_pen_editor_confirm_selection);
- ch1 = *(gPenEditorCandidateInputBox.current_text_p - 2);
- ch2 = *(gPenEditorCandidateInputBox.current_text_p - 1);
- ch = ch1 | (ch2 << 8);
- mmi_pen_editor_input_character(ch, MMI_FALSE);
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_EMS_INPUT_BOX:
- wgui_set_EMS_inputbox_RSK();
- break;
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- wgui_set_RSK();
- break;
- case PEN_EDITOR_SINGLE_LINE_INPU_BOX:
- wgui_singleline_inputbox_RSK_label_clear = 0;
- wgui_set_singleline_RSK();
- break;
- case PEN_EDITOR_INLINE_TEXT:
- mmi_pen_editor_set_right_soft_key_inline_text();
- break;
- case PEN_EDITOR_DATE:
- case PEN_EDITOR_IP4:
- case PEN_EDITOR_TIME:
- case PEN_EDITOR_TIME_PERIOD:
- set_right_softkey_label(wgui_inline_edit_get_RSK_string());
- set_right_softkey_icon(NULL);
- register_right_softkey_handler();
- set_right_softkey_function(execute_wgui_inline_edit_RSK_function, KEY_EVENT_UP);
- redraw_right_softkey();
- break;
- default:
- break;
- }
- /* Temp Solution for checking Chinese Characters */
- mmi_pen_editor_check_phrase(ch);
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- }
- else
- {
- gPenEditorLSKfunction();
- }
- /* W05.50 Exclude Virtual Keyboard Area from Handwriting Area */
- mmi_pen_editor_change_handwriting_area();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_switch_input_method
- * DESCRIPTION
- * Change the input method by sequence and do the related action
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_switch_input_method(void)
- {
- //Jerry add on 2007-1-17 start
- #if defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__)
- if(gPenEditorFirstStroke)
- {
- #endif
- //Jerry add on 2007-1-17 end
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- int changed_height = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* W05.34 for RSK and LSK issue when gPenEditorVKText reset */
- if (gPenEditorSelectCandidate || gPenEditorVKText.TextLength > 0)
- {
- //W05.43 Temp Solution for Switch Input Method Without Complete Selecting Candidate
- //W05.45 Temp Solution for Pen Down When Selecting Candidates
- if (gPenEditorSelectCandidate)
- {
- gui_cancel_timer(mmi_pen_editor_confirm_selection);
- mmi_pen_editor_confirm_selection();
- }
- gPenEditorSelectCandidate = MMI_FALSE;
- mmi_pen_editor_reset_vk_text(&gPenEditorVKText);
- wgui_set_virtual_keyboard_display_area((U8*) gPenEditorVKText.VKText, MMI_FALSE);
- mmi_pen_editor_hide_candidate_area();
- /* Temp Solution for LSK Text Update */
- mmi_pen_editor_set_left_soft_key();
- }
- if (g_pen_editor_smart_latin_pre_candidate_length)
- {
- mmi_pen_editor_smart_latin_confirm_select();
- mmi_pen_editor_set_left_soft_key();
- }
- if (g_pen_editor_composition_state.candidate_state != PEN_EDITOR_CANDIDATE_OFF)
- {
- int change_height = 0;
- g_pen_editor_composition_state.candidate_state = PEN_EDITOR_CANDIDATE_OFF;
- change_height += g_pen_editor_composition_input_box.height;
- mmi_pen_editor_resize_content_area(change_height);
- }
- /* W05.36 Add Center Soft Key for switching Input Method */
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_EMS_INPUT_BOX:
- handle_category28_change_input_mode();
- break;
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- wgui_handle_inputbox_change_input_mode();
- break;
- case PEN_EDITOR_QUICK_SEARCH_SINGLE_LINE_INPU_BOX:
- wgui_handle_qsearch_singleline_inputbox_change_input_mode();
- wgui_set_singleline_RSK();
- break;
- case PEN_EDITOR_SINGLE_LINE_INPU_BOX:
- wgui_handle_singleline_inputbox_change_input_mode();
- break;
- case PEN_EDITOR_INLINE_TEXT:
- wgui_handle_inline_singleline_inputbox_change_input_mode();
- break;
- default:
- MMI_ASSERT(0);
- break;
- }
- gdi_layer_lock_frame_buffer();
- if (GUI_VIRTUAL_KEYBOARD_TRAY != MMI_virtual_keyboard.lang_type)
- {
- changed_height = MMI_virtual_keyboard.height;
- mmi_pen_editor_hide_virtual_keyboard_area();
- if (gPenEditorVKCandidate)
- {
- mmi_pen_editor_set_virtual_keyboard_by_input_mode(MMI_current_input_mode);
- if (!gPenEditorVKCandidate)
- {
- changed_height += (gPenEditorCandidateInputBox.height + 1);
- }
- }
- else
- {
- mmi_pen_editor_set_virtual_keyboard_by_input_mode(MMI_current_input_mode);
- if (gPenEditorVKCandidate)
- {
- changed_height -= (gPenEditorCandidateInputBox.height + 1);
- gui_move_single_line_input_box(
- &gPenEditorCandidateInputBox,
- gPenEditorCandidateInputBox.x,
- MMI_virtual_keyboard.y - gPenEditorCandidateInputBox.height - 2);
- mmi_pen_editor_hide_candidate_area();
- }
- }
- changed_height -= MMI_virtual_keyboard.height;
- }
- #ifdef __MMI_EDITOR_PEN_VK_UNFOLD__
- else
- {
- if (PEN_EDITOR_HANDWRITING_STYLE_MULTI_BLOCK == mmi_pen_editor_get_handwriting_style())
- {
- mmi_pen_editor_disable_multi_block_handwriting();
- }
- else
- {
- mmi_pen_editor_vk_show();
- }
- }
- #endif
- mmi_pen_editor_resize_content_area(changed_height);
- /* W05.36 Adjust the List height for In-line Multiline Input Box */
- if (PEN_EDITOR_INLINE_TEXT == gPenEditorInputBoxType
- || PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX == gPenEditorInputBoxType)
- {
- S32 temp_multiline_height = MMI_multiline_inputbox.height;
- MMI_BOOL temp_VKCandidate = gPenEditorVKCandidate;
- U8 temp_current_input_mode = MMI_current_input_mode;
- gui_virtual_keyboard_language_enum keyboard_type = MMI_virtual_keyboard.lang_type;
- #ifdef __MMI_EDITOR_PEN_VK_UNFOLD__
- gPenEditorHideToTray = MMI_TRUE;
- #endif
- mmi_pen_editor_vk_list_menu_resize();
- #ifdef __MMI_EDITOR_PEN_VK_UNFOLD__
- gPenEditorHideToTray = MMI_FALSE;
- #endif
- MMI_current_input_mode = temp_current_input_mode;
- inputbox_change_mode();
- set_MMI_current_input_type();
- if (PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX == gPenEditorInputBoxType)
- {
- gui_resize_multi_line_input_box(
- &MMI_multiline_inputbox,
- MMI_multiline_inputbox.width,
- temp_multiline_height);
- gPenEditorVKCandidate = temp_VKCandidate;
- redraw_fixed_list();
- redraw_current_inline_item();
- }
- wgui_setup_virtual_keyboard(keyboard_type);
- if (PEN_EDITOR_HANDWRITING_STYLE_MULTI_BLOCK == mmi_pen_editor_get_handwriting_style())
- {
- if (GUI_VIRTUAL_KEYBOARD_TRAY == MMI_virtual_keyboard.lang_type)
- {
- wgui_move_virtual_keyboard(
- MMI_virtual_keyboard.x,
- MMI_content_y + MMI_content_height - PEN_EDITOR_BLOCK_HEIGHT + 3);
- }
- }
- if (gPenEditorVKCandidate)
- {
- gui_move_single_line_input_box(
- &gPenEditorCandidateInputBox,
- gPenEditorCandidateInputBox.x,
- MMI_virtual_keyboard.y - gPenEditorCandidateInputBox.height - 2);
- mmi_pen_editor_hide_candidate_area();
- }
- }
- gdi_layer_unlock_frame_buffer();
- if (PEN_EDITOR_QUICK_SEARCH_SINGLE_LINE_INPU_BOX == gPenEditorInputBoxType)
- {
- gdi_layer_lock_frame_buffer();
- cat200_virtual_keypad_callback();
- RedrawCategoryControlledArea200Screen(NULL);
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- }
- else
- {
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- }
- /* W05.34 Clear key handler when switching input method */
- /* W06.09 Touch Screen With Keypad V1 */
- /* mmi_pen_editor_clear_key_handler(); */
- //KP Jerry modify on 2007-4-17 start
- if (INPUT_MODE_SMART_UPPERCASE_ABC == MMI_current_input_mode || //KP Jerry remove "else" for adjust them order on 2007-4-17
- INPUT_MODE_SMART_LOWERCASE_ABC == MMI_current_input_mode //KP Jerry remove ")" to next lines on 2007-4-16
- //KP Jerry add on 2007-4-16 start
- #ifdef __MMI_LANG_VIETNAMESE__
- || INPUT_MODE_SMART_UPPERCASE_VIETNAMESE == MMI_current_input_mode
- || INPUT_MODE_SMART_LOWERCASE_VIETNAMESE == MMI_current_input_mode
- #endif/*__MMI_LANG_VIETNAMESE__*/
- #ifdef __MMI_LANG_RUSSIAN__
- || INPUT_MODE_SMART_UPPERCASE_RUSSIAN== MMI_current_input_mode
- || INPUT_MODE_SMART_LOWERCASE_RUSSIAN== MMI_current_input_mode
- #endif/*__MMI_LANG_RUSSIAN__*/
- #ifdef __MMI_LANG_THAI__
- || INPUT_MODE_SMART_THAI== MMI_current_input_mode
- #endif/*__MMI_LANG_THAI__*/
- //KP Jerry add on 2007-4-16 end
- )
- {
- mmi_pen_editor_smart_latin_register_key_function();
- }
- #if defined(__MMI_LANG_TR_CHINESE__) || defined(__MMI_LANG_SM_CHINESE__) //KP Jerry add on 2007-4-17
- else if (INPUT_MODE_TR_MULTITAP_BOPOMO == MMI_current_input_mode || //KP Jerry add "else" for adjust them order on 2007-4-17
- INPUT_MODE_SM_MULTITAP_PINYIN == MMI_current_input_mode)
- {
- mmi_pen_editor_bpmf_pinyin_create_multitap(MMI_current_input_mode);
- mmi_pen_editor_bpmf_pinyin_register_multitap_function();
- }
- else if (INPUT_MODE_TR_STROKE == MMI_current_input_mode || INPUT_MODE_SM_STROKE == MMI_current_input_mode)
- {
- mmi_pen_editor_chinese_stroke_register_key_function();
- }
- else if (INPUT_MODE_TR_BOPOMO == MMI_current_input_mode || INPUT_MODE_SM_PINYIN == MMI_current_input_mode)
- {
- mmi_pen_editor_smart_bpmf_pinyin_register_key_function();
- }
- #endif/*__MMI_LANG_TR_CHINESE__ || __MMI_LANG_SM_CHINESE__*/ //KP Jerry add on 2007-4-17
- //KP Jerry modify on 2007-4-17 end
- mmi_pen_editor_set_CSK_content();
- /* W05.50 Exclude Virtual Keyboard Area from Handwriting Area */
- mmi_pen_editor_change_handwriting_area();
- //Jerry add on 2007-1-17 start
- #if defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__)
- }
- #endif
- //Jerry add on 2007-1-17 end
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_change_inputbox_mode
- * DESCRIPTION
- * Change inputbox input mode
- * PARAMETERS
- * input_mode [IN] desired input mode
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_change_inputbox_mode(U8 input_mode)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- change_multiline_inputbox_mode(input_mode);
- wgui_redraw_input_information_bar();
- break;
- case PEN_EDITOR_EMS_INPUT_BOX:
- change_EMS_inputbox_mode(input_mode);
- wgui_EMS_redraw_input_information_bar();
- break;
- case PEN_EDITOR_SINGLE_LINE_INPU_BOX:
- change_singleline_inputbox_mode(input_mode);
- break;
- case PEN_EDITOR_INLINE_TEXT:
- inline_edit_change_singleline_inputbox_mode(input_mode);
- break;
- default:
- break;
- }
- if (INPUT_MODE_SMART_UPPERCASE_ABC == input_mode ||
- INPUT_MODE_SMART_LOWERCASE_ABC == input_mode //KP Jerry remove ")" to next lines on 2007-4-16
- //KP Jerry add on 2007-4-16 start
- #ifdef __MMI_LANG_VIETNAMESE__
- || INPUT_MODE_SMART_UPPERCASE_VIETNAMESE == input_mode
- || INPUT_MODE_SMART_LOWERCASE_VIETNAMESE == input_mode
- #endif/*__MMI_LANG_VIETNAMESE__*/
- #ifdef __MMI_LANG_RUSSIAN__
- || INPUT_MODE_SMART_UPPERCASE_RUSSIAN== input_mode
- || INPUT_MODE_SMART_LOWERCASE_RUSSIAN== input_mode
- #endif/*__MMI_LANG_RUSSIAN__*/
- #ifdef __MMI_LANG_THAI__
- || INPUT_MODE_SMART_THAI== input_mode
- #endif/*__MMI_LANG_THAI__*/
- //KP Jerry add on 2007-4-16 end
- )
- {
- mmi_pen_editor_smart_latin_register_key_function();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_vk_caps_lock
- * DESCRIPTION
- * Switch input method as Caps Lock
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_vk_caps_lock(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- gui_virtual_keyboard_language_enum vk_language;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (PEN_EDITOR_QUICK_SEARCH_SINGLE_LINE_INPU_BOX == gPenEditorInputBoxType)
- {
- return;
- }
- /* To Do : Check Other Input Method Mode */
- switch (MMI_current_input_mode)
- {
- //KP Jerry add on 2007-4-17 start
- #ifdef __MMI_LANG_VIETNAMESE__
- case INPUT_MODE_MULTITAP_UPPERCASE_VIETNAMESE:
- vk_language = GUI_VIRTUAL_KEYBOARD_ENGLISH;
- MMI_current_input_mode = INPUT_MODE_MULTITAP_LOWERCASE_VIETNAMESE;
- break;
- case INPUT_MODE_MULTITAP_LOWERCASE_VIETNAMESE:
- vk_language = GUI_VIRTUAL_KEYBOARD_ENGLISH_UPPERCASE;
- MMI_current_input_mode = INPUT_MODE_MULTITAP_UPPERCASE_VIETNAMESE;
- break;
- case INPUT_MODE_SMART_UPPERCASE_VIETNAMESE:
- vk_language = GUI_VIRTUAL_KEYBOARD_ENGLISH;
- MMI_current_input_mode = INPUT_MODE_SMART_LOWERCASE_VIETNAMESE;
- break;
- case INPUT_MODE_SMART_LOWERCASE_VIETNAMESE:
- vk_language = GUI_VIRTUAL_KEYBOARD_ENGLISH_UPPERCASE;
- MMI_current_input_mode = INPUT_MODE_SMART_UPPERCASE_VIETNAMESE;
- break;
- #endif /*__MMI_LANG_VIETNAMESE__*/
- #ifdef __MMI_LANG_RUSSIAN__
- case INPUT_MODE_MULTITAP_UPPERCASE_RUSSIAN:
- vk_language = GUI_VIRTUAL_KEYBOARD_RUSSIAN;
- MMI_current_input_mode = INPUT_MODE_MULTITAP_LOWERCASE_RUSSIAN;
- break;
- case INPUT_MODE_MULTITAP_LOWERCASE_RUSSIAN:
- vk_language = GUI_VIRTUAL_KEYBOARD_RUSSIAN_UPPERCASE;
- MMI_current_input_mode = INPUT_MODE_MULTITAP_UPPERCASE_RUSSIAN;
- break;
- case INPUT_MODE_SMART_UPPERCASE_RUSSIAN:
- vk_language = GUI_VIRTUAL_KEYBOARD_RUSSIAN;
- MMI_current_input_mode = INPUT_MODE_SMART_LOWERCASE_RUSSIAN;
- break;
- case INPUT_MODE_SMART_LOWERCASE_RUSSIAN:
- vk_language = GUI_VIRTUAL_KEYBOARD_RUSSIAN_UPPERCASE;
- MMI_current_input_mode = INPUT_MODE_SMART_UPPERCASE_RUSSIAN;
- break;
- #endif /*__MMI_LANG_RUSSIAN__*/
- #ifdef __MMI_LANG_THAI__
- case INPUT_MODE_MULTITAP_THAI:
- vk_language = GUI_VIRTUAL_KEYBOARD_ENGLISH_UPPERCASE;
- MMI_current_input_mode = INPUT_MODE_MULTITAP_THAI;
- break;
- case INPUT_MODE_SMART_THAI:
- vk_language = GUI_VIRTUAL_KEYBOARD_ENGLISH_UPPERCASE;
- MMI_current_input_mode = INPUT_MODE_SMART_THAI;
- break;
- #endif /*__MMI_LANG_THAI__*/
- //KP Jerry add on 2007-4-17 end
- case INPUT_MODE_MULTITAP_UPPERCASE_ABC :
- vk_language = GUI_VIRTUAL_KEYBOARD_ENGLISH;
- MMI_current_input_mode = INPUT_MODE_MULTITAP_LOWERCASE_ABC;
- break;
- case INPUT_MODE_MULTITAP_LOWERCASE_ABC :
- vk_language = GUI_VIRTUAL_KEYBOARD_ENGLISH_UPPERCASE;
- MMI_current_input_mode = INPUT_MODE_MULTITAP_UPPERCASE_ABC;
- break;
- case INPUT_MODE_MULTITAP_UPPERCASE_ABC_NO_NUMERIC :
- vk_language = GUI_VIRTUAL_KEYBOARD_ENGLISH;
- MMI_current_input_mode = INPUT_MODE_MULTITAP_LOWERCASE_ABC_NO_NUMERIC;
- break;
- case INPUT_MODE_MULTITAP_LOWERCASE_ABC_NO_NUMERIC :
- vk_language = GUI_VIRTUAL_KEYBOARD_ENGLISH_UPPERCASE;
- MMI_current_input_mode = INPUT_MODE_MULTITAP_UPPERCASE_ABC_NO_NUMERIC;
- break;
- case INPUT_MODE_SMART_UPPERCASE_ABC :
- vk_language = GUI_VIRTUAL_KEYBOARD_ENGLISH;
- MMI_current_input_mode = INPUT_MODE_SMART_LOWERCASE_ABC;
- break;
- case INPUT_MODE_SMART_LOWERCASE_ABC :
- vk_language = GUI_VIRTUAL_KEYBOARD_ENGLISH_UPPERCASE;
- MMI_current_input_mode = INPUT_MODE_SMART_UPPERCASE_ABC;
- break;
- default :
- vk_language = GUI_VIRTUAL_KEYBOARD_ENGLISH;
- break;
- }
- wgui_setup_virtual_keyboard(vk_language);
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- mmi_pen_editor_change_inputbox_mode(MMI_current_input_mode);
- /* W05.36 Fix Center Soft Key Sync Issue */
- set_MMI_current_input_type();
- mmi_pen_editor_set_CSK_content();
- /* W06.09 Touch Screen With Keypad V1 */
- /* mmi_pen_editor_clear_key_handler(); */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_vk_insertcharacter
- * DESCRIPTION
- * Insert the character to the input box or virtual keyboard text according to the situation
- * PARAMETERS
- * vk_para [IN] The data returned by pen event
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_vk_insertcharacter(gui_pen_event_param_struct vk_para)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((GUI_VIRTUAL_KEYBOARD_BOPOMO == MMI_virtual_keyboard.lang_type)
- || GUI_VIRTUAL_KEYBOARD_PINYIN == MMI_virtual_keyboard.lang_type)
- {
- if (INPUT_MODE_MMI_MULTITAP_BPMF == MMI_current_input_mode
- || INPUT_MODE_MMI_MULTITAP_PINYIN == MMI_current_input_mode)
- {
- mmi_pen_editor_input_character((UI_character_type) vk_para._u.i, MMI_FALSE);
- }
- else
- {
- if (!((vk_para._u.i > 0x60 && vk_para._u.i < 0x7b) || (vk_para._u.i > 0x3104 && vk_para._u.i < 0x3130)))
- {
- /* W05.36 Temp Solution Do nothing when there is candidates list */
- if (0 == gPenEditorVKText.TextLength && !gPenEditorSelectCandidate)
- {
- mmi_pen_editor_input_character((UI_character_type) vk_para._u.i, MMI_FALSE);
- }
- }
- else if (mmi_pen_editor_vk_insert_character(&gPenEditorVKText, (UI_character_type) vk_para._u.i))
- {
- /* Check the input is valid or not */
- if (mmi_pen_editor_get_candidates_by_vk())
- {
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- wgui_inputbox_RSK_label_clear = 1;
- break;
- case PEN_EDITOR_EMS_INPUT_BOX:
- category28_RSK_label_clear = 1;
- break;
- default:
- break;
- }
- /* Temp Solution for LSK Text Update */
- /* W05.35 For LSK Text Issue */
- if (gPenEditorVKText.TextLength == 1 && MMI_FALSE == gPenEditorSelectCandidate)
- {
- mmi_pen_editor_store_LSK_Text();
- }
- mmi_pen_editor_set_left_soft_key_select();
- set_left_softkey_function(mmi_pen_editor_left_soft_key_handler, KEY_EVENT_UP);
- set_left_softkey_function(mmi_pen_editor_hold_confirm, KEY_EVENT_DOWN);
- gPenEditorSelectCandidate = MMI_TRUE;
- mmi_pen_editor_register_arrow_keys();
- mmi_pen_editor_set_right_softkey(PEN_EDITOR_RSK_CLEAR);
- }
- else
- {
- mmi_pen_editor_vk_delete_character(&gPenEditorVKText);
- mmi_pen_editor_get_candidates_by_vk();
- }
- wgui_set_virtual_keyboard_display_area((U8*) gPenEditorVKText.VKText, MMI_TRUE);
- }
- else if (!(vk_para._u.i > 0x60 && vk_para._u.i < 0x7b) &&
- (GUI_VIRTUAL_KEYBOARD_PINYIN == MMI_virtual_keyboard.lang_type))
- {
- mmi_pen_editor_input_character((UI_character_type) vk_para._u.i, MMI_FALSE);
- }
- }
- }
- else
- {
- if (0 != vk_para._u.i)
- {
- mmi_pen_editor_input_character((UI_character_type) vk_para._u.i, MMI_FALSE);
- }
- else
- {
- /* Test for Multitap */
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_vk_hide
- * DESCRIPTION
- * Set the virtual keyboard to the tray type
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_vk_hide(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- int changed_height = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (PEN_EDITOR_QUICK_SEARCH_SINGLE_LINE_INPU_BOX == gPenEditorInputBoxType)
- {
- /* W06.04 For Chinese Symbols Keyboard in Quick Search */
- if (GUI_VIRTUAL_KEYBOARD_BOPOMO == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_PINYIN == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_NUMBER == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_ENGLISH == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_SYMBOL == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL == MMI_virtual_keyboard.lang_type)
- {
- changed_height = MMI_virtual_keyboard.height;
- mmi_pen_editor_hide_virtual_keyboard_area();
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_TRAY);
- changed_height -= gPenEditorCandidateInputBox.height;
- mmi_pen_editor_resize_content_area(changed_height);
- RedrawCategoryControlledArea200Screen(NULL);
- }
- return;
- }
- if (GUI_VIRTUAL_KEYBOARD_TRAY != MMI_virtual_keyboard.lang_type)
- {
- /* W05.32 INPUT_TYPE_PHONE_NUMBER won't use tray virtual keyboard */
- if (GUI_VIRTUAL_KEYBOARD_PHONE_NUMBER == MMI_virtual_keyboard.lang_type)
- {
- return;
- }
- gdi_layer_lock_frame_buffer();
- changed_height = MMI_virtual_keyboard.height;
- //KP Jerry modify on 2007-3-17 start
- #if defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__)
- if (GUI_VIRTUAL_KEYBOARD_BOPOMO==MMI_virtual_keyboard.lang_type
- ||GUI_VIRTUAL_KEYBOARD_PINYIN==MMI_virtual_keyboard.lang_type
- ||(GUI_VIRTUAL_KEYBOARD_SYMBOL==MMI_virtual_keyboard.lang_type
- &&(INPUT_MODE_TR_STROKE==MMI_current_input_mode
- ||INPUT_MODE_SM_STROKE==MMI_current_input_mode)))
- #else
- if (GUI_VIRTUAL_KEYBOARD_BOPOMO == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_PINYIN == MMI_virtual_keyboard.lang_type)
- #endif
- //KP Jerry modify on 2007-3-17 end
- {
- changed_height += (gPenEditorCandidateInputBox.height + 1);
- if (gPenEditorVKCandidate)
- {
- gPenEditorVKCandidate = MMI_FALSE;
- }
- mmi_pen_editor_reset_LSK_and_RSK_state();
- }
- /* mmi_pen_editor_reset_vk_text(&gPenEditorVKText); */
- mmi_pen_editor_hide_virtual_keyboard_area();
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_TRAY);
- /* changed_height -= MMI_virtual_keyboard.height; */
- changed_height -= gPenEditorCandidateInputBox.height;
- mmi_pen_editor_resize_content_area(changed_height);
- /* W05.36 Adjust the List height for In-line Multiline Input Box */
- if (PEN_EDITOR_INLINE_TEXT == gPenEditorInputBoxType
- || PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX == gPenEditorInputBoxType)
- {
- S32 temp_multiline_height = MMI_multiline_inputbox.height;
- #ifdef __MMI_EDITOR_PEN_VK_UNFOLD__
- gPenEditorHideToTray = MMI_TRUE;
- #endif
- mmi_pen_editor_vk_list_menu_resize();
- #ifdef __MMI_EDITOR_PEN_VK_UNFOLD__
- gPenEditorHideToTray = MMI_FALSE;
- #endif
- if (PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX == gPenEditorInputBoxType)
- {
- gui_resize_multi_line_input_box(
- &MMI_multiline_inputbox,
- MMI_multiline_inputbox.width,
- temp_multiline_height);
- redraw_fixed_list();
- redraw_current_inline_item();
- }
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_TRAY);
- }
- gui_move_single_line_input_box(
- &gPenEditorCandidateInputBox,
- gPenEditorCandidateInputBox.x,
- PEN_EDITOR_Y_OF_CANDIDATE_INPUT_BOX_IN_BOTTOM);
- gdi_layer_unlock_frame_buffer();
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- }
- /* W05.50 Exclude Virtual Keyboard Area from Handwriting Area */
- mmi_pen_editor_change_handwriting_area();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_vk_show
- * DESCRIPTION
- * Enlarge the virtual keyboard according to the input mothod
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_vk_show(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- int changed_height = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (PEN_EDITOR_QUICK_SEARCH_SINGLE_LINE_INPU_BOX == gPenEditorInputBoxType)
- {
- changed_height = MMI_virtual_keyboard.height;
- if (changed_height < gPenEditorCandidateInputBox.height)
- {
- changed_height = gPenEditorCandidateInputBox.height;
- }
- mmi_pen_editor_set_virtual_keyboard_by_input_mode(MMI_current_input_mode);
- changed_height -= MMI_virtual_keyboard.height;
- mmi_pen_editor_resize_content_area(changed_height);
- RedrawCategoryControlledArea200Screen(NULL);
- return;
- }
- if (GUI_VIRTUAL_KEYBOARD_TRAY == MMI_virtual_keyboard.lang_type)
- {
- /* changed_height = MMI_virtual_keyboard.height; */
- changed_height = gPenEditorCandidateInputBox.height;
- //KP Jerry modify on 2007-4-17 start
- if (INPUT_MODE_MULTITAP_LOWERCASE_ABC == MMI_current_input_mode || //KP Jerry remove "else" for adjust them order on 2007-4-16
- INPUT_MODE_SMART_LOWERCASE_ABC == MMI_current_input_mode ||
- INPUT_MODE_MULTITAP_LOWERCASE_ABC_NO_NUMERIC == MMI_current_input_mode)
- {
- if (gPenEditorVKCandidate)
- {
- changed_height += gPenEditorCandidateInputBox.height;
- }
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH);
- }
- else if (INPUT_MODE_MULTITAP_UPPERCASE_ABC == MMI_current_input_mode ||
- INPUT_MODE_SMART_UPPERCASE_ABC == MMI_current_input_mode ||
- INPUT_MODE_MULTITAP_UPPERCASE_ABC_NO_NUMERIC == MMI_current_input_mode)
- {
- if (gPenEditorVKCandidate)
- {
- changed_height += gPenEditorCandidateInputBox.height;
- }
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH_UPPERCASE);
- }
- else if (INPUT_MODE_123 == MMI_current_input_mode ||
- INPUT_MODE_123_SYMBOLS == MMI_current_input_mode)
- {
- if (gPenEditorVKCandidate)
- {
- changed_height += gPenEditorCandidateInputBox.height;
- }
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_NUMBER);
- }
- #ifdef __MMI_LANG_TR_CHINESE__ //KP Jerry add on 2007-4-16
- else if (INPUT_MODE_TR_MULTITAP_BOPOMO == MMI_current_input_mode || INPUT_MODE_TR_BOPOMO == MMI_current_input_mode) //KP Jerry delete "INPUT_MODE_TR_STROKE == MMI_current_input_mode" on 2007-3-21
- {
- if (!gPenEditorVKCandidate)
- {
- changed_height -= (gPenEditorCandidateInputBox.height + 1);
- gPenEditorVKCandidate = MMI_TRUE;
- }
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_BOPOMO);
- }
- //KP Jerry add on 2007-3-21 start
- else if(INPUT_MODE_TR_STROKE==MMI_current_input_mode)
- {
- if (!gPenEditorVKCandidate)
- {
- changed_height -= (gPenEditorCandidateInputBox.height + 1);
- gPenEditorVKCandidate = MMI_TRUE;
- }
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_SYMBOL);
- }
- //KP Jerry add on 2007-3-21 end
- #endif/*__MMI_LANG_TR_CHINESE__*/ //KP Jerry add on 2007-4-16
- #ifdef __MMI_LANG_SM_CHINESE__ //KP Jerry add on 2007-4-16
- else if (INPUT_MODE_SM_MULTITAP_PINYIN == MMI_current_input_mode || INPUT_MODE_SM_PINYIN == MMI_current_input_mode) //KP Jerry delete "INPUT_MODE_SM_STROKE == MMI_current_input_mode" on 2007-3-21
- {
- if (!gPenEditorVKCandidate)
- {
- changed_height -= (gPenEditorCandidateInputBox.height + 1);
- gPenEditorVKCandidate = MMI_TRUE;
- }
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_PINYIN);
- }
- //KP Jerry add on 2007-3-21 start
- else if(INPUT_MODE_SM_STROKE==MMI_current_input_mode)
- {
- if (!gPenEditorVKCandidate)
- {
- changed_height -= (gPenEditorCandidateInputBox.height + 1);
- gPenEditorVKCandidate = MMI_TRUE;
- }
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_SYMBOL);
- }
- //KP Jerry add on 2007-3-21 end
- #endif/*__MMI_LANG_SM_CHINESE__*/ //KP Jerry add on 2007-4-16
- //KP Jerry add on 2007-4-17 start
- #ifdef __MMI_LANG_VIETNAMESE__
- else if (INPUT_MODE_MULTITAP_LOWERCASE_VIETNAMESE == MMI_current_input_mode ||
- INPUT_MODE_SMART_LOWERCASE_VIETNAMESE == MMI_current_input_mode)
- {
- if (gPenEditorVKCandidate)
- {
- changed_height += gPenEditorCandidateInputBox.height;
- }
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH);
- }
- else if (INPUT_MODE_MULTITAP_UPPERCASE_VIETNAMESE == MMI_current_input_mode ||
- INPUT_MODE_SMART_UPPERCASE_VIETNAMESE == MMI_current_input_mode)
- {
- if (gPenEditorVKCandidate)
- {
- changed_height += gPenEditorCandidateInputBox.height;
- }
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH_UPPERCASE);
- }
- #endif
- #ifdef __MMI_LANG_RUSSIAN__
- else if (INPUT_MODE_MULTITAP_LOWERCASE_RUSSIAN == MMI_current_input_mode ||
- INPUT_MODE_SMART_LOWERCASE_RUSSIAN == MMI_current_input_mode)
- {
- if (gPenEditorVKCandidate)
- {
- changed_height += gPenEditorCandidateInputBox.height;
- }
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_RUSSIAN);
- }
- else if (INPUT_MODE_MULTITAP_UPPERCASE_RUSSIAN == MMI_current_input_mode ||
- INPUT_MODE_SMART_UPPERCASE_RUSSIAN == MMI_current_input_mode)
- {
- if (gPenEditorVKCandidate)
- {
- changed_height += gPenEditorCandidateInputBox.height;
- }
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_RUSSIAN_UPPERCASE);
- }
- #endif
- #ifdef __MMI_LANG_THAI__
- else if (INPUT_MODE_MULTITAP_THAI == MMI_current_input_mode)
- {
- if (gPenEditorVKCandidate)
- {
- changed_height += gPenEditorCandidateInputBox.height;
- }
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH_UPPERCASE);
- }
- #endif
- //KP Jerry add on 2007-4-17 end
- //KP Jerry modify on 2007-4-17 end
- changed_height -= MMI_virtual_keyboard.height;
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_resize_content_area(changed_height);
- /* W05.36 Adjust the List height for In-line Multiline Input Box */
- if (PEN_EDITOR_INLINE_TEXT == gPenEditorInputBoxType
- || PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX == gPenEditorInputBoxType)
- {
- S32 temp_multiline_height = MMI_multiline_inputbox.height;
- MMI_BOOL temp_VKCandidate = gPenEditorVKCandidate;
- gui_virtual_keyboard_language_enum keyboard_type = MMI_virtual_keyboard.lang_type;
- mmi_pen_editor_vk_list_menu_resize();
- if (PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX == gPenEditorInputBoxType)
- {
- gui_resize_multi_line_input_box(
- &MMI_multiline_inputbox,
- MMI_multiline_inputbox.width,
- temp_multiline_height);
- redraw_fixed_list();
- redraw_current_inline_item();
- gPenEditorVKCandidate = temp_VKCandidate;
- }
- wgui_setup_virtual_keyboard(keyboard_type);
- }
- gui_move_single_line_input_box(
- &gPenEditorCandidateInputBox,
- gPenEditorCandidateInputBox.x,
- MMI_virtual_keyboard.y - gPenEditorCandidateInputBox.height - 2);
- if (gPenEditorVKCandidate)
- {
- mmi_pen_editor_hide_candidate_area();
- }
- gdi_layer_unlock_frame_buffer();
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- }
- /* W05.50 Exclude Virtual Keyboard Area from Handwriting Area */
- mmi_pen_editor_change_handwriting_area();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_vk_symbol_picker
- * DESCRIPTION
- * Set the virtual keyboard to the symbol type
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_vk_symbol_picker(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- int changed_height = 0;
- MMI_BOOL is_back_to_multi_block = MMI_FALSE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (PEN_EDITOR_QUICK_SEARCH_SINGLE_LINE_INPU_BOX == gPenEditorInputBoxType)
- {
- changed_height = MMI_virtual_keyboard.height;
- if (changed_height < gPenEditorCandidateInputBox.height)
- {
- changed_height = gPenEditorCandidateInputBox.height;
- }
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_hide_virtual_keyboard_area();
- //KP Jerry modify on 2007-3-17 start
- #if defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__)
- if ((GUI_VIRTUAL_KEYBOARD_SYMBOL==MMI_virtual_keyboard.lang_type
- && INPUT_MODE_MMI_TR_STROKE!=MMI_current_input_mode
- && INPUT_MODE_MMI_SM_STROKE!=MMI_current_input_mode)
- || GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL==MMI_virtual_keyboard.lang_type)
- #else
- if (GUI_VIRTUAL_KEYBOARD_SYMBOL == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL == MMI_virtual_keyboard.lang_type)
- #endif
- //KP Jerry modify on 2007-3-17 end
- {
- wgui_setup_virtual_keyboard(gPenEditorPreviousVirtualKeyboardType);
- }
- else
- {
- //W05.34 For Chinese Symbols Keyboard
- //W06.04 For Chinese Symbols Keyboard in Quick Search
- gPenEditorPreviousVirtualKeyboardType = MMI_virtual_keyboard.lang_type;
- //KP Jerry modify on 2007-3-17 start
- #if defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__)
- if (INPUT_MODE_MMI_MULTITAP_BPMF==MMI_current_input_mode
- ||INPUT_MODE_MMI_MULTITAP_PINYIN==MMI_current_input_mode
- ||INPUT_MODE_MMI_TR_STROKE==MMI_current_input_mode
- ||INPUT_MODE_MMI_SM_STROKE==MMI_current_input_mode)
- #else
- if (INPUT_MODE_MMI_MULTITAP_BPMF == MMI_current_input_mode
- || INPUT_MODE_MMI_MULTITAP_PINYIN == MMI_current_input_mode)
- #endif
- //KP Jerry modify on 2007-3-17 end
- {
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL);
- }
- else
- {
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_SYMBOL);
- }
- }
- if (MMI_virtual_keyboard.height < gPenEditorCandidateInputBox.height)
- {
- changed_height -= gPenEditorCandidateInputBox.height;
- }
- else
- {
- changed_height -= MMI_virtual_keyboard.height;
- }
- mmi_pen_editor_resize_content_area(changed_height);
- gdi_layer_unlock_frame_buffer();
- RedrawCategoryControlledArea200Screen(NULL);
- return;
- }
- changed_height = MMI_virtual_keyboard.height;
- if (GUI_VIRTUAL_KEYBOARD_TRAY == MMI_virtual_keyboard.lang_type)
- {
- if (PEN_EDITOR_HANDWRITING_STYLE_MULTI_BLOCK == mmi_pen_editor_get_handwriting_style())
- {
- changed_height = PEN_EDITOR_BLOCK_HEIGHT;
- }
- else
- {
- changed_height = gPenEditorCandidateInputBox.height;
- }
- }
- gdi_layer_lock_frame_buffer();
- //KP Jerry modify on 2007-3-17 start
- #if defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__)
- if ((GUI_VIRTUAL_KEYBOARD_SYMBOL == MMI_virtual_keyboard.lang_type
- &&INPUT_MODE_TR_STROKE != MMI_current_input_mode
- &&INPUT_MODE_SM_STROKE != MMI_current_input_mode)
- || GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL == MMI_virtual_keyboard.lang_type)
- #else
- if (GUI_VIRTUAL_KEYBOARD_SYMBOL == MMI_virtual_keyboard.lang_type ||
- GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL == MMI_virtual_keyboard.lang_type)
- #endif
- //KP Jerry modify on 2007-3-17 end
- {
- mmi_pen_editor_hide_virtual_keyboard_area();
- if (PEN_EDITOR_HANDWRITING_STYLE_MULTI_BLOCK == mmi_pen_editor_get_handwriting_style())
- {
- if (gPenEditorPreviousVirtualKeyboardType != GUI_VIRTUAL_KEYBOARD_TRAY)
- {
- wgui_setup_virtual_keyboard(gPenEditorPreviousVirtualKeyboardType);
- }
- else
- {
- is_back_to_multi_block = MMI_TRUE;
- }
- }
- else
- {
- wgui_setup_virtual_keyboard(gPenEditorPreviousVirtualKeyboardType);
- }
- //KP Jerry modify on 2007-3-17 start
- #if defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__)
- if (GUI_VIRTUAL_KEYBOARD_BOPOMO==MMI_virtual_keyboard.lang_type
- ||GUI_VIRTUAL_KEYBOARD_PINYIN==MMI_virtual_keyboard.lang_type
- ||(GUI_VIRTUAL_KEYBOARD_SYMBOL==MMI_virtual_keyboard.lang_type
- &&(INPUT_MODE_TR_STROKE==MMI_current_input_mode
- ||INPUT_MODE_SM_STROKE==MMI_current_input_mode)))
- #else
- if (GUI_VIRTUAL_KEYBOARD_BOPOMO == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_PINYIN == MMI_virtual_keyboard.lang_type)
- #endif
- //KP Jerry modify on 2007-3-17 end
- {
- changed_height -= (gPenEditorCandidateInputBox.height + 1);
- gPenEditorVKCandidate = MMI_TRUE;
- mmi_pen_editor_hide_candidate_area();
- }
- }
- else
- {
- gPenEditorPreviousVirtualKeyboardType = MMI_virtual_keyboard.lang_type;
- //KP Jerry modify on 2007-3-17 start
- #if defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__)
- if (GUI_VIRTUAL_KEYBOARD_BOPOMO==MMI_virtual_keyboard.lang_type
- ||GUI_VIRTUAL_KEYBOARD_PINYIN==MMI_virtual_keyboard.lang_type
- ||(GUI_VIRTUAL_KEYBOARD_SYMBOL==MMI_virtual_keyboard.lang_type
- &&(INPUT_MODE_TR_STROKE==MMI_current_input_mode
- ||INPUT_MODE_SM_STROKE==MMI_current_input_mode)))
- #else
- if (GUI_VIRTUAL_KEYBOARD_BOPOMO == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_PINYIN == MMI_virtual_keyboard.lang_type)
- #endif
- //KP Jerry modify on 2007-3-17 end
- {
- //W05.35 VK Symbol Picker should reset gPenEditorVKText
- //W05.38 Consider gPenEditorSelectCandidate and gPenEditorVKText.TextLength
- //W05.48 Fix Right Soft Key Display Issue
- if (gPenEditorVKText.TextLength || gPenEditorSelectCandidate)
- {
- gPenEditorSelectCandidate = MMI_FALSE;
- /* Temp Solution for LSK Text Update */
- mmi_pen_editor_set_left_soft_key();
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_EMS_INPUT_BOX:
- register_EMS_inputbox_keys();
- break;
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- register_multiline_inputbox_keys();
- if (PEN_EDITOR_DICT_MULTILINE_INPUT_BOX == gPenEditorInputBoxType)
- {
- cat201_register_key_func();
- }
- break;
- default:
- break;
- }
- mmi_pen_editor_reset_vk_text(&gPenEditorVKText);
- wgui_set_virtual_keyboard_display_area((U8*) gPenEditorVKText.VKText, MMI_FALSE);
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- /* W05.34 for RSK and LSK issue when gPenEditorVKText reset */
- wgui_handle_inputbox_input();
- wgui_set_RSK();
- break;
- case PEN_EDITOR_EMS_INPUT_BOX:
- /* W05.34 for RSK and LSK issue when gPenEditorVKText reset */
- handle_category28_input();
- wgui_set_EMS_inputbox_RSK();
- break;
- default:
- break;;
- }
- }
- mmi_pen_editor_hide_virtual_keyboard_area();
- changed_height += (gPenEditorCandidateInputBox.height + 1);
- gPenEditorVKCandidate = MMI_FALSE;
- gPenEditorSelectCandidate = MMI_FALSE;
- }
- /* W05.34 For Chinese Symbols Keyboard */
- if (INPUT_MODE_TR_MULTITAP_BOPOMO == MMI_current_input_mode
- || INPUT_MODE_TR_BOPOMO == MMI_current_input_mode
- || INPUT_MODE_TR_STROKE == MMI_current_input_mode
- || INPUT_MODE_SM_MULTITAP_PINYIN == MMI_current_input_mode
- || INPUT_MODE_SM_PINYIN == MMI_current_input_mode || INPUT_MODE_SM_STROKE == MMI_current_input_mode)
- {
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL);
- }
- else
- {
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_SYMBOL);
- }
- }
- if (PEN_EDITOR_HANDWRITING_STYLE_MULTI_BLOCK == mmi_pen_editor_get_handwriting_style())
- {
- if (GUI_VIRTUAL_KEYBOARD_TRAY != MMI_virtual_keyboard.lang_type && !is_back_to_multi_block)
- {
- changed_height -= MMI_virtual_keyboard.height;
- mmi_pen_editor_resize_content_area(changed_height);
- }
- else
- {
- mmi_pen_editor_enable_multi_block_handwriting();
- }
- }
- else
- {
- if (GUI_VIRTUAL_KEYBOARD_TRAY != MMI_virtual_keyboard.lang_type)
- {
- changed_height -= MMI_virtual_keyboard.height;
- }
- else
- {
- changed_height -= gPenEditorCandidateInputBox.height;
- }
- mmi_pen_editor_resize_content_area(changed_height);
- }
- /* W05.36 Adjust the List height for In-line Multiline Input Box */
- if (PEN_EDITOR_INLINE_TEXT == gPenEditorInputBoxType
- || PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX == gPenEditorInputBoxType)
- {
- BOOL symbol_keyboard;
- S32 temp_multiline_height = MMI_multiline_inputbox.height;
- gui_virtual_keyboard_language_enum tempVirtualKeyboardType = MMI_virtual_keyboard.lang_type;
- MMI_BOOL temp_VKCandidate = gPenEditorVKCandidate;
- //KP Jerry modify on 2007-3-17 start
- #if defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__)
- if ((GUI_VIRTUAL_KEYBOARD_SYMBOL == MMI_virtual_keyboard.lang_type
- &&INPUT_MODE_TR_STROKE != MMI_current_input_mode
- &&INPUT_MODE_SM_STROKE != MMI_current_input_mode)
- || GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL == MMI_virtual_keyboard.lang_type)
- #else
- if (GUI_VIRTUAL_KEYBOARD_SYMBOL == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL == MMI_virtual_keyboard.lang_type)
- #endif
- //KP Jerry modify on 2007-3-17 end
- {
- symbol_keyboard = MMI_TRUE;
- }
- else
- {
- symbol_keyboard = MMI_FALSE;
- }
- mmi_pen_editor_vk_list_menu_resize();
- if (PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX == gPenEditorInputBoxType)
- {
- gui_resize_multi_line_input_box(
- &MMI_multiline_inputbox,
- MMI_multiline_inputbox.width,
- temp_multiline_height);
- redraw_fixed_list();
- redraw_current_inline_item();
- gPenEditorVKCandidate = temp_VKCandidate;
- }
- if (symbol_keyboard)
- {
- if (INPUT_MODE_TR_MULTITAP_BOPOMO == MMI_current_input_mode
- || INPUT_MODE_TR_BOPOMO == MMI_current_input_mode
- || INPUT_MODE_TR_STROKE == MMI_current_input_mode
- || INPUT_MODE_SM_MULTITAP_PINYIN == MMI_current_input_mode
- || INPUT_MODE_SM_PINYIN == MMI_current_input_mode || INPUT_MODE_SM_STROKE == MMI_current_input_mode)
- {
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL);
- }
- else
- {
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_SYMBOL);
- }
- }
- else
- {
- if (PEN_EDITOR_HANDWRITING_STYLE_MULTI_BLOCK == mmi_pen_editor_get_handwriting_style())
- {
- if (GUI_VIRTUAL_KEYBOARD_TRAY != tempVirtualKeyboardType)
- {
- wgui_setup_virtual_keyboard(tempVirtualKeyboardType);
- }
- }
- else
- {
- wgui_setup_virtual_keyboard(tempVirtualKeyboardType);
- }
- }
- }
- if (gPenEditorVKCandidate)
- {
- gui_move_single_line_input_box(
- &gPenEditorCandidateInputBox,
- gPenEditorCandidateInputBox.x,
- MMI_virtual_keyboard.y - gPenEditorCandidateInputBox.height - 2);
- mmi_pen_editor_hide_candidate_area();
- }
- gdi_layer_unlock_frame_buffer();
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- if (PEN_EDITOR_HANDWRITING_STYLE_MULTI_BLOCK == mmi_pen_editor_get_handwriting_style())
- {
- if (GUI_VIRTUAL_KEYBOARD_TRAY == MMI_virtual_keyboard.lang_type)
- {
- g_multi_block_stroke_area[0].x1 = 3;
- g_multi_block_stroke_area[0].y1 =
- MMI_content_y + MMI_content_height - PEN_EDITOR_BLOCK_HEIGHT +
- mmi_pen_editor_compute_candidate_input_box_height() + 4;
- g_multi_block_stroke_area[0].x2 = (UI_device_width >> 1) - 2;
- g_multi_block_stroke_area[0].y2 = MMI_content_y + MMI_content_height - 3;
- g_multi_block_stroke_area[1].x1 = (UI_device_width >> 1) + 1;
- g_multi_block_stroke_area[1].y1 =
- MMI_content_y + MMI_content_height - PEN_EDITOR_BLOCK_HEIGHT +
- mmi_pen_editor_compute_candidate_input_box_height() + 4;
- g_multi_block_stroke_area[1].x2 = UI_device_width - 3;
- g_multi_block_stroke_area[1].y2 = MMI_content_y + MMI_content_height - 3;
- gPenEditorEnableHandWriting = MMI_TRUE;
- mmi_pen_start_capture_strokes(
- PEN_EDITOR_STROKE_BUFFER_SIZE,
- gPenEditorStrokeBuffer,
- 2,
- g_multi_block_stroke_area,
- NULL);
- memcpy(
- &g_pen_editor_original_handwriting_area,
- &g_multi_block_stroke_area,
- sizeof(mmi_pen_handwriting_area_struct));
- mmi_pen_register_stroke_down_handler(mmi_pen_editor_multi_block_stroke_down_handler);
- mmi_pen_register_stroke_move_handler(NULL, NULL, mmi_pen_editor_multi_block_stroke_move_handler);
- mmi_pen_register_stroke_up_handler(mmi_pen_editor_multi_block_stroke_up_handler);
- mmi_pen_editor_hand_writing_initailize();
- mmi_pen_begin_strokes_of_character();
- }
- else
- {
- mmi_pen_stop_capture_strokes();
- }
- }
- /* W05.50 Exclude Virtual Keyboard Area from Handwriting Area */
- mmi_pen_editor_change_handwriting_area();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_set_inputbox_LSK_Function
- * DESCRIPTION
- * Set gPenEditorLSKfunction as f. gPenEditorLSKfunction is used in mmi_pen_editor_left_soft_key_handler.
- * PARAMETERS
- * f [IN] Usually the LSK function
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_set_inputbox_LSK_Function(FuncPtr f)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gPenEditorLSKfunction = f;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_store_LSK_Text
- * DESCRIPTION
- * Save current LSK text to gPenEditorLSKText. gPenEditorLSKText is used in mmi_pen_editor_set_left_soft_key.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_store_LSK_Text(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gPenEditorLSKText = MMI_softkeys[MMI_LEFT_SOFTKEY].text;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_history_vk_lang_type
- * DESCRIPTION
- * Get the type of the virtual keyboard when closing input box. This function is used when getting history data
- * PARAMETERS
- * void
- * RETURNS
- * The type of the virtual keyboard when closing input box
- *****************************************************************************/
- gui_virtual_keyboard_language_enum mmi_pen_editor_history_vk_lang_type(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return gPenEditorHistoryVirtualKeyboardType;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_check_valid_input
- * DESCRIPTION
- * Check the input is in the valid input list or not
- * PARAMETERS
- * input [IN] The character to check
- * valid_input [IN] The valid input list
- * RETURNS
- * MMI_TRUE : Valid
- * MMI_FALSE : Invalid
- *****************************************************************************/
- MMI_BOOL mmi_pen_editor_check_valid_input(UI_character_type input, const UI_character_type *valid_input)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- int i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0;; i++)
- {
- if (0 == valid_input[i])
- {
- return MMI_FALSE;
- }
- else if (input == valid_input[i])
- {
- return MMI_TRUE;
- }
- }
- return MMI_FALSE;
- }
- /* W05.33 For candidates sorting issue */
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_resort_candidates
- * DESCRIPTION
- * Resort the candidates according to SortRequirement
- * PARAMETERS
- * candidates [OUT] The buffer of the candidates to resort
- * num [IN] The number of the candidates
- * SortRequirement [IN] PEN_EDITOR_SORT_CAPITAL_FIRST : Capital characters are in the front of non-capital characters
- * PEN_EDITOR_SORT_NON_CAPITAL_FIRST : Non-capital characters are in the front of capital characters
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_resort_candidates(
- UI_character_type *candidates,
- int num,
- mmi_pen_editor_resort_type_enum SortRequirement)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- int i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < num - 1; i++)
- {
- if (PEN_EDITOR_SORT_NON_CAPITAL_FIRST == SortRequirement)
- {
- if ((candidates[i + 1] - 0x20) == candidates[i])
- {
- candidates[i] = candidates[i + 1];
- candidates[i + 1] = candidates[i] - 0x20;
- }
- }
- else if (PEN_EDITOR_SORT_CAPITAL_FIRST == SortRequirement)
- {
- if ((candidates[i + 1] + 0x20) == candidates[i])
- {
- candidates[i] = candidates[i + 1];
- candidates[i + 1] = candidates[i] + 0x20;
- }
- }
- }
- /* For '0' special case */
- if ('0' == candidates[0])
- {
- if (PEN_EDITOR_SORT_NON_CAPITAL_FIRST == SortRequirement)
- {
- if ('o' == candidates[1] && 'O' == candidates[2])
- {
- candidates[0] = 'o';
- candidates[1] = 'O';
- candidates[2] = '0';
- }
- }
- else if (PEN_EDITOR_SORT_CAPITAL_FIRST == SortRequirement)
- {
- if ('O' == candidates[1] && 'o' == candidates[2])
- {
- candidates[0] = 'O';
- candidates[1] = 'o';
- candidates[2] = '0';
- }
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_clear_key_handler
- * DESCRIPTION
- * Clear the key handler of Number Keys, Key Pound, and Key Star
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_clear_key_handler(void)
- {
- #if !defined(__MMI_HANDWRITING_PAD__)
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- clear_MMI_key_input_handler();
- /* W05.51 Fix Long Press Key Handler cannot be cleared in clear_MMI_key_input_handler */
- ClearKeyHandler(KEY_0, KEY_LONG_PRESS);
- ClearKeyHandler(KEY_1, KEY_LONG_PRESS);
- ClearKeyHandler(KEY_2, KEY_LONG_PRESS);
- ClearKeyHandler(KEY_3, KEY_LONG_PRESS);
- ClearKeyHandler(KEY_4, KEY_LONG_PRESS);
- ClearKeyHandler(KEY_5, KEY_LONG_PRESS);
- ClearKeyHandler(KEY_6, KEY_LONG_PRESS);
- ClearKeyHandler(KEY_7, KEY_LONG_PRESS);
- ClearKeyHandler(KEY_8, KEY_LONG_PRESS);
- ClearKeyHandler(KEY_9, KEY_LONG_PRESS);
- ClearKeyHandler(KEY_0, KEY_REPEAT);
- ClearKeyHandler(KEY_1, KEY_REPEAT);
- ClearKeyHandler(KEY_2, KEY_REPEAT);
- ClearKeyHandler(KEY_3, KEY_REPEAT);
- ClearKeyHandler(KEY_4, KEY_REPEAT);
- ClearKeyHandler(KEY_5, KEY_REPEAT);
- ClearKeyHandler(KEY_6, KEY_REPEAT);
- ClearKeyHandler(KEY_7, KEY_REPEAT);
- ClearKeyHandler(KEY_8, KEY_REPEAT);
- ClearKeyHandler(KEY_9, KEY_REPEAT);
- ClearKeyHandler(KEY_POUND, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_STAR, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
- ClearKeyHandler(KEY_STAR, KEY_EVENT_UP);
- #endif /* !defined(__MMI_HANDWRITING_PAD__) */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_vk_list_menu_resize
- * DESCRIPTION
- * Resize the height of the list menu according to the state of the candidate box and the virtual keyboard.Then redraw the list menu.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_vk_list_menu_resize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* W05.36 Add Center Soft Key for switching Input Method */
- /*
- * if ((current_wgui_inline_item->flags & INLINE_ITEM_TYPE_MASK) != INLINE_ITEM_TYPE_MULTI_LINE_EDIT)
- * {
- * resize_fixed_list(MMI_content_width, gPenEditorListMenuHeight - MMI_virtual_keyboard.height - 1);
- * }
- * else
- * {
- * if (gPenEditorVKCandidate)
- * {
- * resize_fixed_list(
- * MMI_content_width,
- * gPenEditorListMenuHeight - MMI_virtual_keyboard.height - gPenEditorCandidateInputBox.height - 1);
- * mmi_pen_editor_hide_candidate_area();
- * }
- * else
- * {
- * resize_fixed_list(MMI_content_width, gPenEditorListMenuHeight - MMI_virtual_keyboard.height - 1);
- * }
- * }
- */
- mmi_pen_editor_list_menu_highlight_resize();
- /* W06.05 Do not draw fixed list in category57 because of virtual keyboard */
- if (((current_wgui_inline_item->flags & INLINE_ITEM_TYPE_MASK) == INLINE_ITEM_TYPE_TEXT_EDIT) ||
- ((current_wgui_inline_item->flags & INLINE_ITEM_TYPE_MASK) == INLINE_ITEM_TYPE_MULTI_LINE_EDIT))
- {
- memset(&gPenEditorInlineEditHistory, 0, sizeof(gPenEditorInlineEditHistory));
- wgui_inline_edit_get_current_item_history((U8*) & gPenEditorInlineEditHistory);
- }
- complete_inline_item_edit();
- wgui_inline_edit_default_list_highlight_handler(MMI_fixed_list_menu.highlighted_item);
- wgui_inline_item_handled = 0;
- gui_fixed_list_menu_locate_highlighted_item(&MMI_fixed_list_menu);
- if ((current_wgui_inline_item->flags & INLINE_ITEM_TYPE_MASK) == INLINE_ITEM_TYPE_MULTI_LINE_EDIT)
- {
- MMI_fixed_list_menu.first_displayed_item = MMI_fixed_list_menu.highlighted_item;
- }
- if (((current_wgui_inline_item->flags & INLINE_ITEM_TYPE_MASK) == INLINE_ITEM_TYPE_TEXT_EDIT) ||
- ((current_wgui_inline_item->flags & INLINE_ITEM_TYPE_MASK) == INLINE_ITEM_TYPE_MULTI_LINE_EDIT))
- {
- memset(&gPenEditorInlineEditHistory, 0, sizeof(gPenEditorInlineEditHistory));
- wgui_inline_edit_get_current_item_history((U8*) & gPenEditorInlineEditHistory);
- }
- redraw_fixed_list();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_list_menu_highlight_resize
- * DESCRIPTION
- * Resize the height of the list menu according to the state of the candidate box and the virtual keyboard
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_list_menu_highlight_resize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* W06.05 Temp solution for Do not draw fixed list in category57 because of virtual keyboard */
- if (gPenEditorListMenuHeight)
- {
- int changed_height = MMI_virtual_keyboard.height;
- int candidate_inpt_box_height = gPenEditorCandidateInputBox.height;
- if (!candidate_inpt_box_height)
- {
- candidate_inpt_box_height = mmi_pen_editor_compute_candidate_input_box_height();
- }
- if (changed_height < candidate_inpt_box_height)
- {
- changed_height = candidate_inpt_box_height;
- }
- if ((current_wgui_inline_item->flags & INLINE_ITEM_TYPE_MASK) != INLINE_ITEM_TYPE_MULTI_LINE_EDIT)
- {
- resize_fixed_list(MMI_content_width, gPenEditorListMenuHeight - changed_height - 1);
- }
- else
- {
- if (gPenEditorVKCandidate)
- {
- resize_fixed_list(
- MMI_content_width,
- gPenEditorListMenuHeight - MMI_virtual_keyboard.height - gPenEditorCandidateInputBox.height - 1);
- mmi_pen_editor_hide_candidate_area();
- }
- else
- {
- resize_fixed_list(MMI_content_width, gPenEditorListMenuHeight - changed_height - 1);
- }
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_store_list_menu_height
- * DESCRIPTION
- * Store the height of the lsit menu in gPenEditorListMenuHeight
- * PARAMETERS
- * list_menu_height [IN] The height of the list menu
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_store_list_menu_height(S32 list_menu_height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gPenEditorListMenuHeight = list_menu_height;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_get_list_menu_height
- * DESCRIPTION
- * Get the stored height of the list menu
- * PARAMETERS
- * void
- * RETURNS
- * The stored height of the list menu
- *****************************************************************************/
- S32 mmi_pen_editor_get_list_menu_height(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return gPenEditorListMenuHeight;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_resize_multiline_input_box_for_vk
- * DESCRIPTION
- * Resize the height of the input box according to the virtual keyboard. This function is used for Category28
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_resize_multiline_input_box_for_vk(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- int changed_height = 0;
- color c;
- #ifdef __MMI_EDITOR_PEN_VK_UNFOLD__
- MMI_BOOL re_entry_flag = MMI_FALSE;
- #endif /* __MMI_EDITOR_PEN_VK_UNFOLD__ */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- c.r = 255;
- c.g = 255;
- c.b = 255;
- c.alpha = 100;
- gui_reset_clip();
- #ifdef __MMI_EDITOR_PEN_VK_UNFOLD__
- if (g_pen_editor_resized_by_vk)
- {
- re_entry_flag = MMI_TRUE;
- }
- #endif /* __MMI_EDITOR_PEN_VK_UNFOLD__ */
- if (PEN_EDITOR_HANDWRITING_STYLE_MULTI_BLOCK == mmi_pen_editor_get_handwriting_style())
- {
- if (!g_pen_editor_resized_by_vk)
- {
- changed_height = MMI_multitap_height - PEN_EDITOR_BLOCK_HEIGHT - 1;
- if ((GUI_VIRTUAL_KEYBOARD_NUMBER_DOT_TRAY == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_NUMBER_TRAY == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_PHONE_NUMBER == MMI_virtual_keyboard.lang_type)
- && (MMI_virtual_keyboard.height > gPenEditorCandidateInputBox.height))
- {
- changed_height -= (MMI_virtual_keyboard.height - gPenEditorCandidateInputBox.height);
- }
- mmi_pen_editor_resize_content_area(changed_height);
- g_pen_editor_resized_by_vk = MMI_TRUE;
- }
- mmi_pen_editor_draw_handwriting_block();
- if (GUI_VIRTUAL_KEYBOARD_TRAY != MMI_virtual_keyboard.lang_type)
- {
- /* W06.09 Consider GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL */
- if (((GUI_VIRTUAL_KEYBOARD_SYMBOL == MMI_virtual_keyboard.lang_type) ||
- (GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL == MMI_virtual_keyboard.lang_type)) &&
- (!g_pen_editor_vk_show_at_start))
- {
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_TRAY);
- mmi_pen_editor_vk_symbol_picker();
- }
- else if (!(GUI_VIRTUAL_KEYBOARD_NUMBER_DOT_TRAY == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_NUMBER_TRAY == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_PHONE_NUMBER == MMI_virtual_keyboard.lang_type))
- {
- #ifdef __MMI_EDITOR_PEN_VK_UNFOLD__
- if (!re_entry_flag)
- {
- #endif /* __MMI_EDITOR_PEN_VK_UNFOLD__ */
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_TRAY);
- mmi_pen_editor_disable_multi_block_handwriting();
- #ifdef __MMI_EDITOR_PEN_VK_UNFOLD__
- }
- else
- {
- gPenEditorOnlyRedrawInputBox = MMI_TRUE;
- mmi_pen_editor_resize_content_area(0);
- gPenEditorOnlyRedrawInputBox = MMI_FALSE;
- }
- #endif /* __MMI_EDITOR_PEN_VK_UNFOLD__ */
- }
- }
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- }
- else
- {
- if (!g_pen_editor_resized_by_vk)
- {
- changed_height = MMI_multitap_height - gPenEditorCandidateInputBox.height - 1;
- /* This is used to adjust input box height when virtual keyboard enabled */
- changed_height -= 1;
- if (wgui_is_wallpaper_on_bottom() == MMI_TRUE)
- {
- gdi_draw_solid_rect(
- 0,
- gPenEditorCandidateInputBox.y - 2,
- UI_device_width,
- gPenEditorCandidateInputBox.y + gPenEditorCandidateInputBox.height - 1,
- GDI_COLOR_TRANSPARENT);
- }
- else
- {
- gui_fill_rectangle(
- 0,
- gPenEditorCandidateInputBox.y - 2,
- UI_device_width,
- gPenEditorCandidateInputBox.y + gPenEditorCandidateInputBox.height - 1,
- c);
- }
- mmi_pen_editor_resize_content_area(changed_height);
- g_pen_editor_resized_by_vk = MMI_TRUE;
- }
- if (GUI_VIRTUAL_KEYBOARD_TRAY != MMI_virtual_keyboard.lang_type)
- {
- /* W06.09 Consider GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL */
- if (((GUI_VIRTUAL_KEYBOARD_SYMBOL == MMI_virtual_keyboard.lang_type) ||
- (GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL == MMI_virtual_keyboard.lang_type)) &&
- (!g_pen_editor_vk_show_at_start))
- {
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_TRAY);
- mmi_pen_editor_vk_symbol_picker();
- }
- else if (GUI_VIRTUAL_KEYBOARD_NUMBER_DOT_TRAY == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_NUMBER_TRAY == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_PHONE_NUMBER == MMI_virtual_keyboard.lang_type)
- {
- gui_virtual_keyboard_language_enum temp_vk_lang_type = MMI_virtual_keyboard.lang_type;
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_TRAY);
- /* changed_height = MMI_virtual_keyboard.height; */
- changed_height = gPenEditorCandidateInputBox.height;
- wgui_setup_virtual_keyboard(temp_vk_lang_type);
- if (MMI_virtual_keyboard.height < gPenEditorCandidateInputBox.height)
- {
- changed_height -= gPenEditorCandidateInputBox.height;
- }
- else
- {
- changed_height -= MMI_virtual_keyboard.height;
- }
- mmi_pen_editor_resize_content_area(changed_height);
- }
- else
- {
- #ifdef __MMI_EDITOR_PEN_VK_UNFOLD__
- if (!re_entry_flag)
- {
- #endif /* __MMI_EDITOR_PEN_VK_UNFOLD__ */
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_TRAY);
- mmi_pen_editor_vk_show();
- #ifdef __MMI_EDITOR_PEN_VK_UNFOLD__
- }
- else
- {
- gPenEditorOnlyRedrawInputBox = MMI_TRUE;
- mmi_pen_editor_resize_content_area(0);
- gPenEditorOnlyRedrawInputBox = MMI_FALSE;
- }
- #endif /* __MMI_EDITOR_PEN_VK_UNFOLD__ */
- }
- }
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_reset_candidate_index
- * DESCRIPTION
- * Reset the current index and the currect page for the candidate box
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_reset_candidate_index(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* W05.35 Temp Solution for Candidate Index Issue */
- gPenEditorCandidateIndex = 0;
- gPenEditorCandidatePage = 0;
- }