PhoneSetup.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:298k
源码类别:
MTK
开发平台:
C/C++
- * HintPhnsetWelcomeText
- * DESCRIPTION
- * This function is hint handling function
- * for Phonesetup -> Greeting Text
- * Functionality:
- * PARAMETERS
- * index [IN]
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintPhnsetWelcomeText(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (IsShowWelcomeScr1())
- {
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
- }
- else
- {
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
- }
- }
- /*****************************************************************************
- * FUNCTION
- * HintPhnsetOwnerNum
- * DESCRIPTION
- * This function is hint handling function
- * for Phonesetup -> Language
- * Functionality:
- * PARAMETERS
- * index [IN]
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintPhnsetOwnerNum(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (PhnsetGetShowOwnerNumStatus())
- {
- g_phnset_cntx_p->curShowOwnNumStatus = 1;
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
- }
- else
- {
- g_phnset_cntx_p->curShowOwnNumStatus = 0;
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
- }
- }
- /* Lisen 0921-1 */
- #if defined(__MMI_OPERATOR_NAME_MENU__)
- /*****************************************************************************
- * FUNCTION
- * HintPhnsetOPN
- * DESCRIPTION
- * This function is hint handling function
- * for Phonesetup -> Language
- * Functionality:
- * PARAMETERS
- * index [IN]
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintPhnsetOPN(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (PhnsetGetShowOPNStatus())
- {
- g_phnset_cntx_p->curShowOPNStatus = 1;
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
- }
- else
- {
- g_phnset_cntx_p->curShowOPNStatus = 0;
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
- }
- }
- #endif /* defined(__MMI_OPERATOR_NAME_MENU__) */
- /*****************************************************************************
- * FUNCTION
- * HintPhnsetShowDateTime
- * DESCRIPTION
- * This function is hint handling function
- * for Phonesetup -> Language
- * Functionality:
- * PARAMETERS
- * index [IN]
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintPhnsetShowDateTime(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (PhnsetGetShowDateTimeStatus())
- {
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
- }
- else
- {
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
- }
- }
- /*****************************************************************************
- * FUNCTION
- * HintPhnsetWallpaper
- * DESCRIPTION
- * This function is hint handling function
- * for Phonesetup -> Display Character -> Wallpaper
- * Functionality:
- * PARAMETERS
- * index [IN]
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintPhnsetWallpaper(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PS8 p;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- p = PhnsetGetCurWallpaperName();
- if (p)
- {
- pfnUnicodeStrcpy((PS8) hintData[index], p);
- }
- }
- #ifdef __MMI_SUB_WALLPAPER__
- /*****************************************************************************
- * FUNCTION
- * HintPhnsetSubWallpaper
- * DESCRIPTION
- * This function is hint handling function
- * for Phonesetup -> Display Character -> Wallpaper
- * Functionality:
- * PARAMETERS
- * index [IN]
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintPhnsetSubWallpaper(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PS8 name;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- name = PhnsetGetCurSubWallpaperName();
- if (name)
- {
- pfnUnicodeStrcpy((PS8) hintData[index], name);
- }
- }
- #endif /* __MMI_SUB_WALLPAPER__ */
- #if defined(__MMI_UI_TECHNO_IDLESCREEN_BAR__)
- /*****************************************************************************
- * FUNCTION
- * PhnsetReadIdleClockType
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetReadIdleClockType(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ReadValue(NVRAM_PHNSET_IDLE_CLOCK_TYPE, &(g_phnset_cntx_p->curtCLKType), DS_BYTE, &error);
- if (g_phnset_cntx_p->curtCLKType > 1)
- {
- g_phnset_cntx_p->curtCLKType = 1; //Old:0; //KP Jerry modify for setting clock-type default value to DIGITAL on 2007-3-29
- WriteValue(NVRAM_PHNSET_IDLE_CLOCK_TYPE, &(g_phnset_cntx_p->curtCLKType), DS_BYTE, &error);
- }
- wgui_set_clock_type((U8) g_phnset_cntx_p->curtCLKType);
- }
- /*****************************************************************************
- * FUNCTION
- * HintPhnsetIdleClockType
- * DESCRIPTION
- *
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintPhnsetIdleClockType(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (g_phnset_cntx_p->curtCLKType)
- {
- /*
- * case MMI_PHNSET_IDLECLKTYPE_NONE:
- * pfnUnicodeStrcpy((PS8)hintData[index],(PS8)GetString(STR_GLOBAL_NONE));
- * break;
- */
- case MMI_PHNSET_IDLECLKTYPE_DIGITAL:
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_ID_PHNSET_DISPCHAR_DIGITAL));
- break;
- case MMI_PHNSET_IDLECLKTYPE_ANALOG:
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_ID_PHNSET_DISPCHAR_ANALOG));
- break;
- default:
- MMI_ASSERT(0);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetIdleClockTypeHiliteHandler
- * DESCRIPTION
- *
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetIdleClockTypeHiliteHandler(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->curHightlightItem = (U32) index;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetIdleClockType
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetIdleClockType(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->curtCLKType = g_phnset_cntx_p->curHightlightItem;
- WriteValue(NVRAM_PHNSET_IDLE_CLOCK_TYPE, &(g_phnset_cntx_p->curtCLKType), DS_BYTE, &error);
- wgui_set_clock_type((U8) g_phnset_cntx_p->curtCLKType);
- g_phnset_cntx_p->isCorrectSet = 1;
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, SUCCESS_TONE);
- }
- /*****************************************************************************
- * FUNCTION
- * ExitPhnsetIdleClockType
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitPhnsetIdleClockType(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_phnset_cntx_p->isCorrectSet)
- {
- DeleteUptoScrID(SCR_IDLE_SCR_DISP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPhnsetIdleClockType
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPhnsetIdleClockType(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *pGuiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_PHNSET_IDLE_CLOCK_TYPE, ExitPhnsetIdleClockType, EntryPhnsetIdleClockType, NULL);
- g_phnset_cntx_p->isCorrectSet = 0;
- pGuiBuffer = GetCurrGuiBuffer(SCR_ID_PHNSET_IDLE_CLOCK_TYPE);
- /*
- * subMenuDataPtrs[MMI_PHNSET_IDLECLKTYPE_NONE] = (PU8)GetString( STR_GLOBAL_NONE );;
- */
- subMenuDataPtrs[MMI_PHNSET_IDLECLKTYPE_ANALOG] = (PU8) GetString(STR_ID_PHNSET_DISPCHAR_ANALOG);
- subMenuDataPtrs[MMI_PHNSET_IDLECLKTYPE_DIGITAL] = (PU8) GetString(STR_ID_PHNSET_DISPCHAR_DIGITAL);
- if (g_phnset_cntx_p->curtCLKType > 1)
- {
- PhnsetReadIdleClockType(); /* __USB_IN_NORMAL_MODE__ */
- }
- RegisterHighlightHandler(PhnsetIdleClockTypeHiliteHandler);
- ShowCategory36Screen(
- STR_ID_IDLE_CLOCK_TYPE,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- MMI_PHNSET_IDLECLKTYPE_MAX,
- (U8 **) subMenuDataPtrs,
- g_phnset_cntx_p->curtCLKType,
- pGuiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(PhnsetIdleClockType, KEY_EVENT_UP);
- SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetIdleClockType
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetIdleClockType(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);
- SetLeftSoftkeyFunction(EntryPhnsetIdleClockType, KEY_EVENT_UP);
- SetKeyHandler(EntryPhnsetIdleClockType, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- #endif /* defined(__MMI_UI_TECHNO_IDLESCREEN_BAR__) */
- /*****************************************************************************
- * FUNCTION
- * HintPhnsetScreenSaver
- * DESCRIPTION
- * This function is hint handling function
- * for Phonesetup -> Display Character -> Screen Saver
- * Functionality:
- * PARAMETERS
- * index [IN]
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintPhnsetScreenSaver(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (PhnsetGetCurScrSvrStatus())
- {
- case SET_SS_STATUS_ON:
- {
- PS8 p = PhnsetGetCurScrSvrName();
- if (p)
- {
- pfnUnicodeStrcpy((PS8) hintData[index], p);
- }
- else
- {
- pfnUnicodeStrcpy((PS8) hintData[index], "");
- }
- }
- break;
- #ifdef __MMI_LCD_PARTIAL_ON__
- case SET_SS_STATUS_POWERSAVING:
- pfnUnicodeStrcpy((PS8) hintData[index], (const S8*)GetString(STR_SCREENSAVER_DISPLAY_TIME));
- break;
- #endif /* __MMI_LCD_PARTIAL_ON__ */
- default:
- pfnUnicodeStrcpy((PS8) hintData[index], "");
- /* memset(hintData[index],0,MAX_SUB_MENU_HINT_SIZE); */
- }
- }
- /*****************************************************************************
- * FUNCTION
- * SettingInlineCustomFunction
- * DESCRIPTION
- * This function is to be register as the inline editor full screen editor LSK handler
- * for Phonesetup-> Greeting Text -> Greeting Text
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SettingInlineCustomFunction(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("*-------[SmsSettingsGuiInterface.c] SetProfileSettingCustomFuns -------*n"));
- ChangeLeftSoftkey(STR_GLOBAL_OPTIONS, IMG_GLOBAL_OPTIONS);
- SetLeftSoftkeyFunction(EntryScrForInputMethodAndDone, KEY_EVENT_UP);
- SetInputMethodAndDoneCaptionIcon(MAIN_MENU_TITLE_SETTINGS_ICON);
- }
- #ifdef __MMI_SET_DEF_ENCODING_TYPE__
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetDefEncoding
- * DESCRIPTION
- * This function is Highlight handler for Phonesetup-> Default Encoding Type
- * Follow functions: EntryPhnsetLang
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetDefEncoding(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Change softkey label */
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(EntryPhnsetDefEncoding, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- #ifdef __MMI_PHNSET_TWO_LINE_MENUITEM_DISPLAY__
- if (!is_inline_menu_exist)
- #endif
- {
- SetKeyHandler(EntryPhnsetDefEncoding, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * HintPhnsetDefEncoding
- * DESCRIPTION
- * This function is Hint handler for Phonesetup-> Default Encoding Type
- * Follow functions:
- * PARAMETERS
- * index [IN]
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintPhnsetDefEncoding(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PS8 hintStr = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (g_phnset_cntx_p->EncodingType)
- {
- case 0:
- hintStr = (PS8) GetString(STR_DEF_ENCODING_TYPE_BIG5);
- break;
- case 1:
- hintStr = (PS8) GetString(STR_DEF_ENCODING_TYPE_GB2312);
- break;
- case 2:
- hintStr = (PS8) GetString(STR_DEF_ENCODING_TYPE_UCS2);
- break;
- default:
- hintStr = (PS8) GetString(STR_DEF_ENCODING_TYPE_BIG5);
- break;
- }
- pfnUnicodeStrcpy((PS8) hintData[index], hintStr);
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetDefEncodingHiliteHandler
- * DESCRIPTION
- * This function is Highlight handler for Phonesetup->Default Encoding Type
- * Follow functions:
- * PARAMETERS
- * index [IN]
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetDefEncodingHiliteHandler(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->curHightlightItem = (U32) index;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetDefEncodingSelectHandler
- * DESCRIPTION
- * This function is LSK handler for Phonesetup->Default Encoding Type -> X
- * Follow functions:
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetDefEncodingSelectHandler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- BOOL is_suc = MMI_TRUE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_phnset_cntx_p->EncodingType != g_phnset_cntx_p->curHightlightItem)
- {
- #ifdef MMI_ON_HARDWARE_P
- switch (g_phnset_cntx_p->curHightlightItem)
- {
- case PHNSET_ENCOD_BIG5:
- #ifdef __MMI_CHSET_BIG5__
- g_chset_text_encoding = MMI_CHSET_BIG5;
- #else /* __MMI_CHSET_BIG5__ */
- /* g_chset_text_encoding =MMI_CHSET_BASE; */
- is_suc = MMI_FALSE;
- #endif /* __MMI_CHSET_BIG5__ */
- break;
- case PHNSET_ENCOD_GB2312:
- #ifdef __MMI_CHSET_GB2312__
- g_chset_text_encoding = MMI_CHSET_GB2312;
- #else /* __MMI_CHSET_GB2312__ */
- /* g_chset_text_encoding = MMI_CHSET_BASE; */
- is_suc = MMI_FALSE;
- #endif /* __MMI_CHSET_GB2312__ */
- break;
- default:
- /* g_chset_text_encoding =MMI_CHSET_BASE; */
- is_suc = MMI_FALSE;
- break;
- }
- #endif /* MMI_ON_HARDWARE_P */
- g_phnset_cntx_p->EncodingType = (U8) (g_phnset_cntx_p->curHightlightItem);
- WriteValue(NVRAM_SETTING_DEF_ENCODING, &(g_phnset_cntx_p->curHightlightItem), DS_BYTE, &error);
- }
- if (MMI_TRUE == is_suc)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- MMI_FALSE,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_ERROR),
- IMG_GLOBAL_ERROR,
- MMI_FALSE,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- }
- DeleteScreenIfPresent(SCR_DEF_ENCODING_TYPE);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPhnsetDefEncoding
- * DESCRIPTION
- * This function is Entry function for Phonesetup-> Default encoding type
- * Following functions:
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPhnsetDefEncoding(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 */
- /*----------------------------------------------------------------*/
- /* U8 *HintList[MAX_SUB_MENUS]; */
- /* 1 Call Exit Handler */
- EntryNewScreen(SCR_DEF_ENCODING_TYPE, NULL, EntryPhnsetDefEncoding, NULL);
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_DEF_ENCODING_TYPE);
- /* 3. Retrieve no of child of menu item to be displayed */
- nNumofItem = GetNumOfChild(MENU_SETTING_DEF_ENCODING_TYPE);
- /* 4. Get attribute of menu to be displayed */
- nDispAttribute = GetDispAttributeOfItem(MENU_SETTING_DEF_ENCODING_TYPE);
- /* 5. Retrieve string ids in sequence of given menu item to be displayed */
- GetSequenceStringIds(MENU_SETTING_DEF_ENCODING_TYPE, nStrItemList);
- /* 6 Set current parent id */
- SetParentHandler(MENU_SETTING_DEF_ENCODING_TYPE);
- /* 7 Register highlight handler to be called in menu screen */
- RegisterHighlightHandler(PhnsetDefEncodingHiliteHandler);
- /* 8 Construct the Hints List */
- /* ConstructHintsList(MENU_SETTING_DEF_ENCODING_TYPE, HintList); */
- /* 9. Display Category screen */
- ShowCategory11Screen(STR_DEF_ENCODING_TYPE_TITLE,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK, IMG_GLOBAL_OK, STR_GLOBAL_BACK, IMG_GLOBAL_BACK, nNumofItem, nStrItemList,
- #if defined(__MMI_PHNSET_TWO_LINE_MENUITEM_DISPLAY__)
- g_phnset_cntx_p->curHightlightItem,
- #else
- g_phnset_cntx_p->EncodingType,
- #endif
- guiBuffer);
- /* 10.Register function with softkey */
- SetLeftSoftkeyFunction(PhnsetDefEncodingSelectHandler, KEY_EVENT_UP);
- SetKeyHandler(NULL, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- #endif /* __MMI_SET_DEF_ENCODING_TYPE__ */
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetDefEncodingType
- * DESCRIPTION
- * This function is export function for applications to query the current encoding type setting
- * Follow functions:
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- U8 PhnsetGetDefEncodingType(void)
- {
- #ifdef __MMI_SET_DEF_ENCODING_TYPE__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return g_chset_text_encoding;
- #else /* __MMI_SET_DEF_ENCODING_TYPE__ */
- return g_chset_text_encoding; //Old:MMI_CHSET_BIG5; //KP Jerry modify because of we modify g_chset_text_encoding initial value according to system-default-language on 2007-4-5
- #endif /* __MMI_SET_DEF_ENCODING_TYPE__ */
- }
- /*
- * Language Setting
- */
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetLang
- * DESCRIPTION
- * This function is Highlight handler for Phonesetup->Language
- * Follow functions: EntryPhnsetLang
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetLang(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);
- SetLeftSoftkeyFunction(EntryPhnsetLang, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- #ifdef __MMI_PHNSET_TWO_LINE_MENUITEM_DISPLAY__
- if (!is_inline_menu_exist)
- #endif
- {
- SetKeyHandler(EntryPhnsetLang, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPhnsetLang
- * DESCRIPTION
- * This function is Entry function for Phonesetup->IdleScreenDisplay
- * Following functions:
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPhnsetLang(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *pGuiBuffer;
- S32 totalLang;
- #ifdef __MMI_PHNSET_TWO_LINE_MENUITEM_DISPLAY__
- U16 hiliteItem = g_phnset_cntx_p->curHightlightItem;
- #else
- U16 hiliteItem = gCurrLangIndex;
- #endif
- U8 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_LANGUAGE_SELECTION, NULL, EntryPhnsetLang, NULL);
- totalLang = (S32) GetLanguages(&(g_phnset_cntx_p->ppLang));
- #ifdef __MMI_AUTO_LANG_EN__
- {
- S16 error;
- U8 data = 0;
- ReadValue(NVRAM_SETTING_LANG, &data, DS_BYTE, &error);
- if (data == 0xFF) /* Auto Language set */
- {
- hiliteItem = 0;
- }
- else
- {
- hiliteItem += 1;
- }
- }
- subMenuDataPtrs[0] = (PU8) GetString(STR_LANGUAGESCR_AUTO);
- for (i = 0; i < totalLang; i++)
- {
- subMenuDataPtrs[i + 1] = g_phnset_cntx_p->ppLang[i];
- }
- totalLang += 1;
- #else /* __MMI_AUTO_LANG_EN__ */
- for (i = 0; i < totalLang; i++)
- {
- subMenuDataPtrs[i] = g_phnset_cntx_p->ppLang[i];
- }
- #endif /* __MMI_AUTO_LANG_EN__ */
- pGuiBuffer = GetCurrGuiBuffer(SCR_LANGUAGE_SELECTION);
- RegisterHighlightHandler(PhnsetLangHiliteHandler);
- ShowCategory36Screen(
- STR_MENU_LANGUAGE,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- totalLang,
- (U8 **) subMenuDataPtrs,
- hiliteItem,
- pGuiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(PhnsetLangLSKHandler, KEY_EVENT_UP);
- SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetLangHiliteHandler
- * DESCRIPTION
- * This function is Highlight handler for Phonesetup->Language
- * Follow functions:
- * PARAMETERS
- * index [IN]
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetLangHiliteHandler(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->curHightlightItem = (U32) index;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetLangLSKHandler
- * DESCRIPTION
- * This function is left softkey handling function
- * for Phonesetup->Language
- * Functionality: Save the setting menu style
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetLangLSKHandler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 data;
- S16 error;
- U16 index;
- S32 LangIdx = g_phnset_cntx_p->curHightlightItem;
- BOOL isAutoLangSet = MMI_FALSE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_AUTO_LANG_EN__
- if (g_phnset_cntx_p->curHightlightItem == 0) /* Auto Language selected */
- {
- LangIdx = 0;
- isAutoLangSet = MMI_TRUE;
- }
- else
- {
- LangIdx -= 1;
- }
- #endif /* __MMI_AUTO_LANG_EN__ */
- ReadValue(NVRAM_SETTING_LANG, &data, DS_BYTE, &error);
- /************************************************************************/
- /* Robin 1129, Add auto language selection */
- /************************************************************************/
- /* if( (LangIdx != (S32) gCurrLangIndex) *** Different Language */
- /* || (data != 0xFF && isAutoLangSet == MMI_TRUE) *** Auto Lang Set */
- /* || (data == 0xFF && isAutoLangSet == MMI_FALSE) *** Auto Lang UnSet */
- /* ) */
- /************************************************************************/
- if ((LangIdx != (S32) gCurrLangIndex)
- || (data != 0xFF && isAutoLangSet == MMI_TRUE) || (data == 0xFF && isAutoLangSet == MMI_FALSE))
- {
- index = GetCurrHiliteID();
- if (isAutoLangSet == MMI_TRUE)
- {
- #ifdef __MMI_AUTO_LANG_EN__
- /* only when __MMI_AUTO_LANG_EN__ compile option turn on, the isAutoLangSet is possible to be TRUE */
- U16 autoLangIdx = PhnsetGetAutoLangIdx();
- data = 0xFF;
- SetCurrentLanguage((S8) autoLangIdx);
- WriteValue(NVRAM_SETTING_LANG, &data, DS_BYTE, &error);
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_LANGUAGESCR_AUTO));
- /********************************************************/
- /* Robin 0602, Remove set AT command profile functions */
- /* AT command will query MMI when needed */
- /* Send to PS for AT+CLAE */
- /********************************************************/
- SendLangChange2AT((U8) autoLangIdx);
- #endif /* __MMI_AUTO_LANG_EN__ */
- }
- else
- {
- data = (U8) LangIdx;
- SetCurrentLanguage((S8) data);
- WriteValue(NVRAM_SETTING_LANG, &data, DS_BYTE, &error);
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) g_phnset_cntx_p->ppLang[(U8) LangIdx]);
- /********************************************************/
- /* Robin 0602, Remove set AT command profile functions */
- /* AT command will query MMI when needed */
- /* Send to PS for AT+CLAE */
- /********************************************************/
- SendLangChange2AT((U8) LangIdx);
- }
- Category52ChangeItemDescription(2, hintData[index]);
- #ifdef __MMI_PHNSET_TWO_LINE_MENUITEM_DISPLAY__
- if (!is_inline_menu_exist)
- #endif
- RefreshNwProviderName(gPLMN);
- #ifdef __MMI_WORLD_CLOCK_SUBLCD_SETTING__
- if (gIsSubLcdOnIdleScreen == 1)
- {
- ShowIdleAppSubLcd();
- }
- #endif /* __MMI_WORLD_CLOCK_SUBLCD_SETTING__ */
- }
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, SUCCESS_TONE);
- #ifdef __MMI_PHNSET_TWO_LINE_MENUITEM_DISPLAY__
- if (!is_inline_menu_exist)
- #endif
- DeleteNHistory(1);
- }
- #ifdef __MMI_AUTO_LANG_EN__
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetAutoLangIdx
- * DESCRIPTION
- * This function is to read language setting from nvram and set
- * Functionality:
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- U16 PhnsetGetAutoLangIdx(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 lang_idx;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_phnset_cntx_p->LP != CBS_INVALID && g_phnset_cntx_p->LP != CBS0_LANG_UNSPECIFIED)
- {
- for (lang_idx = 0; lang_idx < MMI_NUM_OF_AUTOLANG_ELEM; lang_idx++)
- {
- if (g_phnset_cntx_p->LP == auto_lang_struct[lang_idx].LanType)
- {
- if (auto_lang_struct[lang_idx].LanSSC)
- {
- return GetLanguageIndex((S8*) auto_lang_struct[lang_idx].LanSSC);
- }
- else
- {
- return 0;
- }
- }
- }
- if (lang_idx == MMI_NUM_OF_AUTOLANG_ELEM) /* Not found! LP Not support */
- {
- #ifdef MMI_ON_HARDWARE_P
- return (U16) GetLanguageIndex((S8*) MMI_DEFLANGSSC_FOR_AUTO);
- #else
- return 0;
- #endif
- }
- }
- else
- {
- #ifdef MMI_ON_HARDWARE_P
- return (U16) GetLanguageIndex((S8*) MMI_DEFLANGSSC_FOR_AUTO);
- #else
- return 0;
- #endif
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetPLPInd
- * DESCRIPTION
- * Process and store LP in phonesetup context
- * Functionality:
- * PARAMETERS
- * LPArr [?]
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- #define MMI_MAX_LP 5
- void PhnsetPLPInd(U8 *LPArr)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i = 0, j = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < MMI_MAX_LP; i++)
- {
- /* found LP from language_type/SSC mapping table --> auto_lang_struct[] */
- for (j = 0; j < MMI_NUM_OF_AUTOLANG_ELEM; j++)
- {
- if (LPArr[i] == auto_lang_struct[j].LanType)
- {
- break;
- }
- }
- /* Find language array (gLanguageArray) using found SSC */
- if (j != MMI_NUM_OF_AUTOLANG_ELEM)
- {
- if (auto_lang_struct[j].LanSSC)
- if (GetLanguageIndex((S8*) auto_lang_struct[j].LanSSC) != 0xFFFF)
- {
- PhnsetSetLP(LPArr[i]);
- break;
- }
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetSetLP
- * DESCRIPTION
- * This function is for SIM info indication to set LP
- * Functionality:
- * PARAMETERS
- * LP [IN]
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetSetLP(U8 LP)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->LP = LP;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetLang
- * DESCRIPTION
- * This function is to get user set language
- * Functionality:
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- U8 PhnsetGetLang(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return g_phnset_cntx_p->UsrLangIdx;
- }
- #endif /* __MMI_AUTO_LANG_EN__ */
- /*****************************************************************************
- * FUNCTION
- * PhnsetSetLangByNvramValue
- * DESCRIPTION
- * This function is to read language setting from nvram and set
- * Functionality:
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- MMI_BOOL PhnsetSetLangByNvramValue(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- U8 data = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ReadValue(NVRAM_SETTING_LANG, &data, DS_BYTE, &error);
- g_phnset_cntx_p->UsrLangIdx = data;
- if (data == 0xFF)
- {
- #ifdef __MMI_AUTO_LANG_EN__
- /* If read nvram before SIM LP comming, treat as unspecified language */
- /* PhonsetGetAugoLanIdx will return default language index */
- data = PhnsetGetAutoLangIdx();
- #else /* __MMI_AUTO_LANG_EN__ */
- data = 0;
- WriteValue(NVRAM_SETTING_LANG, &data, DS_BYTE, &error);
- #endif /* __MMI_AUTO_LANG_EN__ */
- }
- SetCurrentLanguage(data); /* Func in ReadRes.c */
- return MMI_TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetReinitHomeCityIdx
- * DESCRIPTION
- * This function is to rearrange home city global array and set home city highlight item
- * Functionality:
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetReinitHomeCityIdx(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /**
- * This Is Needed As Set Home City NVRAM Index Doesnt Change On Language Change
- * As The Global City Array Is Chnaged.
- **/
- /**************************************************************/
- /* Dont Chnage Order Of These Function Calls --Start-- Gurinder ***** */
- PhnsetReadNvmHomeCityIdxNStoreCityName();
- PhnsetReinitHomeCity();
- /* Dont Chnage Order Of These Function Calls --End-- Gurinder ***** */
- /**************************************************************/
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetSetHomeCityPtr
- * DESCRIPTION
- * This function is to set current homecity string ptr
- * Functionality:
- * PARAMETERS
- * str [?]
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetSetHomeCityPtr(U8 *str)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->CurHomeCityStrPtr = str;
- }
- #if (defined(__MMI_NITZ__) && !defined(__MMI_AUTOTIMEZONE_IN_DATEANDTIME__))
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetNITZ
- * DESCRIPTION
- * This function is highlight handler for Phonesetup-> Auto Update Date and Time
- * Follow functions:tEntryAutoUpdateDtTime
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetNITZ(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- index = GetCurrHiliteID();
- /* Set the LSK to Off when Auto Update is ON */
- if (g_phnset_cntx_p->curNITZStatus == 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);
- /* Change left soft key icon and label */
- SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- /* Register function for left soft key */
- SetLeftSoftkeyFunction(EntryPhnsetNITZ, KEY_EVENT_UP);
- /* Register function for right soft key */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPhnsetNITZ
- * DESCRIPTION
- * This function is Left softkey handler for Phonesetup-> Auto Update Date and Time
- * Functionality: Toggle status only
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPhnsetNITZ(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- index = GetCurrHiliteID();
- /* Toggle Auto Update of Date And Time */
- if (g_phnset_cntx_p->curNITZStatus == 0)
- {
- g_phnset_cntx_p->curNITZStatus = 1;
- }
- else
- {
- g_phnset_cntx_p->curNITZStatus = 0;
- }
- /* Store the updated Value */
- g_phnset_cntx_p->NITZDirtyFlag = TRUE;
- if (g_phnset_cntx_p->curNITZStatus)
- {
- 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();
- HighlightPhnsetNITZ();
- }
- /*****************************************************************************
- * FUNCTION
- * HintPhnsetNITZ
- * DESCRIPTION
- * This function is hint handling function
- * for Phonesetup -> Auto Update of Date and Time
- * Functionality:
- * PARAMETERS
- * index [IN]
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintPhnsetNITZ(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (PhnsetGetNITZFuncStatus())
- {
- g_phnset_cntx_p->curNITZStatus = 1; /* Robin 1115, initial globol variable */
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
- }
- else
- {
- g_phnset_cntx_p->curNITZStatus = 0; /* Robin 1115, initial globol variable */
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetNITZFuncStatus
- * DESCRIPTION
- * This function is to get NITZ function on/off status
- * Functionality: Only exist when (__MMI_NITZ__) and (!__MMI_AUTOTIMEZONE_IN_DATEANDTIME__)
- * PARAMETERS
- * void
- * a(?) [IN/OUT]
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- MMI_BOOL PhnsetGetNITZFuncStatus(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 data = 0;
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ReadValue(NVRAM_SETTING_AUTOUPDATE_DT_TIME, &data, DS_BYTE, &error);
- if (data == 1)
- {
- return MMI_TRUE;
- }
- else if (data == 0xff)
- {
- data = RstGetNITZStatusDefault();
- WriteValue(NVRAM_SETTING_AUTOUPDATE_DT_TIME, &data, DS_BYTE, &error);
- return MMI_FALSE;
- }
- else
- {
- return MMI_FALSE;
- }
- }
- #endif /* (defined(__MMI_NITZ__) && !defined(__MMI_AUTOTIMEZONE_IN_DATEANDTIME__)) */
- /*****************************************************************************
- *
- * TV Out
- *
- *****************************************************************************/
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_highlight_tvout
- * DESCRIPTION
- * highlight tvout item
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- static void mmi_phnset_highlight_tvout(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_phnset_entry_tvout_screen, KEY_EVENT_UP);
- SetKeyHandler(mmi_phnset_entry_tvout_screen, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_entry_tvout_screen
- * DESCRIPTION
- * entry phone setup tv out screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- static void mmi_phnset_entry_tvout_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 item_list[32];
- U16 item_icons[32];
- U16 num_of_items;
- U8 *gui_buffer;
- U8 *popup_list[16];
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_SETTING_TVOUT, NULL, mmi_phnset_entry_tvout_screen, NULL);
- gui_buffer = GetCurrGuiBuffer(SCR_ID_SETTING_TVOUT);
- num_of_items = GetNumOfChild(MENU_ID_SETTING_TVOUT);
- GetSequenceStringIds(MENU_ID_SETTING_TVOUT, item_list);
- GetSequenceImageIds(MENU_ID_SETTING_TVOUT, item_icons);
- SetParentHandler(MENU_ID_SETTING_TVOUT);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- for (i = 0; i < num_of_items; i++)
- {
- item_icons[i] = (U16) (IMG_GLOBAL_L1 + i);
- }
- for (i = 0; i < num_of_items; i++)
- {
- popup_list[i] = NULL;
- }
- ConstructHintsList(MENU_ID_SETTING_TVOUT, popup_list);
- ShowCategory52Screen(
- STR_ID_SETTING_TVOUT,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- num_of_items,
- item_list,
- item_icons,
- (U8 **) popup_list,
- 0,
- 0,
- gui_buffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_highlight_tvout_setting
- * DESCRIPTION
- * highlight tvout setting item
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- static void mmi_phnset_highlight_tvout_setting(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_phnset_entry_tvout_setting_screen, KEY_EVENT_UP);
- SetKeyHandler(mmi_phnset_entry_tvout_setting_screen, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_highlight_tvout_adjust
- * DESCRIPTION
- * highlight tvout adjust item
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- static void mmi_phnset_highlight_tvout_adjust(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_phnset_entry_tvout_adjust_screen, KEY_EVENT_UP);
- SetKeyHandler(mmi_phnset_entry_tvout_adjust_screen, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_tvout_set_adjust
- * DESCRIPTION
- * set tv out style
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- static void mmi_phnset_tvout_set_adjust(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- U16 y_gamma;
- U16 u;
- U16 v;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, SUCCESS_TONE);
- DeleteNHistory(1);
- g_phnset_cntx_p->tvout_y_gamma = g_phnset_cntx_p->tvout_tmp_y_gamma;
- g_phnset_cntx_p->tvout_u = g_phnset_cntx_p->tvout_tmp_u;
- g_phnset_cntx_p->tvout_v = g_phnset_cntx_p->tvout_tmp_v;
- /* write Y/U/V setting */
- y_gamma = g_phnset_cntx_p->tvout_y_gamma;
- u = g_phnset_cntx_p->tvout_u;
- v = g_phnset_cntx_p->tvout_v;
- WriteValue(NVRAM_SETTING_TVOUT_Y_GAMMA, &y_gamma, DS_SHORT, &error);
- WriteValue(NVRAM_SETTING_TVOUT_U, &u, DS_SHORT, &error);
- WriteValue(NVRAM_SETTING_TVOUT_V, &v, DS_SHORT, &error);
- }
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_tvout_cancel_adjust
- * DESCRIPTION
- * cancel tv out adjust
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- static void mmi_phnset_tvout_cancel_adjust(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* restore default */
- mdi_tvout_adjust_y_gamma((U16) g_phnset_cntx.tvout_y_gamma);
- mdi_tvout_adjust_u((U16) g_phnset_cntx.tvout_u);
- mdi_tvout_adjust_v((U16) g_phnset_cntx.tvout_v);
- GoBackHistory();
- }
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_tvout_setting_set_value
- * DESCRIPTION
- * set tv out format
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- static void mmi_phnset_tvout_setting_set_value(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->tvout_format = g_phnset_cntx_p->tvout_inline_format;
- g_phnset_cntx_p->tvout_aud_path = g_phnset_cntx_p->tvout_inline_aud_path;
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, SUCCESS_TONE);
- DeleteNHistory(1);
- /* write back to NVRAM */
- WriteValue(NVRAM_SETTING_TVOUT_FORMAT, &g_phnset_cntx_p->tvout_format, DS_SHORT, &error);
- WriteValue(NVRAM_SETTING_TVOUT_AUD_PATH, &g_phnset_cntx_p->tvout_aud_path, DS_SHORT, &error);
- /* set format to driver */
- if (g_phnset_cntx_p->tvout_format == MMI_SETTING_TVOUT_FORMAT_NTSC)
- {
- mdi_tvout_set_format(MDI_TV_OUTPUT_FORMAT_NTSC);
- }
- else if (g_phnset_cntx_p->tvout_format == MMI_SETTING_TVOUT_FORMAT_PAL)
- {
- mdi_tvout_set_format(MDI_TV_OUTPUT_FORMAT_PAL);
- }
- else
- {
- MMI_ASSERT(0);
- }
- /* set audio path to driver */
- if (g_phnset_cntx_p->tvout_aud_path == MMI_SETTING_TVOUT_AUD_PATH_BOTH)
- {
- mdi_tvout_set_aud_path(MDI_TV_AUD_PATH_BOTH);
- }
- else if (g_phnset_cntx_p->tvout_aud_path == MMI_SETTING_TVOUT_AUD_PATH_TV)
- {
- mdi_tvout_set_aud_path(MDI_TV_AUD_PATH_TV);
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_exit_tvout_setting_screen
- * DESCRIPTION
- * exit phone setup tv out setting screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- void mmi_phnset_exit_tvout_setting_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history h;
- U16 input_buffer_size;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- CloseCategory57Screen();
- h.scrnID = SCR_ID_SETTING_TVOUT_SETTING;
- h.entryFuncPtr = mmi_phnset_entry_tvout_setting_screen;
- GetCategoryHistory(h.guiBuffer);
- input_buffer_size = (U16) GetCategory57DataSize();
- GetCategory57Data((U8*) h.inputBuffer);
- AddNHistory(h, input_buffer_size);
- }
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_tvout_setting_inline_highlight_hdlr
- * DESCRIPTION
- * tvout settint inline hilight handler
- * PARAMETERS
- * index [IN] Index
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- static void mmi_phnset_tvout_setting_inline_highlight_hdlr(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- SetCategory57LeftSoftkeyFunction(mmi_phnset_tvout_setting_set_value);
- }
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_entry_tvout_setting_screen
- * DESCRIPTION
- * entry phone setup tv out setting screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- static void mmi_phnset_entry_tvout_setting_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *gui_buffer;
- U8 *input_buffer;
- U16 input_buffer_size;
- S32 item_offset = 0;
- U16 list_of_icons[4];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_SETTING_TVOUT_SETTING, mmi_phnset_exit_tvout_setting_screen, NULL, NULL);
- gui_buffer = GetCurrGuiBuffer(SCR_ID_SETTING_TVOUT_SETTING);
- input_buffer = GetCurrNInputBuffer(SCR_ID_SETTING_TVOUT_SETTING, &input_buffer_size);
- /* start of Category 57 */
- InitializeCategory57Screen();
- /* Format */
- g_phnset_cntx_p->tvout_format_str_list[0] = GetString((U16) (STR_ID_SETTING_TVOUT_FORMAT_PAL));
- g_phnset_cntx_p->tvout_format_str_list[1] = GetString((U16) (STR_ID_SETTING_TVOUT_FORMAT_NTSC));
- g_phnset_cntx_p->tvout_inline_format = g_phnset_cntx_p->tvout_format;
- SetInlineItemCaption(&wgui_inline_items[item_offset++], (PU8) GetString(STR_ID_SETTING_TVOUT_FORMAT));
- SetInlineItemActivation(&wgui_inline_items[item_offset], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemSelect(
- &wgui_inline_items[item_offset++],
- 2,
- (PU8*) g_phnset_cntx_p->tvout_format_str_list,
- &g_phnset_cntx_p->tvout_inline_format);
- /* Audio Path */
- g_phnset_cntx_p->tvout_aud_path_str_list[0] = GetString((U16) (STR_ID_SETTING_TVOUT_AUD_PATH_BOTH));
- g_phnset_cntx_p->tvout_aud_path_str_list[1] = GetString((U16) (STR_ID_SETTING_TVOUT_AUD_PATH_TV));
- g_phnset_cntx_p->tvout_inline_aud_path = g_phnset_cntx_p->tvout_aud_path;
- SetInlineItemCaption(&wgui_inline_items[item_offset++], (PU8) GetString(STR_ID_SETTING_TVOUT_AUD_PATH));
- SetInlineItemActivation(&wgui_inline_items[item_offset], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemSelect(
- &wgui_inline_items[item_offset++],
- 2,
- (PU8*) g_phnset_cntx_p->tvout_aud_path_str_list,
- &g_phnset_cntx_p->tvout_inline_aud_path);
- if (input_buffer != NULL)
- {
- SetCategory57Data(wgui_inline_items, item_offset, input_buffer);
- }
- list_of_icons[0] = IMG_GLOBAL_L1;
- list_of_icons[1] = 0;
- list_of_icons[2] = IMG_GLOBAL_L2;
- list_of_icons[3] = 0;
- RegisterHighlightHandler(mmi_phnset_tvout_setting_inline_highlight_hdlr);
- ShowCategory57Screen(
- STR_ID_SETTING_TVOUT_SETTING,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- item_offset,
- list_of_icons,
- wgui_inline_items,
- 0,
- gui_buffer);
- /* LSK */
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- SetCategory57LeftSoftkeyFunction(mmi_phnset_tvout_setting_set_value);
- /* RSK */
- DisableCategory57ScreenDone();
- SetCategory57RightSoftkeyFunctions(GoBackHistory, GoBackHistory);
- }
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_entry_tvout_adjust_screen
- * DESCRIPTION
- * entry phone setup tv out adjust screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- static void mmi_phnset_entry_tvout_adjust_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *str_list[3];
- S32 l_limit[3], u_limit[3];
- S32 *curr_value[3];
- void (*cb_func[3]) (S32 value);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_SETTING_TVOUT_ADJUST, NULL, mmi_phnset_entry_tvout_adjust_screen, NULL);
- g_phnset_cntx_p->tvout_tmp_y_gamma = g_phnset_cntx_p->tvout_y_gamma;
- g_phnset_cntx_p->tvout_tmp_u = g_phnset_cntx_p->tvout_u;
- g_phnset_cntx_p->tvout_tmp_v = g_phnset_cntx_p->tvout_v;
- /* Y */
- str_list[0] = (U8*) get_string(STR_ID_SETTING_TVOUT_ADJUST_Y_GAMMA);
- l_limit[0] = MDI_TV_OUTPUT_GAMMA_1;
- u_limit[0] = MDI_TV_OUTPUT_GAMMA_5;
- curr_value[0] = (S32*) (&g_phnset_cntx_p->tvout_tmp_y_gamma);
- cb_func[0] = mmi_phnset_tvout_adjust_y_gamma_callback;
- /* U */
- str_list[1] = (U8*) get_string(STR_ID_SETTING_TVOUT_ADJUST_U);
- l_limit[1] = 0;
- u_limit[1] = 255;
- curr_value[1] = (S32*) (&g_phnset_cntx_p->tvout_tmp_u);
- cb_func[1] = mmi_phnset_tvout_adjust_u_callback;
- /* V */
- str_list[2] = (U8*) get_string(STR_ID_SETTING_TVOUT_ADJUST_V);
- l_limit[2] = 0;
- u_limit[2] = 255;
- curr_value[2] = (S32*) (&g_phnset_cntx_p->tvout_tmp_v);
- cb_func[2] = mmi_phnset_tvout_adjust_v_callback;
- ShowCategory88Screen(
- STR_ID_SETTING_TVOUT_ADJUST,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- 0,
- 3,
- str_list,
- l_limit,
- u_limit,
- curr_value,
- cb_func,
- NULL);
- SetRightSoftkeyFunction(mmi_phnset_tvout_cancel_adjust, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(mmi_phnset_tvout_set_adjust, KEY_EVENT_UP);
- }
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_tvout_adjust_y_gamma_callback
- * DESCRIPTION
- * adjust y gamma callback
- * PARAMETERS
- * value [IN] Adjusted value
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- static void mmi_phnset_tvout_adjust_y_gamma_callback(S32 value)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mdi_tvout_adjust_y_gamma((U16) value);
- g_phnset_cntx_p->tvout_tmp_y_gamma = value;
- }
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_tvout_adjust_u_callback
- * DESCRIPTION
- * adjust u callback
- * PARAMETERS
- * value [IN] Adjusted value
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- static void mmi_phnset_tvout_adjust_u_callback(S32 value)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mdi_tvout_adjust_u((U16) value);
- g_phnset_cntx_p->tvout_tmp_u = value;
- }
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_tvout_adjust_v_callback
- * DESCRIPTION
- * adjust u callback
- * PARAMETERS
- * value [IN] Adjusted value
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- static void mmi_phnset_tvout_adjust_v_callback(S32 value)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mdi_tvout_adjust_v((U16) value);
- g_phnset_cntx_p->tvout_tmp_v = value;
- }
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_tvout_init_setting
- * DESCRIPTION
- * init tvout
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- void mmi_phnset_tvout_init_setting(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- U16 y_gamma;
- U16 u;
- U16 v;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_phnset_cntx_p->is_tvout_init)
- {
- /* if already init, return */
- return;
- }
- /* load format setting */
- ReadValue(NVRAM_SETTING_TVOUT_FORMAT, &g_phnset_cntx_p->tvout_format, DS_SHORT, &error);
- /* not init */
- if (g_phnset_cntx_p->tvout_format == 0xffff)
- {
- g_phnset_cntx_p->tvout_format = MMI_SETTING_TVOUT_FORMAT_NTSC;
- WriteValue(NVRAM_SETTING_TVOUT_FORMAT, &g_phnset_cntx_p->tvout_format, DS_SHORT, &error);
- }
- /* set to mdi tvout */
- if (g_phnset_cntx_p->tvout_format == MMI_SETTING_TVOUT_FORMAT_NTSC)
- {
- mdi_tvout_set_format(MDI_TV_OUTPUT_FORMAT_NTSC);
- }
- else if (g_phnset_cntx_p->tvout_format == MMI_SETTING_TVOUT_FORMAT_PAL)
- {
- mdi_tvout_set_format(MDI_TV_OUTPUT_FORMAT_PAL);
- }
- else
- {
- MMI_ASSERT(0);
- }
- /* audio path */
- ReadValue(NVRAM_SETTING_TVOUT_AUD_PATH, &g_phnset_cntx_p->tvout_aud_path, DS_SHORT, &error);
- /* not init */
- if (g_phnset_cntx_p->tvout_aud_path == 0xffff)
- {
- g_phnset_cntx_p->tvout_aud_path = MMI_SETTING_TVOUT_AUD_PATH_TV;
- WriteValue(NVRAM_SETTING_TVOUT_AUD_PATH, &g_phnset_cntx_p->tvout_aud_path, DS_SHORT, &error);
- }
- if (g_phnset_cntx_p->tvout_aud_path == MMI_SETTING_TVOUT_AUD_PATH_BOTH)
- {
- mdi_tvout_set_aud_path(MDI_TV_AUD_PATH_BOTH);
- }
- else if (g_phnset_cntx_p->tvout_aud_path == MMI_SETTING_TVOUT_AUD_PATH_TV)
- {
- mdi_tvout_set_aud_path(MDI_TV_AUD_PATH_TV);
- }
- else
- {
- MMI_ASSERT(0);
- }
- /* load Y/U/V setting */
- ReadValue(NVRAM_SETTING_TVOUT_Y_GAMMA, &y_gamma, DS_SHORT, &error);
- ReadValue(NVRAM_SETTING_TVOUT_U, &u, DS_SHORT, &error);
- ReadValue(NVRAM_SETTING_TVOUT_V, &v, DS_SHORT, &error);
- /* not init */
- if (y_gamma == 0xffff)
- {
- g_phnset_cntx_p->tvout_y_gamma = MDI_TV_OUTPUT_GAMMA_3;
- /* recommanded value from driver */
- g_phnset_cntx_p->tvout_u = 0x77; /* range 0-255 */
- g_phnset_cntx_p->tvout_v = 0x90; /* range 0-255 */
- }
- else
- {
- g_phnset_cntx_p->tvout_y_gamma = y_gamma;
- g_phnset_cntx_p->tvout_u = u; /* range 0-255 */
- g_phnset_cntx_p->tvout_v = v; /* range 0-255 */
- }
- g_phnset_cntx_p->is_tvout_connected = FALSE;
- g_phnset_cntx_p->is_tvout_enable_sleep_in = TRUE; /* default allow tv out to sleep in */
- g_phnset_cntx_p->is_tvout_sleep_in = FALSE;
- /* init done */
- g_phnset_cntx_p->is_tvout_init = TRUE;
- }
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_tvout_event_hdlr_before_pwron
- * DESCRIPTION
- * event handler before pwron
- * PARAMETERS
- * result [IN] connect result
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- static void mmi_phnset_tvout_event_hdlr_before_pwron(MDI_RESULT result)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* init setting values */
- mmi_phnset_tvout_init_setting();
- if (result == MDI_RES_TV_ENABLE)
- {
- g_phnset_cntx_p->is_tvout_connected = TRUE;
- }
- else if (result == MDI_RES_TV_DISABLE)
- {
- g_phnset_cntx_p->is_tvout_connected = FALSE;
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_early_init_tvout_before_pwron
- * DESCRIPTION
- * init tvout before poweron indication
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- void mmi_phnset_early_init_tvout_before_pwron()
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mdi_tvout_early_init_before_pwoeron(mmi_phnset_tvout_event_hdlr_before_pwron);
- }
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_init_tvout
- * DESCRIPTION
- * init tvout
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- void mmi_phnset_init_tvout(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* always need to init mdi to register callback/message handler */
- mdi_tvout_init(mmi_phnset_tvout_event_hdlr);
- mmi_phnset_tvout_init_setting();
- }
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_tvout_event_hdlr
- * DESCRIPTION
- * init tvout
- * PARAMETERS
- * result [IN] Event result
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- void mmi_phnset_tvout_event_hdlr(MDI_RESULT result)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MDI_RESULT ret;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (result == MDI_RES_TV_ENABLE)
- {
- if (mmi_bootup_is_in_power_on_period() == MMI_FALSE)
- {
- DisplayPopup(
- (PU8) GetString(STR_ID_SETTING_TVOUT_PLUG_IN),
- IMG_ID_POPUP_TVOUT,
- 1,
- ST_NOTIFYDURATION,
- SUCCESS_TONE);
- }
- /* set adjustment */
- mdi_tvout_adjust_y_gamma((U16) g_phnset_cntx.tvout_y_gamma);
- mdi_tvout_adjust_u((U16) g_phnset_cntx.tvout_u);
- mdi_tvout_adjust_v((U16) g_phnset_cntx.tvout_v);
- /* start mode1 */
- mdi_tvout_set_mode(
- MDI_TV_MODE_LCD_SCR,
- 0, /* layer_width */
- 0); /* layer_height */
- ret = mdi_tvout_start();
- if (ret < 0)
- {
- if (mmi_bootup_is_in_power_on_period() == MMI_FALSE)
- {
- DisplayPopup(
- (PU8) GetString(STR_ID_SETTING_TVOUT_NOT_READY),
- IMG_GLOBAL_ERROR,
- 1,
- ST_NOTIFYDURATION,
- WARNING_TONE);
- }
- return;
- }
- else
- {
- /* if in poweron period and playing video, need stop and start again */
- if (mmi_bootup_is_playing_power_on_animation())
- {
- #if defined(__MMI_VIDEO_PLAYER__)
- mmi_pwron_pause_video();
- mmi_pwron_resume_video();
- #endif /* defined(__MMI_VIDEO_PLAYER__) */
- }
- }
- g_phnset_cntx_p->is_tvout_connected = TRUE;
- }
- else if (result == MDI_RES_TV_DISABLE)
- {
- if (mmi_bootup_is_in_power_on_period() == MMI_FALSE)
- {
- DisplayPopup(
- (PU8) GetString(STR_ID_SETTING_TVOUT_PLUG_OUT),
- IMG_ID_POPUP_TVOUT,
- 1,
- ST_NOTIFYDURATION,
- SUCCESS_TONE);
- }
- /* if in poweron period and playing video, need stop and start again */
- if (mmi_bootup_is_playing_power_on_animation())
- {
- #if defined(__MMI_VIDEO_PLAYER__)
- mmi_pwron_pause_video();
- #endif /* defined(__MMI_VIDEO_PLAYER__) */
- }
- mdi_tvout_stop();
- /* if in poweron period and playing video, need stop and start again */
- if (mmi_bootup_is_playing_power_on_animation())
- {
- #if defined(__MMI_VIDEO_PLAYER__)
- mmi_pwron_resume_video();
- #endif /* defined(__MMI_VIDEO_PLAYER__) */
- }
- g_phnset_cntx_p->is_tvout_connected = FALSE;
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_tvout_check_pwron_start
- * DESCRIPTION
- * check need start tvout when power on
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- void mmi_phnset_tvout_check_pwron_start(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_phnset_cntx_p->is_tvout_connected && FALSE == mdi_tvout_is_enable())
- {
- /* is connected */
- mmi_phnset_tvout_event_hdlr(MDI_RES_TV_ENABLE);
- }
- }
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_tvout_lcd_sleepin_handler
- * DESCRIPTION
- * lcd sleep in handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- void mmi_phnset_tvout_lcd_sleepin_handler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_phnset_cntx_p->is_tvout_connected && g_phnset_cntx_p->is_tvout_enable_sleep_in)
- {
- g_phnset_cntx_p->is_tvout_sleep_in = TRUE;
- mdi_tvout_sleep_in();
- }
- }
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_tvout_lcd_sleepout_handler
- * DESCRIPTION
- * lcd sleep out handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- void mmi_phnset_tvout_lcd_sleepout_handler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_phnset_cntx_p->is_tvout_connected && g_phnset_cntx_p->is_tvout_sleep_in)
- {
- g_phnset_cntx_p->is_tvout_sleep_in = FALSE;
- mdi_tvout_sleep_out();
- }
- }
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_tvout_enable_tv_sleep_in
- * DESCRIPTION
- * allow tv to sleep in
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- void mmi_phnset_tvout_enable_tv_sleep_in(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->is_tvout_enable_sleep_in = TRUE;
- }
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_tvout_disable_tv_sleep_in
- * DESCRIPTION
- * do not allow tv to sleep in
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_TVOUT__
- void mmi_phnset_tvout_disable_tv_sleep_in(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->is_tvout_enable_sleep_in = FALSE;
- }
- #endif /* __MMI_TVOUT__ */
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetFontSize
- * DESCRIPTION
- * ...
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- U8 PhnsetGetFontSize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return g_phnset_cntx_p->font_size;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetReadFontSize
- * DESCRIPTION
- * ...
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetReadFontSize(void) /* __USB_IN_NORMAL_MODE__ */
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ReadValue(NVRAM_BYTE_FONT_SIZE, &(g_phnset_cntx_p->font_size), DS_BYTE, &error);
- if (g_phnset_cntx_p->font_size > LARGE)
- {
- g_phnset_cntx_p->font_size = THEME_DEFAULT;
- }
- }
- #ifdef __MMI_CHANGABLE_FONT__
- /*****************************************************************************
- * FUNCTION
- * PhnsetSetFontSize
- * DESCRIPTION
- * Setting Font Size Enum
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetSetFontSize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->font_size = (U16) GetCurrHiliteID();
- WriteValue(NVRAM_BYTE_FONT_SIZE, &(g_phnset_cntx_p->font_size), DS_BYTE, &error);
- change_font_Theme();
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_ID_PHNSET_FONT_SIZE);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPhnsetFontSize
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPhnsetFontSize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- #ifndef __MMI_DIALLING_FONT__
- U8 nNumofItem = 4;
- U16 nStrItemList[4] =
- {
- STR_ID_PHNSET_FONT_SIZE_THEME_DEFAULT, STR_ID_PHNSET_FONT_SIZE_SMALL, STR_ID_PHNSET_FONT_SIZE_MEDIUM,
- STR_ID_PHNSET_FONT_SIZE_LARGE
- };
- #else /* __MMI_DIALLING_FONT__ */
- U8 nNumofItem = 3;
- U16 nStrItemList[3] =
- {
- STR_ID_PHNSET_FONT_SIZE_THEME_DEFAULT, STR_ID_PHNSET_FONT_SIZE_SMALL, STR_ID_PHNSET_FONT_SIZE_MEDIUM
- };
- #endif /* __MMI_DIALLING_FONT__ */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_PHNSET_FONT_SIZE, NULL, EntryPhnsetFontSize, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_PHNSET_FONT_SIZE);
- SetParentHandler(MENU_ID_PHNSET_FONT_SIZE);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory11Screen(
- STR_ID_PHNSET_FONT_SIZE,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- g_phnset_cntx_p->font_size,
- guiBuffer);
- SetLeftSoftkeyFunction(PhnsetSetFontSize, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * HintPhnsetFontSize
- * DESCRIPTION
- * Hint handlers for Font Size
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintPhnsetFontSize(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
- switch (g_phnset_cntx_p->font_size)
- {
- case THEME_DEFAULT:
- pfnUnicodeStrncpy(
- (PS8) hintData[(index)],
- GetString(STR_ID_PHNSET_FONT_SIZE_THEME_DEFAULT),
- MAX_SUBMENU_CHARACTERS);
- break;
- case SMALL:
- pfnUnicodeStrncpy(
- (PS8) hintData[(index)],
- GetString(STR_ID_PHNSET_FONT_SIZE_SMALL),
- MAX_SUBMENU_CHARACTERS);
- break;
- case MEDIUM:
- pfnUnicodeStrncpy(
- (PS8) hintData[(index)],
- GetString(STR_ID_PHNSET_FONT_SIZE_MEDIUM),
- MAX_SUBMENU_CHARACTERS);
- break;
- case LARGE:
- pfnUnicodeStrncpy(
- (PS8) hintData[(index)],
- GetString(STR_ID_PHNSET_FONT_SIZE_LARGE),
- MAX_SUBMENU_CHARACTERS);
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetFontSize
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetFontSize(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 */
- SetLeftSoftkeyFunction(EntryPhnsetFontSize, KEY_EVENT_UP);
- /* 4 Register function for right soft key */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(EntryPhnsetFontSize, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- #endif /* __MMI_CHANGABLE_FONT__ */