ManageCallMain.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:133k
源码类别:
MTK
开发平台:
C/C++
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_CALLSET_GENERAL_SS_RESULT, NULL, EntryCALLSETGeneralSSResut, NULL);
- RemoveSSReqScr();
- ShowCategory74Screen(
- STR_GLOBAL_DONE,
- 0,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- 0,
- 0,
- g_callset_context.SSDisplayBuffer,
- pfnUnicodeStrlen((PS8) g_callset_context.SSDisplayBuffer),
- NULL);
- SetLeftSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryCALLSETGeneralSSResut
- * DESCRIPTION
- * entry function for call waiting result screen
- * NA
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryCALLSETGeneralSSResut(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((!isIncomingCall()) || (GetActiveScreenId() == SCR_CM_REQUESTINGUSSD))
- {
- RemoveSSReqScr();
- EntryCALLSETGeneralSSResutScr();
- }
- else
- {
- HistoryReplace(SCR_CM_REQUESTINGUSSD, SCR_ID_CALLSET_GENERAL_SS_RESULT, EntryCALLSETGeneralSSResutScr);
- }
- }
- /* micha0921 end */
- #ifdef __IP_NUMBER__
- /*****************************************************************************
- * FUNCTION
- * InitIPNumber
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void InitIPNumber(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetHiliteHandler(MENU_IP_NUM_ACTIVATE, HighlightIPNumActivate);
- SetHiliteHandler(MENU_IP_NUM_EDIT, HighlightIPNumEdit);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightIPNumber
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightIPNumber(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeyHandler(EntryScrViewIPNumbers, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(EntryScrViewIPNumbers, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * LoadIPNumbers
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void LoadIPNumbers(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ReadValue(NVRAM_IP_NUMBER_SETTING, &IPSetting, DS_BYTE, &error);
- ReadRecord(NVRAM_EF_IP_NUMBER_LID, 1, IPNumber, sizeof(IPNumber), &error);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrViewIPNumbers
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrViewIPNumbers(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 highlite = 0;
- U8 *guiBuffer;
- U8 i;
- U16 PPIcons[MAX_IP_NUMBER];
- PU8 nStrItems[MAX_IP_NUMBER];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_SETTING_IP_NUMBER, NULL, EntryScrViewIPNumbers, NULL);
- for (i = 0; i < MAX_IP_NUMBER; i++)
- {
- PPIcons[i] = 0;
- if (IPNumber[i][0] == 0)
- {
- nStrItems[i] = (PU8) GetString(STR_GLOBAL_EMPTY);
- }
- else
- {
- nStrItems[i] = IPNumber[i];
- }
- }
- if (IPSetting != 0xff)
- {
- highlite = IPSetting;
- PPIcons[IPSetting] = IMG_VICON;
- }
- RegisterHighlightHandler(SetCurIPNumberIndex);
- guiBuffer = GetCurrGuiBuffer(SCR_SETTING_IP_NUMBER);
- ShowCategory53Screen(
- STR_SETTING_IP_NUMBER,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OPTIONS,
- IMG_GLOBAL_OPTIONS,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- MAX_IP_NUMBER,
- (U8 **) nStrItems,
- (U16*) PPIcons,
- NULL,
- 0,
- (U16) highlite,
- guiBuffer);
- SetLeftSoftkeyFunction(EntryScrIPNumberOptions, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * SetCurIPNumberIndex
- * DESCRIPTION
- *
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetCurIPNumberIndex(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- curIPNumIndex = index;
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrIPNumberOptions
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrIPNumberOptions(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U16 nNumofItem;
- U16 nStrItem[3];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_SETTING_IP_NUM_OPN, NULL, EntryScrIPNumberOptions, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_SETTING_IP_NUM_OPN);
- nNumofItem = GetNumOfChild(MENU_SETTING_IP_NUM_OPN);
- GetSequenceStringIds(MENU_SETTING_IP_NUM_OPN, nStrItem);
- SetParentHandler(MENU_SETTING_IP_NUM_OPN);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory15Screen(
- STR_GLOBAL_OPTIONS,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItem,
- (U16*) gIndexIconsImageList,
- 1,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightIPNumActivate
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightIPNumActivate(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(ActivateIPNumber, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(ActivateIPNumber, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightIPNumEdit
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightIPNumEdit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- pfnUnicodeStrcpy((PS8) newIPNum, (PS8) IPNumber[curIPNumIndex]);
- SetLeftSoftkeyFunction(EntryScrIPNumberEdit, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(EntryScrIPNumberEdit, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ActivateIPNumber
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ActivateIPNumber(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- IPSetting = curIPNumIndex;
- WriteValue(NVRAM_IP_NUMBER_SETTING, &IPSetting, DS_BYTE, &error);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, 1000, SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_SETTING_IP_NUM_OPN);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrIPNumberEdit
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrIPNumberEdit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_SETTING_IP_NUM_EDIT, NULL, EntryScrIPNumberEdit, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_SETTING_IP_NUM_EDIT);
- if (guiBuffer == NULL)
- {
- memset(newIPNum, 0, 20);
- }
- ShowCategory5Screen(
- STR_SETTING_IP_NUMBER,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- INPUT_TYPE_PHONE_NUMBER,
- (PU8) newIPNum,
- MAX_IP_NUMBER_LEN + 1,
- guiBuffer);
- SetLeftSoftkeyFunction(SetIPNumber, KEY_EVENT_UP);
- SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * SetIPNumber
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetIPNumber(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (pfnUnicodeStrlen((PS8) newIPNum) >= MAX_IP_NUMBER_LEN)
- {
- newIPNum[MAX_IP_NUMBER_LEN * 2] = 0;
- newIPNum[MAX_IP_NUMBER_LEN * 2 + 1] = 0;
- }
- pfnUnicodeStrcpy((PS8) IPNumber[curIPNumIndex], (PS8) newIPNum);
- WriteRecord(NVRAM_EF_IP_NUMBER_LID, 1, IPNumber, sizeof(IPNumber), &error);
- GoBackToHistory(SCR_SETTING_IP_NUMBER);
- DeleteScreenIfPresent(SCR_SETTING_IP_NUM_EDIT);
- }
- /*****************************************************************************
- * FUNCTION
- * GetCurrIPNumber
- * DESCRIPTION
- *
- * PARAMETERS
- * num_str [?]
- * RETURNS
- * void
- *****************************************************************************/
- void GetCurrIPNumber(U8 *num_str)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (num_str != NULL)
- {
- num_str[0] = 0;
- if (IPSetting != 0xff)
- {
- UnicodeToAnsii((PS8) num_str, (PS8) IPNumber[IPSetting]);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * GetCurrIPNumberUCS2
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- *
- *****************************************************************************/
- S8 *GetCurrIPNumberUCS2(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (IPSetting != 0xff)
- {
- return (S8*) IPNumber[IPSetting];
- }
- else
- {
- return NULL;
- }
- }
- #endif /* __IP_NUMBER__ */
- /* Start by Julia */
- #ifdef __MMI_CM_BLACK_LIST__
- /*****************************************************************************
- * FUNCTION
- * InitBlackList
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void InitBlackList(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- //KP Jerry modify on 2007-4-25 start
- #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
- SetHiliteHandler(MENU_SETTING_BLACK_LIST_MODE, HighlightBlackListMode);
- SetHiliteHandler(MENU_SETTING_BLACK_LIST_NUM, HighlightBlackListNum);
- SetHintHandler(MENU_SETTING_BLACK_LIST_MODE, HintBlackListMode);
- #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
- SetHiliteHandler(MENU_SETTING_BLACK_LIST_MODE, HighlightBlackListMode);
- SetHiliteHandler(MENU_SETTING_BLACK_LIST_NUM, HighlightBlackListNum);
- SetHintHandler(MENU_SETTING_BLACK_LIST_MODE, HintBlackListMode);
- SetHiliteHandler(MENU_SETTING_BLACK_LIST_AVAILABLEIN, HighlightBlackListAvailableIn);
- SetHintHandler(MENU_SETTING_BLACK_LIST_AVAILABLEIN, HintBlackListAvailableIn);
- SetHiliteHandler(MENU_SETTING_WHITE_LIST_NUM, HighlightWhiteListNum);
- #endif
- //KP Jerry modify on 2007-4-25 end
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightBlackList
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightBlackList(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeyHandler(EntryScrBlackList, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(EntryScrBlackList, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightBlackListMode
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightBlackListMode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- //KP Jerry modify on 2007-4-25 start
- #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
- if (GetBlackListMode() == TRUE)
- {
- ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
- }
- else
- {
- ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
- }
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(EntryScrBlackListMode, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(EntryFirewallListMode, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- #endif
- //KP Jerry modify on 2007-4-25 end
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightBlackListNum
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightBlackListNum(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (index = 0; index < MAX_BLACK_LIST_NUMBER; index++)
- {
- //KP Jerry modify on 2007-4-26 start
- #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
- pfnUnicodeStrcpy((PS8) dispBlackListNum[index], (PS8) BlackListNum[index]);
- #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
- pfnUnicodeStrcpy((PS8) dispFirewallListNum[index], (PS8) BlackListNum[index]);
- #endif
- //KP Jerry modify on 2007-4-26 end
- }
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetKeyHandler(EntryScrBlackListNum, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(EntryScrBlackListNum, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * HintBlackList
- * DESCRIPTION
- *
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintBlackList(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset((S8*) hintData[index], 0, MAX_SUB_MENU_SIZE);
- //KP Jerry modify on 2007-4-26 start
- #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
- if (GetBlackListMode() == TRUE)
- {
- pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
- }
- else
- {
- pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
- }
- #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
- if (GetBlackListMode() == FIREWALL_CLOSE)
- {
- pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_SETTING_FIREWALLMODE_CLOSE));
- }
- else if(GetBlackListMode() == FIREWALL_BLACKLIST)
- {
- pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_SETTING_FIREWALLMODE_BLACK));
- }
- else
- {
- pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_SETTING_FIREWALLMODE_WHITE));
- }
- #endif
- //KP Jerry modify on 2007-4-26 end
- }
- /*****************************************************************************
- * FUNCTION
- * HintBlackListMode
- * DESCRIPTION
- *
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintBlackListMode(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset((S8*) hintData[index], 0, MAX_SUB_MENU_SIZE);
- //KP Jerry modify on 2007-4-26 start
- #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
- if (GetBlackListMode() == TRUE)
- {
- pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
- }
- else
- {
- pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
- }
- #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
- if (GetBlackListMode() == FIREWALL_CLOSE)
- {
- pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_SETTING_FIREWALLMODE_CLOSE));
- }
- else if(GetBlackListMode() == FIREWALL_BLACKLIST)
- {
- pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_SETTING_FIREWALLMODE_BLACK));
- }
- else
- {
- pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_SETTING_FIREWALLMODE_WHITE));
- }
- #endif
- //KP Jerry modify on 2007-4-26 end
- }
- //KP Jerry modify on 2007-4-26 start
- #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
- /*****************************************************************************
- * FUNCTION
- * EntryScrBlackList
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrBlackList(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U16 nNumofItem;
- U16 nStrItem[3];
- U8 *BlackListType[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_SETTING_BLACK_LIST, NULL, EntryScrBlackList, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_SETTING_BLACK_LIST);
- nNumofItem = GetNumOfChild(MENU_SETTING_BLACK_LIST);
- GetSequenceStringIds(MENU_SETTING_BLACK_LIST, nStrItem);
- SetParentHandler(MENU_SETTING_BLACK_LIST);
- ConstructHintsList(MENU_SETTING_BLACK_LIST, BlackListType);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_SETTING_BLACK_LIST,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItem,
- (U16*) gIndexIconsImageList,
- BlackListType,
- 0,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
- /*****************************************************************************
- * FUNCTION
- * EntryScrBlackList
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrBlackList(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U16 nNumofItem;
- U16 nStrItem[3];
- U8 *BlackListType[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_SETTING_BLACK_LIST, NULL, EntryScrBlackList, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_SETTING_BLACK_LIST);
- nNumofItem = GetNumOfChild(MENU_SETTING_FIREWALL);
- GetSequenceStringIds(MENU_SETTING_FIREWALL, nStrItem);
- SetParentHandler(MENU_SETTING_FIREWALL);
- ConstructHintsList(MENU_SETTING_FIREWALL, BlackListType);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_SETTING_FIREWALL,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItem,
- (U16*) gIndexIconsImageList,
- BlackListType,
- 0,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- #endif
- //KP Jerry modify on 2007-4-26 end
- /*****************************************************************************
- * FUNCTION
- * EntryScrBlackListMode
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrBlackListMode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- index = GetCurrHiliteID();
- if (GetBlackListMode() == TRUE)
- {
- SetBlackListMode(FALSE);
- pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
- Category52ChangeItemDescription(0, (U8*) GetString(STR_GLOBAL_OFF));
- ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
- }
- else
- {
- SetBlackListMode(TRUE);
- pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
- Category52ChangeItemDescription(0, (U8*) GetString(STR_GLOBAL_ON));
- ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
- }
- RedrawCategoryFunction();
- HighlightBlackListMode();
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrBlackListNum
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrBlackListNum(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer; /* Buffer holding history data */
- U8 *inputBuffer; /* added for inline edit history */
- U16 inputBufferSize; /* added for inline edit history */
- U16 index;
- U16 BlackListNumImageList[MAX_BLACK_LIST_NUMBER]; //Old:U16 BlackListNumImageList[6]; //KP Jerry modify on 2007-4-26
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 1 Call Exit Handler */
- EntryNewScreen(SCR_SETTING_BLACK_LIST_NUM, ExitScrBlackListNum, NULL, NULL);
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_SETTING_BLACK_LIST_NUM);
- /* 3 Set current parent id */
- InitializeCategory57Screen();
- for (index = 0; index < MAX_BLACK_LIST_NUMBER; index++)
- {
- SetInlineItemActivation(&wgui_inline_items[index], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- //KP Jerry modify on 2007-4-26 start
- #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
- SetInlineItemTextEdit(
- &wgui_inline_items[index],
- (PU8) dispBlackListNum[index],
- MAX_BLACK_LIST_NUMBER_LEN + 1,
- INPUT_TYPE_PHONE_NUMBER | INPUT_TYPE_PLUS_CHARACTER_HANDLING);
- #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
- SetInlineItemTextEdit(
- &wgui_inline_items[index],
- (PU8) dispFirewallListNum[index],
- MAX_BLACK_LIST_NUMBER_LEN + 1,
- INPUT_TYPE_PHONE_NUMBER | INPUT_TYPE_PLUS_CHARACTER_HANDLING);
- #endif
- //KP Jerry modify on 2007-4-26 end
- DisableInlineItemHighlight(&wgui_inline_items[index]);
- }
- //KP Jerry modify on 2007-4-26 start
- /*Old:
- BlackListNumImageList[0] = IMG_GLOBAL_L1;
- BlackListNumImageList[1] = IMG_GLOBAL_L2;
- BlackListNumImageList[2] = IMG_GLOBAL_L3;
- BlackListNumImageList[3] = IMG_GLOBAL_L4;
- BlackListNumImageList[4] = IMG_GLOBAL_L5;
- */
- for (index = 0; index < MAX_BLACK_LIST_NUMBER; index++)
- {
- BlackListNumImageList[index] = IMG_GLOBAL_L1 + index;
- }
- //KP Jerry modify on 2007-4-26 end
- /* added for inline edit history */
- inputBuffer = GetCurrNInputBuffer(SCR_SETTING_BLACK_LIST_NUM, &inputBufferSize);
- //KP Jerry modify on 2007-4-26 start
- #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
- RegisterHighlightHandler(SetCurrBlackListNumIndex);
- #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
- RegisterHighlightHandler(SetCurrFirewallListNumIndex);
- #endif
- //KP Jerry modify on 2007-4-26 end
- /* added for inline edit history */
- if ((guiBuffer != NULL) && (guiBuffer[0] != 0))
- {
- /* sets the data */
- SetCategory57Data(wgui_inline_items, MAX_BLACK_LIST_NUMBER, inputBuffer);
- }
- /* DisableCategory57ScreenDone(); */
- ShowCategory57Screen(
- STR_SETTING_BLACK_LIST_NUM,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- MAX_BLACK_LIST_NUMBER,
- BlackListNumImageList,
- wgui_inline_items,
- 0,
- guiBuffer);
- SetCategory57RightSoftkeyFunctions(EntryScrSetBlackListNumConfirm, GoBackHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * ExitScrBlackListNum
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitScrBlackListNum(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history currHistory;
- U16 inputBufferSize; /* added for inline edit history */
- S16 nHistory = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- CloseCategory57Screen();
- currHistory.scrnID = SCR_SETTING_BLACK_LIST_NUM;
- currHistory.entryFuncPtr = EntryScrBlackListNum;
- pfnUnicodeStrcpy((S8*) currHistory.inputBuffer, (S8*) & nHistory);
- GetCategoryHistory(currHistory.guiBuffer);
- /* added for inline edit history */
- inputBufferSize = (U16) GetCategory57DataSize();
- GetCategory57Data((U8*) currHistory.inputBuffer);
- AddNHistory(currHistory, inputBufferSize);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrSetBlackListNumConfirm
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrSetBlackListNumConfirm(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(SetBlackListNum, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoToBlackList, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * GoToBlackList
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void GoToBlackList(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GoBackToHistory(SCR_SETTING_BLACK_LIST);
- }
- //KP Jerry modify on 2007-4-26 start
- #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
- /*****************************************************************************
- * FUNCTION
- * SetBlackListMode
- * DESCRIPTION
- *
- * PARAMETERS
- * flag [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetBlackListMode(pBOOL flag)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gBlackListFlag = flag;
- WriteValue(NVRAM_BLACK_LIST_SETTING, &gBlackListFlag, DS_BYTE, &error);
- }
- #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
- /*****************************************************************************
- * FUNCTION
- * SetBlackListMode
- * DESCRIPTION
- *
- * PARAMETERS
- * flag [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetBlackListMode(FIREWALL_MODE mode)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if(mode>2)
- return;
- gFirewallMode &= FIREWALL_AVAILABLEINCOMP;
- gFirewallMode |=mode;
- WriteValue(NVRAM_BLACK_LIST_SETTING, &gFirewallMode, DS_BYTE, &error);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, SUCCESS_TONE);
- DeleteUptoScrID(SCR_SETTING_BLACK_LIST);
- }
- #endif
- //KP Jerry modify on 2007-4-26 end
- //KP Jerry add on 2007-4-26 start
- #if defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
- void SetBlackListAvailableIn(FIREWALL_MODE AvailableIn)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if(AvailableIn<8)
- return;
- gFirewallMode &= FIREWALL_MODECOMP;
- gFirewallMode |= AvailableIn;
- WriteValue(NVRAM_BLACK_LIST_SETTING, &gFirewallMode, DS_BYTE, &error);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, SUCCESS_TONE);
- DeleteUptoScrID(SCR_SETTING_BLACK_LIST);
- }
- FIREWALL_MODE GetBlackListAvailableIn(void)
- {
- return (gFirewallMode & FIREWALL_AVAILABLEINCOMP);
- }
- #endif
- //KP Jerry add on 2007-4-26 end
- //KP Jerry modify on 2007-4-26 start
- #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
- /*****************************************************************************
- * FUNCTION
- * GetBlackListMode
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- *
- *****************************************************************************/
- pBOOL GetBlackListMode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return gBlackListFlag;
- }
- #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
- /*****************************************************************************
- * FUNCTION
- * GetBlackListMode
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- *
- *****************************************************************************/
- FIREWALL_MODE GetBlackListMode(void)
- {
- return (gFirewallMode & FIREWALL_MODECOMP);
- }
- #endif
- //KP Jerry modify on 2007-4-26 end
- /*****************************************************************************
- * FUNCTION
- * SetBlackListNum
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetBlackListNum(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 index;
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (index = 0; index < MAX_BLACK_LIST_NUMBER; index++)
- {
- //KP Jerry modify on 2007-4-26 start
- #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
- pfnUnicodeStrcpy((PS8) BlackListNum[index], (PS8) dispBlackListNum[index]);
- #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
- pfnUnicodeStrcpy((PS8) BlackListNum[index], (PS8) dispFirewallListNum[index]);
- #endif
- //KP Jerry modify on 2007-4-26 end
- }
- WriteRecord(NVRAM_EF_BLACK_LIST_LID, 1, BlackListNum, sizeof(BlackListNum), &error);
- GoBackToHistory(SCR_SETTING_BLACK_LIST);
- }
- /*****************************************************************************
- * FUNCTION
- * LoadBlackListNum
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void LoadBlackListNum(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- //KP Jerry modify on 2007-4-26 start
- #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
- ReadValue(NVRAM_BLACK_LIST_SETTING, &gBlackListFlag, DS_BYTE, &error);
- ReadRecord(NVRAM_EF_BLACK_LIST_LID, 1, BlackListNum, sizeof(BlackListNum), &error);
- #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
- ReadValue(NVRAM_BLACK_LIST_SETTING, &gFirewallMode, DS_BYTE, &error);
- ReadRecord(NVRAM_EF_BLACK_LIST_LID, 1, BlackListNum, sizeof(BlackListNum), &error);
- ReadRecord(NVRAM_EF_WHITE_LIST_LID, 1, WhiteListNum, sizeof(WhiteListNum), &error);//KP djs add for firewall on 07-04-09
- #endif
- //KP Jerry modify on 2007-4-26 end
- }
- //KP Jerry modify on 2007-4-26 start
- #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
- /*****************************************************************************
- * FUNCTION
- * SetCurrBlackListNumIndex
- * DESCRIPTION
- *
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetCurrBlackListNumIndex(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- curBlackListNumIndex = index;
- }
- #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
- /*****************************************************************************
- * FUNCTION
- * SetCurrFirewallListNumIndex
- * DESCRIPTION
- *
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetCurrFirewallListNumIndex(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- curFirewallListNumIndex = index;
- }
- #endif
- //KP Jerry modify on 2007-4-26 end
- /*****************************************************************************
- * FUNCTION
- * IsBlackListNum
- * DESCRIPTION
- *
- * PARAMETERS
- * number [IN]
- * RETURNS
- *
- *****************************************************************************/
- pBOOL IsBlackListNum(PU8 number)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 index;
- U8 tmpNumber[MAX_NUMBER];
- U8 tmpBlackListNumber[MAX_NUMBER];
- U32 newNumber, newBlackListNum;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(tmpNumber, 0, ENCODING_LENGTH);
- UnicodeToAnsii((PS8) tmpNumber, (PS8) number);
- newNumber = mmi_phb_util_convert_number_to_int(tmpNumber);
- for (index = 0; index < MAX_BLACK_LIST_NUMBER; index++)
- {
- UnicodeToAnsii((PS8) tmpBlackListNumber, (PS8) BlackListNum[index]);
- newBlackListNum = mmi_phb_util_convert_number_to_int(tmpBlackListNumber);
- if (newNumber == newBlackListNum)
- {
- return TRUE;
- }
- }
- return FALSE;
- }
- //KP Jerry add on 2007-4-26 start
- #if defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
- pBOOL IsWhiteListNum(PU8 number)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 index;
- U8 tmpNumber[MAX_NUMBER];
- U8 tmpWhiteListNumber[MAX_NUMBER];
- U32 newNumber, newBlackListNum;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(tmpNumber, 0, ENCODING_LENGTH);
- UnicodeToAnsii((PS8) tmpNumber, (PS8) number);
- newNumber = mmi_phb_util_convert_number_to_int(tmpNumber);
- for (index = 0; index < MAX_BLACK_LIST_NUMBER; index++)
- {
- UnicodeToAnsii((PS8) tmpWhiteListNumber, (PS8) WhiteListNum[index]);
- newBlackListNum = mmi_phb_util_convert_number_to_int(tmpWhiteListNumber);
- if (newNumber == newBlackListNum)
- {
- return TRUE;
- }
- }
- return FALSE;
- }
- pBOOL IsBlackListNumsms(U32 newNumber1)
- {
- U16 index;
- U8 tmpBlackListNumber[MAX_NUMBER];
- U32 newBlackListNum ;
- for (index=0; index<MAX_BLACK_LIST_NUMBER; index++)
- {
- UnicodeToAnsii((PS8)tmpBlackListNumber, (PS8)BlackListNum[index]);
- newBlackListNum = mmi_phb_util_convert_number_to_int(tmpBlackListNumber);
- if (newNumber1 == newBlackListNum)
- return TRUE;
- }
- return FALSE;
- }
- pBOOL IsWhiteListNumsms(U32 newNumber)
- {
- U16 index;
- U8 tmpWhiteListNumber[MAX_NUMBER];
- U32 newBlackListNum ;
- for (index=0; index<MAX_BLACK_LIST_NUMBER; index++)
- {
- UnicodeToAnsii((PS8)tmpWhiteListNumber, (PS8)WhiteListNum[index]);
- newBlackListNum = mmi_phb_util_convert_number_to_int(tmpWhiteListNumber);
- if (newNumber == newBlackListNum)
- return TRUE;
- }
- return FALSE;
- }
- void HighlightBlackListAvailableIn(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(HighlightFirewallListAvailableIn, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- void HighlightWhiteListNum(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (index = 0; index < MAX_BLACK_LIST_NUMBER; index++)
- {
- pfnUnicodeStrcpy((PS8) dispFirewallListNum[index], (PS8) WhiteListNum[index]);
- }
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetKeyHandler(EntryScrWhiteListNum, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(EntryScrWhiteListNum, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- void HintBlackListAvailableIn(U16 index)
- {
- memset((S8*) hintData[index], 0, MAX_SUB_MENU_SIZE);
- switch(GetFirewallListAvailableIn())
- {
- case FIREWALL_FORCALL:
- pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_SETTING_FIREWALLAVAILABLEIN_CALL));
- break;
- case FIREWALL_FORSMS:
- pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_SETTING_FIREWALLAVAILABLEIN_SMS));
- break;
- case FIREWALL_FORBOTH:
- pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_SETTING_FIREWALLAVAILABLEIN_BOTH));
- break;
- default:
- pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_SETTING_FIREWALLAVAILABLEIN_NONE));
- break;
- }
- }
- void EntryScrWhiteListNum(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer; /* Buffer holding history data */
- U8 *inputBuffer; /* added for inline edit history */
- U16 inputBufferSize; /* added for inline edit history */
- U16 index;
- U16 WhiteListNumImageList[MAX_BLACK_LIST_NUMBER];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 1 Call Exit Handler */
- EntryNewScreen(SCR_SETTING_WHITE_LIST_NUM, ExitScrWhiteListNum, NULL, NULL);
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_SETTING_WHITE_LIST_NUM);
- /* 3 Set current parent id */
- InitializeCategory57Screen();
- for (index = 0; index < MAX_BLACK_LIST_NUMBER; index++)
- {
- SetInlineItemActivation(&wgui_inline_items[index], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemTextEdit(
- &wgui_inline_items[index],
- (PU8) dispFirewallListNum[index],
- MAX_BLACK_LIST_NUMBER_LEN + 1,
- INPUT_TYPE_PHONE_NUMBER | INPUT_TYPE_PLUS_CHARACTER_HANDLING);
- DisableInlineItemHighlight(&wgui_inline_items[index]);
- WhiteListNumImageList[index] = IMG_GLOBAL_L1 + index;
- }
- /* added for inline edit history */
- inputBuffer = GetCurrNInputBuffer(SCR_SETTING_BLACK_LIST_NUM, &inputBufferSize);
- RegisterHighlightHandler(SetCurrFirewallListNumIndex);
- /* added for inline edit history */
- if ((guiBuffer != NULL) && (guiBuffer[0] != 0))
- {
- /* sets the data */
- SetCategory57Data(wgui_inline_items, MAX_BLACK_LIST_NUMBER, inputBuffer);
- }
- /* DisableCategory57ScreenDone(); */
- ShowCategory57Screen(
- STR_SETTING_WHITE_LIST_NUM,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- MAX_BLACK_LIST_NUMBER,
- WhiteListNumImageList,
- wgui_inline_items,
- 0,
- guiBuffer);
- SetCategory57RightSoftkeyFunctions(EntryScrSetWhiteListNumConfirm, GoBackHistory);
- }
- void EntryScrSetWhiteListNumConfirm(void)
- {
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_GLOBAL_SAVE),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetLeftSoftkeyFunction(SetWhiteListNum, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoToWhiteList, KEY_EVENT_UP);
- }
- void ExitScrWhiteListNum(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history currHistory;
- U16 inputBufferSize; /* added for inline edit history */
- S16 nHistory = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- CloseCategory57Screen();
- currHistory.scrnID = SCR_SETTING_BLACK_LIST_NUM;
- currHistory.entryFuncPtr = EntryScrWhiteListNum;
- pfnUnicodeStrcpy((S8*) currHistory.inputBuffer, (S8*) & nHistory);
- GetCategoryHistory(currHistory.guiBuffer);
- /* added for inline edit history */
- inputBufferSize = (U16) GetCategory57DataSize();
- GetCategory57Data((U8*) currHistory.inputBuffer);
- AddNHistory(currHistory, inputBufferSize);
- return;
- }
- void GoToWhiteList(void)
- {
- GoBackToHistory(SCR_SETTING_BLACK_LIST);
- }
- void SetWhiteListNum(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 index;
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (index = 0; index < MAX_BLACK_LIST_NUMBER; index++)
- {
- pfnUnicodeStrcpy((PS8) WhiteListNum[index], (PS8) dispFirewallListNum[index]);
- }
- WriteRecord(NVRAM_EF_WHITE_LIST_LID, 1, WhiteListNum, sizeof(WhiteListNum), &error);
- GoBackToHistory(SCR_SETTING_BLACK_LIST);
- }
- FIREWALL_MODE GetFirewallListMode(void)
- {
- return (gFirewallMode & FIREWALL_MODECOMP);
- }
- FIREWALL_MODE GetFirewallListAvailableIn(void)
- {
- if((gFirewallMode & FIREWALL_FORCALL) && (gFirewallMode & FIREWALL_FORSMS))
- return FIREWALL_FORBOTH;
- else if(gFirewallMode & FIREWALL_FORCALL)
- return FIREWALL_FORCALL;
- else if(gFirewallMode & FIREWALL_FORSMS)
- return FIREWALL_FORSMS;
- else
- return FIREWALL_FORNONE;
- }
- void Set_Firewall_SmsDeleteFlag(BOOL Flag)
- {
- Firewall_SmsInfo.Firewall_SMSDeleteFlag = Flag;
- }
- void Set_Firewall_SmsDeleteIndex(U16 Index)
- {
- Firewall_SmsInfo.Firewall_Index = Index;
- }
- FIREWALL_SMSINFO* Get_Firewall_SmsInfo(void)
- {
- return &Firewall_SmsInfo;
- }
- BOOL Call_GetNumFromFirewallList_InvailFlag(PU8 pNumber)
- {
- if(gFirewallMode & FIREWALL_FORCALL)
- {
- if((GetFirewallListMode() == FIREWALL_BLACKLIST && IsBlackListNum(pNumber) == TRUE) || (GetFirewallListMode() == FIREWALL_WHITELIST&& IsWhiteListNum(pNumber) == FALSE))
- return TRUE;
- else
- return FALSE;
- }
- else
- return FALSE;
- }
- BOOL Sms_GetNumFromFirewallList_InvailFlag(U32 pNumber)
- {
- if(gFirewallMode & FIREWALL_FORSMS)
- {
- if((GetFirewallListMode() == FIREWALL_BLACKLIST && IsBlackListNumsms(pNumber) == TRUE) || (GetFirewallListMode() == FIREWALL_WHITELIST && IsWhiteListNumsms(pNumber) == FALSE))
- return TRUE;
- else
- return FALSE;
- }
- else
- return FALSE;
- }
- void SetFirewallMode(void)
- {
- SetBlackListMode(curFirewallListNumIndex);
- }
- void EntryFirewallListMode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[] =
- {
- STR_SETTING_FIREWALLMODE_CLOSE, /* Disable */
- STR_SETTING_FIREWALLMODE_BLACK,
- STR_SETTING_FIREWALLMODE_WHITE
- };
- U8 nNumofItem = 3;
- U8* guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_SETTING_FIREWALL_MODE_LIST, NULL, EntryFirewallListMode, NULL);
- guiBuffer = GetCurrGuiBuffer (SCR_SETTING_FIREWALL_MODE_LIST);
- RegisterHighlightHandler (SetCurrFirewallListNumIndex);
- ShowCategory11Screen (STR_SETTING_BLACK_LIST_MODE,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK, 0,
- STR_GLOBAL_BACK, 0,
- nNumofItem,
- nStrItemList,
- //g_fm_radio_cntx.StereoCurrValue,
- gFirewallMode & FIREWALL_MODECOMP,
- guiBuffer);
- SetLeftSoftkeyFunction(SetFirewallMode,KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory,KEY_EVENT_UP);
- }
- void SetFirewallAvailableBack(void)
- {
- GoBacknHistory(1);
- }
- void SetFirewallAvailableIn(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gFirewallMode &= FIREWALL_MODECOMP;
- if(fieldStatesAvailableIn[0])
- {
- gFirewallMode |= FIREWALL_FORCALL;
- }
- if(fieldStatesAvailableIn[1])
- {
- gFirewallMode |= FIREWALL_FORSMS;
- }
- WriteValue(NVRAM_BLACK_LIST_SETTING, &gFirewallMode, DS_BYTE, &error);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, SUCCESS_TONE);
- DeleteUptoScrID(SCR_SETTING_BLACK_LIST);
- }
- void SetFirewallAvailablePopup(void)
- {
- EntryScrProfilesQueryPopup(SetFirewallAvailableIn, SetFirewallAvailableBack);
- }
- void HighlightFirewallListAvailableIn(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- // U16 nStrItemList[15]; /* Stores the strings id of submenus returned */
- U16 nNumofItem = 2; /* Stores no of children in the submenu */
- U8 i = 0;
- U8 *guiBuffer; /* Buffer holding history data */
- U16 nStrItemList[] =
- {
- STR_SETTING_FIREWALLAVAILABLEIN_CALL, /* Disable */
- STR_SETTING_FIREWALLAVAILABLEIN_SMS,
- STR_SETTING_FIREWALLAVAILABLEIN_BOTH
- };
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 1 Call Exit Handler */
- EntryNewScreen(SCR_SETTING_FIREWALL_AVAILABLEIN_LIST, NULL, HighlightFirewallListAvailableIn, NULL);
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_SETTING_FIREWALL_AVAILABLEIN_LIST);
- for (i = 0; i < nNumofItem; i++)
- {
- memset((S8*) subMenuDataPtrs[i], 0, MAX_SUB_MENU_SIZE);
- pfnUnicodeStrncpy((S8*) subMenuDataPtrs[i], GetString(nStrItemList[i]), MAX_SUBMENU_CHARACTERS);
- }
- RegisterHighlightHandler (SetCurrFirewallListNumIndex);
- if(gFirewallMode&FIREWALL_FORCALL)
- fieldStatesAvailableIn[0] = 1;
- else
- fieldStatesAvailableIn[0] = 0;
- if(gFirewallMode&FIREWALL_FORSMS)
- fieldStatesAvailableIn[1] = 1;
- else
- fieldStatesAvailableIn[1] = 0;
- SetCheckboxToggleRightSoftkeyFunctions(SetFirewallAvailablePopup,GoBackHistory);
- ShowCategory140Screen(
- STR_SETTING_BLACK_LIST_AVAILABLEIN,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- nNumofItem,
- (U8 **) subMenuDataPtrs,
- fieldStatesAvailableIn,
- 0,
- guiBuffer);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- #endif
- //KP Jerry modify on 2007-4-26 end
- #endif /* __MMI_CM_BLACK_LIST__ */
- /* End by Julia */