📄 mmiidle.c
字号:
/*******************************************************************************
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: Idle
$File: MmiIdle.c
$Revision: 1.0
$Author: Condat(UK)
$Date: 25/10/00
********************************************************************************
Description:
Handling for the idle screen
********************************************************************************
$History: MmiIdle.c
25/10/00 Original Condat(UK) BMI version.
$End
*******************************************************************************/
/********************************************************************************
$History: MmiIdle.c ver1.86
date version comment
02/09/02 0.10 change the gblink timer to 3seconds, and do not set timer frequentyl ganchh
21/06/02 zy for forbid update idlewin when the focused win is not focused
in idle
04/08/02 zy change the idle display arrangement
and the softkey and relative fuction
09/08 windy modified
15/08/02 xsf modified for switch scene mode in idle window
26/08/02 hxl add for charger
29/08/02 hxl changed for charger
18/09/02 xsf add codes for missedcallTone and unreadSMSTone timer
11/04/03 talcon,fix bug reboot when evironment setting in idle
$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 <stdio.h>
//#include <string.h>
//#include "mfw_sys.h"
//#include "stddefs.h"
//#include "custom.h"
//#include "gsm.h"
//#include "vsi.h"
#include "p_sim.h"
#include "mfw_mfw.h"
#include "mfw_win.h"
#include "mfw_kbd.h"
#include "mfw_lng.h"
#include "mfw_edt.h"
#include "mfw_cm.h"
#include "mfw_phb.h"
#include "mfw_sms.h"
#include "mfw_icn.h"
#include "mfw_mnu.h"
#include "mfw_tim.h"
#include "mfw_sim.h"
#include "mfw_nm.h"
#include "mfw_sat.h"
#include "dspl.h"
#include "MmiMmi.h"
#include "ksd.h"
#include "psa.h"
#include "MmiDummy.h"
#include "MmiDialogs.h"
#include "MmiLists.h"
#include "MmiMain.h"
#include "MmiStart.h"
#include "MmiMenu.h"
#include "MmiBookController.h"
#include "MmiBookUtils.h"
#ifdef MMI_EM_ENABLED //robert.chen added, 2004-08-02
#include "MmiEm.h"
#endif
#include "MmiCall.h"
#include "MmiNetwork.h"
#include "MmiIcons.h"
#include "MmiEditor.h"
#include "MmiSounds.h"
#include "MmiUserData.h"
#include "MmiSoftKeys.h"
#include "MmiPins.h"
#include "MmiDialogs.h"
#include "MmiIdle.h"
#include "MmiNetwork.h"
#include "MmiSettings.h"
#include "MmiSmsIdle.h"
#include "mfw_ffs.h"
#include "MmiSmsBroadcast.h"
#include "MmiCPHS.h"
#ifdef MMI_HOMEZONE_ENABLED
#include "MmiHomezone.h" /* SPR759 - SH*/
#endif
#include "gdi.h"
#include "audio.h"
#include "GameDisplay.h"//zy add 09/18
#include "cus_aci.h"
#include "p_sim.h"
//GW-Remove? #include "pcm.h"
#include "pwr.h" //hxl add for charger
#include "mmicharging.h"
#include "mmiservices.h" //wufei add
#include "fieldtest.h"
#include "L1tm_cust_add.h" //hxl add for pcsync 2003-1-5
#ifdef QQFUNC//hxl add for qq func switch,2003-3-24
#include "mmiqq.h"
#endif
/*2003/11/20,talcon add */
//#define TDTRACE 1
#include "mmiutilapi.h"
#include "mmiouterIdle.h" /*2003/12/27, wangyan add incoming call outsidescreen*/
#include "mmiiconresource.h"/* 2004/06 sunsj modify for icon manage */
#include "encrypt.h"
#undef JVJ_USSD_TEST
//#define EDITOR_SIZE 41 // sbh - moved to MmiIdle.h
extern UBYTE mfw_IMSI []; /* expanded IMSI (ASCIIZ) */
extern BOOL phonebook_search_flag;
//#define _DAIENABLE_
/*********************************************************************
**********************************************************************
IDLE WINDOW. DECLARATION
*********************************************************************
**********************************************************************/
/*
* This is a static window (also called dialog), it remains always, so that we dont have to worry a memory allocation
*/
/*
The typedef for T_idle has been moved into the MmiIdle.h file.
*/
T_idle idle_data; // This is a static window, and the related data are also static.
/*
* These are common functions xxx_create and xxx_destroy
*/
T_MFW_HND idle_create (T_MFW_HND parent_window);
void idle_destroy (T_MFW_HND own_window);
void DAIsignalEnable(); //the function to enable the DAI signal
/*
* This dialog function (the same name as the window)
* is used to handle the comunication between different windows. The global macro SEND_EVENT can be used with parameter win
* and the corresponding events to send from one mmi dialog to another.
*/
void idle (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
/*
* These are common optional functions handler
*/
static int idle_win_cb(MfwEvt e, MfwWin *w);
static int idle_kbd_cb (MfwEvt e, MfwKbd *k);
static int idle_kbd_long_cb (MfwEvt e, MfwKbd *k);
extern uint8 MCallHintDleteFlag; //hu binhao 2003-1-29
static int idleExeSendMessage(MfwMnu* m, MfwMnuItem* i);
MfwHnd VOS_Idle_Win; /* our window */
extern UBYTE getCurrentRingerSettings(void );
extern UBYTE animation_complete;
void idle_Ciphering (UBYTE gsm_ciph, UBYTE gprs_ciph);
U16 AlarmStatus = 0;
extern UBYTE HUPKeyOrigin; // sbh - set to 1 if POWER_KEY is pressed in idle screen
UBYTE test_sim; // SH
extern void Force_refresh();
extern void MmiTrace(char * str);
extern UINT8 g_pcsyncstatus ;//hxl add ,if pcsync run ,return,2003-2-13
/*2003/10/30,talcon add*/
//MfwIcnAttr * get_bkgicnAttr(int i);
static int idlebkganim_timer_cb(MfwEvt e, MfwTim *t);
void dspl_IdleBackBmpAnim(int i,UBYTE * pIndx);
/* end talcon */
/*2003/11/01,talcon add*/
static int draw_idleAnim();
/*end talcon */
/*2003/11/13,talcon add it */
void drawIdle();
/*2003//11/29,talcon add*/
void setIdleDrawFlags(U32 nFlags,U8 nMask);
/*2003/12/03,talcon add*/
extern GLOBAL int get_StringWidth(char *string);
/*********************************************************************
**********************************************************************
DIALLING WINDOW. DECLARATION
*********************************************************************
**********************************************************************/
/*
* This is a dinamic dialog, it must be created only when dialling in idle screen, and destroyed automatically after calling
* or clearing
*/
#define WIN_DIALLING_ORG_X 0
#define WIN_CENTRALIZE_ORG_X 30
#define XOFFSET 1
#define YOFFSET 1
/* 2004/01/04 sunsj modify for different lcd size */
#if (MAIN_LCD_SIZE==3)
#define IDLEOFFSET_X 5
#define IDLENUMBERWIDTH 15
#define IDLENUMBERHIGH 17
#define IDLEOFFSET 10//60//shiheng 288 for idle dial
#define IDLEPHONE_NUMBER 8
#elif ( MAIN_LCD_SIZE==4 )
#define IDLENUMBERWIDTH 15
#define IDLENUMBERHIGH 17
#define IDLEOFFSET 0
#define IDLEOFFSET_X 4
#define IDLEPHONE_NUMBER 8
#elif ( MAIN_LCD_SIZE==2 )
#define IDLENUMBERWIDTH 10
#define IDLENUMBERHIGH 14
#define IDLEOFFSET 0
#define IDLEPHONE_NUMBER 10
#endif
#define YLINE 9
#define KEYPADLOCK_BUF_SIZE 4
#if ( MAIN_LCD_SIZE==4 )
/* 2004/06 sunsj modify for icon manage */
unsigned int idlewallpaperId[] =
{
ICON_IDLESTATICWALLPAPER_1,
ICON_IDLESTATICWALLPAPER_2,
ICON_IDLESTATICWALLPAPER_3,
ICON_IDLESTATICWALLPAPER_4,
ICON_IDLESTATICWALLPAPER_5,
ICON_IDLESTATICWALLPAPER_6,
};
#endif
/*
* The information related to every window must be encapsulated in such an structure
*/
typedef struct
{
T_MMI_CONTROL mmi_control; // common control parameter
T_MFW_HND win;
T_MFW_HND kbd;
T_MFW_HND kbd_long;
T_MFW_HND edt;
} T_idle_dialling;
#if 0
typedef struct
{
/* administrative data */
T_MMI_CONTROL mmi_control;
T_MFW_HND win;
T_MFW_HND parent_win;
T_EDITOR_DATA editor_data;
T_MFW_HND kbd;
/* internal data */
char buffer[100];
UBYTE status;
} tSpecialMode;
#endif
//typedef long WORD32;
/*
* These are common functions xxx_create and xxx_destroy
*/
T_MFW_HND idle_dialling_create(MfwHnd parent);
void idle_dialling_exit (void);
/*
* This dialog function (the same name as the window)
* is used to handle the comunication between different windows. The global macro SEND_EVENT can be used with parameter win
* and the corresponding events to send from one mmi dialog to another.
*/
void idle_dialling (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
/*
* These are common optional functions handler
*/
static int idle_dialling_kbd_cb (MfwEvt e, MfwKbd *k);
static int idle_dialling_kbd_long_cb (MfwEvt e, MfwKbd *k);
static int idle_dialling_win_cb (MfwEvt e, MfwWin *w);
/*
* This an optional function, used often to call, create and init a new dialog, with different parameters depending
* on the context
*/
T_MFW_HND idle_dialling_start (T_MFW_HND win_parent,char *character);
/*********************************************************************
**********************************************************************
OPTIONS DIALLING WINDOW. DECLARATION
*********************************************************************
**********************************************************************/
#define WIN_OPTIONS_DIALLING_ORG_X 0
#define WIN_OPTIONS_DIALLING_ORG_Y SECOND_LINE
#define WIN_OPTIONS_DIALLING_X_OFFSET 1
#define WIN_OPTIONS_DIALLING_Y_OFFSET 1
T_MFW_HND idle_dialling_options_create(MfwHnd parent);
void idle_dialling_options_destroy (T_MFW_HND own_window);
static int idle_dialling_options_kbd_cb (MfwEvt e, MfwKbd *k);
static int idle_dialling_options_kbd_long_cb (MfwEvt e, MfwKbd *k);
static int idle_dialling_options_win_cb (MfwEvt e, MfwWin *w);
static int idle_dialling_options_mnu_cb (MfwEvt e, MfwMnu *m);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -