⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 outgoingcallmanagement.c

📁 MTK手机平台的MMI部分的源代码
💻 C
📖 第 1 页 / 共 5 页
字号:
 * 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 : OutgoingCallmanagement.c

   PURPOSE     : Call Management application

   REMARKS     : nil

   AUTHOR      : Subramanya BG

   DATE     : Nov 11,02

**************************************************************/
#include "stdC.h"
#include "MMI_Features.h"
#include "L4Dr.h"
#include "L4Dr1.h"
#include "PixtelDataTypes.h"
#include "DebugInitDef.h"
#include "ProtocolEvents.h"
#include "EventsGprot.h"
#include "HistoryGprot.h"
#include "SubLCDHistoryGprot.h"
#include "GlobalDefs.h"
#include "GlobalScrEnum.h"
#include "KeyBrd.h"
#include "TimerEvents.h"
#include "CommonScreens.h"
#include "wgui.h"
#include "Wgui_categories_popup.h"
#include "wgui_categories_CM.h"

#include "DateTimeGprot.h"
/* micha0521 */
#include "SATDefs.h"
#include "SATGProts.h"
#include "SimDetectionGexdcl.h"
#include "gpioInc.h"
#include "CSP.h"
#include "CallSetUp.h"
#include "ProfileGprots.h"
#include "ManageCallMain.h"
#include "PhoneBookDef.h"
#include "PhoneBookGprot.h"
#include "MessagesExDcl.h"
#include "MessagesResourceData.h"
#include "SMSApi.h"
#include "AlarmFrameworkProt.h"

#include "mdi_datatype.h"
#include "mdi_audio.h"
#ifdef __MMI_VOICE_MEMO__
#include "VoiceMemoProt.h"
#endif 
#ifdef __MMI_SOUND_RECORDER__
#include "SoundRecorderProt.h"
#endif 
#ifdef __MMI_AUDIO_PLAYER__
#include "AudioPlayerProt.h"
#endif 

#ifdef __MMI_BT_HP_SUPPORT__
#include "BTMMIHPGprots.h"
#endif 

#ifdef __MMI_BT_SUPPORT__
#include "BTMMIScrGprots.h"
#endif 

#ifdef __CTM_SUPPORT__
#include "TextPhoneDef.h"
#include "TextPhoneProt.h"
#endif /* __CTM_SUPPORT__ */ 
#ifdef __MMI_VOIP__
#include "VoIPGProt.h"
#endif
#include "CallManagementIdDef.h"
#include "CallManagementStruct.h"
#include "CallStructureManagementProt.h"
#include "CmErrorTypes.h"
#include "CmErrorHandlersProt.h"
#include "HistoryHelperProt.h"
#include "CommonStubsProt.h"
#include "PsCallHelperDef.h"
#include "mmiapi_struct.h"
#include "PsCallHelperGprot.h"
#include "RedialHelperGProt.h"
#include "CallManagementGprot.h"
#include "IncomingCallManagementProt.h"
#include "OutgoingCallHelperProt.h"

#include "OutgoingCallManagementProt.h"

/* micha1115 */
#include "CallSetUpEnum.h"
#include "SimDetectionGprot.h"


#define TEMP_NO 10
#define SCR_TEXT_LEN 50

static OUTGOING_CALL gCurrOutcall;  /* This is a global variable usefull till the */
static PU8 gcallList[MAX_CALLS];
static U16 gcallListImage[MAX_CALLS];
static U16 gcallListlen = 0;
static U16 gHilitedCall = 0;
static U8 gListOperation = 0;

U16 gtmpOutgoingIndex;

extern MYTIME gTimeStructForCallDuration;
extern const U16 CMIdleScreenDigits[];
extern S8 DTMFPadCallBuffer[MAX_DIGITS_USSD];
extern PU8 gdispnameForSubLCD;

extern void MMIProcessActionMsg(void);

#if defined(__MMI_PHB_CALL_SHOW_PICTURE_FROM_FILE__)
extern S8 *mmi_phb_image_get_path_from_id(U16 index);
#endif 


