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

📄 mmiaoc.c

📁 是一个手机功能的模拟程序
💻 C
📖 第 1 页 / 共 5 页
字号:
/*******************************************************************************

                    CONDAT (UK)

********************************************************************************                                                                              

 This software product is the property of Condat (UK) Ltd and may not be
 disclosed to any third party without the express permission of the owner.                                 
                                                                              
********************************************************************************

 $Project name:	Basic MMI                                                      
 $Project code:	BMI (6349)                                                           
 $Module:		Advice of Charge
 $File:		    MmiVoiceMemo.c
 $Revision:		1.0                                                       
                                                                              
 $Author:		Condat(UK)                                                         
 $Date:		    09/04/01                                                      
                                                                               
********************************************************************************
                                                                              
 Description:

    This provides the start code for the MMI
                        
********************************************************************************
 $History: MmiAoc.c

    09/04/01			Original Condat(UK) BMI version.	
    28/08/02      wufei modified
       
 $End

*******************************************************************************/




/*******************************************************************************
                                                                              
                                Include files
                                                                              
*******************************************************************************/

#define ENTITY_MFW

/* includes */
#include <string.h>
#include <stdio.h>
#include <stdlib.h>

#if defined (NEW_FRAME)

    #include "typedefs.h"
    #include "vsi.h"
    #include "pei.h"
    #include "custom.h"
    #include "gsm.h"

#else

    #include "stddefs.h"
    #include "custom.h"
    #include "gsm.h"
    #include "vsi.h"

#endif
#include "mfw_sys.h"

#include "p_sim.h"
#include "cus_aci.h"

#include "mfw_mfw.h"
#include "mfw_win.h"
#include "mfw_kbd.h"
#include "mfw_edt.h"
#include "mfw_lng.h"
#include "mfw_tim.h"
#include "mfw_icn.h"
#include "mfw_mnu.h"
#include "mfw_phb.h"
#include "mfw_cm.h"
#include "mfw_sim.h"
#include "mfw_nm.h"
#include "mfw_sat.h"
#include "mfw_ss.h" /*for convert*/
#include "mfw_phb.h"
#include "ksd.h"
#include "psa.h"
#include "mfw_sms.h"
#include "mfw_cphs.h"
#include "mfw_sat.h"
#include "mfw_ffs.h" //wufei add 0827

#include "dspl.h"


#include "MmiMmi.h"
#include "MmiDummy.h"
#include "MmiDialogs.h"
#include "MmiEditor.h"
#include "MmiLists.h"
#include "MmiIdle.h"
#include "MmiSoftkeys.h"
#include "MmiIcons.h"
#include "MmiMenu.h"
#include "MmiMain.h"
#include "MmiStart.h"
#include "MmiPins.h"
#include "mmiusersymbolinput.h"  //2003-4-10
#include "mmitextinput.h"		/* 2003/12/04 sunsj */

/*******************************************************************************
    Local Data
 
*******************************************************************************/
#define	PIN_REQUEST_FOR_RATE				700
#define	SERVICES_ENTER_CURRENCY			701
#define	SERVICES_ONE_UNIT					702
#define	SERVICES_RATE_CHANGED			703
/*#define	SERVICES_CREDIT_REMAINING		704
#define	SERVICES_LAST_CHARGE				711
#define	SERVICES_TOTAL_CHARGE			712*/
#define	PIN_REQUEST_FOR_LIMIT_CHANGE	705
#define	PIN_REQUEST_FOR_LIMIT_CANCEL	706
#define	SERVICES_LIMIT_VIEW				707
#define	SERVICES_LIMIT_CHANGE				708
#define	SERVICES_LIMIT_CANCEL				709
#define	SERVICES_LIMIT_CHANGED			710

#define	SERVICES_RESET_CHARGE			713
#define	SERVICES_CHARGE_CHANGED			714
#define	SERVICES_OUT_OF_RANGE			715
#define	SERVICES_AOC_NOT_SUPPORTED		716
#define PIN_REQUEST_FOR_RESET_CHARGE		717
#define  SERVICES_RATE_VIEW				718 //WUFEI APPEND
#define  SERVICES_RATE_CANCEL				719 //WUFEI APPEND
#define PIN_REQUEST_FOR_RATE_CANCEL		720 //WUFEI APPEND


/* Max. Enter of Character   */
#define MAX_ENTER_LIMIT      7
#define MAX_ENTER_CURRENCY   4
#define MAX_ENTER_UNIT       6
/*    */



typedef struct
{
    T_MMI_CONTROL           mmi_control;
    T_MFW_HND               service_win;        /* MFW win handler      */
    T_MFW_HND              edt_win;
    T_MFW_CM_AOC_INFO       aocInfo;
    USHORT                  Identifier;
    char                    edt_Buf[30];      /* Editor buffer       */
} T_SERVICES;




LONG acm_last_call = 0; //accumulated call meter  from the last call
//later the value should save and read again from PCM
extern FlashSetting FlashSettingData; //wufei add 0827

/*******************************************************************************
    Local prototypes
 
*******************************************************************************/
T_MFW_HND   service_Init        (T_MFW_HND parent_window);
void        service_Exit        (T_MFW_HND own_window);
T_MFW_HND   service_create      (T_MFW_HND parent_window);
void        service_destroy     (T_MFW_HND own_window);
static int  service_win_cb      (T_MFW_EVENT event, T_MFW_WIN * win);
void        service_dialog_cb   (T_MFW_HND win, USHORT identifier, UBYTE reason);
void        service             (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
void        service_loadEditDefault (T_EDITOR_DATA *editor_data);
void        service_calc_balance   (T_MFW_HND win,char* line);
void        service_calculate   (T_MFW_HND win, char* line, long value);
USHORT      service_check_pin_for_aoc (void);



/* 2003/10/28, wangyan, modify AOC statistics menu*/
int aoc_statistics (MfwMnu* m, MfwMnuItem* i)/* 2003/10/28, wangyan, modify call time statistics menu*/
{
    T_MFW_HND win = mfw_parent(mfw_header());

    TRACE_FUNCTION("aoc_statistics")

    // create new dynamic dialog for the AOC
    SEND_EVENT (service_Init (win), SERVICES_AOC_STATISTICS, 0, 0);


    return 0;
}


#if 0
/*******************************************************************************
    Functions
 
*******************************************************************************/

/*******************************************************************************

 $Function:    	aoc_credit_remaining

 $Description:	
            
 $Returns:		

 $Arguments:	
 
*******************************************************************************/

int aoc_credit_remaining (MfwMnu* m, MfwMnuItem* i)
{
    T_MFW_HND win = mfw_parent(mfw_header());

    TRACE_FUNCTION("aoc_credit_remaining")

    // create new dynamic dialog for the AOC
    SEND_EVENT (service_Init (win), SERVICES_CREDIT_REMAINING, 0, 0);


    return 0;
}

/*******************************************************************************

 $Function:    	aoc_last_charge

 $Description:	Dispays the charge for the last call in the currency or in units
                if no currency information has been entered
            
 $Returns:		

 $Arguments:	
 
*******************************************************************************/


int aoc_last_charge (MfwMnu* m, MfwMnuItem* i)
{
    T_MFW_HND win = mfw_parent(mfw_header());

    TRACE_FUNCTION("aoc_charge_rate")

    // create new dynamic dialog for the AOC
    SEND_EVENT (service_Init (win), SERVICES_LAST_CHARGE, 0, 0);


    return 0;
}

/*******************************************************************************

 $Function:    	aoc_total_charge

 $Description:	Displays the charge for all calls since the chage counter was last reset
            
 $Returns:		

 $Arguments:	
 
*******************************************************************************/


int aoc_total_charge (MfwMnu* m, MfwMnuItem* i)
{
    T_MFW_HND win = mfw_parent(mfw_header());

    TRACE_FUNCTION("aoc_charge_rate")

    // create new dynamic dialog for the AOC
    SEND_EVENT (service_Init (win), SERVICES_TOTAL_CHARGE, 0, 0);


    return 0;
}
#endif


/*******************************************************************************

 $Function:    	aoc_charge_rate

 $Description:	A security code editing screen is opened and Pin 2 requested.
                Once entered successfully, an alpha. editor is opened with the 
                title "Enter currency".Once entered, an numeric editor is opened
                with the title "Enter price p. unit". When the user has finished 
                entry the information screen " Rate changed" is displayed for 
                3 second and the phone returns to the previous sub-menu
 $Returns:		

 $Arguments:	
 
*******************************************************************************/


int aoc_charge_rate (MfwMnu* m, MfwMnuItem* i)
{
    T_MFW_HND win = mfw_parent(mfw_header());

    TRACE_FUNCTION("aoc_charge_rate")

    switch( service_check_pin_for_aoc () )
    {
    case MFW_SIM_PIN2_REQ:  
        // create new dynamic dialog for the AOC
        SEND_EVENT (service_Init (win), PIN_REQUEST_FOR_RATE, 0, 0);
        break;  

    case MFW_SIM_PIN_REQ:
    case MFW_SIM_NO_PIN:
        //pin 1 or no pin required, open now the editor for entering the currency
//        SEND_EVENT (service_Init (win),  SERVICES_ENTER_CURRENCY, 0, 0);/*2004/5/14, wangyan modify*/
        SEND_EVENT (service_Init (win),  PIN_REQUEST_FOR_RATE, 0, 0);
        break;

        //		case MFW_SIM_FAILURE:
        //AOC is supported from the SIM 
        //			SEND_EVENT (service_Init (win),  SERVICES_AOC_NOT_SUPPORTED, 0, 0);
        //			break;
    }

    return 0;
}

//--------------------------WUFEI ADD----------------------------------------
/**************************WUFEI ADD*****************************************
$Function: aoc_view_rate
$Description: view the ppu and currency(PUCT)
$Returns:
$Arguments:
******************************************************************************/
int aoc_view_rate (MfwMnu* m, MfwMnuItem* i)
{
    T_MFW_HND win = mfw_parent(mfw_header());
    TRACE_FUNCTION("aoc_view_rate")
    SEND_EVENT (service_Init(win), SERVICES_RATE_VIEW, 0, 0);
    return 0;
}


/******************************************************************************
$Function: aoc_cancel_rate
$Descripton: cancel the PUCT settings
$Returns:
$Arguments:
*******************************************************************************/
int aoc_cancel_rate (MfwMnu* m, MfwMnuItem* i)
{
    T_MFW_HND win = mfw_parent(mfw_header());

    TRACE_FUNCTION("aoc_charge_rate")

    // create new dynamic dialog for the AOC
    SEND_EVENT (service_Init (win), PIN_REQUEST_FOR_RATE_CANCEL, 0, 0);

    //	SEND_EVENT (service_Init(win), SERVICES_RATE_CANCEL, 0, 0);
    return 0;
}

//------------------------END OF WUFEI ADD---------------------------------

/*******************************************************************************

 $Function:    	aoc_view_limit

 $Description:	
            
 $Returns:		

 $Arguments:	
 
*******************************************************************************/


int aoc_view_limit (MfwMnu* m, MfwMnuItem* i)
{
    T_MFW_HND win = mfw_parent(mfw_header());

    TRACE_FUNCTION("aoc_charge_rate")

    // create new dynamic dialog for the AOC
    SEND_EVENT (service_Init (win), SERVICES_LIMIT_VIEW, 0, 0);

    return 0;
}


⌨️ 快捷键说明

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