EditorPen.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:513k
源码类别:
MTK
开发平台:
C/C++
- }
- else
- #endif /* defined(__MMI_HANDWRITING_MULTI_BLOCK__) */
- {
- mmi_pen_editor_set_handwriting_style(PEN_EDITOR_HANDWRITING_STYLE_FULL_SCREEN);
- }
- gPenEditorHistoryVirtualKeyboardType = GUI_VIRTUAL_KEYBOARD_MAX_LANG;
- if ((NULL != stroke_area) && (NULL != ext_stroke) &&
- !(INPUT_TYPE_NUMERIC_PASSWORD == input_type_only ||
- INPUT_TYPE_SAT_NUMERIC_PASSWORD == input_type_only) && (!g_pen_editor_disable_handwriting))
- {
- gPenEditorEnableHandWriting = MMI_TRUE;
- if (PEN_EDITOR_HANDWRITING_STYLE_MULTI_BLOCK == mmi_pen_editor_get_handwriting_style())
- {
- 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() + 5;
- 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) + 2;
- 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() + 5;
- g_multi_block_stroke_area[1].x2 = UI_device_width - 4;
- g_multi_block_stroke_area[1].y2 = MMI_content_y + MMI_content_height - 3;
- 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, 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);
- wgui_virtual_keyboard_set_global_multi_block_mode(MMI_TRUE);
- }
- else
- {
- mmi_pen_start_capture_strokes(
- PEN_EDITOR_STROKE_BUFFER_SIZE,
- gPenEditorStrokeBuffer,
- 1,
- stroke_area,
- ext_stroke);
- memcpy(&g_pen_editor_original_handwriting_area, stroke_area, sizeof(mmi_pen_handwriting_area_struct));
- mmi_pen_register_stroke_down_handler(mmi_pen_editor_stroke_down_handler);
- mmi_pen_register_stroke_move_handler(NULL, NULL, mmi_pen_editor_stroke_move_handler);
- mmi_pen_register_stroke_up_handler(mmi_pen_editor_stroke_up_handler);
- }
- /* W05.39 Call these functions only when enabling handwriting */
- mmi_pen_editor_hand_writing_initailize();
- mmi_pen_begin_strokes_of_character();
- }
- #if !defined(__MMI_HANDWRITING_PAD__)
- mmi_pen_register_abort_handler(mmi_pen_editor_pen_abort_handler);
- mmi_pen_register_down_handler(mmi_pen_editor_pen_down_handler);
- mmi_pen_register_long_tap_handler(mmi_pen_editor_pen_long_tap_handler);
- mmi_pen_register_move_handler(mmi_pen_editor_pen_move_handler);
- mmi_pen_register_up_handler(mmi_pen_editor_pen_up_handler);
- mmi_pen_register_repeat_handler(mmi_pen_editor_pen_repeat_handler);
- #endif /* !defined(__MMI_HANDWRITING_PAD__) */
- /*
- * font_height = UI_get_font_height(candidate_singleline_inputbox_theme.text_font) + 2;
- * if (font_height < MMI_multitap_height)
- * {
- * font_height = MMI_multitap_height;
- * }
- */
- font_height = mmi_pen_editor_compute_candidate_input_box_height();
- grid_width = ((MMI_multitap_width) / (PEN_EDITOR_CANDIDATE_SIZE_WITH_ARROWS + 2));
- gui_create_single_line_input_box_use_buffer(
- &gPenEditorCandidateInputBox,
- MMI_multitap_x + grid_width,
- MMI_content_y + MMI_content_height - font_height,
- grid_width * PEN_EDITOR_CANDIDATE_SIZE,
- font_height,
- gPenEditorCandidateBuffer,
- ((PEN_EDITOR_MAX_CANDIDATE_SIZE + 1) * sizeof(U16)));
- gui_set_single_line_input_box_theme(&gPenEditorCandidateInputBox, &candidate_singleline_inputbox_theme);
- gPenEditorCandidateInputBox.flags |= UI_SINGLE_LINE_INPUT_BOX_DISABLE_SCROLLING;
- gPenEditorCandidateInputBox.flags |= UI_SINGLE_LINE_INPUT_BOX_FULL_HEIGHT_BLOCK_CURSOR;
- gPenEditorCandidateInputBox.flags |= UI_SINGLE_LINE_INPUT_BOX_VIEW_FULL_CHARACTERS;
- gPenEditorCandidateInputBox.ext_flags |= UI_SINGLE_LINE_INPUT_BOX_EXT_FIXED_GRID;
- //W05.35 Temp Solution for Candidates List Grid Width
- //W05.39 Adjust the grid width by the number of characters in Candidate List
- gPenEditorCandidateInputBox.text_x = 0;
- gPenEditorCandidateInputBox.grid_width = grid_width;
- g_pen_editor_candidate_x = MMI_multitap_x + grid_width;
- gui_create_single_line_input_box_use_buffer(
- &g_pen_editor_composition_input_box,
- MMI_multitap_x,
- gPenEditorCandidateInputBox.y - font_height - 2,
- MMI_multitap_width,
- font_height,
- g_pen_editor_composition_buffer,
- ((PEN_EDITOR_MAX_COMPOSITION_SIZE + 1) * sizeof(U16)));
- gui_set_single_line_input_box_theme(&g_pen_editor_composition_input_box, &candidate_singleline_inputbox_theme);
- g_pen_editor_composition_input_box.flags |= UI_SINGLE_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW;
- g_pen_editor_composition_input_box.grid_width = grid_width;
- gPenEditorInputBoxType = input_box_type;
- /* W05.32 History Issue */
- if (MMI_FALSE == is_init)
- {
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_EMPTY_TRAY);
- is_init = MMI_TRUE;
- }
- if ((GUI_VIRTUAL_KEYBOARD_EMPTY_TRAY == MMI_virtual_keyboard.lang_type) &&
- !(PEN_EDITOR_QUICK_SEARCH_SINGLE_LINE_INPU_BOX == gPenEditorInputBoxType))
- {
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_TRAY);
- }
- if ((PEN_EDITOR_DATE == gPenEditorInputBoxType)
- || (PEN_EDITOR_IP4 == gPenEditorInputBoxType)
- || (PEN_EDITOR_TIME == gPenEditorInputBoxType) || (PEN_EDITOR_TIME_PERIOD == gPenEditorInputBoxType))
- {
- MMI_current_input_mode = INPUT_MODE_123;
- }
- //W05.36 Disable switch Input Method when INPUT_TYPE_NUMERIC
- //W05.36 Add Center Soft Key for switching Input Method
- if (!(INPUT_TYPE_NUMERIC_PASSWORD == input_type_only
- || INPUT_TYPE_PHONE_NUMBER == input_type_only
- || INPUT_TYPE_SAT_NUMERIC_PASSWORD == input_type_only
- || INPUT_TYPE_KEYPAD_NUMERIC == input_type_only
- || INPUT_TYPE_DECIMAL_NUMERIC == input_type_only
- || INPUT_TYPE_ALPHABATIC_LOWERCASE == input_type_only
- || INPUT_TYPE_ALPHABATIC_UPPERCASE == input_type_only
- || INPUT_TYPE_NUMERIC_SYMBOL == input_type_only || INPUT_TYPE_NUMERIC == input_type_only))
- {
- if (information_bar_flag)
- {
- mmi_pen_editor_add_cocontrol(&gPenEditorControlSet, PEN_EDITOR_CONTROL_INFORMATION_BAR);
- }
- #ifdef __MMI_WGUI_CSK_ENABLE__
- if (!((PEN_EDITOR_DATE == gPenEditorInputBoxType)
- || (PEN_EDITOR_IP4 == gPenEditorInputBoxType)
- || (PEN_EDITOR_TIME == gPenEditorInputBoxType) || (PEN_EDITOR_TIME_PERIOD == gPenEditorInputBoxType)))
- {
- mmi_pen_editor_set_CSK_content();
- set_softkey_function(mmi_pen_editor_switch_input_method, KEY_EVENT_UP, MMI_CENTER_SOFTKEY);
- register_softkey_handler(MMI_CENTER_SOFTKEY);
- }
- #endif /* __MMI_WGUI_CSK_ENABLE__ */
- }
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- /* W05.32 Check special input type for virtual keyboard */
- switch (input_type_only)
- {
- 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:
- case INPUT_TYPE_NUMERIC_PASSWORD:
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_NUMBER_TRAY);
- break;
- #ifdef __MMI_EDITOR_PEN_VK_UNFOLD__
- case INPUT_TYPE_ALPHANUMERIC_UPPERCASE:
- if (!((GUI_VIRTUAL_KEYBOARD_SYMBOL == MMI_virtual_keyboard.lang_type) ||
- (GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL == MMI_virtual_keyboard.lang_type)))
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH_UPPERCASE);
- break;
- case INPUT_TYPE_ALPHANUMERIC_LOWERCASE:
- if (!((GUI_VIRTUAL_KEYBOARD_SYMBOL == MMI_virtual_keyboard.lang_type) ||
- (GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL == MMI_virtual_keyboard.lang_type)))
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH);
- break;
- case INPUT_TYPE_NUMERIC_CHANGEABLE:
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_NUMBER);
- break;
- case INPUT_TYPE_TR_MULTITAP_BOPOMO:
- case INPUT_TYPE_TR_BOPOMO: //KP Jerry add on 2007-3-21
- if (!((GUI_VIRTUAL_KEYBOARD_SYMBOL == MMI_virtual_keyboard.lang_type) ||
- (GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL == MMI_virtual_keyboard.lang_type)))
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_BOPOMO);
- break;
- case INPUT_TYPE_SM_MULTITAP_PINYIN:
- case INPUT_TYPE_SM_PINYIN: //KP Jerry add on 2007-3-21
- if (!((GUI_VIRTUAL_KEYBOARD_SYMBOL == MMI_virtual_keyboard.lang_type) ||
- (GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL == MMI_virtual_keyboard.lang_type)))
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_PINYIN);
- break;
- //KP Jerry add on 2007-3-21 start
- case INPUT_TYPE_TR_STROKE:
- case INPUT_TYPE_SM_STROKE:
- if (!(GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL == MMI_virtual_keyboard.lang_type))
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_SYMBOL);
- break;
- //KP Jerry add on 2007-3-21 end
- #endif
- default:
- break;
- }
- mmi_pen_editor_add_cocontrol(&gPenEditorControlSet, PEN_EDITOR_CONTROL_MULTILINE_INPUT_BOX);
- mmi_pen_editor_add_cocontrol(&gPenEditorControlSet, PEN_EDITOR_CONTROL_MULTITAP);
- break;
- case PEN_EDITOR_EMS_INPUT_BOX:
- #ifdef __MMI_EDITOR_PEN_VK_UNFOLD__
- switch (input_type_only)
- {
- case INPUT_TYPE_ALPHANUMERIC_UPPERCASE:
- if (!((GUI_VIRTUAL_KEYBOARD_SYMBOL == MMI_virtual_keyboard.lang_type) ||
- (GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL == MMI_virtual_keyboard.lang_type)))
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH_UPPERCASE);
- break;
- case INPUT_TYPE_ALPHANUMERIC_LOWERCASE:
- if (!((GUI_VIRTUAL_KEYBOARD_SYMBOL == MMI_virtual_keyboard.lang_type) ||
- (GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL == MMI_virtual_keyboard.lang_type)))
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH);
- break;
- case INPUT_TYPE_NUMERIC_CHANGEABLE:
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_NUMBER);
- break;
- case INPUT_TYPE_TR_MULTITAP_BOPOMO:
- case INPUT_TYPE_TR_BOPOMO: //KP Jerry add on 2007-3-21
- if (!((GUI_VIRTUAL_KEYBOARD_SYMBOL == MMI_virtual_keyboard.lang_type) ||
- (GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL == MMI_virtual_keyboard.lang_type)))
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_BOPOMO);
- break;
- case INPUT_TYPE_SM_MULTITAP_PINYIN:
- case INPUT_TYPE_SM_PINYIN: //KP Jerry add on 2007-3-21
- if (!((GUI_VIRTUAL_KEYBOARD_SYMBOL == MMI_virtual_keyboard.lang_type) ||
- (GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL == MMI_virtual_keyboard.lang_type)))
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_PINYIN);
- break;
- //KP Jerry add on 2007-3-21 start
- case INPUT_TYPE_TR_STROKE:
- case INPUT_TYPE_SM_STROKE:
- if (!(GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL == MMI_virtual_keyboard.lang_type))
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_SYMBOL);
- break;
- //KP Jerry add on 2007-3-21 end
- default:
- break;
- }
- #endif
- mmi_pen_editor_add_cocontrol(&gPenEditorControlSet, PEN_EDITOR_CONTROL_EMS_INPUT_BOX);
- mmi_pen_editor_add_cocontrol(&gPenEditorControlSet, PEN_EDITOR_CONTROL_MULTITAP);
- break;
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- /* W05.32 Check special input type for virtual keyboard */
- switch (input_type_only)
- {
- 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:
- case INPUT_TYPE_NUMERIC_PASSWORD:
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_NUMBER_TRAY);
- break;
- default:
- break;
- }
- mmi_pen_editor_set_inputbox_LSK_Function(wgui_inline_edit_DONE_function);
- mmi_pen_editor_add_cocontrol(&gPenEditorControlSet, PEN_EDITOR_CONTROL_INLINE_MULTILINE_INPUT_BOX);
- mmi_pen_editor_add_cocontrol(&gPenEditorControlSet, PEN_EDITOR_CONTROL_MULTITAP);
- break;
- case PEN_EDITOR_SINGLE_LINE_INPU_BOX:
- switch (input_type_only)
- {
- case INPUT_TYPE_ALPHANUMERIC_LOWERCASE:
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH);
- break;
- case INPUT_TYPE_ALPHANUMERIC_UPPERCASE:
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH_UPPERCASE);
- 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:
- case INPUT_TYPE_NUMERIC_PASSWORD:
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_NUMBER_TRAY);
- break;
- default:
- /* MMI_ASSERT(0); */
- break;
- }
- mmi_pen_editor_add_cocontrol(&gPenEditorControlSet, PEN_EDITOR_CONTROL_SINGLE_LINE_INPU_BOX);
- break;
- case PEN_EDITOR_PAGING_IN_MULTLINE_EDITOR:
- switch (input_type_only)
- {
- case INPUT_TYPE_NUMERIC:
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_NUMBER_TRAY);
- break;
- default:
- /* MMI_ASSERT(0); */
- break;
- }
- break;
- case PEN_EDITOR_QUICK_SEARCH_SINGLE_LINE_INPU_BOX:
- //W06.04 Fix category200 history issue of virtual keyboard
- //W06.06 Set virtual keyboard according to the input method
- if ((GUI_VIRTUAL_KEYBOARD_EMPTY_TRAY == MMI_virtual_keyboard.lang_type))
- {
- switch (input_type_only)
- {
- case INPUT_TYPE_MMI_LOWERCASE_ABC:
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH);
- break;
- case INPUT_TYPE_MMI_MULTITAP_BPMF:
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_BOPOMO);
- break;
- case INPUT_TYPE_MMI_MULTITAP_PINYIN:
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_PINYIN);
- break;
- case INPUT_TYPE_MMI_NUMERIC:
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_NUMBER);
- break;
- //KP Jerry add on 2007-3-17 start
- case INPUT_TYPE_MMI_TR_STROKE:
- case INPUT_TYPE_MMI_SM_STROKE:
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_SYMBOL);
- break;
- //KP Jerry add on 2007-3-17 end
- default:
- MMI_ASSERT(0);
- break;
- }
- }
- mmi_pen_editor_add_cocontrol(&gPenEditorControlSet, PEN_EDITOR_CONTROL_SINGLE_LINE_INPU_BOX);
- break;
- case PEN_EDITOR_INLINE_TEXT:
- changed_height = MMI_virtual_keyboard.height;
- switch (input_type_only)
- {
- case INPUT_TYPE_ALPHANUMERIC_LOWERCASE:
- #ifdef __MMI_EDITOR_PEN_VK_UNFOLD__
- if(!gPenEditorHideToTray)
- {
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH);
- }
- #endif
- break;
- case INPUT_TYPE_ALPHANUMERIC_UPPERCASE:
- #ifdef __MMI_EDITOR_PEN_VK_UNFOLD__
- if(!gPenEditorHideToTray)
- {
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH_UPPERCASE);
- }
- #endif
- 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:
- case INPUT_TYPE_NUMERIC_PASSWORD:
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_NUMBER_TRAY);
- break;
- default:
- /* MMI_ASSERT(0); */
- break;
- }
- mmi_pen_editor_add_cocontrol(&gPenEditorControlSet, PEN_EDITOR_CONTROL_INLINE_TEXT);
- mmi_pen_editor_add_cocontrol(&gPenEditorControlSet, PEN_EDITOR_CONTROL_MULTITAP);
- break;
- case PEN_EDITOR_DATE:
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_NUMBER_TRAY);
- mmi_pen_editor_add_cocontrol(&gPenEditorControlSet, PEN_EDITOR_CONTROL_DATE);
- break;
- case PEN_EDITOR_IP4:
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_NUMBER_TRAY);
- mmi_pen_editor_add_cocontrol(&gPenEditorControlSet, PEN_EDITOR_CONTROL_IP4);
- break;
- case PEN_EDITOR_TIME:
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_NUMBER_TRAY);
- mmi_pen_editor_add_cocontrol(&gPenEditorControlSet, PEN_EDITOR_CONTROL_TIME);
- break;
- case PEN_EDITOR_TIME_PERIOD:
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_NUMBER_TRAY);
- mmi_pen_editor_add_cocontrol(&gPenEditorControlSet, PEN_EDITOR_CONTROL_TIME_PERIOD);
- break;
- default:
- MMI_ASSERT(0);
- break;
- }
- if (!(INPUT_TYPE_NUMERIC_PASSWORD == input_type_only
- || INPUT_TYPE_SAT_NUMERIC_PASSWORD == input_type_only)
- || !(PEN_EDITOR_SINGLE_LINE_INPU_BOX == gPenEditorInputBoxType)
- #ifdef UI_SMALL_PIN_EDITOR_SCREEN
- || whether_no_small_screen()
- #endif /* UI_SMALL_PIN_EDITOR_SCREEN */
- )
- {
- mmi_pen_editor_add_cocontrol(&gPenEditorControlSet, PEN_EDITOR_CONTROL_VIRTUAL_KEYBOARD);
- }
- mmi_pen_editor_add_cocontrol(&gPenEditorControlSet, PEN_EDITOR_CONTROL_COMPOSITION_AREA);
- mmi_pen_editor_add_cocontrol(&gPenEditorControlSet, PEN_EDITOR_CONTROL_CANDIDATE_AREA);
- mmi_pen_editor_add_cocontrol(&gPenEditorControlSet, PEN_EDITOR_CONTROL_IME_BUTTON);
- gPenEditorVKState = PEN_EDITOR_VK_ON;
- gPenEditorVKCandidate = MMI_FALSE;
- //W05.44 Draw Manager will free the stroke layer
- //gPenEditorGDIHandler = NULL;
- gPenEditorShowVK = MMI_TRUE;
- gPenEditorFirstStroke = MMI_TRUE;
- mmi_pen_editor_reset_vk_text(&gPenEditorVKText);
- wgui_set_virtual_keyboard_display_area((U8*) gPenEditorVKText.VKText, MMI_FALSE);
- mmi_pen_editor_pen_set_stroke_color(PhnsetGetHandwritingColor());
- gPenEditorHWSpeed = PhnsetGetHandwritingSpeed();
- /* W06.09 Touch Screen With Keypad V1 */
- /* mmi_pen_editor_clear_key_handler(); */
- g_pen_editor_active_multitap_index = -1;
- g_pen_editor_hold_confirm = MMI_FALSE;
- g_pen_editor_smart_latin_pre_candidate_length = 0;
- g_pen_editor_smart_latin_candidate_index = 0;
- g_pen_editor_composition_state.candidate_state = PEN_EDITOR_CANDIDATE_OFF;
- //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
- /* W05.50 Exclude Virtual Keyboard Area from Handwriting Area */
- mmi_pen_editor_change_handwriting_area();
- /* W06.09 Touch Screen With Keypad V1 */
- if (wgui_handle_inputbox_change_input_mode == currKeyFuncPtrs[KEY_POUND][KEY_EVENT_DOWN] ||
- handle_category28_change_input_mode == currKeyFuncPtrs[KEY_POUND][KEY_EVENT_DOWN] ||
- wgui_handle_qsearch_singleline_inputbox_change_input_mode == currKeyFuncPtrs[KEY_POUND][KEY_EVENT_DOWN] ||
- wgui_handle_singleline_inputbox_change_input_mode == currKeyFuncPtrs[KEY_POUND][KEY_EVENT_DOWN] ||
- wgui_handle_inline_singleline_inputbox_change_input_mode == currKeyFuncPtrs[KEY_POUND][KEY_EVENT_DOWN] //KP Jerry remove "||" to next lines on 2007-4-16
- //KP Jerry modify on 2007-4-16 start
- #ifdef __MMI_LANG_TR_CHINESE__
- || 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
- #endif/*__MMI_LANG_TR_CHINESE__*/
- #ifdef __MMI_LANG_SM_CHINESE__
- || 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
- #endif/*__MMI_LANG_SM_CHINESE__*/
- || INPUT_MODE_SMART_UPPERCASE_ABC == MMI_current_input_mode
- || INPUT_MODE_SMART_LOWERCASE_ABC == MMI_current_input_mode //KP Jerry remove ")" to next lines on 2007-4-16
- #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 modify on 2007-4-16 end
- )
- {
- SetKeyHandler(mmi_pen_editor_switch_input_method, KEY_POUND, KEY_EVENT_DOWN);
- }
- if (PEN_EDITOR_HANDWRITING_STYLE_MULTI_BLOCK == mmi_pen_editor_get_handwriting_style())
- {
- if (MMI_virtual_keyboard.height <= gPenEditorCandidateInputBox.height)
- {
- wgui_move_virtual_keyboard(
- MMI_virtual_keyboard.x,
- MMI_content_y + MMI_content_height - PEN_EDITOR_BLOCK_HEIGHT + 3);
- }
- else
- {
- int different_height = MMI_virtual_keyboard.height - gPenEditorCandidateInputBox.height;
- wgui_move_virtual_keyboard(
- MMI_virtual_keyboard.x,
- MMI_content_y + MMI_content_height - PEN_EDITOR_BLOCK_HEIGHT - different_height);
- }
- gui_move_single_line_input_box(
- &gPenEditorCandidateInputBox,
- gPenEditorCandidateInputBox.x,
- MMI_content_y + MMI_content_height - PEN_EDITOR_BLOCK_HEIGHT + 3);
- }
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- SetLeftSoftkeyAlwaysKeyUpByPen();
- SetRightSoftkeyAlwaysKeyUpByPen();
- #ifdef __MMI_WGUI_CSK_ENABLE__
- SetCenterSoftkeyAlwaysKeyUpByPen();
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_close_input_box
- * DESCRIPTION
- * Reset the state when exiting handwriting
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_close_input_box(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- int changed_height = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* W05.32 History Issue */
- gPenEditorHistoryVirtualKeyboardType = MMI_virtual_keyboard.lang_type;
- changed_height = MMI_virtual_keyboard.height;
- /* W05.44 If the user does not select the candidate and quit the input box, help the user to select the candiadte */
- if (gPenEditorSelectCandidate)
- {
- mmi_pen_editor_confirm_selection();
- }
- //Disable Hand Writing
- //W06.03 Reentering stroke mode after mmi_pen_stop_capture_strokes because of mmi_pen_change_handwriting_area
- mmi_pen_stop_capture_strokes();
- gPenEditorEnableHandWriting = MMI_FALSE;
- //Reset Pen Event Queue
- //Flush pen event queue in mmi_pen_stop_capture_strokes instead of mmi_pen_reset here
- //Clear stroke event handler as nothing
- //mmi_pen_reset();
- //W05.43 clear stroke layer for category57
- if (gPenEditorGDIHandler != NULL && *gPenEditorGDIHandler != GDI_ERROR_HANDLE)
- {
- gdi_layer_push_and_set_active(*gPenEditorGDIHandler);
- gdi_layer_set_source_key(TRUE, GDI_COLOR_TRANSPARENT);
- gdi_layer_clear(GDI_COLOR_TRANSPARENT);
- gdi_layer_pop_and_restore_active();
- }
- mmi_pen_register_stroke_down_handler(mmi_pen_dummy_hdlr);
- mmi_pen_register_stroke_move_handler(NULL, NULL, mmi_pen_dummy_hdlr);
- mmi_pen_register_stroke_up_handler(mmi_pen_dummy_hdlr);
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_EMPTY_TRAY);
- gui_cancel_timer(mmi_pen_editor_stroke_up_timer_handler);
- gui_cancel_timer(mmi_pen_editor_confirm_selection);
- mmi_pen_editor_reset_control_set(&gPenEditorControlSet);
- mmi_pen_editor_reset_vk_text(&gPenEditorVKText);
- wgui_set_virtual_keyboard_display_area((U8*) gPenEditorVKText.VKText, MMI_FALSE);
- gPenEditorActiveControl = PEN_EDITOR_CONTROL_NONE;
- gPenEditorCandidateIndex = 0;
- gPenEditorCandidatePage = 0;
- gPenEditorVKCandidate = MMI_FALSE;
- g_pen_editor_hold_confirm = MMI_FALSE;
- g_pen_editor_vk_show_at_start = MMI_FALSE;
- g_pen_editor_disable_handwriting = MMI_FALSE;
- g_pen_editor_disable_virtual_keyboard = MMI_FALSE;
- g_pen_editor_disable_keypad = MMI_FALSE;
- g_pen_editor_smart_latin_pre_candidate_length = 0;
- g_pen_editor_smart_latin_candidate_index = 0;
- g_pen_editor_resized_by_vk = MMI_FALSE;
- mmi_pen_editor_smart_latin_unhighlight_candidate(MMI_FALSE);
- mmi_pen_editor_reset_key_sequence(&g_pen_editor_key_sequence);
- wgui_virtual_keyboard_set_global_multi_block_mode(MMI_FALSE);
- memset(&g_pen_editor_vk_keys_set, 0, sizeof(g_pen_editor_vk_keys_set));
- memset(g_pen_editor_vk_characters_disable_list, 0, sizeof(g_pen_editor_vk_characters_disable_list));
- memset(g_pen_editor_vk_event_keys_disable_list, 0, sizeof(g_pen_editor_vk_event_keys_disable_list));
- #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);
- //W06.09 Draw Center Softkey when entering new screen instead of drawing here
- //But in in-line editor, redrawing is needed when completing in-line item
- //redraw_softkey(MMI_CENTER_SOFTKEY);
- clear_softkey_handler(MMI_CENTER_SOFTKEY);
- #endif /* __MMI_WGUI_CSK_ENABLE__ */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_show_component
- * DESCRIPTION
- * Empty function
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_show_component(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_add_cocontrol
- * DESCRIPTION
- * Add the pen editor control to the control stes
- * PARAMETERS
- * peneditorcontrolset [OUT] The Control Set to be added
- * peneditorcontrol [IN] The Control to add
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_add_cocontrol(
- mmi_pen_editor_control_set_struct *peneditorcontrolset,
- mmi_pen_editor_control_type_enum peneditorcontrol)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- peneditorcontrolset->PenEditorControlSet[peneditorcontrolset->NumberofControlSets++] = peneditorcontrol;
- MMI_ASSERT(peneditorcontrolset->NumberofControlSets < PEN_EDITOR_MAX_CONTROL_SET_SIZE);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_reset_control_set
- * DESCRIPTION
- * Reset the control stes
- * PARAMETERS
- * peneditorcontrolset [OUT] The control set to be reset
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_reset_control_set(mmi_pen_editor_control_set_struct *peneditorcontrolset)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(peneditorcontrolset, 0, sizeof(mmi_pen_editor_control_set_struct));
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_reset_vk_text
- * DESCRIPTION
- * Reset the virtual keyboard text
- * PARAMETERS
- * peneditorvktext [OUT] The text of virtual keyboard
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_reset_vk_text(mmi_pen_editor_vk_text_struct *peneditorvktext)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(peneditorvktext, 0, sizeof(mmi_pen_editor_vk_text_struct));
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_reset_key_sequence
- * DESCRIPTION
- * Reset the key sequence
- * PARAMETERS
- * peneditorkeysequence [OUT] The key sequence
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_reset_key_sequence(mmi_pen_editor_key_sequence_struct *peneditorkeysequence)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(peneditorkeysequence, 0, sizeof(mmi_pen_editor_key_sequence_struct));
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_set_vk_to_show
- * DESCRIPTION
- * Call mmi_pen_editor_vk_show at the beginning or not
- * PARAMETERS
- * enable [IN] MMI_TRUE : yes
- * MMI_FALSE : no
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_set_vk_to_show(MMI_BOOL enable)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_pen_editor_vk_show_at_start = enable;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_input_character
- * DESCRIPTION
- * Input the character c to the input box
- * PARAMETERS
- * c [IN] The character to input
- * needselect [IN] The candidate can be replaced or not
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_input_character(UI_character_type c, BOOL needselect)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- int changed_height = 0;
- BOOL is_last = MMI_FALSE;
- BOOL is_able_to_insert = MMI_TRUE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* W05.32 Check the character is valid in somespecial input type or not */
- if (INPUT_TYPE_PHONE_NUMBER == (MMI_current_input_type & INPUT_TYPE_MASK))
- {
- if (MMI_current_input_ext_type & INPUT_TYPE_EXT_SIM_NUMERIC)
- {
- if (!mmi_pen_editor_check_valid_input(c, gPenEditorPhoneNumberSIMValidCharacters))
- {
- return;
- }
- }
- else
- {
- if (!mmi_pen_editor_check_valid_input(c, gPenEditorPhoneNumberValidCharacters))
- {
- return;
- }
- }
- }
- else if (INPUT_TYPE_DECIMAL_NUMERIC == (MMI_current_input_type & INPUT_TYPE_MASK))
- {
- if (!mmi_pen_editor_check_valid_input(c, gPenEditorDecimalNumericValidCharacters))
- {
- return;
- }
- }
- else if (INPUT_TYPE_KEYPAD_NUMERIC == (MMI_current_input_type & INPUT_TYPE_MASK)
- || INPUT_TYPE_SAT_NUMERIC_PASSWORD == (MMI_current_input_type & INPUT_TYPE_MASK))
- {
- if (!mmi_pen_editor_check_valid_input(c, gPenEditorKeyPadNumbericValidCharacters))
- {
- return;
- }
- }
- else if (MMI_allow_only_english_input_modes)
- {
- //W05.35 Temp Solution for European Dollar Sign Issue
- //W05.36 Correct for wrong way to check the input
- if ((c > 0xFF))
- {
- return;
- }
- }
- is_able_to_insert = mmi_pen_editor_check_input(c);
- gdi_layer_lock_frame_buffer();
- if (needselect)
- {
- gPenEditorSelectCandidate = MMI_TRUE;
- }
- else
- {
- {
- if (gPenEditorVKText.TextLength > 0)
- {
- mmi_pen_editor_reset_vk_text(&gPenEditorVKText);
- wgui_set_virtual_keyboard_display_area((U8*) gPenEditorVKText.VKText, MMI_TRUE);
- }
- if (GUI_VIRTUAL_KEYBOARD_BOPOMO == MMI_virtual_keyboard.lang_type
- || GUI_VIRTUAL_KEYBOARD_PINYIN == MMI_virtual_keyboard.lang_type)
- {
- if (PEN_EDITOR_QUICK_SEARCH_SINGLE_LINE_INPU_BOX != gPenEditorInputBoxType)
- {
- mmi_pen_editor_hide_candidate_area();
- }
- }
- }
- }
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- if (needselect)
- {
- if (is_able_to_insert)
- {
- multiline_inputbox_multitap_input(c);
- }
- else
- {
- UI_editor_play_tone_cannot_insert();
- }
- mmi_pen_editor_set_right_softkey(PEN_EDITOR_RSK_BY_STATE);
- }
- else
- {
- if (gPenEditorSelectCandidate)
- {
- if (is_able_to_insert)
- {
- multiline_inputbox_multitap_input(c);
- }
- else
- {
- UI_editor_play_tone_cannot_insert();
- }
- /* Temp Solution for LSK Text Update */
- gPenEditorSelectCandidate = MMI_FALSE;
- mmi_pen_editor_set_left_soft_key();
- register_multiline_inputbox_keys();
- if (PEN_EDITOR_DICT_MULTILINE_INPUT_BOX == gPenEditorInputBoxType)
- {
- cat201_register_key_func();
- }
- multiline_inputbox_multitap_input_complete();
- if (PEN_EDITOR_VK_OFF == gPenEditorVKState)
- {
- 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
- || GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL == 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);
- }
- gui_move_single_line_input_box(
- &gPenEditorCandidateInputBox,
- gPenEditorCandidateInputBox.x,
- MMI_virtual_keyboard.y - gPenEditorCandidateInputBox.height - 2);
- }
- /* W06.08 Avoid changing handwriting area when stroke down */
- if (GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL != MMI_virtual_keyboard.lang_type)
- {
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- }
- }
- }
- else
- {
- if (wgui_multiline_inputbox_decimal_input_mode_flag && (c == (UI_character_type) '.'))
- {
- wgui_multiline_inputbox_decimal_numeric_handle_pound_key_down();
- }
- else
- {
- multiline_inputbox_direct_input(c);
- }
- }
- }
- break;
- case PEN_EDITOR_EMS_INPUT_BOX:
- if (needselect)
- {
- if (is_able_to_insert)
- {
- EMS_inputbox_multitap_input(c);
- }
- else
- {
- UI_editor_play_tone_cannot_insert();
- }
- mmi_pen_editor_set_right_softkey(PEN_EDITOR_RSK_BY_STATE);
- }
- else
- {
- if (gPenEditorSelectCandidate)
- {
- if (is_able_to_insert)
- {
- EMS_inputbox_multitap_input(c);
- }
- else
- {
- UI_editor_play_tone_cannot_insert();
- }
- gPenEditorSelectCandidate = MMI_FALSE;
- mmi_pen_editor_set_left_soft_key();
- register_EMS_inputbox_keys();
- EMS_inputbox_multitap_input_complete();
- if (PEN_EDITOR_VK_OFF == gPenEditorVKState)
- {
- 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
- || GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL == MMI_virtual_keyboard.lang_type))
- {
- changed_height -= MMI_virtual_keyboard.height;
- if (!gPenEditorVKCandidate)
- {
- changed_height += gPenEditorCandidateInputBox.height;
- }
- mmi_pen_editor_resize_content_area(changed_height);
- gui_move_single_line_input_box(
- &gPenEditorCandidateInputBox,
- gPenEditorCandidateInputBox.x,
- MMI_virtual_keyboard.y - gPenEditorCandidateInputBox.height - 2);
- }
- /* W06.08 Avoid changing handwriting area when stroke down */
- if (GUI_VIRTUAL_KEYBOARD_CHINESE_SYMBOL != MMI_virtual_keyboard.lang_type)
- {
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- }
- }
- }
- else
- {
- EMS_inputbox_direct_input(c);
- }
- }
- break;
- case PEN_EDITOR_SINGLE_LINE_INPU_BOX:
- case PEN_EDITOR_QUICK_SEARCH_SINGLE_LINE_INPU_BOX:
- if (needselect)
- {
- singleline_inputbox_multitap_input(c);
- mmi_pen_editor_set_right_softkey(PEN_EDITOR_RSK_BY_STATE);
- }
- else
- {
- if (gPenEditorSelectCandidate)
- {
- singleline_inputbox_multitap_input(c);
- gPenEditorSelectCandidate = MMI_FALSE;
- /* Temp Solution for LSK Text Update */
- mmi_pen_editor_set_left_soft_key();
- singleline_inputbox_multitap_input_complete();
- if (PEN_EDITOR_VK_OFF == gPenEditorVKState)
- {
- gPenEditorVKState = PEN_EDITOR_VK_ON;
- /* W05.32 Virtual Keyboard Display Issue in single Line Input Box */
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- }
- }
- else
- {
- if (PEN_EDITOR_QUICK_SEARCH_SINGLE_LINE_INPU_BOX == gPenEditorInputBoxType)
- {
- if (cat200_search_function)
- {
- singleline_inputbox_direct_input(c);
- refresh_search_list(MMI_singleline_inputbox.text);
- RedrawCategoryFunction();
- }
- }
- else
- {
- if (wgui_singleline_inputbox_decimal_input_mode_flag && (c == (UI_character_type) '.'))
- {
- wgui_singleline_inputbox_decimal_numeric_handle_pound_key_down();
- }
- else
- {
- singleline_inputbox_direct_input(c);
- }
- }
- }
- }
- break;
- case PEN_EDITOR_INLINE_TEXT:
- if (needselect)
- {
- inline_edit_singleline_inputbox_multitap_input(c);
- mmi_pen_editor_set_right_softkey(PEN_EDITOR_RSK_BY_STATE);
- }
- else
- {
- if (gPenEditorSelectCandidate)
- {
- inline_edit_singleline_inputbox_multitap_input(c);
- gPenEditorSelectCandidate = MMI_FALSE;
- /* Temp Solution for LSK Text Update */
- mmi_pen_editor_set_left_soft_key();
- inline_edit_singleline_inputbox_multitap_input_complete();
- if (PEN_EDITOR_VK_OFF == gPenEditorVKState)
- {
- gPenEditorVKState = PEN_EDITOR_VK_ON;
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- }
- }
- else
- {
- if (wgui_inline_singleline_inputbox_decimal_input_mode_flag && (c == (UI_character_type) '.'))
- {
- wgui_inline_singleline_inputbox_decimal_numeric_handle_pound_key_down();
- }
- else
- {
- inline_edit_singleline_inputbox_direct_input(c);
- }
- }
- }
- break;
- case PEN_EDITOR_DATE:
- if (needselect)
- {
- if (date_input_test_last_position(current_date_input))
- {
- is_last = MMI_TRUE;
- }
- date_input_direct_input_nodraw(c);
- if (!is_last)
- {
- date_input_previous_character();
- }
- show_date_input(current_date_input);
- mmi_pen_editor_set_right_softkey(PEN_EDITOR_RSK_BACK);
- }
- else
- {
- if (gPenEditorSelectCandidate)
- {
- date_input_direct_input(c);
- gPenEditorSelectCandidate = MMI_FALSE;
- /* Temp Solution for LSK Text Update */
- mmi_pen_editor_set_left_soft_key();
- if (PEN_EDITOR_VK_OFF == gPenEditorVKState)
- {
- gPenEditorVKState = PEN_EDITOR_VK_ON;
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- }
- }
- else
- {
- date_input_direct_input(c);
- }
- }
- break;
- case PEN_EDITOR_IP4:
- if (needselect)
- {
- if (IP4_input_test_last_position(current_IP4_input))
- {
- is_last = MMI_TRUE;
- }
- IP4_input_direct_input_nodraw(c);
- if (!is_last)
- {
- IP4_input_previous_character();
- }
- show_IP4_input(current_IP4_input);
- mmi_pen_editor_set_right_softkey(PEN_EDITOR_RSK_BACK);
- }
- else
- {
- if (gPenEditorSelectCandidate)
- {
- IP4_input_direct_input(c);
- gPenEditorSelectCandidate = MMI_FALSE;
- /* Temp Solution for LSK Text Update */
- mmi_pen_editor_set_left_soft_key();
- if (PEN_EDITOR_VK_OFF == gPenEditorVKState)
- {
- gPenEditorVKState = PEN_EDITOR_VK_ON;
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- }
- }
- else
- {
- IP4_input_direct_input(c);
- }
- }
- break;
- case PEN_EDITOR_TIME:
- if (needselect)
- {
- if (time_input_test_last_position(current_time_input))
- {
- is_last = MMI_TRUE;
- }
- time_input_direct_input_nodraw(c);
- if (!is_last)
- {
- time_input_previous_character();
- }
- show_time_input(current_time_input);
- mmi_pen_editor_set_right_softkey(PEN_EDITOR_RSK_BACK);
- }
- else
- {
- if (gPenEditorSelectCandidate)
- {
- time_input_direct_input(c);
- gPenEditorSelectCandidate = MMI_FALSE;
- /* Temp Solution for LSK Text Update */
- mmi_pen_editor_set_left_soft_key();
- if (PEN_EDITOR_VK_OFF == gPenEditorVKState)
- {
- gPenEditorVKState = PEN_EDITOR_VK_ON;
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- }
- }
- else
- {
- time_input_direct_input(c);
- }
- }
- break;
- case PEN_EDITOR_TIME_PERIOD:
- if (needselect)
- {
- if (time_period_input_test_last_position(current_time_period_input))
- {
- is_last = MMI_TRUE;
- }
- time_period_input_direct_input_nodraw(c);
- if (!is_last)
- {
- time_period_input_previous_character();
- }
- show_time_period_input(current_time_period_input);
- mmi_pen_editor_set_right_softkey(PEN_EDITOR_RSK_BACK);
- }
- else
- {
- if (gPenEditorSelectCandidate)
- {
- time_period_input_direct_input(c);
- gPenEditorSelectCandidate = MMI_FALSE;
- /* Temp Solution for LSK Text Update */
- mmi_pen_editor_set_left_soft_key();
- if (PEN_EDITOR_VK_OFF == gPenEditorVKState)
- {
- gPenEditorVKState = PEN_EDITOR_VK_ON;
- mmi_pen_editor_clear_and_show_virtual_keyboard_area();
- }
- }
- else
- {
- time_period_input_direct_input(c);
- }
- }
- break;
- #ifdef __UI_PAGING_IN_MULTILINE_EDITOR__
- case PEN_EDITOR_PAGING_IN_MULTLINE_EDITOR:
- wgui_paging_multiline_key_maaping_TS(c);
- break;
- #endif
- default:
- MMI_ASSERT(0);
- }
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_backspace
- * DESCRIPTION
- * Backspace in the input box
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_backspace(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* W06.11 Set RSK after backspace in virtual keyboard */
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- if (wgui_multiline_inputbox_decimal_input_mode_flag)
- {
- wgui_handle_inputbox_right_softkey_down();
- }
- else
- {
- multiline_inputbox_delete_character();
- }
- wgui_set_RSK();
- break;
- case PEN_EDITOR_EMS_INPUT_BOX:
- EMS_inputbox_backspace();
- wgui_set_EMS_inputbox_RSK();
- break;
- case PEN_EDITOR_SINGLE_LINE_INPU_BOX:
- case PEN_EDITOR_QUICK_SEARCH_SINGLE_LINE_INPU_BOX:
- if (wgui_singleline_inputbox_decimal_input_mode_flag)
- {
- wgui_handle_singleline_inputbox_right_softkey_down();
- }
- else
- {
- singleline_inputbox_delete_character();
- }
- if (cat200_search_function)
- {
- refresh_search_list(MMI_singleline_inputbox.text);
- RedrawCategoryFunction();
- }
- wgui_set_singleline_RSK();
- break;
- case PEN_EDITOR_INLINE_TEXT:
- /* W06.16 Temp Solution for RSK in Category57. Only delete the character when there is something. */
- if (gui_single_line_input_box_get_text_length(&MMI_inline_singleline_inputbox) > 0)
- {
- if (wgui_inline_singleline_inputbox_decimal_input_mode_flag)
- {
- handle_inline_text_edit_right_softkey_down();
- }
- else
- {
- inline_edit_singleline_inputbox_delete_character();
- }
- mmi_pen_editor_set_right_soft_key_inline_text();
- }
- else
- {
- UI_editor_play_tone_cannot_change();
- }
- break;
- case PEN_EDITOR_DATE:
- date_input_previous_character();
- break;
- case PEN_EDITOR_IP4:
- IP4_input_previous_character();
- break;
- case PEN_EDITOR_TIME:
- time_input_previous_character();
- break;
- case PEN_EDITOR_TIME_PERIOD:
- time_period_input_previous_character();
- break;
- case PEN_EDITOR_PAGING_IN_MULTLINE_EDITOR:
- break;
- default:
- MMI_ASSERT(0);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_bracket
- * DESCRIPTION
- * Add brackets in the input box
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_bracket(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* W05.36 Temp Solution Do nothing when there is candidates list */
- if (gPenEditorSelectCandidate)
- {
- return;
- }
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- gui_multi_line_input_box_insert_character(&MMI_multiline_inputbox, '(');
- if (0 < gui_multi_line_input_box_get_remaining_length(&MMI_multiline_inputbox))
- {
- gui_multi_line_input_box_insert_character(&MMI_multiline_inputbox, ')');
- multiline_inputbox_previous_character();
- }
- else
- {
- redraw_multiline_inputbox();
- }
- multiline_inputbox_input_callback();
- break;
- case PEN_EDITOR_EMS_INPUT_BOX:
- {
- //W06.03 EMS_get_remaining_length > 0 does not make sure that we could insert one more character
- //We check this by gui_EMS_input_box_insert_character
- U8 ret = gui_EMS_input_box_insert_character(&MMI_EMS_inputbox, '(');
- if (0 < EMS_get_remaining_length(MMI_EMS_inputbox.data) && (ret == EMS_OK))
- {
- if (gui_EMS_input_box_insert_character(&MMI_EMS_inputbox, ')') == EMS_OK)
- {
- EMS_inputbox_previous();
- }
- }
- redraw_EMS_inputbox();
- EMS_inputbox_input_callback();
- break;
- }
- case PEN_EDITOR_SINGLE_LINE_INPU_BOX:
- case PEN_EDITOR_QUICK_SEARCH_SINGLE_LINE_INPU_BOX:
- gui_single_line_input_box_insert_character(&MMI_singleline_inputbox, '(');
- if (0 < gui_single_line_input_box_get_remaining_length(&MMI_singleline_inputbox))
- {
- gui_single_line_input_box_insert_character(&MMI_singleline_inputbox, ')');
- singleline_inputbox_previous_character();
- }
- else
- {
- redraw_singleline_inputbox();
- }
- singleline_inputbox_input_callback();
- /* W05.52 Fix Quick Search Issue */
- if (cat200_search_function)
- {
- refresh_search_list(MMI_singleline_inputbox.text);
- RedrawCategoryFunction();
- }
- break;
- case PEN_EDITOR_INLINE_TEXT:
- gui_single_line_input_box_insert_character(&MMI_inline_singleline_inputbox, '(');
- if (0 < gui_single_line_input_box_get_remaining_length(&MMI_inline_singleline_inputbox))
- {
- gui_single_line_input_box_insert_character(&MMI_inline_singleline_inputbox, ')');
- inline_edit_singleline_inputbox_previous_character();
- }
- else
- {
- redraw_inline_singleline_inputbox();
- }
- inline_singleline_inputbox_input_callback();
- break;
- case PEN_EDITOR_DATE:
- case PEN_EDITOR_IP4:
- case PEN_EDITOR_TIME:
- case PEN_EDITOR_TIME_PERIOD:
- break;
- default:
- MMI_ASSERT(0);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_new_line
- * DESCRIPTION
- * Add "Enter (0x0A 0x0D)" symbol in the input box
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_new_line(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* W05.48 If INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL, do not insert new line */
- if (INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL & MMI_current_input_ext_type)
- {
- return;
- }
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- gui_multi_line_input_box_insert_newline(&MMI_multiline_inputbox);
- redraw_multiline_inputbox();
- multiline_inputbox_input_callback();
- break;
- case PEN_EDITOR_EMS_INPUT_BOX:
- EMS_inputbox_insert_new_line();
- redraw_EMS_inputbox();
- break;
- case PEN_EDITOR_SINGLE_LINE_INPU_BOX:
- case PEN_EDITOR_QUICK_SEARCH_SINGLE_LINE_INPU_BOX:
- case PEN_EDITOR_INLINE_TEXT:
- case PEN_EDITOR_DATE:
- case PEN_EDITOR_IP4:
- case PEN_EDITOR_TIME:
- case PEN_EDITOR_TIME_PERIOD:
- break;
- default:
- MMI_ASSERT(0);
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_resize_content_area
- * DESCRIPTION
- * Resize the content area according to the changed height.
- * PARAMETERS
- * changed_height [IN] The height to change
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_resize_content_area(int changed_height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (0 == changed_height
- #ifdef __MMI_EDITOR_PEN_VK_UNFOLD__
- && !gPenEditorOnlyRedrawInputBox
- #endif /* __MMI_EDITOR_PEN_VK_UNFOLD__ */
- )
- {
- return;
- }
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- gui_resize_multi_line_input_box(
- &MMI_multiline_inputbox,
- MMI_multiline_inputbox.width,
- MMI_multiline_inputbox.height + changed_height);
- redraw_multiline_inputbox();
- break;
- case PEN_EDITOR_EMS_INPUT_BOX:
- gui_resize_EMS_input_box(
- &MMI_EMS_inputbox,
- MMI_EMS_inputbox.width,
- MMI_EMS_inputbox.height + changed_height);
- redraw_EMS_inputbox();
- break;
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- gui_resize_multi_line_input_box(
- &MMI_multiline_inputbox,
- MMI_multiline_inputbox.width,
- MMI_multiline_inputbox.height + changed_height);
- redraw_multiline_inputbox();
- break;
- case PEN_EDITOR_SINGLE_LINE_INPU_BOX:
- break;
- case PEN_EDITOR_QUICK_SEARCH_SINGLE_LINE_INPU_BOX:
- resize_fixed_list(MMI_fixed_list_menu.width, MMI_fixed_list_menu.height + changed_height);
- /* W06.03 Adjust highlight position */
- gui_dynamic_list_menu_locate_highlighted_item(&MMI_fixed_list_menu);
- move_singleline_inputbox(MMI_singleline_inputbox.x, MMI_fixed_list_menu.y + MMI_fixed_list_menu.height + 1);
- break;
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- resize_fixed_list(MMI_fixed_list_menu.width, MMI_fixed_list_menu.height + changed_height);
- gui_dynamic_list_menu_locate_highlighted_item(&MMI_fixed_list_menu);
- move_multiline_inputbox(
- MMI_multiline_inputbox.x,
- MMI_fixed_list_menu.y + MMI_fixed_list_menu.height + wgui_inputbox_information_bar_height);
- wgui_setup_input_information(
- MMI_multiline_inputbox.x,
- MMI_multiline_inputbox.y - wgui_inputbox_information_bar_height,
- MMI_multiline_inputbox.width,
- wgui_inputbox_information_bar_height);
- RedrawCategoryControlledArea201Screen();
- break;
- case PEN_EDITOR_INLINE_TEXT:
- break;
- case PEN_EDITOR_DATE:
- break;
- case PEN_EDITOR_IP4:
- break;
- case PEN_EDITOR_TIME:
- break;
- case PEN_EDITOR_TIME_PERIOD:
- break;
- default:
- MMI_ASSERT(0);
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_set_virtual_keyboard_by_input_mode
- * DESCRIPTION
- * Set the type of virtual keyboard by input mode
- * PARAMETERS
- * input_mode [IN] The input mode
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_set_virtual_keyboard_by_input_mode(S32 input_mode)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (input_mode)
- {
- //KP Jerry modify on 2007-3-17 start
- case INPUT_MODE_MMI_LOWERCASE_ABC:
- case INPUT_MODE_MULTITAP_LOWERCASE_ABC:
- case INPUT_MODE_SMART_LOWERCASE_ABC:
- case INPUT_MODE_MULTITAP_LOWERCASE_ABC_NO_NUMERIC:
- gPenEditorVKCandidate=MMI_FALSE;
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH);
- break;
- case INPUT_MODE_MMI_NUMERIC:
- case INPUT_MODE_123:
- case INPUT_MODE_123_SYMBOLS:
- gPenEditorVKCandidate=MMI_FALSE;
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_NUMBER);
- break;
- #ifdef __MMI_LANG_TR_CHINESE__
- case INPUT_MODE_MMI_MULTITAP_BPMF:
- gPenEditorVKCandidate=MMI_FALSE;
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_BOPOMO);
- break;
- case INPUT_MODE_MMI_TR_STROKE:
- gPenEditorVKCandidate=MMI_FALSE;
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_SYMBOL);
- break;
- #endif/*__MMI_LANG_TR_CHINESE__*/
- #ifdef __MMI_LANG_SM_CHINESE__
- case INPUT_MODE_MMI_MULTITAP_PINYIN:
- gPenEditorVKCandidate=MMI_FALSE;
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_PINYIN);
- break;
- case INPUT_MODE_MMI_SM_STROKE:
- gPenEditorVKCandidate=MMI_FALSE;
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_SYMBOL);
- break;
- #endif/*__MMI_LANG_SM_CHINESE__*/
- case INPUT_MODE_MULTITAP_UPPERCASE_ABC:
- case INPUT_MODE_SMART_UPPERCASE_ABC:
- case INPUT_MODE_MULTITAP_UPPERCASE_ABC_NO_NUMERIC:
- gPenEditorVKCandidate=MMI_FALSE;
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH_UPPERCASE);
- break;
- #ifdef __MMI_LANG_TR_CHINESE__
- case INPUT_MODE_TR_MULTITAP_BOPOMO:
- case INPUT_MODE_TR_BOPOMO:
- gPenEditorVKCandidate=MMI_TRUE;
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_BOPOMO);
- break;
- case INPUT_MODE_TR_STROKE:
- gPenEditorVKCandidate=MMI_TRUE;
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_SYMBOL);
- break;
- #endif/*__MMI_LANG_TR_CHINESE__*/
- #ifdef __MMI_LANG_SM_CHINESE__
- case INPUT_MODE_SM_MULTITAP_PINYIN:
- case INPUT_MODE_SM_PINYIN:
- gPenEditorVKCandidate=MMI_TRUE;
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_PINYIN);
- break;
- case INPUT_MODE_SM_STROKE:
- gPenEditorVKCandidate=MMI_TRUE;
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_SYMBOL);
- break;
- #endif/*__MMI_LANG_SM_CHINESE__*/
- //KP Jerry modify on 2007-3-17 end
- //KP Jerry add on 2007-4-7 start
- #ifdef __MMI_LANG_VIETNAMESE__
- case INPUT_MODE_MULTITAP_UPPERCASE_VIETNAMESE:
- case INPUT_MODE_SMART_UPPERCASE_VIETNAMESE:
- gPenEditorVKCandidate=MMI_FALSE;
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH_UPPERCASE);
- break;
- case INPUT_MODE_MULTITAP_LOWERCASE_VIETNAMESE:
- case INPUT_MODE_MMI_LOWERCASE_VIETNAMESE:
- case INPUT_MODE_SMART_LOWERCASE_VIETNAMESE:
- gPenEditorVKCandidate=MMI_FALSE;
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH);
- break;
- #endif
- #ifdef __MMI_LANG_RUSSIAN__
- case INPUT_MODE_MULTITAP_UPPERCASE_RUSSIAN:
- case INPUT_MODE_SMART_UPPERCASE_RUSSIAN:
- gPenEditorVKCandidate=MMI_FALSE;
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_RUSSIAN_UPPERCASE);
- break;
- case INPUT_MODE_MULTITAP_LOWERCASE_RUSSIAN:
- case INPUT_MODE_MMI_LOWERCASE_RUSSIAN:
- case INPUT_MODE_SMART_LOWERCASE_RUSSIAN:
- gPenEditorVKCandidate=MMI_FALSE;
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_RUSSIAN);
- break;
- #endif
- #ifdef __MMI_LANG_THAI__
- case INPUT_MODE_MULTITAP_THAI:
- case INPUT_MODE_SMART_THAI:
- gPenEditorVKCandidate=MMI_FALSE;
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH_UPPERCASE);
- break;
- case INPUT_MODE_MMI_MULTITAP_THAI:
- gPenEditorVKCandidate=MMI_FALSE;
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_ENGLISH);
- break;
- #endif
- //KP Jerry add on 2007-4-7 end
- default:
- MMI_ASSERT(0);
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_vk_insert_character
- * DESCRIPTION
- * Insert character into Virtual Keyboard Text
- * PARAMETERS
- * vk_text [OUT] The virtual keyboard text control
- * ch [IN] The character to insert
- * RETURNS
- * MMI_TRUE : Success to insert
- * MMI_FALSE : Failed to insert
- *****************************************************************************/
- BOOL mmi_pen_editor_vk_insert_character(mmi_pen_editor_vk_text_struct *vk_text, UI_character_type ch)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (MMI_virtual_keyboard.lang_type)
- {
- case GUI_VIRTUAL_KEYBOARD_BOPOMO:
- if (vk_text->TextLength < PEN_EDITOR_MAX_BOPOMOFO_SIZE - 1)
- {
- vk_text->VKText[vk_text->TextLength++] = ch;
- return MMI_TRUE;
- }
- return MMI_FALSE;
- case GUI_VIRTUAL_KEYBOARD_PINYIN:
- if ((vk_text->TextLength < PEN_EDITOR_MAX_PINYIN_SIZE - 1) && (ch > 0x60) && (ch < 0x7b))
- {
- vk_text->VKText[vk_text->TextLength++] = ch;
- return MMI_TRUE;
- }
- return MMI_FALSE;
- default:
- return MMI_FALSE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_vk_delete_character
- * DESCRIPTION
- * Delete the last character in Virtual Keyboard Text
- * PARAMETERS
- * vk_text [OUT] The virtual keyboard text control
- * RETURNS
- * MMI_TRUE : Success to delete
- * MMI_FALSE : Failed to delete
- *****************************************************************************/
- BOOL mmi_pen_editor_vk_delete_character(mmi_pen_editor_vk_text_struct *vk_text)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (vk_text->TextLength > 0)
- {
- vk_text->VKText[--vk_text->TextLength] = ' ';
- return MMI_TRUE;
- }
- return MMI_FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_add_key_sequence
- * DESCRIPTION
- * Insert the key into key sequence
- * PARAMETERS
- * key_sequence [OUT] The key sequence control
- * key [IN] The key to insert
- * RETURNS
- * MMI_TRUE : Success to insert
- * MMI_FALSE : Failed to insert
- *****************************************************************************/
- BOOL mmi_pen_editor_add_key_sequence(mmi_pen_editor_key_sequence_struct *key_sequence, mmi_keypads_enum key)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (key_sequence->KeyLength < PEN_EDITOR_MAX_KEY_BUFFER_SIZE - 1)
- {
- key_sequence->KeySequence[key_sequence->KeyLength++] = key;
- return MMI_TRUE;
- }
- return MMI_FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_del_key_sequence
- * DESCRIPTION
- * Delete the last key in key sequence
- * PARAMETERS
- * key_sequence [OUT] The key sequence control
- * RETURNS
- * MMI_TRUE : Success to delete
- * MMI_FALSE : Failed to delete
- *****************************************************************************/
- BOOL mmi_pen_editor_del_key_sequence(mmi_pen_editor_key_sequence_struct *key_sequence)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (key_sequence->KeyLength > 0)
- {
- key_sequence->KeySequence[--key_sequence->KeyLength] = ' ';
- return MMI_TRUE;
- }
- return MMI_FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_get_candidates_by_vk
- * DESCRIPTION
- * To get candidates according to virtual keyboard text
- * PARAMETERS
- * void
- * RETURNS
- * MMI_TRUE : The virtual keyboard text is valid
- * MMI_FALSE : The virtual keyboard text is invalid
- *****************************************************************************/
- BOOL mmi_pen_editor_get_candidates_by_vk(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- UI_character_type candidate_buffer[PEN_EDITOR_MAX_CANDIDATE_SIZE];
- int num = 0, i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gPenEditorVKText.TextLength > 0)
- {
- /* W05.36 To Fix Candidates Lsit Issue Because of Font Type */
- gui_set_font(gPenEditorCandidateInputBox.text_font);
- num = mmi_ime_get_candidates_by_composition(gPenEditorVKText.VKText, candidate_buffer);
- if (num)
- {
- /* W06.10 Reset Candidate Index to avoid incorrect value when adding components */
- mmi_pen_editor_reset_candidate_index();
- gui_single_line_input_box_delete_all(&gPenEditorCandidateInputBox);
- for (; 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);
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_show_candidate_area(MMI_TRUE, PEN_EDITOR_CANDIDATE_ON_AND_FOCUS);
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- return MMI_TRUE;
- }
- }
- return MMI_FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_get_candidates_by_phrase
- * DESCRIPTION
- * To Get candidates from input character as phrase
- * PARAMETERS
- * ch [IN] The previous character of the phrase
- * RETURNS
- * MMI_TRUE : There are candidates as the phrase of ch
- * MMI_FALSE : There are no candidates as the phrase of ch
- *****************************************************************************/
- BOOL mmi_pen_editor_get_candidates_by_phrase(UI_character_type ch)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- UI_character_type candidate_buffer[PEN_EDITOR_MAX_CANDIDATE_SIZE];
- int num = 0, i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* W05.36 To Fix Candidates Lsit Issue Because of Font Type */
- gui_set_font(gPenEditorCandidateInputBox.text_font);
- num = mmi_ime_get_candidates_by_phrase(ch, candidate_buffer);
- if (num)
- {
- gui_single_line_input_box_delete_all(&gPenEditorCandidateInputBox);
- for (; 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);
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_show_candidate_area(MMI_TRUE, PEN_EDITOR_CANDIDATE_ON_AND_FOCUS);
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- return MMI_TRUE;
- }
- return MMI_FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_get_candidates_by_page
- * DESCRIPTION
- * To Get the candidates according to the page index
- * PARAMETERS
- * page [IN] The page index
- * RETURNS
- * MMI_TRUE : There are candidates for the page index
- * MMI_FALSE : There are no candidates for the page index
- *****************************************************************************/
- BOOL mmi_pen_editor_get_candidates_by_page(S32 page)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- UI_character_type candidate_buffer[PEN_EDITOR_MAX_CANDIDATE_SIZE];
- int num = 0, i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* W05.37 To Fix Candidates Lsit Issue Because of Font Type */
- gui_set_font(gPenEditorCandidateInputBox.text_font);
- num = mmi_ime_get_candidates_by_page(page, candidate_buffer);
- if (num)
- {
- gui_single_line_input_box_delete_all(&gPenEditorCandidateInputBox);
- for (; 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);
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_show_candidate_area(MMI_TRUE, PEN_EDITOR_CANDIDATE_ON_AND_FOCUS);
- gdi_layer_unlock_frame_buffer();
- /* gdi_lcd_repaint_all(); */
- return MMI_TRUE;
- }
- return MMI_FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_get_candidates_prev_page
- * DESCRIPTION
- * To get the candidates of the previous page
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_get_candidates_prev_page(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gPenEditorCandidatePage > 0)
- {
- gPenEditorCandidatePage--;
- mmi_pen_editor_get_candidates_by_page(gPenEditorCandidatePage);
- gui_single_line_input_box_next_steps(&gPenEditorCandidateInputBox, gPenEditorCandidateIndex);
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_show_candidate_area(
- g_pen_editor_candidate_state.arrow_enable,
- PEN_EDITOR_CANDIDATE_ON_AND_FOCUS);
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_get_candidates_next_page
- * DESCRIPTION
- * To get the candidates of the next page
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_get_candidates_next_page(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gPenEditorCandidatePage++;
- if (!mmi_pen_editor_get_candidates_by_page(gPenEditorCandidatePage))
- {
- gPenEditorCandidatePage--;
- return;
- }
- gui_single_line_input_box_next_steps(&gPenEditorCandidateInputBox, gPenEditorCandidateIndex);
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_show_candidate_area(g_pen_editor_candidate_state.arrow_enable, PEN_EDITOR_CANDIDATE_ON_AND_FOCUS);
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_get_candidates_prev
- * DESCRIPTION
- * Goto to the previous candidate
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_get_candidates_prev(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gPenEditorCandidateIndex > 0)
- {
- gPenEditorCandidateIndex--;
- gui_single_line_input_box_previous(&gPenEditorCandidateInputBox);
- }
- else
- {
- 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)
- {
- if (gPenEditorCandidatePage > 0)
- {
- gPenEditorCandidatePage--;
- gPenEditorCandidateIndex = PEN_EDITOR_CANDIDATE_SIZE_WITH_ARROWS - 1;
- mmi_pen_editor_get_candidates_by_page(gPenEditorCandidatePage);
- gui_single_line_input_box_goto_last_character(&gPenEditorCandidateInputBox);
- }
- }
- }
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_show_candidate_area(g_pen_editor_candidate_state.arrow_enable, PEN_EDITOR_CANDIDATE_ON_AND_FOCUS);
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_get_candidates_next
- * DESCRIPTION
- * Goto to the next candidate
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_get_candidates_next(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* W05.35 For Candidate Index Issue */
- if ((gPenEditorCandidateIndex < PEN_EDITOR_CANDIDATE_SIZE_WITH_ARROWS - 1)
- && (gPenEditorCandidateIndex < (gPenEditorCandidateInputBox.text_length / 2) - 2))
- {
- gPenEditorCandidateIndex++;
- gui_single_line_input_box_next(&gPenEditorCandidateInputBox);
- }
- else
- {
- 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)
- {
- gPenEditorCandidatePage++;
- if (!mmi_pen_editor_get_candidates_by_page(gPenEditorCandidatePage))
- {
- gPenEditorCandidatePage--;
- return;
- }
- gPenEditorCandidateIndex = 0;
- }
- }
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_show_candidate_area(g_pen_editor_candidate_state.arrow_enable, PEN_EDITOR_CANDIDATE_ON_AND_FOCUS);
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_register_arrow_keys
- * DESCRIPTION
- * Register functions of the arrow keys when focus on the candidate box
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_register_arrow_keys(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_EMS_INPUT_BOX:
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_DICT_MULTILINE_INPUT_BOX:
- SetKeyHandler(mmi_pen_editor_get_candidates_prev, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_pen_editor_get_candidates_next, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_pen_editor_get_candidates_prev_page, KEY_UP_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_pen_editor_get_candidates_next_page, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
- break;
- default:
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_smart_latin_register_arrow_keys
- * DESCRIPTION
- * Register functions of the arrow keys when there is smart latin candidate
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_smart_latin_register_arrow_keys(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeyHandler(mmi_pen_editor_smart_latin_confirm_candidate_left, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_pen_editor_smart_latin_confirm_candidate_right, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_pen_editor_smart_latin_get_candidates_prev, KEY_UP_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_pen_editor_smart_latin_get_candidates_next, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_smart_latin_confirm_candidate_left
- * DESCRIPTION
- * Confirm and move the cursor to the left of the smart latin candidate
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_smart_latin_confirm_candidate_left(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- for (i = 0; i < g_pen_editor_smart_latin_pre_candidate_length; i++)
- {
- switch (gPenEditorInputBoxType)
- {
- case PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX:
- case PEN_EDITOR_MULTILINE_INPUT_BOX:
- gui_multi_line_input_box_previous(&MMI_multiline_inputbox);
- break;
- case PEN_EDITOR_EMS_INPUT_BOX:
- gui_EMS_input_box_previous(&MMI_EMS_inputbox);
- break;
- default:
- break;
- }
- }
- mmi_pen_editor_left_soft_key_handler();
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_smart_latin_confirm_candidate_right
- * DESCRIPTION
- * Confirm and move the cursor to the right of the smart latin candidate
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_smart_latin_confirm_candidate_right(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_left_soft_key_handler();
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_smart_latin_get_candidates_prev
- * DESCRIPTION
- * Get the previous smart latin candidate
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_smart_latin_get_candidates_prev(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- UI_character_type candidate_buffer[PEN_EDITOR_MAX_KEY_BUFFER_SIZE];
- U32 candidatelength = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_pen_editor_smart_latin_candidate_index--;
- candidatelength = mmi_ime_smart_latin_get_candidates_by_index(&g_pen_editor_smart_latin_candidate_index, candidate_buffer);
- if (candidatelength)
- {
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_smart_latin_replace_candidate(candidate_buffer, candidatelength);
- if (g_pen_editor_key_sequence.KeyLength == 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);
- mmi_pen_editor_smart_latin_register_arrow_keys();
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_smart_latin_get_candidates_next
- * DESCRIPTION
- * Get the next smart latin candidate
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_smart_latin_get_candidates_next(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- UI_character_type candidate_buffer[PEN_EDITOR_MAX_KEY_BUFFER_SIZE];
- U32 candidatelength = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_pen_editor_smart_latin_candidate_index++;
- candidatelength = mmi_ime_smart_latin_get_candidates_by_index(&g_pen_editor_smart_latin_candidate_index, candidate_buffer);
- if (candidatelength)
- {
- gdi_layer_lock_frame_buffer();
- mmi_pen_editor_smart_latin_replace_candidate(candidate_buffer, candidatelength);
- if (g_pen_editor_key_sequence.KeyLength == 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);
- mmi_pen_editor_smart_latin_register_arrow_keys();
- gdi_layer_unlock_frame_buffer();
- gdi_lcd_repaint_all();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_smart_bpmf_pinyin_register_arrow_keys
- * DESCRIPTION
- * Register functions of the arrow keys when the input mode is smart BPMF/PinYin
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_smart_bpmf_pinyin_register_arrow_keys(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeyHandler(mmi_pen_editor_smart_bpmf_pinyin_get_syllable_prev, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_pen_editor_smart_bpmf_pinyin_get_syllable_next, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_pen_editor_smart_bpmf_pinyin_confirm_syllable, KEY_UP_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_pen_editor_smart_bpmf_pinyin_confirm_syllable, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_pen_editor_smart_bpmf_pinyin_get_syllable_prev
- * DESCRIPTION
- * Get the previous smart BPMF/PinYin syllable
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_pen_editor_smart_bpmf_pinyin_get_syllable_prev(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_pen_editor_composition_index)
- {
- g_pen_editor_composition_index--;
- }
- else
- {
- if (g_pen_editor_composition_page)
- {
- g_pen_editor_composition_index = PEN_EDITOR_MAX_SYLLABLE_CANDIDATE_SIZE - 1;
- 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 = 0;
- g_pen_editor_composition_page++;
- }
- }
- 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_get_syllable_next
- * DESCRIPTION
- * Get the next smart BPMF/PinYin syllable
- * PARAMETERS
- * void
- * RETURNS
- * void