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

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.  * CallForwarding.c
  39.  *
  40.  * Project:
  41.  * --------
  42.  *   MAUI
  43.  *
  44.  * Description:
  45.  * ------------
  46.  *   <file description>.
  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.  * removed!
  75.  * removed!
  76.  * removed!
  77.  *
  78.  * removed!
  79.  * removed!
  80.  * removed!
  81.  *
  82.  * removed!
  83.  * removed!
  84.  * removed!
  85.  *
  86.  * removed!
  87.  * removed!
  88.  * removed!
  89.  *
  90.  * removed!
  91.  * removed!
  92.  * removed!
  93.  *
  94.  * removed!
  95.  * removed!
  96.  * removed!
  97.  *
  98.  *------------------------------------------------------------------------------
  99.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
  100.  *============================================================================== 
  101.  *******************************************************************************/
  102. /**
  103.  * Copyright Notice
  104.  * ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
  105.  * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
  106.  *  (It is illegal to remove this copyright notice from this software or any
  107.  *  portion of it)
  108.  */
  109. /**************************************************************
  110.    FILENAME : CallForwarding.c
  111.    PURPOSE     : Call Setting - Call forwarding Application
  112.    REMARKS     : nil
  113.    AUTHOR      : Anil Kumar Vutukuru
  114.    DATE     : 11/14/2003
  115. **************************************************************/
  116. #include "stdC.h"
  117. #include "L4Dr1.h"
  118. #include "CSP.h"
  119. #include "MainMenuDef.h"
  120. #include "ProtocolEvents.h"
  121. #include "PhoneBookTypes.h"
  122. #include "PhoneBookGProt.h"
  123. #include "CallSetUp.h"
  124. #include "DebugInitDef.h"
  125. #include "CallForwarding.h"
  126. #include "CallSetUpEnum.h"
  127. #include "CommonScreens.h"
  128. #include "CallmanagementIdDef.h"
  129. #include "MessagesExDcl.h"
  130. #include "CallManagementGprot.h"
  131. #include "wgui_inputs.h"
  132. #include "wgui_categories_inputs.h"
  133. #include "MMI_features.h"
  134. extern S16 MMI_current_input_ext_type;
  135. /*****************************************************************************
  136.  * FUNCTION
  137.  *  HighlightCALLSETCallFwdCancelAll
  138.  * DESCRIPTION
  139.  *  Highlight handler for cancel all menu option
  140.  * NA
  141.  *  
  142.  * PARAMETERS
  143.  *  void
  144.  * RETURNS
  145.  *  void
  146.  *****************************************************************************/
  147. void HighlightCALLSETCallFwdCancelAll(void)
  148. {
  149.     /*----------------------------------------------------------------*/
  150.     /* Local Variables                                                */
  151.     /*----------------------------------------------------------------*/
  152.     /*----------------------------------------------------------------*/
  153.     /* Code Body                                                      */
  154.     /*----------------------------------------------------------------*/
  155.     /* storing the menu item selected */
  156.     g_callset_context.SSCFType = FORWARD_CANCEL_ALL;
  157.     /* Change left soft key icon and label */
  158.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  159.     /* Change right soft key icon and label */
  160.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  161.     /* set the left/right soft key functions handlers */
  162.     SetLeftSoftkeyFunction(EnterScrCallFwdOffReq, KEY_EVENT_UP);
  163.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  164.     /* set the left/right arrow key function handlers */
  165.     ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  166.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  167.     return;
  168. }
  169. /*****************************************************************************
  170.  * FUNCTION
  171.  *  InitCallForwarding
  172.  * DESCRIPTION
  173.  *  Initialize funtion for call fwding application.
  174.  * NA
  175.  *  
  176.  * PARAMETERS
  177.  *  void
  178.  * RETURNS
  179.  *  void
  180.  *****************************************************************************/
  181. void InitCallForwarding(void)
  182. {
  183.     /*----------------------------------------------------------------*/
  184.     /* Local Variables                                                */
  185.     /*----------------------------------------------------------------*/
  186.     /*----------------------------------------------------------------*/
  187.     /* Code Body                                                      */
  188.     /*----------------------------------------------------------------*/
  189.     /* Set hilite handlers for the individual sub menu items of call forwarding */
  190.     SetHiliteHandler(MENU8237_SCR8093_MNGCALL_MENU_FWD, HighlightCALLSETCallFwd);
  191.     SetHiliteHandler(MENU8238_MNGCALL_CALFWD_VOICECALL, HighlightCALLSETCallFwdVoice);
  192.     SetHiliteHandler(MENU8238_MNGCALL_CALFWD_DATACALL, HighlightCALLSETCallFwdData);
  193.     SetHiliteHandler(MENU8239_CALFWD_VOICECALL_UNREACHABLE, HighlightCALLSETCallFwdUnreach);
  194.     SetHiliteHandler(MENU8239_CALFWD_VOICECALL_NOANSWER, HighlightCALLSETCallFwdNoAns);
  195.     SetHiliteHandler(MENU8239_CALFWD_VOICECALL_ALLCOND, HighlightCALLSETCallFwdAllCond);
  196.     SetHiliteHandler(MENU8239_CALFWD_VOICECALL_BUSY, HighlightCALLSETCallFwdBusy);
  197.     SetHiliteHandler(MENU8240_MNGCALL_CALLFWD_FWD_ON, HighlightCALLSETCallFwdOn);
  198.     SetHiliteHandler(MENU8240_MNGCALL_CALLFWD_FWD_OFF, HighlightCALLSETCallFwdOff);
  199.     SetHiliteHandler(MENU8240_MNGCALL_CALLFWD_FWD_QUERY, HighlightCALLSETCallFwdQuery);
  200.     SetHiliteHandler(MENU_CALL_FWD_CANCELALL, HighlightCALLSETCallFwdCancelAll);
  201.     ResetCFCondStage();
  202. }
  203. /*****************************************************************************
  204.  * FUNCTION
  205.  *  HighlightCALLSETCallFwd
  206.  * DESCRIPTION
  207.  *  Highlight handler for the call fwding menu option
  208.  * NA
  209.  *  
  210.  * PARAMETERS
  211.  *  void
  212.  * RETURNS
  213.  *  void
  214.  *****************************************************************************/
  215. void HighlightCALLSETCallFwd(void)
  216. {
  217.     /*----------------------------------------------------------------*/
  218.     /* Local Variables                                                */
  219.     /*----------------------------------------------------------------*/
  220.     /*----------------------------------------------------------------*/
  221.     /* Code Body                                                      */
  222.     /*----------------------------------------------------------------*/
  223.     /* Change left soft key icon and label */
  224.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  225.     /* Change right soft key icon and label */
  226.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  227.     /* set the left/right arrow key function handlers */
  228.     SetKeyHandler(EntryCALLSETForwardMain, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  229.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  230.     /* set the left/right soft key functions handlers */
  231.     SetLeftSoftkeyFunction(EntryCALLSETForwardMain, KEY_EVENT_UP);
  232.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  233.     return;
  234. }
  235. /*****************************************************************************
  236.  * FUNCTION
  237.  *  HighlightCALLSETCallFwdVoice
  238.  * DESCRIPTION
  239.  *  Hightlight handler for call fwd voice sub menu item
  240.  * NA
  241.  *  
  242.  * PARAMETERS
  243.  *  void
  244.  * RETURNS
  245.  *  void
  246.  *****************************************************************************/
  247. void HighlightCALLSETCallFwdVoice(void)
  248. {
  249.     /*----------------------------------------------------------------*/
  250.     /* Local Variables                                                */
  251.     /*----------------------------------------------------------------*/
  252.     /*----------------------------------------------------------------*/
  253.     /* Code Body                                                      */
  254.     /*----------------------------------------------------------------*/
  255.     /* storing the menu item selected */
  256.     g_callset_context.SSCFType = FORWARD_ALLVOICE;
  257.     /* set the left/right soft key functions handlers */
  258.     SetLeftSoftkeyFunction(EntryCALLSETForwardOptions, KEY_EVENT_UP);
  259.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  260.     /* set the left/right arrow key function handlers */
  261.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  262.     SetKeyHandler(EntryCALLSETForwardOptions, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  263.     return;
  264. }
  265. /*****************************************************************************
  266.  * FUNCTION
  267.  *  HighlightCALLSETCallFwdData
  268.  * DESCRIPTION
  269.  *  highlight hander for call fwd data sub menu item.
  270.  * NA
  271.  *  
  272.  * PARAMETERS
  273.  *  void
  274.  * RETURNS
  275.  *  void
  276.  *****************************************************************************/
  277. void HighlightCALLSETCallFwdData(void)
  278. {
  279.     /*----------------------------------------------------------------*/
  280.     /* Local Variables                                                */
  281.     /*----------------------------------------------------------------*/
  282.     /*----------------------------------------------------------------*/
  283.     /* Code Body                                                      */
  284.     /*----------------------------------------------------------------*/
  285.     /* storing the menu item selected */
  286.     g_callset_context.SSCFType = FORWARD_DATA;
  287.     /* set the left/right soft key functions handlers */
  288.     SetLeftSoftkeyFunction(EntryCALLSETForwardOptions, KEY_EVENT_UP);
  289.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  290.     /* set the left/right arrow key functions handlers */
  291.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  292.     SetKeyHandler(EntryCALLSETForwardOptions, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  293.     return;
  294. }
  295. /*****************************************************************************
  296.  * FUNCTION
  297.  *  HighlightCALLSETCallFwdUnreach
  298.  * DESCRIPTION
  299.  *  Highlight handler for voice unreach sub menu item
  300.  * NA
  301.  *  
  302.  * PARAMETERS
  303.  *  void
  304.  * RETURNS
  305.  *  void
  306.  *****************************************************************************/
  307. void HighlightCALLSETCallFwdUnreach(void)
  308. {
  309.     /*----------------------------------------------------------------*/
  310.     /* Local Variables                                                */
  311.     /*----------------------------------------------------------------*/
  312.     /*----------------------------------------------------------------*/
  313.     /* Code Body                                                      */
  314.     /*----------------------------------------------------------------*/
  315.     /* storing the menu item selected */
  316.     g_callset_context.SSCFType = FORWARD_UNREACHABLE;
  317.     /* set the left/right soft key functions handlers */
  318.     SetLeftSoftkeyFunction(EntryCALLSETForwardOptions, KEY_EVENT_UP);
  319.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  320.     /* set the left/right arrow key function handlers */
  321.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  322.     SetKeyHandler(EntryCALLSETForwardOptions, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  323.     return;
  324. }
  325. /*****************************************************************************
  326.  * FUNCTION
  327.  *  HighlightCALLSETCallFwdBusy
  328.  * DESCRIPTION
  329.  *  Highlight handler for when busy sub menu item
  330.  * NA
  331.  *  
  332.  * PARAMETERS
  333.  *  void
  334.  * RETURNS
  335.  *  void
  336.  *****************************************************************************/
  337. void HighlightCALLSETCallFwdBusy(void)
  338. {
  339.     /*----------------------------------------------------------------*/
  340.     /* Local Variables                                                */
  341.     /*----------------------------------------------------------------*/
  342.     /*----------------------------------------------------------------*/
  343.     /* Code Body                                                      */
  344.     /*----------------------------------------------------------------*/
  345.     /* storing the menu item selected */
  346.     g_callset_context.SSCFType = FORWARD_BUSY;
  347.     /* set the left/right soft key functions handlers */
  348.     SetLeftSoftkeyFunction(EntryCALLSETForwardOptions, KEY_EVENT_UP);
  349.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  350.     /* set the left/right arrow key function handlers */
  351.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  352.     SetKeyHandler(EntryCALLSETForwardOptions, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  353.     return;
  354. }
  355. /*****************************************************************************
  356.  * FUNCTION
  357.  *  HighlightCALLSETCallFwdNoAns
  358.  * DESCRIPTION
  359.  *  Highlight handler for call fwd when no answer
  360.  * NA
  361.  *  
  362.  * PARAMETERS
  363.  *  void
  364.  * RETURNS
  365.  *  void
  366.  *****************************************************************************/
  367. void HighlightCALLSETCallFwdNoAns(void)
  368. {
  369.     /*----------------------------------------------------------------*/
  370.     /* Local Variables                                                */
  371.     /*----------------------------------------------------------------*/
  372.     /*----------------------------------------------------------------*/
  373.     /* Code Body                                                      */
  374.     /*----------------------------------------------------------------*/
  375.     /* storing the menu item selected */
  376.     g_callset_context.SSCFType = FORWARD_NOANSWER;
  377.     /* set the left/right soft key functions handlers */
  378.     SetLeftSoftkeyFunction(EntryCALLSETForwardOptions, KEY_EVENT_UP);
  379.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  380.     /* set the left/right arrow key function handlers */
  381.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  382.     SetKeyHandler(EntryCALLSETForwardOptions, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  383.     return;
  384. }
  385. /*****************************************************************************
  386.  * FUNCTION
  387.  *  HighlightCALLSETCallFwdAllCond
  388.  * DESCRIPTION
  389.  *  Highlight handler for call fwd when no answer
  390.  * NA
  391.  *  
  392.  * PARAMETERS
  393.  *  void
  394.  * RETURNS
  395.  *  void
  396.  *****************************************************************************/
  397. void HighlightCALLSETCallFwdAllCond(void)
  398. {
  399.     /*----------------------------------------------------------------*/
  400.     /* Local Variables                                                */
  401.     /*----------------------------------------------------------------*/
  402.     /*----------------------------------------------------------------*/
  403.     /* Code Body                                                      */
  404.     /*----------------------------------------------------------------*/
  405.     /* storing the menu item selected */
  406.     g_callset_context.SSCFType = FORWARD_ALLCOND;
  407.     /* set the left/right soft key functions handlers */
  408.     SetLeftSoftkeyFunction(EntryCALLSETForwardOptions, KEY_EVENT_UP);
  409.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  410.     /* set the left/right arrow key function handlers */
  411.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  412.     SetKeyHandler(EntryCALLSETForwardOptions, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  413.     return;
  414. }
  415. /*****************************************************************************
  416.  * FUNCTION
  417.  *  HighlightCALLSETCallFwdOn
  418.  * DESCRIPTION
  419.  *  Highlight handler for call fwd on submenu item
  420.  * NA
  421.  *  
  422.  * PARAMETERS
  423.  *  void
  424.  * RETURNS
  425.  *  void
  426.  *****************************************************************************/
  427. void HighlightCALLSETCallFwdOn(void)
  428. {
  429.     /*----------------------------------------------------------------*/
  430.     /* Local Variables                                                */
  431.     /*----------------------------------------------------------------*/
  432.     /*----------------------------------------------------------------*/
  433.     /* Code Body                                                      */
  434.     /*----------------------------------------------------------------*/
  435.     /* set the left/right soft key functions handlers */
  436.     SetLeftSoftkeyFunction(EntryCALLSETForwardNumber, KEY_EVENT_UP);
  437.     /* micha0529 */
  438.     SetKeyHandler(EntryCALLSETForwardNumber, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  439.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  440.     return;
  441. }
  442. /*****************************************************************************
  443.  * FUNCTION
  444.  *  HighlightCALLSETCallFwdOff
  445.  * DESCRIPTION
  446.  *  Highlight handler for call fwd off submenu item
  447.  * NA
  448.  *  
  449.  * PARAMETERS
  450.  *  void
  451.  * RETURNS
  452.  *  void
  453.  *****************************************************************************/
  454. void HighlightCALLSETCallFwdOff(void)
  455. {
  456.     /*----------------------------------------------------------------*/
  457.     /* Local Variables                                                */
  458.     /*----------------------------------------------------------------*/
  459.     /*----------------------------------------------------------------*/
  460.     /* Code Body                                                      */
  461.     /*----------------------------------------------------------------*/
  462.     /* set the left/right soft key functions handlers */
  463.     SetLeftSoftkeyFunction(EnterScrCallFwdOffReq, KEY_EVENT_UP);
  464.     /* micha0529 */
  465.     ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  466.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  467.     return;
  468. }
  469. /*****************************************************************************
  470.  * FUNCTION
  471.  *  HighlightCALLSETCallFwdQuery
  472.  * DESCRIPTION
  473.  *  Highlight handler for call fwd on query sub menu item
  474.  * NA
  475.  *  
  476.  * PARAMETERS
  477.  *  void
  478.  * RETURNS
  479.  *  void
  480.  *****************************************************************************/
  481. void HighlightCALLSETCallFwdQuery(void)
  482. {
  483.     /*----------------------------------------------------------------*/
  484.     /* Local Variables                                                */
  485.     /*----------------------------------------------------------------*/
  486.     /*----------------------------------------------------------------*/
  487.     /* Code Body                                                      */
  488.     /*----------------------------------------------------------------*/
  489.     /* set the left/right soft key functions handlers */
  490.     SetLeftSoftkeyFunction(EnterScrCallFwdQueryReq, KEY_EVENT_UP);
  491.     /* micha0529 */
  492.     ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  493.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  494.     return;
  495. }
  496. /*****************************************************************************
  497.  * FUNCTION
  498.  *  EntryCALLSETForwardMain
  499.  * DESCRIPTION
  500.  *  Entry function for call fwd main screen
  501.  * NA
  502.  *  
  503.  * PARAMETERS
  504.  *  void
  505.  * RETURNS
  506.  *  void
  507.  *****************************************************************************/
  508. void EntryCALLSETForwardMain(void)
  509. {
  510.     /*----------------------------------------------------------------*/
  511.     /* Local Variables                                                */
  512.     /*----------------------------------------------------------------*/
  513.     //micha1229
  514.     //      U16 nDispAttribute; /* Stores display attribue */
  515.     U8 *guiBuffer;              /* Buffer holding history data */
  516.     U16 nNumofItem;
  517.     U16 nStrItemList[MAX_SUB_MENUS];
  518.     /*----------------------------------------------------------------*/
  519.     /* Code Body                                                      */
  520.     /*----------------------------------------------------------------*/
  521.     /* U32 maskingByte=0xFFFFFFFF;
  522.        U32 menuItemId=0xFFFFFFFF; */
  523.     EntryNewScreen(SCR_ID_CALLSET_FORWARD_MAIN, NULL, EntryCALLSETForwardMain, NULL);
  524.     /* Get current screen info into gui buffer  for history purposes */
  525.     guiBuffer = GetCurrGuiBuffer(SCR_ID_CALLSET_FORWARD_MAIN);
  526.     /* Retrieve no of child of menu item to be displayed */
  527.     nNumofItem = GetNumOfChild_Ext(MENU8237_SCR8093_MNGCALL_MENU_FWD);  /* diamond, 2005/07/01 add _Ext to menu item functions */
  528.     /* Get attribute of menu to be displayed */
  529.     /* nDispAttribute = GetDispAttributeOfItem(MENU8237_SCR8093_MNGCALL_MENU_FWD); */
  530.     /* Retrieve string ids in sequence of given menu item to be displayed */
  531.     GetSequenceStringIds_Ext(MENU8237_SCR8093_MNGCALL_MENU_FWD, nStrItemList);  /* diamond, 2005/07/01 add _Ext to menu item functions */
  532.     /* Set current parent id */
  533.     SetParentHandler(MENU8237_SCR8093_MNGCALL_MENU_FWD);
  534.     /* Register highlight handler to be called in menu screen */
  535.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  536.     /* diamond, 2005/07/01 removed for new menu item architecture to CPHS */
  537. #if 0
  538. /* under construction !*/
  539. /* under construction !*/
  540. /* under construction !*/
  541. /* under construction !*/
  542. /* under construction !*/
  543. /* under construction !*/
  544. /* under construction !*/
  545. /* under construction !*/
  546. /* under construction !*/
  547. /* under construction !*/
  548. /* under construction !*/
  549. /* under construction !*/
  550. /* under construction !*/
  551. #endif /* 0 */ 
  552.     /* Display Category15 Screen */
  553.     ShowCategory15Screen(
  554.         STR_MENU8238_MNGCALL_CALLFWD_CAPTION,
  555.         MAIN_MENU_TITLE_SETTINGS_ICON,
  556.         STR_GLOBAL_OK,
  557.         IMG_GLOBAL_OK,
  558.         STR_GLOBAL_BACK,
  559.         IMG_GLOBAL_BACK,
  560.         nNumofItem,
  561.         nStrItemList,
  562.         (U16*) gIndexIconsImageList,
  563.         1,
  564.         0,
  565.         guiBuffer);
  566.     /* Register function with right softkey */
  567.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  568.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  569.     return;
  570. }
  571. /*****************************************************************************
  572.  * FUNCTION
  573.  *  EntryCALLSETForwardOptions
  574.  * DESCRIPTION
  575.  *  Entry function for call fwd options screen
  576.  * NA
  577.  *  
  578.  * PARAMETERS
  579.  *  void
  580.  * RETURNS
  581.  *  void
  582.  *****************************************************************************/
  583. void EntryCALLSETForwardOptions(void)
  584. {
  585.     /*----------------------------------------------------------------*/
  586.     /* Local Variables                                                */
  587.     /*----------------------------------------------------------------*/
  588.     //micha1229
  589.     //      U16 nDispAttribute; /* Stores display attribue */
  590.     U8 *guiBuffer;              /* Buffer holding history data */
  591.     U16 nNumofItem;
  592.     U16 nStrItemList[MAX_SUB_MENUS];
  593.     /*----------------------------------------------------------------*/
  594.     /* Code Body                                                      */
  595.     /*----------------------------------------------------------------*/
  596.     EntryNewScreen(SCR_ID_CALLSET_FORWARD_OPTIONS, NULL, EntryCALLSETForwardOptions, NULL);
  597.     /* Get current screen info into gui buffer  for history purposes */
  598.     guiBuffer = GetCurrGuiBuffer(SCR_ID_CALLSET_FORWARD_OPTIONS);
  599.     /* Retrieve no of child of menu item to be displayed */
  600.     nNumofItem = GetNumOfChild(MENU8240_MNGCALL_CALLFWD_FWD_OPTION);
  601.     /* Get attribute of menu to be displayed */
  602.     /* nDispAttribute = GetDispAttributeOfItem(MENU8240_MNGCALL_CALLFWD_FWD_OPTION  ); */
  603.     /* Retrieve string ids in sequence of given menu item to be displayed */
  604.     GetSequenceStringIds(MENU8240_MNGCALL_CALLFWD_FWD_OPTION, nStrItemList);
  605.     /* Set current parent id */
  606.     SetParentHandler(MENU8240_MNGCALL_CALLFWD_FWD_OPTION);
  607.     /* Register highlight handler to be called in menu screen */
  608.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  609.     /* Display Category1 Screen */
  610.     ShowCategory15Screen(
  611.         STR_MENU8240_MNGCALL_CALLFWD_FWD_OPTION,
  612.         MAIN_MENU_TITLE_SETTINGS_ICON,
  613.         STR_GLOBAL_OK,
  614.         IMG_GLOBAL_OK,
  615.         STR_GLOBAL_BACK,
  616.         IMG_GLOBAL_BACK,
  617.         nNumofItem,
  618.         nStrItemList,
  619.         (U16*) gIndexIconsImageList,
  620.         1,
  621.         0,
  622.         guiBuffer);
  623.     /* Register function with right softkey */
  624.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  625.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  626.     return;
  627. }
  628. /*****************************************************************************
  629.  * FUNCTION
  630.  *  StarKeyHandler
  631.  * DESCRIPTION
  632.  *  Key handler for the astrick key.
  633.  * NA
  634.  *  
  635.  * PARAMETERS
  636.  *  void
  637.  * RETURNS
  638.  *  void
  639.  *****************************************************************************/
  640. void StarKeyHandler(void)
  641. {
  642.     /*----------------------------------------------------------------*/
  643.     /* Local Variables                                                */
  644.     /*----------------------------------------------------------------*/
  645.     /*----------------------------------------------------------------*/
  646.     /* Code Body                                                      */
  647.     /*----------------------------------------------------------------*/
  648. multiline_inputbox_direct_input('+');
  649.     return;
  650. }
  651. /*****************************************************************************
  652.  * FUNCTION
  653.  *  EntryCALLSETForwardNumber
  654.  * DESCRIPTION
  655.  *  Entry function for the enter number for call fwd screen.
  656.  * NA
  657.  *  
  658.  * PARAMETERS
  659.  *  void
  660.  * RETURNS
  661.  *  void
  662.  *****************************************************************************/
  663. void EntryCALLSETForwardNumber(void)
  664. {
  665.     /*----------------------------------------------------------------*/
  666.     /* Local Variables                                                */
  667.     /*----------------------------------------------------------------*/
  668.     U8 *guiBuffer;
  669.     /*----------------------------------------------------------------*/
  670.     /* Code Body                                                      */
  671.     /*----------------------------------------------------------------*/
  672.     EntryNewScreen(SCR_ID_CALLSET_FORWARD_NUMBER, ExitCALLSETForwardNumber, EntryCALLSETForwardNumber, NULL);
  673.     /* Get current screen info into gui buffer  for history purposes */
  674.     guiBuffer = GetCurrGuiBuffer(SCR_ID_CALLSET_FORWARD_NUMBER);
  675.     /* Check the screen is from forward or backward traversal */
  676.     if (guiBuffer == NULL)
  677.     {
  678.         memset(g_callset_context.SSCFNum, 0, (MAX_CC_ADDR_LEN * ENCODING_LENGTH) + 2);
  679.     }
  680.     if (g_callset_context.SSCFNumFromPHB)
  681.     {
  682.         guiBuffer = NULL;
  683.     }
  684.     g_callset_context.SSCFNumFromPHB = FALSE;
  685.     MMI_current_input_ext_type |= INPUT_TYPE_EXT_SIM_NUMERIC;
  686.     /* to display the screen for taking input for the callfwd number */
  687.     ShowCategory5Screen(
  688.         STR_CALL_FWD_ENTER_NUM_CAP,
  689.         MAIN_MENU_TITLE_SETTINGS_ICON,
  690.         STR_GLOBAL_OK,
  691.         IMG_GLOBAL_OK,
  692.         STR_GLOBAL_BACK,
  693.         IMG_GLOBAL_BACK,
  694.         INPUT_TYPE_PHONE_NUMBER,
  695.         (PU8) g_callset_context.SSCFNum,
  696.         MAX_CC_ADDR_LEN,
  697.         guiBuffer);
  698.     /* clear key handler for the pound key */
  699.     ClearKeyHandler(KEY_POUND, KEY_EVENT_DOWN);
  700.     /* set key handler for the astrick key */
  701.     ClearKeyHandler(KEY_STAR, KEY_EVENT_UP);
  702.     SetKeyHandler(StarKeyHandler, KEY_STAR, KEY_EVENT_DOWN);
  703.     /* set the left and right soft key functionalities */
  704.     SetLeftSoftkeyFunction(EnterScrCallFwdOnReq, KEY_EVENT_UP);
  705.     SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  706.     return;
  707. }
  708. /*****************************************************************************
  709.  * FUNCTION
  710.  *  ExitCALLSETForwardNumber
  711.  * DESCRIPTION
  712.  *  Exit function for the enter number for call fwd screen.
  713.  * NA
  714.  *  
  715.  * PARAMETERS
  716.  *  void
  717.  * RETURNS
  718.  *  void
  719.  *****************************************************************************/
  720. void ExitCALLSETForwardNumber(void)
  721. {
  722.     /*----------------------------------------------------------------*/
  723.     /* Local Variables                                                */
  724.     /*----------------------------------------------------------------*/
  725.     /*----------------------------------------------------------------*/
  726.     /* Code Body                                                      */
  727.     /*----------------------------------------------------------------*/
  728.     MMI_current_input_ext_type &= ~INPUT_TYPE_EXT_SIM_NUMERIC;
  729. }
  730. /*****************************************************************************
  731.  * FUNCTION
  732.  *  EnterScrCallFwdOnReq
  733.  * DESCRIPTION
  734.  *  Entry function for call fwd screen when on req .
  735.  * NA
  736.  *  
  737.  * PARAMETERS
  738.  *  void
  739.  * RETURNS
  740.  *  void
  741.  *****************************************************************************/
  742. void EnterScrCallFwdOnReq(void)
  743. {
  744.     /*----------------------------------------------------------------*/
  745.     /* Local Variables                                                */
  746.     /*----------------------------------------------------------------*/
  747.     S8 input_string[MAX_DIGITS_USSD * ENCODING_LENGTH];
  748.     S8 string_code[50];
  749.     PS8 hash_string = NULL;
  750.     S8 uni_input_string[MAX_DIGITS_USSD * ENCODING_LENGTH];
  751.     U8 i;
  752.     /*----------------------------------------------------------------*/
  753.     /* Code Body                                                      */
  754.     /*----------------------------------------------------------------*/
  755.     /* check the buffer of the call fwding number */
  756.     if (pfnUnicodeStrlen((S8*) g_callset_context.SSCFNum) == 0)
  757.     {
  758.         mmi_phb_call_enter_from_divert();
  759.         return;
  760.     }
  761.     for (i = 0; i < pfnUnicodeStrlen((S8*) g_callset_context.SSCFNum); i++)
  762.     {
  763.         if ((g_callset_context.SSCFNum[i * 2] == 'p') || (g_callset_context.SSCFNum[i * 2] == 'w'))
  764.         {
  765.             DisplayPopup((PU8) GetString(STR_GLOBAL_NOT_DONE), IMG_GLOBAL_UNFINISHED, 0, CS_NOTIFYDURATION, ERROR_TONE);
  766.             return;
  767.         }
  768.     }
  769.     /* format the string for the ss string handling */
  770.     memset(input_string, 0, (MAX_DIGITS_USSD * ENCODING_LENGTH));
  771.     memset(string_code, 0, 50);
  772.     hash_string = (PS8) GetString(STR_HASH_VALUE);
  773.     switch (g_callset_context.SSCFType)
  774.     {
  775.             /* if the menu item is selected is voice call fwd when un reachable */
  776.         case FORWARD_UNREACHABLE:
  777.             strcpy((S8*) string_code, "**62*");
  778.             AnsiiToUnicodeString((PS8) input_string, (PS8) string_code);
  779.             pfnUnicodeStrcat((PS8) input_string, (PS8) g_callset_context.SSCFNum);
  780.             pfnUnicodeStrcat((PS8) input_string, (PS8) hash_string);
  781.             break;
  782.             /* if the menu item is selected is voice call fwd when no answer */
  783.         case FORWARD_NOANSWER:
  784.         case FORWARD_ALLCOND:
  785.             EntryCALLSETForwardNoAnsTime();
  786.             return;
  787.             /* if the menu item is selected is voice call fwd when busy */
  788.         case FORWARD_BUSY:
  789.             strcpy((S8*) string_code, "**67*");
  790.             AnsiiToUnicodeString((PS8) input_string, (PS8) string_code);
  791.             pfnUnicodeStrcat((PS8) input_string, (PS8) g_callset_context.SSCFNum);
  792.             pfnUnicodeStrcat((PS8) input_string, (PS8) hash_string);
  793.             break;
  794.             /* if the menu item is selected all voice call fwd */
  795.         case FORWARD_ALLVOICE:
  796.             strcpy((S8*) string_code, "**21*");
  797.             AnsiiToUnicodeString((PS8) input_string, (PS8) string_code);
  798.             pfnUnicodeStrcat((PS8) input_string, (PS8) g_callset_context.SSCFNum);
  799.             strcpy((S8*) string_code, "*11");
  800.             AnsiiToUnicodeString((PS8) uni_input_string, (PS8) string_code);
  801.             pfnUnicodeStrcat((PS8) input_string, (PS8) uni_input_string);
  802.             pfnUnicodeStrcat((PS8) input_string, (PS8) hash_string);
  803.             break;
  804.             /* if the menu item is selected is data call fwd */
  805.         case FORWARD_DATA:
  806.             strcpy((S8*) string_code, "**21*");
  807.             AnsiiToUnicodeString((PS8) input_string, (PS8) string_code);
  808.             pfnUnicodeStrcat((PS8) input_string, (PS8) g_callset_context.SSCFNum);
  809.             strcpy((S8*) string_code, "*20");
  810.             AnsiiToUnicodeString((PS8) uni_input_string, (PS8) string_code);
  811.             pfnUnicodeStrcat((PS8) input_string, (PS8) uni_input_string);
  812.             pfnUnicodeStrcat((PS8) input_string, (PS8) hash_string);
  813.             break;
  814.     }
  815.     /* set protocol event handler for the call fwd response */
  816.     SetProtocolEventHandler(CALLSETForwardRsp, PRT_MMI_SS_CALL_FORWARD_RSP);
  817.     /* make a corresponding ss string for call fwd option */
  818.     MakeCall((PS8) input_string);
  819.     return;
  820. }
  821. /*****************************************************************************
  822.  * FUNCTION
  823.  *  ResetCFCondStage
  824.  * DESCRIPTION
  825.  *  Entry function for call fwd screen when off req .
  826.  * NA
  827.  *  
  828.  * PARAMETERS
  829.  *  void
  830.  * RETURNS
  831.  *  void
  832.  *****************************************************************************/
  833. void ResetCFCondStage(void)
  834. {
  835.     g_callset_context.SSCFCondQueryStage = CF_COND_STAGE_NONE;
  836. }
  837. /*****************************************************************************
  838.  * FUNCTION
  839.  *  EnterScrCallFwdOffReq
  840.  * DESCRIPTION
  841.  *  Entry function for call fwd screen when off req .
  842.  * NA
  843.  *  
  844.  * PARAMETERS
  845.  *  void
  846.  * RETURNS
  847.  *  void
  848.  *****************************************************************************/
  849. void EnterScrCallFwdOffReq(void)
  850. {
  851.     /*----------------------------------------------------------------*/
  852.     /* Local Variables                                                */
  853.     /*----------------------------------------------------------------*/
  854.     S8 input_string[MAX_DIGITS_USSD * ENCODING_LENGTH];
  855.     S8 string_out[20];
  856.     /*----------------------------------------------------------------*/
  857.     /* Code Body                                                      */
  858.     /*----------------------------------------------------------------*/
  859.     //micha1229
  860.     //      PS8 hash_string = NULL ;
  861.     /* format the string for the ss string handling */
  862.     memset(input_string, 0, (MAX_DIGITS_USSD * ENCODING_LENGTH));
  863.     memset(string_out, 0, 20);
  864.     /* hash_string = (PS8) GetString(STR_HASH_VALUE); */
  865.     switch (g_callset_context.SSCFType)
  866.     {
  867.             /* if the menu item is selected is voice call fwd when un reachable */
  868.         case FORWARD_UNREACHABLE:
  869.             strcpy((S8*) string_out, "##62#");
  870.             AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
  871.             break;
  872.             /* if the menu item is selected is voice call fwd when no answer */
  873.         case FORWARD_NOANSWER:
  874.             strcpy((S8*) string_out, "##61#");
  875.             AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
  876.             break;
  877.             /* if the menu item is selected is voice call fwd when all conditional */
  878.         case FORWARD_BUSY:
  879.             strcpy((S8*) string_out, "##67#");
  880.             AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
  881.             break;
  882.             /* if the menu item is selected all voice call fwd */
  883.         case FORWARD_ALLCOND:
  884.             strcpy((S8*) string_out, "##004#");
  885.             AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
  886.             break;
  887.             /* if the menu item is selected is voice call fwd when busy */
  888.         case FORWARD_ALLVOICE:
  889.             strcpy((S8*) string_out, "##21**11#");
  890.             AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
  891.             break;
  892.             /* if the menu item is selected is cancel all fwd */
  893.         case FORWARD_CANCEL_ALL:
  894.             strcpy((S8*) string_out, "##002#");
  895.             AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
  896.             break;
  897.             /* if the menu item is selected is data call fwd */
  898.         case FORWARD_DATA:
  899.             strcpy((S8*) string_out, "##21**20#");
  900.             AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
  901.             break;
  902.     }
  903.     /* set protocol event handler for the call fwd response */
  904.     SetProtocolEventHandler(CALLSETForwardRsp, PRT_MMI_SS_CALL_FORWARD_RSP);
  905.     /* make a corresponding ss string for call fwd option */
  906.     MakeCall((PS8) input_string);
  907.     return;
  908. }
  909. /*****************************************************************************
  910.  * FUNCTION
  911.  *  EnterScrCallFwdQueryReq
  912.  * DESCRIPTION
  913.  *  Entry function for call fwd screen qurey request.
  914.  * NA
  915.  *  
  916.  * PARAMETERS
  917.  *  void
  918.  * RETURNS
  919.  *  void
  920.  *****************************************************************************/
  921. void EnterScrCallFwdQueryReq(void)
  922. {
  923.     /*----------------------------------------------------------------*/
  924.     /* Local Variables                                                */
  925.     /*----------------------------------------------------------------*/
  926.     S8 input_string[MAX_DIGITS_USSD * ENCODING_LENGTH];
  927.     S8 string_out[20];
  928.     /*----------------------------------------------------------------*/
  929.     /* Code Body                                                      */
  930.     /*----------------------------------------------------------------*/
  931.     //micha1229
  932.     //      PS8 hash_string = NULL ;
  933.     /* format the string for the ss string handling */
  934.     memset(input_string, 0, (MAX_DIGITS_USSD * ENCODING_LENGTH));
  935.     memset(string_out, 0, 20);
  936.     /* hash_string = (PS8) GetString(STR_HASH_VALUE); */
  937.     switch (g_callset_context.SSCFType)
  938.     {
  939.             /* if the menu item is selected is voice call fwd when un reachable */
  940.         case FORWARD_UNREACHABLE:
  941.             strcpy((S8*) string_out, "*#62#");
  942.             AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
  943.             break;
  944.             /* if the menu item is selected is voice call fwd when no answer */
  945.         case FORWARD_NOANSWER:
  946.             strcpy((S8*) string_out, "*#61#");
  947.             AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
  948.             break;
  949.             /* if the menu item is selected is voice call fwd when all conditional */
  950.         case FORWARD_BUSY:
  951.             strcpy((S8*) string_out, "*#67#");
  952.             AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
  953.             break;
  954.             /* if the menu item is selected all voice call fwd */
  955.         case FORWARD_ALLCOND:
  956.             switch (g_callset_context.SSCFCondQueryStage)
  957.             {
  958.                 case CF_COND_STAGE_NONE:
  959.                     g_callset_context.SSCFCondQueryStage = CF_COND_STAGE_UNREACH;            
  960.                     strcpy((S8*) string_out, "*#62#");
  961.                     AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
  962.                     break;
  963.                 case CF_COND_STAGE_UNREACH:
  964.                     g_callset_context.SSCFCondQueryStage = CF_COND_STAGE_NOANS;            
  965.                     strcpy((S8*) string_out, "*#61#");
  966.                     AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
  967.                     break;
  968.                 case CF_COND_STAGE_NOANS:
  969.                     g_callset_context.SSCFCondQueryStage = CF_COND_STAGE_BUSY;            
  970.                     strcpy((S8*) string_out, "*#67#");
  971.                     AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
  972.                     break;
  973.                 default:
  974.                     ASSERT(0);
  975.                     break;
  976.             }
  977.             break;
  978.             /* if the menu item is selected is voice call fwd when busy */
  979.         case FORWARD_ALLVOICE:
  980.             strcpy((S8*) string_out, "*#21**11#");
  981.             AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
  982.             break;
  983.             /* if the menu item is selected is data call fwd */
  984.         case FORWARD_DATA:
  985.             strcpy((S8*) string_out, "*#21**20#");
  986.             AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
  987.             break;
  988.     }
  989.     /* set protocol event handler for the call fwd response */
  990.     SetProtocolEventHandler(CALLSETForwardRsp, PRT_MMI_SS_CALL_FORWARD_RSP);
  991.     /* make a corresponding ss string for call fwd option */
  992.     MakeCall((PS8) input_string);
  993.     return;
  994. }
  995. /*****************************************************************************
  996.  * FUNCTION
  997.  *  CALLSETForwardRsp
  998.  * DESCRIPTION
  999.  *  response handler for the call fwd query request.
  1000.  * NA
  1001.  *  
  1002.  * PARAMETERS
  1003.  *  info        [?]     
  1004.  * RETURNS
  1005.  *  void
  1006.  *****************************************************************************/
  1007. void CALLSETForwardRsp(void *info)
  1008. {
  1009.     /*----------------------------------------------------------------*/
  1010.     /* Local Variables                                                */
  1011.     /*----------------------------------------------------------------*/
  1012.     S8 short_string[45], TempShortString[90];
  1013.     S8 TempBuff[250];
  1014.     S8 *TempBuff1;
  1015.     U8 bs_index;
  1016.     mmi_ss_call_forward_rsp_struct *pMsgFwdQueryrsp = (mmi_ss_call_forward_rsp_struct*) info;
  1017.     /*----------------------------------------------------------------*/
  1018.     /* Code Body                                                      */
  1019.     /*----------------------------------------------------------------*/
  1020.     DeleteScreenIfPresent(SCR_ID_CALLSET_FORWARD_OPTIONS);
  1021.     DeleteScreenIfPresent(SCR_ID_CALLSET_FORWARD_NUMBER);
  1022.     DeleteScreenIfPresent(SCR_ID_CALLSET_FORWARD_NO_ANS_TIME);
  1023.     TempBuff1 = (S8*) OslMalloc(MAX_DISP_UCS2);
  1024.     memset(TempBuff1, 0, MAX_DISP_UCS2);                    
  1025.     if (pMsgFwdQueryrsp->result.flag == L4C_OK)
  1026.     {
  1027.         switch (pMsgFwdQueryrsp->type)
  1028.         {
  1029.             case L4_CFU:
  1030.                 pfnUnicodeStrcpy((PS8) TempBuff1, (PS8) GetString(STR_L4_CFU));
  1031.                 break;
  1032.             case L4_CFB:
  1033.                 pfnUnicodeStrcpy((PS8) TempBuff1, (PS8) GetString(STR_L4_CFB));
  1034.                 break;
  1035.             case L4_CFNRY:
  1036.                 pfnUnicodeStrcpy((PS8) TempBuff1, (PS8) GetString(STR_L4_CFNRY));
  1037.                 break;
  1038.             case L4_CFNRC:
  1039.                 pfnUnicodeStrcpy((PS8) TempBuff1, (PS8) GetString(STR_L4_CFNRC));
  1040.                 break;
  1041.             case L4_CFA:
  1042.                 pfnUnicodeStrcpy((PS8) TempBuff1, (PS8) GetString(STR_L4_CFA));
  1043.                 break;
  1044.             case L4_CFC:
  1045.                 pfnUnicodeStrcpy((PS8) TempBuff1, (PS8) GetString(STR_L4_CFC));
  1046.                 break;
  1047.             default:
  1048.                 pfnUnicodeStrcpy((PS8) TempBuff1, (PS8) GetString(STR_FWD_UNKNOWN_SERVICE));
  1049.                 break;
  1050.         }
  1051.         if (pMsgFwdQueryrsp->count == 0)
  1052.         {
  1053.             pfnUnicodeStrcat((PS8) TempBuff1, (PS8) GetString(STR_DEACTIVATED));
  1054.         }
  1055.         for (bs_index = 0; bs_index < pMsgFwdQueryrsp->count; bs_index++)
  1056.         {
  1057.             memset(TempBuff, 0, sizeof(TempBuff));
  1058.             if (pMsgFwdQueryrsp->list[bs_index].ss_status & SS_ABIT)
  1059.             {
  1060.                 pfnUnicodeStrcat((PS8) TempBuff, (PS8) GetString(STR_ACTIVATED));
  1061.             }
  1062.             else if (pMsgFwdQueryrsp->opcode == SS_OP_INTERROGATESS)
  1063.             {
  1064.                 if (pMsgFwdQueryrsp->list[bs_index].ss_status & SS_PBIT)
  1065.                 {
  1066.                     pfnUnicodeStrcat((PS8) TempBuff, (PS8) GetString(STR_DEACTIVATED));
  1067.                 }
  1068.                 else
  1069.                 {
  1070.                     pfnUnicodeStrcat((PS8) TempBuff, (PS8) GetString(STR_NOT_PROVIDED));
  1071.                 }
  1072.             }
  1073.             else
  1074.             {
  1075.                 pfnUnicodeStrcat((PS8) TempBuff, (PS8) GetString(STR_DEACTIVATED));
  1076.             }
  1077.             if (pMsgFwdQueryrsp->list[bs_index].no_reply_timer != 0)
  1078.             {
  1079.                 sprintf(short_string, "%d ", (U8) pMsgFwdQueryrsp->list[bs_index].no_reply_timer);
  1080.                 AnsiiToUnicodeString((PS8) TempShortString, (PS8) short_string);
  1081.                 pfnUnicodeStrcat((S8*) TempBuff, (S8*) TempShortString);
  1082.                 pfnUnicodeStrcat((PS8) TempBuff, (PS8) GetString(STR_SECONDS));
  1083.             }
  1084.             AppendBScodeString(pMsgFwdQueryrsp->list[bs_index].bs_code, TempBuff);
  1085.             if (strlen(pMsgFwdQueryrsp->list[bs_index].address) != 0)
  1086.             {
  1087.                 memset(short_string, 0, sizeof(short_string));
  1088.                 memset(TempShortString, 0, sizeof(TempShortString));
  1089.                 strncpy((PS8) short_string, (PS8) pMsgFwdQueryrsp->list[bs_index].address, sizeof(short_string) - 5);
  1090.                 strcat((PS8) short_string, " ");
  1091.                 AnsiiToUnicodeString((PS8) TempShortString, (PS8) short_string);
  1092.                 pfnUnicodeStrcat((S8*) TempBuff, (S8*) TempShortString);
  1093.             }
  1094.             if ((pfnUnicodeStrlen((PS8) TempBuff) + pfnUnicodeStrlen((PS8) TempBuff1))
  1095.                 < MAX_DISP_UCS2 / ENCODING_LENGTH)
  1096.             {
  1097.                 pfnUnicodeStrcat((S8*) TempBuff1, (S8*) TempBuff);
  1098.             }
  1099.         }
  1100.         sprintf(short_string, "n");
  1101.         AnsiiToUnicodeString((PS8) TempShortString, (PS8) short_string);
  1102.         pfnUnicodeStrcat((S8*) TempBuff1, (S8*) TempShortString);            
  1103.         switch (g_callset_context.SSCFCondQueryStage)
  1104.         {
  1105.             case CF_COND_STAGE_NONE:
  1106.                 pfnUnicodeStrcpy((S8*) g_callset_context.SSDisplayBuffer, (S8*) TempBuff1);
  1107.                 DeleteScreenIfPresent(SCR_ID_CALLSET_GENERAL_SS_RESULT);
  1108.                 EntryCALLSETGeneralSSResut();
  1109.                 break;
  1110.             case CF_COND_STAGE_UNREACH:
  1111.                 pfnUnicodeStrcpy((S8*) g_callset_context.SSDisplayBuffer, (S8*) TempBuff1);
  1112.                 g_callset_context.SSCFType = FORWARD_ALLCOND;
  1113.                 EnterScrCallFwdQueryReq();
  1114.                 break;
  1115.             case CF_COND_STAGE_NOANS:
  1116.                 if ((pfnUnicodeStrlen((PS8) TempBuff1) + pfnUnicodeStrlen((PS8) g_callset_context.SSDisplayBuffer))
  1117.                     < MAX_DISP_UCS2 / ENCODING_LENGTH)
  1118.                 {
  1119.                     pfnUnicodeStrcat((S8*) g_callset_context.SSDisplayBuffer, (S8*) TempBuff1);
  1120.                 }
  1121.                 g_callset_context.SSCFType = FORWARD_ALLCOND;
  1122.                 EnterScrCallFwdQueryReq();
  1123.                 break;
  1124.             case CF_COND_STAGE_BUSY:
  1125.                 if ((pfnUnicodeStrlen((PS8) TempBuff1) + pfnUnicodeStrlen((PS8) g_callset_context.SSDisplayBuffer))
  1126.                     < MAX_DISP_UCS2 / ENCODING_LENGTH)
  1127.                 {
  1128.                     pfnUnicodeStrcat((S8*) g_callset_context.SSDisplayBuffer, (S8*) TempBuff1);
  1129.                 }
  1130.                 g_callset_context.SSCFCondQueryStage = CF_COND_STAGE_NONE;
  1131.                 DeleteScreenIfPresent(SCR_ID_CALLSET_GENERAL_SS_RESULT);
  1132.                 EntryCALLSETGeneralSSResut();
  1133.                 break;
  1134.             default:
  1135.                 ASSERT(0);
  1136.                 break;
  1137.         }
  1138.     }
  1139.     else
  1140.     {
  1141.         ResetCFCondStage();
  1142.     #ifdef __MMI_SS_SHOW_CAUSE__
  1143.         ShowCauseString(pMsgFwdQueryrsp->result.cause, g_callset_context.SSDisplayBuffer);
  1144.         DeleteScreenIfPresent(SCR_ID_CALLSET_GENERAL_SS_RESULT);
  1145.         EntryCALLSETGeneralSSResut();
  1146.     #else /* __MMI_SS_SHOW_CAUSE__ */ 
  1147.         DisplayPopup((PU8) GetString(STR_GLOBAL_NOT_DONE), IMG_GLOBAL_UNFINISHED, 0, CS_NOTIFYDURATION, ERROR_TONE);
  1148.         RemoveSSReqScr();
  1149.     #endif /* __MMI_SS_SHOW_CAUSE__ */ 
  1150.     }
  1151.     OslMfree(TempBuff1);
  1152. }
  1153. /*****************************************************************************
  1154.  * FUNCTION
  1155.  *  ActivateVNoAnswer
  1156.  * DESCRIPTION
  1157.  *  Sending req for the call fwd when no answer case
  1158.  * NA
  1159.  *  
  1160.  * PARAMETERS
  1161.  *  void
  1162.  * RETURNS
  1163.  *  void
  1164.  *****************************************************************************/
  1165. void ActivateVNoAnswer(void)
  1166. {
  1167.     /*----------------------------------------------------------------*/
  1168.     /* Local Variables                                                */
  1169.     /*----------------------------------------------------------------*/
  1170.     S8 input_string[MAX_DIGITS_USSD * ENCODING_LENGTH];
  1171.     S8 string_code[50];
  1172.     PS8 hash_string = NULL;
  1173.     S8 uni_input_string[MAX_DIGITS_USSD * ENCODING_LENGTH];
  1174.     /*----------------------------------------------------------------*/
  1175.     /* Code Body                                                      */
  1176.     /*----------------------------------------------------------------*/
  1177.     /* format the string for the ss string handling */
  1178.     memset(input_string, 0, (MAX_DIGITS_USSD * ENCODING_LENGTH));
  1179.     memset(string_code, 0, 50);
  1180.     hash_string = (PS8) GetString(STR_HASH_VALUE);
  1181.     if (g_callset_context.SSCFType == FORWARD_NOANSWER)
  1182.     {
  1183.         strcpy((S8*) string_code, "**61*");
  1184.     }
  1185.     else
  1186.     {
  1187.         strcpy((S8*) string_code, "**004*");
  1188.     }
  1189.     AnsiiToUnicodeString((PS8) input_string, (PS8) string_code);
  1190.     pfnUnicodeStrcat((PS8) input_string, (PS8) g_callset_context.SSCFNum);
  1191.     strcpy((PS8) string_code, "**");
  1192.     AnsiiToUnicodeString((PS8) uni_input_string, (PS8) string_code);
  1193.     pfnUnicodeStrcat((PS8) input_string, (PS8) uni_input_string);
  1194.     sprintf((PS8) string_code, "%d", 5 * (g_callset_context.SSCFNoAnsTimeIndex + 1));
  1195.     AnsiiToUnicodeString((PS8) uni_input_string, (PS8) string_code);
  1196.     pfnUnicodeStrcat((PS8) input_string, (PS8) uni_input_string);
  1197.     pfnUnicodeStrcat((PS8) input_string, (PS8) hash_string);
  1198.     /* set protocol event handler for the call fwd response */
  1199.     SetProtocolEventHandler(CALLSETForwardRsp, PRT_MMI_SS_CALL_FORWARD_RSP);
  1200.     /* make a corresponding ss string for call fwd option */
  1201.     MakeCall((PS8) input_string);
  1202.     return;
  1203. }
  1204. /*****************************************************************************
  1205.  * FUNCTION
  1206.  *  GetCurrHandler
  1207.  * DESCRIPTION
  1208.  *  Getting Current highlighted item
  1209.  * NA
  1210.  *  
  1211.  * PARAMETERS
  1212.  *  item_index      [IN]        
  1213.  * RETURNS
  1214.  *  void
  1215.  *****************************************************************************/
  1216. void GetCurrHandler(S32 item_index)
  1217. {
  1218.     /*----------------------------------------------------------------*/
  1219.     /* Local Variables                                                */
  1220.     /*----------------------------------------------------------------*/
  1221.     /*----------------------------------------------------------------*/
  1222.     /* Code Body                                                      */
  1223.     /*----------------------------------------------------------------*/
  1224.     g_callset_context.SSCFNoAnsTimeIndex = (U8) item_index;
  1225.     return;
  1226. }
  1227. /*****************************************************************************
  1228.  * FUNCTION
  1229.  *  EntryCALLSETForwardNoAnsTime
  1230.  * DESCRIPTION
  1231.  *  entry function for no answer
  1232.  * NA
  1233.  *  
  1234.  * PARAMETERS
  1235.  *  void
  1236.  * RETURNS
  1237.  *  void
  1238.  *****************************************************************************/
  1239. void EntryCALLSETForwardNoAnsTime(void)
  1240. {
  1241.     /*----------------------------------------------------------------*/
  1242.     /* Local Variables                                                */
  1243.     /*----------------------------------------------------------------*/
  1244.     U16 nStrItemList[MAX_SUB_MENUS];    /* Stores the strings id of submenus returned */
  1245.     U8 *guiBuffer;                      /* Buffer holding history data */
  1246.     U16 nNumofItem;
  1247.     /*----------------------------------------------------------------*/
  1248.     /* Code Body                                                      */
  1249.     /*----------------------------------------------------------------*/
  1250.     EntryNewScreen(SCR_ID_CALLSET_FORWARD_NO_ANS_TIME, NULL, EntryCALLSETForwardNoAnsTime, NULL);
  1251.     /* Get current screen info into gui buffer  for history purposes */
  1252.     guiBuffer = GetCurrGuiBuffer(SCR_ID_CALLSET_FORWARD_NO_ANS_TIME);
  1253.     /* Retrieve no of child of menu item to be displayed */
  1254.     nNumofItem = GetNumOfChild(MENU8239_CALFWD_VOICECALL_NOANSWER_OPTIONS);
  1255.     /* Retrieve string ids in sequence of given menu item to be displayed */
  1256.     GetSequenceStringIds(MENU8239_CALFWD_VOICECALL_NOANSWER_OPTIONS, nStrItemList);
  1257.     /* Set current parent id */
  1258.     SetParentHandler(MENU8239_CALFWD_VOICECALL_NOANSWER_OPTIONS);
  1259.     /* Register highlight handler to be called in menu screen */
  1260.     RegisterHighlightHandler(GetCurrHandler);
  1261.     /* display the corresponding screen */
  1262.     ShowCategory15Screen(
  1263.         SCR_CALL_FWD_ENTER_NO_ANSWER_TIME_CAP,
  1264.         0,
  1265.         STR_GLOBAL_OK,
  1266.         IMG_GLOBAL_OK,
  1267.         STR_GLOBAL_BACK,
  1268.         IMG_GLOBAL_BACK,
  1269.         nNumofItem,
  1270.         nStrItemList,
  1271.         (U16*) gIndexIconsImageList,
  1272.         1,
  1273.         0,
  1274.         guiBuffer);
  1275.     /* Register function with left/right softkey */
  1276.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1277.     SetLeftSoftkeyFunction(ActivateVNoAnswer, KEY_EVENT_UP);
  1278.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1279.     return;
  1280. }
  1281. /*****************************************************************************
  1282.  * FUNCTION
  1283.  *  SendPhbEntryForDivert
  1284.  * DESCRIPTION
  1285.  *  send phone number for diverting to the number
  1286.  * NA
  1287.  *  
  1288.  * PARAMETERS
  1289.  *  name        [?]     
  1290.  *  number      [?]     
  1291.  * RETURNS
  1292.  *  void
  1293.  *****************************************************************************/
  1294. void SendPhbEntryForDivert(U8 name[], U8 number[])
  1295. {
  1296.     /*----------------------------------------------------------------*/
  1297.     /* Local Variables                                                */
  1298.     /*----------------------------------------------------------------*/
  1299.     /*----------------------------------------------------------------*/
  1300.     /* Code Body                                                      */
  1301.     /*----------------------------------------------------------------*/
  1302.     g_callset_context.SSCFNumFromPHB = TRUE;
  1303.     pfnUnicodeStrcpy((PS8) g_callset_context.SSCFNum, (PS8) number);
  1304.     GoBackHistory();
  1305.     return;
  1306. }