📄 jmmsinboxui.c
字号:
SetKeyHandler(NULL, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
SetKeyHandler(mmi_jmms_inbox_pre_delete, KEY_WAP, KEY_EVENT_DOWN);
}
/*****************************************************************************
* FUNCTION
* mmi_jmms_highlight_inbox_options_delete_all
* DESCRIPTION
* highlight hdlr of delete all menu item in Inbox options
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_jmms_highlight_inbox_options_delete_all(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
SetLeftSoftkeyFunction(mmi_jmms_inbox_delete_all, KEY_EVENT_UP);
SetKeyHandler(NULL, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
SetKeyHandler(mmi_jmms_inbox_delete_all, KEY_WAP, KEY_EVENT_DOWN);
}
/*****************************************************************************
* FUNCTION
* mmi_jmms_highlight_inbox_options_use_details
* DESCRIPTION
* highlight hdlr of use details menu item in Inbox options
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
#ifdef __MMI_UNIFIED_MESSAGE__
void mmi_jmms_highlight_inbox_options_use_number(void)
#else
void mmi_jmms_highlight_inbox_options_use_details(void)
#endif
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
SetLeftSoftkeyFunction(mmi_jmms_inbox_use_details, KEY_EVENT_UP);
SetKeyHandler(mmi_jmms_inbox_use_details, KEY_SEND, KEY_EVENT_UP);
SetKeyHandler(mmi_jmms_inbox_use_details, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
SetKeyHandler(mmi_jmms_inbox_use_details, KEY_WAP, KEY_EVENT_DOWN);
}
/*****************************************************************************
* FUNCTION
* mmi_jmms_highlight_inbox_options_properties
* DESCRIPTION
* highlight hdlr of properties menu item in Inbox options
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_jmms_highlight_inbox_options_properties(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
SetLeftSoftkeyFunction(mmi_jmms_inbox_properties, KEY_EVENT_UP);
SetKeyHandler(mmi_jmms_inbox_properties, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
SetKeyHandler(mmi_jmms_inbox_properties, KEY_WAP, KEY_EVENT_DOWN);
}
/*****************************************************************************
* FUNCTION
* mmi_jmms_inbox_view
* DESCRIPTION
*
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_jmms_inbox_view(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U8 msg_index = 0;
#ifndef __MMI_UNIFIED_MESSAGE__
U8 index = 0;
#endif
jmms_folder_msgs_list *node = NULL;
MMI_BOOL is_msg_read = MMI_TRUE;
JC_RETCODE eRet = JC_OK;
CONTENT_DATA Content = {0, };
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
node = g_jmms_context->store_context->messages_list;
#ifdef __MMI_UNIFIED_MESSAGE__
while (node != NULL)
{
if (node->msg_index == g_jmms_context->nCurr_scr_hilited_index)
{
break;
}
node = node->next;
}
if (node == NULL)
{
return;
}
#else /* __MMI_UNIFIED_MESSAGE__ */
while (index < g_jmms_context->nCurr_scr_hilited_index)
{
node = node->next;
index++;
}
#endif /* __MMI_UNIFIED_MESSAGE__ */
/* /set the msg status as read if first time read */
msg_index = g_jmms_context->store_context->nMsgs_in_Current_folder - g_jmms_context->nCurr_scr_hilited_index;
msg_index = msg_index - 1;
is_msg_read = mmi_jmms_is_msg_read(msg_index);
#ifdef __MMI_UNIFIED_MESSAGE__
if ((is_msg_read == MMI_FALSE) && node->msg_type != E_MSG_NOTIFICATION && node->msg_type != E_MSG_JAVA_MESSAGE)
#else
if (is_msg_read == MMI_FALSE)
#endif
{
mmi_jmms_set_msg_as_read(msg_index);
}
//TODO:: need to test read report PDU and Delivery Report PDU
///currently not able to save these PDUs. Will able to test
///in T3
#ifdef __MMI_UNIFIED_MESSAGE__
if (node->msg_type == E_MSG_DELIVERY_REPORT || node->msg_type == E_MSG_READ_REPORT ||
node->msg_type == E_MSG_NOTIFICATION || node->msg_type == E_MSG_JAVA_MESSAGE)
#else /* __MMI_UNIFIED_MESSAGE__ */
if (node->msg_type == E_MSG_DELIVERY_REPORT || node->msg_type == E_MSG_READ_REPORT)
#endif /* __MMI_UNIFIED_MESSAGE__ */
{
#ifdef __MMI_UNIFIED_MESSAGE__
if (node->msg_type == E_MSG_NOTIFICATION)
{
MMI_BOOL status = mmi_jmms_is_notifiction_in_use((U16)
(g_jmms_context->store_context->nMsgs_in_Current_folder -
g_jmms_context->nCurr_scr_hilited_index));
if (status == MMI_TRUE)
{
DisplayPopup(
(U8*) GetString(STR_ID_JMMS_NOTF_IN_USE),
IMG_GLOBAL_WARNING,
1,
JMMS_POPUP_TIME,
(U8) WARNING_TONE);
return;
}
}
#endif
mmi_jmms_show_mms_properties(node->msg_type, MMI_JMMS_INBOX);
return;
}
else
{
Content.bIsStream = E_TRUE;
eRet = mmi_jmms_get_message(
"Inbox",
&Content,
(g_jmms_context->store_context->nMsgs_in_Current_folder - g_jmms_context->nCurr_scr_hilited_index));
if (eRet != JC_OK)
{
goto END;
}
if (is_msg_read == MMI_FALSE)
{
///it means first time viewing the mms.
///so need to check for read report require to send
mmi_jmms_deinit_mms_context(g_jmms_context);
eRet = mmi_jmms_jdi_parse_msg_buffer(&(g_jmms_context->msg_handle), &Content, E_TYPE_MMS, E_FALSE);
/* Async changes start */
while (eRet == JC_ERR_MMS_PARSE_PENDING)
{
eRet = mmi_jmms_jdi_msg_parse_continue(g_jmms_context->msg_handle);
};
/* Async changes end */
if (JC_OK != eRet)
{
goto END;
}
eRet = mmi_jmms_jdi_get_msg_headers(
g_jmms_context->msg_handle,
(MESSAGE_HEADERS **) (&(g_jmms_context->MsgHeaders_p)));
if (JC_OK != eRet)
{
goto END;
}
g_jmms_context->MsgHeader_type_p =
(MESSAGE_RETRIEVAL*) ((MESSAGE_HEADERS*) g_jmms_context->MsgHeaders_p)->pHeaders;
g_jmms_context->last_scr_id = SCR_ID_JMMS_INBOX_OPTIONS;
g_jmms_context->mms_index =
g_jmms_context->store_context->nMsgs_in_Current_folder - g_jmms_context->nCurr_scr_hilited_index;
g_jmms_context->is_unread_msg_deleted = 0;
#ifdef __MMI_UNIFIED_MESSAGE__
g_jmms_context->show_property_screen = MMI_FALSE;
#endif
mmi_jmms_handle_read_report(g_jmms_context->MsgHeader_type_p);
}
else
{
/* /TODO:: to be added by deeapali */
g_jmms_context->last_scr_id = SCR_ID_JMMS_INBOX_OPTIONS;
#ifdef __MMI_UNIFIED_MESSAGE__
mmi_jmms_deinit_view();
#endif
eRet = mmi_jmms_pre_entry_mms_view(&Content);
if (eRet == JC_ERR_MMS_PARSE_PENDING)
{
return;
}
}
}
END:
if (eRet != JC_OK && g_jmms_context->msg_handle != NULL)
{
eRet = mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
g_jmms_context->msg_handle = NULL;
}
if (eRet != JC_OK)
{
DisplayPopup((U8*) GetString(STR_GLOBAL_ERROR), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, (U8) ERROR_TONE);
}
}
/*****************************************************************************
* FUNCTION
* mmi_jmms_inbox_reply
* DESCRIPTION
*
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_jmms_inbox_reply(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
mmi_jmms_reply_message(E_FALSE);
}
/*****************************************************************************
* FUNCTION
* mmi_jmms_inbox_reply_all
* DESCRIPTION
*
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_jmms_inbox_reply_all(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
mmi_jmms_reply_message(E_TRUE);
}
/*****************************************************************************
* FUNCTION
* mmi_jmms_reply_message
* DESCRIPTION
*
* PARAMETERS
* bReplyAll [IN]
* RETURNS
* void
*****************************************************************************/
void mmi_jmms_reply_message(JC_BOOLEAN bReplyAll)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
CONTENT_DATA Content = {0, };
MSG_HANDLE hTempMsg = NULL;
S8 *temp_str = NULL;
S8 *str = NULL;
S32 len = 0;
S32 start_index = 0;
JC_RETCODE eRet = JC_OK;
U8 ret = 0;
MESSAGE_HEADERS *pMsgHeaders = NULL;
MESSAGE_SEND *send_p = NULL;
MMI_BOOL is_email = MMI_FALSE;
S32 len_to_copy = 0;
U8 number = 0;
MMI_BOOL is_duplicate = MMI_FALSE;
#if 0
/* under construction !*/
/* under construction !*/
#endif
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
number = g_jmms_context->store_context->nMsgs_in_Current_folder;
eRet = jdi_MsgInit(&hTempMsg, NULL);
if (JC_OK != eRet)
{
mmi_jmms_error_handler(eRet);
goto END;
}
Content.bIsStream = E_TRUE;
eRet = mmi_jmms_get_message("Inbox", &Content, (number - g_jmms_context->nCurr_scr_hilited_index));
if (eRet != JC_OK)
{
mmi_jmms_error_handler(eRet);
goto END;
}
if (g_jmms_context->msg_handle != NULL)
{
eRet = mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
g_jmms_context->msg_handle = NULL;
}
#if 0
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif
eRet = mmi_jmms_jdi_msg_reply(hTempMsg, &Content, bReplyAll, &(g_jmms_context->msg_handle));
if (eRet != JC_OK)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -