PhoneSetup.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:298k
源码类别:
MTK
开发平台:
C/C++
- U32 menuItemId=-1; */
- /* 1 Call Exit Handler */
- EntryNewScreen(SCR9003_INITIALSETUP, ExitPhnsetScr, EntryPhnsetScr, NULL);
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR9003_INITIALSETUP);
- /* 3. Retrieve no of child of menu item to be displayed */
- /* diamond, 2005/07/01 add _Ext to menu item functions */
- nNumofItem = GetNumOfChild_Ext(MENU9102_INITIAL_SETUP);
- /* 4. Get attribute of menu to be displayed */
- nDispAttribute = GetDispAttributeOfItem(MENU9102_INITIAL_SETUP);
- /* 5. Retrieve string ids in sequence of given menu item to be displayed */
- /* diamond, 2005/07/01 add _Ext to menu item functions */
- GetSequenceStringIds_Ext(MENU9102_INITIAL_SETUP, nStrItemList);
- /* 6 Set current parent id */
- SetParentHandler(MENU9102_INITIAL_SETUP);
- /* 7 Register highlight handler to be called in menu screen */
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- /* 8 Construct the Hints List */
- ConstructHintsList(MENU9102_INITIAL_SETUP, ItemType);
- #ifdef __MMI_PHNSET_TWO_LINE_MENUITEM_DISPLAY__
- if (!guiBuffer)
- {
- mmi_phnset_2line_read_setting();
- }
- is_inline_menu_exist = 1;
- wgui_set_pfn_to_get_display_style(mmi_phnset_2line_get_display_style);
- wgui_set_pfn_to_get_current_menu_item_properties(mmi_phnset_2line_get_menuitem_properties);
- #endif /* __MMI_PHNSET_TWO_LINE_MENUITEM_DISPLAY__ */
- ShowCategory52Screen(
- STR_MENU9102_INITIAL_SETUP,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (PU16) gIndexIconsImageList,
- ItemType,
- 0,
- 0,
- guiBuffer);
- /* 9.Register function with right softkey */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- #ifndef __MMI_PHNSET_TWO_LINE_MENUITEM_DISPLAY__
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * ExitPhnsetScr
- * DESCRIPTION
- * This function is Exit function for Phonesetup
- * Following functions:
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ExitPhnsetScr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- #if ( defined(__MMI_NITZ__) && !defined(__MMI_AUTOTIMEZONE_IN_DATEANDTIME__))
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Only Write To NVRAM if the value is changes for ON/OFF Keys */
- if (g_phnset_cntx_p->NITZDirtyFlag == TRUE)
- {
- WriteValue(NVRAM_SETTING_AUTOUPDATE_DT_TIME, &(g_phnset_cntx_p->curNITZStatus), DS_BYTE, &error);
- g_phnset_cntx_p->NITZDirtyFlag = FALSE;
- }
- #endif /* ( defined(__MMI_NITZ__) && !defined(__MMI_AUTOTIMEZONE_IN_DATEANDTIME__)) */
- #ifdef __MMI_PHNSET_TWO_LINE_MENUITEM_DISPLAY__
- is_inline_menu_exist = 0;
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetScr
- * DESCRIPTION
- * This function is highlight handler for Phonesetup
- * Follow functions: EntryPhnsetScr
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetScr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 1 Change left soft key icon and label */
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- /* 2 Change right soft key icon and label */
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- /* 3 Register function for left soft key */
- SetLeftSoftkeyFunction(EntryPhnsetScr, KEY_EVENT_UP);
- SetKeyHandler(EntryPhnsetScr, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- /* 4 Register function for right soft key */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /* Robin 0603: G12C request -- Add Display Setup menu */
- #ifdef __MMI_DISP_SETUP_LEVEL_UP__
- /*****************************************************************************
- * FUNCTION
- * HighlightDispSetup
- * DESCRIPTION
- * This function is highlight handler for Display Setup menu item (same level with pPhone Setup)
- * Follow functions:
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightDispSetup(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Change right soft key icon and label */
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- /* Register function for left soft key */
- SetLeftSoftkeyFunction(EntryDispSetup, KEY_EVENT_UP);
- SetKeyHandler(EntryDispSetup, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- /* Register function for right soft key */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryDispSetup
- * DESCRIPTION
- * This function is Entry function for Display Setup
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EntryDispSetup(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[MAX_SUB_MENUS]; /* Stores the strings id of submenus returned */
- U16 nNumofItem; /* Stores no of children in the submenu */
- U16 nDispAttribute; /* Stores display attribue */
- U8 *guiBuffer; /* Buffer holding history data */
- U8 *ItemType[MAX_SUB_MENUS];
- U32 maskingByte = -1;
- U32 menuItemId = -1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 1 Call Exit Handler */
- EntryNewScreen(SCR_DISP_SETUP, NULL, EntryDispSetup, NULL);
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_DISP_SETUP);
- /* 3. Retrieve no of child of menu item to be displayed */
- nNumofItem = GetNumOfChild(MENU_DISP_SETUP);
- /* 4. Get attribute of menu to be displayed */
- nDispAttribute = GetDispAttributeOfItem(MENU_DISP_SETUP);
- /* 5. Retrieve string ids in sequence of given menu item to be displayed */
- GetSequenceStringIds(MENU_DISP_SETUP, nStrItemList);
- /* 6 Set current parent id */
- SetParentHandler(MENU_DISP_SETUP);
- /* 7 Register highlight handler to be called in menu screen */
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- /* 8 Construct the Hints List */
- ConstructHintsList(MENU_DISP_SETUP, ItemType);
- ShowCategory52Screen(
- STR_DISP_SETUP,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (PU16) gIndexIconsImageList,
- ItemType,
- 0,
- 0,
- guiBuffer);
- /* 9.Register function with right softkey */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- /* 10. Register Exit handler */
- //SetExitHandler(SCR9003_INITIALSETUP, ExitPhnsetScr);
- //SetGenericExitHandler( SCR_DISP_SETUP, NULL, EntryDispSetup);
- }
- #endif /* __MMI_DISP_SETUP_LEVEL_UP__ */
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetIdleScrDisp
- * DESCRIPTION
- * This function is highlight handler for Phonesetup-> IdleScreenDisplay
- * Follow functions:
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetIdleScrDisp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Change right soft key icon and label */
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- /* Register function for left soft key */
- SetLeftSoftkeyFunction(EntryPhnsetIdleScrDisp, KEY_EVENT_UP);
- SetKeyHandler(EntryPhnsetIdleScrDisp, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- /* Register function for right soft key */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPhnsetIdleScrDisp
- * DESCRIPTION
- * This function is Exit function for Phonesetup->IdleScreenDisplay
- * Following functions:
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPhnsetIdleScrDisp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[MAX_SUB_MENUS]; /* Stores the strings id of submenus returned */
- U16 nNumofItem; /* Stores no of children in the submenu */
- U16 nDispAttribute; /* Stores display attribue */
- U8 *guiBuffer; /* Buffer holding history data */
- U8 *IdleScrDispType[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Call Exit Handler */
- EntryNewScreen(SCR_IDLE_SCR_DISP, ExitPhnsetIdleScrDisp, EntryPhnsetIdleScrDisp, NULL);
- /* Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_IDLE_SCR_DISP);
- /* Retrieve no of child of menu item to be displayed */
- nNumofItem = GetNumOfChild_Ext(MENU_IDLE_SCR_DISP);
- /* Get attribute of menu to be displayed */
- nDispAttribute = GetDispAttributeOfItem(MENU_IDLE_SCR_DISP);
- /* Retrieve string ids in sequence of given menu item to be displayed */
- GetSequenceStringIds_Ext(MENU_IDLE_SCR_DISP, nStrItemList);
- /* Set current parent id */
- SetParentHandler(MENU_IDLE_SCR_DISP);
- /* Register highlight handler to be called in menu screen */
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- /* If Screen Saver is Off then Set The HintHnadler to NULL instead of
- passing empty screen */
- if (PhnsetGetCurScrSvrStatus() != SET_SS_STATUS_OFF)
- {
- SetHintHandler(MENU_SETTING_SCR_SVR, HintPhnsetScreenSaver);
- }
- else
- {
- SetHintHandler(MENU_SETTING_SCR_SVR, NULL);
- }
- /* Constrct Hint for Idle Screen Display */
- ConstructHintsList(MENU_IDLE_SCR_DISP, IdleScrDispType);
- /* Display Category Screen */
- ShowCategory52Screen(
- STR_IDLE_SCR_DISP,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (PU16) gIndexIconsImageList,
- IdleScrDispType,
- 0,
- 0,
- guiBuffer);
- /* Register function with softkey */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ExitPhnsetIdleScrDisp
- * DESCRIPTION
- * This function is Exit function for Phonesetup->IdleScreenDisplay
- * Functionality: Save 1. Save Owner number 2. Show date and time status
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ExitPhnsetIdleScrDisp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Save NVRAM only when value is changed for date time and
- own type on idle screen */
- if (g_phnset_cntx_p->ShowDtDirtyFlag == TRUE)
- {
- WriteValue(NVRAM_SETTING_STATUS_DT_TIME, &(g_phnset_cntx_p->curShowDtStatus), DS_BYTE, &error);
- g_phnset_cntx_p->ShowDtDirtyFlag = FALSE;
- }
- if (g_phnset_cntx_p->ShowOwnNumDirtyFlag == TRUE)
- {
- WriteValue(NVRAM_SETTING_OWNER_NO, &(g_phnset_cntx_p->curShowOwnNumStatus), DS_BYTE, &error);
- g_phnset_cntx_p->ShowOwnNumDirtyFlag = FALSE;
- }
- /* Lisen 0921-1 */
- #if defined(__MMI_OPERATOR_NAME_MENU__)
- if (g_phnset_cntx_p->ShowOPNDirtyFlag == TRUE)
- {
- WriteValue(NVRAM_SETTING_OPN_DISPLAY, &(g_phnset_cntx_p->curShowOPNStatus), DS_BYTE, &error);
- g_phnset_cntx_p->ShowOPNDirtyFlag = FALSE;
- }
- #endif /* defined(__MMI_OPERATOR_NAME_MENU__) */
- }
- #ifdef __MMI_MAINMENU_STYLE_CHANGE_EN__
- /*****************************************************************************
- * FUNCTION
- * HintPhnsetMainMenuStyle
- * DESCRIPTION
- * This function is Hint handler for Phonesetup->IdleScreenDisplay --> Mainmenu style
- * Follow functions:
- * PARAMETERS
- * index [IN]
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintPhnsetMainMenuStyle(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PS8 p = NULL;
- U8 style = PhnsetGetMainMenuStyle();
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (style)
- {
- #ifdef __MMI_MAINMENU_MATRIX_SUPPORT__ /* 071705 Calvin added */
- case PHNSET_MAINMENU_STYLE_MATRIX:
- p = GetString(STR_MAINMENU_STYLE_MATRIX);
- break;
- #endif /* __MMI_MAINMENU_MATRIX_SUPPORT__ */
- #ifdef __MMI_MAINMENU_PAGE_SUPPORT__ /* 071705 Calvin added */
- case PHNSET_MAINMENU_STYLE_PAGE:
- p = GetString(STR_MAINMENU_STYLE_PAGE);
- break;
- #endif /* __MMI_MAINMENU_PAGE_SUPPORT__ */
- #ifdef __MMI_MAINMENU_LIST_SUPPORT__ /* 071705 Calvin added */
- case PHNSET_MAINMENU_STYLE_LIST:
- p = GetString(STR_MAINMENU_STYLE_LIST);
- break;
- #endif /* __MMI_MAINMENU_LIST_SUPPORT__ */
- #ifdef __MMI_MAINMENU_CIRCULAR_SUPPORT__ /* 071705 Calvin modified */
- case PHNSET_MAINMENU_STYLE_CIRCULE:
- p = GetString(STR_MAINMENU_STYLE_CIRCULAR);
- break;
- #endif /* __MMI_MAINMENU_CIRCULAR_SUPPORT__ */
- #ifdef __MMI_MAINMENU_ROTATE_SUPPORT__
- case PHNSET_MAINMENU_STYLE_ROTATE:
- p = GetString(STR_MAINMENU_STYLE_ROTATE); /* PDG1 Manish */
- break;
- #endif /* __MMI_MAINMENU_ROTATE_SUPPORT__ */
- #ifdef __MMI_MAINMENU_TAB_SUPPORT__ /* 071705 Calvin modified */
- case PHNSET_MAINMENU_STYLE_TAB:
- p = GetString(STR_MAINMENU_STYLE_TAB);
- break;
- #endif /* __MMI_MAINMENU_TAB_SUPPORT__ */
- default:
- p = GetString(STR_GLOBAL_EMPTY);
- break;
- }
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) p);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetMainMenuStyle
- * DESCRIPTION
- * This function is Highlight handler for Phonesetup->IdleScreenDisplay --> Mainmenu style
- * Follow functions: EntryPhnsetMainMenuStyle
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetMainMenuStyle(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Change right soft key icon and label */
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- /* Register function for left soft key */
- SetLeftSoftkeyFunction(EntryPhnsetMainMenuStyle, KEY_EVENT_UP);
- SetKeyHandler(EntryPhnsetMainMenuStyle, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- /* Register function for right soft key */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPhnsetMainMenuStyle
- * DESCRIPTION
- * This function is Entry function for Phonesetup->IdleScreenDisplay --> Main Menu Style
- * Following functions: HighlightPhnsetMainMenuStyleSelect
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPhnsetMainMenuStyle(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[MAX_SUB_MENUS]; /* Stores the strings id of submenus returned */
- U16 nNumofItem; /* Stores no of children in the submenu */
- U16 nDispAttribute; /* Stores display attribue */
- U8 *guiBuffer; /* Buffer holding history data */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- //S16 Err=0;
- //U8 *IdleScrDispType[MAX_SUB_MENUS];
- /* Call Exit Handler */
- EntryNewScreen(SCR_MAINMENU_STYLE, NULL, EntryPhnsetMainMenuStyle, NULL);
- /* Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_MAINMENU_STYLE);
- /* Retrieve no of child of menu item to be displayed */
- nNumofItem = GetNumOfChild(MENU_SETTING_MAINMENU_STYLE);
- /* Get attribute of menu to be displayed */
- nDispAttribute = GetDispAttributeOfItem(MENU_SETTING_MAINMENU_STYLE);
- /* Retrieve string ids in sequence of given menu item to be displayed */
- GetSequenceStringIds(MENU_SETTING_MAINMENU_STYLE, nStrItemList);
- /* Set current parent id */
- SetParentHandler(MENU_SETTING_MAINMENU_STYLE);
- /* Register highlight handler to be called in menu screen */
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- /* Display Category Screen */
- ShowCategory11Screen(
- STR_MAINMENU_STYLE,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- g_phnset_cntx_p->MenuStyle,
- guiBuffer);
- /* Register function with softkey */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetMainMenuStyleSelect
- * DESCRIPTION
- * This function is Highlight handler for Phonesetup->IdleScreenDisplay --> Mainmenu style
- * Follow functions: PhnsetMainMenuStyleSelectLskHdlr
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetMainMenuStyleSelect(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Change right soft key icon and label */
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- /* Register function for left soft key */
- SetLeftSoftkeyFunction(PhnsetMainMenuStyleSelectLskHdlr, KEY_EVENT_UP);
- /* Register function for right soft key */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetMainMenuStyleSelectLskHdlr
- * DESCRIPTION
- * This function is left softkey handling function
- * for Phonesetup->IdleScreenDisplay -> MainMenu style -> Select
- * Functionality: Save the setting menu style
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetMainMenuStyleSelectLskHdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 HighlightItem = 0;
- S16 Err;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- HighlightItem = (U8) GetHighlightedItem();
- if (g_phnset_cntx_p->MenuStyle != HighlightItem)
- {
- g_phnset_cntx_p->MenuStyle = HighlightItem;
- WriteValue(NVRAM_SET_MAINMENU_STYLE, &(g_phnset_cntx_p->MenuStyle), DS_BYTE, &Err);
- }
- DisplayPopup((U8*) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, 2000, SUCCESS_TONE);
- DeleteNScrId(SCR_MAINMENU_STYLE);
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetMainMenuStyle
- * DESCRIPTION
- * This function is to get setting main menu style
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- U8 PhnsetGetMainMenuStyle(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return g_phnset_cntx_p->MenuStyle;
- }
- #endif /* __MMI_MAINMENU_STYLE_CHANGE_EN__ */
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetShowDtTime
- * DESCRIPTION
- * This function is highlight handler for Phonesetup->IdleScreenDisplay-> Show Date and Time
- * Follow functions:
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetShowDtTime(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* If Show Date Time if On Show LSK as OFF otherwise On. */
- if (g_phnset_cntx_p->curShowDtStatus)
- {
- ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
- }
- else
- {
- ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
- }
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(PhnsetToggleShowDtTime, KEY_EVENT_UP);
- SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetToggleShowDtTime
- * DESCRIPTION
- * This function is Left softkey handler
- * for Phonesetup->IdleScreenDisplay-> Show Date and Time
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetToggleShowDtTime(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- index = GetCurrHiliteID();
- /* if show date time is on chnage it off */
- if (g_phnset_cntx_p->curShowDtStatus)
- {
- g_phnset_cntx_p->curShowDtStatus = 0;
- }
- /* else chnage it on */
- else
- {
- g_phnset_cntx_p->curShowDtStatus = 1;
- }
- /* Flag to Indicate Value is changed, will be used on exit Handler of menu */
- g_phnset_cntx_p->ShowDtDirtyFlag = TRUE;
- if (g_phnset_cntx_p->curShowDtStatus)
- {
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
- Category52ChangeItemDescription(index, hintData[index]);
- ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
- }
- else
- {
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
- Category52ChangeItemDescription(index, hintData[index]);
- ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
- }
- /* Redraw the Category Screen As Hint Handler and LSK are going to Chnage */
- RedrawCategoryFunction();
- /* After redraw hight the ShowDateTime */
- HighlightPhnsetShowDtTime();
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetShowOwnNo
- * DESCRIPTION
- * This function is highlight handler for Phonesetup->IdleScreenDisplay->Show Owner Number
- * Follow functions:
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetShowOwnNo(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- index = GetCurrHiliteID();
- /* If Owner Number Is On Change The LSK to OFF otherwise ON. */
- if (g_phnset_cntx_p->curShowOwnNumStatus == 1)
- {
- ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
- }
- else
- {
- ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
- }
- /* Change right soft key icon and label */
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(PhnsetToggleShowOwnNo, KEY_EVENT_UP);
- SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- /* Register function for right soft key */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetToggleShowOwnNo
- * DESCRIPTION
- * This function is Left softkey handler
- * for Phonesetup->IdleScreenDisplay-> Show owner number
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetToggleShowOwnNo(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- index = GetCurrHiliteID();
- /* If Own Number Display if Off then turn it On Pressing LSK */
- if (g_phnset_cntx_p->curShowOwnNumStatus == 0)
- {
- g_phnset_cntx_p->curShowOwnNumStatus = 1;
- }
- else
- {
- g_phnset_cntx_p->curShowOwnNumStatus = 0;
- }
- /* Flag to write NVRAM in Exit Handler */
- g_phnset_cntx_p->ShowOwnNumDirtyFlag = TRUE;
- if (g_phnset_cntx_p->curShowOwnNumStatus)
- {
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
- Category52ChangeItemDescription(index, hintData[index]);
- ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
- }
- else
- {
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
- Category52ChangeItemDescription(index, hintData[index]);
- ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
- }
- RedrawCategoryFunction();
- HighlightPhnsetShowOwnNo();
- }
- /* Lisen 0921-1 */
- #if defined(__MMI_OPERATOR_NAME_MENU__)
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetShowOPN
- * DESCRIPTION
- * This function is highlight handler for Phonesetup->IdleScreenDisplay->Show Operator Name
- * Follow functions:
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetShowOPN(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- index = GetCurrHiliteID();
- /* If Owner Number Is On Change The LSK to OFF otherwise ON. */
- if (g_phnset_cntx_p->curShowOPNStatus == 1)
- {
- ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
- }
- else
- {
- ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
- }
- /* Change right soft key icon and label */
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(PhnsetToggleShowOPN, KEY_EVENT_UP);
- SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- /* Register function for right soft key */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetToggleShowOPN
- * DESCRIPTION
- * This function is Left softkey handler
- * for Phonesetup->IdleScreenDisplay-> Show Operator Name
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetToggleShowOPN(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- index = GetCurrHiliteID();
- /* If Own Number Display if Off then turn it On Pressing LSK */
- if (g_phnset_cntx_p->curShowOPNStatus == 0)
- {
- g_phnset_cntx_p->curShowOPNStatus = 1;
- }
- else
- {
- g_phnset_cntx_p->curShowOPNStatus = 0;
- }
- /* Flag to write NVRAM in Exit Handler */
- g_phnset_cntx_p->ShowOPNDirtyFlag = TRUE;
- if (g_phnset_cntx_p->curShowOPNStatus)
- {
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
- Category52ChangeItemDescription(index, hintData[index]);
- ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
- }
- else
- {
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
- Category52ChangeItemDescription(index, hintData[index]);
- ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
- }
- RedrawCategoryFunction();
- HighlightPhnsetShowOPN();
- }
- #endif /* defined(__MMI_OPERATOR_NAME_MENU__) */
- /*****************************************************************************
- * FUNCTION
- * PhnsetSetShowDTStatus
- * DESCRIPTION
- * This function is to set show data time statu on/off
- * Follow functions:
- * PARAMETERS
- * status [IN]
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetSetShowDTStatus(U8 status)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->curShowDtStatus = status;
- }
- /*
- * ( Phonesetup-> SpeedDial -> Set Number ) functions are in speedDial.c
- */
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetWelcomeText
- * DESCRIPTION
- * This function is highlight handler for Phonesetup-> Greeting Text
- * Follow functions:
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetWelcomeText(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Change left soft key icon and label */
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- /* Change right soft key icon and label */
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- /* Register function for left soft key */
- SetLeftSoftkeyFunction(EntryPhnsetWelcomeText, KEY_EVENT_UP);
- SetKeyHandler(EntryPhnsetWelcomeText, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- /* Register function for right soft key */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetFillWelcomeInlineEditStruct
- * DESCRIPTION
- * This function is to fill inline editor screen for Phonesetup-> Greeting Text
- * PARAMETERS
- * pInlineStruct [?]
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- static void PhnsetFillWelcomeInlineEditStruct(void *pInlineStruct)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 *WelcomeString = NULL;
- InlineItem *InlineStruct = (InlineItem*) pInlineStruct;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- WelcomeString = GetWelcomeText();
- /* CurrSelect */
- g_phnset_cntx_p->curHightlightItem = (U32) IsShowWelcomeScr1();
- pfnUnicodeStrncpy((S8*) WelcomeText, WelcomeString, MAX_SETTING_WELCOME_TEXT);
- OslMfree(WelcomeString);
- greet_text_on_off[1] = (U8*) GetString(STR_GLOBAL_ON);
- greet_text_on_off[0] = (U8*) GetString(STR_GLOBAL_OFF);
- SetInlineItemActivation(&InlineStruct[0], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemCaption(&InlineStruct[0], (PU8) (U8*) GetString(STR_MENU9146_OFF));
- SetInlineItemActivation(&InlineStruct[2], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemCaption(&InlineStruct[2], (PU8) (U8*) GetString(STR_MENU9146_ON));
- SetInlineItemActivation(&InlineStruct[1], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemSelect(
- &InlineStruct[1],
- 2,
- greet_text_on_off,
- (S32*) & (g_phnset_cntx_p->curHightlightItem) /* CurrSelect */ );
- SetInlineItemActivation(&InlineStruct[3], KEY_LSK, KEY_EVENT_UP);
- /* disable new line */
- SetInlineItemFullScreenEdit_ext(
- &InlineStruct[3],
- STR_MENU9146_WELCOME_TEXT,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- (PU8) WelcomeText,
- MAX_SETTING_WELCOME_TEXT + 1,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE,
- INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
- SetInlineFullScreenEditCustomFunction(&InlineStruct[3], SettingInlineCustomFunction);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPhnsetWelcomeText
- * DESCRIPTION
- * This function is Entry function for Phonesetup-> Greeting Text
- * Following functions: EntryWelcomeTextOn
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPhnsetWelcomeText(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nNumofItem = 4; /* Stores no of children in the submenu */
- U8 *inputBuffer; /* added for inline edit history */
- U8 *guiBuffer; /* Buffer holding history data */
- U16 inputBufferSize;
- U16 ItemIcons[4] = {IMG_SETTING_GREET_STATUS, 0, IMG_SETTING_GREET_TEXT, 0};
- InlineItem greet_text_inline_edit_list[4];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR9146_WELCOME_TEXT, ExitPhnsetWelcomeText, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR9146_WELCOME_TEXT);
- InitializeCategory57Screen();
- memset(greet_text_inline_edit_list, 0, sizeof(greet_text_inline_edit_list));
- PhnsetFillWelcomeInlineEditStruct((void*)greet_text_inline_edit_list);
- inputBuffer = GetCurrNInputBuffer(SCR9146_WELCOME_TEXT, &inputBufferSize); /* added for inline edit history */
- if (inputBuffer != NULL)
- {
- SetCategory57Data(greet_text_inline_edit_list, nNumofItem, inputBuffer);
- }
- ClearHighlightHandler();
- ShowCategory57Screen(
- STR_MENU9146_WELCOME_TEXT,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- ItemIcons,
- greet_text_inline_edit_list,
- 0,
- guiBuffer);
- /* Register function for right soft key */
- SetCategory57RightSoftkeyFunctions(EntryPhnsetWelcomeTextDoneHdlr, GoBackHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * ExitPhnsetWelcomeText
- * DESCRIPTION
- * This function is Exit function for Phonesetup-> Greeting Text
- * Following functions:
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ExitPhnsetWelcomeText(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history Scr;
- S16 nHistory = 0;
- U16 inputBufferSize; /* added for inline edit history */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Scr.scrnID = SCR9146_WELCOME_TEXT;
- CloseCategory57Screen();
- Scr.entryFuncPtr = EntryPhnsetWelcomeText;
- pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) & nHistory);
- GetCategory57History(Scr.guiBuffer);
- inputBufferSize = (U16) GetCategory57DataSize(); /* added for inline edit history */
- GetCategory57Data((U8*) Scr.inputBuffer); /* added for inline edit history */
- AddNHistory(Scr, (U16) inputBufferSize); /* added for inline edit history */
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPhnsetWelcomeTextDoneHdlr
- * DESCRIPTION
- * This function is done key handler for Phonesetup-> Greeting Text -> Done
- * Functionality: Query Yes/No
- * Following functions: PhnsetWelcomeTextDoneLskHdlr
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPhnsetWelcomeTextDoneHdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer; /* Buffer holding history data */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Call Exit Handler */
- EntryNewScreen(SCR9146_WELCOME_TEXT_ON, NULL, NULL, NULL);
- /* Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR9146_WELCOME_TEXT_ON);
- /* Display Category1 Screen */
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- (PU16) GetString(STR_GLOBAL_SAVE),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetLeftSoftkeyFunction(PhnsetWelcomeTextDoneLskHdlr, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBack2TheHistory, KEY_EVENT_UP);
- /* Play warning tone */
- playRequestedTone(WARNING_TONE);
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetWelcomeTextDoneLskHdlr
- * DESCRIPTION
- * This function is Left softkey handler
- * for Phonesetup-> Greeting Text -> Done -> Yes
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetWelcomeTextDoneLskHdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* ExecuteCurrExitHandler(); */
- ClearInputEventHandler(MMI_DEVICE_ALL);
- ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
- WriteValue(
- NVRAM_SETTING_WELCOME_TEXT,
- (U8*) & (g_phnset_cntx_p->curHightlightItem) /* CurrSelect */ ,
- DS_BYTE,
- &error);
- WriteRecord(
- NVRAM_EF_SETTING_LID,
- 1,
- (void*)WelcomeText,
- (U16) (MAX_SETTING_WELCOME_TEXT * ENCODING_LENGTH),
- &error);
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* 0 */
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, SUCCESS_TONE);
- DeleteNHistory(1);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightSPOF
- * DESCRIPTION
- * This function is Highlight handler for Phonesetup->IdleScreenDisplay --> Mainmenu style
- * Follow functions: EntryPhnsetMainMenuStyle
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightSPOF(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 1 Change left soft key icon and label */
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- /* 2 Change right soft key icon and label */
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- /* 3 Register function for left soft key */
- #ifdef MMI_ON_HARDWARE_P
- SetLeftSoftkeyFunction(EntrySpofApp, KEY_EVENT_UP);
- SetKeyHandler(EntrySpofApp, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- #else /* MMI_ON_HARDWARE_P */
- SetLeftSoftkeyFunction(PopupNoSupport, KEY_EVENT_UP);
- SetKeyHandler(PopupNoSupport, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- #endif /* MMI_ON_HARDWARE_P */
- /* 4 Register function for right soft key */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*
- * ( Phonesetup-> SPOF ) functions are in ScheduledPowerOnOff.c
- */
- /*
- * Query function begin:
- */
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetShowOwnerNumStatus
- * DESCRIPTION
- * This function is to get show owner number on/off status
- * Functionality:
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- MMI_BOOL PhnsetGetShowOwnerNumStatus(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 data = 0;
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ReadValue(NVRAM_SETTING_OWNER_NO, &data, DS_BYTE, &error);
- if (data == 1)
- {
- return MMI_TRUE;
- }
- else
- {
- return MMI_FALSE;
- }
- }
- /* Lisen 0921-1 */
- #if defined(__MMI_OPERATOR_NAME_MENU__)
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetShowOPNStatus
- * DESCRIPTION
- * This function is to get show owner number on/off status
- * Functionality:
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- MMI_BOOL PhnsetGetShowOPNStatus(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 data = 0;
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ReadValue(NVRAM_SETTING_OPN_DISPLAY, &data, DS_BYTE, &error);
- if (data == 0)
- {
- return MMI_FALSE;
- }
- else
- {
- return MMI_TRUE;
- }
- }
- #endif /* defined(__MMI_OPERATOR_NAME_MENU__) */
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetShowDateTimeStatus
- * DESCRIPTION
- * This function is to get show date/time on/off status
- * Functionality:
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- MMI_BOOL PhnsetGetShowDateTimeStatus(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 data = 0;
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ReadValue(NVRAM_SETTING_STATUS_DT_TIME, &data, DS_BYTE, &error);
- if (data == 0)
- {
- return MMI_FALSE;
- }
- else
- {
- return MMI_TRUE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetSetWelcomeText
- * DESCRIPTION
- * This function is to set welcome text for AT command
- * Functionality:
- * PARAMETERS
- * mode [IN]
- * dcs [IN]
- * text [?]
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- MMI_BOOL PhnsetSetWelcomeText(MMI_BOOL mode, U8 dcs, U8 *text, U8 length)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- S32 AtMode;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (length != 0xFF)
- {
- U8 AtWelcomeText[(MAX_SETTING_WELCOME_TEXT + 1) * ENCODING_LENGTH];
- memset(AtWelcomeText, 0, sizeof(AtWelcomeText));
- if (dcs == L4_ASCII)
- {
- AnsiiNToUnicodeString((S8*) AtWelcomeText, (S8*) text, MAX_SETTING_WELCOME_TEXT);
- }
- else if (dcs == L4_UCS2)
- {
- memcpy(AtWelcomeText, text, sizeof(AtWelcomeText));
- }
- WriteRecord(
- NVRAM_EF_SETTING_LID,
- 1,
- (void*)AtWelcomeText,
- (U16) (MAX_SETTING_WELCOME_TEXT * ENCODING_LENGTH),
- &error);
- if (error != NVRAM_WRITE_SUCCESS)
- {
- return MMI_FALSE;
- }
- }
- if (mode == 0)
- {
- AtMode = 0;
- }
- else
- {
- AtMode = 1;
- }
- WriteValue(NVRAM_SETTING_WELCOME_TEXT, (U8*) & AtMode, DS_BYTE, &error);
- if (error != NVRAM_WRITE_SUCCESS)
- {
- return MMI_FALSE;
- }
- return MMI_TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetWelcomeText
- * DESCRIPTION
- * This function is to get welcome text for AT command
- * Functionality:
- * PARAMETERS
- * buf [?]
- * buf_size [IN]
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetGetWelcomeText(S8 *buf, U16 buf_size)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- U8 data[(MAX_SETTING_WELCOME_TEXT + 1) * ENCODING_LENGTH];
- U16 max_buf_size;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(data, 0, sizeof(data));
- ReadRecord(NVRAM_EF_SETTING_LID, 1, data, (MAX_SETTING_WELCOME_TEXT * ENCODING_LENGTH), &error);
- if (buf_size < (MAX_SETTING_WELCOME_TEXT + 1) * ENCODING_LENGTH)
- {
- max_buf_size = buf_size;
- }
- else
- {
- max_buf_size = (MAX_SETTING_WELCOME_TEXT + 1) * ENCODING_LENGTH;
- }
- memset(buf, 0, buf_size);
- if (data[0] != 0xFF)
- {
- memcpy(buf, data, (max_buf_size - ENCODING_LENGTH));
- }
- }
- /*
- * Hint Handler begin:
- */
- /*****************************************************************************
- * FUNCTION
- * HintPhnsetLanguage
- * DESCRIPTION
- * This function is hint handling function
- * for Phonesetup -> Language
- * Functionality:
- * PARAMETERS
- * index [IN]
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintPhnsetLanguage(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- U8 data = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ReadValue(NVRAM_SETTING_LANG, &data, DS_BYTE, &error);
- #ifdef __MMI_AUTO_LANG_EN__
- if (data == 0xFF) /* Auto Language Selected */
- {
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_LANGUAGESCR_AUTO));
- }
- else
- #endif /* __MMI_AUTO_LANG_EN__ */
- {
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) gLanguageArray[data].aName);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * HintPhnsetPreferedInputMethod
- * DESCRIPTION
- * This function is hint handling function
- * for Phonesetup -> Language
- * Functionality:
- * PARAMETERS
- * index [IN]
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_PREFER_INPUT_METHOD__
- void HintPhnsetPreferedInputMethod(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- U16 data = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ReadValue(NVRAM_SETTING_PREFER_INPUT_METHOD, &data, DS_SHORT, &error);
- InitPreferedInputMethod();
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) inputMethodList[GetInputMethodIndex(data)]);
- }
- #endif /* __MMI_PREFER_INPUT_METHOD__ */
- #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
- /*****************************************************************************
- * FUNCTION
- * HighlightHandwritingSetting
- * DESCRIPTION
- * This function is highlight handler for Handwriting setting screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightHandwritingSetting(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(EntryHandWritingSettingScr, KEY_EVENT_UP);
- SetKeyHandler(EntryHandWritingSettingScr, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightCalibrationSetting
- * DESCRIPTION
- * This function is highlight handler for Calibration setting screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightCalibrationSetting(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(EntryCalibrationSettingScr, KEY_EVENT_UP);
- SetKeyHandler(EntryCalibrationSettingScr, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * SaveHandwritingSetting
- * DESCRIPTION
- * This function saves pen setting in Settings->PhoneSetup->PenSetting screen
- * Functionality:
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SaveHandwritingSetting(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 pError;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->pen_speed = gInlinePenSpeed;
- g_phnset_cntx_p->pen_color = gInlinePenColorIndex;
- WriteValue(NVRAM_PEN_SPEED, &(g_phnset_cntx_p->pen_speed), DS_BYTE, &pError);
- if (pError != NVRAM_WRITE_SUCCESS)
- {
- PRINT_INFORMATION(("NVRAM PenSetting Write Failed. Error -%d", pError));
- }
- WriteValue(NVRAM_PEN_COLOR, &(g_phnset_cntx_p->pen_color), DS_BYTE, &pError);
- if (pError != NVRAM_WRITE_SUCCESS)
- {
- PRINT_INFORMATION(("NVRAM Pen Setting Write Failed. Error -%d", pError));
- }
- GoBeyondMarkerScr(SCR_HANDWRITING_SETTING);
- }
- /*****************************************************************************
- * FUNCTION
- * GoBackHandwritingSettingConfirm
- * DESCRIPTION
- * This function exits pen setting screen when user doesn't save pen settings after changing in Settings->PhoneSetup->PenSetting screen
- * Functionality:
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void GoBackHandwritingSettingConfirm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GoBeyondMarkerScr(SCR_HANDWRITING_SETTING);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrHandwritingSettingConfirm
- * DESCRIPTION
- * This function displays pop up to confirm pen settings change before saving them in Settings->PhoneSetup->PenSetting screen
- * Functionality:
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrHandwritingSettingConfirm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_GLOBAL_SAVE),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetLeftSoftkeyFunction(SaveHandwritingSetting, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHandwritingSettingConfirm, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HandwritingSettingInlineColor
- * DESCRIPTION
- * This function updates softkey and iInlinePen color according to change in Pen Color
- * PARAMETERS
- * index [IN]
- * a(?) [IN]
- * b(?) [OUT]
- * RETURNS
- * void
- *****************************************************************************/
- void HandwritingSettingInlineColor(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (index < MAX_PEN_COLORS)
- {
- if (index != gInlinePenColorIndex)
- {
- set_wgui_inline_list_menu_changed();
- }
- gInlinePenColorIndex = index;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryHandWritingSettingScr
- * DESCRIPTION
- * Entry function for Pen Setting Screen
- * PARAMETERS
- * void
- * a(?) [IN]
- * b(?) [OUT]
- * RETURNS
- * void
- *****************************************************************************/
- void EntryHandWritingSettingScr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U8 *inputBuffer;
- U16 inputBufferSize;
- U16 list_of_icons[4];
- S32 iCount;
- S16 item_offset = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_HANDWRITING_SETTING, ExitHandWritingSettingScr, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_HANDWRITING_SETTING);
- inputBuffer = GetCurrNInputBuffer(SCR_HANDWRITING_SETTING, &inputBufferSize);
- for (iCount = 0; iCount < MAX_PEN_SPEED; ++iCount)
- {
- g_pen_speed_str_list[iCount] = (U8*) GetString((U16) (iCount + STR_HANDWRITING_FAST));
- }
- gInlinePenSpeed = g_phnset_cntx_p->pen_speed;
- gInlinePenColorIndex = g_phnset_cntx_p->pen_color;
- /* start of Category 57 */
- InitializeCategory57Screen();
- /* Pen speed */
- SetInlineItemCaption(&wgui_inline_items[item_offset++], (PU8) GetString(STR_HANDWRITING_PEN_SPEED));
- SetInlineItemActivation(&wgui_inline_items[item_offset], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemSelect(&wgui_inline_items[item_offset++], MAX_PEN_SPEED, g_pen_speed_str_list, &gInlinePenSpeed);
- /* Pen Color */
- SetInlineItemCaption(&wgui_inline_items[item_offset++], (PU8) GetString(STR_HANDWRITING_PEN_COLOR));
- SetInlineItemActivation(&wgui_inline_items[item_offset], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemColorSelect(
- &wgui_inline_items[item_offset++],
- MAX_PEN_COLORS,
- (U16) gInlinePenColorIndex,
- (color*) g_pen_color_list,
- HandwritingSettingInlineColor);
- if (inputBuffer != NULL)
- {
- SetCategory57Data(wgui_inline_items, item_offset, inputBuffer);
- }
- list_of_icons[0] = IMG_GLOBAL_L1;
- list_of_icons[1] = 0;
- list_of_icons[2] = IMG_GLOBAL_L2;
- list_of_icons[3] = 0;
- ShowCategory57Screen(
- STR_HANDWRITING_SETTING,
- GetRootTitleIcon(MENU_SETTING_HANDWRITING),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- item_offset,
- list_of_icons,
- wgui_inline_items,
- 0,
- guiBuffer);
- SetCategory57RightSoftkeyFunctions(EntryScrHandwritingSettingConfirm, GoBackHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * ExitHandWritingSettingScr
- * DESCRIPTION
- * Exit function for Pen Setting Screen
- * PARAMETERS
- * void
- * a(?) [IN]
- * b(?) [OUT]
- * RETURNS
- * void
- *****************************************************************************/
- void ExitHandWritingSettingScr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history h;
- U16 inputBufferSize;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- CloseCategory57Screen();
- h.scrnID = SCR_HANDWRITING_SETTING;
- h.entryFuncPtr = EntryHandWritingSettingScr;
- GetCategoryHistory(h.guiBuffer);
- inputBufferSize = (U16) GetCategory57DataSize();
- GetCategory57Data((U8*) h.inputBuffer);
- AddNHistory(h, inputBufferSize);
- }
- /*****************************************************************************
- * FUNCTION
- * WriteNvramCalibrationData
- * DESCRIPTION
- * Writes calibration setting in NVRAM
- * PARAMETERS
- * calibration_data [IN]
- * RETURNS
- * void
- * REMARKS
- * This function assumes that NVRAM Values of Calibration data are stored in
- * a fixed order in NVRAMEnum.h file . Order should not be changed.
- *
- * It is not atomic operation between ReadRecord and WriteRecord, but it's okay.
- *****************************************************************************/
- static void WriteNvramCalibrationData(mmi_pen_calibration_struct *calibration_data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 tempBuffer[NVRAM_CACHE_SIZE];
- S16 pError = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Note: It is not atomic operation between ReadRecord and WriteRecord. */
- if (ReadRecord(NVRAM_EF_CACHE_DOUBLE_LID, 1, tempBuffer, NVRAM_CACHE_SIZE, &pError) < 0)
- {
- PRINT_INFORMATION(("Calibration NVRAM data read failed , Error = %d", (int)pError));
- /* Do some error handling */
- }
- else
- {
- S16 i, j;
- for (i = NVRAM_PEN_CALIBRATION_VALUE1, j = 0; i <= NVRAM_PEN_CALIBRATION_VALUE1 + PEN_CALIBRATION_DATA_SIZE - 1;
- i++, j++)
- {
- memcpy(&tempBuffer[i * DS_DOUBLE], &calibration_data->data[j], DS_DOUBLE);
- }
- WriteRecord(NVRAM_EF_CACHE_DOUBLE_LID, 1, tempBuffer, NVRAM_CACHE_SIZE, &pError);
- }
- g_phnset_cntx_p->is_default_calibration_set = MMI_TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * WriteNvramFactoryDefaultCalibrationData
- * DESCRIPTION
- * Writes factory default calibration setting in NVRAM
- * PARAMETERS
- * calibration_data [IN]
- * RETURNS
- * void
- * REMARKS
- * This function assumes that NVRAM Values of Calibration data are stored in
- * a fixed order in NVRAMEnum.h file . Order should not be changed.
- *
- * It is not atomic operation between ReadRecord and WriteRecord, but it's okay.
- *****************************************************************************/
- static void WriteNvramFactoryDefaultCalibrationData(mmi_pen_calibration_struct *calibration_data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 tempBuffer[NVRAM_CACHE_SIZE];
- S16 pError = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Note: It is not atomic operation between ReadRecord and WriteRecord. */
- if (ReadRecord(NVRAM_EF_CACHE_DOUBLE_LID, 1, tempBuffer, NVRAM_CACHE_SIZE, &pError) < 0)
- {
- PRINT_INFORMATION(("Calibration NVRAM data read failed , Error = %d", (int)pError));
- /* Do some error handling */
- }
- else
- {
- S16 i, j;
- for (i = NVRAM_RESTORE_DEFAULT_PEN_CALIBRATION_VALUE1, j = 0;
- i <= NVRAM_RESTORE_DEFAULT_PEN_CALIBRATION_VALUE1 + PEN_CALIBRATION_DATA_SIZE - 1; i++, j++)
- {
- memcpy(&tempBuffer[i * DS_DOUBLE], &calibration_data->data[j], DS_DOUBLE);
- }
- WriteRecord(NVRAM_EF_CACHE_DOUBLE_LID, 1, tempBuffer, NVRAM_CACHE_SIZE, &pError);
- }
- g_phnset_cntx_p->is_default_calibration_set = MMI_TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * ValidateNvramCalibrationData
- * DESCRIPTION
- * Function to validate calibration data read from NVRAM
- * PARAMETERS
- * buffer [?]
- * start_index [IN]
- * end_index [IN]
- * a(?) [IN] U8* , S16, S16
- * b(?) [OUT] BOOL
- * RETURNS
- * void
- *****************************************************************************/
- static BOOL ValidateNvramCalibrationData(U8 *buffer, S16 start_index, S16 end_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- unsigned char default_value[] = "xFFxFFxFFxFFxFFxFFxFFxFF";
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = start_index; i <= end_index; i++)
- {
- if (memcmp(&buffer[i * DS_DOUBLE], default_value, DS_DOUBLE))
- {
- return MMI_TRUE;
- }
- }
- return MMI_FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetReadNvramCalibrationData
- * DESCRIPTION
- * Function to read calibration data from NVRAM
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetReadNvramCalibrationData(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 tempBuffer[NVRAM_CACHE_SIZE];
- S16 pError = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->is_default_calibration_set = MMI_FALSE;
- if (ReadRecord(NVRAM_EF_CACHE_DOUBLE_LID, 1, tempBuffer, NVRAM_CACHE_SIZE, &pError) < 0)
- {
- PRINT_INFORMATION(("Calibration NVRAM data read failed , Error = %d", (int)pError));
- /* Do nothing, driver will take care */
- return;
- }
- else
- {
- S16 i, j;
- mmi_pen_calibration_struct calibration_data;
- if (ValidateNvramCalibrationData
- (tempBuffer, NVRAM_PEN_CALIBRATION_VALUE1, NVRAM_PEN_CALIBRATION_VALUE1 + PEN_CALIBRATION_DATA_SIZE - 1))
- {
- /* Use user-calibrated data */
- for (i = NVRAM_PEN_CALIBRATION_VALUE1, j = 0;
- i <= NVRAM_PEN_CALIBRATION_VALUE1 + PEN_CALIBRATION_DATA_SIZE - 1; i++, j++)
- {
- memcpy(&calibration_data.data[j], &tempBuffer[i * DS_DOUBLE], DS_DOUBLE);
- }
- mmi_pen_set_calibration_data(&calibration_data);
- g_phnset_cntx_p->is_default_calibration_set = MMI_TRUE;
- return;
- }
- else
- {
- /* Use factory default data */
- if (ValidateNvramCalibrationData
- (tempBuffer, NVRAM_RESTORE_DEFAULT_PEN_CALIBRATION_VALUE1,
- NVRAM_RESTORE_DEFAULT_PEN_CALIBRATION_VALUE1 + PEN_CALIBRATION_DATA_SIZE - 1))
- {
- for (i = NVRAM_RESTORE_DEFAULT_PEN_CALIBRATION_VALUE1, j = 0;
- i <= NVRAM_RESTORE_DEFAULT_PEN_CALIBRATION_VALUE1 + PEN_CALIBRATION_DATA_SIZE - 1; i++, j++)
- {
- memcpy(&calibration_data.data[j], &tempBuffer[i * DS_DOUBLE], DS_DOUBLE);
- }
- mmi_pen_set_calibration_data(&calibration_data);
- g_phnset_cntx_p->is_default_calibration_set = MMI_TRUE;
- return;
- }
- }
- PRINT_INFORMATION(("NVRAM Calibration Data not found"));
- /* Do nothing, driver will take care */
- }
- }
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* 0 */
- /*****************************************************************************
- * FUNCTION
- * CalibrationSettingRestoreData
- * DESCRIPTION
- * Restores calibration setting if user is not able to set calibration data properly
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void CalibrationSettingRestoreData(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_pen_set_calibration_data(&g_phnset_calibration_cntx_p->backup_data);
- }
- /*****************************************************************************
- * FUNCTION
- * CalibrationSettingPenDown
- * DESCRIPTION
- * PenDown Handler for Calibration Setting Screen
- * PARAMETERS
- * point [IN]
- * RETURNS
- * void
- *****************************************************************************/
- static void CalibrationSettingPenDown(mmi_pen_point_struct point)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (g_phnset_calibration_screen_state)
- {
- case CALIBRATION_WELCOME_STATE:
- g_phnset_calibration_screen_state = CALIBRATION_TOP_LEFT_POINT_STATE;
- UpdateCalibrationScreen(
- IMG_CALIBRATION_TOP_LEFT,
- g_phnset_calibration_cntx_p->points[0].x,
- g_phnset_calibration_cntx_p->points[0].y,
- STR_CALIBRATION_TOP_LEFT_TEXT,
- CALIBRATION_TOP_LEFT_POINT_STATE,
- MMI_TRUE);
- mmi_pen_start_calibration(NUM_CALIBRATION_POINTS, g_phnset_calibration_cntx_p->points);
- break;
- case CALIBRATION_TOP_LEFT_POINT_STATE:
- g_phnset_calibration_screen_state = CALIBRATION_BOTTOM_RIGHT_POINT_STATE;
- UpdateCalibrationScreen(
- IMG_CALIBRAION_BOTTOM_RIGHT,
- g_phnset_calibration_cntx_p->points[1].x,
- g_phnset_calibration_cntx_p->points[1].y,
- STR_CALIBRATION_BOTTOM_RIGHT_TEXT,
- CALIBRATION_BOTTOM_RIGHT_POINT_STATE,
- MMI_TRUE);
- break;
- case CALIBRATION_BOTTOM_RIGHT_POINT_STATE:
- g_phnset_calibration_screen_state = CALIBRATION_CENTER_POINT_STATE;
- UpdateCalibrationScreen(
- IMG_CALIBRATION_CENTER,
- g_phnset_calibration_cntx_p->points[2].x,
- g_phnset_calibration_cntx_p->points[2].y,
- STR_CALIBRATION_CENTER_TEXT,
- CALIBRATION_CENTER_POINT_STATE,
- MMI_TRUE);
- break;
- case CALIBRATION_CENTER_POINT_STATE:
- #ifndef __MTK_TARGET__ /* Emulate driver's response */
- {
- mmi_pen_calibration_struct calibration_data;
- g_phnset_calibration_cntx_p->finished = MMI_TRUE;
- /* Write calibration data in NVRAM */
- mmi_pen_read_calibration_data(&calibration_data);
- if (g_phnset_calibration_cntx_p->save_to_factory_default)
- {
- WriteNvramFactoryDefaultCalibrationData(&calibration_data);
- }
- else
- {
- WriteNvramCalibrationData(&calibration_data);
- }
- if (g_phnset_calibration_cntx_p->finish_callback)
- {
- DisplayPopupCallBack(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- MMI_FALSE,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE,
- g_phnset_calibration_cntx_p->finish_callback);
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- MMI_FALSE,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- }
- #endif /* __MTK_TARGET__ */
- break;
- default:
- MMI_ASSERT(0);
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetCalibrationDriverRsp
- * DESCRIPTION
- * Protocol event handler of driver response
- * PARAMETERS
- * msg [IN] Local parameter
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MTK_TARGET__
- void PhnsetCalibrationDriverRsp(void *msg)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- tp_cali_done_struct *rsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- rsp = (tp_cali_done_struct*) msg;
- if (GetExitScrnID() != SCR_CALIBRATION_SETTING)
- {
- /* Race condition that screen is changed. */
- return;
- }
- if (rsp->result)
- {
- mmi_pen_calibration_struct calibration_data;
- g_phnset_calibration_cntx_p->finished = MMI_TRUE;
- /* Write calibration data in NVRAM */
- mmi_pen_read_calibration_data(&calibration_data);
- if (g_phnset_calibration_cntx_p->save_to_factory_default)
- {
- WriteNvramFactoryDefaultCalibrationData(&calibration_data);
- }
- else
- {
- WriteNvramCalibrationData(&calibration_data);
- }
- if (g_phnset_calibration_cntx_p->finish_callback)
- {
- DisplayPopupCallBack(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- MMI_FALSE,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE,
- g_phnset_calibration_cntx_p->finish_callback);
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- MMI_FALSE,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- }
- else
- {
- /*
- * Flush pen event queue because Pen Down event of the 3rd point might come after
- * * MSG_ID_TP_CALI_DONE, but it is changed to CALIBRATION_TOP_LEFT_POINT_STATE.
- */
- mmi_pen_reset();
- /* Restart calibration process */
- CalibrationSettingRestoreData();
- g_phnset_calibration_screen_state = CALIBRATION_TOP_LEFT_POINT_STATE;
- UpdateCalibrationScreen(
- IMG_CALIBRATION_TOP_LEFT,
- g_phnset_calibration_cntx_p->points[0].x,
- g_phnset_calibration_cntx_p->points[0].y,
- STR_CALIBRATION_TOP_LEFT_TEXT,
- CALIBRATION_TOP_LEFT_POINT_STATE,
- MMI_TRUE);
- mmi_pen_start_calibration(NUM_CALIBRATION_POINTS, g_phnset_calibration_cntx_p->points);
- }
- }
- #endif /* __MTK_TARGET__ */
- /*****************************************************************************
- * FUNCTION
- * EntryCalibrationSettingScr
- * DESCRIPTION
- * Entry function for Calibration Setting Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryCalibrationSettingScr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MTK_TARGET__
- SetProtocolEventHandler(PhnsetCalibrationDriverRsp, MSG_ID_TP_CALI_DONE);
- #endif
- EntryNewScreen(SCR_CALIBRATION_SETTING, ExitCalibrationSettingScr, NULL, NULL);
- g_phnset_calibration_cntx_p = OslMalloc(sizeof(mmi_phnset_calibration_struct));
- g_phnset_calibration_cntx_p->finished = MMI_FALSE;
- g_phnset_calibration_cntx_p->save_to_factory_default = MMI_FALSE;
- #ifdef __MMI_TOUCH_SCREEN__
- g_phnset_calibration_cntx_p->finish_callback = NULL;
- /* 1st & 2nd point should not on the margin */
- g_phnset_calibration_cntx_p->points[0].x = UI_device_width / 10;
- g_phnset_calibration_cntx_p->points[0].y = UI_device_height / 10;
- g_phnset_calibration_cntx_p->points[1].x = UI_device_width * 9 / 10;
- g_phnset_calibration_cntx_p->points[1].y = UI_device_height * 9 / 10;
- /*
- * 3rd point should be different from the ceter point
- * * such that driver can check it's ADC value
- */
- g_phnset_calibration_cntx_p->points[2].x = UI_device_width * 11 / 20;
- g_phnset_calibration_cntx_p->points[2].y = UI_device_height * 11 / 20;
- #else /* __MMI_TOUCH_SCREEN__ */
- g_phnset_calibration_cntx_p->finish_callback = EntryTestControlAreaScr;
- /* 1st & 2nd point should not on the margin */
- g_phnset_calibration_cntx_p->points[0] = tp_calibration_point[0];
- g_phnset_calibration_cntx_p->points[1] = tp_calibration_point[1];
- g_phnset_calibration_cntx_p->points[2] = tp_calibration_point[2];
- #endif /* __MMI_TOUCH_SCREEN__ */
- /* 1.Back up user calibration data */
- mmi_pen_read_calibration_data(&g_phnset_calibration_cntx_p->backup_data);
- /* 2 Show Calibration Welcome screen */
- g_phnset_calibration_screen_state = CALIBRATION_WELCOME_STATE;
- ShowCalibrationScreen(0, 0, 0, STR_CALIBRATION_WELCOME_TEXT, CALIBRATION_WELCOME_STATE);
- TurnOnBacklight(0);
- /* 3. Register Pen Handlers
- Because hardware can not get correct ADC value on PenUp, we use PenDown for calibration. */
- ClearInputEventHandler(MMI_DEVICE_ALL);
- mmi_pen_register_up_handler(mmi_pen_dummy_hdlr);
- mmi_pen_register_down_handler(CalibrationSettingPenDown);
- mmi_pen_register_move_handler(mmi_pen_dummy_hdlr);
- mmi_pen_register_abort_handler(mmi_pen_dummy_hdlr);
- mmi_pen_register_repeat_handler(mmi_pen_dummy_hdlr);
- mmi_pen_register_long_tap_handler(mmi_pen_dummy_hdlr);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPhnseFactoryDefaultCalibrationScr_internal
- * DESCRIPTION
- * Entry function for Calibration Screen of factory default value
- * PARAMETERS
- * void
- * callback(?) [IN] Callback function after calibration is finished.
- * RETURNS
- * void
- *****************************************************************************/
- static void (*g_phnset_factory_default_finish_callback) (void);
- static void EntryPhnseFactoryDefaultCalibrationScr_internal(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryCalibrationSettingScr();
- ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
- g_phnset_calibration_cntx_p->save_to_factory_default = MMI_TRUE;
- g_phnset_calibration_cntx_p->finish_callback = g_phnset_factory_default_finish_callback;
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPhnseFactoryDefaultCalibrationScr
- * DESCRIPTION
- *
- * PARAMETERS
- * callback [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPhnseFactoryDefaultCalibrationScr(void (*callback) (void))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_factory_default_finish_callback = callback;
- EntryPhnseFactoryDefaultCalibrationScr_internal();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCalibrationSettingScr
- * DESCRIPTION
- * Exit function for Calibration Setting Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCalibrationSettingScr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history h;
- U16 nHistory = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!g_phnset_calibration_cntx_p->finished)
- {
- /* Restore calibration previously set */
- mmi_pen_set_calibration_data(&g_phnset_calibration_cntx_p->backup_data);
- /* Calibration screen should be put in history, e.g. "Invalid SIM" popup on boot */
- h.scrnID = SCR_CALIBRATION_SETTING;
- if (g_phnset_calibration_cntx_p->save_to_factory_default)
- {
- h.entryFuncPtr = EntryPhnseFactoryDefaultCalibrationScr_internal;
- }
- else
- {
- h.entryFuncPtr = EntryCalibrationSettingScr;
- }
- pfnUnicodeStrcpy((S8*) h.inputBuffer, (S8*) & nHistory);
- memset(h.guiBuffer, 0, sizeof(h.guiBuffer));
- AddHistory(h);
- }
- g_phnset_calibration_screen_state = CALIBRATION_NULL_STATE;
- OslMfree(g_phnset_calibration_cntx_p);
- g_phnset_calibration_cntx_p = NULL;
- TurnOffBacklight();
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetNeedFactoryDefaultCalibration
- * DESCRIPTION
- * Whether pen is calibrated.
- * PARAMETERS
- * void
- * RETURNS
- * BOOL
- *****************************************************************************/
- BOOL PhnsetNeedFactoryDefaultCalibration(void)
- {
- #ifdef MMI_ON_WIN32
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* PC Simulator does not support NVRAM */
- return MMI_FALSE;
- #else /* MMI_ON_WIN32 */
- if (!g_phnset_cntx_p->is_default_calibration_set)
- {
- return MMI_TRUE;
- }
- else
- {
- return MMI_FALSE;
- }
- #endif /* MMI_ON_WIN32 */
- }
- #ifdef __MMI_HANDWRITING_PAD__
- /*****************************************************************************
- * FUNCTION
- * TestControlAreaPenDown
- * DESCRIPTION
- * PenDown Handler for Test Control Area Screen
- * PARAMETERS
- * point [IN]
- * RETURNS
- * void
- *****************************************************************************/
- static void TestControlAreaPenDown(mmi_pen_point_struct point)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 state;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- state = UpdateTestControlAreaScreen(
- point,
- STR_TEST_CONTROL_AREA_WELCOME_TEXT,
- TEST_CONTROL_AREA_TESTING_STATE,
- MMI_TRUE);
- Trace2(TRACE_GROUP_2, "[G] TestControlAreaPenDown - state:%d (%d, %d) ", state, point.x, point.y);
- if (state == TEST_CONTROL_AREA_FINISH_STATE)
- {
- mmi_frm_setup_default_pen_handler();
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- MMI_FALSE,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitControlAreaTestingScr
- * DESCRIPTION
- * Exit function for Calibration Setting Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitControlAreaTestingScr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- TurnOffBacklight();
- }
- /*****************************************************************************
- * FUNCTION
- * EntryTestControlAreaScr
- * DESCRIPTION
- * Entry function for Test Control Area Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryTestControlAreaScr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_pen_point_struct pos = {0};
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_CALIBRATION_CONTROL_AREA_TESTING, ExitControlAreaTestingScr, NULL, NULL);
- /* Show control area test screen */
- ShowTestControlAreaScreen(pos, STR_TEST_CONTROL_AREA_WELCOME_TEXT, TEST_CONTROL_AREA_WELCOME_STATE);
- TurnOnBacklight(0);
- /* 2. Register Pen Handlers
- Because hardware can not get correct ADC value on PenUp, we use PenDown for calibration. */
- ClearInputEventHandler(MMI_DEVICE_ALL);
- mmi_pen_register_up_handler(mmi_pen_dummy_hdlr);
- mmi_pen_register_down_handler(TestControlAreaPenDown);
- mmi_pen_register_move_handler(mmi_pen_dummy_hdlr);
- mmi_pen_register_abort_handler(mmi_pen_dummy_hdlr);
- mmi_pen_register_repeat_handler(mmi_pen_dummy_hdlr);
- mmi_pen_register_long_tap_handler(mmi_pen_dummy_hdlr);
- }
- #endif /* __MMI_HANDWRITING_PAD__ */
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetHandwritingColor
- * DESCRIPTION
- * Get handwriting stroke color
- * PARAMETERS
- * void
- * RETURNS
- * color
- *****************************************************************************/
- color PhnsetGetHandwritingColor(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_ASSERT(g_phnset_cntx_p->pen_color < MAX_PEN_COLORS);
- return g_pen_color_list[g_phnset_cntx_p->pen_color];
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetHandwritingSpeed
- * DESCRIPTION
- * Get handwriting speed
- * PARAMETERS
- * void
- * RETURNS
- * PHNSET_HANDWRITING_SPEED_ENUM
- *****************************************************************************/
- PHNSET_HANDWRITING_SPEED_ENUM PhnsetGetHandwritingSpeed(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (g_phnset_cntx_p->pen_speed)
- {
- case 0:
- return PHNSET_HANDWRITING_FAST;
- case 1:
- return PHNSET_HANDWRITING_MEDIUM;
- case 2:
- return PHNSET_HANDWRITING_SLOW;
- default:
- MMI_ASSERT(0);
- return PHNSET_HANDWRITING_MEDIUM;
- }
- }
- #endif /* defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__) */
- /*****************************************************************************
- * FUNCTION