/*****************************************************************************
 * FUNCTION
 *  ReinitializeOutgoingCall
 * DESCRIPTION
 *  To ReInitialize the Outgoing Call Management Application
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void ReinitializeOutgoingCall(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    SetDialIndication(FALSE);
#ifdef __IP_NUMBER__
    SetTempUseIPNumber(FALSE);
#endif 

    SetProtocolEventHandler(PsCBackPlayInternalTone, PRT_PLAY_GSM_TONE);
    SetProtocolEventHandler(OutgoingCallConnected, PRT_OUTGOINGCALL_CONNECTED);
    SetProtocolEventHandler(PsCbackOutgoingCallIdSync, PRT_OUTGOINGCALL_EVENT_RSP);
    SetProtocolEventHandler(PsCBackUSSDResponse, PRT_USSD_RES_SUCCESS);
    #ifdef MMI_ON_HARDWARE_P
    SetProtocolEventHandler(MakeCallReqInd, PRT_MMI_MAKE_CALL_REQ_IND);
	#endif /* MMI_ON_HARDWARE_P */
}


/*****************************************************************************
 * FUNCTION
 *  InitOutGoingCall
 * DESCRIPTION
 *  To Initialize the Outgoing Call Management Application
 *  
 *  This function sets up the handlers required for event flow and
 *  application management.This function is invoked from InitIncomingCall.
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void InitOutGoingCall(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    ReinitializeOutgoingCall();

    SetHiliteHandler(MITEM2011_CM_S_ACTIVE_END, HiliteM2019AllActiveEnd);
    SetHiliteHandler(MITEM2011_CM_END_SINGLE, HiliteM2011EndSingle);
    SetHiliteHandler(MITEM2011_CM_INC_END_SINGLE, HiliteM2011IncEndSingle);
    SetHiliteHandler(MITEM2019_CM_ALL_ACTIVE_END, HiliteM2019AllActiveEnd);
    SetHiliteHandler(MITEM2020_CM_ALL_HELD_END, HiliteM2020AllHeldEnd);
    SetHiliteHandler(MITEM2050_CM_END_HELD_ENDALL_HELD, HiliteM2020AllHeldEnd);
    SetHiliteHandler(MITEM2011_CM_END, HiliteM2016AllCallEnd);
    SetHiliteHandler(MITEM2011_CM_END_ALL, HiliteM2016AllCallEnd);
    SetHiliteHandler(MITEM2016_CM_ALL_CALL_END, HiliteM2016AllCallEnd);
    SetHiliteHandler(MITEM_OUTGOING_REJECT, HiliteIncomingReject);

    SetHiliteHandler(MITEM2010_CM_ACTIVE_HOLD, HiliteM2010ActiveHold);
    SetHiliteHandler(MITEM2010_CM_M_ACTIVE_HOLD, HiliteM2010ActiveHold);
    SetHiliteHandler(MITEM2012_CM_HELD_RETRIEVE, HiliteM2012HeldRetrieve);
    SetHiliteHandler(MITEM2012_CM_M_HELD_RETRIEVE, HiliteM2012HeldRetrieve);
    SetHiliteHandler(MITEM2014_CM_CALL_SWAP, HiliteM2014Swap);
    SetHiliteHandler(MITEM2015_CM_CALL_CONFER, HiliteM2015Conference);
    SetHiliteHandler(MITEM2017_CM_CALL_TRANSFER, HiliteM2017Transfer);
    SetHiliteHandler(MITEM2018_CM_CALL_SPLIT, HiliteM2018Split);

    SetHiliteHandler(MITEM2031_CM_PBOOK, HiliteM2031PBookAppEntry);
    SetHiliteHandler(MITEM2032_CM_SMS, HiliteM2032MsgAppEntry);
#ifdef __MMI_VOICE_MEMO__
    SetHiliteHandler(MITEM2022_CM_VOICE_MEMO, HiliteM2022VoiceMemo);
#endif 
#ifdef __MMI_SOUND_RECORDER__
    SetHiliteHandler(MITEM2026_CM_SOUND_RECORDER, HiliteM2026SoundRecorder);
#endif 
#ifdef __MMI_AUDIO_PLAYER__
    SetHiliteHandler(MITEM2025_CM_AUDIO_PLAYER, HiliteM2025AudioPlayer);
#endif 

#if defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__)
    SetHiliteHandler(MITEM_CM_BT_SETPATH, HiliteBTCMSetPath);
#endif 

    SetHiliteHandler(MITEM2020_CM_MUTE, HiliteM2020Mute);
    SetHiliteHandler(MITEM2024_CM_DTMF, HiliteM2024DTMF);
    SetHiliteHandler(MITEM2021_CM_NEWCALL, HiliteM2021NewCall);
#ifdef __CTM_SUPPORT__
    SetHiliteHandler(MITEM2027_CM_CTM, HiliteM2027CTM);
#endif 

    SetHintHandler(MITEM2020_CM_MUTE, Hint2020Mute);
    SetHintHandler(MITEM2024_CM_DTMF, Hint2024DTMF);
}


/*****************************************************************************
 * FUNCTION
 *  HiliteM2011EndSingle
 * DESCRIPTION
 *  hilite handler to invoke End Single function call
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void HiliteM2011EndSingle(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PRINT_INFORMATION(("\n 2011 End Single \n"));

    ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
    ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SCR1003_LSK);
#ifdef __GPRS_MODE__
    SetLeftSoftkeyFunction(HangupHilited, KEY_EVENT_UP);
#else 
    SetLeftSoftkeyFunction(EndSingleAndGoBack, KEY_EVENT_UP);
#endif 
    SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
}


/*****************************************************************************
 * FUNCTION
 *  HiliteM2011IncEndSingle
 * DESCRIPTION
 *  hilite handler to invoke End Single function call
 *  when MT call present
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void HiliteM2011IncEndSingle(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PRINT_INFORMATION(("\n 2011 End Single \n"));

    ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
    ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SCR1003_LSK);
    SetLeftSoftkeyFunction(EndSingleAndGoBack, KEY_EVENT_UP);
    SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
}


/*****************************************************************************
 * FUNCTION
 *  HiliteM2011SingleActiveEnd
 * DESCRIPTION
 *  Hilite function for selecting active call to end
 *  
 *  In case there is only one active call the incoming call must be accepted
 *  otherwise a screen to select an active call to end must be Shown
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void HiliteM2011SingleActiveEnd(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
    ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
    SetLeftSoftkeyFunction(EndSingleActiveAndGoBack, KEY_EVENT_UP);
    SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
}


/*****************************************************************************
 * FUNCTION
 *  HiliteM2019AllActiveEnd
 * DESCRIPTION
 *  hilite handler to invoke function that hangup all the active call
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void HiliteM2019AllActiveEnd(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PRINT_INFORMATION(("\n 2019 AllActiveEnd \n"));

    ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
    ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SCR1003_LSK);
    SetLeftSoftkeyFunction(HangupallActive, KEY_EVENT_UP);
    SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
}


/*****************************************************************************
 * FUNCTION
 *  HiliteM2020AllHeldEnd
 * DESCRIPTION
 *  hilite handler to invoke the function that hangup all the heldcall
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void HiliteM2020AllHeldEnd(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PRINT_INFORMATION(("\n 2020 AllHeldEnd \n"));

    ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
    ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SCR1003_LSK);
    SetLeftSoftkeyFunction(HangupallHeld, KEY_EVENT_UP);
    SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
}


/*****************************************************************************
 * FUNCTION
 *  HiliteM2016AllCallEnd
 * DESCRIPTION
 *  hilite handler to invoke the hangup of all the calls
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void HiliteM2016AllCallEnd(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    PRINT_INFORMATION(("\n 2016 AllCallEnd \n"));

    ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
    ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_SCR1003_LSK);
    SetLeftSoftkeyFunction(KbCBackEndAllCallsExceptIncoming, KEY_EVENT_UP);
    SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
}


/*****************************************************************************
 * FUNCTION

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -