📄 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
*******************************************************************************/
/*******************************************************************************
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 "p_sim.h"
#include "mfw_mfw.h"
#include "mfw_win.h"
#include "mfw_kbd.h"
#include "mfw_lng.h"
/* SPR#1428 - SH - New Editor changes */
#ifndef NEW_EDITOR
#include "mfw_edt.h"
#endif
#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_simi.h" // NH : put after mfw_nm.h as it contains a definition required by mfw_simi.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"
#include "MmiCall.h"
#include "MmiNetwork.h"
#include "MmiIcons.h"
/* SPR#1428 - SH - New Editor changes */
#ifdef NEW_EDITOR
#include "ATBCommon.h"
#include "ATBDisplay.h"
#include "ATBEditor.h"
#include "AUIEditor.h"
#else
#include "MmiEditor.h"
#endif
#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"
#include "mmiSmsRead.h"
#include "Mfw_td.h"/*SPR 1725*/
#ifdef MMI_HOMEZONE_ENABLED
#include "MmiHomezone.h" /* SPR759 - SH*/
#endif
#include "gdi.h"
#include "audio.h"
#include "cus_aci.h"
#include "p_sim.h"
#include "mmiResources.h" //for LINE_HEIGHT
#include "mmiColours.h"
#undef JVJ_USSD_TEST
#include "mmibookshared.h"
#include "mmibookutils.h"
#ifdef MMI_EM_ENABLED
#include "MmiEm.h"
#endif
/*********************************************************************
**********************************************************************
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);
/*
* 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);
static int idleLine( int lineNo );
static int idleExeSendMessage(MfwMnu* m, MfwMnuItem* i);
MfwHnd VOS_Idle_Win; /* our window */
extern UBYTE getCurrentRingerSettings(void );
void idle_Ciphering (UBYTE gsm_ciph, UBYTE gprs_ciph);
U16 AlarmStatus = 0;
extern UBYTE HUPKeyOrigin; // SH - set to 1 if POWER_KEY is pressed in idle screen
UBYTE test_sim; // SH
/*********************************************************************
**********************************************************************
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
#ifndef LSCREEN
#define YLINE 9
#else
#define YLINE (12*2+2)
#endif
#define KEYPADLOCK_BUF_SIZE 4
/*
* 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;
#ifdef NEW_EDITOR
T_ED_DATA *editor; /* SPR#1428 - SH - New Editor changes */
#else /* NEW_EDITOR */
T_MFW_HND edt;
#endif /* NEW_EDITOR */
} T_idle_dialling;
typedef struct
{
/* administrative data */
T_MMI_CONTROL mmi_control;
T_MFW_HND win;
T_MFW_HND parent_win;
#ifdef NEW_EDITOR
T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor data */
#else
T_EDITOR_DATA editor_data;
#endif
/* internal data */
char buffer[80];
UBYTE status;
} tShowVerion;
/*
* 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);
typedef struct
{
T_MMI_CONTROL mmi_control;
T_MFW_HND win; // window handle
T_MFW_HND kbd;
T_MFW_HND kbd_long;
T_MFW_HND menu;
} T_idle_dialling_options;
/*********************************************************************
**********************************************************************
KEYPADLOCKED WINDOW. DECLARATION
*********************************************************************
**********************************************************************/
T_MFW_HND idle_key_pad_locked_create(MfwHnd parent);
void idle_key_pad_locked_destroy (T_MFW_HND own_window);
static int idle_key_pad_locked_kbd_cb (MfwEvt e, MfwKbd *k);
static int idle_key_pad_locked_kbd_long_cb (MfwEvt e, MfwKbd *k);
static int idle_key_pad_locked_win_cb (MfwEvt e, MfwWin *w);
typedef struct
{
T_MMI_CONTROL mmi_control;
T_MFW_HND win; // window handle
T_MFW_HND kbd;
T_MFW_HND kbd_long;
#ifdef NEW_EDITOR /* SPR#1428 - SH - New Editor changes */
T_ED_DATA *editor;
#else
T_MFW_HND edt;
#endif
T_MFW_HND win_info; // window handle
UBYTE menuPressed;
UBYTE keyPadLockBuf[KEYPADLOCK_BUF_SIZE];
UBYTE TempkeyPadLockBuf[KEYPADLOCK_BUF_SIZE];
} T_idle_key_pad_locked;
void idle_key_pad_locked (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
static void (*showKeyPadLocked) (void);
static void showSOSCallKeyPadLocked(void);
void idle_info_destroy_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason);
/*********************************************************************
**********************************************************************
Information WINDOW. DECLARATION
*********************************************************************
**********************************************************************/
static int lockTimerEvent(MfwEvt e, MfwTim *t);
static void showPressMenuStar(void);
static void showSMSNewMessage(void);
static void showNothing(void);
T_MFW_HND idle_information_create(MfwHnd parent);
void idle_information_destroy (T_MFW_HND own_window);
static int idle_information_kbd_cb (MfwEvt e, MfwKbd *k);
static int idle_information_kbd_long_cb (MfwEvt e, MfwKbd *k);
static int idle_information_win_cb (MfwEvt e, MfwWin *w);
typedef struct
{
T_MMI_CONTROL mmi_control;
T_MFW_HND win; // window handle
T_MFW_HND parent_win;
T_MFW_HND timer;
T_VOID_FUNC info_cb;
T_MFW_HND kbd;
} T_idle_information;
void idle_information (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
T_MFW_HND idle_information_start(MfwHnd win_parent,S32 time,void (*show)(void),T_VOID_FUNC info_cb);
static void (*showInformation)(void);
static int idle_information_tim_cb(MfwEvt e, MfwTim *t);
static int idle_imei_info_cb(T_MFW_HND win, USHORT identifier, UBYTE reason);
T_MFW_HND ShowVersion(T_MFW_HND parent_window);
static T_MFW_HND ShowVersion_create(MfwHnd parent_window);
static void ShowVersion_DialogCB(T_MFW_HND win, USHORT e, SHORT identifier, void *parameter);
void ShowVersionSetEditor(T_MFW_HND win);
static void ShowVerionCB( T_MFW_HND win, USHORT Identifier,UBYTE reason);
void showVersion_destroy(MfwHnd own_window);
const char * date = "29.02.02";
const char * bmi = "01.06.01";
const char * gprs = "XX.XX.XX";
const char * ti = "05.03.02";
//API - 13-01-03 - 1310 - Create a variable for idle instead of using global pin_emergency_call
UBYTE pin_idle_emerg_call;
/*********************************************************************
**********************************************************************
IDLE WINDOW. IMPLEMENTATION
*********************************************************************
/*******************************************************************************
$Function: idleInit
$Description: init MMI idle handling
$Returns:
$Arguments:
*******************************************************************************/
void idleInit (MfwHnd parent)
{
T_MFW_HND hnd;
winAutoFocus(TRUE);
idle_data.nm_status = 0;
hnd = idle_create (parent);
TRACE_EVENT_P1("FFS_flashData.IdleScreenBgd = %d", FFS_flashData.IdleScreenBgd);
if( FFS_flashData.ProviderNetworkShow != TRUE )
FFS_flashData.ProviderNetworkShow = FFS_flashData.ProviderNetworkShow;
else
FFS_flashData.ProviderNetworkShow = TRUE;
if((FFS_flashData.IdleScreenBgd >= BGD_NONE) && (FFS_flashData.IdleScreenBgd < BGD_LAST))
idle_setBgdBitmap(FFS_flashData.IdleScreenBgd);
else
idle_setBgdBitmap(BGD_TI_LOGO);
if((FFS_flashData.MainMenuBgd >= BGD_NONE) && (FFS_flashData.MainMenuBgd < BGD_LAST))
icon_setMainBgdBitmap(FFS_flashData.MainMenuBgd);
else
icon_setMainBgdBitmap(BGD_SQUARE);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -