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

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.  * CallFixedDialList.c
  39.  *
  40.  * Project:
  41.  * --------
  42.  *   MAUI
  43.  *
  44.  * Description:
  45.  * ------------
  46.  *   Fixed Dial List 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 : CallFixedDialList.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 "PhoneBookDef.h"
  97. #include "wgui_categories.h"
  98. #include "SettingGprots.h"
  99. #include "CallFixedDial.h"
  100. #include "CommonScreens.h"
  101. #include "CallManagementGprot.h"
  102. #include "PhoneBookGprot.h"
  103. #include "GSM7BitDefaultAlphabet.h"
  104. #include "SettingDefs.h"
  105. #include "SettingsGexdcl.h"
  106. #include "SettingsGdcl.h"
  107. #include "SecuritySetup.h"
  108. /* micha0901 */
  109. #include "ProfileGprots.h"
  110. #include "SimDetectionDef.h"
  111. /* MTK Leo add 20040608 */
  112. #include "wgui_categories_popup.h"
  113. #include "wgui_categories_inputs.h"
  114. FDLBDLContext gFDLBDLContext;
  115. /*****************************************************************************
  116.  * FUNCTION
  117.  *  InitFixedDialList
  118.  * DESCRIPTION
  119.  *  Initialize FDL.
  120.  * PARAMETERS
  121.  *  void
  122.  * RETURNS
  123.  *  void
  124.  *  Author            : Vanita Jain(?)
  125.  *****************************************************************************/
  126. void InitFixedDialList(void)
  127. {
  128.     /*----------------------------------------------------------------*/
  129.     /* Local Variables                                                */
  130.     /*----------------------------------------------------------------*/
  131.     /*----------------------------------------------------------------*/
  132.     /* Code Body                                                      */
  133.     /*----------------------------------------------------------------*/
  134.     SetHiliteHandler(MENU8234_FDL_VIEW_OPTIONS_ADD, HighlighSrcAddFDL);
  135.     SetHiliteHandler(MENU8234_FDL_VIEW_OPTIONS_EDIT, HighlightScrEditFDL);
  136.     SetHiliteHandler(MENU8234_FDL_VIEW_OPTIONS_DELETE, HighLightDeleteFDL);
  137.     gFDLBDLContext.FDNBDNCount = 0;
  138.     gFDLBDLContext.FDNBDNEdit = 0;
  139.     gFDLBDLContext.HighlightedFDN = 255;
  140. }
  141. /*****************************************************************************
  142.  * FUNCTION
  143.  *  SECSETGetFdlEntriesReq
  144.  * DESCRIPTION
  145.  *  getting all entries req
  146.  * PARAMETERS
  147.  *  void
  148.  * RETURNS
  149.  *  void
  150.  *  Author            : Vanita Jain(?)
  151.  *****************************************************************************/
  152. void SECSETGetFdlEntriesReq()
  153. {
  154.     /*----------------------------------------------------------------*/
  155.     /* Local Variables                                                */
  156.     /*----------------------------------------------------------------*/
  157.     MSG_PHB_GET_ENTRY_BY_INDEX_REQ_STRUCT *pMsgIndexReq = NULL;
  158.     MYQUEUE Message;
  159.     /*----------------------------------------------------------------*/
  160.     /* Code Body                                                      */
  161.     /*----------------------------------------------------------------*/
  162.     pMsgIndexReq =
  163.         (MSG_PHB_GET_ENTRY_BY_INDEX_REQ_STRUCT*) OslConstructDataPtr(sizeof(MSG_PHB_GET_ENTRY_BY_INDEX_REQ_STRUCT));
  164.     pMsgIndexReq->index = gFDLBDLContext.FDNBDNCount + 1;
  165.     pMsgIndexReq->record_index = 0xFFFF;
  166.     pMsgIndexReq->storage = MMI_SIM;
  167.     pMsgIndexReq->type = MMI_PHB_FDN;
  168.     pMsgIndexReq->no_data = MAX_ENTRIES_IN_LIST;
  169.     Message.oslSrcId = MOD_MMI;
  170.     Message.oslDestId = MOD_L4C;
  171.     Message.oslMsgId = PRT_PHB_GET_ENTRY_BY_INDEX_REQ;
  172.     Message.oslDataPtr = (oslParaType*) pMsgIndexReq;
  173.     Message.oslPeerBuffPtr = NULL;
  174.     SetProtocolEventHandler(SECSETGetFdlEntriesRsp, PRT_PHB_GET_ENTRY_BY_INDEX_RSP);
  175.     OslMsgSendExtQueue(&Message);
  176. }
  177. /*****************************************************************************
  178.  * FUNCTION
  179.  *  SECSETGetFdlEntriesRsp
  180.  * DESCRIPTION
  181.  *  getting all entries rsp
  182.  * PARAMETERS
  183.  *  info        [?]     
  184.  * RETURNS
  185.  *  void
  186.  *  Author            : Vanita Jain(?)
  187.  *****************************************************************************/
  188. void SECSETGetFdlEntriesRsp(void *info)
  189. {
  190.     /*----------------------------------------------------------------*/
  191.     /* Local Variables                                                */
  192.     /*----------------------------------------------------------------*/
  193.     MSG_PHB_GET_ENTRY_BY_INDEX_RSP_STRUCT *localPtr;
  194.     U8 i = 0, j = 0;
  195.     /* micha0317 */
  196.     U8 TempBuff[(MAX_PB_NUMBER_LENGTH + 2) * ENCODING_LENGTH];
  197.     U8 *tmpConvertBuf = NULL;
  198.     U16 convertOutLen = 0;
  199.     /*----------------------------------------------------------------*/
  200.     /* Code Body                                                      */
  201.     /*----------------------------------------------------------------*/
  202.     localPtr = (MSG_PHB_GET_ENTRY_BY_INDEX_RSP_STRUCT*) info;
  203.     if (localPtr->result.flag == 0 /* OK */ )
  204.     {
  205.         i = gFDLBDLContext.FDNBDNCount;
  206.         gFDLBDLContext.FDNBDNCount += localPtr->no_list;    /* Add number of new entries in current list length. */
  207.         if (gFDLBDLContext.FDNBDNCount > MAX_SIM_ENTRIES)
  208.         {
  209.             gFDLBDLContext.FDNBDNCount = MAX_SIM_ENTRIES;
  210.         }
  211.         for (; i < gFDLBDLContext.FDNBDNCount; i++, j++)
  212.         {
  213.             gFDLBDLContext.FDLBDLEntries[i].storage = localPtr->list[j].storage;
  214.             gFDLBDLContext.FDLBDLEntries[i].index = localPtr->list[j].index;
  215.             gFDLBDLContext.FDLBDLEntries[i].record_index = localPtr->list[j].record_index;
  216.             memset(gFDLBDLContext.FDLBDLEntries[i].alpha_id.name, 0, MAX_NAME_LEN_FSB_LIST * ENCODING_LENGTH);
  217.             memset(gFDLBDLContext.FDLBDLEntries[i].tel.number, 0, MAX_NUMBER_LEN_FSB_LIST * ENCODING_LENGTH);
  218.             gFDLBDLContext.FDLBDLEntries[i].alpha_id.name_length = localPtr->list[j].alpha_id.name_length;
  219.             gFDLBDLContext.FDLBDLEntries[i].alpha_id.name_dcs = localPtr->list[j].alpha_id.name_dcs;
  220.             tmpConvertBuf = CovertStringForPlatform(
  221.                                 localPtr->list[j].alpha_id.name,
  222.                                 gFDLBDLContext.FDLBDLEntries[i].alpha_id.name_length,
  223.                                 gFDLBDLContext.FDLBDLEntries[i].alpha_id.name_dcs,
  224.                                 &convertOutLen);
  225.             gFDLBDLContext.FDLBDLEntries[i].alpha_id.name_length = (U8) convertOutLen;
  226.             if (pfnUnicodeStrlen((PS8) tmpConvertBuf) <= MAX_PB_NAME_LENGTH)
  227.             {
  228.                 pfnUnicodeStrcpy((PS8) gFDLBDLContext.FDLBDLEntries[i].alpha_id.name, (PS8) tmpConvertBuf);
  229.             }
  230.             else
  231.             {
  232.                 pfnUnicodeStrncpy(
  233.                     (PS8) gFDLBDLContext.FDLBDLEntries[i].alpha_id.name,
  234.                     (PS8) tmpConvertBuf,
  235.                     MAX_PB_NAME_LENGTH);
  236.             }
  237.             if (tmpConvertBuf != NULL)
  238.             {
  239.                 OslMfree(tmpConvertBuf);
  240.             }
  241.             if (localPtr->list[j].tel.type == MMI_CSMCC_INTERNATIONAL_ADDR)
  242.             {
  243.                 gFDLBDLContext.FDLBDLEntries[i].tel.type = localPtr->list[j].tel.type;
  244.                 gFDLBDLContext.FDLBDLEntries[i].tel.number[0] = '+';    /* insert '+' before the number. */
  245.                 gFDLBDLContext.FDLBDLEntries[i].tel.length = localPtr->list[j].tel.length;
  246.                 AnsiiToUnicodeString((PS8) TempBuff, (PS8) localPtr->list[j].tel.number);
  247.                 memcpy(
  248.                     gFDLBDLContext.FDLBDLEntries[i].tel.number + ENCODING_LENGTH,
  249.                     TempBuff,
  250.                     (localPtr->list[j].tel.length) * ENCODING_LENGTH);
  251.             }
  252.             else
  253.             {
  254.                 gFDLBDLContext.FDLBDLEntries[i].tel.type = localPtr->list[j].tel.type;
  255.                 gFDLBDLContext.FDLBDLEntries[i].tel.length = localPtr->list[j].tel.length;
  256.                 AnsiiToUnicodeString((PS8) TempBuff, (PS8) localPtr->list[j].tel.number);
  257.                 memcpy(
  258.                     gFDLBDLContext.FDLBDLEntries[i].tel.number,
  259.                     (PS8) TempBuff,
  260.                     (localPtr->list[j].tel.length) * ENCODING_LENGTH);
  261.             }
  262.         }
  263.         if (localPtr->no_list == MAX_ENTRIES_IN_LIST)
  264.         {
  265.             SECSETGetFdlEntriesReq();
  266.         }
  267.         else
  268.         {
  269.             ViewFDList();
  270.             /*
  271.              *    Retrieve FDN list to ADN buffer when FDN is enable.
  272.              *    Because ADN will not read when FDN is on, so use ADN's buffer to store FDN temporarily
  273.              *    This is for call lookup FDN number usage.
  274.              */
  275.             if (gSecuritySetupContext.FdlStatus)
  276.             {
  277.                 mmi_phb_fdn_get_list_to_ram();
  278.             }
  279.         }
  280.     }
  281.     else if (localPtr->result.flag == 1 && localPtr->result.cause == 5)
  282.     {
  283.         /* gFDLBDLContext.FDNBDNCount = 0; */
  284.         ViewFDList();
  285.     }
  286.     else
  287.     {
  288.         DisplayPopup((PU8) GetString(STR_GLOBAL_UNFINISHED), IMG_GLOBAL_UNFINISHED, 1, ST_NOTIFYDURATION, ERROR_TONE);
  289.         DeleteUptoScrID(SCR_ID_SECSET_FIX_DIAL);
  290.     }
  291. }
  292. /*****************************************************************************
  293.  * FUNCTION
  294.  *  ViewFDList
  295.  * DESCRIPTION
  296.  *  View FDL List
  297.  * PARAMETERS
  298.  *  void
  299.  * RETURNS
  300.  *  void
  301.  *  Author            : Vanita Jain(?)
  302.  *****************************************************************************/
  303. void ViewFDList()
  304. {
  305.     /*----------------------------------------------------------------*/
  306.     /* Local Variables                                                */
  307.     /*----------------------------------------------------------------*/
  308.     /*----------------------------------------------------------------*/
  309.     /* Code Body                                                      */
  310.     /*----------------------------------------------------------------*/
  311.     gFDLBDLContext.HighlightedFDN = 0;
  312.     EntrySECSETFDNList();
  313. }
  314. /*****************************************************************************
  315.  * FUNCTION
  316.  *  EntrySECSETFDNList
  317.  * DESCRIPTION
  318.  *  Entry screen to view FDl list
  319.  * PARAMETERS
  320.  *  void
  321.  * RETURNS
  322.  *  void
  323.  *  Author            : Vanita Jain(?)
  324.  *****************************************************************************/
  325. void EntrySECSETFDNList()
  326. {
  327.     /*----------------------------------------------------------------*/
  328.     /* Local Variables                                                */
  329.     /*----------------------------------------------------------------*/
  330.     U8 *pstfdlist[MAX_SIM_ENTRIES], *fdlHint[MAX_SIM_ENTRIES];
  331.     U16 index;
  332.     U8 *guiBuffer;
  333.     U16 fdlimagelist[MAX_SIM_ENTRIES];
  334.     /*----------------------------------------------------------------*/
  335.     /* Code Body                                                      */
  336.     /*----------------------------------------------------------------*/
  337.     EntryNewScreen(SCR_ID_SECSET_FDN_LIST, NULL, EntrySECSETFDNList, NULL);
  338.     guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_FDN_LIST);   /* Getting the Index from history */
  339.     for (index = 0; index < gFDLBDLContext.FDNBDNCount; index++)
  340.     {
  341.         if (gFDLBDLContext.FDLBDLEntries[index].alpha_id.name[0] != '')
  342.         {
  343.             pstfdlist[index] = (U8*) gFDLBDLContext.FDLBDLEntries[index].alpha_id.name;
  344.             fdlHint[index] = (U8*) gFDLBDLContext.FDLBDLEntries[index].tel.number;
  345.         }
  346.         else
  347.         {
  348.             pstfdlist[index] = (U8*) gFDLBDLContext.FDLBDLEntries[index].tel.number;
  349.             fdlHint[index] = NULL;
  350.         }
  351.         fdlimagelist[index] = IMG_STORAGE_SIM;
  352.     }
  353.     RegisterHighlightHandler(GetActiveIndex);
  354.     if (guiBuffer != NULL)
  355.     {
  356.         memset((void*)guiBuffer, 0, 2);
  357.     }
  358.     if ((gFDLBDLContext.HighlightedFDN >= gFDLBDLContext.FDNBDNCount) && (gFDLBDLContext.FDNBDNCount > 0))
  359.     {
  360.         gFDLBDLContext.HighlightedFDN = gFDLBDLContext.FDNBDNCount - 1;
  361.     }
  362.     if (gFDLBDLContext.FDNBDNCount == 0)
  363.     {
  364.         pstfdlist[0] = (U8*) GetString(STR_GLOBAL_EMPTY_LIST);
  365.         fdlimagelist[0] = 0;
  366.         fdlHint[0] = NULL;
  367.         ShowCategory6Screen(
  368.             STR_SCR8054_CALL_FDL_CAPTION,
  369.             MAIN_MENU_TITLE_SETTINGS_ICON,
  370.             STR_GLOBAL_ADD,
  371.             IMG_GLOBAL_OPTIONS,
  372.             STR_GLOBAL_BACK,
  373.             IMG_GLOBAL_BACK,
  374.             1,
  375.             pstfdlist,
  376.             NULL,
  377.             0,
  378.             guiBuffer);
  379.         gFDLBDLContext.FDNBDNEdit = FALSE;
  380.         memset(gFDLBDLContext.FDLBDLName, 0, (MAX_NAME_LEN_FSB_LIST + 1) * ENCODING_LENGTH);
  381.         memset(gFDLBDLContext.FDLBDLNumber, 0, (MAX_NUMBER_LEN_FSB_LIST + 1 + 1) * ENCODING_LENGTH);
  382.         SetLeftSoftkeyFunction(EntrySECSETFDNDetails, KEY_EVENT_UP);
  383.         /* micha0529 */
  384.         SetKeyHandler(EntrySECSETFDNDetails, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  385.         SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  386.         SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  387.         SetKeyHandler(0, KEY_SEND, KEY_EVENT_UP);
  388.     }
  389.     else
  390.     {
  391.         ShowCategory53Screen(
  392.             STR_SCR8054_CALL_FDL_CAPTION,
  393.             MAIN_MENU_TITLE_SETTINGS_ICON,
  394.             /* micha0610 */ STR_GLOBAL_OPTIONS,
  395.             IMG_GLOBAL_OPTIONS,
  396.             STR_GLOBAL_BACK,
  397.             IMG_GLOBAL_BACK,
  398.             gFDLBDLContext.FDNBDNCount,
  399.             pstfdlist,
  400.             fdlimagelist,
  401.             fdlHint,
  402.             0,
  403.             gFDLBDLContext.HighlightedFDN,
  404.             guiBuffer);
  405.         SetLeftSoftkeyFunction(EntrySECSETFDNOption, KEY_EVENT_UP);
  406.         /* micha0529 */
  407.         SetKeyHandler(EntrySECSETFDNOption, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  408.         SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  409.         SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  410.         SetKeyHandler(FdlMakeCall, KEY_SEND, KEY_EVENT_UP);
  411.     }
  412. }
  413. /*****************************************************************************
  414.  * FUNCTION
  415.  *  ExitSECSETFDNListReload
  416.  * DESCRIPTION
  417.  *  
  418.  * PARAMETERS
  419.  *  void
  420.  * RETURNS
  421.  *  void
  422.  *  Author            : Vanita Jain(?)
  423.  *****************************************************************************/
  424. void ExitSECSETFDNListReload(void)
  425. {
  426.     /*----------------------------------------------------------------*/
  427.     /* Local Variables                                                */
  428.     /*----------------------------------------------------------------*/
  429.     history Scr;
  430.     S16 nHistory = 0;
  431.     /*----------------------------------------------------------------*/
  432.     /* Code Body                                                      */
  433.     /*----------------------------------------------------------------*/
  434.     DeleteScreenIfPresent(SCR_ID_SECSET_FDN_LIST);
  435.     Scr.scrnID = SCR_ID_SECSET_FDN_LIST;
  436.     Scr.entryFuncPtr = EntryFdlList;
  437.     pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) & nHistory);
  438.     GetCategoryHistory(Scr.guiBuffer);
  439.     AddHistory(Scr);
  440. }
  441. /*****************************************************************************
  442.  * FUNCTION
  443.  *  EntrySECSETFDNOption
  444.  * DESCRIPTION
  445.  *  Entry screen of FDL list Options, when list is not empty.
  446.  * PARAMETERS
  447.  *  void
  448.  * RETURNS
  449.  *  void
  450.  *  Author            : Vanita Jain(?)
  451.  *****************************************************************************/
  452. void EntrySECSETFDNOption()
  453. {
  454.     /*----------------------------------------------------------------*/
  455.     /* Local Variables                                                */
  456.     /*----------------------------------------------------------------*/
  457.     U16 nStrItemList[MAX_SUB_MENUS];    /* Stores the strings id of submenus returned */
  458.     U16 nNumofItem;                     /* Stores no of children in the submenu */
  459.     //micha1229
  460.     //      U16 nDispAttribute; /* Stores display attribue */
  461.     U8 *guiBuffer;              /* Buffer holding history data */
  462.     /*----------------------------------------------------------------*/
  463.     /* Code Body                                                      */
  464.     /*----------------------------------------------------------------*/
  465.     EntryNewScreen(SCR_ID_SECSET_FDN_OPTION, NULL, EntrySECSETFDNOption, NULL);
  466.     /* 2 Get current screen to gui buffer  for history purposes */
  467.     guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_FDN_OPTION);
  468.     /* 3. Retrieve no of child of menu item to be displayed */
  469.     nNumofItem = GetNumOfChild(MENU8234_FDL_VIEW_OPTIONS_MAIN);
  470.     /* 4. Get attribute of menu to be displayed */
  471.     /* nDispAttribute = GetDispAttributeOfItem(MENU8234_FDL_VIEW_OPTIONS_MAIN       ); */
  472.     /* 5. Retrieve string ids in sequence of given menu item to be displayed */
  473.     GetSequenceStringIds(MENU8234_FDL_VIEW_OPTIONS_MAIN, nStrItemList);
  474.     /* 6 Set current parent id */
  475.     SetParentHandler(MENU8234_FDL_VIEW_OPTIONS_MAIN);
  476.     /* 7 Register highlight handler to be called in menu screen */
  477.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  478.     /* 8 Display Category15 Screen */
  479.     ShowCategory15Screen(
  480.         STR_GLOBAL_OPTIONS,
  481.         MAIN_MENU_TITLE_SETTINGS_ICON,
  482.         STR_GLOBAL_OK,
  483.         IMG_GLOBAL_OK,
  484.         STR_GLOBAL_BACK,
  485.         IMG_GLOBAL_BACK,
  486.         nNumofItem,
  487.         nStrItemList,
  488.         (PU16) gIndexIconsImageList,
  489.         LIST_MENU,
  490.         0,
  491.         guiBuffer);
  492.     /* 9.Register function with right softkey */
  493.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  494. }
  495. /*****************************************************************************
  496.  * FUNCTION
  497.  *  HighlighSrcAddFDL
  498.  * DESCRIPTION
  499.  *  add option
  500.  * PARAMETERS
  501.  *  void
  502.  * RETURNS
  503.  *  void
  504.  *  Author            : Vanita Jain(?)
  505.  *****************************************************************************/
  506. void HighlighSrcAddFDL()
  507. {
  508.     /*----------------------------------------------------------------*/
  509.     /* Local Variables                                                */
  510.     /*----------------------------------------------------------------*/
  511.     /*----------------------------------------------------------------*/
  512.     /* Code Body                                                      */
  513.     /*----------------------------------------------------------------*/
  514.     /* 1 Change left soft key icon and label */
  515.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  516.     /* 2 Change right soft key icon and label */
  517.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  518.     SetKeyHandler(EntrySECSETFDNDetails, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  519.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  520.     SetLeftSoftkeyFunction(EntrySECSETFDNDetails, KEY_EVENT_UP);
  521.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  522.     gFDLBDLContext.FDNBDNEdit = FALSE;
  523.     memset(gFDLBDLContext.FDLBDLName, 0, (MAX_NAME_LEN_FSB_LIST + 1) * ENCODING_LENGTH);
  524.     memset(gFDLBDLContext.FDLBDLNumber, 0, (MAX_NUMBER_LEN_FSB_LIST + 1 + 1) * ENCODING_LENGTH);
  525. }
  526. /*****************************************************************************
  527.  * FUNCTION
  528.  *  EntrySECSETFDNDetails
  529.  * DESCRIPTION
  530.  *  Entry screen to add FDL entry.
  531.  * PARAMETERS
  532.  *  void
  533.  * RETURNS
  534.  *  void
  535.  *  Author            : Vanita Jain(?)
  536.  *****************************************************************************/
  537. void EntrySECSETFDNDetails(void)
  538. {
  539.     /*----------------------------------------------------------------*/
  540.     /* Local Variables                                                */
  541.     /*----------------------------------------------------------------*/
  542.     U16 nNumofItem; /* Stores no of children in the submenu */
  543.     //micha1229
  544.     //      U16 nDispAttribute; /* Stores display attribue */
  545.     U8 *guiBuffer;              /* Buffer holding history data */
  546.     U16 ItemIcons[2];
  547.     U8 *inputBuffer;            /* added for inline edit history */
  548.     U16 inputBufferSize;        /* added for inline edit history */
  549.     /*----------------------------------------------------------------*/
  550.     /* Code Body                                                      */
  551.     /*----------------------------------------------------------------*/
  552.     if ((gFDLBDLContext.FDNBDNCount == (U16) gFDLBDLContext.MaxFDL || gFDLBDLContext.FDNBDNCount == MAX_SIM_ENTRIES) &&
  553.         (gFDLBDLContext.FDNBDNEdit == FALSE))
  554.     {
  555.         DisplayPopup(
  556.             (U8*) GetString(STR_SETTING_STORAGE_FULL),
  557.             IMG_GLOBAL_WARNING,
  558.             0,
  559.             ST_NOTIFYDURATION,
  560.             (U8) WARNING_TONE);
  561.     }
  562.     else
  563.     {
  564.         EntryNewScreen(SCR_ID_SECSET_FDN_DETAILS, ExitSECSETFDNDetails, NULL, NULL);
  565.         guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_FDN_DETAILS);
  566.         inputBuffer = GetCurrNInputBuffer(SCR_ID_SECSET_FDN_DETAILS, &inputBufferSize); /* added for inline edit history */
  567.         nNumofItem = GetNumOfChild(MENU8234_FDL_VIEW_OPTIONS_ADD);
  568.         /* nDispAttribute = GetDispAttributeOfItem(MENU8234_FDL_VIEW_OPTIONS_ADD); */
  569.         GetSequenceImageIds(MENU8234_FDL_VIEW_OPTIONS_ADD, ItemIcons);
  570.         InitializeCategory57Screen();
  571.         FillFdlInlineEditStruct();
  572.         if (inputBuffer != NULL)    /* added for inline edit history */
  573.         {
  574.             SetCategory57Data(gFDLBDLContext.FDLBDLInlineDisplay, nNumofItem, inputBuffer);     /* sets the data */
  575.         }
  576.         ShowCategory57Screen(
  577.             STR_SETTING_FDL_EDIT_ENTRY,
  578.             MAIN_MENU_TITLE_SETTINGS_ICON,
  579.             STR_EDIT,
  580.             IMG_GLOBAL_OK,
  581.             STR_DONE,
  582.             IMG_GLOBAL_BACK,
  583.             nNumofItem,
  584.             ItemIcons,
  585.             gFDLBDLContext.FDLBDLInlineDisplay,
  586.             0,
  587.             guiBuffer);
  588.         SetCategory57RightSoftkeyFunctions(PreNewFdlEntryReq, GoBackHistory);
  589.     }
  590. }
  591. /*****************************************************************************
  592.  * FUNCTION
  593.  *  ExitSECSETFDNDetails
  594.  * DESCRIPTION
  595.  *  Exit fn for FDL add screen
  596.  * PARAMETERS
  597.  *  void
  598.  * RETURNS
  599.  *  void
  600.  *  Author            : Vanita Jain(?)
  601.  *****************************************************************************/
  602. void ExitSECSETFDNDetails(void)
  603. {
  604.     /*----------------------------------------------------------------*/
  605.     /* Local Variables                                                */
  606.     /*----------------------------------------------------------------*/
  607.     history Scr;    /* Variable to hold the history data */
  608.     S16 nHistory = 0;
  609.     U16 size;
  610.     /*----------------------------------------------------------------*/
  611.     /* Code Body                                                      */
  612.     /*----------------------------------------------------------------*/
  613.     CloseCategory57Screen();
  614.     Scr.scrnID = SCR_ID_SECSET_FDN_DETAILS;
  615.     Scr.entryFuncPtr = EntrySECSETFDNDetails;
  616.     pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) & nHistory);
  617.     GetCategory57History(Scr.guiBuffer);
  618.     size = (U16) GetCategory57DataSize();       /* added for inline edit history */
  619.     GetCategory57Data((U8*) Scr.inputBuffer);   /* added for inline edit history */
  620.     AddNHistory(Scr, size);
  621. }
  622. /*****************************************************************************
  623.  * FUNCTION
  624.  *  FillFdlInlineEditStruct
  625.  * DESCRIPTION
  626.  *  Fill Inline Edit structs.
  627.  * PARAMETERS
  628.  *  void
  629.  * RETURNS
  630.  *  void
  631.  *  Author            : Vanita Jain(?)
  632.  *****************************************************************************/
  633. void FillFdlInlineEditStruct(void)
  634. {
  635.     /*----------------------------------------------------------------*/
  636.     /* Local Variables                                                */
  637.     /*----------------------------------------------------------------*/
  638.     /*----------------------------------------------------------------*/
  639.     /* Code Body                                                      */
  640.     /*----------------------------------------------------------------*/
  641.     SetInlineItemActivation(&gFDLBDLContext.FDLBDLInlineDisplay[0], KEY_LSK, KEY_EVENT_UP);
  642.     SetInlineItemFullScreenEdit_ext(
  643.         &gFDLBDLContext.FDLBDLInlineDisplay[0],
  644.         STR_SETTING_FDL_NAME,
  645.         MAIN_MENU_TITLE_SETTINGS_ICON,
  646.         (PU8) gFDLBDLContext.FDLBDLName,
  647.         g_phb_cntx.fdn_name_len + 1,
  648.         INPUT_TYPE_ALPHANUMERIC_UPPERCASE | INPUT_TYPE_USE_ENCODING_BASED_LENGTH | INPUT_TYPE_ONE_LESS_CHARACTER,
  649.         INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
  650.     SetInlineFullScreenEditCustomFunction(&gFDLBDLContext.FDLBDLInlineDisplay[0], SettingInlineCustomFunction);
  651.     SetInlineItemActivation(&gFDLBDLContext.FDLBDLInlineDisplay[1], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  652.     SetInlineItemTextEdit(
  653.         &gFDLBDLContext.FDLBDLInlineDisplay[1],
  654.         (PU8) gFDLBDLContext.FDLBDLNumber,
  655.         MAX_PB_NUMBER_LENGTH + 1,
  656.         INPUT_TYPE_PHONE_NUMBER | INPUT_TYPE_PLUS_CHARACTER_HANDLING);
  657.     DisableInlineItemHighlight(&gFDLBDLContext.FDLBDLInlineDisplay[1]);
  658. }
  659. /*****************************************************************************
  660.  * FUNCTION
  661.  *  PreNewFdlEntryReq
  662.  * DESCRIPTION
  663.  *  Goto Confirm Save screen.
  664.  * PARAMETERS
  665.  *  void
  666.  * RETURNS
  667.  *  void
  668.  *  Author            : Vanita Jain(?)
  669.  *****************************************************************************/
  670. void PreNewFdlEntryReq()
  671. {
  672.     /*----------------------------------------------------------------*/
  673.     /* Local Variables                                                */
  674.     /*----------------------------------------------------------------*/
  675.     /*----------------------------------------------------------------*/
  676.     /* Code Body                                                      */
  677.     /*----------------------------------------------------------------*/
  678.     if (!pfnUnicodeStrlen((PS8) gFDLBDLContext.FDLBDLNumber) && !pfnUnicodeStrlen((PS8) gFDLBDLContext.FDLBDLName))
  679.     {
  680.         GoBackHistory();
  681.     }
  682.     else
  683.     {
  684.         EntrySECSETFDNSaveConfirm();
  685.     }
  686. }
  687. /*****************************************************************************
  688.  * FUNCTION
  689.  *  EntrySECSETFDNSaveConfirm
  690.  * DESCRIPTION
  691.  *  Show confirm Save Screen
  692.  * PARAMETERS
  693.  *  void
  694.  * RETURNS
  695.  *  void
  696.  *  Author            : Vanita Jain(?)
  697.  *****************************************************************************/
  698. void EntrySECSETFDNSaveConfirm(void)
  699. {
  700.     /*----------------------------------------------------------------*/
  701.     /* Local Variables                                                */
  702.     /*----------------------------------------------------------------*/
  703.     /*----------------------------------------------------------------*/
  704.     /* Code Body                                                      */
  705.     /*----------------------------------------------------------------*/
  706.     DisplayConfirm(
  707.         STR_GLOBAL_YES,
  708.         IMG_GLOBAL_YES,
  709.         STR_GLOBAL_NO,
  710.         IMG_GLOBAL_NO,
  711.         get_string(STR_GLOBAL_SAVE),
  712.         IMG_GLOBAL_QUESTION,
  713.         WARNING_TONE);
  714.     gSecuritySetupContext.VerifyPassSuccessCallBack = SECSETSetFdlEntryReq;
  715.     SetLeftSoftkeyFunction(SECSETGetPIN2StatusReq, KEY_EVENT_UP);
  716.     SetRightSoftkeyFunction(GoToFDLList, KEY_EVENT_UP);
  717. }
  718. /*****************************************************************************
  719.  * FUNCTION
  720.  *  ExitSECSETFDNSaveConfirm
  721.  * DESCRIPTION
  722.  *  
  723.  * PARAMETERS
  724.  *  void
  725.  * RETURNS
  726.  *  void
  727.  *****************************************************************************/
  728. void ExitSECSETFDNSaveConfirm(void)
  729. {
  730.     /*----------------------------------------------------------------*/
  731.     /* Local Variables                                                */
  732.     /*----------------------------------------------------------------*/
  733.     /*----------------------------------------------------------------*/
  734.     /* Code Body                                                      */
  735.     /*----------------------------------------------------------------*/
  736.     /* micha0531 */
  737.     stopRequestedTone(WARNING_TONE);
  738. }
  739. /*****************************************************************************
  740.  * FUNCTION
  741.  *  SECSETSetFdlEntryReq
  742.  * DESCRIPTION
  743.  *  Req to L4 to add new Entry in FDL.
  744.  *  
  745.  *  First Send req to verify Pin2, After PIN2 Verified,
  746.  *  call this Fn to add new FDL entry in L4.
  747.  * PARAMETERS
  748.  *  void
  749.  * RETURNS
  750.  *  void
  751.  *  Author            : Vanita Jain(?)
  752.  *****************************************************************************/
  753. void SECSETSetFdlEntryReq(void)
  754. {
  755.     /*----------------------------------------------------------------*/
  756.     /* Local Variables                                                */
  757.     /*----------------------------------------------------------------*/
  758.     MSG_PHB_SET_ENRTY_REQ_STRUCT *pMsgNewEntry = NULL;
  759.     MYQUEUE Message;
  760.     /* U8 pbName_ASCII[MAX_PB_NAME_LENGTH]; */
  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.     /* diamond, 2005/07/22 memset length issue */
  768.     //memset(pMsgNewEntry->list.alpha_id.name, 0, strlen((PS8)pbName_ASCII)+1);
  769.     //memset(pMsgNewEntry->list.tel.number, 0, strlen((PS8)pbNumber_ASCII)+1);
  770.     memset(pMsgNewEntry->list.alpha_id.name, 0, MAX_PB_NAME_LENGTH + 1);
  771.     memset(pMsgNewEntry->list.tel.number, 0, MAX_PB_NAME_LENGTH + 1);
  772.     /* end, diamond */
  773.     pMsgNewEntry->type = MMI_PHB_FDN;
  774.     pMsgNewEntry->no_data = 1;
  775.     pMsgNewEntry->list.storage = MMI_SIM;
  776.     pMsgNewEntry->list.index = 0xFFFF;          /* For New Entry It should Always be 0xFFFF; */
  777.     pMsgNewEntry->list.record_index = 0xFFFF;   /* For New Entry It should be alaways 0xFFFF */
  778.     if (gFDLBDLContext.FDNBDNEdit)  /* If entry is edited */
  779.     {
  780.         pMsgNewEntry->list.index = gFDLBDLContext.FDLBDLEntries[gFDLBDLContext.HighlightedFDN].index;
  781.         pMsgNewEntry->list.record_index = gFDLBDLContext.FDLBDLEntries[gFDLBDLContext.HighlightedFDN].record_index;
  782.     }
  783.     if (gFDLBDLContext.FDLBDLNumber[0] == '+')  /* If Number is International */
  784.     {
  785.         pMsgNewEntry->list.tel.type = MMI_CSMCC_INTERNATIONAL_ADDR;     /* INTERNATIONAL */
  786.         pMsgNewEntry->list.tel.length =
  787.             (U8) pfnUnicodeStrlen((const S8*)(gFDLBDLContext.FDLBDLNumber + ENCODING_LENGTH));
  788.         UnicodeToAnsii((PS8) pbNumber_ASCII, (PS8) (gFDLBDLContext.FDLBDLNumber + ENCODING_LENGTH));
  789.         memcpy(pMsgNewEntry->list.tel.number, pbNumber_ASCII, strlen((PS8) pbNumber_ASCII) + 1);
  790.     }
  791.     else
  792.     {
  793.         pMsgNewEntry->list.tel.type = MMI_CSMCC_DEFAULT_ADDR_TYPE;      /* DEFAULT */
  794.         pMsgNewEntry->list.tel.length = (U8) pfnUnicodeStrlen((PS8) gFDLBDLContext.FDLBDLNumber);
  795.         UnicodeToAnsii((PS8) pbNumber_ASCII, (PS8) gFDLBDLContext.FDLBDLNumber);
  796.         memcpy(pMsgNewEntry->list.tel.number, pbNumber_ASCII, strlen((PS8) pbNumber_ASCII) + 1);
  797.     }
  798.     if (GetUCS2Flag((PS8) gFDLBDLContext.FDLBDLName))
  799.     {
  800.         pMsgNewEntry->list.alpha_id.name_dcs = MMI_PHB_UCS2;
  801.         pMsgNewEntry->list.alpha_id.name_length =
  802.             ((U8) pfnUnicodeStrlen((PS8) gFDLBDLContext.FDLBDLName)) * ENCODING_LENGTH;
  803.         BigEndianToLittleEndian((PS8) pMsgNewEntry->list.alpha_id.name, (PS8) gFDLBDLContext.FDLBDLName);
  804.     }
  805.     else
  806.     {
  807.         pMsgNewEntry->list.alpha_id.name_dcs = MMI_PHB_ASCII;
  808.         pMsgNewEntry->list.alpha_id.name_length = (U8) pfnUnicodeStrlen((PS8) gFDLBDLContext.FDLBDLName);
  809.         UnicodeToAnsii((PS8) pMsgNewEntry->list.alpha_id.name, (PS8) gFDLBDLContext.FDLBDLName);
  810.         PhbAsciiToGSM7Bit(pMsgNewEntry->list.alpha_id.name);
  811.     }
  812.     Message.oslSrcId = MOD_MMI;
  813.     Message.oslDestId = MOD_L4C;
  814.     Message.oslMsgId = PRT_PHB_SET_ENTRY_REQ;
  815.     Message.oslDataPtr = (oslParaType*) pMsgNewEntry;
  816.     Message.oslPeerBuffPtr = NULL;
  817.     DeleteUptoScrID(SCR_ID_SECSET_FDN_LIST);
  818.     DeleteScreenIfPresent(SCR_ID_SECSET_FDN_LIST);
  819.     ExitSECSETFDNListReload();
  820.     SetProtocolEventHandler(SECSETSetFdlEntryRsp, PRT_PHB_SET_ENTRY_RSP);
  821.     OslMsgSendExtQueue(&Message);
  822. }
  823. /*****************************************************************************
  824.  * FUNCTION
  825.  *  SECSETSetFdlEntryRsp
  826.  * DESCRIPTION
  827.  *  Rsp fn for getting all FDL entries.
  828.  * PARAMETERS
  829.  *  info        [?]     
  830.  * RETURNS
  831.  *  void
  832.  *  Author            : Vanita Jain(?)
  833.  *****************************************************************************/
  834. void SECSETSetFdlEntryRsp(void *info)
  835. {
  836.     /*----------------------------------------------------------------*/
  837.     /* Local Variables                                                */
  838.     /*----------------------------------------------------------------*/
  839.     MSG_PHB_SET_ENRTY_RSP_STRUCT *localPtr;
  840.     /*----------------------------------------------------------------*/
  841.     /* Code Body                                                      */
  842.     /*----------------------------------------------------------------*/
  843.     localPtr = (MSG_PHB_SET_ENRTY_RSP_STRUCT*) info;
  844.     if (localPtr->result.flag == 0)
  845.     {
  846.         DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, SUCCESS_TONE);
  847.     }
  848.     else if (localPtr->result.cause == MMI_SIM_EF_RECORD_FULL)
  849.     {
  850.         DisplayPopup(
  851.             (PU8) GetString(STR_NOT_SAVED_NUMBER_TOO_LONG),
  852.             IMG_GLOBAL_ERROR,
  853.             1,
  854.             ST_NOTIFYDURATION,
  855.             ERROR_TONE);
  856.     }
  857.     else
  858.     {
  859.         DisplayPopup((PU8) GetString(STR_GLOBAL_UNFINISHED), IMG_GLOBAL_UNFINISHED, 1, ST_NOTIFYDURATION, ERROR_TONE);
  860.     }
  861.     gFDLBDLContext.FDNBDNEdit = FALSE;
  862.     DeleteUptoScrID(SCR_ID_SECSET_FDN_LIST);
  863. }
  864. /*****************************************************************************
  865.  * FUNCTION
  866.  *  HighlightScrEditFDL
  867.  * DESCRIPTION
  868.  *  Highlight Edit option
  869.  * PARAMETERS
  870.  *  void
  871.  * RETURNS
  872.  *  void
  873.  *  Author            : Vanita Jain(?)
  874.  *****************************************************************************/
  875. void HighlightScrEditFDL()
  876. {
  877.     /*----------------------------------------------------------------*/
  878.     /* Local Variables                                                */
  879.     /*----------------------------------------------------------------*/
  880.     /*----------------------------------------------------------------*/
  881.     /* Code Body                                                      */
  882.     /*----------------------------------------------------------------*/
  883.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  884.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  885.     SetKeyHandler(EntrySECSETFDNDetails, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  886.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  887.     SetLeftSoftkeyFunction(EntrySECSETFDNDetails, KEY_EVENT_UP);
  888.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  889.     pfnUnicodeStrcpy(
  890.         (S8*) gFDLBDLContext.FDLBDLName,
  891.         (S8*) gFDLBDLContext.FDLBDLEntries[gFDLBDLContext.HighlightedFDN].alpha_id.name);
  892.     pfnUnicodeStrcpy(
  893.         (S8*) gFDLBDLContext.FDLBDLNumber,
  894.         (S8*) gFDLBDLContext.FDLBDLEntries[gFDLBDLContext.HighlightedFDN].tel.number);
  895.     gFDLBDLContext.FDNBDNEdit = TRUE;
  896. }
  897. /*****************************************************************************
  898.  * FUNCTION
  899.  *  HighLightDeleteFDL
  900.  * DESCRIPTION
  901.  *  Highlight Delete Option.
  902.  * PARAMETERS
  903.  *  void
  904.  * RETURNS
  905.  *  void
  906.  *  Author            : Vanita Jain(?)
  907.  *****************************************************************************/
  908. void HighLightDeleteFDL()
  909. {
  910.     /*----------------------------------------------------------------*/
  911.     /* Local Variables                                                */
  912.     /*----------------------------------------------------------------*/
  913.     /*----------------------------------------------------------------*/
  914.     /* Code Body                                                      */
  915.     /*----------------------------------------------------------------*/
  916.     //micha0811
  917.     //      SetKeyHandler(EntrySECSETFDNDelConfirm, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  918.     ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  919.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  920.     SetLeftSoftkeyFunction(EntrySECSETFDNDelConfirm, KEY_EVENT_UP);
  921.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  922. }
  923. /*****************************************************************************
  924.  * FUNCTION
  925.  *  EntrySECSETFDNDelConfirm
  926.  * DESCRIPTION
  927.  *  Entry fn for Confirmation of Delete.
  928.  * PARAMETERS
  929.  *  void
  930.  * RETURNS
  931.  *  void
  932.  *  Author            : Vanita Jain(?)
  933.  *****************************************************************************/
  934. void EntrySECSETFDNDelConfirm()
  935. {
  936.     /*----------------------------------------------------------------*/
  937.     /* Local Variables                                                */
  938.     /*----------------------------------------------------------------*/
  939.     /*----------------------------------------------------------------*/
  940.     /* Code Body                                                      */
  941.     /*----------------------------------------------------------------*/
  942.     DisplayConfirm(
  943.         STR_GLOBAL_YES,
  944.         IMG_GLOBAL_YES,
  945.         STR_GLOBAL_NO,
  946.         IMG_GLOBAL_NO,
  947.         get_string(STR_DELETE_QUERY_MSG),
  948.         IMG_GLOBAL_QUESTION,
  949.         WARNING_TONE);
  950.     gSecuritySetupContext.VerifyPassSuccessCallBack = SECSETDelFdlReq;
  951.     SetLeftSoftkeyFunction(SECSETGetPIN2StatusReq, KEY_EVENT_UP);
  952.     SetRightSoftkeyFunction(GoToFDLList, KEY_EVENT_UP);
  953. }
  954. /*****************************************************************************
  955.  * FUNCTION
  956.  *  ExitSECSETFDNDelConfirm
  957.  * DESCRIPTION
  958.  *  
  959.  * PARAMETERS
  960.  *  void
  961.  * RETURNS
  962.  *  void
  963.  *  Author            : Vanita Jain(?)
  964.  *****************************************************************************/
  965. void ExitSECSETFDNDelConfirm()
  966. {
  967.     /*----------------------------------------------------------------*/
  968.     /* Local Variables                                                */
  969.     /*----------------------------------------------------------------*/
  970.     /*----------------------------------------------------------------*/
  971.     /* Code Body                                                      */
  972.     /*----------------------------------------------------------------*/
  973.     /* micha0531 */
  974.     stopRequestedTone(WARNING_TONE);
  975. }
  976. /*****************************************************************************
  977.  * FUNCTION
  978.  *  SECSETDelFdlReq
  979.  * DESCRIPTION
  980.  *  send req to L4 to Delete FDL List
  981.  * PARAMETERS
  982.  *  void
  983.  * RETURNS
  984.  *  void
  985.  *  Author            : Vanita Jain(?)
  986.  *****************************************************************************/
  987. void SECSETDelFdlReq()
  988. {
  989.     /*----------------------------------------------------------------*/
  990.     /* Local Variables                                                */
  991.     /*----------------------------------------------------------------*/
  992.     MSG_PHB_DELETE_ENTRY_REQ_STRUCT *pMsgDelEntry = NULL;
  993.     MYQUEUE Message;
  994.     /*----------------------------------------------------------------*/
  995.     /* Code Body                                                      */
  996.     /*----------------------------------------------------------------*/
  997.     EntrySECSETFDNBDNDeleting();
  998.     pMsgDelEntry = (MSG_PHB_DELETE_ENTRY_REQ_STRUCT*) OslConstructDataPtr(sizeof(MSG_PHB_DELETE_ENTRY_REQ_STRUCT));
  999.     pMsgDelEntry->no_data = 1;
  1000.     pMsgDelEntry->del_all = MMI_FALSE;  /* No */
  1001.     pMsgDelEntry->index = gFDLBDLContext.FDLBDLEntries[gFDLBDLContext.HighlightedFDN].index;
  1002.     pMsgDelEntry->type = MMI_PHB_FDN;   /* PHB_PHONEBOOK */
  1003.     Message.oslSrcId = MOD_MMI;
  1004.     Message.oslDestId = MOD_L4C;
  1005.     Message.oslMsgId = PRT_PHB_DEL_ENTRY_REQ;
  1006.     Message.oslDataPtr = (oslParaType*) pMsgDelEntry;
  1007.     Message.oslPeerBuffPtr = NULL;
  1008.     DeleteUptoScrID(SCR_ID_SECSET_FDN_LIST);
  1009.     DeleteScreenIfPresent(SCR_ID_SECSET_FDN_LIST);
  1010.     ExitSECSETFDNListReload();
  1011.     SetProtocolEventHandler(SECSETDelFdlRsp, PRT_PHB_DEL_ENTRY_RSP);
  1012.     OslMsgSendExtQueue(&Message);
  1013. }
  1014. /*****************************************************************************
  1015.  * FUNCTION
  1016.  *  SECSETDelFdlRsp
  1017.  * DESCRIPTION
  1018.  *  Rsp handler for Delete req.
  1019.  * PARAMETERS
  1020.  *  info        [?]     
  1021.  * RETURNS
  1022.  *  void
  1023.  *  Author            : Vanita Jain(?)
  1024.  *****************************************************************************/
  1025. void SECSETDelFdlRsp(void *info)
  1026. {
  1027.     /*----------------------------------------------------------------*/
  1028.     /* Local Variables                                                */
  1029.     /*----------------------------------------------------------------*/
  1030.     MSG_PHB_DELETE_ENTRY_RSP_STRUCT *localPtr;
  1031.     /*----------------------------------------------------------------*/
  1032.     /* Code Body                                                      */
  1033.     /*----------------------------------------------------------------*/
  1034.     localPtr = (MSG_PHB_DELETE_ENTRY_RSP_STRUCT*) info;
  1035.     if (localPtr->result.flag == 0 /* OK */ )
  1036.     {
  1037.         DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, SUCCESS_TONE);
  1038.     }
  1039.     else
  1040.     {
  1041.         DisplayPopup((PU8) GetString(STR_GLOBAL_UNFINISHED), IMG_GLOBAL_UNFINISHED, 1, ST_NOTIFYDURATION, ERROR_TONE);
  1042.     }
  1043.     DeleteUptoScrID(SCR_ID_SECSET_FDN_LIST);
  1044. }
  1045. /*****************************************************************************
  1046.  * FUNCTION
  1047.  *  FdlMakeCall
  1048.  * DESCRIPTION
  1049.  *  make call from FDL
  1050.  * PARAMETERS
  1051.  *  void
  1052.  * RETURNS
  1053.  *  void
  1054.  *  Author            : Vanita Jain(?)
  1055.  *****************************************************************************/
  1056. void FdlMakeCall()
  1057. {
  1058.     /*----------------------------------------------------------------*/
  1059.     /* Local Variables                                                */
  1060.     /*----------------------------------------------------------------*/
  1061.     /*----------------------------------------------------------------*/
  1062.     /* Code Body                                                      */
  1063.     /*----------------------------------------------------------------*/
  1064.     if (gFDLBDLContext.HighlightedFDN != 255)
  1065.     {
  1066.         g_phb_cntx.dial_from_list = MMI_PHB_FDN;
  1067.         MakeCall((PS8) gFDLBDLContext.FDLBDLEntries[gFDLBDLContext.HighlightedFDN].tel.number);
  1068.     }
  1069. }
  1070. /*****************************************************************************
  1071.  * FUNCTION
  1072.  *  GetActiveIndex
  1073.  * DESCRIPTION
  1074.  *  
  1075.  * PARAMETERS
  1076.  *  index       [IN]        
  1077.  * RETURNS
  1078.  *  void
  1079.  *  Author            : Vanita Jain(?)
  1080.  *****************************************************************************/
  1081. void GetActiveIndex(S32 index)
  1082. {
  1083.     /*----------------------------------------------------------------*/
  1084.     /* Local Variables                                                */
  1085.     /*----------------------------------------------------------------*/
  1086.     /*----------------------------------------------------------------*/
  1087.     /* Code Body                                                      */
  1088.     /*----------------------------------------------------------------*/
  1089.     gFDLBDLContext.HighlightedFDN = (U8) index;
  1090. }
  1091. /*****************************************************************************
  1092.  * FUNCTION
  1093.  *  GoToFDLList
  1094.  * DESCRIPTION
  1095.  *  Goback to FDl List Screen.
  1096.  * PARAMETERS
  1097.  *  void
  1098.  * RETURNS
  1099.  *  void
  1100.  *  Author            : Vanita Jain(?)
  1101.  *****************************************************************************/
  1102. void GoToFDLList(void)
  1103. {
  1104.     /*----------------------------------------------------------------*/
  1105.     /* Local Variables                                                */
  1106.     /*----------------------------------------------------------------*/
  1107.     /*----------------------------------------------------------------*/
  1108.     /* Code Body                                                      */
  1109.     /*----------------------------------------------------------------*/
  1110.     GoBackToHistory(SCR_ID_SECSET_FDN_LIST);
  1111. }
  1112. /*****************************************************************************
  1113.  * FUNCTION
  1114.  *  GoToAddEditScreen
  1115.  * DESCRIPTION
  1116.  *  Go back to Add screen or edit screen.
  1117.  * PARAMETERS
  1118.  *  void
  1119.  * RETURNS
  1120.  *  void
  1121.  *  Author            : Vanita Jain(?)
  1122.  *****************************************************************************/
  1123. void GoToAddEditScreen(void)
  1124. {
  1125.     /*----------------------------------------------------------------*/
  1126.     /* Local Variables                                                */
  1127.     /*----------------------------------------------------------------*/
  1128.     /*----------------------------------------------------------------*/
  1129.     /* Code Body                                                      */
  1130.     /*----------------------------------------------------------------*/
  1131.     if (IsScreenPresent(SCR_ID_SECSET_FDN_DETAILS))
  1132.     {
  1133.         GoBackToHistory(SCR_ID_SECSET_FDN_DETAILS);
  1134.     }
  1135.     else
  1136.     {
  1137.         GoBackToHistory(SCR_ID_SECSET_FDN_LIST);
  1138.     }
  1139. }
  1140. /*****************************************************************************
  1141.  * FUNCTION
  1142.  *  EntrySECSETFDNBDNSaving
  1143.  * DESCRIPTION
  1144.  *  Show progress screen for Settings.
  1145.  * PARAMETERS
  1146.  *  void
  1147.  * RETURNS
  1148.  *  void
  1149.  *  Author            : Vanita Jain(?)
  1150.  *****************************************************************************/
  1151. void EntrySECSETFDNBDNSaving(void)
  1152. {
  1153.     /*----------------------------------------------------------------*/
  1154.     /* Local Variables                                                */
  1155.     /*----------------------------------------------------------------*/
  1156.     /*----------------------------------------------------------------*/
  1157.     /* Code Body                                                      */
  1158.     /*----------------------------------------------------------------*/
  1159.     EntryNewScreen(SCR_ID_SECSET_FDNBDN_SAVING, NULL, EntrySECSETFDNBDNSaving, NULL);
  1160.     /* micha1020 */
  1161.     ShowCategory66Screen(
  1162.         STR_SCR9002_SECURITY_CAPTION,
  1163.         IMG_SCR_PBOOK_CAPTION,
  1164.         0,
  1165.         0,
  1166.         0,
  1167.         0,
  1168.         (PU8) GetString(STR_GLOBAL_SAVING),
  1169.         IMG_GLOBAL_SAVE,
  1170.         NULL);
  1171.     ClearInputEventHandler(MMI_DEVICE_ALL); /* keep in saving screen and no input can be accepted */
  1172.     ClearKeyHandler(KEY_END, KEY_EVENT_UP);
  1173.     ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
  1174.     ClearKeyHandler(KEY_END, KEY_LONG_PRESS);
  1175.     ClearKeyHandler(KEY_END, KEY_REPEAT);
  1176. }
  1177. /*****************************************************************************
  1178.  * FUNCTION
  1179.  *  EntrySECSETFDNBDNDeleting
  1180.  * DESCRIPTION
  1181.  *  Show progress screen for Settings.
  1182.  * PARAMETERS
  1183.  *  void
  1184.  * RETURNS
  1185.  *  void
  1186.  *  Author            : Vanita Jain(?)
  1187.  *****************************************************************************/
  1188. void EntrySECSETFDNBDNDeleting(void)
  1189. {
  1190.     /*----------------------------------------------------------------*/
  1191.     /* Local Variables                                                */
  1192.     /*----------------------------------------------------------------*/
  1193.     /*----------------------------------------------------------------*/
  1194.     /* Code Body                                                      */
  1195.     /*----------------------------------------------------------------*/
  1196.     EntryNewScreen(SCR_ID_SECSET_FDNBDN_DELETING, NULL, EntrySECSETFDNBDNDeleting, NULL);
  1197.     ShowCategory66Screen(
  1198.         STR_SCR9000_SETTINGS_CAPTION,
  1199.         IMG_SCR_PBOOK_CAPTION,
  1200.         0,
  1201.         0,
  1202.         0,
  1203.         0,
  1204.         (PU8) GetString(STR_PHB_DELETING),
  1205.         IMG_GLOBAL_DELETED,
  1206.         NULL);
  1207.     ClearInputEventHandler(MMI_DEVICE_ALL); /* keep in deleting screen and no input can be accepted */
  1208.     ClearKeyHandler(KEY_END, KEY_EVENT_UP);
  1209.     ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
  1210.     ClearKeyHandler(KEY_END, KEY_LONG_PRESS);
  1211.     ClearKeyHandler(KEY_END, KEY_REPEAT);
  1212. }
  1213. /*****************************************************************************
  1214.  * FUNCTION
  1215.  *  EntryFdlList
  1216.  * DESCRIPTION
  1217.  *  Check if phonebook is ready, if yes then load FDL List
  1218.  * PARAMETERS
  1219.  *  void
  1220.  * RETURNS
  1221.  *  void
  1222.  *****************************************************************************/
  1223. void EntryFdlList(void)
  1224. {
  1225.     /*----------------------------------------------------------------*/
  1226.     /* Local Variables                                                */
  1227.     /*----------------------------------------------------------------*/
  1228.     /*----------------------------------------------------------------*/
  1229.     /* Code Body                                                      */
  1230.     /*----------------------------------------------------------------*/
  1231.     ClearInputEventHandler(MMI_DEVICE_ALL); /* need to reload the FDL list screen and no input can be accepted */
  1232.     ClearKeyHandler(KEY_END, KEY_EVENT_UP);
  1233.     ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
  1234.     ClearKeyHandler(KEY_END, KEY_LONG_PRESS);
  1235.     ClearKeyHandler(KEY_END, KEY_REPEAT);
  1236.     if (g_phb_cntx.phb_ready)
  1237.     {
  1238.         gFDLBDLContext.FDNBDNCount = 0;
  1239.         SECSETGetFdlEntriesReq();
  1240.     }
  1241.     else
  1242.     {
  1243.         DisplayPopup((PU8) GetString(STR_FDL_NOT_READY), IMG_PROCESSING_PHONEBOOK, 1, ST_NOTIFYDURATION, 0);
  1244.     }
  1245. }