📄 mmismsread.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
$Module: SMS
$File: MmiSmsRead.c
$Revision: 1.0
$Author: Condat(UK)
$Date: 25/10/00
********************************************************************************
Description:
Shared definitions of data elements are made in here
and accessed via the primitive operations supplied
********************************************************************************
$History: MmiSmsRead.c
25/10/00 Original Condat(UK) BMI version.
09/08 windy modified
19/08/02 ver0.111 wangxia modified
$End
*******************************************************************************/
#define MMI_SMSREAD_C
#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_edt.h"
#include "mfw_tim.h"
#include "mfw_phb.h"
#include "ksd.h"
#include "psa.h"
#include "mfw_sms.h"
#include "mfw_smsi.h"
#include "mfw_icn.h"
#include "mfw_mnu.h"
#include "mfw_lng.h"
#include "mfw_sat.h"
#include "mfw_kbd.h"
#include "mfw_nm.h"
#include "psa_util.h"
#include "dspl.h"
// #include "unicode_types.h"
#include "MmiMain.h"
#include "MmiDummy.h"
//#include "MmiLists.h"
#include "MmiMmi.h"
#include "mmicall.h"//GW 29/11/01 for 'callNumber'
#include "MmiDialogs.h"
#include "MmiLists.h"
#include "MmiMenu.h"
#include "MmiSoftKeys.h"
#include "MmiEditor.h"
#include "MmiBookShared.h" // MZ
#include "mmiSmsMenu.h"
#include "MmiSmsSend.h"
#include "MmiSmsRead.h"
#include "MmiSmsIdle.h"
#include "mfw_ffs.h"
#include "cus_aci.h"
#include "p_sim.h"
#include "pcm.h"
#include "aci_cmh.h" //GW 29/11/01 added for types in aci_fd.h
#include "aci_fd.h" //GW 29/11/01 added for types in 'cmh.h'
#include "cmh.h" //GW 29/11/01 added for types in 'cmh_phb.h'
#include "cmh_phb.h" //GW 29/11/01 added for cmhPHB_getAdrStr
#include "mfw_cnvt.h"
#include "mmiusersymbolinput.h"
#include "Mmiicons.h"
#include "mfw_ffs.h"
#include "GameDisplay.h"
#include "Mmitoolkit_timer.h"
//#define TDTRACE 1
#include "mmiutilapi.h"
#include "mmihost.h" /* 2004/04/05 sunsj add */
#include "mmiiconresource.h"/* 2004/06 sunsj modify for icon manage */
//GW 29/11/01 - added header file - removed extern void callNumber(UBYTE* number);
// GSM alphabet characters unknown in the ASCII table have been replaced by <SP> characters
static const char g_translation_ascii_table[128] = { 64, 156, 36, 157, 138, 130, 151, 141, 149, 128,
10, 2 , 7, 32, 143, 134, 4, 95, 232, 226, 239, 234, 227, 5, 228,
233, 240, 32, 146, 145, 225, 144, 32, 33, 34, 35, 1, 37, 38, 39,
40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
55, 56, 57, 58, 59, 60, 61, 62, 63, 173, 65, 66, 67, 68, 69,
70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
85, 86, 87, 88, 89, 90, 142, 153, 165, 154, 06, 168, 97, 98, 99,
100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
115, 116, 117, 118, 119, 120, 121, 122, 132, 148, 164, 129, 133};
static const int g_translation_unicode[128] = { 0x0040, 0x00A3, 0x0024, 0x00A5, 0x00E8, 0x00E9, 0x00F9, 0x00EC, 0x00F2, 0x00C7, 0x000A, 0x00D8, 0x00F8,
0x000D, 0x00C5, 0x00E5, 0x0394, 0x005F, 0x03A6, 0x0393, 0x039B, 0x03A9, 0x03A0, 0x03A8, 0x03A3, 0x0398,
0x039E, 0x03A2, 0x00C6, 0x00E6, 0x00DF, 0x00C9, 0x0020, 0x0021, 0x0022, 0x0023, 0x00A4, 0x0025, 0x0026,
0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033,
0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x00A1,
0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D,
0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A,
0x00C4, 0x00D6, 0x00D1, 0x00DC, 0x00A7, 0x00BF, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074,
0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x00E4, 0x00F6, 0x00F1, 0x00FC, 0x00E0};
/*********************************************************************
DYNAMIC MENU WINDOW. DECLARATION
**********************************************************************/
// Those information are passed to the sms editor
typedef struct
{
SHORT sms_index;
T_MMI_SMS_STAT sms_type;
T_MFW_SMS_PARA *sms_info;
char *assoc_name;
}T_SMS_EDITOR_DATA;
/* This variable is used to know in which state we are when MFW callback function is called */
typedef struct
{
SHORT nb_sms_stored;
T_MFW_SMS_MSG sms_messages[MAX_MESSAGES]; /* store info about the SMS: index... */
wstring_t* sms_header[MAX_MESSAGES]; /* header displayed in the dynamic menu */
}T_SMS_LIST_DATA;
typedef struct
{
/* administrative data */
T_MMI_CONTROL mmi_control;
T_MFW_HND win;
SHORT id;
T_MFW_HND parent;
T_MFW_HND kbd;
/* associated handlers */
T_MFW_HND sms_handle; /* MFW sms handler */
/* internal data */
T_SMS_LIST_DATA sms_list_data;
T_SMS_EDITOR_DATA sms_editor_data;
T_MFW_HND list_editor;
ListMenuData *menu_list_data;
UBYTE option_select; /* indicate what the user selected in the Optionsmenu*/
} T_SMSREAD_R;
//T_MFW_HND list_editor;
typedef struct
{
/* administrative data */
T_MMI_CONTROL mmi_control;
T_MFW_HND win;
SHORT id;
T_MFW_HND parent;
T_MFW_HND editor_win;
/* associated handlers */
/* internal data */
T_SMS_EDITOR_DATA *sms_editor_data;
//T_SMS_LIST_DATA sms_list_data;
ListMenuData *menu_list_data;
//char editor_buffer[MAX_EDITOR_LEN];
} T_SMSREAD_R_TEXTEDT2;
typedef struct
{
/* administrative data */
T_MMI_CONTROL mmi_control;
T_MFW_HND win;
SHORT id;
T_MFW_HND parent;
/* associated handlers */
/* !!! **************************************** modify here **************************************** !!!*/
T_MFW_HND kbd;
T_MFW_HND kbd_long;
T_MFW_HND menu;
/* !!! **************************************** end modify here **************************************** !!! */
/* internal data */
/* !!! **************************************** modify here **************************************** !!!*/
BOOL answer; /* TRUE == YES, FALSE == NO */
T_MFW_HND sms;
T_MFW_HND dialog_win;
/* !!! **************************************** end modify here **************************************** !!! */
T_SMS_EDITOR_DATA *sms_editor_data; //NM 25.8
} T_SMSREAD_R_OPT;
typedef struct
{
/* administrative data */
T_MMI_CONTROL mmi_control;
T_MFW_HND win;
SHORT id;
T_MFW_HND parent;
/* associated handlers */
/* internal data */
T_SMS_EDITOR_DATA sms_editor_data;
char editor_buffer[MAX_EDITOR_LEN];
} T_SMSREAD_R_TEXTEDT;
//MZ 7/02/01 graphic object type
// typedef MfwMnuItem *grph_Obj_t;
static enum
{
READ_SMS_LIST,
READ_FLASH_SMS_LIST,
READ_SELECTED_FLASH_SMS,
READ_SELECTED_SMS
} g_sms_state;
static int g_sms_fixed_state;
//MZ 7/02/01 tmp enums.
static enum
{
MFW_MB_LINE1,
MFW_MB_DATA
}mfw_mailBox_type;
//static char buf[100];
static MfwMnuAttr readSMS_menuAttrib =
{
0,
&readSMS_menuArea,
MNU_LEFT | MNU_LIST | MNU_CUR_LINE, /* centered page menu */
-1, /* use default font */
NULL, /* with these items */
0 /* number of items */
};
/*2003/12/4, wangyan add*/
static MfwMnuAttr readSMS_menuAttribMo =
{
0,
&readSMS_menuAreaMo,
MNU_LEFT | MNU_LIST | MNU_CUR_LINE, /* centered page menu */
-1, /* use default font */
NULL, /* with these items */
0 /* number of items */
};
static T_MFW_HND SmsRead_R_OPT_create (T_MFW_HND parent);
static void SmsRead_R_OPT_destroy (T_MFW_HND window);
static void SmsRead_R_OPT_StandardDialog(T_MFW_HND win, int TextId, ULONG duration);
static void SmsRead_R_OPT_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
static int SmsRead_R_OPT_win_cb (MfwEvt e, MfwWin *w);
//static int SmsRead_R_OPT_mfw_cb (MfwEvt event, void *parameter);
static int SmsRead_R_OPT_dialog_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason);
static int SmsRead_R_OPT_kbd_cb (MfwEvt e, MfwKbd *k);
static int SmsRead_R_OPT_mnu_cb (MfwEvt e, MfwMnu *m);
static int SmsRead_R_OPTExeDelete(MfwMnu* m, MfwMnuItem* i);
static int SmsRead_R_OPTExeReply(MfwMnu* m, MfwMnuItem* i);
static int SmsRead_R_OPTExeStoreNumber(MfwMnu* m, MfwMnuItem* i);
static int SmsRead_R_OPTExeForward(MfwMnu* m, MfwMnuItem* i);
void SmsRead_R_OPTExeCallNumber(void);
static int SmsRead_R_OPTExeEdit(MfwMnu* m, MfwMnuItem* i);
static int SmsRead_R_OPTExeToNVM(MfwMnu* m, MfwMnuItem* i);
/* 2004/06 sunsj modify for icon manage */
extern const MfwIcnAttr colist[];
static MfwMnuItem SmsRead_R_OPTItems [] =
{
{(MfwIcnAttr *)&colist,0,0,(char *)TxtReply,0,(MenuFunc)SmsRead_R_OPTExeReply,item_flag_none},
{(MfwIcnAttr *)&colist,0,0,(char *)TxtForward,0,(MenuFunc)SmsRead_R_OPTExeForward,item_flag_none},
{(MfwIcnAttr *)&colist,0,0,(char *)TxtDelete,0,(MenuFunc)SmsRead_R_OPTExeDelete,item_flag_none},
// {0,0,0,(char *)TxtEdit,0,(MenuFunc)SmsRead_R_OPTExeEdit,item_flag_none},
{(MfwIcnAttr *)&colist,0,0,(char *)TxtCallNumber,0,(MenuFunc)SmsRead_R_OPTExeCallNumber,item_flag_none},
{(MfwIcnAttr *)&colist,0,0,(char *)TxtExtractNumber,0,(MenuFunc)SmsRead_R_OPTExeStoreNumber,item_flag_none},
{(MfwIcnAttr *)&colist,0,0,(char *)TxtSaveToNVM,0,(MenuFunc)SmsRead_R_OPTExeToNVM,item_flag_none}
};
static MfwMnuAttr SmsRead_R_OPTAttrib =
{
0,
&SmsRead_R_OPTArea,
MNU_LEFT | MNU_LIST | MNU_CUR_LINE, /* centered page menu */
-1, /* use default font */
SmsRead_R_OPTItems, /* with these items */
sizeof(SmsRead_R_OPTItems)/sizeof(MfwMnuItem) /* number of items */
};
static MfwMnuItem SmsRead_FST_OPTItems [] =
{
{(MfwIcnAttr *)&colist,0,0,(char *)TxtReply,0,(MenuFunc)SmsRead_R_OPTExeReply,item_flag_none},
{(MfwIcnAttr *)&colist,0,0,(char *)TxtDelete,0,(MenuFunc)SmsRead_R_OPTExeDelete,item_flag_none},
{(MfwIcnAttr *)&colist,0,0,(char *)TxtForward,0,(MenuFunc)SmsRead_R_OPTExeForward,item_flag_none},
{(MfwIcnAttr *)&colist,0,0,(char *)TxtExtractNumber,0,(MenuFunc)SmsRead_R_OPTExeStoreNumber,item_flag_none},
{(MfwIcnAttr *)&colist,0,0,(char *)TxtCallNumber,0,(MenuFunc)SmsRead_R_OPTExeCallNumber,item_flag_none}
};
static MfwMnuAttr SmsRead_FST_OPTAttrib =
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -