ManageCallMain.c
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:133k
源码类别:

MTK

开发平台:

C/C++

  1.     /*----------------------------------------------------------------*/
  2.     /* Code Body                                                      */
  3.     /*----------------------------------------------------------------*/
  4.     EntryNewScreen(SCR_ID_CALLSET_GENERAL_SS_RESULT, NULL, EntryCALLSETGeneralSSResut, NULL);
  5.     RemoveSSReqScr();
  6.     ShowCategory74Screen(
  7.         STR_GLOBAL_DONE,
  8.         0,
  9.         STR_GLOBAL_OK,
  10.         IMG_GLOBAL_OK,
  11.         0,
  12.         0,
  13.         g_callset_context.SSDisplayBuffer,
  14.         pfnUnicodeStrlen((PS8) g_callset_context.SSDisplayBuffer),
  15.         NULL);
  16.     SetLeftSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  17. }
  18. /*****************************************************************************
  19.  * FUNCTION
  20.  *  EntryCALLSETGeneralSSResut
  21.  * DESCRIPTION
  22.  *  entry function for call waiting result screen
  23.  * NA
  24.  *  
  25.  * PARAMETERS
  26.  *  void
  27.  * RETURNS
  28.  *  void
  29.  *****************************************************************************/
  30. void EntryCALLSETGeneralSSResut(void)
  31. {
  32.     /*----------------------------------------------------------------*/
  33.     /* Local Variables                                                */
  34.     /*----------------------------------------------------------------*/
  35.     /*----------------------------------------------------------------*/
  36.     /* Code Body                                                      */
  37.     /*----------------------------------------------------------------*/
  38.     if ((!isIncomingCall()) || (GetActiveScreenId() == SCR_CM_REQUESTINGUSSD))
  39.     {
  40.         RemoveSSReqScr();
  41.         EntryCALLSETGeneralSSResutScr();
  42.     }
  43.     else
  44.     {
  45.         HistoryReplace(SCR_CM_REQUESTINGUSSD, SCR_ID_CALLSET_GENERAL_SS_RESULT, EntryCALLSETGeneralSSResutScr);
  46.     }
  47. }
  48. /* micha0921 end */
  49. #ifdef __IP_NUMBER__
  50. /*****************************************************************************
  51.  * FUNCTION
  52.  *  InitIPNumber
  53.  * DESCRIPTION
  54.  *  
  55.  * PARAMETERS
  56.  *  void
  57.  * RETURNS
  58.  *  void
  59.  *****************************************************************************/
  60. void InitIPNumber(void)
  61. {
  62.     /*----------------------------------------------------------------*/
  63.     /* Local Variables                                                */
  64.     /*----------------------------------------------------------------*/
  65.     /*----------------------------------------------------------------*/
  66.     /* Code Body                                                      */
  67.     /*----------------------------------------------------------------*/
  68.     SetHiliteHandler(MENU_IP_NUM_ACTIVATE, HighlightIPNumActivate);
  69.     SetHiliteHandler(MENU_IP_NUM_EDIT, HighlightIPNumEdit);
  70. }
  71. /*****************************************************************************
  72.  * FUNCTION
  73.  *  HighlightIPNumber
  74.  * DESCRIPTION
  75.  *  
  76.  * PARAMETERS
  77.  *  void
  78.  * RETURNS
  79.  *  void
  80.  *****************************************************************************/
  81. void HighlightIPNumber(void)
  82. {
  83.     /*----------------------------------------------------------------*/
  84.     /* Local Variables                                                */
  85.     /*----------------------------------------------------------------*/
  86.     /*----------------------------------------------------------------*/
  87.     /* Code Body                                                      */
  88.     /*----------------------------------------------------------------*/
  89.     SetKeyHandler(EntryScrViewIPNumbers, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  90.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  91.     SetLeftSoftkeyFunction(EntryScrViewIPNumbers, KEY_EVENT_UP);
  92.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  93. }
  94. /*****************************************************************************
  95.  * FUNCTION
  96.  *  LoadIPNumbers
  97.  * DESCRIPTION
  98.  *  
  99.  * PARAMETERS
  100.  *  void
  101.  * RETURNS
  102.  *  void
  103.  *****************************************************************************/
  104. void LoadIPNumbers(void)
  105. {
  106.     /*----------------------------------------------------------------*/
  107.     /* Local Variables                                                */
  108.     /*----------------------------------------------------------------*/
  109.     S16 error;
  110.     /*----------------------------------------------------------------*/
  111.     /* Code Body                                                      */
  112.     /*----------------------------------------------------------------*/
  113.     ReadValue(NVRAM_IP_NUMBER_SETTING, &IPSetting, DS_BYTE, &error);
  114.     ReadRecord(NVRAM_EF_IP_NUMBER_LID, 1, IPNumber, sizeof(IPNumber), &error);
  115. }
  116. /*****************************************************************************
  117.  * FUNCTION
  118.  *  EntryScrViewIPNumbers
  119.  * DESCRIPTION
  120.  *  
  121.  * PARAMETERS
  122.  *  void
  123.  * RETURNS
  124.  *  void
  125.  *****************************************************************************/
  126. void EntryScrViewIPNumbers(void)
  127. {
  128.     /*----------------------------------------------------------------*/
  129.     /* Local Variables                                                */
  130.     /*----------------------------------------------------------------*/
  131.     U16 highlite = 0;
  132.     U8 *guiBuffer;
  133.     U8 i;
  134.     U16 PPIcons[MAX_IP_NUMBER];
  135.     PU8 nStrItems[MAX_IP_NUMBER];
  136.     /*----------------------------------------------------------------*/
  137.     /* Code Body                                                      */
  138.     /*----------------------------------------------------------------*/
  139.     EntryNewScreen(SCR_SETTING_IP_NUMBER, NULL, EntryScrViewIPNumbers, NULL);
  140.     for (i = 0; i < MAX_IP_NUMBER; i++)
  141.     {
  142.         PPIcons[i] = 0;
  143.         if (IPNumber[i][0] == 0)
  144.         {
  145.             nStrItems[i] = (PU8) GetString(STR_GLOBAL_EMPTY);
  146.         }
  147.         else
  148.         {
  149.             nStrItems[i] = IPNumber[i];
  150.         }
  151.     }
  152.     if (IPSetting != 0xff)
  153.     {
  154.         highlite = IPSetting;
  155.         PPIcons[IPSetting] = IMG_VICON;
  156.     }
  157.     RegisterHighlightHandler(SetCurIPNumberIndex);
  158.     guiBuffer = GetCurrGuiBuffer(SCR_SETTING_IP_NUMBER);
  159.     ShowCategory53Screen(
  160.         STR_SETTING_IP_NUMBER,
  161.         MAIN_MENU_TITLE_SETTINGS_ICON,
  162.         STR_GLOBAL_OPTIONS,
  163.         IMG_GLOBAL_OPTIONS,
  164.         STR_GLOBAL_BACK,
  165.         IMG_GLOBAL_BACK,
  166.         MAX_IP_NUMBER,
  167.         (U8 **) nStrItems,
  168.         (U16*) PPIcons,
  169.         NULL,
  170.         0,
  171.         (U16) highlite,
  172.         guiBuffer);
  173.     SetLeftSoftkeyFunction(EntryScrIPNumberOptions, KEY_EVENT_UP);
  174.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  175. }
  176. /*****************************************************************************
  177.  * FUNCTION
  178.  *  SetCurIPNumberIndex
  179.  * DESCRIPTION
  180.  *  
  181.  * PARAMETERS
  182.  *  index       [IN]        
  183.  * RETURNS
  184.  *  void
  185.  *****************************************************************************/
  186. void SetCurIPNumberIndex(S32 index)
  187. {
  188.     /*----------------------------------------------------------------*/
  189.     /* Local Variables                                                */
  190.     /*----------------------------------------------------------------*/
  191.     /*----------------------------------------------------------------*/
  192.     /* Code Body                                                      */
  193.     /*----------------------------------------------------------------*/
  194.     curIPNumIndex = index;
  195. }
  196. /*****************************************************************************
  197.  * FUNCTION
  198.  *  EntryScrIPNumberOptions
  199.  * DESCRIPTION
  200.  *  
  201.  * PARAMETERS
  202.  *  void
  203.  * RETURNS
  204.  *  void
  205.  *****************************************************************************/
  206. void EntryScrIPNumberOptions(void)
  207. {
  208.     /*----------------------------------------------------------------*/
  209.     /* Local Variables                                                */
  210.     /*----------------------------------------------------------------*/
  211.     U8 *guiBuffer;
  212.     U16 nNumofItem;
  213.     U16 nStrItem[3];
  214.     /*----------------------------------------------------------------*/
  215.     /* Code Body                                                      */
  216.     /*----------------------------------------------------------------*/
  217.     EntryNewScreen(SCR_SETTING_IP_NUM_OPN, NULL, EntryScrIPNumberOptions, NULL);
  218.     guiBuffer = GetCurrGuiBuffer(SCR_SETTING_IP_NUM_OPN);
  219.     nNumofItem = GetNumOfChild(MENU_SETTING_IP_NUM_OPN);
  220.     GetSequenceStringIds(MENU_SETTING_IP_NUM_OPN, nStrItem);
  221.     SetParentHandler(MENU_SETTING_IP_NUM_OPN);
  222.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  223.     ShowCategory15Screen(
  224.         STR_GLOBAL_OPTIONS,
  225.         MAIN_MENU_TITLE_SETTINGS_ICON,
  226.         STR_GLOBAL_OK,
  227.         IMG_GLOBAL_OK,
  228.         STR_GLOBAL_BACK,
  229.         IMG_GLOBAL_BACK,
  230.         nNumofItem,
  231.         nStrItem,
  232.         (U16*) gIndexIconsImageList,
  233.         1,
  234.         0,
  235.         guiBuffer);
  236.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  237.     return;
  238. }
  239. /*****************************************************************************
  240.  * FUNCTION
  241.  *  HighlightIPNumActivate
  242.  * DESCRIPTION
  243.  *  
  244.  * PARAMETERS
  245.  *  void
  246.  * RETURNS
  247.  *  void
  248.  *****************************************************************************/
  249. void HighlightIPNumActivate(void)
  250. {
  251.     /*----------------------------------------------------------------*/
  252.     /* Local Variables                                                */
  253.     /*----------------------------------------------------------------*/
  254.     /*----------------------------------------------------------------*/
  255.     /* Code Body                                                      */
  256.     /*----------------------------------------------------------------*/
  257.     SetLeftSoftkeyFunction(ActivateIPNumber, KEY_EVENT_UP);
  258.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  259.     SetKeyHandler(ActivateIPNumber, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  260.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  261. }
  262. /*****************************************************************************
  263.  * FUNCTION
  264.  *  HighlightIPNumEdit
  265.  * DESCRIPTION
  266.  *  
  267.  * PARAMETERS
  268.  *  void
  269.  * RETURNS
  270.  *  void
  271.  *****************************************************************************/
  272. void HighlightIPNumEdit(void)
  273. {
  274.     /*----------------------------------------------------------------*/
  275.     /* Local Variables                                                */
  276.     /*----------------------------------------------------------------*/
  277.     /*----------------------------------------------------------------*/
  278.     /* Code Body                                                      */
  279.     /*----------------------------------------------------------------*/
  280.     pfnUnicodeStrcpy((PS8) newIPNum, (PS8) IPNumber[curIPNumIndex]);
  281.     SetLeftSoftkeyFunction(EntryScrIPNumberEdit, KEY_EVENT_UP);
  282.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  283.     SetKeyHandler(EntryScrIPNumberEdit, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  284.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  285. }
  286. /*****************************************************************************
  287.  * FUNCTION
  288.  *  ActivateIPNumber
  289.  * DESCRIPTION
  290.  *  
  291.  * PARAMETERS
  292.  *  void
  293.  * RETURNS
  294.  *  void
  295.  *****************************************************************************/
  296. void ActivateIPNumber(void)
  297. {
  298.     /*----------------------------------------------------------------*/
  299.     /* Local Variables                                                */
  300.     /*----------------------------------------------------------------*/
  301.     S16 error;
  302.     /*----------------------------------------------------------------*/
  303.     /* Code Body                                                      */
  304.     /*----------------------------------------------------------------*/
  305.     IPSetting = curIPNumIndex;
  306.     WriteValue(NVRAM_IP_NUMBER_SETTING, &IPSetting, DS_BYTE, &error);
  307.     DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, 1000, SUCCESS_TONE);
  308.     DeleteScreenIfPresent(SCR_SETTING_IP_NUM_OPN);
  309. }
  310. /*****************************************************************************
  311.  * FUNCTION
  312.  *  EntryScrIPNumberEdit
  313.  * DESCRIPTION
  314.  *  
  315.  * PARAMETERS
  316.  *  void
  317.  * RETURNS
  318.  *  void
  319.  *****************************************************************************/
  320. void EntryScrIPNumberEdit(void)
  321. {
  322.     /*----------------------------------------------------------------*/
  323.     /* Local Variables                                                */
  324.     /*----------------------------------------------------------------*/
  325.     U8 *guiBuffer;
  326.     /*----------------------------------------------------------------*/
  327.     /* Code Body                                                      */
  328.     /*----------------------------------------------------------------*/
  329.     EntryNewScreen(SCR_SETTING_IP_NUM_EDIT, NULL, EntryScrIPNumberEdit, NULL);
  330.     guiBuffer = GetCurrGuiBuffer(SCR_SETTING_IP_NUM_EDIT);
  331.     if (guiBuffer == NULL)
  332.     {
  333.         memset(newIPNum, 0, 20);
  334.     }
  335.     ShowCategory5Screen(
  336.         STR_SETTING_IP_NUMBER,
  337.         MAIN_MENU_TITLE_SETTINGS_ICON,
  338.         STR_GLOBAL_OK,
  339.         IMG_GLOBAL_OK,
  340.         STR_GLOBAL_BACK,
  341.         IMG_GLOBAL_BACK,
  342.         INPUT_TYPE_PHONE_NUMBER,
  343.         (PU8) newIPNum,
  344.         MAX_IP_NUMBER_LEN + 1,
  345.         guiBuffer);
  346.     SetLeftSoftkeyFunction(SetIPNumber, KEY_EVENT_UP);
  347.     SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  348. }
  349. /*****************************************************************************
  350.  * FUNCTION
  351.  *  SetIPNumber
  352.  * DESCRIPTION
  353.  *  
  354.  * PARAMETERS
  355.  *  void
  356.  * RETURNS
  357.  *  void
  358.  *****************************************************************************/
  359. void SetIPNumber(void)
  360. {
  361.     /*----------------------------------------------------------------*/
  362.     /* Local Variables                                                */
  363.     /*----------------------------------------------------------------*/
  364.     S16 error;
  365.     /*----------------------------------------------------------------*/
  366.     /* Code Body                                                      */
  367.     /*----------------------------------------------------------------*/
  368.     if (pfnUnicodeStrlen((PS8) newIPNum) >= MAX_IP_NUMBER_LEN)
  369.     {
  370.         newIPNum[MAX_IP_NUMBER_LEN * 2] = 0;
  371.         newIPNum[MAX_IP_NUMBER_LEN * 2 + 1] = 0;
  372.     }
  373.     pfnUnicodeStrcpy((PS8) IPNumber[curIPNumIndex], (PS8) newIPNum);
  374.     WriteRecord(NVRAM_EF_IP_NUMBER_LID, 1, IPNumber, sizeof(IPNumber), &error);
  375.     GoBackToHistory(SCR_SETTING_IP_NUMBER);
  376.     DeleteScreenIfPresent(SCR_SETTING_IP_NUM_EDIT);
  377. }
  378. /*****************************************************************************
  379.  * FUNCTION
  380.  *  GetCurrIPNumber
  381.  * DESCRIPTION
  382.  *  
  383.  * PARAMETERS
  384.  *  num_str     [?]     
  385.  * RETURNS
  386.  *  void
  387.  *****************************************************************************/
  388. void GetCurrIPNumber(U8 *num_str)
  389. {
  390.     /*----------------------------------------------------------------*/
  391.     /* Local Variables                                                */
  392.     /*----------------------------------------------------------------*/
  393.     /*----------------------------------------------------------------*/
  394.     /* Code Body                                                      */
  395.     /*----------------------------------------------------------------*/
  396.     if (num_str != NULL)
  397.     {
  398.         num_str[0] = 0;
  399.         if (IPSetting != 0xff)
  400.         {
  401.             UnicodeToAnsii((PS8) num_str, (PS8) IPNumber[IPSetting]);
  402.         }
  403.     }
  404. }
  405. /*****************************************************************************
  406.  * FUNCTION
  407.  *  GetCurrIPNumberUCS2
  408.  * DESCRIPTION
  409.  *  
  410.  * PARAMETERS
  411.  *  void
  412.  * RETURNS
  413.  *  
  414.  *****************************************************************************/
  415. S8 *GetCurrIPNumberUCS2(void)
  416. {
  417.     /*----------------------------------------------------------------*/
  418.     /* Local Variables                                                */
  419.     /*----------------------------------------------------------------*/
  420.     /*----------------------------------------------------------------*/
  421.     /* Code Body                                                      */
  422.     /*----------------------------------------------------------------*/
  423.     if (IPSetting != 0xff)
  424.     {
  425.         return (S8*) IPNumber[IPSetting];
  426.     }
  427.     else
  428.     {
  429.         return NULL;
  430.     }
  431. }
  432. #endif /* __IP_NUMBER__ */ 
  433. /* Start by Julia */
  434. #ifdef __MMI_CM_BLACK_LIST__
  435. /*****************************************************************************
  436.  * FUNCTION
  437.  *  InitBlackList
  438.  * DESCRIPTION
  439.  *  
  440.  * PARAMETERS
  441.  *  void
  442.  * RETURNS
  443.  *  void
  444.  *****************************************************************************/
  445. void InitBlackList(void)
  446. {
  447.     /*----------------------------------------------------------------*/
  448.     /* Local Variables                                                */
  449.     /*----------------------------------------------------------------*/
  450.     /*----------------------------------------------------------------*/
  451.     /* Code Body                                                      */
  452.     /*----------------------------------------------------------------*/
  453. //KP Jerry modify on 2007-4-25 start
  454. #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
  455.     SetHiliteHandler(MENU_SETTING_BLACK_LIST_MODE, HighlightBlackListMode);
  456.     SetHiliteHandler(MENU_SETTING_BLACK_LIST_NUM, HighlightBlackListNum);
  457.     SetHintHandler(MENU_SETTING_BLACK_LIST_MODE, HintBlackListMode);
  458. #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
  459.     SetHiliteHandler(MENU_SETTING_BLACK_LIST_MODE, HighlightBlackListMode);
  460.     SetHiliteHandler(MENU_SETTING_BLACK_LIST_NUM, HighlightBlackListNum);
  461.     SetHintHandler(MENU_SETTING_BLACK_LIST_MODE, HintBlackListMode);
  462.     SetHiliteHandler(MENU_SETTING_BLACK_LIST_AVAILABLEIN, HighlightBlackListAvailableIn);
  463.     SetHintHandler(MENU_SETTING_BLACK_LIST_AVAILABLEIN, HintBlackListAvailableIn);
  464.     SetHiliteHandler(MENU_SETTING_WHITE_LIST_NUM, HighlightWhiteListNum);
  465. #endif
  466. //KP Jerry modify on 2007-4-25 end
  467. }
  468. /*****************************************************************************
  469.  * FUNCTION
  470.  *  HighlightBlackList
  471.  * DESCRIPTION
  472.  *  
  473.  * PARAMETERS
  474.  *  void
  475.  * RETURNS
  476.  *  void
  477.  *****************************************************************************/
  478. void HighlightBlackList(void)
  479. {
  480.     /*----------------------------------------------------------------*/
  481.     /* Local Variables                                                */
  482.     /*----------------------------------------------------------------*/
  483.     /*----------------------------------------------------------------*/
  484.     /* Code Body                                                      */
  485.     /*----------------------------------------------------------------*/
  486.     SetKeyHandler(EntryScrBlackList, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  487.     SetLeftSoftkeyFunction(EntryScrBlackList, KEY_EVENT_UP);
  488.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  489.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  490. }
  491. /*****************************************************************************
  492.  * FUNCTION
  493.  *  HighlightBlackListMode
  494.  * DESCRIPTION
  495.  *  
  496.  * PARAMETERS
  497.  *  void
  498.  * RETURNS
  499.  *  void
  500.  *****************************************************************************/
  501. void HighlightBlackListMode(void)
  502. {
  503.     /*----------------------------------------------------------------*/
  504.     /* Local Variables                                                */
  505.     /*----------------------------------------------------------------*/
  506.     /*----------------------------------------------------------------*/
  507.     /* Code Body                                                      */
  508.     /*----------------------------------------------------------------*/
  509. //KP Jerry modify on 2007-4-25 start
  510. #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
  511.     if (GetBlackListMode() == TRUE)
  512.     {
  513.         ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
  514.     }
  515.     else
  516.     {
  517.         ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
  518.     }
  519.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  520.     SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  521.     SetLeftSoftkeyFunction(EntryScrBlackListMode, KEY_EVENT_UP);
  522.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  523.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  524. #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
  525.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  526.     SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  527.     SetLeftSoftkeyFunction(EntryFirewallListMode, KEY_EVENT_UP);
  528.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  529.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  530. #endif
  531. //KP Jerry modify on 2007-4-25 end
  532. }
  533. /*****************************************************************************
  534.  * FUNCTION
  535.  *  HighlightBlackListNum
  536.  * DESCRIPTION
  537.  *  
  538.  * PARAMETERS
  539.  *  void
  540.  * RETURNS
  541.  *  void
  542.  *****************************************************************************/
  543. void HighlightBlackListNum(void)
  544. {
  545.     /*----------------------------------------------------------------*/
  546.     /* Local Variables                                                */
  547.     /*----------------------------------------------------------------*/
  548.     U16 index;
  549.     /*----------------------------------------------------------------*/
  550.     /* Code Body                                                      */
  551.     /*----------------------------------------------------------------*/
  552.     for (index = 0; index < MAX_BLACK_LIST_NUMBER; index++)
  553.     {
  554. //KP Jerry modify on 2007-4-26 start
  555. #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
  556.         pfnUnicodeStrcpy((PS8) dispBlackListNum[index], (PS8) BlackListNum[index]);
  557. #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
  558.         pfnUnicodeStrcpy((PS8) dispFirewallListNum[index], (PS8) BlackListNum[index]);
  559. #endif
  560. //KP Jerry modify on 2007-4-26 end
  561.     }
  562.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  563.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  564.     SetKeyHandler(EntryScrBlackListNum, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  565.     SetLeftSoftkeyFunction(EntryScrBlackListNum, KEY_EVENT_UP);
  566.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  567.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  568. }
  569. /*****************************************************************************
  570.  * FUNCTION
  571.  *  HintBlackList
  572.  * DESCRIPTION
  573.  *  
  574.  * PARAMETERS
  575.  *  index       [IN]        
  576.  * RETURNS
  577.  *  void
  578.  *****************************************************************************/
  579. void HintBlackList(U16 index)
  580. {
  581.     /*----------------------------------------------------------------*/
  582.     /* Local Variables                                                */
  583.     /*----------------------------------------------------------------*/
  584.     /*----------------------------------------------------------------*/
  585.     /* Code Body                                                      */
  586.     /*----------------------------------------------------------------*/
  587.     memset((S8*) hintData[index], 0, MAX_SUB_MENU_SIZE);
  588. //KP Jerry modify on 2007-4-26 start
  589. #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
  590.     if (GetBlackListMode() == TRUE)
  591.     {
  592.         pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
  593.     }
  594.     else
  595.     {
  596.         pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
  597.     }
  598. #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
  599.     if (GetBlackListMode() == FIREWALL_CLOSE)
  600.     {
  601.         pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_SETTING_FIREWALLMODE_CLOSE));
  602.     }
  603.     else if(GetBlackListMode() == FIREWALL_BLACKLIST)
  604.     {
  605.         pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_SETTING_FIREWALLMODE_BLACK));
  606.     }
  607.     else 
  608.     {
  609.       pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_SETTING_FIREWALLMODE_WHITE));
  610.     }
  611. #endif
  612. //KP Jerry modify on 2007-4-26 end
  613. }
  614. /*****************************************************************************
  615.  * FUNCTION
  616.  *  HintBlackListMode
  617.  * DESCRIPTION
  618.  *  
  619.  * PARAMETERS
  620.  *  index       [IN]        
  621.  * RETURNS
  622.  *  void
  623.  *****************************************************************************/
  624. void HintBlackListMode(U16 index)
  625. {
  626.     /*----------------------------------------------------------------*/
  627.     /* Local Variables                                                */
  628.     /*----------------------------------------------------------------*/
  629.     /*----------------------------------------------------------------*/
  630.     /* Code Body                                                      */
  631.     /*----------------------------------------------------------------*/
  632.     memset((S8*) hintData[index], 0, MAX_SUB_MENU_SIZE);
  633. //KP Jerry modify on 2007-4-26 start
  634. #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
  635.     if (GetBlackListMode() == TRUE)
  636.     {
  637.         pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
  638.     }
  639.     else
  640.     {
  641.         pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
  642.     }
  643. #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
  644.     if (GetBlackListMode() == FIREWALL_CLOSE)
  645.     {
  646.         pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_SETTING_FIREWALLMODE_CLOSE));
  647.     }
  648.     else if(GetBlackListMode() == FIREWALL_BLACKLIST)
  649.     {
  650.         pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_SETTING_FIREWALLMODE_BLACK));
  651.     }
  652.     else 
  653.     {
  654.       pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_SETTING_FIREWALLMODE_WHITE));
  655.     }
  656. #endif
  657. //KP Jerry modify on 2007-4-26 end
  658. }
  659. //KP Jerry modify on 2007-4-26 start
  660. #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
  661. /*****************************************************************************
  662.  * FUNCTION
  663.  *  EntryScrBlackList
  664.  * DESCRIPTION
  665.  *  
  666.  * PARAMETERS
  667.  *  void
  668.  * RETURNS
  669.  *  void
  670.  *****************************************************************************/
  671. void EntryScrBlackList(void)
  672. {
  673.     /*----------------------------------------------------------------*/
  674.     /* Local Variables                                                */
  675.     /*----------------------------------------------------------------*/
  676.     U8 *guiBuffer;
  677.     U16 nNumofItem;
  678.     U16 nStrItem[3];
  679.     U8 *BlackListType[MAX_SUB_MENUS];
  680.     /*----------------------------------------------------------------*/
  681.     /* Code Body                                                      */
  682.     /*----------------------------------------------------------------*/
  683.     EntryNewScreen(SCR_SETTING_BLACK_LIST, NULL, EntryScrBlackList, NULL);
  684.     guiBuffer = GetCurrGuiBuffer(SCR_SETTING_BLACK_LIST);
  685.     nNumofItem = GetNumOfChild(MENU_SETTING_BLACK_LIST);
  686.     GetSequenceStringIds(MENU_SETTING_BLACK_LIST, nStrItem);
  687.     SetParentHandler(MENU_SETTING_BLACK_LIST);
  688.     ConstructHintsList(MENU_SETTING_BLACK_LIST, BlackListType);
  689.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  690.     ShowCategory52Screen(
  691.         STR_SETTING_BLACK_LIST,
  692.         MAIN_MENU_TITLE_SETTINGS_ICON,
  693.         STR_GLOBAL_OK,
  694.         IMG_GLOBAL_OK,
  695.         STR_GLOBAL_BACK,
  696.         IMG_GLOBAL_BACK,
  697.         nNumofItem,
  698.         nStrItem,
  699.         (U16*) gIndexIconsImageList,
  700.         BlackListType,
  701.         0,
  702.         0,
  703.         guiBuffer);
  704.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  705.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  706. }
  707. #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
  708. /*****************************************************************************
  709.  * FUNCTION
  710.  *  EntryScrBlackList
  711.  * DESCRIPTION
  712.  *  
  713.  * PARAMETERS
  714.  *  void
  715.  * RETURNS
  716.  *  void
  717.  *****************************************************************************/
  718. void EntryScrBlackList(void)
  719. {
  720.     /*----------------------------------------------------------------*/
  721.     /* Local Variables                                                */
  722.     /*----------------------------------------------------------------*/
  723.     U8 *guiBuffer;
  724.     U16 nNumofItem;
  725.     U16 nStrItem[3];
  726.     U8 *BlackListType[MAX_SUB_MENUS];
  727.     /*----------------------------------------------------------------*/
  728.     /* Code Body                                                      */
  729.     /*----------------------------------------------------------------*/
  730.     EntryNewScreen(SCR_SETTING_BLACK_LIST, NULL, EntryScrBlackList, NULL);
  731.     guiBuffer = GetCurrGuiBuffer(SCR_SETTING_BLACK_LIST);
  732.     nNumofItem = GetNumOfChild(MENU_SETTING_FIREWALL);
  733.     GetSequenceStringIds(MENU_SETTING_FIREWALL, nStrItem);
  734.     SetParentHandler(MENU_SETTING_FIREWALL);
  735.     ConstructHintsList(MENU_SETTING_FIREWALL, BlackListType);
  736.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  737.     ShowCategory52Screen(
  738.         STR_SETTING_FIREWALL,
  739.         MAIN_MENU_TITLE_SETTINGS_ICON,
  740.         STR_GLOBAL_OK,
  741.         IMG_GLOBAL_OK,
  742.         STR_GLOBAL_BACK,
  743.         IMG_GLOBAL_BACK,
  744.         nNumofItem,
  745.         nStrItem,
  746.         (U16*) gIndexIconsImageList,
  747.         BlackListType,
  748.         0,
  749.         0,
  750.         guiBuffer);
  751.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  752.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  753. }
  754. #endif
  755. //KP Jerry modify on 2007-4-26 end
  756. /*****************************************************************************
  757.  * FUNCTION
  758.  *  EntryScrBlackListMode
  759.  * DESCRIPTION
  760.  *  
  761.  * PARAMETERS
  762.  *  void
  763.  * RETURNS
  764.  *  void
  765.  *****************************************************************************/
  766. void EntryScrBlackListMode(void)
  767. {
  768.     /*----------------------------------------------------------------*/
  769.     /* Local Variables                                                */
  770.     /*----------------------------------------------------------------*/
  771.     U16 index;
  772.     /*----------------------------------------------------------------*/
  773.     /* Code Body                                                      */
  774.     /*----------------------------------------------------------------*/
  775.     index = GetCurrHiliteID();
  776.     if (GetBlackListMode() == TRUE)
  777.     {
  778.         SetBlackListMode(FALSE);
  779.         pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
  780.         Category52ChangeItemDescription(0, (U8*) GetString(STR_GLOBAL_OFF));
  781.         ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
  782.     }
  783.     else
  784.     {
  785.         SetBlackListMode(TRUE);
  786.         pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
  787.         Category52ChangeItemDescription(0, (U8*) GetString(STR_GLOBAL_ON));
  788.         ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
  789.     }
  790.     RedrawCategoryFunction();
  791.     HighlightBlackListMode();
  792. }
  793. /*****************************************************************************
  794.  * FUNCTION
  795.  *  EntryScrBlackListNum
  796.  * DESCRIPTION
  797.  *  
  798.  * PARAMETERS
  799.  *  void
  800.  * RETURNS
  801.  *  void
  802.  *****************************************************************************/
  803. void EntryScrBlackListNum(void)
  804. {
  805.     /*----------------------------------------------------------------*/
  806.     /* Local Variables                                                */
  807.     /*----------------------------------------------------------------*/
  808.     U8 *guiBuffer;          /* Buffer holding history data */
  809.     U8 *inputBuffer;        /* added for inline edit history */
  810.     U16 inputBufferSize;    /* added for inline edit history */
  811.     U16 index;
  812.     U16 BlackListNumImageList[MAX_BLACK_LIST_NUMBER];     //Old:U16 BlackListNumImageList[6];     //KP Jerry modify on 2007-4-26
  813.     /*----------------------------------------------------------------*/
  814.     /* Code Body                                                      */
  815.     /*----------------------------------------------------------------*/
  816.     /* 1 Call Exit Handler */
  817.     EntryNewScreen(SCR_SETTING_BLACK_LIST_NUM, ExitScrBlackListNum, NULL, NULL);
  818.     /* 2 Get current screen to gui buffer  for history purposes */
  819.     guiBuffer = GetCurrGuiBuffer(SCR_SETTING_BLACK_LIST_NUM);
  820.     /* 3 Set current parent id */
  821.     InitializeCategory57Screen();
  822.     for (index = 0; index < MAX_BLACK_LIST_NUMBER; index++)
  823.     {
  824.         SetInlineItemActivation(&wgui_inline_items[index], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  825. //KP Jerry modify on 2007-4-26 start
  826. #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
  827.         SetInlineItemTextEdit(
  828.             &wgui_inline_items[index],
  829.             (PU8) dispBlackListNum[index],
  830.             MAX_BLACK_LIST_NUMBER_LEN + 1,
  831.             INPUT_TYPE_PHONE_NUMBER | INPUT_TYPE_PLUS_CHARACTER_HANDLING);
  832. #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
  833.         SetInlineItemTextEdit(
  834.             &wgui_inline_items[index],
  835.             (PU8) dispFirewallListNum[index],
  836.             MAX_BLACK_LIST_NUMBER_LEN + 1,
  837.             INPUT_TYPE_PHONE_NUMBER | INPUT_TYPE_PLUS_CHARACTER_HANDLING);
  838. #endif
  839. //KP Jerry modify on 2007-4-26 end
  840.         DisableInlineItemHighlight(&wgui_inline_items[index]);
  841.     }
  842. //KP Jerry modify on 2007-4-26 start
  843. /*Old:
  844.     BlackListNumImageList[0] = IMG_GLOBAL_L1;
  845.     BlackListNumImageList[1] = IMG_GLOBAL_L2;
  846.     BlackListNumImageList[2] = IMG_GLOBAL_L3;
  847.     BlackListNumImageList[3] = IMG_GLOBAL_L4;
  848.     BlackListNumImageList[4] = IMG_GLOBAL_L5;
  849. */
  850.     for (index = 0; index < MAX_BLACK_LIST_NUMBER; index++)
  851.     {
  852. BlackListNumImageList[index] = IMG_GLOBAL_L1 + index;
  853.     }
  854. //KP Jerry modify on 2007-4-26 end
  855.     /* added for inline edit history */
  856.     inputBuffer = GetCurrNInputBuffer(SCR_SETTING_BLACK_LIST_NUM, &inputBufferSize);
  857. //KP Jerry modify on 2007-4-26 start
  858. #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
  859.     RegisterHighlightHandler(SetCurrBlackListNumIndex);
  860. #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
  861.     RegisterHighlightHandler(SetCurrFirewallListNumIndex);
  862. #endif
  863. //KP Jerry modify on 2007-4-26 end
  864.     /* added for inline edit history */
  865.     if ((guiBuffer != NULL) && (guiBuffer[0] != 0))
  866.     {
  867.         /* sets the data */
  868.         SetCategory57Data(wgui_inline_items, MAX_BLACK_LIST_NUMBER, inputBuffer);
  869.     }
  870.     /* DisableCategory57ScreenDone(); */
  871.     ShowCategory57Screen(
  872.         STR_SETTING_BLACK_LIST_NUM,
  873.         MAIN_MENU_TITLE_SETTINGS_ICON,
  874.         STR_GLOBAL_OK,
  875.         IMG_GLOBAL_OK,
  876.         STR_GLOBAL_BACK,
  877.         IMG_GLOBAL_BACK,
  878.         MAX_BLACK_LIST_NUMBER,
  879.         BlackListNumImageList,
  880.         wgui_inline_items,
  881.         0,
  882.         guiBuffer);
  883.     SetCategory57RightSoftkeyFunctions(EntryScrSetBlackListNumConfirm, GoBackHistory);
  884. }
  885. /*****************************************************************************
  886.  * FUNCTION
  887.  *  ExitScrBlackListNum
  888.  * DESCRIPTION
  889.  *  
  890.  * PARAMETERS
  891.  *  void
  892.  * RETURNS
  893.  *  void
  894.  *****************************************************************************/
  895. void ExitScrBlackListNum(void)
  896. {
  897.     /*----------------------------------------------------------------*/
  898.     /* Local Variables                                                */
  899.     /*----------------------------------------------------------------*/
  900.     history currHistory;
  901.     U16 inputBufferSize;    /* added for inline edit history */
  902.     S16 nHistory = 0;
  903.     /*----------------------------------------------------------------*/
  904.     /* Code Body                                                      */
  905.     /*----------------------------------------------------------------*/
  906.     CloseCategory57Screen();
  907.     currHistory.scrnID = SCR_SETTING_BLACK_LIST_NUM;
  908.     currHistory.entryFuncPtr = EntryScrBlackListNum;
  909.     pfnUnicodeStrcpy((S8*) currHistory.inputBuffer, (S8*) & nHistory);
  910.     GetCategoryHistory(currHistory.guiBuffer);
  911.     /* added for inline edit history */
  912.     inputBufferSize = (U16) GetCategory57DataSize();
  913.     GetCategory57Data((U8*) currHistory.inputBuffer);
  914.     AddNHistory(currHistory, inputBufferSize);
  915.     return;
  916. }
  917. /*****************************************************************************
  918.  * FUNCTION
  919.  *  EntryScrSetBlackListNumConfirm
  920.  * DESCRIPTION
  921.  *  
  922.  * PARAMETERS
  923.  *  void
  924.  * RETURNS
  925.  *  void
  926.  *****************************************************************************/
  927. void EntryScrSetBlackListNumConfirm(void)
  928. {
  929.     /*----------------------------------------------------------------*/
  930.     /* Local Variables                                                */
  931.     /*----------------------------------------------------------------*/
  932.     /*----------------------------------------------------------------*/
  933.     /* Code Body                                                      */
  934.     /*----------------------------------------------------------------*/
  935.     DisplayConfirm(
  936.         STR_GLOBAL_YES,
  937.         IMG_GLOBAL_YES,
  938.         STR_GLOBAL_NO,
  939.         IMG_GLOBAL_NO,
  940.         get_string(STR_GLOBAL_SAVE),
  941.         IMG_GLOBAL_QUESTION,
  942.         WARNING_TONE);
  943.     SetLeftSoftkeyFunction(SetBlackListNum, KEY_EVENT_UP);
  944.     SetRightSoftkeyFunction(GoToBlackList, KEY_EVENT_UP);
  945. }
  946. /*****************************************************************************
  947.  * FUNCTION
  948.  *  GoToBlackList
  949.  * DESCRIPTION
  950.  *  
  951.  * PARAMETERS
  952.  *  void
  953.  * RETURNS
  954.  *  void
  955.  *****************************************************************************/
  956. void GoToBlackList(void)
  957. {
  958.     /*----------------------------------------------------------------*/
  959.     /* Local Variables                                                */
  960.     /*----------------------------------------------------------------*/
  961.     /*----------------------------------------------------------------*/
  962.     /* Code Body                                                      */
  963.     /*----------------------------------------------------------------*/
  964.     GoBackToHistory(SCR_SETTING_BLACK_LIST);
  965. }
  966. //KP Jerry modify on 2007-4-26 start
  967. #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
  968. /*****************************************************************************
  969.  * FUNCTION
  970.  *  SetBlackListMode
  971.  * DESCRIPTION
  972.  *  
  973.  * PARAMETERS
  974.  *  flag        [IN]        
  975.  * RETURNS
  976.  *  void
  977.  *****************************************************************************/
  978. void SetBlackListMode(pBOOL flag)
  979. {
  980.     /*----------------------------------------------------------------*/
  981.     /* Local Variables                                                */
  982.     /*----------------------------------------------------------------*/
  983.     S16 error;
  984.     /*----------------------------------------------------------------*/
  985.     /* Code Body                                                      */
  986.     /*----------------------------------------------------------------*/
  987.     gBlackListFlag = flag;
  988.     WriteValue(NVRAM_BLACK_LIST_SETTING, &gBlackListFlag, DS_BYTE, &error);
  989. }
  990. #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
  991. /*****************************************************************************
  992.  * FUNCTION
  993.  *  SetBlackListMode
  994.  * DESCRIPTION
  995.  *  
  996.  * PARAMETERS
  997.  *  flag        [IN]        
  998.  * RETURNS
  999.  *  void
  1000.  *****************************************************************************/
  1001. void SetBlackListMode(FIREWALL_MODE mode)
  1002. {
  1003. /*----------------------------------------------------------------*/
  1004. /* Local Variables                                                */
  1005. /*----------------------------------------------------------------*/
  1006. S16 error;
  1007. /*----------------------------------------------------------------*/
  1008. /* Code Body                                                      */
  1009. /*----------------------------------------------------------------*/
  1010. if(mode>2)
  1011. return;
  1012. gFirewallMode &= FIREWALL_AVAILABLEINCOMP;
  1013. gFirewallMode |=mode;
  1014. WriteValue(NVRAM_BLACK_LIST_SETTING, &gFirewallMode, DS_BYTE, &error);
  1015. DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, SUCCESS_TONE);
  1016. DeleteUptoScrID(SCR_SETTING_BLACK_LIST);
  1017. }
  1018. #endif
  1019. //KP Jerry modify on 2007-4-26 end
  1020. //KP Jerry add on 2007-4-26 start
  1021. #if defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
  1022. void SetBlackListAvailableIn(FIREWALL_MODE AvailableIn)
  1023. {
  1024. /*----------------------------------------------------------------*/
  1025. /* Local Variables                                                */
  1026. /*----------------------------------------------------------------*/
  1027. S16 error;
  1028. /*----------------------------------------------------------------*/
  1029. /* Code Body                                                      */
  1030. /*----------------------------------------------------------------*/
  1031. if(AvailableIn<8)
  1032. return;
  1033. gFirewallMode &= FIREWALL_MODECOMP;
  1034. gFirewallMode |=  AvailableIn;
  1035. WriteValue(NVRAM_BLACK_LIST_SETTING, &gFirewallMode, DS_BYTE, &error);
  1036. DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, SUCCESS_TONE);
  1037. DeleteUptoScrID(SCR_SETTING_BLACK_LIST);
  1038. }
  1039. FIREWALL_MODE GetBlackListAvailableIn(void)
  1040. {
  1041. return (gFirewallMode & FIREWALL_AVAILABLEINCOMP);
  1042. }
  1043. #endif
  1044. //KP Jerry add on 2007-4-26 end
  1045. //KP Jerry modify on 2007-4-26 start
  1046. #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
  1047. /*****************************************************************************
  1048.  * FUNCTION
  1049.  *  GetBlackListMode
  1050.  * DESCRIPTION
  1051.  *  
  1052.  * PARAMETERS
  1053.  *  void
  1054.  * RETURNS
  1055.  *  
  1056.  *****************************************************************************/
  1057. pBOOL GetBlackListMode(void)
  1058. {
  1059.     /*----------------------------------------------------------------*/
  1060.     /* Local Variables                                                */
  1061.     /*----------------------------------------------------------------*/
  1062.     /*----------------------------------------------------------------*/
  1063.     /* Code Body                                                      */
  1064.     /*----------------------------------------------------------------*/
  1065.     return gBlackListFlag;
  1066. }
  1067. #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
  1068. /*****************************************************************************
  1069.  * FUNCTION
  1070.  *  GetBlackListMode
  1071.  * DESCRIPTION
  1072.  *  
  1073.  * PARAMETERS
  1074.  *  void
  1075.  * RETURNS
  1076.  *  
  1077.  *****************************************************************************/
  1078. FIREWALL_MODE GetBlackListMode(void)
  1079. {
  1080. return (gFirewallMode & FIREWALL_MODECOMP);
  1081. }
  1082. #endif
  1083. //KP Jerry modify on 2007-4-26 end
  1084. /*****************************************************************************
  1085.  * FUNCTION
  1086.  *  SetBlackListNum
  1087.  * DESCRIPTION
  1088.  *  
  1089.  * PARAMETERS
  1090.  *  void
  1091.  * RETURNS
  1092.  *  void
  1093.  *****************************************************************************/
  1094. void SetBlackListNum(void)
  1095. {
  1096.     /*----------------------------------------------------------------*/
  1097.     /* Local Variables                                                */
  1098.     /*----------------------------------------------------------------*/
  1099.     U16 index;
  1100.     S16 error;
  1101.     /*----------------------------------------------------------------*/
  1102.     /* Code Body                                                      */
  1103.     /*----------------------------------------------------------------*/
  1104.     for (index = 0; index < MAX_BLACK_LIST_NUMBER; index++)
  1105.     {
  1106. //KP Jerry modify on 2007-4-26 start
  1107. #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
  1108.         pfnUnicodeStrcpy((PS8) BlackListNum[index], (PS8) dispBlackListNum[index]);
  1109. #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
  1110.         pfnUnicodeStrcpy((PS8) BlackListNum[index], (PS8) dispFirewallListNum[index]);
  1111. #endif
  1112. //KP Jerry modify on 2007-4-26 end
  1113.     }
  1114.     WriteRecord(NVRAM_EF_BLACK_LIST_LID, 1, BlackListNum, sizeof(BlackListNum), &error);
  1115.     GoBackToHistory(SCR_SETTING_BLACK_LIST);
  1116. }
  1117. /*****************************************************************************
  1118.  * FUNCTION
  1119.  *  LoadBlackListNum
  1120.  * DESCRIPTION
  1121.  *  
  1122.  * PARAMETERS
  1123.  *  void
  1124.  * RETURNS
  1125.  *  void
  1126.  *****************************************************************************/
  1127. void LoadBlackListNum(void)
  1128. {
  1129.     /*----------------------------------------------------------------*/
  1130.     /* Local Variables                                                */
  1131.     /*----------------------------------------------------------------*/
  1132.     S16 error;
  1133.     /*----------------------------------------------------------------*/
  1134.     /* Code Body                                                      */
  1135.     /*----------------------------------------------------------------*/
  1136. //KP Jerry modify on 2007-4-26 start
  1137. #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
  1138.     ReadValue(NVRAM_BLACK_LIST_SETTING, &gBlackListFlag, DS_BYTE, &error);
  1139.     ReadRecord(NVRAM_EF_BLACK_LIST_LID, 1, BlackListNum, sizeof(BlackListNum), &error);
  1140. #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
  1141.     ReadValue(NVRAM_BLACK_LIST_SETTING, &gFirewallMode, DS_BYTE, &error);
  1142.     ReadRecord(NVRAM_EF_BLACK_LIST_LID, 1, BlackListNum, sizeof(BlackListNum), &error);
  1143.     ReadRecord(NVRAM_EF_WHITE_LIST_LID, 1, WhiteListNum, sizeof(WhiteListNum), &error);//KP djs add for firewall on 07-04-09 
  1144. #endif
  1145. //KP Jerry modify on 2007-4-26 end
  1146. }
  1147. //KP Jerry modify on 2007-4-26 start
  1148. #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
  1149. /*****************************************************************************
  1150.  * FUNCTION
  1151.  *  SetCurrBlackListNumIndex
  1152.  * DESCRIPTION
  1153.  *  
  1154.  * PARAMETERS
  1155.  *  index       [IN]        
  1156.  * RETURNS
  1157.  *  void
  1158.  *****************************************************************************/
  1159. void SetCurrBlackListNumIndex(S32 index)
  1160. {
  1161.     /*----------------------------------------------------------------*/
  1162.     /* Local Variables                                                */
  1163.     /*----------------------------------------------------------------*/
  1164.     /*----------------------------------------------------------------*/
  1165.     /* Code Body                                                      */
  1166.     /*----------------------------------------------------------------*/
  1167.     curBlackListNumIndex = index;
  1168. }
  1169. #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
  1170. /*****************************************************************************
  1171.  * FUNCTION
  1172.  *  SetCurrFirewallListNumIndex
  1173.  * DESCRIPTION
  1174.  *  
  1175.  * PARAMETERS
  1176.  *  index       [IN]        
  1177.  * RETURNS
  1178.  *  void
  1179.  *****************************************************************************/
  1180. void SetCurrFirewallListNumIndex(S32 index)
  1181. {
  1182.     /*----------------------------------------------------------------*/
  1183.     /* Local Variables                                                */
  1184.     /*----------------------------------------------------------------*/
  1185.     /*----------------------------------------------------------------*/
  1186.     /* Code Body                                                      */
  1187.     /*----------------------------------------------------------------*/
  1188.     curFirewallListNumIndex = index;
  1189. }
  1190. #endif
  1191. //KP Jerry modify on 2007-4-26 end
  1192. /*****************************************************************************
  1193.  * FUNCTION
  1194.  *  IsBlackListNum
  1195.  * DESCRIPTION
  1196.  *  
  1197.  * PARAMETERS
  1198.  *  number      [IN]        
  1199.  * RETURNS
  1200.  *  
  1201.  *****************************************************************************/
  1202. pBOOL IsBlackListNum(PU8 number)
  1203. {
  1204.     /*----------------------------------------------------------------*/
  1205.     /* Local Variables                                                */
  1206.     /*----------------------------------------------------------------*/
  1207.     U16 index;
  1208.     U8 tmpNumber[MAX_NUMBER];
  1209.     U8 tmpBlackListNumber[MAX_NUMBER];
  1210.     U32 newNumber, newBlackListNum;
  1211.     /*----------------------------------------------------------------*/
  1212.     /* Code Body                                                      */
  1213.     /*----------------------------------------------------------------*/
  1214.     memset(tmpNumber, 0, ENCODING_LENGTH);
  1215.     UnicodeToAnsii((PS8) tmpNumber, (PS8) number);
  1216.     newNumber = mmi_phb_util_convert_number_to_int(tmpNumber);
  1217.     for (index = 0; index < MAX_BLACK_LIST_NUMBER; index++)
  1218.     {
  1219.         UnicodeToAnsii((PS8) tmpBlackListNumber, (PS8) BlackListNum[index]);
  1220.         newBlackListNum = mmi_phb_util_convert_number_to_int(tmpBlackListNumber);
  1221.         if (newNumber == newBlackListNum)
  1222.         {
  1223.             return TRUE;
  1224.         }
  1225.     }
  1226.     return FALSE;
  1227. }
  1228. //KP Jerry add on 2007-4-26 start
  1229. #if defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
  1230. pBOOL IsWhiteListNum(PU8 number)
  1231. {
  1232.     /*----------------------------------------------------------------*/
  1233.     /* Local Variables                                                */
  1234.     /*----------------------------------------------------------------*/
  1235.     U16 index;
  1236.     U8 tmpNumber[MAX_NUMBER];
  1237.     U8 tmpWhiteListNumber[MAX_NUMBER];
  1238.     U32 newNumber, newBlackListNum;
  1239.     /*----------------------------------------------------------------*/
  1240.     /* Code Body                                                      */
  1241.     /*----------------------------------------------------------------*/
  1242.     memset(tmpNumber, 0, ENCODING_LENGTH);
  1243.     UnicodeToAnsii((PS8) tmpNumber, (PS8) number);
  1244.     newNumber = mmi_phb_util_convert_number_to_int(tmpNumber);
  1245.     for (index = 0; index < MAX_BLACK_LIST_NUMBER; index++)
  1246.     {
  1247.         UnicodeToAnsii((PS8) tmpWhiteListNumber, (PS8) WhiteListNum[index]);
  1248.         newBlackListNum = mmi_phb_util_convert_number_to_int(tmpWhiteListNumber);
  1249.         if (newNumber == newBlackListNum)
  1250.         {
  1251.             return TRUE;
  1252.         }
  1253.     }
  1254.     return FALSE;
  1255. }
  1256. pBOOL IsBlackListNumsms(U32 newNumber1)   
  1257. {
  1258. U16 index;
  1259. U8 tmpBlackListNumber[MAX_NUMBER];
  1260. U32  newBlackListNum ;
  1261. for (index=0; index<MAX_BLACK_LIST_NUMBER; index++)
  1262. {
  1263.     UnicodeToAnsii((PS8)tmpBlackListNumber, (PS8)BlackListNum[index]);
  1264.     newBlackListNum = mmi_phb_util_convert_number_to_int(tmpBlackListNumber);
  1265.   if (newNumber1 == newBlackListNum)
  1266.   return TRUE;
  1267. }
  1268. return FALSE;
  1269. }
  1270. pBOOL IsWhiteListNumsms(U32 newNumber)   
  1271. {
  1272. U16 index;
  1273. U8 tmpWhiteListNumber[MAX_NUMBER];
  1274. U32  newBlackListNum ;
  1275. for (index=0; index<MAX_BLACK_LIST_NUMBER; index++)
  1276. {
  1277.     UnicodeToAnsii((PS8)tmpWhiteListNumber, (PS8)WhiteListNum[index]);
  1278.     newBlackListNum = mmi_phb_util_convert_number_to_int(tmpWhiteListNumber);
  1279.   if (newNumber == newBlackListNum)
  1280.   return TRUE;
  1281. }
  1282. return FALSE;
  1283. }
  1284. void HighlightBlackListAvailableIn(void)
  1285. {
  1286.     /*----------------------------------------------------------------*/
  1287.     /* Local Variables                                                */
  1288.     /*----------------------------------------------------------------*/
  1289.     /*----------------------------------------------------------------*/
  1290.     /* Code Body                                                      */
  1291.     /*----------------------------------------------------------------*/
  1292.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  1293.     SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1294.     SetLeftSoftkeyFunction(HighlightFirewallListAvailableIn, KEY_EVENT_UP);
  1295.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1296.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1297. }
  1298. void HighlightWhiteListNum(void)
  1299. {
  1300.     /*----------------------------------------------------------------*/
  1301.     /* Local Variables                                                */
  1302.     /*----------------------------------------------------------------*/
  1303.     U16 index;
  1304.     /*----------------------------------------------------------------*/
  1305.     /* Code Body                                                      */
  1306.     /*----------------------------------------------------------------*/
  1307.     for (index = 0; index < MAX_BLACK_LIST_NUMBER; index++)
  1308.     {
  1309.         pfnUnicodeStrcpy((PS8) dispFirewallListNum[index], (PS8) WhiteListNum[index]);
  1310.     }
  1311.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  1312.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  1313.     SetKeyHandler(EntryScrWhiteListNum, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1314.     SetLeftSoftkeyFunction(EntryScrWhiteListNum, KEY_EVENT_UP);
  1315.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1316.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1317. }
  1318. void HintBlackListAvailableIn(U16 index)
  1319. {
  1320. memset((S8*) hintData[index], 0, MAX_SUB_MENU_SIZE);
  1321. switch(GetFirewallListAvailableIn())
  1322. {
  1323. case FIREWALL_FORCALL:
  1324. pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_SETTING_FIREWALLAVAILABLEIN_CALL));
  1325. break;
  1326. case FIREWALL_FORSMS:
  1327. pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_SETTING_FIREWALLAVAILABLEIN_SMS));
  1328. break;
  1329. case FIREWALL_FORBOTH:
  1330. pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_SETTING_FIREWALLAVAILABLEIN_BOTH));
  1331. break;
  1332. default:
  1333. pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_SETTING_FIREWALLAVAILABLEIN_NONE));
  1334. break;
  1335. }
  1336. }
  1337. void EntryScrWhiteListNum(void)
  1338. {
  1339.     /*----------------------------------------------------------------*/
  1340.     /* Local Variables                                                */
  1341.     /*----------------------------------------------------------------*/
  1342.     U8 *guiBuffer;          /* Buffer holding history data */
  1343.     U8 *inputBuffer;        /* added for inline edit history */
  1344.     U16 inputBufferSize;    /* added for inline edit history */
  1345.     U16 index;
  1346.     U16 WhiteListNumImageList[MAX_BLACK_LIST_NUMBER];
  1347.     /*----------------------------------------------------------------*/
  1348.     /* Code Body                                                      */
  1349.     /*----------------------------------------------------------------*/
  1350.     /* 1 Call Exit Handler */
  1351.     EntryNewScreen(SCR_SETTING_WHITE_LIST_NUM, ExitScrWhiteListNum, NULL, NULL);
  1352.     /* 2 Get current screen to gui buffer  for history purposes */
  1353.     guiBuffer = GetCurrGuiBuffer(SCR_SETTING_WHITE_LIST_NUM);
  1354.     /* 3 Set current parent id */
  1355.     InitializeCategory57Screen();
  1356.     for (index = 0; index < MAX_BLACK_LIST_NUMBER; index++)
  1357.     {
  1358.         SetInlineItemActivation(&wgui_inline_items[index], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1359.         SetInlineItemTextEdit(
  1360.             &wgui_inline_items[index],
  1361.             (PU8) dispFirewallListNum[index],
  1362.             MAX_BLACK_LIST_NUMBER_LEN + 1,
  1363.             INPUT_TYPE_PHONE_NUMBER | INPUT_TYPE_PLUS_CHARACTER_HANDLING);
  1364.         DisableInlineItemHighlight(&wgui_inline_items[index]);
  1365. WhiteListNumImageList[index] = IMG_GLOBAL_L1 + index;
  1366.     }
  1367.     /* added for inline edit history */
  1368.     inputBuffer = GetCurrNInputBuffer(SCR_SETTING_BLACK_LIST_NUM, &inputBufferSize);
  1369.     RegisterHighlightHandler(SetCurrFirewallListNumIndex);
  1370.     /* added for inline edit history */
  1371.     if ((guiBuffer != NULL) && (guiBuffer[0] != 0))
  1372.     {
  1373.         /* sets the data */
  1374.         SetCategory57Data(wgui_inline_items, MAX_BLACK_LIST_NUMBER, inputBuffer);
  1375.     }
  1376.     /* DisableCategory57ScreenDone(); */
  1377.     ShowCategory57Screen(
  1378.         STR_SETTING_WHITE_LIST_NUM,
  1379.         MAIN_MENU_TITLE_SETTINGS_ICON,
  1380.         STR_GLOBAL_OK,
  1381.         IMG_GLOBAL_OK,
  1382.         STR_GLOBAL_BACK,
  1383.         IMG_GLOBAL_BACK,
  1384.         MAX_BLACK_LIST_NUMBER,
  1385.         WhiteListNumImageList,
  1386.         wgui_inline_items,
  1387.         0,
  1388.         guiBuffer);
  1389.     SetCategory57RightSoftkeyFunctions(EntryScrSetWhiteListNumConfirm, GoBackHistory);
  1390. }
  1391. void EntryScrSetWhiteListNumConfirm(void)
  1392. {
  1393.     DisplayConfirm(
  1394.         STR_GLOBAL_YES,
  1395.         IMG_GLOBAL_YES,
  1396.         STR_GLOBAL_NO,
  1397.         IMG_GLOBAL_NO,
  1398.         get_string(STR_GLOBAL_SAVE),
  1399.         IMG_GLOBAL_QUESTION,
  1400.         WARNING_TONE);
  1401.     SetLeftSoftkeyFunction(SetWhiteListNum, KEY_EVENT_UP);
  1402.     SetRightSoftkeyFunction(GoToWhiteList, KEY_EVENT_UP);
  1403. }
  1404. void ExitScrWhiteListNum(void)
  1405. {
  1406.     /*----------------------------------------------------------------*/
  1407.     /* Local Variables                                                */
  1408.     /*----------------------------------------------------------------*/
  1409.     history currHistory;
  1410.     U16 inputBufferSize;    /* added for inline edit history */
  1411.     S16 nHistory = 0;
  1412.     /*----------------------------------------------------------------*/
  1413.     /* Code Body                                                      */
  1414.     /*----------------------------------------------------------------*/
  1415.     CloseCategory57Screen();
  1416.     currHistory.scrnID = SCR_SETTING_BLACK_LIST_NUM;
  1417.     currHistory.entryFuncPtr = EntryScrWhiteListNum;
  1418.     pfnUnicodeStrcpy((S8*) currHistory.inputBuffer, (S8*) & nHistory);
  1419.     GetCategoryHistory(currHistory.guiBuffer);
  1420.     /* added for inline edit history */
  1421.     inputBufferSize = (U16) GetCategory57DataSize();
  1422.     GetCategory57Data((U8*) currHistory.inputBuffer);
  1423.     AddNHistory(currHistory, inputBufferSize);
  1424.     return;
  1425. }
  1426. void GoToWhiteList(void)
  1427. {
  1428.     GoBackToHistory(SCR_SETTING_BLACK_LIST);
  1429. }
  1430. void SetWhiteListNum(void)
  1431. {
  1432.     /*----------------------------------------------------------------*/
  1433.     /* Local Variables                                                */
  1434.     /*----------------------------------------------------------------*/
  1435.     U16 index;
  1436.     S16 error;
  1437.     /*----------------------------------------------------------------*/
  1438.     /* Code Body                                                      */
  1439.     /*----------------------------------------------------------------*/
  1440.     for (index = 0; index < MAX_BLACK_LIST_NUMBER; index++)
  1441.     {
  1442.         pfnUnicodeStrcpy((PS8) WhiteListNum[index], (PS8) dispFirewallListNum[index]);
  1443.     }
  1444.     WriteRecord(NVRAM_EF_WHITE_LIST_LID, 1, WhiteListNum, sizeof(WhiteListNum), &error);
  1445.     GoBackToHistory(SCR_SETTING_BLACK_LIST);
  1446. }
  1447. FIREWALL_MODE GetFirewallListMode(void)
  1448. {
  1449. return (gFirewallMode & FIREWALL_MODECOMP);
  1450. }
  1451. FIREWALL_MODE GetFirewallListAvailableIn(void)
  1452. {
  1453. if((gFirewallMode & FIREWALL_FORCALL) && (gFirewallMode & FIREWALL_FORSMS))
  1454. return FIREWALL_FORBOTH;
  1455. else if(gFirewallMode & FIREWALL_FORCALL)
  1456. return FIREWALL_FORCALL;
  1457. else if(gFirewallMode & FIREWALL_FORSMS)
  1458. return FIREWALL_FORSMS;
  1459. else 
  1460. return FIREWALL_FORNONE;
  1461. }
  1462. void Set_Firewall_SmsDeleteFlag(BOOL Flag)
  1463. {
  1464. Firewall_SmsInfo.Firewall_SMSDeleteFlag = Flag;
  1465. }
  1466. void Set_Firewall_SmsDeleteIndex(U16 Index)
  1467. {
  1468. Firewall_SmsInfo.Firewall_Index = Index;
  1469. }
  1470. FIREWALL_SMSINFO* Get_Firewall_SmsInfo(void)
  1471. {
  1472. return &Firewall_SmsInfo;
  1473. }
  1474. BOOL Call_GetNumFromFirewallList_InvailFlag(PU8 pNumber)
  1475. {
  1476. if(gFirewallMode & FIREWALL_FORCALL)
  1477. {
  1478. if((GetFirewallListMode() == FIREWALL_BLACKLIST && IsBlackListNum(pNumber) == TRUE) || (GetFirewallListMode() == FIREWALL_WHITELIST&& IsWhiteListNum(pNumber) == FALSE))
  1479. return TRUE;
  1480. else
  1481. return FALSE;
  1482. }
  1483. else
  1484. return FALSE;
  1485. }
  1486. BOOL Sms_GetNumFromFirewallList_InvailFlag(U32 pNumber)
  1487. {
  1488. if(gFirewallMode & FIREWALL_FORSMS)
  1489. {
  1490. if((GetFirewallListMode() == FIREWALL_BLACKLIST && IsBlackListNumsms(pNumber) == TRUE) || (GetFirewallListMode() == FIREWALL_WHITELIST && IsWhiteListNumsms(pNumber) == FALSE))
  1491. return TRUE;
  1492. else
  1493. return FALSE;
  1494. }
  1495. else
  1496. return FALSE;
  1497. }
  1498. void SetFirewallMode(void)
  1499. {
  1500. SetBlackListMode(curFirewallListNumIndex);
  1501. }
  1502. void EntryFirewallListMode(void)
  1503. {
  1504.     /*----------------------------------------------------------------*/
  1505.     /* Local Variables                                                */
  1506.     /*----------------------------------------------------------------*/
  1507.     U16 nStrItemList[] = 
  1508.     {
  1509.             STR_SETTING_FIREWALLMODE_CLOSE,           /* Disable */
  1510.             STR_SETTING_FIREWALLMODE_BLACK,
  1511.             STR_SETTING_FIREWALLMODE_WHITE
  1512.     };   
  1513.     U8 nNumofItem = 3;
  1514.     U8* guiBuffer;
  1515.     /*----------------------------------------------------------------*/
  1516.     /* Code Body                                                      */
  1517.     /*----------------------------------------------------------------*/
  1518.     EntryNewScreen(SCR_SETTING_FIREWALL_MODE_LIST, NULL, EntryFirewallListMode, NULL);
  1519.     guiBuffer = GetCurrGuiBuffer (SCR_SETTING_FIREWALL_MODE_LIST);
  1520.     RegisterHighlightHandler (SetCurrFirewallListNumIndex);
  1521.     ShowCategory11Screen (STR_SETTING_BLACK_LIST_MODE, 
  1522.      MAIN_MENU_TITLE_SETTINGS_ICON,
  1523.                                              STR_GLOBAL_OK, 0,
  1524.                                              STR_GLOBAL_BACK, 0,
  1525.                                              nNumofItem, 
  1526.                                              nStrItemList, 
  1527.                                              //g_fm_radio_cntx.StereoCurrValue, 
  1528.                                              gFirewallMode & FIREWALL_MODECOMP,
  1529.                                              guiBuffer);
  1530.     SetLeftSoftkeyFunction(SetFirewallMode,KEY_EVENT_UP);
  1531.     SetRightSoftkeyFunction(GoBackHistory,KEY_EVENT_UP);
  1532. }
  1533. void SetFirewallAvailableBack(void)
  1534. {
  1535. GoBacknHistory(1);
  1536. }
  1537. void SetFirewallAvailableIn(void)
  1538. {
  1539. /*----------------------------------------------------------------*/
  1540. /* Local Variables                                                */
  1541. /*----------------------------------------------------------------*/
  1542. S16 error;
  1543. /*----------------------------------------------------------------*/
  1544. /* Code Body                                                      */
  1545. /*----------------------------------------------------------------*/
  1546. gFirewallMode &= FIREWALL_MODECOMP;
  1547. if(fieldStatesAvailableIn[0])
  1548. {
  1549. gFirewallMode |=  FIREWALL_FORCALL;
  1550. }
  1551. if(fieldStatesAvailableIn[1])
  1552. {
  1553. gFirewallMode |=  FIREWALL_FORSMS;
  1554. }
  1555. WriteValue(NVRAM_BLACK_LIST_SETTING, &gFirewallMode, DS_BYTE, &error);
  1556. DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, SUCCESS_TONE);
  1557. DeleteUptoScrID(SCR_SETTING_BLACK_LIST);
  1558. }
  1559. void SetFirewallAvailablePopup(void)
  1560. {
  1561.     EntryScrProfilesQueryPopup(SetFirewallAvailableIn, SetFirewallAvailableBack);
  1562. }
  1563. void HighlightFirewallListAvailableIn(void)
  1564. {
  1565. /*----------------------------------------------------------------*/
  1566. /* Local Variables                                              */
  1567. /*----------------------------------------------------------------*/
  1568. //   U16 nStrItemList[15];   /* Stores the strings id of submenus returned */
  1569. U16 nNumofItem = 2;         /* Stores no of children in the submenu */
  1570. U8 i = 0;
  1571. U8 *guiBuffer;          /* Buffer holding history data */
  1572. U16 nStrItemList[] = 
  1573. {
  1574. STR_SETTING_FIREWALLAVAILABLEIN_CALL,           /* Disable */
  1575. STR_SETTING_FIREWALLAVAILABLEIN_SMS,
  1576. STR_SETTING_FIREWALLAVAILABLEIN_BOTH
  1577. }; 
  1578. /*----------------------------------------------------------------*/
  1579. /* Code Body                                                      */
  1580. /*----------------------------------------------------------------*/
  1581. /* 1 Call Exit Handler */
  1582. EntryNewScreen(SCR_SETTING_FIREWALL_AVAILABLEIN_LIST, NULL, HighlightFirewallListAvailableIn, NULL);
  1583. /* 2 Get current screen to gui buffer  for history purposes */
  1584. guiBuffer = GetCurrGuiBuffer(SCR_SETTING_FIREWALL_AVAILABLEIN_LIST);
  1585. for (i = 0; i < nNumofItem; i++)
  1586. {
  1587. memset((S8*) subMenuDataPtrs[i], 0, MAX_SUB_MENU_SIZE);
  1588. pfnUnicodeStrncpy((S8*) subMenuDataPtrs[i], GetString(nStrItemList[i]), MAX_SUBMENU_CHARACTERS);
  1589. }
  1590. RegisterHighlightHandler (SetCurrFirewallListNumIndex);
  1591. if(gFirewallMode&FIREWALL_FORCALL)
  1592. fieldStatesAvailableIn[0] = 1;
  1593. else
  1594. fieldStatesAvailableIn[0] = 0;
  1595. if(gFirewallMode&FIREWALL_FORSMS)
  1596. fieldStatesAvailableIn[1] = 1;
  1597. else
  1598. fieldStatesAvailableIn[1] = 0;
  1599. SetCheckboxToggleRightSoftkeyFunctions(SetFirewallAvailablePopup,GoBackHistory);
  1600. ShowCategory140Screen(
  1601. STR_SETTING_BLACK_LIST_AVAILABLEIN,
  1602. MAIN_MENU_TITLE_SETTINGS_ICON,
  1603. nNumofItem,
  1604. (U8 **) subMenuDataPtrs,
  1605. fieldStatesAvailableIn,
  1606. 0,
  1607. guiBuffer);
  1608. SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1609. }
  1610. #endif
  1611. //KP Jerry modify on 2007-4-26 end
  1612. #endif /* __MMI_CM_BLACK_LIST__ */ 
  1613. /* End by Julia */