CallForwarding.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:55k
源码类别:
MTK
开发平台:
C/C++
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2005
- *
- * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
- * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
- * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
- *
- * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
- * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
- * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
- * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
- * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
- * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
- *
- *****************************************************************************/
- /*******************************************************************************
- * Filename:
- * ---------
- * CallForwarding.c
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * <file description>.
- *
- * Author:
- * -------
- * -------
- *
- *==============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *==============================================================================
- *******************************************************************************/
- /**
- * Copyright Notice
- * ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
- * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
- * (It is illegal to remove this copyright notice from this software or any
- * portion of it)
- */
- /**************************************************************
- FILENAME : CallForwarding.c
- PURPOSE : Call Setting - Call forwarding Application
- REMARKS : nil
- AUTHOR : Anil Kumar Vutukuru
- DATE : 11/14/2003
- **************************************************************/
- #include "stdC.h"
- #include "L4Dr1.h"
- #include "CSP.h"
- #include "MainMenuDef.h"
- #include "ProtocolEvents.h"
- #include "PhoneBookTypes.h"
- #include "PhoneBookGProt.h"
- #include "CallSetUp.h"
- #include "DebugInitDef.h"
- #include "CallForwarding.h"
- #include "CallSetUpEnum.h"
- #include "CommonScreens.h"
- #include "CallmanagementIdDef.h"
- #include "MessagesExDcl.h"
- #include "CallManagementGprot.h"
- #include "wgui_inputs.h"
- #include "wgui_categories_inputs.h"
- #include "MMI_features.h"
- extern S16 MMI_current_input_ext_type;
- /*****************************************************************************
- * FUNCTION
- * HighlightCALLSETCallFwdCancelAll
- * DESCRIPTION
- * Highlight handler for cancel all menu option
- * NA
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightCALLSETCallFwdCancelAll(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* storing the menu item selected */
- g_callset_context.SSCFType = FORWARD_CANCEL_ALL;
- /* Change left soft key icon and label */
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- /* Change right soft key icon and label */
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- /* set the left/right soft key functions handlers */
- SetLeftSoftkeyFunction(EnterScrCallFwdOffReq, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- /* set the left/right arrow key function handlers */
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * InitCallForwarding
- * DESCRIPTION
- * Initialize funtion for call fwding application.
- * NA
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void InitCallForwarding(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Set hilite handlers for the individual sub menu items of call forwarding */
- SetHiliteHandler(MENU8237_SCR8093_MNGCALL_MENU_FWD, HighlightCALLSETCallFwd);
- SetHiliteHandler(MENU8238_MNGCALL_CALFWD_VOICECALL, HighlightCALLSETCallFwdVoice);
- SetHiliteHandler(MENU8238_MNGCALL_CALFWD_DATACALL, HighlightCALLSETCallFwdData);
- SetHiliteHandler(MENU8239_CALFWD_VOICECALL_UNREACHABLE, HighlightCALLSETCallFwdUnreach);
- SetHiliteHandler(MENU8239_CALFWD_VOICECALL_NOANSWER, HighlightCALLSETCallFwdNoAns);
- SetHiliteHandler(MENU8239_CALFWD_VOICECALL_ALLCOND, HighlightCALLSETCallFwdAllCond);
- SetHiliteHandler(MENU8239_CALFWD_VOICECALL_BUSY, HighlightCALLSETCallFwdBusy);
- SetHiliteHandler(MENU8240_MNGCALL_CALLFWD_FWD_ON, HighlightCALLSETCallFwdOn);
- SetHiliteHandler(MENU8240_MNGCALL_CALLFWD_FWD_OFF, HighlightCALLSETCallFwdOff);
- SetHiliteHandler(MENU8240_MNGCALL_CALLFWD_FWD_QUERY, HighlightCALLSETCallFwdQuery);
- SetHiliteHandler(MENU_CALL_FWD_CANCELALL, HighlightCALLSETCallFwdCancelAll);
- ResetCFCondStage();
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightCALLSETCallFwd
- * DESCRIPTION
- * Highlight handler for the call fwding menu option
- * NA
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightCALLSETCallFwd(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Change left soft key icon and label */
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- /* Change right soft key icon and label */
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- /* set the left/right arrow key function handlers */
- SetKeyHandler(EntryCALLSETForwardMain, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- /* set the left/right soft key functions handlers */
- SetLeftSoftkeyFunction(EntryCALLSETForwardMain, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightCALLSETCallFwdVoice
- * DESCRIPTION
- * Hightlight handler for call fwd voice sub menu item
- * NA
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightCALLSETCallFwdVoice(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* storing the menu item selected */
- g_callset_context.SSCFType = FORWARD_ALLVOICE;
- /* set the left/right soft key functions handlers */
- SetLeftSoftkeyFunction(EntryCALLSETForwardOptions, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- /* set the left/right arrow key function handlers */
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(EntryCALLSETForwardOptions, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightCALLSETCallFwdData
- * DESCRIPTION
- * highlight hander for call fwd data sub menu item.
- * NA
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightCALLSETCallFwdData(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* storing the menu item selected */
- g_callset_context.SSCFType = FORWARD_DATA;
- /* set the left/right soft key functions handlers */
- SetLeftSoftkeyFunction(EntryCALLSETForwardOptions, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- /* set the left/right arrow key functions handlers */
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(EntryCALLSETForwardOptions, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightCALLSETCallFwdUnreach
- * DESCRIPTION
- * Highlight handler for voice unreach sub menu item
- * NA
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightCALLSETCallFwdUnreach(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* storing the menu item selected */
- g_callset_context.SSCFType = FORWARD_UNREACHABLE;
- /* set the left/right soft key functions handlers */
- SetLeftSoftkeyFunction(EntryCALLSETForwardOptions, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- /* set the left/right arrow key function handlers */
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(EntryCALLSETForwardOptions, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightCALLSETCallFwdBusy
- * DESCRIPTION
- * Highlight handler for when busy sub menu item
- * NA
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightCALLSETCallFwdBusy(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* storing the menu item selected */
- g_callset_context.SSCFType = FORWARD_BUSY;
- /* set the left/right soft key functions handlers */
- SetLeftSoftkeyFunction(EntryCALLSETForwardOptions, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- /* set the left/right arrow key function handlers */
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(EntryCALLSETForwardOptions, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightCALLSETCallFwdNoAns
- * DESCRIPTION
- * Highlight handler for call fwd when no answer
- * NA
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightCALLSETCallFwdNoAns(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* storing the menu item selected */
- g_callset_context.SSCFType = FORWARD_NOANSWER;
- /* set the left/right soft key functions handlers */
- SetLeftSoftkeyFunction(EntryCALLSETForwardOptions, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- /* set the left/right arrow key function handlers */
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(EntryCALLSETForwardOptions, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightCALLSETCallFwdAllCond
- * DESCRIPTION
- * Highlight handler for call fwd when no answer
- * NA
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightCALLSETCallFwdAllCond(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* storing the menu item selected */
- g_callset_context.SSCFType = FORWARD_ALLCOND;
- /* set the left/right soft key functions handlers */
- SetLeftSoftkeyFunction(EntryCALLSETForwardOptions, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- /* set the left/right arrow key function handlers */
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(EntryCALLSETForwardOptions, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightCALLSETCallFwdOn
- * DESCRIPTION
- * Highlight handler for call fwd on submenu item
- * NA
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightCALLSETCallFwdOn(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* set the left/right soft key functions handlers */
- SetLeftSoftkeyFunction(EntryCALLSETForwardNumber, KEY_EVENT_UP);
- /* micha0529 */
- SetKeyHandler(EntryCALLSETForwardNumber, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightCALLSETCallFwdOff
- * DESCRIPTION
- * Highlight handler for call fwd off submenu item
- * NA
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightCALLSETCallFwdOff(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* set the left/right soft key functions handlers */
- SetLeftSoftkeyFunction(EnterScrCallFwdOffReq, KEY_EVENT_UP);
- /* micha0529 */
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightCALLSETCallFwdQuery
- * DESCRIPTION
- * Highlight handler for call fwd on query sub menu item
- * NA
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightCALLSETCallFwdQuery(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* set the left/right soft key functions handlers */
- SetLeftSoftkeyFunction(EnterScrCallFwdQueryReq, KEY_EVENT_UP);
- /* micha0529 */
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * EntryCALLSETForwardMain
- * DESCRIPTION
- * Entry function for call fwd main screen
- * NA
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryCALLSETForwardMain(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- //micha1229
- // U16 nDispAttribute; /* Stores display attribue */
- U8 *guiBuffer; /* Buffer holding history data */
- U16 nNumofItem;
- U16 nStrItemList[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* U32 maskingByte=0xFFFFFFFF;
- U32 menuItemId=0xFFFFFFFF; */
- EntryNewScreen(SCR_ID_CALLSET_FORWARD_MAIN, NULL, EntryCALLSETForwardMain, NULL);
- /* Get current screen info into gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_ID_CALLSET_FORWARD_MAIN);
- /* Retrieve no of child of menu item to be displayed */
- nNumofItem = GetNumOfChild_Ext(MENU8237_SCR8093_MNGCALL_MENU_FWD); /* diamond, 2005/07/01 add _Ext to menu item functions */
- /* Get attribute of menu to be displayed */
- /* nDispAttribute = GetDispAttributeOfItem(MENU8237_SCR8093_MNGCALL_MENU_FWD); */
- /* Retrieve string ids in sequence of given menu item to be displayed */
- GetSequenceStringIds_Ext(MENU8237_SCR8093_MNGCALL_MENU_FWD, nStrItemList); /* diamond, 2005/07/01 add _Ext to menu item functions */
- /* Set current parent id */
- SetParentHandler(MENU8237_SCR8093_MNGCALL_MENU_FWD);
- /* Register highlight handler to be called in menu screen */
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- /* diamond, 2005/07/01 removed for new menu item architecture to CPHS */
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* 0 */
- /* Display Category15 Screen */
- ShowCategory15Screen(
- STR_MENU8238_MNGCALL_CALLFWD_CAPTION,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- 1,
- 0,
- guiBuffer);
- /* Register function with right softkey */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * EntryCALLSETForwardOptions
- * DESCRIPTION
- * Entry function for call fwd options screen
- * NA
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryCALLSETForwardOptions(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- //micha1229
- // U16 nDispAttribute; /* Stores display attribue */
- U8 *guiBuffer; /* Buffer holding history data */
- U16 nNumofItem;
- U16 nStrItemList[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_CALLSET_FORWARD_OPTIONS, NULL, EntryCALLSETForwardOptions, NULL);
- /* Get current screen info into gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_ID_CALLSET_FORWARD_OPTIONS);
- /* Retrieve no of child of menu item to be displayed */
- nNumofItem = GetNumOfChild(MENU8240_MNGCALL_CALLFWD_FWD_OPTION);
- /* Get attribute of menu to be displayed */
- /* nDispAttribute = GetDispAttributeOfItem(MENU8240_MNGCALL_CALLFWD_FWD_OPTION ); */
- /* Retrieve string ids in sequence of given menu item to be displayed */
- GetSequenceStringIds(MENU8240_MNGCALL_CALLFWD_FWD_OPTION, nStrItemList);
- /* Set current parent id */
- SetParentHandler(MENU8240_MNGCALL_CALLFWD_FWD_OPTION);
- /* Register highlight handler to be called in menu screen */
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- /* Display Category1 Screen */
- ShowCategory15Screen(
- STR_MENU8240_MNGCALL_CALLFWD_FWD_OPTION,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- 1,
- 0,
- guiBuffer);
- /* Register function with right softkey */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * StarKeyHandler
- * DESCRIPTION
- * Key handler for the astrick key.
- * NA
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void StarKeyHandler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- multiline_inputbox_direct_input('+');
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * EntryCALLSETForwardNumber
- * DESCRIPTION
- * Entry function for the enter number for call fwd screen.
- * NA
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryCALLSETForwardNumber(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_CALLSET_FORWARD_NUMBER, ExitCALLSETForwardNumber, EntryCALLSETForwardNumber, NULL);
- /* Get current screen info into gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_ID_CALLSET_FORWARD_NUMBER);
- /* Check the screen is from forward or backward traversal */
- if (guiBuffer == NULL)
- {
- memset(g_callset_context.SSCFNum, 0, (MAX_CC_ADDR_LEN * ENCODING_LENGTH) + 2);
- }
- if (g_callset_context.SSCFNumFromPHB)
- {
- guiBuffer = NULL;
- }
- g_callset_context.SSCFNumFromPHB = FALSE;
- MMI_current_input_ext_type |= INPUT_TYPE_EXT_SIM_NUMERIC;
- /* to display the screen for taking input for the callfwd number */
- ShowCategory5Screen(
- STR_CALL_FWD_ENTER_NUM_CAP,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- INPUT_TYPE_PHONE_NUMBER,
- (PU8) g_callset_context.SSCFNum,
- MAX_CC_ADDR_LEN,
- guiBuffer);
- /* clear key handler for the pound key */
- ClearKeyHandler(KEY_POUND, KEY_EVENT_DOWN);
- /* set key handler for the astrick key */
- ClearKeyHandler(KEY_STAR, KEY_EVENT_UP);
- SetKeyHandler(StarKeyHandler, KEY_STAR, KEY_EVENT_DOWN);
- /* set the left and right soft key functionalities */
- SetLeftSoftkeyFunction(EnterScrCallFwdOnReq, KEY_EVENT_UP);
- SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCALLSETForwardNumber
- * DESCRIPTION
- * Exit function for the enter number for call fwd screen.
- * NA
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCALLSETForwardNumber(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_current_input_ext_type &= ~INPUT_TYPE_EXT_SIM_NUMERIC;
- }
- /*****************************************************************************
- * FUNCTION
- * EnterScrCallFwdOnReq
- * DESCRIPTION
- * Entry function for call fwd screen when on req .
- * NA
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EnterScrCallFwdOnReq(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 input_string[MAX_DIGITS_USSD * ENCODING_LENGTH];
- S8 string_code[50];
- PS8 hash_string = NULL;
- S8 uni_input_string[MAX_DIGITS_USSD * ENCODING_LENGTH];
- U8 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* check the buffer of the call fwding number */
- if (pfnUnicodeStrlen((S8*) g_callset_context.SSCFNum) == 0)
- {
- mmi_phb_call_enter_from_divert();
- return;
- }
- for (i = 0; i < pfnUnicodeStrlen((S8*) g_callset_context.SSCFNum); i++)
- {
- if ((g_callset_context.SSCFNum[i * 2] == 'p') || (g_callset_context.SSCFNum[i * 2] == 'w'))
- {
- DisplayPopup((PU8) GetString(STR_GLOBAL_NOT_DONE), IMG_GLOBAL_UNFINISHED, 0, CS_NOTIFYDURATION, ERROR_TONE);
- return;
- }
- }
- /* format the string for the ss string handling */
- memset(input_string, 0, (MAX_DIGITS_USSD * ENCODING_LENGTH));
- memset(string_code, 0, 50);
- hash_string = (PS8) GetString(STR_HASH_VALUE);
- switch (g_callset_context.SSCFType)
- {
- /* if the menu item is selected is voice call fwd when un reachable */
- case FORWARD_UNREACHABLE:
- strcpy((S8*) string_code, "**62*");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_code);
- pfnUnicodeStrcat((PS8) input_string, (PS8) g_callset_context.SSCFNum);
- pfnUnicodeStrcat((PS8) input_string, (PS8) hash_string);
- break;
- /* if the menu item is selected is voice call fwd when no answer */
- case FORWARD_NOANSWER:
- case FORWARD_ALLCOND:
- EntryCALLSETForwardNoAnsTime();
- return;
- /* if the menu item is selected is voice call fwd when busy */
- case FORWARD_BUSY:
- strcpy((S8*) string_code, "**67*");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_code);
- pfnUnicodeStrcat((PS8) input_string, (PS8) g_callset_context.SSCFNum);
- pfnUnicodeStrcat((PS8) input_string, (PS8) hash_string);
- break;
- /* if the menu item is selected all voice call fwd */
- case FORWARD_ALLVOICE:
- strcpy((S8*) string_code, "**21*");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_code);
- pfnUnicodeStrcat((PS8) input_string, (PS8) g_callset_context.SSCFNum);
- strcpy((S8*) string_code, "*11");
- AnsiiToUnicodeString((PS8) uni_input_string, (PS8) string_code);
- pfnUnicodeStrcat((PS8) input_string, (PS8) uni_input_string);
- pfnUnicodeStrcat((PS8) input_string, (PS8) hash_string);
- break;
- /* if the menu item is selected is data call fwd */
- case FORWARD_DATA:
- strcpy((S8*) string_code, "**21*");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_code);
- pfnUnicodeStrcat((PS8) input_string, (PS8) g_callset_context.SSCFNum);
- strcpy((S8*) string_code, "*20");
- AnsiiToUnicodeString((PS8) uni_input_string, (PS8) string_code);
- pfnUnicodeStrcat((PS8) input_string, (PS8) uni_input_string);
- pfnUnicodeStrcat((PS8) input_string, (PS8) hash_string);
- break;
- }
- /* set protocol event handler for the call fwd response */
- SetProtocolEventHandler(CALLSETForwardRsp, PRT_MMI_SS_CALL_FORWARD_RSP);
- /* make a corresponding ss string for call fwd option */
- MakeCall((PS8) input_string);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * ResetCFCondStage
- * DESCRIPTION
- * Entry function for call fwd screen when off req .
- * NA
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ResetCFCondStage(void)
- {
- g_callset_context.SSCFCondQueryStage = CF_COND_STAGE_NONE;
- }
- /*****************************************************************************
- * FUNCTION
- * EnterScrCallFwdOffReq
- * DESCRIPTION
- * Entry function for call fwd screen when off req .
- * NA
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EnterScrCallFwdOffReq(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 input_string[MAX_DIGITS_USSD * ENCODING_LENGTH];
- S8 string_out[20];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- //micha1229
- // PS8 hash_string = NULL ;
- /* format the string for the ss string handling */
- memset(input_string, 0, (MAX_DIGITS_USSD * ENCODING_LENGTH));
- memset(string_out, 0, 20);
- /* hash_string = (PS8) GetString(STR_HASH_VALUE); */
- switch (g_callset_context.SSCFType)
- {
- /* if the menu item is selected is voice call fwd when un reachable */
- case FORWARD_UNREACHABLE:
- strcpy((S8*) string_out, "##62#");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
- break;
- /* if the menu item is selected is voice call fwd when no answer */
- case FORWARD_NOANSWER:
- strcpy((S8*) string_out, "##61#");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
- break;
- /* if the menu item is selected is voice call fwd when all conditional */
- case FORWARD_BUSY:
- strcpy((S8*) string_out, "##67#");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
- break;
- /* if the menu item is selected all voice call fwd */
- case FORWARD_ALLCOND:
- strcpy((S8*) string_out, "##004#");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
- break;
- /* if the menu item is selected is voice call fwd when busy */
- case FORWARD_ALLVOICE:
- strcpy((S8*) string_out, "##21**11#");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
- break;
- /* if the menu item is selected is cancel all fwd */
- case FORWARD_CANCEL_ALL:
- strcpy((S8*) string_out, "##002#");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
- break;
- /* if the menu item is selected is data call fwd */
- case FORWARD_DATA:
- strcpy((S8*) string_out, "##21**20#");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
- break;
- }
- /* set protocol event handler for the call fwd response */
- SetProtocolEventHandler(CALLSETForwardRsp, PRT_MMI_SS_CALL_FORWARD_RSP);
- /* make a corresponding ss string for call fwd option */
- MakeCall((PS8) input_string);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * EnterScrCallFwdQueryReq
- * DESCRIPTION
- * Entry function for call fwd screen qurey request.
- * NA
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EnterScrCallFwdQueryReq(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 input_string[MAX_DIGITS_USSD * ENCODING_LENGTH];
- S8 string_out[20];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- //micha1229
- // PS8 hash_string = NULL ;
- /* format the string for the ss string handling */
- memset(input_string, 0, (MAX_DIGITS_USSD * ENCODING_LENGTH));
- memset(string_out, 0, 20);
- /* hash_string = (PS8) GetString(STR_HASH_VALUE); */
- switch (g_callset_context.SSCFType)
- {
- /* if the menu item is selected is voice call fwd when un reachable */
- case FORWARD_UNREACHABLE:
- strcpy((S8*) string_out, "*#62#");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
- break;
- /* if the menu item is selected is voice call fwd when no answer */
- case FORWARD_NOANSWER:
- strcpy((S8*) string_out, "*#61#");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
- break;
- /* if the menu item is selected is voice call fwd when all conditional */
- case FORWARD_BUSY:
- strcpy((S8*) string_out, "*#67#");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
- break;
- /* if the menu item is selected all voice call fwd */
- case FORWARD_ALLCOND:
- switch (g_callset_context.SSCFCondQueryStage)
- {
- case CF_COND_STAGE_NONE:
- g_callset_context.SSCFCondQueryStage = CF_COND_STAGE_UNREACH;
- strcpy((S8*) string_out, "*#62#");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
- break;
- case CF_COND_STAGE_UNREACH:
- g_callset_context.SSCFCondQueryStage = CF_COND_STAGE_NOANS;
- strcpy((S8*) string_out, "*#61#");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
- break;
- case CF_COND_STAGE_NOANS:
- g_callset_context.SSCFCondQueryStage = CF_COND_STAGE_BUSY;
- strcpy((S8*) string_out, "*#67#");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
- break;
- default:
- ASSERT(0);
- break;
- }
- break;
- /* if the menu item is selected is voice call fwd when busy */
- case FORWARD_ALLVOICE:
- strcpy((S8*) string_out, "*#21**11#");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
- break;
- /* if the menu item is selected is data call fwd */
- case FORWARD_DATA:
- strcpy((S8*) string_out, "*#21**20#");
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_out);
- break;
- }
- /* set protocol event handler for the call fwd response */
- SetProtocolEventHandler(CALLSETForwardRsp, PRT_MMI_SS_CALL_FORWARD_RSP);
- /* make a corresponding ss string for call fwd option */
- MakeCall((PS8) input_string);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * CALLSETForwardRsp
- * DESCRIPTION
- * response handler for the call fwd query request.
- * NA
- *
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void CALLSETForwardRsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 short_string[45], TempShortString[90];
- S8 TempBuff[250];
- S8 *TempBuff1;
- U8 bs_index;
- mmi_ss_call_forward_rsp_struct *pMsgFwdQueryrsp = (mmi_ss_call_forward_rsp_struct*) info;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DeleteScreenIfPresent(SCR_ID_CALLSET_FORWARD_OPTIONS);
- DeleteScreenIfPresent(SCR_ID_CALLSET_FORWARD_NUMBER);
- DeleteScreenIfPresent(SCR_ID_CALLSET_FORWARD_NO_ANS_TIME);
- TempBuff1 = (S8*) OslMalloc(MAX_DISP_UCS2);
- memset(TempBuff1, 0, MAX_DISP_UCS2);
- if (pMsgFwdQueryrsp->result.flag == L4C_OK)
- {
- switch (pMsgFwdQueryrsp->type)
- {
- case L4_CFU:
- pfnUnicodeStrcpy((PS8) TempBuff1, (PS8) GetString(STR_L4_CFU));
- break;
- case L4_CFB:
- pfnUnicodeStrcpy((PS8) TempBuff1, (PS8) GetString(STR_L4_CFB));
- break;
- case L4_CFNRY:
- pfnUnicodeStrcpy((PS8) TempBuff1, (PS8) GetString(STR_L4_CFNRY));
- break;
- case L4_CFNRC:
- pfnUnicodeStrcpy((PS8) TempBuff1, (PS8) GetString(STR_L4_CFNRC));
- break;
- case L4_CFA:
- pfnUnicodeStrcpy((PS8) TempBuff1, (PS8) GetString(STR_L4_CFA));
- break;
- case L4_CFC:
- pfnUnicodeStrcpy((PS8) TempBuff1, (PS8) GetString(STR_L4_CFC));
- break;
- default:
- pfnUnicodeStrcpy((PS8) TempBuff1, (PS8) GetString(STR_FWD_UNKNOWN_SERVICE));
- break;
- }
- if (pMsgFwdQueryrsp->count == 0)
- {
- pfnUnicodeStrcat((PS8) TempBuff1, (PS8) GetString(STR_DEACTIVATED));
- }
- for (bs_index = 0; bs_index < pMsgFwdQueryrsp->count; bs_index++)
- {
- memset(TempBuff, 0, sizeof(TempBuff));
- if (pMsgFwdQueryrsp->list[bs_index].ss_status & SS_ABIT)
- {
- pfnUnicodeStrcat((PS8) TempBuff, (PS8) GetString(STR_ACTIVATED));
- }
- else if (pMsgFwdQueryrsp->opcode == SS_OP_INTERROGATESS)
- {
- if (pMsgFwdQueryrsp->list[bs_index].ss_status & SS_PBIT)
- {
- pfnUnicodeStrcat((PS8) TempBuff, (PS8) GetString(STR_DEACTIVATED));
- }
- else
- {
- pfnUnicodeStrcat((PS8) TempBuff, (PS8) GetString(STR_NOT_PROVIDED));
- }
- }
- else
- {
- pfnUnicodeStrcat((PS8) TempBuff, (PS8) GetString(STR_DEACTIVATED));
- }
- if (pMsgFwdQueryrsp->list[bs_index].no_reply_timer != 0)
- {
- sprintf(short_string, "%d ", (U8) pMsgFwdQueryrsp->list[bs_index].no_reply_timer);
- AnsiiToUnicodeString((PS8) TempShortString, (PS8) short_string);
- pfnUnicodeStrcat((S8*) TempBuff, (S8*) TempShortString);
- pfnUnicodeStrcat((PS8) TempBuff, (PS8) GetString(STR_SECONDS));
- }
- AppendBScodeString(pMsgFwdQueryrsp->list[bs_index].bs_code, TempBuff);
- if (strlen(pMsgFwdQueryrsp->list[bs_index].address) != 0)
- {
- memset(short_string, 0, sizeof(short_string));
- memset(TempShortString, 0, sizeof(TempShortString));
- strncpy((PS8) short_string, (PS8) pMsgFwdQueryrsp->list[bs_index].address, sizeof(short_string) - 5);
- strcat((PS8) short_string, " ");
- AnsiiToUnicodeString((PS8) TempShortString, (PS8) short_string);
- pfnUnicodeStrcat((S8*) TempBuff, (S8*) TempShortString);
- }
- if ((pfnUnicodeStrlen((PS8) TempBuff) + pfnUnicodeStrlen((PS8) TempBuff1))
- < MAX_DISP_UCS2 / ENCODING_LENGTH)
- {
- pfnUnicodeStrcat((S8*) TempBuff1, (S8*) TempBuff);
- }
- }
- sprintf(short_string, "n");
- AnsiiToUnicodeString((PS8) TempShortString, (PS8) short_string);
- pfnUnicodeStrcat((S8*) TempBuff1, (S8*) TempShortString);
- switch (g_callset_context.SSCFCondQueryStage)
- {
- case CF_COND_STAGE_NONE:
- pfnUnicodeStrcpy((S8*) g_callset_context.SSDisplayBuffer, (S8*) TempBuff1);
- DeleteScreenIfPresent(SCR_ID_CALLSET_GENERAL_SS_RESULT);
- EntryCALLSETGeneralSSResut();
- break;
- case CF_COND_STAGE_UNREACH:
- pfnUnicodeStrcpy((S8*) g_callset_context.SSDisplayBuffer, (S8*) TempBuff1);
- g_callset_context.SSCFType = FORWARD_ALLCOND;
- EnterScrCallFwdQueryReq();
- break;
- case CF_COND_STAGE_NOANS:
- if ((pfnUnicodeStrlen((PS8) TempBuff1) + pfnUnicodeStrlen((PS8) g_callset_context.SSDisplayBuffer))
- < MAX_DISP_UCS2 / ENCODING_LENGTH)
- {
- pfnUnicodeStrcat((S8*) g_callset_context.SSDisplayBuffer, (S8*) TempBuff1);
- }
- g_callset_context.SSCFType = FORWARD_ALLCOND;
- EnterScrCallFwdQueryReq();
- break;
- case CF_COND_STAGE_BUSY:
- if ((pfnUnicodeStrlen((PS8) TempBuff1) + pfnUnicodeStrlen((PS8) g_callset_context.SSDisplayBuffer))
- < MAX_DISP_UCS2 / ENCODING_LENGTH)
- {
- pfnUnicodeStrcat((S8*) g_callset_context.SSDisplayBuffer, (S8*) TempBuff1);
- }
- g_callset_context.SSCFCondQueryStage = CF_COND_STAGE_NONE;
- DeleteScreenIfPresent(SCR_ID_CALLSET_GENERAL_SS_RESULT);
- EntryCALLSETGeneralSSResut();
- break;
- default:
- ASSERT(0);
- break;
- }
- }
- else
- {
- ResetCFCondStage();
- #ifdef __MMI_SS_SHOW_CAUSE__
- ShowCauseString(pMsgFwdQueryrsp->result.cause, g_callset_context.SSDisplayBuffer);
- DeleteScreenIfPresent(SCR_ID_CALLSET_GENERAL_SS_RESULT);
- EntryCALLSETGeneralSSResut();
- #else /* __MMI_SS_SHOW_CAUSE__ */
- DisplayPopup((PU8) GetString(STR_GLOBAL_NOT_DONE), IMG_GLOBAL_UNFINISHED, 0, CS_NOTIFYDURATION, ERROR_TONE);
- RemoveSSReqScr();
- #endif /* __MMI_SS_SHOW_CAUSE__ */
- }
- OslMfree(TempBuff1);
- }
- /*****************************************************************************
- * FUNCTION
- * ActivateVNoAnswer
- * DESCRIPTION
- * Sending req for the call fwd when no answer case
- * NA
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ActivateVNoAnswer(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 input_string[MAX_DIGITS_USSD * ENCODING_LENGTH];
- S8 string_code[50];
- PS8 hash_string = NULL;
- S8 uni_input_string[MAX_DIGITS_USSD * ENCODING_LENGTH];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* format the string for the ss string handling */
- memset(input_string, 0, (MAX_DIGITS_USSD * ENCODING_LENGTH));
- memset(string_code, 0, 50);
- hash_string = (PS8) GetString(STR_HASH_VALUE);
- if (g_callset_context.SSCFType == FORWARD_NOANSWER)
- {
- strcpy((S8*) string_code, "**61*");
- }
- else
- {
- strcpy((S8*) string_code, "**004*");
- }
- AnsiiToUnicodeString((PS8) input_string, (PS8) string_code);
- pfnUnicodeStrcat((PS8) input_string, (PS8) g_callset_context.SSCFNum);
- strcpy((PS8) string_code, "**");
- AnsiiToUnicodeString((PS8) uni_input_string, (PS8) string_code);
- pfnUnicodeStrcat((PS8) input_string, (PS8) uni_input_string);
- sprintf((PS8) string_code, "%d", 5 * (g_callset_context.SSCFNoAnsTimeIndex + 1));
- AnsiiToUnicodeString((PS8) uni_input_string, (PS8) string_code);
- pfnUnicodeStrcat((PS8) input_string, (PS8) uni_input_string);
- pfnUnicodeStrcat((PS8) input_string, (PS8) hash_string);
- /* set protocol event handler for the call fwd response */
- SetProtocolEventHandler(CALLSETForwardRsp, PRT_MMI_SS_CALL_FORWARD_RSP);
- /* make a corresponding ss string for call fwd option */
- MakeCall((PS8) input_string);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * GetCurrHandler
- * DESCRIPTION
- * Getting Current highlighted item
- * NA
- *
- * PARAMETERS
- * item_index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void GetCurrHandler(S32 item_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_callset_context.SSCFNoAnsTimeIndex = (U8) item_index;
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * EntryCALLSETForwardNoAnsTime
- * DESCRIPTION
- * entry function for no answer
- * NA
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryCALLSETForwardNoAnsTime(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[MAX_SUB_MENUS]; /* Stores the strings id of submenus returned */
- U8 *guiBuffer; /* Buffer holding history data */
- U16 nNumofItem;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_CALLSET_FORWARD_NO_ANS_TIME, NULL, EntryCALLSETForwardNoAnsTime, NULL);
- /* Get current screen info into gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_ID_CALLSET_FORWARD_NO_ANS_TIME);
- /* Retrieve no of child of menu item to be displayed */
- nNumofItem = GetNumOfChild(MENU8239_CALFWD_VOICECALL_NOANSWER_OPTIONS);
- /* Retrieve string ids in sequence of given menu item to be displayed */
- GetSequenceStringIds(MENU8239_CALFWD_VOICECALL_NOANSWER_OPTIONS, nStrItemList);
- /* Set current parent id */
- SetParentHandler(MENU8239_CALFWD_VOICECALL_NOANSWER_OPTIONS);
- /* Register highlight handler to be called in menu screen */
- RegisterHighlightHandler(GetCurrHandler);
- /* display the corresponding screen */
- ShowCategory15Screen(
- SCR_CALL_FWD_ENTER_NO_ANSWER_TIME_CAP,
- 0,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- 1,
- 0,
- guiBuffer);
- /* Register function with left/right softkey */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(ActivateVNoAnswer, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * SendPhbEntryForDivert
- * DESCRIPTION
- * send phone number for diverting to the number
- * NA
- *
- * PARAMETERS
- * name [?]
- * number [?]
- * RETURNS
- * void
- *****************************************************************************/
- void SendPhbEntryForDivert(U8 name[], U8 number[])
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_callset_context.SSCFNumFromPHB = TRUE;
- pfnUnicodeStrcpy((PS8) g_callset_context.SSCFNum, (PS8) number);
- GoBackHistory();
- return;
- }