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

MTK

开发平台:

C/C++

  1. /*****************************************************************************
  2. *  Copyright Statement:
  3. *  --------------------
  4. *  This software is protected by Copyright and the information contained
  5. *  herein is confidential. The software may not be copied and the information
  6. *  contained herein may not be used or disclosed except with the written
  7. *  permission of MediaTek Inc. (C) 2005
  8. *
  9. *  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  10. *  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  11. *  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
  12. *  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  13. *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  14. *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  15. *  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  16. *  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  17. *  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
  18. *  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
  19. *  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
  20. *  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
  21. *
  22. *  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
  23. *  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  24. *  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  25. *  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
  26. *  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
  27. *
  28. *  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
  29. *  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
  30. *  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
  31. *  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
  32. *  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
  33. *
  34. *****************************************************************************/
  35. /*******************************************************************************
  36.  * Filename:
  37.  * ---------
  38.  * BarredDialList.c
  39.  *
  40.  * Project:
  41.  * --------
  42.  *   MAUI
  43.  *
  44.  * Description:
  45.  * ------------
  46.  *   Barred Dial List related functions
  47.  *
  48.  * Author:
  49.  * -------
  50.  * -------
  51.  *
  52. *==============================================================================
  53.  *             HISTORY
  54.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
  55.  *------------------------------------------------------------------------------
  56.  * removed!
  57.  *
  58.  * removed!
  59.  * removed!
  60.  * removed!
  61.  *
  62.  * removed!
  63.  * removed!
  64.  * removed!
  65.  *
  66.  * removed!
  67.  * removed!
  68.  * removed!
  69.  *
  70.  * removed!
  71.  * removed!
  72.  * removed!
  73.  *
  74.  *------------------------------------------------------------------------------
  75.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
  76.  *============================================================================== 
  77.  *******************************************************************************/
  78. /**
  79.  * Copyright Notice
  80.  * (c) 2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
  81.  * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
  82.  *  (It is illegal to remove this copyright notice from this software or any
  83.  *  portion of it)
  84.  */
  85. /**************************************************************
  86.    FILENAME : CallBarredDialList.c
  87.    PURPOSE     : Call Setting Application
  88.    REMARKS     : nil
  89.    AUTHOR      : Deepali Gupta, Vanita Jain
  90.    DATE     : 
  91. **************************************************************/
  92. #include "StdC.h"
  93. #include "L4Dr1.h"
  94. #include "MainMenuDef.h"
  95. #include "ProtocolEvents.h"
  96. #include "wgui_categories.h"
  97. #include "PhoneBookDef.h"
  98. #include "SettingGprots.h"
  99. #include "BarredDialList.h"
  100. #include "CommonScreens.h"
  101. #include "PhoneBookGprot.h"
  102. #include "GSM7BitDefaultAlphabet.h"
  103. #include "SettingDefs.h"
  104. #include "SettingsGexdcl.h"
  105. #include "SettingsGdcl.h"
  106. #include "SecuritySetup.h"
  107. /* micha0901 */
  108. #include "ProfileGprots.h"
  109. #include "SimDetectionDef.h"
  110. /* MTK Leo add 20040608 */
  111. #include "wgui_categories_popup.h"
  112. #include "wgui_categories_inputs.h"
  113. /*****************************************************************************
  114.  * FUNCTION
  115.  *  InitBarredDialList
  116.  * DESCRIPTION
  117.  *  
  118.  * PARAMETERS
  119.  *  void
  120.  * RETURNS
  121.  *  void
  122.  *  Author            : Vanita Jain(?)
  123.  *****************************************************************************/
  124. void InitBarredDialList(void)
  125. {
  126.     /*----------------------------------------------------------------*/
  127.     /* Local Variables                                                */
  128.     /*----------------------------------------------------------------*/
  129.     /*----------------------------------------------------------------*/
  130.     /* Code Body                                                      */
  131.     /*----------------------------------------------------------------*/
  132.     SetHiliteHandler(MENU8236_BDL_VIEW_OPTIONS_ADD, HighlightAddBDlist);
  133.     SetHiliteHandler(MENU8236_BDL_VIEW_OPTIONS_EDIT, HighlightEditBDlist);
  134.     SetHiliteHandler(MENU8236_BDL_VIEW_OPTIONS_DELETE, HighlightDeleteBDlist);
  135.     gFDLBDLContext.FDNBDNCount = 0;
  136.     gFDLBDLContext.FDNBDNEdit = FALSE;
  137.     gFDLBDLContext.HighlightedBDN = 255;
  138. }
  139. /*****************************************************************************
  140.  * FUNCTION
  141.  *  SECSETGetBdlEntriesReq
  142.  * DESCRIPTION
  143.  *  Send req to L4 to Load BDL list
  144.  * PARAMETERS
  145.  *  void
  146.  * RETURNS
  147.  *  void
  148.  *  Author            : Vanita Jain(?)
  149.  *****************************************************************************/
  150. void SECSETGetBdlEntriesReq()
  151. {
  152.     /*----------------------------------------------------------------*/
  153.     /* Local Variables                                                */
  154.     /*----------------------------------------------------------------*/
  155.     MSG_PHB_GET_ENTRY_BY_INDEX_REQ_STRUCT *pMsgIndexReq = NULL;
  156.     MYQUEUE Message;
  157.     /*----------------------------------------------------------------*/
  158.     /* Code Body                                                      */
  159.     /*----------------------------------------------------------------*/
  160.     pMsgIndexReq =
  161.         (MSG_PHB_GET_ENTRY_BY_INDEX_REQ_STRUCT*) OslConstructDataPtr(sizeof(MSG_PHB_GET_ENTRY_BY_INDEX_REQ_STRUCT));
  162.     pMsgIndexReq->index = gFDLBDLContext.FDNBDNCount + 1;
  163.     pMsgIndexReq->record_index = 0xFFFF;
  164.     pMsgIndexReq->storage = MMI_SIM;
  165.     pMsgIndexReq->type = MMI_PHB_BDN;
  166.     pMsgIndexReq->no_data = MAX_ENTRIES_IN_LIST;
  167.     Message.oslSrcId = MOD_MMI;
  168.     Message.oslDestId = MOD_L4C;
  169.     Message.oslMsgId = PRT_PHB_GET_ENTRY_BY_INDEX_REQ;
  170.     Message.oslDataPtr = (oslParaType*) pMsgIndexReq;
  171.     Message.oslPeerBuffPtr = NULL;
  172.     SetProtocolEventHandler(SECSETGetBdlEntriesRsp, PRT_PHB_GET_ENTRY_BY_INDEX_RSP);
  173.     OslMsgSendExtQueue(&Message);
  174. }
  175. /*****************************************************************************
  176.  * FUNCTION
  177.  *  SECSETGetBdlEntriesRsp
  178.  * DESCRIPTION
  179.  *  Rsp handler of req to load BDL list.
  180.  * PARAMETERS
  181.  *  info        [?]     
  182.  * RETURNS
  183.  *  void
  184.  *  Author            : Vanita Jain(?)
  185.  *****************************************************************************/
  186. void SECSETGetBdlEntriesRsp(void *info)
  187. {
  188.     /*----------------------------------------------------------------*/
  189.     /* Local Variables                                                */
  190.     /*----------------------------------------------------------------*/
  191.     MSG_PHB_GET_ENTRY_BY_INDEX_RSP_STRUCT *localPtr;
  192.     U8 i = 0, j = 0;
  193.     /* micha0317 */
  194.     U8 TempBuff[(MAX_PB_NUMBER_LENGTH + 2) * ENCODING_LENGTH];
  195.     U8 *tmpConvertBuf = NULL;
  196.     U16 convertOutLen = 0;
  197.     /*----------------------------------------------------------------*/
  198.     /* Code Body                                                      */
  199.     /*----------------------------------------------------------------*/
  200.     localPtr = (MSG_PHB_GET_ENTRY_BY_INDEX_RSP_STRUCT*) info;
  201.     if (localPtr->result.flag == 0 /* OK */ )
  202.     {
  203.         i = gFDLBDLContext.FDNBDNCount;
  204.         gFDLBDLContext.FDNBDNCount += localPtr->no_list;    /* Add New entries count to BDL list count */
  205.         if (gFDLBDLContext.FDNBDNCount > MAX_SIM_ENTRIES)
  206.         {
  207.             gFDLBDLContext.FDNBDNCount = MAX_SIM_ENTRIES;
  208.         }
  209.         for (; i < gFDLBDLContext.FDNBDNCount; i++, j++)
  210.         {
  211.             gFDLBDLContext.FDLBDLEntries[i].storage = localPtr->list[j].storage;
  212.             gFDLBDLContext.FDLBDLEntries[i].index = localPtr->list[j].index;
  213.             gFDLBDLContext.FDLBDLEntries[i].record_index = localPtr->list[j].record_index;
  214.             memset(gFDLBDLContext.FDLBDLEntries[i].alpha_id.name, 0, MAX_NAME_LEN_FSB_LIST * ENCODING_LENGTH);
  215.             memset(gFDLBDLContext.FDLBDLEntries[i].tel.number, 0, MAX_NUMBER_LEN_FSB_LIST * ENCODING_LENGTH);
  216.             gFDLBDLContext.FDLBDLEntries[i].alpha_id.name_length = localPtr->list[j].alpha_id.name_length;
  217.             gFDLBDLContext.FDLBDLEntries[i].alpha_id.name_dcs = localPtr->list[j].alpha_id.name_dcs;
  218.             tmpConvertBuf = CovertStringForPlatform(
  219.                                 localPtr->list[j].alpha_id.name,
  220.                                 gFDLBDLContext.FDLBDLEntries[i].alpha_id.name_length,
  221.                                 gFDLBDLContext.FDLBDLEntries[i].alpha_id.name_dcs,
  222.                                 &convertOutLen);
  223.             gFDLBDLContext.FDLBDLEntries[i].alpha_id.name_length = (U8) convertOutLen;
  224.             if (pfnUnicodeStrlen((PS8) tmpConvertBuf) <= MAX_PB_NAME_LENGTH)
  225.             {
  226.                 pfnUnicodeStrcpy((PS8) gFDLBDLContext.FDLBDLEntries[i].alpha_id.name, (PS8) tmpConvertBuf);
  227.             }
  228.             else
  229.             {
  230.                 pfnUnicodeStrncpy(
  231.                     (PS8) gFDLBDLContext.FDLBDLEntries[i].alpha_id.name,
  232.                     (PS8) tmpConvertBuf,
  233.                     MAX_PB_NAME_LENGTH);
  234.             }
  235.             if (tmpConvertBuf != NULL)
  236.             {
  237.                 OslMfree(tmpConvertBuf);
  238.             }
  239.             if (localPtr->list[j].tel.type == MMI_CSMCC_INTERNATIONAL_ADDR)
  240.             {
  241.                 gFDLBDLContext.FDLBDLEntries[i].tel.type = localPtr->list[j].tel.type;
  242.                 gFDLBDLContext.FDLBDLEntries[i].tel.number[0] = '+';
  243.                 gFDLBDLContext.FDLBDLEntries[i].tel.length = localPtr->list[j].tel.length;
  244.                 AnsiiToUnicodeString((PS8) TempBuff, (PS8) localPtr->list[j].tel.number);
  245.                 memcpy(
  246.                     gFDLBDLContext.FDLBDLEntries[i].tel.number + ENCODING_LENGTH,
  247.                     TempBuff,
  248.                     (localPtr->list[j].tel.length) * ENCODING_LENGTH);
  249.             }
  250.             else
  251.             {
  252.                 gFDLBDLContext.FDLBDLEntries[i].tel.type = localPtr->list[j].tel.type;
  253.                 gFDLBDLContext.FDLBDLEntries[i].tel.length = localPtr->list[j].tel.length;
  254.                 AnsiiToUnicodeString((PS8) TempBuff, (PS8) localPtr->list[j].tel.number);
  255.                 memcpy(
  256.                     gFDLBDLContext.FDLBDLEntries[i].tel.number,
  257.                     (PS8) TempBuff,
  258.                     (localPtr->list[j].tel.length) * ENCODING_LENGTH);
  259.             }
  260.         }
  261.         if (localPtr->no_list == MAX_ENTRIES_IN_LIST)
  262.         {
  263.             SECSETGetBdlEntriesReq();
  264.         }
  265.         else
  266.         {
  267.             ViewBDList();
  268.         }
  269.     }
  270.     else if (localPtr->result.flag == 1 /* Failure */  && localPtr->result.cause == 5)
  271.     {
  272.         /* gFDLBDLContext.FDNBDNCount =0; */
  273.         ViewBDList();
  274.     }
  275.     else
  276.     {
  277.         DisplayPopup((PU8) GetString(STR_GLOBAL_UNFINISHED), IMG_GLOBAL_UNFINISHED, 1, ST_NOTIFYDURATION, ERROR_TONE);
  278.         DeleteUptoScrID(SCR_ID_SECSET_BAR_DIAL);
  279.     }
  280. }
  281. /*****************************************************************************
  282.  * FUNCTION
  283.  *  ViewBDList
  284.  * DESCRIPTION
  285.  *  go to view BDL list screen.
  286.  * PARAMETERS
  287.  *  void
  288.  * RETURNS
  289.  *  void
  290.  *  Author            : Vanita Jain(?)
  291.  *****************************************************************************/
  292. void ViewBDList()
  293. {
  294.     /*----------------------------------------------------------------*/
  295.     /* Local Variables                                                */
  296.     /*----------------------------------------------------------------*/
  297.     /*----------------------------------------------------------------*/
  298.     /* Code Body                                                      */
  299.     /*----------------------------------------------------------------*/
  300.     gFDLBDLContext.HighlightedBDN = 0;
  301.     EntrySECSETBDNList();
  302. }
  303. /*****************************************************************************
  304.  * FUNCTION
  305.  *  EntrySECSETBDNList
  306.  * DESCRIPTION
  307.  *  Entry fn to view BDL list
  308.  * PARAMETERS
  309.  *  void
  310.  * RETURNS
  311.  *  void
  312.  *  Author            : Vanita Jain(?)
  313.  *****************************************************************************/
  314. void EntrySECSETBDNList()
  315. {
  316.     /*----------------------------------------------------------------*/
  317.     /* Local Variables                                                */
  318.     /*----------------------------------------------------------------*/
  319.     U8 *pstbdlist[MAX_SIM_ENTRIES], *bdlHint[MAX_SIM_ENTRIES];
  320.     U16 index;
  321.     U8 *guiBuffer;
  322.     U16 bdlimagelist[MAX_SIM_ENTRIES];
  323.     /*----------------------------------------------------------------*/
  324.     /* Code Body                                                      */
  325.     /*----------------------------------------------------------------*/
  326.     EntryNewScreen(SCR_ID_SECSET_BDN_LIST, NULL, EntrySECSETBDNList, NULL);
  327.     guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_BDN_LIST);   /* Getting the Index from history */
  328.     for (index = 0; index < gFDLBDLContext.FDNBDNCount; index++)
  329.     {
  330.         if (pfnUnicodeStrlen((PS8) (gFDLBDLContext.FDLBDLEntries[index].alpha_id.name)) > 0)
  331.         {
  332.             pstbdlist[index] = (U8*) gFDLBDLContext.FDLBDLEntries[index].alpha_id.name;
  333.             bdlHint[index] = (U8*) gFDLBDLContext.FDLBDLEntries[index].tel.number;
  334.         }
  335.         else
  336.         {
  337.             pstbdlist[index] = (U8*) gFDLBDLContext.FDLBDLEntries[index].tel.number;
  338.             bdlHint[index] = NULL;
  339.         }
  340.         bdlimagelist[index] = IMG_STORAGE_SIM;
  341.     }
  342.     RegisterHighlightHandler(GetActiveBDLIndex);
  343.     if (guiBuffer != NULL)
  344.     {
  345.         memset((void*)guiBuffer, 0, 2);
  346.     }
  347.     if ((gFDLBDLContext.HighlightedBDN >= gFDLBDLContext.FDNBDNCount) && (gFDLBDLContext.FDNBDNCount > 0))
  348.     {
  349.         gFDLBDLContext.HighlightedBDN = gFDLBDLContext.FDNBDNCount - 1;
  350.     }
  351.     if (gFDLBDLContext.FDNBDNCount == 0)    /* If list is empty */
  352.     {
  353.         pstbdlist[0] = (U8*) GetString(STR_GLOBAL_EMPTY_LIST);
  354.         bdlimagelist[0] = 0;
  355.         bdlHint[0] = NULL;
  356.         ShowCategory6Screen(
  357.             STR_SCR8079_BDL_VIEW_LIST_CAPTION,
  358.             MAIN_MENU_TITLE_SETTINGS_ICON,
  359.             STR_GLOBAL_ADD,
  360.             IMG_GLOBAL_OPTIONS,
  361.             STR_GLOBAL_BACK,
  362.             IMG_GLOBAL_BACK,
  363.             1,
  364.             pstbdlist,
  365.             NULL,
  366.             0,
  367.             guiBuffer);
  368.         gFDLBDLContext.FDNBDNEdit = FALSE;
  369.         memset(gFDLBDLContext.FDLBDLName, 0, (MAX_NAME_LEN_FSB_LIST + 1) * ENCODING_LENGTH);
  370.         memset(gFDLBDLContext.FDLBDLNumber, 0, (MAX_NUMBER_LEN_FSB_LIST + 1 + 1) * ENCODING_LENGTH);
  371.         SetLeftSoftkeyFunction(EntrySECSETBDNDetails, KEY_EVENT_UP);
  372.         /* micha0529 */
  373.         SetKeyHandler(EntrySECSETBDNDetails, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  374.         SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  375.         SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  376.         SetKeyHandler(0, KEY_SEND, KEY_EVENT_UP);
  377.     }
  378.     else
  379.     {
  380.         ShowCategory53Screen(
  381.             STR_SCR8079_BDL_VIEW_LIST_CAPTION,
  382.             MAIN_MENU_TITLE_SETTINGS_ICON,
  383.             /* micha0610 */ STR_GLOBAL_OPTIONS,
  384.             IMG_GLOBAL_OPTIONS,
  385.             STR_GLOBAL_BACK,
  386.             IMG_GLOBAL_BACK,
  387.             gFDLBDLContext.FDNBDNCount,
  388.             pstbdlist,
  389.             bdlimagelist,
  390.             bdlHint,
  391.             0,
  392.             gFDLBDLContext.HighlightedBDN,
  393.             guiBuffer);
  394.         SetLeftSoftkeyFunction(EntrySECSETBDNOption, KEY_EVENT_UP);
  395.         /* micha0529 */
  396.         SetKeyHandler(EntrySECSETBDNOption, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  397.         SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  398.         SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  399.         SetKeyHandler(0, KEY_SEND, KEY_EVENT_UP);
  400.     }
  401. }
  402. /*****************************************************************************
  403.  * FUNCTION
  404.  *  ExitSECSETBDNListReload
  405.  * DESCRIPTION
  406.  *  
  407.  * PARAMETERS
  408.  *  void
  409.  * RETURNS
  410.  *  void
  411.  *  Author            : Vanita Jain(?)
  412.  *****************************************************************************/
  413. void ExitSECSETBDNListReload(void)
  414. {
  415.     /*----------------------------------------------------------------*/
  416.     /* Local Variables                                                */
  417.     /*----------------------------------------------------------------*/
  418.     history Scr;
  419.     S16 nHistory = 0;
  420.     /*----------------------------------------------------------------*/
  421.     /* Code Body                                                      */
  422.     /*----------------------------------------------------------------*/
  423.     DeleteScreenIfPresent(SCR_ID_SECSET_BDN_LIST);
  424.     Scr.scrnID = SCR_ID_SECSET_BDN_LIST;
  425.     Scr.entryFuncPtr = EntryBdlList;
  426.     pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) & nHistory);
  427.     GetCategoryHistory(Scr.guiBuffer);
  428.     AddHistory(Scr);
  429. }
  430. /*****************************************************************************
  431.  * FUNCTION
  432.  *  EntrySECSETBDNOption
  433.  * DESCRIPTION
  434.  *  Entry fn to view Options of BDL list screen
  435.  * PARAMETERS
  436.  *  void
  437.  * RETURNS
  438.  *  void
  439.  *  Author            : Vanita Jain(?)
  440.  *****************************************************************************/
  441. void EntrySECSETBDNOption()
  442. {
  443.     /*----------------------------------------------------------------*/
  444.     /* Local Variables                                                */
  445.     /*----------------------------------------------------------------*/
  446.     U16 nStrItemList[MAX_SUB_MENUS];    /* Stores the strings id of submenus returned */
  447.     U16 nNumofItem;                     /* Stores no of children in the submenu */
  448.     //micha1229
  449.     //      U16 nDispAttribute; /* Stores display attribue */
  450.     U8 *guiBuffer;              /* Buffer holding history data */
  451.     /*----------------------------------------------------------------*/
  452.     /* Code Body                                                      */
  453.     /*----------------------------------------------------------------*/
  454.     EntryNewScreen(SCR_ID_SECSET_BDN_OPTION, NULL, EntrySECSETBDNOption, NULL);
  455.     guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_BDN_OPTION);
  456.     nNumofItem = GetNumOfChild(MENU8236_BDL_VIEW_OPTIONS_MAIN);
  457.     /* nDispAttribute = GetDispAttributeOfItem(MENU8236_BDL_VIEW_OPTIONS_MAIN       ); */
  458.     GetSequenceStringIds(MENU8236_BDL_VIEW_OPTIONS_MAIN, nStrItemList);
  459.     SetParentHandler(MENU8236_BDL_VIEW_OPTIONS_MAIN);
  460.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  461.     /* micha0610 */
  462.     ShowCategory15Screen(
  463.         STR_GLOBAL_OPTIONS,
  464.         MAIN_MENU_TITLE_SETTINGS_ICON,
  465.         STR_GLOBAL_OK,
  466.         IMG_GLOBAL_OK,
  467.         STR_GLOBAL_BACK,
  468.         IMG_GLOBAL_BACK,
  469.         nNumofItem,
  470.         nStrItemList,
  471.         (PU16) gIndexIconsImageList,
  472.         LIST_MENU,
  473.         0,
  474.         guiBuffer);
  475.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  476. }
  477. /*****************************************************************************
  478.  * FUNCTION
  479.  *  GetActiveBDLIndex
  480.  * DESCRIPTION
  481.  *  Get index of currently highlighted BDL entry.
  482.  * PARAMETERS
  483.  *  index       [IN]        
  484.  * RETURNS
  485.  *  void
  486.  *  Author            : Vanita Jain(?)
  487.  *****************************************************************************/
  488. void GetActiveBDLIndex(S32 index)
  489. {
  490.     /*----------------------------------------------------------------*/
  491.     /* Local Variables                                                */
  492.     /*----------------------------------------------------------------*/
  493.     /*----------------------------------------------------------------*/
  494.     /* Code Body                                                      */
  495.     /*----------------------------------------------------------------*/
  496.     gFDLBDLContext.HighlightedBDN = (U8) index;
  497. }
  498. /*****************************************************************************
  499.  * FUNCTION
  500.  *  HighlightAddBDlist
  501.  * DESCRIPTION
  502.  *  Highlight handler of Add option
  503.  * PARAMETERS
  504.  *  void
  505.  * RETURNS
  506.  *  void
  507.  *  Author            : Vanita Jain(?)
  508.  *****************************************************************************/
  509. void HighlightAddBDlist()
  510. {
  511.     /*----------------------------------------------------------------*/
  512.     /* Local Variables                                                */
  513.     /*----------------------------------------------------------------*/
  514.     /*----------------------------------------------------------------*/
  515.     /* Code Body                                                      */
  516.     /*----------------------------------------------------------------*/
  517.     /* 1 Change left soft key icon and label */
  518.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  519.     /* 2 Change right soft key icon and label */
  520.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  521.     SetKeyHandler(EntrySECSETBDNDetails, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  522.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  523.     SetLeftSoftkeyFunction(EntrySECSETBDNDetails, KEY_EVENT_UP);
  524.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  525.     gFDLBDLContext.FDNBDNEdit = FALSE;
  526.     memset(gFDLBDLContext.FDLBDLName, 0, (MAX_NAME_LEN_FSB_LIST + 1) * ENCODING_LENGTH);
  527.     memset(gFDLBDLContext.FDLBDLNumber, 0, (MAX_NUMBER_LEN_FSB_LIST + 1 + 1) * ENCODING_LENGTH);
  528. }
  529. /*****************************************************************************
  530.  * FUNCTION
  531.  *  EntrySECSETBDNDetails
  532.  * DESCRIPTION
  533.  *  Main Inline edit entry sceen fn to add and edit a BDL entry.
  534.  * PARAMETERS
  535.  *  void
  536.  * RETURNS
  537.  *  void
  538.  *  Author            : Vanita Jain(?)
  539.  *****************************************************************************/
  540. void EntrySECSETBDNDetails(void)
  541. {
  542.     /*----------------------------------------------------------------*/
  543.     /* Local Variables                                                */
  544.     /*----------------------------------------------------------------*/
  545.     U16 nNumofItem; /* Stores no of children in the submenu */
  546.     //micha1229
  547.     //      U16 nDispAttribute; /* Stores display attribue */
  548.     U8 *guiBuffer;              /* Buffer holding history data */
  549.     U16 ItemIcons[2];
  550.     U8 *inputBuffer;            /* added for inline edit history */
  551.     U16 inputBufferSize;        /* added for inline edit history */
  552.     /*----------------------------------------------------------------*/
  553.     /* Code Body                                                      */
  554.     /*----------------------------------------------------------------*/
  555.     if ((gFDLBDLContext.FDNBDNCount == (U16) gFDLBDLContext.MaxBDL || gFDLBDLContext.FDNBDNCount == MAX_SIM_ENTRIES) &&
  556.         (gFDLBDLContext.FDNBDNEdit == FALSE))
  557.     {
  558.         DisplayPopup(
  559.             (U8*) GetString(STR_SETTING_STORAGE_FULL),
  560.             IMG_GLOBAL_WARNING,
  561.             0,
  562.             ST_NOTIFYDURATION,
  563.             (U8) WARNING_TONE);
  564.     }
  565.     else
  566.     {
  567.         EntryNewScreen(SCR_ID_SECSET_BDN_DETAILS, ExitSECSETBDNDetails, NULL, NULL);
  568.         guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_BDN_DETAILS);
  569.         inputBuffer = GetCurrNInputBuffer(SCR_ID_SECSET_BDN_DETAILS, &inputBufferSize); /* added for inline edit history */
  570.         nNumofItem = GetNumOfChild(MENU8236_BDL_VIEW_OPTIONS_ADD);
  571.         /* nDispAttribute = GetDispAttributeOfItem(MENU8236_BDL_VIEW_OPTIONS_ADD); */
  572.         GetSequenceImageIds(MENU8236_BDL_VIEW_OPTIONS_ADD, ItemIcons);
  573.         InitializeCategory57Screen();
  574.         FillBdlInlineEditStruct();
  575.         if (inputBuffer != NULL)    /* added for inline edit history */
  576.         {
  577.             SetCategory57Data(gFDLBDLContext.FDLBDLInlineDisplay, nNumofItem, inputBuffer);     /* sets the data */
  578.         }
  579.         ShowCategory57Screen(
  580.             STR_SETTING_FDL_EDIT_ENTRY,
  581.             MAIN_MENU_TITLE_SETTINGS_ICON,
  582.             STR_EDIT,
  583.             IMG_GLOBAL_OK,
  584.             STR_DONE,
  585.             IMG_GLOBAL_BACK,
  586.             nNumofItem,
  587.             ItemIcons,
  588.             gFDLBDLContext.FDLBDLInlineDisplay,
  589.             0,
  590.             guiBuffer);
  591.         SetCategory57RightSoftkeyFunctions(PreNewBdlEntryReq, GoBackHistory);
  592.     }
  593. }
  594. /*****************************************************************************
  595.  * FUNCTION
  596.  *  ExitSECSETBDNDetails
  597.  * DESCRIPTION
  598.  *  
  599.  * PARAMETERS
  600.  *  void
  601.  * RETURNS
  602.  *  void
  603.  *  Author            : Vanita Jain(?)
  604.  *****************************************************************************/
  605. void ExitSECSETBDNDetails(void)
  606. {
  607.     /*----------------------------------------------------------------*/
  608.     /* Local Variables                                                */
  609.     /*----------------------------------------------------------------*/
  610.     history Scr;    /* Variable to hold the history data */
  611.     S16 nHistory = 0;
  612.     U16 size;
  613.     /*----------------------------------------------------------------*/
  614.     /* Code Body                                                      */
  615.     /*----------------------------------------------------------------*/
  616.     CloseCategory57Screen();
  617.     Scr.scrnID = SCR_ID_SECSET_BDN_DETAILS;
  618.     Scr.entryFuncPtr = EntrySECSETBDNDetails;
  619.     pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) & nHistory);
  620.     GetCategory57History(Scr.guiBuffer);
  621.     size = (U16) GetCategory57DataSize();       /* added for inline edit history */
  622.     GetCategory57Data((U8*) Scr.inputBuffer);   /* added for inline edit history */
  623.     AddNHistory(Scr, size);
  624. }
  625. /*****************************************************************************
  626.  * FUNCTION
  627.  *  FillBdlInlineEditStruct
  628.  * DESCRIPTION
  629.  *  Fill Inline Edit structs.
  630.  * PARAMETERS
  631.  *  void
  632.  * RETURNS
  633.  *  void
  634.  *  Author            : Vanita Jain(?)
  635.  *****************************************************************************/
  636. void FillBdlInlineEditStruct(void)
  637. {
  638.     /*----------------------------------------------------------------*/
  639.     /* Local Variables                                                */
  640.     /*----------------------------------------------------------------*/
  641.     /*----------------------------------------------------------------*/
  642.     /* Code Body                                                      */
  643.     /*----------------------------------------------------------------*/
  644.     SetInlineItemActivation(&gFDLBDLContext.FDLBDLInlineDisplay[0], KEY_LSK, KEY_EVENT_UP);
  645.     SetInlineItemFullScreenEdit_ext(
  646.         &gFDLBDLContext.FDLBDLInlineDisplay[0],
  647.         STR_SETTING_FDL_NAME,
  648.         MAIN_MENU_TITLE_SETTINGS_ICON,
  649.         (PU8) gFDLBDLContext.FDLBDLName,
  650.         g_phb_cntx.bdn_name_len + 1,
  651.         INPUT_TYPE_ALPHANUMERIC_UPPERCASE | INPUT_TYPE_USE_ENCODING_BASED_LENGTH | INPUT_TYPE_ONE_LESS_CHARACTER,
  652.         INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
  653.     SetInlineFullScreenEditCustomFunction(&gFDLBDLContext.FDLBDLInlineDisplay[0], SettingInlineCustomFunction);
  654.     SetInlineItemActivation(&gFDLBDLContext.FDLBDLInlineDisplay[1], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  655.     SetInlineItemTextEdit(
  656.         &gFDLBDLContext.FDLBDLInlineDisplay[1],
  657.         (PU8) gFDLBDLContext.FDLBDLNumber,
  658.         MAX_PB_NUMBER_LENGTH + 1,
  659.         INPUT_TYPE_PHONE_NUMBER | INPUT_TYPE_PLUS_CHARACTER_HANDLING);
  660.     DisableInlineItemHighlight(&gFDLBDLContext.FDLBDLInlineDisplay[1]);
  661. }
  662. /*****************************************************************************
  663.  * FUNCTION
  664.  *  PreNewBdlEntryReq
  665.  * DESCRIPTION
  666.  *  Funtion to be called after press of button save.
  667.  * PARAMETERS
  668.  *  void
  669.  * RETURNS
  670.  *  void
  671.  *  Author            : Vanita Jain(?)
  672.  *****************************************************************************/
  673. void PreNewBdlEntryReq()
  674. {
  675.     /*----------------------------------------------------------------*/
  676.     /* Local Variables                                                */
  677.     /*----------------------------------------------------------------*/
  678.     /*----------------------------------------------------------------*/
  679.     /* Code Body                                                      */
  680.     /*----------------------------------------------------------------*/
  681.     if (!pfnUnicodeStrlen((PS8) gFDLBDLContext.FDLBDLNumber) && !pfnUnicodeStrlen((PS8) gFDLBDLContext.FDLBDLName))
  682.     {
  683.         GoBackHistory();
  684.     }
  685.     else
  686.     {
  687.         EntrySECSETBDNSaveConfirm();
  688.     }
  689. }
  690. /*****************************************************************************
  691.  * FUNCTION
  692.  *  EntrySECSETBDNSaveConfirm
  693.  * DESCRIPTION
  694.  *  Entry fn to confirm Entry save.
  695.  * PARAMETERS
  696.  *  void
  697.  * RETURNS
  698.  *  void
  699.  *  Author            : Vanita Jain(?)
  700.  *****************************************************************************/
  701. void EntrySECSETBDNSaveConfirm(void)
  702. {
  703.     /*----------------------------------------------------------------*/
  704.     /* Local Variables                                                */
  705.     /*----------------------------------------------------------------*/
  706.     /*----------------------------------------------------------------*/
  707.     /* Code Body                                                      */
  708.     /*----------------------------------------------------------------*/
  709.     DisplayConfirm(
  710.         STR_GLOBAL_YES,
  711.         IMG_GLOBAL_YES,
  712.         STR_GLOBAL_NO,
  713.         IMG_GLOBAL_NO,
  714.         get_string(STR_GLOBAL_SAVE),
  715.         IMG_GLOBAL_QUESTION,
  716.         WARNING_TONE);
  717.     gSecuritySetupContext.VerifyPassSuccessCallBack = SECSETSetBdlEntryReq;
  718.     SetRightSoftkeyFunction(GoToBDLList, KEY_EVENT_UP);
  719.     SetLeftSoftkeyFunction(SECSETGetPIN2StatusReq, KEY_EVENT_UP);
  720. }
  721. /*****************************************************************************
  722.  * FUNCTION
  723.  *  ExitSECSETBDNSaveConfirm
  724.  * DESCRIPTION
  725.  *  
  726.  * PARAMETERS
  727.  *  void
  728.  * RETURNS
  729.  *  void
  730.  *****************************************************************************/
  731. void ExitSECSETBDNSaveConfirm(void)
  732. {
  733.     /*----------------------------------------------------------------*/
  734.     /* Local Variables                                                */
  735.     /*----------------------------------------------------------------*/
  736.     /*----------------------------------------------------------------*/
  737.     /* Code Body                                                      */
  738.     /*----------------------------------------------------------------*/
  739.     /* micha0531 */
  740.     stopRequestedTone(WARNING_TONE);
  741. }
  742. /*****************************************************************************
  743.  * FUNCTION
  744.  *  SECSETSetBdlEntryReq
  745.  * DESCRIPTION
  746.  *  Fn to to called to send req to L4 to add entry
  747.  *  in Bdl list after confirmation of PIN2.
  748.  * PARAMETERS
  749.  *  void
  750.  * RETURNS
  751.  *  void
  752.  *  Author            : Vanita Jain(?)
  753.  *****************************************************************************/
  754. void SECSETSetBdlEntryReq()
  755. {
  756.     /*----------------------------------------------------------------*/
  757.     /* Local Variables                                                */
  758.     /*----------------------------------------------------------------*/
  759.     MSG_PHB_SET_ENRTY_REQ_STRUCT *pMsgNewEntry = NULL;
  760.     MYQUEUE Message;
  761.     U8 pbNumber_ASCII[MAX_PB_NUMBER_LENGTH + 1];
  762.     /*----------------------------------------------------------------*/
  763.     /* Code Body                                                      */
  764.     /*----------------------------------------------------------------*/
  765.     EntrySECSETFDNBDNSaving();
  766.     pMsgNewEntry = (MSG_PHB_SET_ENRTY_REQ_STRUCT*) OslConstructDataPtr(sizeof(MSG_PHB_SET_ENRTY_REQ_STRUCT));
  767.     pMsgNewEntry->type = MMI_PHB_BDN;
  768.     pMsgNewEntry->no_data = 1;
  769.     pMsgNewEntry->list.storage = MMI_SIM;
  770.     pMsgNewEntry->list.index = 0xFFFF;          /* For New Entry It should Always be 0xFFFF; */
  771.     pMsgNewEntry->list.record_index = 0xFFFF;   /* For New Entry It should be alaways 0xFFFF */
  772.     if (gFDLBDLContext.FDNBDNEdit)  /* If entry is edited */
  773.     {
  774.         pMsgNewEntry->list.index = gFDLBDLContext.FDLBDLEntries[gFDLBDLContext.HighlightedBDN].index;
  775.         pMsgNewEntry->list.record_index = gFDLBDLContext.FDLBDLEntries[gFDLBDLContext.HighlightedBDN].record_index;
  776.     }
  777.     if (gFDLBDLContext.FDLBDLNumber[0] == '+')  /* if number is international */
  778.     {
  779.         pMsgNewEntry->list.tel.type = MMI_CSMCC_INTERNATIONAL_ADDR;     /* INTERNATIONAL */
  780.         pMsgNewEntry->list.tel.length =
  781.             (U8) pfnUnicodeStrlen((const S8*)(gFDLBDLContext.FDLBDLNumber + ENCODING_LENGTH));
  782.         UnicodeToAnsii((PS8) pbNumber_ASCII, (PS8) (gFDLBDLContext.FDLBDLNumber + ENCODING_LENGTH));
  783.         memcpy(pMsgNewEntry->list.tel.number, pbNumber_ASCII, strlen((PS8) pbNumber_ASCII) + 1);
  784.     }
  785.     else
  786.     {
  787.         pMsgNewEntry->list.tel.type = MMI_CSMCC_DEFAULT_ADDR_TYPE;      /* DEFAULT */
  788.         pMsgNewEntry->list.tel.length = (U8) pfnUnicodeStrlen((PS8) gFDLBDLContext.FDLBDLNumber);
  789.         UnicodeToAnsii((PS8) pbNumber_ASCII, (PS8) gFDLBDLContext.FDLBDLNumber);
  790.         memcpy(pMsgNewEntry->list.tel.number, pbNumber_ASCII, strlen((PS8) pbNumber_ASCII) + 1);
  791.     }
  792.     if (GetUCS2Flag((PS8) gFDLBDLContext.FDLBDLName))
  793.     {
  794.         pMsgNewEntry->list.alpha_id.name_dcs = MMI_PHB_UCS2;
  795.         pMsgNewEntry->list.alpha_id.name_length =
  796.             ((U8) pfnUnicodeStrlen((PS8) gFDLBDLContext.FDLBDLName)) * ENCODING_LENGTH;
  797.         BigEndianToLittleEndian((PS8) pMsgNewEntry->list.alpha_id.name, (PS8) gFDLBDLContext.FDLBDLName);
  798.     }
  799.     else
  800.     {
  801.         pMsgNewEntry->list.alpha_id.name_dcs = MMI_PHB_ASCII;
  802.         pMsgNewEntry->list.alpha_id.name_length = (U8) pfnUnicodeStrlen((PS8) gFDLBDLContext.FDLBDLName);
  803.         UnicodeToAnsii((PS8) pMsgNewEntry->list.alpha_id.name, (PS8) gFDLBDLContext.FDLBDLName);
  804.         PhbAsciiToGSM7Bit(pMsgNewEntry->list.alpha_id.name);
  805.     }
  806.     Message.oslSrcId = MOD_MMI;
  807.     Message.oslDestId = MOD_L4C;
  808.     Message.oslMsgId = PRT_PHB_SET_ENTRY_REQ;
  809.     Message.oslDataPtr = (oslParaType*) pMsgNewEntry;
  810.     Message.oslPeerBuffPtr = NULL;
  811.     DeleteUptoScrID(SCR_ID_SECSET_BDN_LIST);
  812.     DeleteScreenIfPresent(SCR_ID_SECSET_BDN_LIST);
  813.     ExitSECSETBDNListReload();
  814.     SetProtocolEventHandler(SECSETSetBdlEntryRsp, PRT_PHB_SET_ENTRY_RSP);
  815.     OslMsgSendExtQueue(&Message);
  816. }
  817. /*****************************************************************************
  818.  * FUNCTION
  819.  *  SECSETSetBdlEntryRsp
  820.  * DESCRIPTION
  821.  *  Rsp handler to add new entry in BDL.
  822.  * PARAMETERS
  823.  *  info        [?]     
  824.  * RETURNS
  825.  *  void
  826.  *  Author            : Vanita Jain(?)
  827.  *****************************************************************************/
  828. void SECSETSetBdlEntryRsp(void *info)
  829. {
  830.     /*----------------------------------------------------------------*/
  831.     /* Local Variables                                                */
  832.     /*----------------------------------------------------------------*/
  833.     MSG_PHB_SET_ENRTY_RSP_STRUCT *localPtr;
  834.     /*----------------------------------------------------------------*/
  835.     /* Code Body                                                      */
  836.     /*----------------------------------------------------------------*/
  837.     localPtr = (MSG_PHB_SET_ENRTY_RSP_STRUCT*) info;
  838.     if (localPtr->result.flag == 0)
  839.     {
  840.         DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, SUCCESS_TONE);
  841.     }
  842.     else if (localPtr->result.cause == MMI_SIM_EF_RECORD_FULL)
  843.     {
  844.         DisplayPopup(
  845.             (PU8) GetString(STR_NOT_SAVED_NUMBER_TOO_LONG),
  846.             IMG_GLOBAL_ERROR,
  847.             1,
  848.             ST_NOTIFYDURATION,
  849.             ERROR_TONE);
  850.     }
  851.     else
  852.     {
  853.         DisplayPopup((PU8) GetString(STR_GLOBAL_UNFINISHED), IMG_GLOBAL_UNFINISHED, 1, ST_NOTIFYDURATION, ERROR_TONE);
  854.     }
  855.     gFDLBDLContext.FDNBDNEdit = FALSE;
  856.     DeleteUptoScrID(SCR_ID_SECSET_BDN_LIST);
  857. }
  858. /*****************************************************************************
  859.  * FUNCTION
  860.  *  HighlightEditBDlist
  861.  * DESCRIPTION
  862.  *  Highlight handler of Edit option.
  863.  * PARAMETERS
  864.  *  void
  865.  * RETURNS
  866.  *  void
  867.  *  Author            : Vanita Jain(?)
  868.  *****************************************************************************/
  869. void HighlightEditBDlist()
  870. {
  871.     /*----------------------------------------------------------------*/
  872.     /* Local Variables                                                */
  873.     /*----------------------------------------------------------------*/
  874.     /*----------------------------------------------------------------*/
  875.     /* Code Body                                                      */
  876.     /*----------------------------------------------------------------*/
  877.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  878.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  879.     SetKeyHandler(EntrySECSETBDNDetails, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  880.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  881.     SetLeftSoftkeyFunction(EntrySECSETBDNDetails, KEY_EVENT_UP);
  882.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  883.     pfnUnicodeStrcpy(
  884.         (S8*) gFDLBDLContext.FDLBDLName,
  885.         (S8*) gFDLBDLContext.FDLBDLEntries[gFDLBDLContext.HighlightedBDN].alpha_id.name);
  886.     pfnUnicodeStrcpy(
  887.         (S8*) gFDLBDLContext.FDLBDLNumber,
  888.         (S8*) gFDLBDLContext.FDLBDLEntries[gFDLBDLContext.HighlightedBDN].tel.number);
  889.     gFDLBDLContext.FDNBDNEdit = TRUE;
  890. }
  891. /*****************************************************************************
  892.  * FUNCTION
  893.  *  HighlightDeleteBDlist
  894.  * DESCRIPTION
  895.  *  Highlight handler Of dlete option
  896.  * PARAMETERS
  897.  *  void
  898.  * RETURNS
  899.  *  void
  900.  *  Author            : Vanita Jain(?)
  901.  *****************************************************************************/
  902. void HighlightDeleteBDlist()
  903. {
  904.     /*----------------------------------------------------------------*/
  905.     /* Local Variables                                                */
  906.     /*----------------------------------------------------------------*/
  907.     /*----------------------------------------------------------------*/
  908.     /* Code Body                                                      */
  909.     /*----------------------------------------------------------------*/
  910.     //micha0811
  911.     //      SetKeyHandler(EntrySECSETBDNDelConfirm, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  912.     ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  913.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  914.     SetLeftSoftkeyFunction(EntrySECSETBDNDelConfirm, KEY_EVENT_UP);
  915.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  916. }
  917. /*****************************************************************************
  918.  * FUNCTION
  919.  *  EntrySECSETBDNDelConfirm
  920.  * DESCRIPTION
  921.  *  Entry screen to confirm delete operation from user.
  922.  * PARAMETERS
  923.  *  void
  924.  * RETURNS
  925.  *  void
  926.  *  Author            : Vanita Jain(?)
  927.  *****************************************************************************/
  928. void EntrySECSETBDNDelConfirm()
  929. {
  930.     /*----------------------------------------------------------------*/
  931.     /* Local Variables                                                */
  932.     /*----------------------------------------------------------------*/
  933.     /*----------------------------------------------------------------*/
  934.     /* Code Body                                                      */
  935.     /*----------------------------------------------------------------*/
  936.     DisplayConfirm(
  937.         STR_GLOBAL_YES,
  938.         IMG_GLOBAL_YES,
  939.         STR_GLOBAL_NO,
  940.         IMG_GLOBAL_NO,
  941.         get_string(STR_DELETE_QUERY_MSG),
  942.         IMG_GLOBAL_QUESTION,
  943.         WARNING_TONE);
  944.     gSecuritySetupContext.VerifyPassSuccessCallBack = SECSETDelBdlReq;
  945.     SetLeftSoftkeyFunction(SECSETGetPIN2StatusReq, KEY_EVENT_UP);
  946.     SetRightSoftkeyFunction(GoToBDLList, KEY_EVENT_UP);
  947. }
  948. /*****************************************************************************
  949.  * FUNCTION
  950.  *  ExitSECSETBDNDelConfirm
  951.  * DESCRIPTION
  952.  *  
  953.  * PARAMETERS
  954.  *  void
  955.  * RETURNS
  956.  *  void
  957.  *  Author            : Vanita Jain(?)
  958.  *****************************************************************************/
  959. void ExitSECSETBDNDelConfirm()
  960. {
  961.     /*----------------------------------------------------------------*/
  962.     /* Local Variables                                                */
  963.     /*----------------------------------------------------------------*/
  964.     /*----------------------------------------------------------------*/
  965.     /* Code Body                                                      */
  966.     /*----------------------------------------------------------------*/
  967.     /* micha0531 */
  968.     stopRequestedTone(WARNING_TONE);
  969. }
  970. /*****************************************************************************
  971.  * FUNCTION
  972.  *  SECSETDelBdlReq
  973.  * DESCRIPTION
  974.  *  After PIN2 verification, send req to l4 to delete selected BDL entry.
  975.  * PARAMETERS
  976.  *  void
  977.  * RETURNS
  978.  *  void
  979.  *  Author            : Vanita Jain(?)
  980.  *****************************************************************************/
  981. void SECSETDelBdlReq()
  982. {
  983.     /*----------------------------------------------------------------*/
  984.     /* Local Variables                                                */
  985.     /*----------------------------------------------------------------*/
  986.     MSG_PHB_DELETE_ENTRY_REQ_STRUCT *pMsgDelEntry = NULL;
  987.     MYQUEUE Message;
  988.     /*----------------------------------------------------------------*/
  989.     /* Code Body                                                      */
  990.     /*----------------------------------------------------------------*/
  991.     EntrySECSETFDNBDNDeleting();
  992.     pMsgDelEntry = (MSG_PHB_DELETE_ENTRY_REQ_STRUCT*) OslConstructDataPtr(sizeof(MSG_PHB_DELETE_ENTRY_REQ_STRUCT));
  993.     pMsgDelEntry->no_data = 1;
  994.     pMsgDelEntry->del_all = MMI_FALSE;  /* No */
  995.     pMsgDelEntry->index = gFDLBDLContext.FDLBDLEntries[gFDLBDLContext.HighlightedBDN].index;
  996.     pMsgDelEntry->type = MMI_PHB_BDN;   /* PHB_PHONEBOOK */
  997.     Message.oslSrcId = MOD_MMI;
  998.     Message.oslDestId = MOD_L4C;
  999.     Message.oslMsgId = PRT_PHB_DEL_ENTRY_REQ;
  1000.     Message.oslDataPtr = (oslParaType*) pMsgDelEntry;
  1001.     Message.oslPeerBuffPtr = NULL;
  1002.     DeleteUptoScrID(SCR_ID_SECSET_BDN_LIST);
  1003.     DeleteScreenIfPresent(SCR_ID_SECSET_BDN_LIST);
  1004.     ExitSECSETBDNListReload();
  1005.     SetProtocolEventHandler(SECSETDelBdlRsp, PRT_PHB_DEL_ENTRY_RSP);
  1006.     OslMsgSendExtQueue(&Message);
  1007. }
  1008. /*****************************************************************************
  1009.  * FUNCTION
  1010.  *  SECSETDelBdlRsp
  1011.  * DESCRIPTION
  1012.  *  Rsp handler L4 req to delete entry in BDL.
  1013.  * PARAMETERS
  1014.  *  info        [?]     
  1015.  * RETURNS
  1016.  *  void
  1017.  *  Author            : Vanita Jain(?)
  1018.  *****************************************************************************/
  1019. void SECSETDelBdlRsp(void *info)
  1020. {
  1021.     /*----------------------------------------------------------------*/
  1022.     /* Local Variables                                                */
  1023.     /*----------------------------------------------------------------*/
  1024.     MSG_PHB_DELETE_ENTRY_RSP_STRUCT *localPtr;
  1025.     /*----------------------------------------------------------------*/
  1026.     /* Code Body                                                      */
  1027.     /*----------------------------------------------------------------*/
  1028.     localPtr = (MSG_PHB_DELETE_ENTRY_RSP_STRUCT*) info;
  1029.     if (localPtr->result.flag == 0 /* OK */ )
  1030.     {
  1031.         DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, SUCCESS_TONE);
  1032.     }
  1033.     else
  1034.     {
  1035.         DisplayPopup((PU8) GetString(STR_GLOBAL_UNFINISHED), IMG_GLOBAL_UNFINISHED, 1, ST_NOTIFYDURATION, ERROR_TONE);
  1036.     }
  1037.     DeleteUptoScrID(SCR_ID_SECSET_BDN_LIST);
  1038. }
  1039. /*****************************************************************************
  1040.  * FUNCTION
  1041.  *  GoToBDLList
  1042.  * DESCRIPTION
  1043.  *  Go to view BDL list.
  1044.  * PARAMETERS
  1045.  *  void
  1046.  * RETURNS
  1047.  *  void
  1048.  *  Author            : Vanita Jain(?)
  1049.  *****************************************************************************/
  1050. void GoToBDLList(void)
  1051. {
  1052.     /*----------------------------------------------------------------*/
  1053.     /* Local Variables                                                */
  1054.     /*----------------------------------------------------------------*/
  1055.     /*----------------------------------------------------------------*/
  1056.     /* Code Body                                                      */
  1057.     /*----------------------------------------------------------------*/
  1058.     GoBackToHistory(SCR_ID_SECSET_BDN_LIST);
  1059. }
  1060. /*****************************************************************************
  1061.  * FUNCTION
  1062.  *  EntryBdlList
  1063.  * DESCRIPTION
  1064.  *  Check if Phone Book is ready, if yes then Enter in BDL List screen.
  1065.  * PARAMETERS
  1066.  *  void
  1067.  * RETURNS
  1068.  *  void
  1069.  *****************************************************************************/
  1070. void EntryBdlList(void)
  1071. {
  1072.     /*----------------------------------------------------------------*/
  1073.     /* Local Variables                                                */
  1074.     /*----------------------------------------------------------------*/
  1075.     /*----------------------------------------------------------------*/
  1076.     /* Code Body                                                      */
  1077.     /*----------------------------------------------------------------*/
  1078.     ClearInputEventHandler(MMI_DEVICE_ALL); /* need to reload the FDL list screen and no input can be accepted */
  1079.     ClearKeyHandler(KEY_END, KEY_EVENT_UP);
  1080.     ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
  1081.     ClearKeyHandler(KEY_END, KEY_LONG_PRESS);
  1082.     ClearKeyHandler(KEY_END, KEY_REPEAT);
  1083.     if (g_phb_cntx.phb_ready)
  1084.     {
  1085.         gFDLBDLContext.FDNBDNCount = 0;
  1086.         SECSETGetBdlEntriesReq();
  1087.     }
  1088.     else
  1089.     {
  1090.         DisplayPopup((PU8) GetString(STR_BDL_NOT_READY), IMG_PROCESSING_PHONEBOOK, 1, ST_NOTIFYDURATION, 0);
  1091.     }
  1092. }