MTK短信开发详解(七)
读取请求发送之后,在 mmi_frm_sms_read_sms_rsp 接收请求处理结果,显示短信。
[\plutommi\mmi\MiscFramework\MiscFrameworkSrc\SMSMsg.c]
void mmi_frm_sms_read_sms_rsp(void *inMsg) // 短信请求应答
mmi_frm_sms_callback_action(&type, result);
[\plutommi\mmi\MiscFramework\MiscFrameworkSrc\SMSMsg.c]
void mmi_frm_sms_callback_action(void *data, U16 result)
callback(data, (module_type) mod_src, result);// 调用 mmi_msg_entry_inbox_msg
[\plutommi\mmi\messages\messagessrc\SmsMoMtGuiInterface.c]
void mmi_msg_entry_inbox_msg(void)
// 显示短信内容
3.4、短信【选项】菜单
1、选项菜单资源:
SMS_INBOX_OPTIONS_MENUID //菜单ID
STR_GLOBAL_OPTIONS //字串资源
2、选项菜单入口:
[\plutommi\mmi\messages\messagessrc\SmsMoMtGuiInterface.c]
void mmi_msg_entry_option_inbox(void)
3、菜单子选项的初始化:
[\plutommi\customer\custresource\pluto_mmi\res_mmi\Res_Messages.c]
void PopulateMessagesResData (void)
{
[...]
ADD_APPLICATION_MENUITEM((SMS_INBOX_OPTIONS_MENUID,/* 1. 收件箱短信的[选项]菜单 */
0, NUM_MESSAGES_INBOXOP_MENU, /* 2. [选项]菜单项个数 */
SMS_INBOX_OPT_REPLY_MENUID, /* 3. [回复]选项 */
SMS_INBOX_OPT_DELETE_MENUID, /* 4. [删除]选项 */
[...]
STR_GLOBAL_OPTIONS, IMG_SMS_COMMON_NOIMAGE));
[...]
}
短信相关的高亮注册集中在mmi_msg_set_highlight_handler,可以从这里快速查找到[选项]各子项:
[\plutommi\mmi\messages\messagessrc\SmsMoMtGuiInterface.c]
void mmi_msg_set_highlight_handler(void)
{
[...]
SetHiliteHandler(SMS_INBOX_OPT_REPLY_MENUID, mmi_msg_highlight_reply);
SetHiliteHandler(SMS_INBOX_OPT_EDIT_MENUID, mmi_msg_highlight_edit);
SetHiliteHandler(SMS_INBOX_OPT_FORWARD_MENUID, mmi_msg_highlight_forward);
[...]
}
4、业务信箱
业务信箱沿用原有的收/发件箱模式,但由于无法保存自定义的短信状态值, 所以必须自行建一个状态映射表,用以保存是否业务短信。
4.1、定义相关资源
[\custom\common\mmi_msg_context.c]
unsigned short mmi_frm_sms_inbox_list[CM_SMS_MAX_MSG_NUM];
unsigned short mmi_frm_sms_outbox_list[CM_SMS_MAX_MSG_NUM];
unsigned short mmi_frm_sms_bizbox_list[CM_SMS_MAX_MSG_NUM];// add
mmi_frm_sms_msgbox_struct mmi_frm_sms_msg_box[CM_SMS_MAX_MSG_NUM];
[\custom\common\mmi_msg_context.h]
extern unsigned short mmi_frm_sms_inbox_list[CM_SMS_MAX_MSG_NUM];
extern unsigned short mmi_frm_sms_outbox_list[CM_SMS_MAX_MSG_NUM];
extern unsigned short mmi_frm_sms_drafts_list[CM_SMS_MAX_MSG_NUM];
extern unsigned short mmi_frm_sms_bizbox_list[CM_SMS_MAX_MSG_NUM];// add
[\plutommi\mmi\MiscFramework\MiscFrameworkSrc\SMSUtil.c]
static U16 mmi_frm_sms_msgbox_size = 0;
static U16 mmi_frm_sms_inbox_size = 0;
static U16 mmi_frm_sms_outbox_size = 0;
static U16 mmi_frm_sms_bizbox_size = 0;// add
[\plutommi\mmi\miscframework\miscframeworkinc\SMSStruct.h]
mmi_frm_sms_msgbox_enum
MMI_FRM_SMS_INBOX = 0x02, //read
MMI_FRM_SMS_OUTBOX = 0x04,
MMI_FRM_SMS_BIZUNREAD = 0x200,// add
MMI_FRM_SMS_BIZINBOX = 0x400,// add
[\plutommi\mmi\miscframework\miscframeworkinc\SMSApi.h]
typedef enum
{
[...]
MMI_FRM_SMS_APP_INBOX = 0x02,
MMI_FRM_SMS_APP_OUTBOX = 0x04,
MMI_FRM_SMS_APP_BIZUNREAD = 0x200,// add
MMI_FRM_SMS_APP_BIZINBOX = 0x400,// add
[...]
} mmi_frm_sms_app_msgbox_enum;
[\plutommi\mmi\messages\messagesinc\MessagesResourceData.h]
typedef enum
{
[...]
SCR_ID_MSG_BIZBOX_MSG,// add
SCR_ID_MSG_BIZBOX_LIST,// add
MESSAGES_SCR_ID_DEFINES_MAX
} MESSAGES_SCREEN_ENUM;
完整版本请见 http://www.51qianru.cn/bbs/
曙海教育
曙海嵌入式学院3G通信培训中心
(MTK培训,Android培训,iPhone培训)
电话:021-51875830
网址:http://www.51qianru.cn
讲师:李现路
版权所有-曙海教育 转发请注明出处 |