📄 wgui_categories_inputs.c
字号:
Input Parameters: none
Output Parameters: none
Returns: void
----------------------------------------------------------------------------*/
void change_singleline_input_mode(void)
{
U8 i;
U8* MMI_input_mode_set;
i = 0;
if (MMI_allow_only_english_input_modes)
{
MMI_input_mode_set = MMI_english_input_mode_set;
}
else
{
MMI_input_mode_set = MMI_all_input_mode_set;
}
while(MMI_input_mode_set[i] != MMI_current_input_mode && MMI_input_mode_set[i] != 0xff)
{
i++;
}
do
{
if(MMI_input_mode_set[i]==0xff)
{
i=0;
MMI_current_input_mode = MMI_input_mode_set[0];
}
if(MMI_input_mode_set[i+1]==0xff)
{
i=0;
MMI_current_input_mode = MMI_input_mode_set[0];
}
else
{
MMI_current_input_mode = MMI_input_mode_set[i+1];
}
i++;
} while( MMI_current_input_mode!= INPUT_MODE_MULTITAP_UPPERCASE_ABC &&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_LOWERCASE_ABC&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_THAI&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_LOWERCASE_SPANISH&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_UPPERCASE_SPANISH&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_LOWERCASE_DANISH&&//PMT VIKASG START 20050729
MMI_current_input_mode!= INPUT_MODE_MULTITAP_UPPERCASE_DANISH&&//PMT VIKASG END 20050729
//PMT CZ_PO_TU START 20050812
MMI_current_input_mode!= INPUT_MODE_MULTITAP_LOWERCASE_POLISH&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_UPPERCASE_POLISH&&
//PMT CZ_PO_TU END 20050812
MMI_current_input_mode!= INPUT_MODE_MULTITAP_LOWERCASE_FRENCH&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_UPPERCASE_FRENCH&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_LOWERCASE_GERMAN&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_UPPERCASE_GERMAN&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_LOWERCASE_ITALIAN&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_UPPERCASE_ITALIAN&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_LOWERCASE_RUSSIAN&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_UPPERCASE_RUSSIAN&&
//PMT BULGARIAN START 20051201
MMI_current_input_mode!= INPUT_MODE_MULTITAP_LOWERCASE_BULGARIAN&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_UPPERCASE_BULGARIAN&&
//PMT BULGARIAN END 20051201
MMI_current_input_mode!= INPUT_MODE_MULTITAP_LOWERCASE_TURKISH&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_UPPERCASE_TURKISH&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_LOWERCASE_PORTUGUESE&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_UPPERCASE_PORTUGUESE&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_LOWERCASE_INDONESIAN&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_UPPERCASE_INDONESIAN&&
//PMT CZ_PO_TU START 20050812
MMI_current_input_mode!= INPUT_MODE_MULTITAP_LOWERCASE_CZECH&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_UPPERCASE_CZECH&&
//PMT CZ_PO_TU END 20050812
MMI_current_input_mode!= INPUT_MODE_MULTITAP_LOWERCASE_MALAY&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_UPPERCASE_MALAY&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_LOWERCASE_VIETNAMESE&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_UPPERCASE_VIETNAMESE&&
//PMT START HU_FI 20050825
MMI_current_input_mode!= INPUT_MODE_MULTITAP_LOWERCASE_FINNISH&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_UPPERCASE_FINNISH&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_LOWERCASE_HUNGARIAN&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_UPPERCASE_HUNGARIAN&&
//PMT END HU_FI 20050825
//PMT NO_AR_SL_DU START 20050909
MMI_current_input_mode!= INPUT_MODE_MULTITAP_LOWERCASE_SLOVAK&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_UPPERCASE_SLOVAK&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_LOWERCASE_DUTCH&& //Nitesh added
MMI_current_input_mode!= INPUT_MODE_MULTITAP_UPPERCASE_DUTCH&&
//Norwegian start
MMI_current_input_mode!= INPUT_MODE_MULTITAP_LOWERCASE_NORWEGIAN&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_UPPERCASE_NORWEGIAN&&
//Norwegian end
//PMT NO_AR_SL_DU END 20050909
//PMT START SWEDISH 20050916
MMI_current_input_mode!= INPUT_MODE_MULTITAP_LOWERCASE_SWEDISH&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_UPPERCASE_SWEDISH&&
//PMT END SWEDISH 20050916
//PMT START CR_ROM_SLO 20050923
MMI_current_input_mode!= INPUT_MODE_MULTITAP_LOWERCASE_CROATIAN&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_UPPERCASE_CROATIAN&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_LOWERCASE_ROMANIAN&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_UPPERCASE_ROMANIAN&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_LOWERCASE_SLOVENIAN&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_UPPERCASE_SLOVENIAN&&
//PMT END CR_ROM_SLO 20050923
//PMT START GR_HE_CZ_FI_DA_HU 20051007
MMI_current_input_mode!= INPUT_MODE_MULTITAP_LOWERCASE_GREEK&&
MMI_current_input_mode!= INPUT_MODE_MULTITAP_UPPERCASE_GREEK&&
//PMT END GR_HE_CZ_FI_DA_HU 20051007
MMI_current_input_mode!= INPUT_MODE_123);
inputbox_change_mode();
set_MMI_current_input_type();
}
/*code added vandana mehtani*/
/*----------------------------------------------------------------------------
Function: change_singleline_inputbox_input_mode
Description: change the input mode of single line input box
Input Parameters: none
Output Parameters: none
Returns: void
----------------------------------------------------------------------------*/
void change_singleline_inputbox_input_mode(void)
{ change_singleline_inputbox_mode(MMI_current_input_mode);
}
//MTK Elvis to add some APIs for Qsearch
/*----------------------------------------------------------------------------
Function: change_singleline_inputbox_input_mode
Description: change the input mode of single line input box
Input Parameters: none
Output Parameters: none
Returns: void
----------------------------------------------------------------------------*/
void change_qsearch_singleline_inputbox_input_mode(void)
{ change_qsearch_singleline_inputbox_mode(MMI_current_input_mode);
}
//MTK end
/*----------------------------------------------------------------------------
Function: change_multiline_inputbox_input_mode
Description: Changes the input mode of the multiline inputbox
Input Parameters: none
Output Parameters: none
Returns: void
----------------------------------------------------------------------------*/
void change_multiline_inputbox_input_mode(void)
{ change_multiline_inputbox_mode(MMI_current_input_mode);
}
//Function Added To Display Remaining Character for Single Line Box - Gurinder 23/4/2004
/*----------------------------------------------------------------------------
Function: wgui_redraw_remaining_characters_display
Description:
Input parameters : none
Output Parameters: none
Returns: none
----------------------------------------------------------------------------*/
void wgui_redraw_singleline_input_box_remaining_characters_display(void)
{
#ifndef __MMI_HIDE_SGL_REMAINING_CHAR__
color c;
//MTK Elvis for R2L characters
s32 x1;
s32 x2;
s32 y1=wgui_inputbox_information_bar_y;
s32 y2=wgui_inputbox_information_bar_y+wgui_inputbox_information_bar_height-1;
//MTK end
#if !defined(__MMI_TOUCH_SCREEN__)
stFontAttribute *f=&MMI_small_font;
s32 w,n,max_n;
#else
stFontAttribute *f=&MMI_medium_font;
s32 w,h,n,max_n;
#endif
UI_character_type str[32];
//MTK Elvis for R2L characters
if(!r2lMMIFlag)
{
x1=wgui_inputbox_information_bar_x+(wgui_inputbox_information_bar_width>>1);
x2=wgui_inputbox_information_bar_x+wgui_inputbox_information_bar_width-1;
}
else
{
x1=wgui_inputbox_information_bar_x;
x2=wgui_inputbox_information_bar_x+(wgui_inputbox_information_bar_width/2)-1;
}
//MTK end
#if(UI_DOUBLE_BUFFER_SUPPORT)
pixtel_UI_lock_double_buffer();
#endif
/* Warning: Temporary change only UCS2 / ASCII. This has to be done in a more formal manner */
n=(MMI_singleline_inputbox.text_length>>1)-1;
max_n=(MMI_singleline_inputbox.available_length>>1)-1;
if((MMI_singleline_inputbox.flags & UI_SINGLE_LINE_INPUT_BOX_CHECK_GSM_EXTENDED) && (MMI_singleline_inputbox.UCS2_count==0))
{ n+=MMI_singleline_inputbox.GSM_ext_count;
}
if((MMI_singleline_inputbox.flags & UI_SINGLE_LINE_INPUT_BOX_PLUS_CHARACTER_HANDLING) && (MMI_singleline_inputbox.text[0]=='+'))
{ n--;
max_n--;
}
// if(!(MMI_multiline_inputbox.flags & UI_MULTI_LINE_INPUT_BOX_INCLUDE_INFO_AREA))
wgui_input_information_background(x1,y1,x2,y2);
pixtel_UI_reset_text_clip();
pixtel_UI_sprintf(str,"%d/%d",n,max_n);
c=*current_MMI_theme->remaining_length_text_color;
pixtel_UI_set_font(f);
pixtel_UI_set_text_color(c);
pixtel_UI_set_text_clip(0,0,UI_device_width-1,UI_device_height-1);
#if !defined(__MMI_TOUCH_SCREEN__)
w=pixtel_UI_get_string_width(str);
#else
pixtel_UI_measure_string(str,&w,&h);
#endif
//MTK Elvis for R2L characters
if(!r2lMMIFlag)
#if !defined(__MMI_TOUCH_SCREEN__)
pixtel_UI_move_text_cursor(x2-2-w,y1+2);
#else
pixtel_UI_move_text_cursor(x2-2-w,y1+(wgui_inputbox_information_bar_height-h)/2);
#endif
else
#if !defined(__MMI_TOUCH_SCREEN__)
pixtel_UI_move_text_cursor(x1+2+w,y1+2);
#else
pixtel_UI_move_text_cursor(x1+2+w,y1+(wgui_inputbox_information_bar_height-h)/2);
#endif
//MTK end
pixtel_UI_print_text(str);
#if(UI_DOUBLE_BUFFER_SUPPORT)
pixtel_UI_unlock_double_buffer();
pixtel_UI_BLT_double_buffer(x1,y1,x2,y2);
#endif
#endif
}
//Function Added To Display Information Bar For Single Line Input Box - Gurinder 23/4/2004
/*----------------------------------------------------------------------------
Function: wgui_redraw_singleline_input_information_bar
Description: redrwa input information bar
Input parameters : none
Output Parameters: none
Returns: none
----------------------------------------------------------------------------*/
void wgui_redraw_singleline_input_information_bar(void)
{
s32 x1=wgui_inputbox_information_bar_x;
s32 y1=wgui_inputbox_information_bar_y;
s32 x2=wgui_inputbox_information_bar_x+wgui_inputbox_information_bar_width-1;
s32 y2=wgui_inputbox_information_bar_y+wgui_inputbox_information_bar_height-1;
#if(UI_DOUBLE_BUFFER_SUPPORT)
pixtel_UI_lock_double_buffer();
#endif
wgui_input_information_background(x1,y1,x2,y2);
wgui_show_input_mode(MMI_current_input_mode, wgui_inputbox_information_icon);
wgui_redraw_singleline_input_box_remaining_characters_display();
#if(UI_DOUBLE_BUFFER_SUPPORT)
pixtel_UI_unlock_double_buffer();
pixtel_UI_BLT_double_buffer(x1,y1,x2,y2);
#endif
}
/*CODE ADDED VANDANA MEHTANI*/
/*----------------------------------------------------------------------------
Function: set_singleline_inputbox_category_history
Description: Sets the history data for the singleline inputbox from the given history buffer
Input Parameters: history_ID is the ID used by category screens
history_buffer is the buffer from which history data is taken
Output Parameters: none
Returns: Returns true if the history ID is valid
----------------------------------------------------------------------------*/
byte set_singleline_inputbox_category_history(word history_ID,byte *history_buffer,s16 *input_type)
{
if(history_buffer!=NULL)
{
singleline_inputbox_category_history *h=(singleline_inputbox_category_history*)history_buffer;
if(history_valid(h->history_ID,history_ID))
{
MMI_singleline_inputbox.text_length=h->text_length;
MMI_singleline_inputbox.allocated_length=h->allocated_length;
MMI_singleline_inputbox.available_length=h->available_length;
MMI_singleline_inputbox.current_text_p=(UI_buffer_type)(MMI_singleline_inputbox.text+h->current_position);
MMI_singleline_inputbox.text_offset_x=h->text_offset_x;
MMI_singleline_inputbox.UCS2_count=h->UCS2_count;
*input_type=h->input_type;
MMI_singleline_inputbox.flags=h->flags;
#if defined(__MMI_TOUCH_SCREEN__)
wgui_setup_virtual_keyboard(h->vk_lang_type);
#endif
return(1);
}
}
return(0);
}
/*----------------------------------------------------------------------------
Function: set_singleline_inputbox_category_history
Description: gets the history data for the singleline inputbox from the given history buffer
Input Parameters: history_ID is the ID used by category screens
history_buffer is the buffer from which history data is taken
Output Parameters: none
Returns: Returns true if the history ID is valid
----------------------------------------------------------------------------*/
void get_singleline_inputbox_category_history(word history_ID,byte *history_buffer,s16 input_type)
{
if(history_buffer!=NULL)
{
word hID=(word)(history_ID|0x8000);
singleline_inputbox_category_history *h=(singleline_inputbox_category_history*)history_buffer;
h->history_ID=hID;
h->text_length=(s16)MMI_singleline_inputbox.text_length;
h->allocated_length=(s16)MMI_singleline_inputbox.allocated_length;
h->available_length=(s16)MMI_singleline_inputbox.available_length;
h->current_position=(s16)(MMI_singleline_inputbox.current_text_p-MMI_singleline_inputbox.text);
h->text_offset_x=(s16)MMI_singleline_inputbox.text_offset_x;
h->UCS2_count=(s16)MMI_singleline_inputbox.UCS2_count;
h->input_type=(s16)input_type;
h->flags=(dword)MMI_singleline_inputbox.flags;
#if defined(__MMI_TOUCH_SCREEN__)
//W06.04 Save Virtual Keyboard in the history of single line input box
if ( MMI_GUI_VIRTUAL_KEYBOARD_MAX_LANG == mmi_pen_editor_history_vk_lang_type() )
{
h->vk_lang_type = MMI_virtual_keyboard.lang_type;
}
else
{
h->vk_lang_type = mmi_pen_editor_history_vk_lang_type();
}
#endif
}
}
/*CODE ENDED VANDANA MEHTANI*/
/*----------------------------------------------------------------------------
Function: set_multiline_inputbox_category_history
Description: Sets the history data for the multiline inputbox from the given history buffer
Input Parameters: history_ID is the ID used by category screens
history_buffer is the buffer from which history data is taken
Output Parameters: none
Returns: Returns true if the history ID is valid
----------------------------------------------------------------------------*/
byte set_multiline_inputbox_category_history(word history_ID,byte *history_buffer,s16 *input_type)
{ if(history_buffer!=NULL)
{ multiline_inputbox_category_history *h=(multiline_inputbox_category_history*)history_buffer;
if(history_valid(h->history_ID,history_ID))
{ MMI_multiline_inputbox.text_length=h->text_length;
MMI_multiline_inputbox.allocated_length=h->allocated_length;
#if defined(__MMI_SMART_MESSAGE_MO__)&& !defined(__MMI_MESSAGES_EMS__)
/* under construction !*/
/* under construction !*/
#else
MMI_multiline_inputbox.available_length=h->available_length;
#endif
MMI_multiline_inputbox.n_lines=h->n_lines;
MMI_multiline_inputbox.text_height=h->text_height;
MMI_multiline_inputbox.text_offset_x=h->text_offset_x;
MMI_multiline_inputbox.text_offset_y=h->text_offset_y;
MMI_multiline_inputbox.cursor_x=h->cursor_x;
MMI_multiline_inputbox.cursor_y=h->cursor_y;
MMI_multiline_inputbox.cursor_line_position_counter=h->cursor_line_position_counter;
MMI_multiline_inputbox.line_before_cursor_line_p=(UI_buffer_type)(MMI_multiline_inputbox.text+h->line_before_cursor_line_p);
MMI_multiline_inputbox.cursor_line_p=(UI_buffer_type)(MMI_multiline_inputbox.text+h->cursor_line_p);
MMI_multiline_inputbox.cursor_p=(UI_buffer_type)(MMI_multiline_inputbox.text+h->cursor_p);
MMI_multiline_inputbox.line_after_cursor_line_p=(UI_buffer_type)(MMI_multiline_inputbox.text+h->line_after_cursor_line_p);
MMI_multiline_inputbox.line_after_cursor_line_last_p=(UI_buffer_type)(MMI_multiline_inputbox.text+h->line_after_cursor_line_last_p);
MMI_multiline_inputbox.last_position_p=(UI_buffer_type)(MMI_multiline_inputbox.text+h->last_position_p);
MMI_multiline_inputbox.UCS2_count=h->UCS2_count;
*input_type=h->input_type;
MMI_multiline_inputbox.flags=h->flags;
#if defined(__MMI_TOUCH_SCREEN__)
wgui_setup_virtual_keyboard(h->vk_lang_type);
#endif
return(1);
}
}
return(0);
}
/*----------------------------------------------------------------------------
Function: get_multiline_inputbox_category_history
Description: Gets the history data for the multiline inputbox and stores into the given history buffer
Input Parameters: history_ID is the ID used by category screens
history_buffer is
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -