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

📄 mmisettings.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:		Settings
 $File:		    MmiSettings.c
 $Revision:		1.0                                                       
                                                                              
 $Author:		Condat(UK)                                                         
 $Date:		    25/10/00                                                      
                                                                               
********************************************************************************
                                                                              
 Description:

    
********************************************************************************
 $History: MmiSetting.c

 data:  22/07/02  

 Description:zy Mobile Innovation make the Active and Deactive confirm window has icons
       
 $End

*******************************************************************************/
/********************************************************************************
 $History: MmiSetting.c
 data                  Description
 01/08/02             zy Mobile Innovation make the language choice funtion
 04/08/02	          zy Mobile Innovation change the total structure 
 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 "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_phb.h"
#include "ksd.h"
#include "psa.h"
#include "mfw_sms.h"
#include "mfw_cphs.h"
#include "mfw_sat.h"

#include "dspl.h"

#include "MmiMmi.h"
#include "MmiDummy.h"
#include "MmiDialogs.h"
#include "MmiLists.h"
#include "MmiIdle.h"
#include "MmiSoftkeys.h"
#include "MmiIcons.h"
#include "MmiSounds.h"
#include "MmiMenu.h"
#include "MmiMain.h"
#include "MmiStart.h"
#include "MmiPins.h"
#include "MmiSettings.h"
#include "MmiVoiceMemo.h"
#include "mfw_ffs.h"
#include "MmiTimers.h"
#include "Mmieditor.h"
#include "mmiusersymbolinput.h"

#include "cus_aci.h"
#include "p_sim.h"
#include "mmihost.h"   //xsf add 2002.08.30 for hostkey protect options
#include "mmitextinput.h"		/* 2003/12/04 sunsj */
#include "mmiiconresource.h"/* 2004/06 sunsj modify for icon manage */

#define CLEAR_BOTTOM_ZONE dspl_Clear( KEY_AREA );
T_MFW_SMS_INFO SmsConfigData;
//extern UINT8    Gu8_Envio_num;//enter which enviroment flag  /*2004/5/14, wangyan remove*/
extern MfwHnd ledblink;//zy 2003-02-12

static int winEvent (MfwEvt e, MfwWin *w);

void confirm (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
void confirm_dialog_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason);
static void confirm_dialog(void);
static int confirm_win_cb (T_MFW_EVENT event, T_MFW_WIN * win);
void confirm_destroy (T_MFW_HND own_window);
T_MFW_HND confirm_create (T_MFW_HND parent_window);
void confirm_Exit (T_MFW_HND own_window);
T_MFW_HND confirm_Init (T_MFW_HND parent_window);
void setUserSettings2Default (void);
/*................zy add functions 04/08/02......................................................*/
static void NameAddNameCB( T_MFW_HND win, USHORT Identifier, SHORT reason );
static int NameInputKbdLongCB( MfwEvt e, MfwKbd *k );
static int NameInputKbdCB( MfwEvt e, MfwKbd *k );
static int NameInputWindowCB( MfwEvt e, MfwWin *w );
static void NameInputDestroy( MfwHnd window );
static void NameInputDialog( T_MFW_HND win, USHORT event, SHORT value, void *parameter );
static T_MFW_HND NameInputCreate( MfwHnd parent );
/*.....................end of zy change.................................................................*/

static void (*show) (void);

static MfwHnd win;                      /* our window               */
static MmiState nextState;              /* next state when finished */
static DisplayData DisplayInfo;
static int curIntensity;//zy add 04/08/02 backlight intensity
static U32 curKey;//zy add 04/08/02
static int BG;//zy add 04/08/02


#define SHOW_CONFIRM           3
#define ACTIVATE_CONFIRM       4
#define DEACTIVATE_CONFIRM     5
#define FACTORY_RESET          6
#define MAX_INTENSITY 6//zy add 04/08/02 max backlight intensity
#define MAX_SPLIT_FILE_NUM   8    //chenjun ,max split files num of user defined picture,2002-12-29 

//#ifdef FIELD_TEST_MODE_ENABLED 
#if 0
extern unsigned char gucEarPhoneSupport;
#endif

typedef struct
{
    T_MMI_CONTROL    mmi_control;
    T_MFW_HND        confirm_win;        /* MFW win handler      */
    UBYTE            local_status;
} T_confirm;
/*............zy add 08/04/02 for backlight listmenu.....................*/
typedef struct
{
    T_MMI_CONTROL    mmi_control;
    T_MFW_HND        background_win;                 /* MFW win handler      */
    T_MFW_HND        parent;
    T_MFW_HND        Background_handler;         /* MFW sms handler      */
    unsigned char      local_status;
    ListMenuData     * menu_list_data;
} T_BACKGROUND_INFO;
/*2003/12/15,talcon add*/
typedef struct 
{
    T_MMI_CONTROL    mmi_control;
    T_MFW_HND        win;
    T_MFW_HND           kbd;
    MfwHnd           AnimTimer; 
    UBYTE            idxbkganim;
    UBYTE            nBKGSel;   
}T_BKGSel;
T_confirm confirm_data;
/*2003/12/15,talcon add*/
T_BKGSel  BKGSel_data;
T_BKGSel  OuterBKGSel_data; /* 2004/04/10 sunsj add */

static MfwMnuAttr background_menuAttrib =
{
    0,
    &melody_menuArea,
    MNU_LEFT | MNU_LIST | MNU_CUR_LINE, /* centered page menu       */
    -1,                                 /* use default font         */
    NULL,                               /* with these items         */
    0                                   /* number of items     */
};
/*................end of zy change......................................*/
/*
 * Settings menu subs:
 */




#define ON  	0
#define OFF		1
#define CLEAR	2

typedef struct 
{
    UBYTE setting;
    UBYTE status;
} T_settings;
/*....................zy add for edit greetingword.04/08/02.................*/
typedef struct 
{
    T_MMI_CONTROL   mmi_control;
    T_MFW_HND       win;
    T_MFW_HND       kbd;
    T_MFW_HND       edt;
    T_MFW_HND       parent_win;
    T_VOID_FUNC     Callback;
    char             edt_buf_name[PHB_MAX_LEN];
    MfwEdtAttr      attr;
    T_EDITOR_DATA  properties;
} T_editBGname;

typedef enum
{
    NAMEINPUT_INIT,
    NAMEINPUT_LEFT,
    NAMEINPUT_RIGHT,
    NAMEINPUT_CLEAR,
    NAMEINPUT_DESTROY
} tNameMessageEvents;
typedef enum
{
    BACKLIGHT_REASON=0,
    CONTRAST_REASON
} IntensityReasons;
/*......................end of zy change....................................*/
typedef enum 
{
    ENGLISH = 0,
    GERMAN,
    AUTOREDIAL,
    AUTOANSWER,
    ANYKEYANSWER,
    CALLTIMERS,
    KEYPAD_CLICK,
    KEYPAD_DTMF,
    KEYPAD_SILENT,
    VOICE_MEMO,
    // later melody & volume as well
    // voicememo buffer + record_position
    MAX
}T_FACTORY_RESET_LIST;
/*..........zy cahnge for rename greetingword04/08/02....................*/
typedef enum
{
    RENAMEGREETINGWORD=0,
}T_RENAMEENTRY;

T_RENAMEENTRY RenameEntry;
/*.......................end of zy change...........................*/
//DEFAULT-SETTING-TABLE 
//IF YOU WANT TO MODIFY THE "DEFAULT_SETTINGS"-TABLE
//JUST CHANGE ONLY THE STATUS (ON, OFF, CLEAR)

T_settings DEFAULT_SETTINGS[] = 
{ 
    {ENGLISH,       ON},        //select the Language:English as a default
    {GERMAN,        OFF},   
    {AUTOREDIAL,    OFF},       
    {AUTOANSWER,    OFF},       
    {ANYKEYANSWER,  OFF},       
    {CALLTIMERS,    CLEAR},     
    {KEYPAD_CLICK,  ON},        //only one of the Keypads are eligible
    {KEYPAD_DTMF,   OFF},       
    {KEYPAD_SILENT, OFF},       
    {VOICE_MEMO,    CLEAR},     
    {MAX,           0xFF}     
};

typedef enum
{
    E_INIT = 0x0801,
    E_BACK,
    E_ABORT,
    E_EXIT,
    E_RETURN,
    E_OK
} e_M_events;
typedef struct
{
    /* administrative data */

    T_MMI_CONTROL     mmi_control;
    T_MFW_HND         win;
    T_MFW_HND         parent_win;
    T_MFW_HND           kbd;
    IntensityReasons    reason;
    int                 intensity;
} t_Intnsity;
typedef struct 
{
    UINT8 splitNum;    //拆分文件数
    UINT8 splitW;   //拆分宽度,just one, all the split file has the same width
    UINT8 splitH[2];   //拆分高度,each split file may has it's own height
    char splitName[MAX_SPLIT_FILE_NUM][25];     //拆分文件名
}TSplitPicInfo;//ADDED by chenjun 2002-12-28
static int curVolume;                   /* current volume           */
//chenjun add the following lines for user defined pixture 2002-12-29

#define SPLIT_SIZE  3840    //7680   //120*32=120*128*2/8=120*160*2/5


unsigned char UserBmpBuffer[SPLIT_SIZE+1];  //chenjun 2003-01-23 changed from malloc to static 
const char picIndex[]="/bmi/pic1index"; /* 2004/06/14 sunsj modify */
TSplitPicInfo SplitInfo;
/*******************************************************************************

 $Function:    	SmsValidityPeriod

 $Description:	Store the validity period information, selected by the user.
            
 
 $Returns:		Execution status
 
 $Arguments:	m - menu handler
                i - Menu item selected
 
*******************************************************************************/
int SmsValidityPeriod(MfwMnu* m, MfwMnuItem* i)
{
    int index;
    T_DISPLAY_DATA DisplayInfo;

    T_MFW_HND win  = mfwParent(mfw_header());

    TRACE_EVENT(">>>> SmsValidityPeriod()");

    index= m->lCursor[m->level];
    // Use Index to store the selected validity period in NVM.

    // Display confirmation screen.
    dialog_info_init(&DisplayInfo);//gdy add
    DisplayInfo.TextId= TxtSmsValidityPeriodSet;
    DisplayInfo.Time =ONE_SECS;
    DisplayInfo.KeyEvents    = KEY_RIGHT|KEY_CLEAR;
    DisplayInfo.TextId2      = 0;
    DisplayInfo.TextString    = '\0';
    DisplayInfo.TextString2   = '\0';
    DisplayInfo.LeftSoftKey   = TxtNull;
    DisplayInfo.RightSoftKey = TxtCancel;
    DisplayInfo.Callback     = NULL;

    info_dialog(win,&DisplayInfo);

    return 1;
}

/******************************************************/
/*                                                    */
/*Function Name: CBLanguage_check                       */
/*Purpose:      CBLanguage_check items check                      */
/*Prarmeter:   struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi */
/*return   :     USHORT                                 */
/*                                                    */
/*Author   :     windy                              */
/*Date     :    Aug.16th,2002                             */
/******************************************************/
USHORT SRRONOFF_check (struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi)
{
    if( FFS_flashData.SRRONOFF==1 )
        return FLAGFUNC_TRUE_ICON;
    else if( FFS_flashData.SRRONOFF==0 )
        return FLAGFUNC_FALSE_ICON;
#if 0
    T_MFW_SMS_INFO  sms_parameter;
    SmsSend_get_config_data(&sms_parameter);
    switch( sms_parameter.srr )
    {
    case SMS_NOT_REQUESTED_SRR:
        return FLAGFUNC_FALSE_ICON;

    case SMS_REQUESTED_SRR:
        return FLAGFUNC_TRUE_ICON;

    }
#endif
}
/* Marcus: Issue 1170: 30/09/2002: Start */
/*******************************************************************************

 $Function:    	SmsStatusReportRequest

 $Description:	Activate/Deactivate SRR, selected by the user.
            
 $Returns:		Execution status
 
 $Arguments:	m - menu handler
                i - Menu item selected
 
*******************************************************************************/
int SmsStatusReportRequest(MfwMnu* m, MfwMnuItem* i)
{
    int index = m->lCursor[m->level];
    T_DISPLAY_DATA DisplayInfo;
    T_MFW_SMS_INFO sms_info;
    T_MFW_HND win  = mfwParent(mfw_header());

    TRACE_FUNCTION(">>>> SmsStatusReportRequest()");

    dialog_info_init(&DisplayInfo);//gdy add
    if( sms_parameter(&sms_info, TRUE) == MFW_SMS_OK )
    {
        if( FFS_flashData.SRRONOFF==1 )
        {
            sms_info.srr = SMS_NOT_REQUESTED_SRR;
            sms_parameter(&sms_info, FALSE);
            //		call infoscreen("Deactivated"); 
            DisplayInfo.RightSoftKey = 0;
            DisplayInfo.Time         = ONE_SECS;//zy 12/22/2002 change 3sec to 1sec
            DisplayInfo.KeyEvents    = KEY_CLEAR|KEY_RIGHT|KEY_LEFT;
            DisplayInfo.TextId2      = TxtDeActivated;
            DisplayInfo.Identifier   = DIALOGS_REASON_NULL;
            DisplayInfo.iconindex   =REMIND_COMPLETE;
            info_dialog (win, &DisplayInfo); 
            //info_screen(win, TxtDeActivated,TxtNull, NULL);//(T_VOID_FUNC)SmsCB_dialog_cb); 
            //statusCBCH(TRUE);
            FFS_flashData.SRRONOFF=0;
            flash_write();
        }
        else if( FFS_flashData.SRRONOFF==0 )
        {
            sms_info.srr = SMS_REQUESTED_SRR;
            sms_parameter(&sms_info, FALSE);
            //call infoscreen("Activated"); 
            DisplayInfo.RightSoftKey = 0;
            DisplayInfo.Time         = ONE_SECS;//zy 12/22/2002 change 3sec to 1sec
            DisplayInfo.KeyEvents    =  KEY_CLEAR|KEY_RIGHT|KEY_LEFT;
            DisplayInfo.TextId2      = TxtActivated;
            DisplayInfo.Identifier   = DIALOGS_REASON_NULL;
            DisplayInfo.iconindex   =REMIND_COMPLETE;
            info_dialog (win, &DisplayInfo); 
            //info_screen(win, TxtActivated,TxtNull,NULL);//(T_VOID_FUNC)SmsCB_dialog_cb); 
            //statusCBCH(FALSE);
            FFS_flashData.SRRONOFF=1;
            flash_write();
        }

⌨️ 快捷键说明

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