CommonScreens.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:247k
源码类别:
MTK
开发平台:
C/C++
- MMI_TRUE,
- MMI_FALSE);
- #if !defined(__MMI_TOUCH_SCREEN__)
- postHandleInputMethodLSKFuncPtrs[i] = UI_dummy_function;
- preHandleInputMethodLSKFuncPtrs[i++] = EntrySymbolPickerScreenFromMenuList;
- #endif /* !defined(__MMI_TOUCH_SCREEN__) */
- currPreFuncPtr = preHandleInputMethodLSKFuncPtrs[index];
- currPostFuncPtr = postHandleInputMethodLSKFuncPtrs[index];
- if (currPreFuncPtr != NULL)
- {
- (*currPreFuncPtr) ();
- }
- if (currPostFuncPtr != NULL)
- {
- (*currPostFuncPtr) ();
- }
- /* MTK end */
- }
- /*****************************************************************************
- * FUNCTION
- * RegisterInputMethodScreenCloseFunction
- * DESCRIPTION
- *
- * PARAMETERS
- * f [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void RegisterInputMethodScreenCloseFunction(void (*f) (void))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (f != NULL)
- {
- InputMethodScreenCloseFunction = f;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * InputMethodScreenHandleRSK
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void InputMethodScreenHandleRSK(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- //SetSavedInputType();
- //MTK Elvis 20031217---it is not required to set them to UI_dummy_function
- //Issue:
- //if set them to UI_dummy_function, will cause following issue:
- //user cannot select desired input mode while entering input method menu list, pressing RSK-Back,
- //and entering input method menu again.
- //pressing RSK will reset following function pointers to be UI_dummy_function.
- //Solution:
- //The xxxchange_inputbox_modexxxx will be re-initialized in different editing screen, so it
- //not required to set them to UI_dummy_function while pressing RSK-Back
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #if defined(__MMI_T9__) || defined(__MMI_ZI__)
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif
- /* under construction !*/
- #endif /* 0 */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GoBackHistory();
- }
- extern void handle_inline_full_screen_edit_complete(void);
- extern void handle_inline_full_screen_edit_cancel(void);
- extern wgui_inline_item *current_wgui_inline_item;
- extern S32 wgui_n_inline_items;
- extern S32 wgui_inline_item_highlighted_index;
- /*****************************************************************************
- * FUNCTION
- * ConfirmInlineFullScreenEdit
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ConfirmInlineFullScreenEdit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_lock_double_buffer();
- #endif
- if ((current_wgui_inline_item == NULL) || (wgui_n_inline_items <= 0))
- {
- GoBackHistory();
- }
- handle_inline_full_screen_edit_complete();
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(0, 0, UI_device_width - 1, UI_device_height - 1);
- #endif /* (UI_DOUBLE_BUFFER_SUPPORT) */
- }
- /*****************************************************************************
- * FUNCTION
- * CancelInlineFullScreenEdit
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void CancelInlineFullScreenEdit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_lock_double_buffer();
- #endif
- if ((current_wgui_inline_item == NULL) || (wgui_n_inline_items <= 0))
- {
- GoBackHistory();
- }
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_unlock_double_buffer();
- #endif
- handle_inline_full_screen_edit_cancel();
- }
- /*****************************************************************************
- * FUNCTION
- * EntryAPRequiredInputMethodScreen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryAPRequiredInputMethodScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U16 nNumofItem = 0;
- U16 p = 0, q = 0;
- U16 nStrItemList[INPUT_MODE_MAX_NUM];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- void (*LSK_handler) (void);
- /* ExecuteCurrExitHandler(); */
- EntryNewScreen(SCR_AP_REQUIRED_INPUT_METHOD_LIST, ExitAPRequiredInputMethodScreen, NULL, NULL);
- while (1)
- {
- if (MMI_AP_required_input_mode_set[p] == gIMEModeArray[q].IME_Mode_ID)
- {
- nStrItemList[nNumofItem] = gIMEModeArray[q].Common_Screen_StringID;
- nNumofItem++;
- if (MMI_AP_required_input_mode_set[p + 1] == -1)
- {
- break;
- }
- p++;
- q = 0;
- }
- else
- {
- q++;
- if (q > INPUT_MODE_MAX_NUM + 1)
- {
- if (MMI_AP_required_input_mode_set[p] == -1 || MMI_AP_required_input_mode_set[p + 1] == -1)
- {
- break;
- }
- p++;
- q = 0;
- }
- }
- }
- #if !defined(__MMI_TOUCH_SCREEN__)
- nStrItemList[nNumofItem] = STR_INPUT_METHOD_MENU_INSERT_SYMBOLS;
- nNumofItem++;
- #endif /* !defined(__MMI_TOUCH_SCREEN__) */
- LSK_handler = APRequiredInputMethodScreenHandleLSK;
- //MTK end
- //START PMTFARHAD 20050224
- //PMT START PERSIAN
- #if defined __MMI_LANG_HINDI__ && (defined __MMI_LANG_ARABIC__ || defined __MMI_LANG_PERSIAN__)
- /* PMT END PERSIAN */
- if (HINDI_PRESENT || ARABIC_PRESENT)
- {
- int Item_counter = 0;
- int string_found = 0;
- if (ARABIC_PRESENT)
- {
- while (Item_counter != nNumofItem)
- {
- if (nStrItemList[Item_counter] == STR_INPUT_METHOD_MENU_MULTITAP_HINDI)
- {
- string_found = 1;
- }
- nStrItemList[Item_counter] = nStrItemList[Item_counter + string_found];
- Item_counter++;
- }
- }
- else
- {
- while (Item_counter != nNumofItem)
- {
- if (nStrItemList[Item_counter] == STR_INPUT_METHOD_MENU_SMART_ARABIC)
- {
- string_found = 1;
- }
- nStrItemList[Item_counter] = nStrItemList[Item_counter + string_found];
- Item_counter++;
- }
- }
- }
- #endif /* defined __MMI_LANG_HINDI__ && (defined __MMI_LANG_ARABIC__ || defined __MMI_LANG_PERSIAN__) */
- /* END PMTFARHAD 20050224 */
- saved_MMI_current_input_type = MMI_current_input_type;
- guiBuffer = GetCurrGuiBuffer(SCR_AP_REQUIRED_INPUT_METHOD_LIST);
- if (guiBuffer != NULL)
- {
- InputMethodScreenCloseFunction = SavedInputMethodScreenCloseFunction;
- }
- ShowCategory15Screen(
- STR_GLOBAL_INPUT_METHOD,
- /* gInputMethodAndDoneCaptionIcon */ 0,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (PU16) gIndexIconsImageList,
- LIST_MENU,
- 0,
- guiBuffer);
- SetLeftSoftkeyFunction(LSK_handler, KEY_EVENT_UP);
- SetRightSoftkeyFunction(InputMethodScreenHandleRSK, KEY_EVENT_UP);
- SetKeyHandler(LSK_handler, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(InputMethodScreenHandleRSK, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- /* SetExitHandler(SCR_INPUT_METHOD_LIST, ExitInputMethodScreen); */
- }
- /*****************************************************************************
- * FUNCTION
- * ExitAPRequiredInputMethodScreen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitAPRequiredInputMethodScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history h;
- S16 nHistory = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SavedInputMethodScreenCloseFunction = InputMethodScreenCloseFunction;
- //MTK Elvis 20031217---it is not required to set them to UI_dummy_function
- //Issue:
- //if set them to UI_dummy_function, will cause following issue:
- //user cannot select desired input mode while entering input method menu list, pressing RSK-Back,
- //and entering input method menu again.
- //pressing RSK will reset following function pointers to be UI_dummy_function.
- //Solution:
- //The InputMethodScreenCloseFunction will be re-initialized in different editing screen, so it
- //not required to set them to UI_dummy_function while pressing RSK-Back
- #if 0
- /* under construction !*/
- #endif /* 0 */
- h.scrnID = SCR_AP_REQUIRED_INPUT_METHOD_LIST;
- h.entryFuncPtr = EntryAPRequiredInputMethodScreen;
- pfnUnicodeStrcpy((S8*) h.inputBuffer, (S8*) & nHistory);
- GetCategoryHistory(h.guiBuffer);
- AddHistory(h);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryInputMethodScreen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryInputMethodScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U16 nNumofItem = 0, i = 0;
- U16 nStrItemList[INPUT_MODE_MAX_NUM];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- void (*LSK_handler) (void);
- /* ExecuteCurrExitHandler(); */
- EntryNewScreen(SCR_INPUT_METHOD_LIST, ExitInputMethodScreen, NULL, NULL);
- if (MMI_english_input_mode_flag) /* English only input methods menu */
- {
- for (;;)
- {
- if (((0xff) != gIMEModeArray[i].IME_Mode_ID) && (0 != gIMEModeArray[i].Common_Screen_StringID))
- {
- if (gIMEModeArray[i].English_Only_Flag)
- {
- if (!(mmi_is_alphanum_pass &&
- (gIMEModeArray[i].IME_Mode_ID == INPUT_MODE_SMART_UPPERCASE_ABC ||
- gIMEModeArray[i].IME_Mode_ID == INPUT_MODE_SMART_LOWERCASE_ABC))) /* smart ABC, abc is not allowed in INPUT_TYPE_ALPHANUMERIC_PASSWORD */
- {
- nStrItemList[nNumofItem] = gIMEModeArray[i].Common_Screen_StringID;
- nNumofItem++;
- }
- }
- }
- else
- {
- break;
- }
- i++;
- }
- #if !defined(__MMI_TOUCH_SCREEN__)
- nStrItemList[nNumofItem] = STR_INPUT_METHOD_MENU_INSERT_SYMBOLS;
- nNumofItem++;
- #endif /* !defined(__MMI_TOUCH_SCREEN__) */
- LSK_handler = InputMethodScreenEnglishOnlyHandleLSK;
- }
- else /* English-Chinese input methods menu */
- {
- for (;;)
- {
- if ((0xff) != gIMEModeArray[i].IME_Mode_ID && (0 != gIMEModeArray[i].Common_Screen_StringID))
- {
- if (!(mmi_is_alphanum_pass &&
- (gIMEModeArray[i].IME_Mode_ID == INPUT_MODE_SMART_UPPERCASE_ABC ||
- gIMEModeArray[i].IME_Mode_ID == INPUT_MODE_SMART_LOWERCASE_ABC))) /* smart ABC, abc is not allowed in INPUT_TYPE_ALPHANUMERIC_PASSWORD */
- {
- nStrItemList[nNumofItem] = gIMEModeArray[i].Common_Screen_StringID;
- nNumofItem++;
- }
- }
- else
- {
- break;
- }
- i++;
- }
- #if !defined(__MMI_TOUCH_SCREEN__)
- nStrItemList[nNumofItem] = STR_INPUT_METHOD_MENU_INSERT_SYMBOLS;
- nNumofItem++;
- #endif /* !defined(__MMI_TOUCH_SCREEN__) */
- LSK_handler = InputMethodScreenHandleLSK;
- }
- //MTK end
- //PMT START PERSIAN
- #if defined (__MMI_LANG_HINDI__) && (defined (__MMI_LANG_ARABIC__) || defined (__MMI_LANG_PERSIAN__))
- /* PMT END PERSIAN */
- if (HINDI_PRESENT || ARABIC_PRESENT)
- {
- int Item_counter = 0;
- int string_found = 0;
- if (ARABIC_PRESENT)
- {
- while (Item_counter != nNumofItem)
- {
- if (nStrItemList[Item_counter] == STR_INPUT_METHOD_MENU_MULTITAP_HINDI)
- {
- string_found = 1;
- }
- //PMT START PERSIAN
- else if ((nStrItemList[Item_counter] == STR_INPUT_METHOD_MENU_SMART_ARABIC) ||
- (nStrItemList[Item_counter] == STR_INPUT_METHOD_MENU_SMART_PERSIAN))
- /* PMT END PERSIAN */
- {
- string_found = 2;
- }
- /* PMT LANGUAGE END 20051221 */
- nStrItemList[Item_counter] = nStrItemList[Item_counter + string_found];
- Item_counter++;
- }
- }
- /* PMT LANGUAGE START 20051221 */
- else if (HINDI_PRESENT)
- {
- while (Item_counter != nNumofItem)
- {
- /* PMT START PERSIAN */
- if ((nStrItemList[Item_counter] == STR_INPUT_METHOD_MENU_MULTITAP_ARABIC) ||
- (nStrItemList[Item_counter] == STR_INPUT_METHOD_MENU_MULTITAP_PERSIAN))
- /* PMT END PERSIAN */
- {
- string_found = 1;
- }
- else if (nStrItemList[Item_counter] == STR_INPUT_METHOD_MENU_MULTITAP_HINDI)
- {
- string_found = 2;
- }
- nStrItemList[Item_counter] = nStrItemList[Item_counter + string_found];
- Item_counter++;
- }
- }
- /* PMT LANGUAGE END 20051221 */
- }
- #endif /* defined (__MMI_LANG_HINDI__) && (defined (__MMI_LANG_ARABIC__) || defined (__MMI_LANG_PERSIAN__)) */
- //PMT START PERSIAN
- #if defined (__MMI_LANG_HINDI__) && (defined (__MMI_LANG_ARABIC__) || defined (__MMI_LANG_PERSIAN__))
- /* PMT END PERSIAN */
- if (HINDI_PRESENT || ARABIC_PRESENT)
- {
- nNumofItem = nNumofItem - 2;
- }
- #endif /* defined (__MMI_LANG_HINDI__) && (defined (__MMI_LANG_ARABIC__) || defined (__MMI_LANG_PERSIAN__)) */
- /* PMT LANGUAGE END 20051221 */
- saved_MMI_current_input_type = MMI_current_input_type;
- guiBuffer = GetCurrGuiBuffer(SCR_INPUT_METHOD_LIST);
- if (guiBuffer != NULL)
- {
- InputMethodScreenCloseFunction = SavedInputMethodScreenCloseFunction;
- }
- ShowCategory15Screen(
- STR_GLOBAL_INPUT_METHOD,
- /* gInputMethodAndDoneCaptionIcon */ 0,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (PU16) gIndexIconsImageList,
- LIST_MENU,
- 0,
- guiBuffer);
- SetLeftSoftkeyFunction(LSK_handler, KEY_EVENT_UP);
- SetRightSoftkeyFunction(InputMethodScreenHandleRSK, KEY_EVENT_UP);
- SetKeyHandler(LSK_handler, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(InputMethodScreenHandleRSK, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- /* SetExitHandler(SCR_INPUT_METHOD_LIST, ExitInputMethodScreen); */
- }
- /*****************************************************************************
- * FUNCTION
- * ExitInputMethodScreen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitInputMethodScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history h;
- S16 nHistory = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SavedInputMethodScreenCloseFunction = InputMethodScreenCloseFunction;
- //MTK Elvis 20031217---it is not required to set them to UI_dummy_function
- //Issue:
- //if set them to UI_dummy_function, will cause following issue:
- //user cannot select desired input mode while entering input method menu list, pressing RSK-Back,
- //and entering input method menu again.
- //pressing RSK will reset following function pointers to be UI_dummy_function.
- //Solution:
- //The InputMethodScreenCloseFunction will be re-initialized in different editing screen, so it
- //not required to set them to UI_dummy_function while pressing RSK-Back
- #if 0
- /* under construction !*/
- #endif /* 0 */
- h.scrnID = SCR_INPUT_METHOD_LIST;
- h.entryFuncPtr = EntryInputMethodScreen;
- pfnUnicodeStrcpy((S8*) h.inputBuffer, (S8*) & nHistory);
- GetCategoryHistory(h.guiBuffer);
- AddHistory(h);
- }
- /* __CUSTPACK_MULTIBIN Terry END */
- /* START VIJAY PMT 20050725 */
- #if defined(__MMI_MULTITAP_HINDI__)
- #define VOWEL_PICKER_MAX_HINDI_SYMBOLS 27
- #define VOWEL_PICKER_LF_INDEX (VOWEL_PICKER_MAX_HINDI_SYMBOLS-1)
- #define VOWEL_PICKER_SPACE_INDEX (VOWEL_PICKER_MAX_HINDI_SYMBOLS-2)
- #define IND_VOWEL_PICKER_MAX_HINDI_SYMBOL 15
- #define IND_VOWEL_PICKER_LF_INDEX (IND_VOWEL_PICKER_MAX_HINDI_SYMBOL-1)
- #define IND_VOWEL_PICKER_SPACE_INDEX (IND_VOWEL_PICKER_MAX_HINDI_SYMBOL-2)
- #endif /* defined(__MMI_MULTITAP_HINDI__) */
- /* END VIJAY PMT 20050725 */
- #define SYMBOL_PICKER_MAX_SYMBOLS 36
- #define SYMBOL_PICKER_LF_INDEX 35
- #define SYMBOL_PICKER_SPACE_INDEX 34
- #define SYMBOL_PICKER_MAX_CHINESE_SYMBOLS 28
- #define SYMBOL_PICKER_CHINESE_LF_INDEX 27
- #define SYMBOL_PICKER_CHINESE_SPACE_INDEX 26
- /* Begin AP Symbol table */
- U8 MMI_AP_No_Show_Symbol_List_flag = 0;
- U8 *MMI_AP_No_Show_Symbol_List[SYMBOL_PICKER_MAX_SYMBOLS];
- /* End AP Symbol table */
- const U8 *SymbolPickerSymbols[SYMBOL_PICKER_MAX_SYMBOLS] =
- {
- (U8 *) "x2e ",
- (U8 *) "x2c ",
- (U8 *) "? ",
- (U8 *) "! ",
- (U8 *) "' ",
- (U8 *) ""