wgui_categories_inputs.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:1705k
源码类别:
MTK
开发平台:
C/C++
- case INPUT_TYPE_SMART_LOWERCASE_FINNISH:
- set_multiline_inputbox_mask(0);
- change_multiline_inputbox_mode(INPUT_MODE_SMART_LOWERCASE_FINNISH);
- SetKeyHandler(wgui_handle_inputbox_change_input_mode, KEY_POUND, KEY_EVENT_DOWN);
- inputbox_change_mode = change_multiline_inputbox_input_mode;
- MMI_current_input_mode = INPUT_MODE_SMART_LOWERCASE_FINNISH;
- wgui_inputbox_information_icon = get_image(WGUI_ZI_EZITEXT_LOGO);
- break;
- #endif /* defined(__MMI_ZI_FINNISH__) */
- #if defined(__MMI_ZI_CZECH__)
- case INPUT_TYPE_SMART_UPPERCASE_CZECH:
- set_multiline_inputbox_mask(0);
- change_multiline_inputbox_mode(INPUT_MODE_SMART_UPPERCASE_CZECH);
- SetKeyHandler(wgui_handle_inputbox_change_input_mode, KEY_POUND, KEY_EVENT_DOWN);
- inputbox_change_mode = change_multiline_inputbox_input_mode;
- MMI_current_input_mode = INPUT_MODE_SMART_UPPERCASE_CZECH;
- wgui_inputbox_information_icon = get_image(WGUI_ZI_EZITEXT_LOGO);
- break;
- case INPUT_TYPE_SMART_LOWERCASE_CZECH:
- set_multiline_inputbox_mask(0);
- change_multiline_inputbox_mode(INPUT_MODE_SMART_LOWERCASE_CZECH);
- SetKeyHandler(wgui_handle_inputbox_change_input_mode, KEY_POUND, KEY_EVENT_DOWN);
- inputbox_change_mode = change_multiline_inputbox_input_mode;
- MMI_current_input_mode = INPUT_MODE_SMART_LOWERCASE_CZECH;
- wgui_inputbox_information_icon = get_image(WGUI_ZI_EZITEXT_LOGO);
- break;
- #endif /* defined(__MMI_ZI_CZECH__) */
- #if defined(__MMI_ZI_HUNGARIAN__)
- case INPUT_TYPE_SMART_UPPERCASE_HUNGARIAN:
- set_multiline_inputbox_mask(0);
- change_multiline_inputbox_mode(INPUT_MODE_SMART_UPPERCASE_HUNGARIAN);
- SetKeyHandler(wgui_handle_inputbox_change_input_mode, KEY_POUND, KEY_EVENT_DOWN);
- inputbox_change_mode = change_multiline_inputbox_input_mode;
- MMI_current_input_mode = INPUT_MODE_SMART_UPPERCASE_HUNGARIAN;
- wgui_inputbox_information_icon = get_image(WGUI_ZI_EZITEXT_LOGO);
- break;
- case INPUT_TYPE_SMART_LOWERCASE_HUNGARIAN:
- set_multiline_inputbox_mask(0);
- change_multiline_inputbox_mode(INPUT_MODE_SMART_LOWERCASE_HUNGARIAN);
- SetKeyHandler(wgui_handle_inputbox_change_input_mode, KEY_POUND, KEY_EVENT_DOWN);
- inputbox_change_mode = change_multiline_inputbox_input_mode;
- MMI_current_input_mode = INPUT_MODE_SMART_LOWERCASE_HUNGARIAN;
- wgui_inputbox_information_icon = get_image(WGUI_ZI_EZITEXT_LOGO);
- break;
- #endif /* defined(__MMI_ZI_HUNGARIAN__) */
- //PERSIAN add by Ailsa start
- #if defined(__MMI_ZI_PERSIAN__)
- case INPUT_TYPE_SMART_PERSIAN:
- set_multiline_inputbox_mask(0);
- change_multiline_inputbox_mode(INPUT_MODE_SMART_PERSIAN);
- SetKeyHandler(wgui_handle_inputbox_change_input_mode, KEY_POUND, KEY_EVENT_DOWN);
- inputbox_change_mode = change_multiline_inputbox_input_mode;
- MMI_current_input_mode = INPUT_MODE_SMART_PERSIAN;
- wgui_inputbox_information_icon = get_image(WGUI_ZI_EZITEXT_LOGO);
- break;
- #endif /* defined(__MMI_ZI_PERSIAN) */
- //PERSIAN add by Ailsa end
- //KP Jerry add on 2007-3-8 start
- #elif defined(__MMI_CSTAR__)
- case INPUT_TYPE_TR_MULTITAP_BOPOMO:
- change_multiline_inputbox_mode(INPUT_MODE_TR_MULTITAP_BOPOMO);
- MMI_current_input_mode = INPUT_MODE_TR_MULTITAP_BOPOMO;
- inputbox_change_mode = change_multiline_inputbox_input_mode;
- wgui_inputbox_information_icon = get_image(WGUI_IME_MULTITAP_BPMF_IMG);
- break;
- case INPUT_TYPE_SM_MULTITAP_PINYIN:
- change_multiline_inputbox_mode(INPUT_MODE_SM_MULTITAP_PINYIN);
- MMI_current_input_mode = INPUT_MODE_SM_MULTITAP_PINYIN;
- inputbox_change_mode = change_multiline_inputbox_input_mode;
- wgui_inputbox_information_icon = get_image(WGUI_IME_MULTITAP_PINYIN_IMG);
- break;
- case INPUT_TYPE_TR_BOPOMO:
- change_multiline_inputbox_mode(INPUT_MODE_TR_BOPOMO);
- MMI_current_input_mode = INPUT_MODE_TR_BOPOMO;
- inputbox_change_mode = change_multiline_inputbox_input_mode;
- wgui_inputbox_information_icon = get_image(WGUI_IME_SMART_BPMF_IMG);
- break;
- case INPUT_TYPE_SM_PINYIN:
- change_multiline_inputbox_mode(INPUT_MODE_SM_PINYIN);
- MMI_current_input_mode = INPUT_MODE_SM_PINYIN;
- inputbox_change_mode = change_multiline_inputbox_input_mode;
- wgui_inputbox_information_icon = get_image(WGUI_IME_SMART_PINYIN_IMG);
- break;
- case INPUT_TYPE_TR_STROKE:
- change_multiline_inputbox_mode(INPUT_MODE_TR_STROKE);
- MMI_current_input_mode = INPUT_MODE_TR_STROKE;
- inputbox_change_mode = change_multiline_inputbox_input_mode;
- wgui_inputbox_information_icon = get_image(WGUI_IME_TR_STROKE_IMG);
- break;
- case INPUT_TYPE_SM_STROKE:
- change_multiline_inputbox_mode(INPUT_MODE_SM_STROKE);
- MMI_current_input_mode = INPUT_MODE_SM_STROKE;
- inputbox_change_mode = change_multiline_inputbox_input_mode;
- wgui_inputbox_information_icon = get_image(WGUI_IME_SM_STROKE_IMG);
- break;
- case INPUT_TYPE_SMART_UPPERCASE_ABC:
- change_multiline_inputbox_mode(INPUT_MODE_SMART_UPPERCASE_ABC);
- MMI_current_input_mode = INPUT_MODE_SMART_UPPERCASE_ABC;
- inputbox_change_mode = change_multiline_inputbox_input_mode;
- wgui_inputbox_information_icon = get_image(WGUI_IME_SMART_ENGLISH_IMG);
- break;
- case INPUT_TYPE_SMART_LOWERCASE_ABC:
- change_multiline_inputbox_mode(INPUT_MODE_SMART_LOWERCASE_ABC);
- MMI_current_input_mode = INPUT_MODE_SMART_LOWERCASE_ABC;
- inputbox_change_mode = change_multiline_inputbox_input_mode;
- wgui_inputbox_information_icon = get_image(WGUI_IME_SMART_ENGLISH_IMG);
- break;
- case INPUT_TYPE_SMART_UPPERCASE_VIETNAMESE:
- set_multiline_inputbox_mask(0);
- change_multiline_inputbox_mode(INPUT_MODE_SMART_UPPERCASE_VIETNAMESE);
- SetKeyHandler(wgui_handle_inputbox_change_input_mode, KEY_POUND, KEY_EVENT_DOWN);
- inputbox_change_mode = change_multiline_inputbox_input_mode;
- MMI_current_input_mode = INPUT_MODE_SMART_UPPERCASE_VIETNAMESE;
- wgui_inputbox_information_icon = get_image(WGUI_IME_SMART_ENGLISH_IMG);
- break;
- case INPUT_TYPE_SMART_LOWERCASE_VIETNAMESE:
- set_multiline_inputbox_mask(0);
- change_multiline_inputbox_mode(INPUT_MODE_SMART_LOWERCASE_VIETNAMESE);
- SetKeyHandler(wgui_handle_inputbox_change_input_mode, KEY_POUND, KEY_EVENT_DOWN);
- inputbox_change_mode = change_multiline_inputbox_input_mode;
- MMI_current_input_mode = INPUT_MODE_SMART_LOWERCASE_VIETNAMESE;
- wgui_inputbox_information_icon = get_image(WGUI_IME_SMART_ENGLISH_IMG);
- break;
- //KP Jerry add on 2007-3-8 end
- #elif defined(__MMI_KA__)
- case INPUT_TYPE_SM_PINYIN:
- change_multiline_inputbox_mode(INPUT_MODE_SM_PINYIN);
- MMI_current_input_mode = INPUT_MODE_SM_PINYIN;
- inputbox_change_mode = change_multiline_inputbox_input_mode;
- wgui_inputbox_information_icon = get_image(WGUI_IME_SMART_PINYIN_IMG);
- break;
- case INPUT_TYPE_SM_STROKE:
- change_multiline_inputbox_mode(INPUT_MODE_SM_STROKE);
- MMI_current_input_mode = INPUT_MODE_SM_STROKE;
- inputbox_change_mode = change_multiline_inputbox_input_mode;
- wgui_inputbox_information_icon = get_image(WGUI_IME_SM_STROKE_IMG);
- break;
- #endif
- default:
- set_multiline_inputbox_mask(0);
- change_multiline_inputbox_mode(INPUT_MODE_123);
- MMI_current_input_mode = INPUT_MODE_123;
- break;
- }
- if (!override_history_input_type && (saved_inputbox_flags & UI_MULTI_LINE_INPUT_BOX_MASK_CHARACTERS))
- {
- set_multiline_inputbox_mask(1);
- if ((saved_input_type & INPUT_TYPE_MASK) != INPUT_TYPE_ALPHANUMERIC_PASSWORD)
- {
- ClearKeyHandler(KEY_POUND, KEY_EVENT_DOWN);
- }
- }
- wgui_inputbox_RSK_label_icon = RSK_icon;
- wgui_inputbox_RSK_label_string = RSK_label;
- MMI_multiline_inputbox.change_callback = set_multiline_inputbox_change;
- test_change_input_mode = wgui_multiline_inputbox_test_change_input_mode;
- register_multiline_inputbox_input_callback(wgui_handle_inputbox_input);
- #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
- ext_stroke.x1 = 0;
- ext_stroke.y1 = 0;
- ext_stroke.x2 = UI_device_width - 1;
- ext_stroke.y2 = UI_device_height - 1;
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #else /* 0 */
- stroke_area.x1 = MMI_content_x;
- stroke_area.x2 = MMI_content_x + MMI_content_width - MMI_multiline_inputbox.vbar.width;
- stroke_area.y1 = MMI_title_y;
- stroke_area.y2 = MMI_title_y + MMI_content_height + MMI_title_height;
- #endif /* 0 */
- mmi_pen_editor_setup_input_box(
- &stroke_area,
- &ext_stroke,
- MMI_current_input_type,
- MMI_TRUE,
- PEN_EDITOR_INLINE_MULTILINE_INPUT_BOX);
- #endif /* defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__) */
- show_multiline_inputbox_no_draw();
- UI_UNUSED_PARAMETER(saved_MMI_current_input_mode);
- }
- /*****************************************************************************
- * FUNCTION
- * category5_hide_multitap
- * DESCRIPTION
- * Hide function for multitap
- *
- * Internal function
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void category5_hide_multitap(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color c;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_lock_double_buffer();
- #endif
- /* micha1104 Chicago Feature */
- #ifdef __MMI_DEFAULT_THEME_3__
- c.r = 206;
- c.g = 206;
- c.b = 206;
- #else /* __MMI_DEFAULT_THEME_3__ */
- c.r = 255;
- c.g = 255;
- c.b = 255;
- #endif /* __MMI_DEFAULT_THEME_3__ */
- c.alpha = 100;
- gui_reset_clip();
- /* MTK for modify the clear area because of one more pixel */
- gui_fill_rectangle(0, MMI_multitap_y, UI_device_width - 1, MMI_multitap_y + MMI_multitap_height - 1, c);
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(0, MMI_multitap_y, UI_device_width - 1, MMI_multitap_y + MMI_multitap_height + 1);
- #endif /* (UI_DOUBLE_BUFFER_SUPPORT) */
- }
- /*****************************************************************************
- * FUNCTION
- * RedrawCategory5Screen
- * DESCRIPTION
- * Redraws the category5 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void RedrawCategory5Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_lock_double_buffer();
- clear_screen();
- show_title_status_icon();
- draw_title();
- wgui_show_inputbox();
- show_softkey_background();
- show_left_softkey();
- show_right_softkey();
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(0, 0, UI_device_width - 1, UI_device_height - 1);
- /* MTK Elvis for redrawing spelling or candidate boxes */
- if (RedrawSpellingOrCandidateBoxesFunction)
- {
- RedrawSpellingOrCandidateBoxesFunction();
- }
- /* MTK end */
- }
- /*****************************************************************************
- * FUNCTION
- * category5callback
- * DESCRIPTION
- *
- * PARAMETERS
- * coordinate [?]
- * RETURNS
- * void
- *****************************************************************************/
- void category5callback(dm_coordinates *coordinate)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* MTK Elvis for redrawing spelling or candidate boxes */
- if (RedrawSpellingOrCandidateBoxesFunction)
- {
- RedrawSpellingOrCandidateBoxesFunction();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * SetCategory5RightSoftkeyFunction
- * DESCRIPTION
- *
- * PARAMETERS
- * f [IN]
- * k [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetCategory5RightSoftkeyFunction(void (*f) (void), MMI_key_event_type k)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(k);
- wgui_inputbox_RSK_function = f;
- }
- /* Function to append a string to category 5 screen */
- /*****************************************************************************
- * FUNCTION
- * AppendCategory5String
- * DESCRIPTION
- * append the string in category 5 (editor) text
- * PARAMETERS
- * input_type [IN] Input ype
- * buffer [IN] Buffer
- * buffer_size [IN] Buffer isze
- * s [IN] String
- * history_buffer [IN] History buffer
- * RETURNS
- * void
- *****************************************************************************/
- //PMT START PERSIAN
- #if defined __MMI_LANG_HINDI__ && (defined __MMI_LANG_ARABIC__ || defined __MMI_LANG_PERSIAN__)
- //PMT END PERSIAN
- extern S32 IS_HINDI;
- extern S32 IS_ARABIC;
- #endif /* defined __MMI_LANG_HINDI__ && (defined __MMI_LANG_ARABIC__ || defined __MMI_LANG_PERSIAN__) */
- void wgui_multiline_inputbox_append_string(
- S16 input_type,
- U8 *buffer,
- S32 buffer_size,
- U8 *s,
- U8 *history_buffer,
- U16 category_id,
- MMI_BOOL (*change_event_handler)(gui_multi_line_input_box_change_event_enum event,U16 C))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 l, h, fh, i;
- UI_string_type ts = (UI_string_type) s;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- //PMT START PERSIAN
- #if defined __MMI_LANG_HINDI__ && (defined __MMI_LANG_ARABIC__ || defined __MMI_LANG_PERSIAN__ )
- //PMT END PERSIAN
- if (ARABIC_PRESENT || MMI_current_input_mode == INPUT_MODE_SMART_ARABIC || MMI_current_input_mode == INPUT_MODE_SMART_PERSIAN)
- {
- U16 unicode = 0;
- U16 clFill = 0;
- IS_HINDI = 0;
- while ((s[clFill] != ' ' || s[clFill + 1] != ' ') && !IS_HINDI)
- {
- unicode = s[clFill];
- unicode |= (s[clFill + 1] << 8);
- if (UI_HINDI_CHARACTER_UCS2_RANGE(unicode))
- {
- IS_HINDI = 1;
- }
- clFill += 2;
- }
- if (IS_HINDI && ARABIC_PRESENT)
- {
- ts[0] = 0;
- ts[1] = 0;
- }
- else if (IS_HINDI)
- {
- test_change_input_mode = wgui_multiline_inputbox_test_change_input_mode;
- wgui_change_inputbox_mode_multitap_HINDI();
- }
- }
- else if (HINDI_PRESENT || MMI_current_input_mode == INPUT_MODE_MULTITAP_HINDI)
- {
- U16 default_direction = 1;
- U16 Count = 0;
- U16 length = pfnUnicodeStrlen((const char*)s) * 2;
- IS_ARABIC = 0;
- for (Count = 0; Count < length; Count += 2)
- {
- bidi_get_char_type(s + Count, (U8*) & default_direction);
- if ((default_direction == 5) || (default_direction == 3) || (default_direction == 2))
- {
- IS_ARABIC = 1;
- }
- }
- if (IS_ARABIC && HINDI_PRESENT)
- {
- ts[0] = 0;
- ts[1] = 0;
- }
- else if (IS_ARABIC)
- {
- test_change_input_mode = wgui_multiline_inputbox_test_change_input_mode;
- //PMT START PERSIAN
- #if defined(__MMI_LANG_ARABIC__)
- wgui_change_inputbox_mode_smart_arabic();
- #elif defined(__MMI_LANG_PERSIAN__)
- wgui_change_inputbox_mode_smart_persian();
- #endif
- //PMT END PERSIAN
- }
- }
- #endif /* defined __MMI_LANG_HINDI__ && defined __MMI_LANG_ARABIC__ */
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_lock_double_buffer();
- #endif
- l = gui_strlen((UI_string_type) buffer);
- create_multiline_inputbox_set_buffer((UI_string_type) buffer, buffer_size, l, l);
- gui_multi_line_input_box_register_change_event_handler(&MMI_multiline_inputbox,change_event_handler);
- if (input_type & INPUT_TYPE_USE_ENCODING_BASED_LENGTH)
- {
- MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_USE_ENCODING_BASED_LENGTH;
- if (input_type & INPUT_TYPE_ONE_LESS_CHARACTER)
- {
- MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_ONE_LESS_CHARACTER;
- UI_TEST_UCS2_COUNT_SET_LENGTH_TYPE2(
- MMI_multiline_inputbox.UCS2_count,
- MMI_multiline_inputbox.allocated_length,
- MMI_multiline_inputbox.available_length);
- }
- else if (input_type & INPUT_TYPE_FORTY_FOUR_LESS_CHARACTER)
- {
- MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_FORTY_FOUR_LESS_CHARACTER;
- UI_TEST_UCS2_COUNT_SET_LENGTH_TYPE3(
- MMI_multiline_inputbox.UCS2_count,
- MMI_multiline_inputbox.allocated_length,
- MMI_multiline_inputbox.available_length);
- }
- else
- {
- UI_TEST_UCS2_COUNT_SET_LENGTH(
- MMI_multiline_inputbox.UCS2_count,
- MMI_multiline_inputbox.allocated_length,
- MMI_multiline_inputbox.available_length);
- }
- }
- #ifdef __BW_MMI__
- h = MMI_content_height - MMI_multitap_height;
- #else
- h = MMI_content_height - MMI_multitap_height - MULTILINE_INPUTBOX_EDIT_HEIGHT_PAD;
- #endif
- set_multiline_inputbox_category_history(category_id, history_buffer, &input_type);
- show_multiline_inputbox_no_draw();
- fh = get_multiline_inputbox_line_height();
- h = ((h / fh) * fh) + MULTILINE_INPUTBOX_EDIT_HEIGHT_PAD;
- resize_multiline_inputbox(MMI_multiline_inputbox.width, h);
- l = gui_strlen(ts);
- for (i = 0; i < l; i++)
- {
- if (MMI_multiline_inputbox.text_length >= MMI_multiline_inputbox.available_length)
- {
- gui_multi_line_input_box_insert_character(&MMI_multiline_inputbox, (UI_character_type) ts[i]);
- break;
- }
- else
- {
- gui_multi_line_input_box_insert_character(&MMI_multiline_inputbox, (UI_character_type) ts[i]);
- }
- }
- get_multiline_inputbox_category_history(category_id, history_buffer, input_type);
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_unlock_double_buffer();
- #endif
- }
- void AppendCategory5String(S16 input_type, U8 *buffer, S32 buffer_size, U8 *s, U8 *history_buffer)
- {
- wgui_multiline_inputbox_append_string(input_type,buffer,buffer_size,s,history_buffer,MMI_CATEGORY5_ID,NULL);
- }
- /*****************************************************************************
- * FUNCTION
- * cat5_virtual_keypad_callback
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void cat5_virtual_keypad_callback(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if defined(__MMI_TOUCH_SCREEN__)
- mmi_pen_editor_resize_multiline_input_box_for_vk();
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory5Screen
- * DESCRIPTION
- * Displays the category5 screen
- * PARAMETERS
- * title [IN] Title for the screen
- * title_icon [IN] Icon shown with the title
- * left_softkey [IN] Left softkey label
- * left_softkey_icon [IN] Icon for the left softkey
- * right_softkey [IN] Right softkey label
- * right_softkey_icon [IN] Icon for the right softkey
- * input_type [IN] Type of input to use
- * buffer [IN] Buffer the input box should use.
- * buffer_size [IN] Size of the buffer.
- * history_buffer [IN] History buffer
- * For(?) [IN] Example, 5 means only 5 characters can be input in this screen.
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory5Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- S16 input_type,
- U8 *buffer,
- S32 buffer_size,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Begin AP input mode set */
- ShowCategory5Screen_ext(
- title,
- title_icon,
- left_softkey,
- left_softkey_icon,
- right_softkey,
- right_softkey_icon,
- input_type,
- buffer,
- buffer_size,
- history_buffer,
- 0,
- NULL,
- NULL);
- /* End AP input mode set */
- }
- BOOL(*wgui_check_editor_buffer_need_flush) (void) = NULL;
- /*****************************************************************************
- * FUNCTION
- * Register_cat5_editor_buffer_need_flush
- * DESCRIPTION
- *
- * PARAMETERS
- * FuncPtr [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void Register_cat5_editor_buffer_need_flush(BOOL(*FuncPtr) (void)) /* rajbir */
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_check_editor_buffer_need_flush = FuncPtr;
- }
- /* Begin AP input mode set */
- /*****************************************************************************
- * FUNCTION
- * wgui_fill_AP_required_input_mode_set
- * DESCRIPTION
- * fill AP requried input mode set into global array
- * PARAMETERS
- * required_input_mode_set [IN] Required input mode array
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_fill_AP_required_input_mode_set(S16 *required_input_mode_set)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- while (1)
- {
- if (i > INPUT_MODE_MAX_NUM + 1)
- {
- MMI_ASSERT(0);
- /*
- * reason: (1) No of AP input mode set is more than INPUT_MODE_MAX_NUM+1
- * (2) required_input_mode_set arrary is not ended with -1.
- */
- }
- if (required_input_mode_set[i] == -1)
- {
- MMI_AP_required_input_mode_set[i] = -1;
- break;
- }
- MMI_AP_required_input_mode_set[i] = required_input_mode_set[i];
- i++;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_set_AP_required_input_mode_set_flag
- * DESCRIPTION
- * set MMI_AP_set_input_mode_set to true
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- S16 MMI_saved_prefered_input_type = 0;
- extern void SetInputMethod(U16 index);
- extern U16 MMI_all_prefered_input_mode_set[INPUT_MODE_MAX_NUM];
- void wgui_set_AP_required_input_mode_set_flag(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- #if defined(__MMI_PREFER_INPUT_METHOD__)
- MMI_BOOL is_in_ap_required_input_mode = MMI_FALSE;
- S32 i = 0;
- S32 input_mode = -1;
- #endif
- S32 curIndex = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_AP_set_input_mode_set = 1;
- #if defined(__MMI_PREFER_INPUT_METHOD__)
- MMI_saved_prefered_input_type = MMI_prefered_input_type;
- //Add by ailsa start : For applying prefered input type when AP_required_input_mode
- // search the input mode ID of MMI_saved_prefered_input_type
- while (gIMEModeArray[i].IME_Mode_ID != (0xff))
- {
- if (gIMEModeArray[i].IME_Type_ID == MMI_saved_prefered_input_type)
- {
- input_mode = gIMEModeArray[i].IME_Mode_ID;
- break;
- }
- i++;
- }
- // input mode ID found, search to check if it is in MMI_AR_required_input_mode_set
- if (input_mode !=-1)
- {
- for (i=0; MMI_AP_required_input_mode_set[i] != -1; i++)
- {
- if (MMI_AP_required_input_mode_set[i] == input_mode)
- {
- is_in_ap_required_input_mode = MMI_TRUE;
- break;
- }
- }
- }
- if (is_in_ap_required_input_mode)
- {
- MMI_prefered_input_type = MMI_saved_prefered_input_type;
- }
- else
- {
- #endif
- // search the index in gIMEModeArray of which IME_Mode_ID equeal to MMI_AP_required_input_mode_set[0]
- i = 0;
- while (gIMEModeArray[i].IME_Mode_ID != (0xff))
- {
- if (gIMEModeArray[i].IME_Mode_ID == MMI_AP_required_input_mode_set[0])
- {
- curIndex = i;
- break;
- }
- i++;
- }
- SetInputMethod((U16)curIndex);
- #if defined(__MMI_PREFER_INPUT_METHOD__)
- }
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_unset_AP_required_input_mode_set_flag
- * DESCRIPTION
- * unset MMI_AP_set_input_mode_set to true
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_unset_AP_required_input_mode_set_flag(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_AP_set_input_mode_set = 0;
- #if defined(__MMI_PREFER_INPUT_METHOD__)
- MMI_prefered_input_type = MMI_saved_prefered_input_type;
- #endif
- }
- /* End AP input mode set */
- /* Begin AP Symbol table */
- /*****************************************************************************
- * FUNCTION
- * wgui_fill_AP_No_Show_Symbol_List
- * DESCRIPTION
- * fill AP No_Show_Symbol_List into global array
- * PARAMETERS
- * no_show_symbol_list [IN] [] no show symbol list array
- * RETURNS
- * void
- *****************************************************************************/
- extern U8 *MMI_AP_No_Show_Symbol_List[];
- void wgui_fill_AP_No_Show_Symbol_List(U8 *no_show_symbol_list[])
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- while (1)
- {
- if (*no_show_symbol_list[i] == ((U8)0x00))
- {
- MMI_AP_No_Show_Symbol_List[i] = (U8*) "x00x00 ";
- break;
- }
- MMI_AP_No_Show_Symbol_List[i] = no_show_symbol_list[i];
- i++;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_set_AP_No_Show_Symbol_List_flag
- * DESCRIPTION
- * set MMI_AP_No_Show_Symbol_List_flag to true
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- extern U8 MMI_AP_No_Show_Symbol_List_flag;
- void wgui_set_AP_No_Show_Symbol_List_flag(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_AP_No_Show_Symbol_List_flag = 1;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_unset_AP_No_Show_Symbol_List_flag
- * DESCRIPTION
- * unset MMI_AP_No_Show_Symbol_List_flag to true
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_unset_AP_No_Show_Symbol_List_flag(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_AP_No_Show_Symbol_List_flag = 0;
- }
- /* End AP Symbol table */
- /* Begin AP Symbol table */
- /*****************************************************************************
- * FUNCTION
- * ShowCategory5Screen_ext
- * DESCRIPTION
- *
- * PARAMETERS
- * title [IN]
- * title_icon [IN]
- * left_softkey [IN]
- * left_softkey_icon [IN]
- * right_softkey [IN]
- * right_softkey_icon [IN]
- * input_type [IN]
- * buffer [?]
- * buffer_size [IN]
- * history_buffer [?]
- * input_ext_type [IN]
- * required_input_mode_set [?]
- * no_show_symbol_list [?]
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory5Screen_ext(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- S16 input_type,
- U8 *buffer,
- S32 buffer_size,
- U8 *history_buffer,
- S16 input_ext_type,
- S16 *required_input_mode_set,
- U8 *no_show_symbol_list[])
- /* End AP Symbol table */
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef UI_SMALL_CATEGORY_EDITOR
- if (whether_no_small_screen())
- {
- ShowCategory100Screen(
- title,
- title_icon,
- left_softkey,
- left_softkey_icon,
- right_softkey,
- right_softkey_icon,
- input_type,
- buffer,
- buffer_size,
- history_buffer);
- }
- else
- #endif /* UI_SMALL_CATEGORY_EDITOR */
- {
- dm_data_struct dm_data;
- S32 inputbox_x = 0;
- S32 inputbox_y = (MMI_title_y + MMI_title_height);
- S32 inputbox_width = MMI_content_width;
- #if defined(__MMI_FULL_SCREEN_EDITOR__)
- S32 inputbox_height = MMI_content_height;
- #else
- S32 inputbox_height = MMI_content_height - MMI_multitap_height;
- #endif
- // ADD_SCREEN_STRINGS((3,title,right_softkey,left_softkey));
- // ADD_SCREEN_IMAGES((3,title_icon,right_softkey_icon,left_softkey_icon));
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_lock_double_buffer();
- #endif
- MMI_menu_shortcut_number = -1;
- MMI_disable_title_shortcut_display = 1;
- clear_category_screen_key_handlers();
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- clear_left_softkey();
- clear_right_softkey();
- register_left_softkey_handler();
- register_right_softkey_handler();
- register_default_hide_softkeys();
- /* Begin AP input mode set */
- if (required_input_mode_set != NULL)
- {
- wgui_fill_AP_required_input_mode_set(required_input_mode_set);
- wgui_set_AP_required_input_mode_set_flag();
- }
- /* End AP input mode set */
- /* MTK Add By Elvis for T9 */
- #ifdef __MMI_T9__
- InuptMethodEnterCategory5();
- #elif defined __MMI_ZI__
- ZiInuptMethodEnterCategory5();
- //KP Jerry add on 2007-3-8 start
- #elif defined __MMI_CSTAR__
- CstarInputMethodEnterCategory5();
- //KP Jerry add on 2007-3-8 end
- #elif defined __MMI_KA__
- KonkaInuptMethodEnterCategory5();
- #elif defined __MMI_ITAP__
- /* under construction !*/
- #endif
- /* MTK end */
- MMI_title_string = (UI_string_type) get_string(title);
- MMI_title_icon = (PU8) get_image(title_icon);
- register_hide_multitap(category5_hide_multitap);
- wgui_setup_inputbox(
- inputbox_x,
- inputbox_y,
- inputbox_width,
- inputbox_height,
- buffer,
- buffer_size,
- MMI_CATEGORY5_ID,
- get_string(right_softkey),
- get_image(right_softkey_icon),
- input_type,
- history_buffer,
- 1);
- /* Begin AP Symbol table */
- if (no_show_symbol_list != NULL)
- {
- wgui_fill_AP_No_Show_Symbol_List(no_show_symbol_list);
- wgui_set_AP_No_Show_Symbol_List_flag();
- }
- /* End AP Symbol table */
- /* if input method changed from "option", and language changed then delete all character in case of dictionary */
- if (wgui_check_editor_buffer_need_flush)
- {
- if (wgui_check_editor_buffer_need_flush())
- {
- multiline_inputbox_delete_all_characters();
- set_right_softkey_function(GoBackHistory, KEY_EVENT_UP);
- #ifdef __MMI_T9__
- T9SynT9WithInputBoxMultilineInputBox();
- #endif
- }
- }
- if (input_ext_type != 0)
- {
- MMI_current_input_ext_type = input_ext_type;
- }
- #if defined(__MMI_FULL_SCREEN_EDITOR__)
- inputbox_height = MMI_content_height - wgui_inputbox_information_bar_height;
- #else
- inputbox_height = MMI_content_height - MMI_multitap_height - wgui_inputbox_information_bar_height;
- #endif
- if (MMI_multiline_inputbox.height > inputbox_height)
- {
- gui_resize_multi_line_input_box(&MMI_multiline_inputbox, MMI_multiline_inputbox.width, inputbox_height);
- }
- #if UI_INCLUDE_INFORMATION_AREA_IN_MULTI_LINE
- MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_INCLUDE_INFO_AREA;
- #endif
- #ifdef __MMI_WALLPAPER_ON_BOTTOM__
- MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_TRANSPARENT_BACKGROUND;
- #endif
- gui_unlock_double_buffer();
- ExitCategoryFunction = ExitCategory5Screen;
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- dm_data.s32flags |= DM_SHOW_VKPAD;
- dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
- dm_register_category_controlled_callback(category5callback);
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY5_ID;
- dm_setup_data(&dm_data);
- dm_register_vkpad_callback(cat5_virtual_keypad_callback);
- dm_redraw_category_screen();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory5Screen
- * DESCRIPTION
- * Exits the category5 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory5Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- set_MMI_current_input_type();
- reset_softkeys();
- reset_multitaps();
- wgui_close_inputbox();
- ExitCategoryFunction = MMI_dummy_function;
- RedrawCategoryFunction = MMI_dummy_function;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- wgui_check_editor_buffer_need_flush = NULL;
- /* Begin AP input mode set */
- if (MMI_AP_set_input_mode_set)
- {
- wgui_unset_AP_required_input_mode_set_flag();
- }
- /* End AP input mode set */
- #ifdef UI_SMALL_LIST_SCREEN
- restore_small_screen();
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory5HistorySize
- * DESCRIPTION
- * Gets the size of the history buffer for category5 screen
- * PARAMETERS
- * void
- * RETURNS
- * size in U8s of the history buffer
- *****************************************************************************/
- S32 GetCategory5HistorySize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (sizeof(multiline_inputbox_category_history));
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory5History
- * DESCRIPTION
- * Gets the history buffer for category5 screen
- * PARAMETERS
- * history_buffer [IN] Is the buffer into which the history data is stored (pre-allocated)
- * RETURNS
- * Pointer to the history buffer
- *****************************************************************************/
- U8 *GetCategory5History(U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- get_multiline_inputbox_category_history(MMI_CATEGORY5_ID, history_buffer, MMI_current_input_type);
- return (history_buffer);
- }
- #ifdef UI_SMALL_CATEGORY_EDITOR
- extern U16 title_bg_id;//092906 popup title
- /*****************************************************************************
- * FUNCTION
- * ShowCategory100Screen
- * DESCRIPTION
- *
- * PARAMETERS
- * title [IN]
- * title_icon [IN]
- * left_softkey [IN]
- * left_softkey_icon [IN]
- * right_softkey [IN]
- * right_softkey_icon [IN]
- * input_type [IN]
- * buffer [?]
- * buffer_size [IN]
- * history_buffer [?]
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory100Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- S16 input_type,
- U8 *buffer,
- S32 buffer_size,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- color c = *(current_MMI_theme->UI_black_color);
- S32 inputbox_height;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_multiline_inputbox_x = MMI_SMALL_SCREEN_X_OFFSET;
- MMI_multiline_inputbox_y = MMI_title_y + 2 * MMI_title_height + MMI_SMALL_SCREEN_Y_OFFSET;
- MMI_multiline_inputbox_width = MMI_content_width - 2 * MMI_SMALL_SCREEN_X_OFFSET + 1;
- MMI_multiline_inputbox_height = MMI_content_height - 2 * (MMI_SMALL_SCREEN_Y_OFFSET) - MMI_title_height + 1;
- MMI_multitap_x = MMI_SMALL_SCREEN_X_OFFSET + 1;
- MMI_multitap_y -= (MMI_SMALL_SCREEN_Y_OFFSET + 1);
- MMI_multitap_width = UI_DEVICE_WIDTH - 2 * MMI_SMALL_SCREEN_X_OFFSET - 1;
- g_small_editor_category_present = TRUE;
- #ifdef __MMI_UI_SMALL_SCREEN_SUPPORT__
- set_small_screen();
- wgui_small_editor_information_flag = 1;
- gui_add_cleanup_hook(disable_resized_small_screen);
- #endif /* __MMI_UI_SMALL_SCREEN_SUPPORT__ */
- hide_status_icon_bar(0);//052906 early status icon
- #if defined (__MMI_T9_SM_CHINESE__) || defined (__MMI_T9_TR_CHINESE__)
- T9TrResizeSelectionArea();
- #elif defined (__MMI_ZI__)
- ZiResizeSelectionArea(); /* for testing only..remove comment before making build */
- #endif
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_lock_double_buffer();
- #endif
- MMI_menu_shortcut_number = -1;
- MMI_disable_title_shortcut_display = 1;
- clear_category_screen_key_handlers();
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- clear_left_softkey();
- clear_right_softkey();
- register_left_softkey_handler();
- register_right_softkey_handler();
- register_default_hide_softkeys();
- /* MTK Add By Elvis for T9 */
- #ifdef __MMI_T9__
- InuptMethodEnterCategory5();
- #elif defined __MMI_ZI__
- ZiInuptMethodEnterCategory5();
- //KP Jerry add on 2007-3-8 start
- #elif defined __MMI_CSTAR__
- CstarInputMethodEnterCategory5();
- //KP Jerry add on 2007-3-8 end
- #elif defined __MMI_KA__
- KonkaInuptMethodEnterCategory5();
- #elif defined __MMI_ITAP__
- /* under construction !*/
- #endif
- /* MTK end */
- MMI_title_string = (UI_string_type) get_string(title);
- MMI_title_icon = (PU8) get_image(title_icon);
- register_hide_multitap(category100_hide_multitap);
- wgui_setup_inputbox(
- MMI_multiline_inputbox_x,
- MMI_multiline_inputbox_y,
- MMI_multiline_inputbox_width,
- MMI_multiline_inputbox_height,
- buffer,
- buffer_size,
- MMI_CATEGORY100_ID,
- get_string(right_softkey),
- get_image(right_softkey_icon),
- input_type,
- history_buffer,
- 1);
- inputbox_height =
- MMI_content_height - MMI_title_height - 2 * MMI_SMALL_SCREEN_Y_OFFSET - wgui_inputbox_information_bar_height +
- 1;
- if (MMI_multiline_inputbox.height > inputbox_height)
- {
- gui_resize_multi_line_input_box(&MMI_multiline_inputbox, MMI_multiline_inputbox.width, inputbox_height);
- }
- //#ifdef __MMI_WALLPAPER_ON_BOTTOM__//110306 popup title
- title_bg_id = IMG_FLEXIBLE_TITLEBAR_BG;
- //#endif
- gui_unlock_double_buffer();
- ExitCategoryFunction = ExitCategory100Screen;
- dm_data.s32flags = /* DM_NO_FLAGS */ DM_NO_POPUP_BACKGROUND;
- dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
- dm_register_category_controlled_callback(category5callback);
- dm_add_rectangle(c, DM_RECTANGLE_FILL_GRAYSCALE);
- dm_add_rectangle(c, 0);
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY100_ID;
- dm_setup_data(&dm_data);
- dm_redraw_category_screen();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory100Screen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory100Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_multiline_inputbox_x = MMI_MULTILINE_INPUTBOX_X;
- MMI_multiline_inputbox_y = MMI_MULTILINE_INPUTBOX_Y;
- MMI_multiline_inputbox_height = UI_DEVICE_HEIGHT;
- MMI_multiline_inputbox_width = UI_DEVICE_WIDTH;
- wgui_small_editor_information_flag = 0;
- MMI_multitap_x = MMI_MULTITAP_X;
- MMI_multitap_y = /*(UI_device_height - MMI_BUTTON_BAR_HEIGHT - MMI_MULTITAP_HEIGHT);*/ MMI_MULTITAP_Y;
- MMI_multitap_width = UI_device_width - 4;
- g_small_editor_category_present = FALSE;
- #if defined (__MMI_T9_SM_CHINESE__) || defined (__MMI_T9_TR_CHINESE__)
- T9TrResizeSelectionArea();
- #elif defined (__MMI_ZI__)
- ZiResizeSelectionArea();
- #endif
- #ifdef __MMI_UI_SMALL_SCREEN_SUPPORT__
- reset_small_screen();
- #endif
- //#ifdef __MMI_WALLPAPER_ON_BOTTOM__//111306 popup title
- title_bg_id = 0;
- //#endif
- show_status_icon_bar(0);//052906 early status icon
- set_MMI_current_input_type();
- reset_softkeys();
- reset_multitaps();
- wgui_close_inputbox();
- entry_full_screen();
- ExitCategoryFunction = MMI_dummy_function;
- RedrawCategoryFunction = MMI_dummy_function;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- }
- /*****************************************************************************
- * FUNCTION
- * category100_hide_multitap
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void category100_hide_multitap(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color c;
- S32 x1,y1,x2,y2;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_lock_double_buffer();
- /* micha1104 Chicago Feature */
- #ifdef __MMI_DEFAULT_THEME_3__
- c.r = 206;
- c.g = 206;
- c.b = 206;
- #else /* __MMI_DEFAULT_THEME_3__ */
- c.r = 255;
- c.g = 255;
- c.b = 255;
- #endif /* __MMI_DEFAULT_THEME_3__ */
- c.alpha = 100;
- gui_reset_clip();
- /* MTK for modify the clear area because of one more pixel */
- x1 = MMI_multitap_x;
- y1 = MMI_multitap_y;
- x2 = MMI_multitap_x + MMI_multitap_width - 1;
- //PMT SUKRIT START MAUI_00226206
- y2 = MMI_multitap_y + MMI_multitap_height;
- //PMT SUKRIT END MAUI_00226206
- gui_fill_rectangle(x1,y1,x2,y2,c);
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(x1,y1,x2,y2);
- }
- #endif /* UI_SMALL_CATEGORY_EDITOR */
- /* global variable of category35 multiline box */
- multi_line_input_box cat35_message_box;
- /*****************************************************************************
- * FUNCTION
- * category35callback
- * DESCRIPTION
- *
- * PARAMETERS
- * coordinate [?]
- * RETURNS
- * void
- *****************************************************************************/
- void category35callback(dm_coordinates *coordinate)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_show_multi_line_input_box(&cat35_message_box);
- coordinate->s16X = cat35_message_box.x;
- coordinate->s16Y = cat35_message_box.y;
- coordinate->s16Width = cat35_message_box.width;
- coordinate->s16Height = cat35_message_box.height;
- }
- /*****************************************************************************
- * FUNCTION
- * SetCategory35RightSoftkeyFunction
- * DESCRIPTION
- * register RSK function handler of category 35
- * PARAMETERS
- * f [IN]
- * k [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetCategory35RightSoftkeyFunction(void (*f) (void), MMI_key_event_type k)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(k);
- wgui_inputbox_RSK_function = f;
- }
- /*****************************************************************************
- * FUNCTION
- * category35_message_box_previous_line
- * DESCRIPTION
- * move to previous line of multi line box of category 35
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void category35_message_box_previous_line(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_multi_line_input_box_previous_line(&cat35_message_box);
- gui_show_multi_line_input_box(&cat35_message_box);
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_BLT_double_buffer(
- cat35_message_box.x,
- cat35_message_box.y,
- cat35_message_box.x + cat35_message_box.width - 1,
- cat35_message_box.y + cat35_message_box.height - 1);
- #endif /* (UI_DOUBLE_BUFFER_SUPPORT) */
- }
- /*****************************************************************************
- * FUNCTION
- * category35_message_box_next_line
- * DESCRIPTION
- * move to next line of multi line box of category 35
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void category35_message_box_next_line(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_multi_line_input_box_next_line(&cat35_message_box);
- gui_show_multi_line_input_box(&cat35_message_box);
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_BLT_double_buffer(
- cat35_message_box.x,
- cat35_message_box.y,
- cat35_message_box.x + cat35_message_box.width - 1,
- cat35_message_box.y + cat35_message_box.height - 1);
- #endif /* (UI_DOUBLE_BUFFER_SUPPORT) */
- }
- /*****************************************************************************
- * FUNCTION
- * category35_keyboard_key_handler
- * DESCRIPTION
- * key board handling of category 35
- * PARAMETERS
- * vkey_code [IN]
- * key_state [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void category35_keyboard_key_handler(S32 vkey_code, S32 key_state)
- {
- #if(MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32)
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (key_state)
- {
- switch (vkey_code)
- {
- case 37:
- multiline_inputbox_previous_character();
- break;
- case 39:
- multiline_inputbox_next_character();
- break;
- case 38:
- category35_message_box_previous_line();
- break;
- case 40:
- category35_message_box_next_line();
- break;
- case 45:
- multiline_inputbox_toggle_insert_mode();
- break;
- case 46:
- multiline_inputbox_delete_current_character();
- break;
- }
- }
- #else /* (MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32) */
- UI_UNUSED_PARAMETER(vkey_code);
- UI_UNUSED_PARAMETER(key_state);
- #endif /* (MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32) */
- }
- /*****************************************************************************
- * FUNCTION
- * cat35_virtual_keypad_callback
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void cat35_virtual_keypad_callback(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if defined(__MMI_TOUCH_SCREEN__)
- mmi_pen_editor_resize_multiline_input_box_for_vk();
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory35Screen
- * DESCRIPTION
- * Displays the dynamic icon notification with user input screen
- * PARAMETERS
- * left_softkey [IN] Left softkey label
- * left_softkey_icon [IN] Icon for the left softkey
- * right_softkey [IN] Right softkey label
- * right_softkey_icon [IN] Icon for the right softkey
- * message [IN] Notification message
- * message_icon [IN]
- * input_type [IN]
- * buffer [IN] Input buffer
- * buffer_size [IN] Input buffer size
- * history_buffer [IN] History buffer
- * INPUT_TYPE_ALPHANUMERIC_SENTENCECASE(?) [IN]
- * INPUT_TYPE(?) [IN] Can take the following values:
- * INPUT_TYPE_ALPHANUMERIC_LOWERCASE(?) [IN]
- * INPUT_TYPE_NUMERIC(?) [IN]
- * INPUT_TYPE_ALPHANUMERIC_PASSWORD(?) [IN] (rare).
- * INPUT_TYPE_ALPHANUMERIC_UPPERCASE(?) [IN]
- * INPUT_TYPE_NUMERIC_PASSWORD(?) [IN]
- * IMAGE(?) [IN] Image Notification image
- * For(?) [IN] Example, 5 means only 5 characters can be input in this screen.
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory35Screen(
- U8 *left_softkey,
- PU8 left_softkey_icon,
- U8 *right_softkey,
- PU8 right_softkey_icon,
- U8 *message,
- PU8 message_icon,
- S16 input_type,
- U8 *buffer,
- S32 buffer_size,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- S32 l, x = 24;
- S32 inputbox_x, inputbox_y, inputbox_width, inputbox_height;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(history_buffer);
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_lock_double_buffer();
- #endif
- MMI_menu_shortcut_number = -1;
- clear_category_screen_key_handlers();
- set_left_softkey_label((UI_string_type) left_softkey);
- set_left_softkey_icon(left_softkey_icon);
- set_right_softkey_label((UI_string_type) right_softkey);
- set_right_softkey_icon(right_softkey_icon);
- clear_left_softkey();
- clear_right_softkey();
- register_left_softkey_handler();
- register_right_softkey_handler();
- register_default_hide_softkeys();
- MMI_message_string = (UI_string_type) message;
- MMI_message_icon = message_icon;
- wgui_set_animation_image(x >> 1, (MMI_title_y + MMI_title_height), (PU8) message_icon);
- if (message_icon == NULL)
- {
- x = 0;
- }
- /* MTK Add By Elvis for T9 */
- #ifdef __MMI_T9__
- InuptMethodEnterCategory5();
- #elif defined __MMI_ZI__
- ZiInuptMethodEnterCategory5();
- //KP Jerry add on 2007-3-8 start
- #elif defined __MMI_CSTAR__
- CstarInputMethodEnterCategory5();
- //KP Jerry add on 2007-3-8 end
- #elif defined __MMI_KA__
- KonkaInuptMethodEnterCategory5();
- #elif defined __MMI_ITAP__
- /* under construction !*/
- /* under construction !*/
- #endif
- /* MTK end */
- inputbox_x = 0;
- inputbox_y = (MMI_title_y + MMI_title_height) << 1;
- inputbox_width = UI_device_width;
- inputbox_height = MMI_content_height - (MMI_title_y + MMI_title_height) - (MMI_multitap_height << 1) + 4;
- register_hide_multitap(category5_hide_multitap);
- wgui_setup_inputbox(
- inputbox_x,
- inputbox_y,
- inputbox_width,
- inputbox_height,
- buffer,
- buffer_size,
- MMI_CATEGORY5_ID,
- (UI_string_type) right_softkey,
- (PU8) right_softkey_icon,
- input_type,
- history_buffer,
- 1);
- l = gui_strlen(MMI_message_string);
- /* changed code vandana mehtani iheight +9 */
- gui_create_multi_line_input_box_set_buffer(
- &cat35_message_box,
- x,
- MMI_title_y,
- UI_device_width - x + 1,
- (MMI_title_height) << 1,
- MMI_message_string,
- l,
- l,
- 0);
- /* end of changed code vandana mehtani */
- /* Add flags for input box here */
- cat35_message_box.flags |=
- (UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW | UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW |
- UI_MULTI_LINE_INPUT_BOX_VIEW_MODE);
- gui_show_multi_line_input_box(&cat35_message_box);
- cat35_message_box.flags &= ~UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW;
- register_keyboard_key_handler(category35_keyboard_key_handler);
- SetKeyHandler(category35_message_box_previous_line, KEY_UP_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(category35_message_box_next_line, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
- /* micha0106 */
- if (((input_type & INPUT_TYPE_MASK) != INPUT_TYPE_PHONE_NUMBER) &&
- ((input_type & INPUT_TYPE_MASK) != INPUT_TYPE_SAT_NUMERIC_PASSWORD))
- {
- ClearKeyHandler(KEY_POUND, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
- }
- #if !defined(__MMI_MULTITAP_FOR_STAR_AND_POUND__)
- if (((input_type & INPUT_TYPE_MASK) == INPUT_TYPE_ALPHANUMERIC_LOWERCASE) ||
- ((input_type & INPUT_TYPE_MASK) == INPUT_TYPE_ALPHANUMERIC_UPPERCASE) ||
- ((input_type & INPUT_TYPE_MASK) == INPUT_TYPE_ALPHANUMERIC_SENTENCECASE))
- {
- SetKeyHandler(wgui_handle_inputbox_change_input_mode, KEY_POUND, KEY_EVENT_DOWN);
- }
- #endif /* !defined(__MMI_MULTITAP_FOR_STAR_AND_POUND__) */
- inputbox_height =
- UI_device_height - MMI_button_bar_height - wgui_inputbox_information_bar_height - cat35_message_box.height -
- MMI_multitap_height;
- gui_resize_multi_line_input_box(&MMI_multiline_inputbox, MMI_multiline_inputbox.width, inputbox_height);
- #ifdef __MMI_WALLPAPER_ON_BOTTOM__
- MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_TRANSPARENT_BACKGROUND;
- dm_get_scr_bg_image(
- &editor_scr_bg_ID,
- &editor_scr_bg_filename,
- &editor_scr_bg_x,
- &editor_scr_bg_y,
- &editor_scr_bg_opacity);
- dm_set_scr_bg_image(editor_scr_bg_ID, editor_scr_bg_filename, editor_scr_bg_x, editor_scr_bg_y, MMI_EDITOR_BG_OPACITY); /* 100605 editor opacity Calvin */
- #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_unlock_double_buffer();
- #endif
- ExitCategoryFunction = ExitCategory35Screen;
- dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
- dm_register_category_controlled_callback(category35callback);
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY35_ID;
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- dm_data.s32flags |= DM_SHOW_VKPAD;
- dm_setup_data(&dm_data);
- dm_register_vkpad_callback(cat35_virtual_keypad_callback);
- dm_redraw_category_screen();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory35Screen
- * DESCRIPTION
- * Exits the dynamic icon notification with user input screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory35Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- set_MMI_current_input_type();
- #if(UI_BLINKING_CURSOR_SUPPORT)
- //gui_cancel_timer(UI_inputbox_blink_cursor);
- StopMyTimer(BLINKING_CURSOR);
- #endif /* (UI_BLINKING_CURSOR_SUPPORT) */
- reset_softkeys();
- reset_multitaps();
- wgui_close_inputbox();
- #ifdef __MMI_WALLPAPER_ON_BOTTOM__
- /* dm_set_scr_bg_image(editor_scr_bg_ID, editor_scr_bg_filename, editor_scr_bg_x, editor_scr_bg_y, editor_scr_bg_opacity);//092005 grayscale Calvin */
- dm_set_scr_bg_image_no_draw(
- editor_scr_bg_ID,
- editor_scr_bg_filename,
- editor_scr_bg_x,
- editor_scr_bg_y,
- editor_scr_bg_opacity);
- #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */
- ExitCategoryFunction = MMI_dummy_function;
- RedrawCategoryFunction = MMI_dummy_function;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- }
- /* Category 171: SAT edit screen (Equivalent to Cat-35) */
- /*****************************************************************************
- * FUNCTION
- * SetCategory171RightSoftkeyFunction
- * DESCRIPTION
- * Redraws the dynamic icon notification with user input screen
- * PARAMETERS
- * f [IN]
- * k [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetCategory171RightSoftkeyFunction(void (*f) (void), MMI_key_event_type k)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(k);
- wgui_inputbox_RSK_function = f;
- }
- /*****************************************************************************
- * FUNCTION
- * cat171_virtual_keypad_callback
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void cat171_virtual_keypad_callback(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if defined(__MMI_TOUCH_SCREEN__)
- mmi_pen_editor_resize_multiline_input_box_for_vk();
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory171Screen
- * DESCRIPTION
- * Displays the dynamic icon notification with user input screen
- * PARAMETERS
- * left_softkey [IN] Left softkey label
- * left_softkey_icon [IN] Icon for the left softkey
- * right_softkey [IN] Right softkey label
- * right_softkey_icon [IN] Icon for the right softkey
- * message [IN] Notification message
- * message_icon [IN]
- * input_type [IN]
- * buffer [IN] Input buffer
- * buffer_size [IN] Input buffer size
- * history_buffer [IN] History buffer
- * IMAGE(?) [IN] Image Notification image
- * For(?) [IN] Example, 5 means only 5 characters can be input in this screen.
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory171Screen(
- U8 *left_softkey,
- PU8 left_softkey_icon,
- U8 *right_softkey,
- PU8 right_softkey_icon,
- U8 *message,
- PU8 message_icon,
- S16 input_type,
- U8 *buffer,
- S32 buffer_size,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- S32 inputbox_x, inputbox_y, inputbox_width, inputbox_height;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(history_buffer);
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_lock_double_buffer();
- #endif
- MMI_menu_shortcut_number = -1;
- clear_category_screen_key_handlers();
- set_left_softkey_label((UI_string_type) left_softkey);
- set_left_softkey_icon(left_softkey_icon);
- set_right_softkey_label((UI_string_type) right_softkey);
- set_right_softkey_icon(right_softkey_icon);
- clear_left_softkey();
- clear_right_softkey();
- register_left_softkey_handler();
- register_right_softkey_handler();
- register_default_hide_softkeys();
- MMI_title_string = (UI_string_type) message;
- MMI_title_icon = (PU8) message_icon;
- /* MTK Add By Elvis for T9 */
- #ifdef __MMI_T9__
- InuptMethodEnterCategory5();
- #elif defined __MMI_ZI__
- ZiInuptMethodEnterCategory5();
- //KP Jerry add on 2007-3-8 start
- #elif defined __MMI_CSTAR__
- CstarInputMethodEnterCategory5();
- //KP Jerry add on 2007-3-8 end
- #elif defined __MMI_KA__
- KonkaInuptMethodEnterCategory5();
- #elif defined __MMI_ITAP__
- /* under construction !*/
- #endif
- /* MTK end */
- inputbox_x = 0;
- inputbox_y = (MMI_title_y + MMI_title_height);
- inputbox_width = UI_device_width;
- #if defined(__MMI_FULL_SCREEN_EDITOR__)
- inputbox_height = MMI_content_height - 12;
- #else
- inputbox_height = MMI_content_height - MMI_multitap_height - 12;
- #endif
- register_hide_multitap(category5_hide_multitap);
- wgui_setup_inputbox(
- inputbox_x,
- inputbox_y,
- inputbox_width,
- inputbox_height,
- buffer,
- buffer_size,
- MMI_CATEGORY171_ID,
- (UI_string_type) right_softkey,
- (PU8) right_softkey_icon,
- input_type,
- history_buffer,
- 1);
- /* W05.41 Do not Clear Key Pound Function because it is used in some input method */
- #if !defined(__MMI_MULTITAP_FOR_STAR_AND_POUND__)
- if (((input_type & INPUT_TYPE_MASK) != INPUT_TYPE_PHONE_NUMBER) &&
- ((input_type & INPUT_TYPE_MASK) != INPUT_TYPE_SAT_NUMERIC_PASSWORD))
- {
- ClearKeyHandler(KEY_POUND, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
- }
- if (((input_type & INPUT_TYPE_MASK) == INPUT_TYPE_ALPHANUMERIC_LOWERCASE) ||
- ((input_type & INPUT_TYPE_MASK) == INPUT_TYPE_ALPHANUMERIC_UPPERCASE) ||
- ((input_type & INPUT_TYPE_MASK) == INPUT_TYPE_ALPHANUMERIC_SENTENCECASE))
- {
- SetKeyHandler(wgui_handle_inputbox_change_input_mode, KEY_POUND, KEY_EVENT_DOWN);
- }
- #endif /* !defined(__MMI_MULTITAP_FOR_STAR_AND_POUND__) */
- setup_scrolling_title();
- #ifdef __MMI_WALLPAPER_ON_BOTTOM__
- MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_TRANSPARENT_BACKGROUND;
- dm_get_scr_bg_image(
- &editor_scr_bg_ID,
- &editor_scr_bg_filename,
- &editor_scr_bg_x,
- &editor_scr_bg_y,
- &editor_scr_bg_opacity);
- dm_set_scr_bg_image(editor_scr_bg_ID, editor_scr_bg_filename, editor_scr_bg_x, editor_scr_bg_y, MMI_EDITOR_BG_OPACITY); /* 100605 editor opacity Calvin */
- #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_unlock_double_buffer();
- #endif
- ExitCategoryFunction = ExitCategory171Screen;
- dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY171_ID;
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND | DM_SCROLL_TITLE;
- dm_data.s32flags |= DM_SHOW_VKPAD;
- dm_setup_data(&dm_data);
- dm_register_vkpad_callback(cat171_virtual_keypad_callback);
- dm_redraw_category_screen();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory171Screen
- * DESCRIPTION
- * Exits the dynamic icon notification with user input screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory171Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- set_MMI_current_input_type();
- #if(UI_BLINKING_CURSOR_SUPPORT)
- //gui_cancel_timer(UI_inputbox_blink_cursor);
- StopMyTimer(BLINKING_CURSOR);
- #endif /* (UI_BLINKING_CURSOR_SUPPORT) */
- close_scrolling_title();
- /* MTK Elvis 20040116 to reset softkeys and multitap status */
- reset_softkeys();
- reset_multitaps();
- /* MTK end */
- wgui_close_inputbox();
- #ifdef __MMI_WALLPAPER_ON_BOTTOM__
- /* dm_set_scr_bg_image(editor_scr_bg_ID, editor_scr_bg_filename, editor_scr_bg_x, editor_scr_bg_y, editor_scr_bg_opacity);//092005 grayscale Calvin */
- dm_set_scr_bg_image_no_draw(
- editor_scr_bg_ID,
- editor_scr_bg_filename,
- editor_scr_bg_x,
- editor_scr_bg_y,
- editor_scr_bg_opacity);
- #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */
- ExitCategoryFunction = MMI_dummy_function;
- RedrawCategoryFunction = MMI_dummy_function;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- }
- /*****************************************************************************
- * FUNCTION
- * SetInputboxLSKFunction
- * DESCRIPTION
- *
- * PARAMETERS
- * f [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetInputboxLSKFunction(FuncPtr f)
- {
- #ifdef __MMI_T9__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- T9SetInputboxLSKFunction(f);
- #elif defined __MMI_ZI__
- ZiSetInputboxLSKFunction(f);
- //KP Jerry add on 2007-3-8 start
- #elif defined __MMI_CSTAR__
- CstarSetInputboxLSKFunction(f);
- //KP Jerry add on 2007-3-8 end
- #elif defined __MMI_KA__
- KonKaSetInputboxLSKFunction(f);
- #elif defined __MMI_ITAP__
- /* under construction !*/
- #endif
- #if defined(__MMI_TOUCH_SCREEN__)
- mmi_pen_editor_set_inputbox_LSK_Function(f);
- #endif
- }
- #if defined(__MMI_WCSS_INPUT_FORMAT_SUPPORT__)
- // TODO: to be moved to wgui_categories_inputs.c
- U8 *cat115buffer;
- static void wgui_WCSS_inputbox_input_handler(MMI_key_code_type key_code, MMI_key_event_type key_event);
- /* Return The Input Mode Respect To The Input Method Passed By User. */
- /*****************************************************************************
- * FUNCTION
- * WCSS_check_input_method
- * DESCRIPTION
- *
- * PARAMETERS
- * s [?]
- * RETURNS
- *
- *****************************************************************************/
- static U16 WCSS_check_input_method(U8 *s)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (s[0] & 0x1F)
- {
- case INPUT_MODE_MULTITAP_UPPERCASE_ABC_NO_NUMERIC:
- return INPUT_TYPE_ALPHABATIC_UPPERCASE;
- case INPUT_MODE_MULTITAP_LOWERCASE_ABC_NO_NUMERIC:
- return INPUT_TYPE_ALPHABATIC_LOWERCASE;
- case INPUT_MODE_MULTITAP_UPPERCASE_ABC:
- return INPUT_TYPE_ALPHANUMERIC_UPPERCASE;
- case INPUT_MODE_MULTITAP_LOWERCASE_ABC:
- return INPUT_TYPE_ALPHANUMERIC_LOWERCASE;
- case INPUT_MODE_123:
- return INPUT_TYPE_NUMERIC;
- case INPUT_MODE_123_SYMBOLS:
- return INPUT_TYPE_NUMERIC_SYMBOL;
- default:
- return INPUT_TYPE_ALPHANUMERIC_UPPERCASE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * RedrawCategory115Screen
- * DESCRIPTION
- * Redraws the category115 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void RedrawCategory115Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- RedrawCategory5Screen();
- }
- /*****************************************************************************
- * FUNCTION
- * SetCategory115RightSoftkeyFunction
- * DESCRIPTION
- *
- * PARAMETERS
- * f [IN]
- * k [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetCategory115RightSoftkeyFunction(void (*f) (void), MMI_key_event_type k)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetCategory5RightSoftkeyFunction(f, k);
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory115Screen
- * DESCRIPTION
- * Exits the category5 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory115Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Reference: ExitCategory5Screen() */
- set_MMI_current_input_type();
- reset_softkeys();
- reset_multitaps();
- wgui_close_inputbox();
- clear_key_input_handler(); /* Key input handler was registered before */
- ExitCategoryFunction = MMI_dummy_function;
- RedrawCategoryFunction = MMI_dummy_function;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- if (cat115buffer != NULL)
- {
- gui_free(cat115buffer);
- cat115buffer = NULL;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory115HistorySize
- * DESCRIPTION
- * Gets the size of the history buffer for category115 screen
- * PARAMETERS
- * void
- * RETURNS
- * size in U8s of the history buffer
- *****************************************************************************/
- S32 GetCategory115HistorySize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (sizeof(multiline_inputbox_category_history));
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory115History
- * DESCRIPTION
- * Gets the history buffer for category115 screen
- * PARAMETERS
- * history_buffer [IN] Is the buffer into which the history data is stored (pre-allocated)
- * buffer_size(?) [IN] In unicode (containing ' ')
- * RETURNS
- * Pointer to the history buffer
- *****************************************************************************/
- U8 *GetCategory115History(U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- get_multiline_inputbox_category_history(MMI_CATEGORY5_ID, history_buffer, MMI_current_input_type);
- return (history_buffer);
- }
- #ifdef __MMI_T9__
- extern void InuptMethodEnterCategory5(void);
- #endif
- /*****************************************************************************
- * FUNCTION
- * ShowCategory115Screen
- * DESCRIPTION
- * Displays the category115 screen (WCSS editor)
- * PARAMETERS
- * title [IN] Title for the screen
- * title_icon [IN] Icon shown with the title
- * left_softkey [IN] Left softkey label
- * left_softkey_icon [IN] Icon for the left softkey
- * right_softkey [IN] Right softkey label
- * right_softkey_icon [IN] Icon for the right softkey
- * buffer [IN] Buffer the input box should use.
- * buffer_size [IN] UCS2 character count including ' '
- * input_format [IN] WAP input-format
- * input_required [IN] Unused
- * history_buffer [IN] History buffer
- * RETURNS
- * void
- *****************************************************************************/
- /*
- * Note: We do not handle Chinese input in ShowCategory115Screen to simplify the design.
- * * "*m" and "*M" is already handled in WAP. and "nnn*M" will only allow three digits, and
- * * any number of western characters.
- */
- void ShowCategory115Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- U8 *buffer,
- S32 buffer_size,
- U8 *input_format,
- U8 input_required,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /* Reference: ShowCategory5Screen() */
- dm_data_struct dm_data;//092906 cat115
- S32 inputbox_x = 0;
- S32 inputbox_y = (MMI_title_y + MMI_title_height);
- S32 inputbox_width = MMI_content_width;
- #if defined(__MMI_FULL_SCREEN_EDITOR__)
- S32 inputbox_height = MMI_content_height;
- #else
- S32 inputbox_height = MMI_content_height - MMI_multitap_height;
- #endif
- S8 input_format_status = 0;
- S32 format_length;
- U16 input_type = INPUT_TYPE_ALPHANUMERIC_UPPERCASE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- // ADD_SCREEN_STRINGS((3,title,right_softkey,left_softkey));
- // ADD_SCREEN_IMAGES((3,title_icon,right_softkey_icon,left_softkey_icon));
- if (buffer_size > CAT115_MAXSIZE) /* Maximum input char = CAT115_MAXSIZE - 1 */
- {
- buffer_size = CAT115_MAXSIZE;
- }
- format_length = get_category_115_format_buffer_length(input_format, buffer_size);
- if (format_length == -1)
- {
- /* Use as normat category 5. */
- input_format_status = (S8) (-1);
- }
- else if (format_length == 0)
- {
- /* Leave buffer_size unchanged */
- }
- else if (format_length < buffer_size)
- {
- /* Set the buffer length to the upper bound derived from input format */
- buffer_size = format_length + 1;
- }
- else if (format_length >= buffer_size)
- {
- /* Act as Category 5 */
- input_format_status = (S8) (-1);
- }
- if (input_format_status != -1)
- {
- /* Allocate fixed size of control buffer bucket because the size is controlled by
- external web pages; otherwise, it might exhaust some kind of control buffer */
- cat115buffer = gui_malloc(CAT115_MAXSIZE);
- if (gui_parse_WCSS_string
- ((U8*) input_format, (U8*) buffer, (U8*) cat115buffer, (S16) buffer_size,
- (U8) ((history_buffer || buffer[0] || buffer[1]) ? 1 : 0)) != 0)
- {
- PRINT_INFORMATION(("n --- Category 115 --- Invalid WCSS Format --- "));
- input_format_status = (S8) (-1); /* In this case the editor will works as normal text editor. */
- }
- }
- if (input_format_status != -1)
- {
- extern void gui_reset_WCSS_cursor_position(void);
- /* Use INPUT_TYPE_OVERRIDE_DEFAULT to prevent overriden by default input method, which might be chinese input method (unsupported) */
- input_type = WCSS_check_input_method(cat115buffer) | INPUT_TYPE_OVERRIDE_DEFAULT;
- if (history_buffer == NULL)
- {
- is_fisrt_entry_WCSS_editor = MMI_TRUE;
- }
- else
- {
- is_fisrt_entry_WCSS_editor = MMI_FALSE;
- }
- gui_reset_WCSS_cursor_position();
- }
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_lock_double_buffer();
- #endif
- MMI_menu_shortcut_number = -1;
- MMI_disable_title_shortcut_display = 1;
- clear_category_screen_key_handlers();
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- clear_left_softkey();
- clear_right_softkey();
- register_left_softkey_handler();
- register_right_softkey_handler();
- register_default_hide_softkeys();
- #ifdef __MMI_T9__
- InuptMethodEnterCategory5();
- #elif defined __MMI_ZI__
- ZiInuptMethodEnterCategory5();
- //KP Jerry add on 2007-3-8 start
- #elif defined __MMI_CSTAR__
- CstarInputMethodEnterCategory5();
- //KP Jerry add on 2007-3-8 end
- #elif defined __MMI_KA__
- KonkaInuptMethodEnterCategory5();
- #elif defined __MMI_ITAP__
- /* under construction !*/
- #endif
- MMI_title_string = (UI_string_type) get_string(title);
- MMI_title_icon = (PU8) get_image(title_icon);
- register_hide_multitap(category5_hide_multitap);
- wgui_setup_inputbox(
- inputbox_x,
- inputbox_y,
- inputbox_width,
- inputbox_height,
- buffer,
- buffer_size,
- MMI_CATEGORY5_ID,
- get_string(right_softkey),
- get_image(right_softkey_icon),
- input_type,
- history_buffer,
- 1);
- MMI_current_input_ext_type |= INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL;
- if (input_format_status != -1)
- {
- register_key_input_handler(wgui_WCSS_inputbox_input_handler);
- }
- #if defined(__MMI_FULL_SCREEN_EDITOR__)
- inputbox_height = MMI_content_height - wgui_inputbox_information_bar_height;
- #else
- inputbox_height = MMI_content_height - MMI_multitap_height - wgui_inputbox_information_bar_height;
- #endif
- if (MMI_multiline_inputbox.height > inputbox_height)
- {
- gui_resize_multi_line_input_box(&MMI_multiline_inputbox, MMI_multiline_inputbox.width, inputbox_height);
- }
- #if UI_INCLUDE_INFORMATION_AREA_IN_MULTI_LINE
- MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_INCLUDE_INFO_AREA;
- #endif
- if (input_format_status != -1)
- {
- MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_OVERWRITE_MODE;
- MMI_multiline_inputbox.flags |= UI_MULTI_LINE_WCSS_INPUT_BOX_ENABLE;
- /* Disable word-wrapping for WCSS editor */
- MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_DISABLE_WRAPPING_BY_WORD;
- }
- #ifdef __MMI_WALLPAPER_ON_BOTTOM__
- MMI_multiline_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_TRANSPARENT_BACKGROUND;
- #endif /* __MMI_WALLPAPER_ON_BOTTOM__ */
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_unlock_double_buffer();
- #endif
- if (input_format_status != -1 && history_buffer == NULL)
- {
- /* We hope to edit from the beginning even with default input values,
- and we just configured the input format for the first character */
- MMI_multiline_inputbox.cursor_p = MMI_multiline_inputbox.text;
- MMI_multiline_inputbox.cursor_line_position_counter = 0;
- show_multiline_inputbox_no_draw();
- }
- #if 0//092006 cat115
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #else
- ExitCategoryFunction = ExitCategory115Screen;
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- dm_data.s32flags |= DM_SHOW_VKPAD;
- dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size);
- dm_register_category_controlled_callback(category5callback);
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- dm_data.s32CatId = MMI_CATEGORY5_ID;
- dm_setup_data(&dm_data);
- dm_register_vkpad_callback(cat5_virtual_keypad_callback);
- dm_redraw_category_screen();
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_WCSS_inputbox_input_handler
- * DESCRIPTION
- *
- * PARAMETERS
- * key_code [IN]
- * key_event [IN]
- * RETURNS
- * void
- *****************************************************************************/
- static void wgui_WCSS_inputbox_input_handler(MMI_key_code_type key_code, MMI_key_event_type key_event)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /*
- * When input method is changed before controlled by Multitap Input
- * We cannot switch input method automatically unless multitap is discarded.
- * For example: assume we do not do this, we may get string "ad" from input format "xn" when pressing '2' and '3' successively.
- */
- #if 1
- if (MMI_multiline_inputbox.flags & UI_MULTI_LINE_WCSS_INPUT_BOX_ENABLE)
- #else
- /* under construction !*/
- #endif
- {
- if (MMI_active_multitap != key_code)
- {
- if (!gui_WCSS_check_next_multitap_input(&MMI_multiline_inputbox))
- {
- /* If the next character does not use multitap, disable multitap */
- disable_active_multitap();
- }
- }
- }
- }
- #endif /* defined(__MMI_WCSS_INPUT_FORMAT_SUPPORT__) */
- #if defined(__MMI_SMART_MESSAGE_MO__) && !defined(__MMI_MESSAGES_EMS__)
- /*****************************************************************************
- * FUNCTION
- * mmi_nsm2_get_remaining_len
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- *
- *****************************************************************************/
- S32 mmi_nsm2_get_remaining_len(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_nsm_msg_context.UCS2_count > 0)
- {
- if (g_nsm_msg_context.is_picmsg == TRUE)
- {
- /* 64 */
- g_nsm_msg_context.remaining_length = (MAX_PICMSG_UCS2_DCS_TEXT_LEN) + 1;
- }
- else
- {
- /* 306 */
- g_nsm_msg_context.remaining_length = (UCS2_DCS_ALLOCATED_LENGTH) + 1;
- }
- }
- else /* No UCS Character */
- {
- if (g_nsm_msg_context.is_picmsg == TRUE)
- {
- /* 128 */
- g_nsm_msg_context.remaining_length = (MAX_PICMSG_DEFAULT_DCS_TEXT_LEN) + 1;
- }
- else
- {
- /* 612 */
- g_nsm_msg_context.remaining_length = (DEFAULT_DCS_ALLOCATED_LENGTH) + 1;
- }
- }
- return (g_nsm_msg_context.remaining_length * 2);
- }
- #endif /* defined(__MMI_SMART_MESSAGE_MO__) && !defined(__MMI_MESSAGES_EMS__) */
- #ifdef __MMI_MESSAGES_CHAT__
- /* only used in cat305(ChatApp) */
- UI_filled_area greenwgui_color_dialog_background = {UI_FILLED_AREA_TYPE_COLOR,
- UI_NULL_IMAGE,
- NULL,
- {200, 255, 145, 100},
- {0, 0, 0, 0},
- {0, 0, 0, 100},
- {50, 50, 50, 100},
- 0
- };
- /********** MS CHAT SCREEN START **********/
- #define LOCAL 0
- #define SENDER 1
- #define RECEIVER_TRUNCATED 2
- #define SENDER_TRUNCATED 3
- UI_filled_area SMSChat_inputbox_BG_filler =
- {
- UI_FILLED_AREA_TYPE_COLOR | UI_FILLED_AREA_DOUBLE_BORDER | UI_FILLED_AREA_ROUNDED_BORDER |
- UI_FILLED_AREA_SHADOW_DOUBLE_LINE | UI_FILLED_AREA_SHADOW,
- UI_NULL_IMAGE,
- NULL,
- {255, 255, 217, 100},
- {0, 0, 0, 0},
- {107, 215, 0, 100},
- {84, 84, 84, 100},
- 0
- };
- UI_multi_line_input_box_theme SMSChat_MMI_multiline_inputbox_theme = { (UI_filled_area *)&SMSChat_inputbox_BG_filler,
- (UI_filled_area *)&SMSChat_inputbox_BG_filler,
- (UI_filled_area *)&SMSChat_inputbox_BG_filler,
- {0, 0, 0, 100},
- {0, 0, 0, 100},
- {128, 128, 128, 100},
- {0, 0, 0, 100},
- {255, 255, 255, 100},
- {51, 88, 171, 100},
- {255, 0, 0, 100},
- {255, 0, 0, 100},
- &(UI_DEFAULT_FONT),
- 1,
- 0,
- '*',
- 5
- };
- //U8 chat_message[CHAT_MESSAGE_BUFFER];
- U8 *chat_message = NULL;
- const S8 uni_str_new_line[4] = { 'n', ' ', ' ', ' ' };
- const S8 uni_grp_ch[4] = {0x1d, 0x00, 0x00, 0x00};
- const S8 uni_file_ch[4] = {0x1c, 0x00, 0x00, 0x00};
- const S8 uni_sender_truncate[4] = {0x1e, 0x00, 0x00, 0x00};
- const S8 uni_receiver_truncate[4] = {0x1f, 0x00, 0x00, 0x00};
- const S8 gChatTruncateSymbol[] = { '(', ' ', '.', ' ', '.', ' ', ')', ' ', ' ', ' ' };
- scrolling_text wgui_category305_scrolling_text;
- #define MAX_CHAT_NICKNAME_SIZE 12
- U8 *last_char = NULL, *current_pos = NULL;