📄 jmmsdraftsui.c
字号:
eRet = mmi_jmms_jdi_set_creation_mode(g_jmms_context->msg_handle, mmi_jmms_compose_settings_creation_mode());
if (eRet != JC_OK)
{
mmi_jmms_error_handler(eRet);
goto END;
}
eRet = mmi_jmms_jdi_set_msg_type(g_jmms_context->msg_handle, E_TYPE_MMS);
if (eRet != JC_OK)
{
mmi_jmms_error_handler(eRet);
goto END;
}
eRet = mmi_jmms_jdi_set_presentation_type(g_jmms_context->msg_handle, E_PRESENTATION_SMIL);
if (eRet != JC_OK)
{
mmi_jmms_error_handler(eRet);
goto END;
}
eRet = mmi_jmms_jdi_get_msg_headers(g_jmms_context->msg_handle, &pMsgHeaders);
if (eRet != JC_OK || pMsgHeaders == NULL)
{
eRet = JC_ERR_STORE_FILE_CORRUPTED;
mmi_jmms_error_handler(eRet);
goto END;
}
send_p = (MESSAGE_SEND*) (pMsgHeaders->pHeaders);
g_jmms_context->version = (S8*) (send_p->pVersion);
#ifdef __MMI_UNIFIED_MESSAGE__
g_jmms_context->save_mms = MMI_FALSE;
#else
g_jmms_context->save_mms = MMI_TRUE;
#endif
// mmi_jmms_entry_communication_progress_screen();
/******************************************************************************
This part of the function is modified to add the blank slide into the MMS.
Modified By : Raj Kumar Gupta
Date of Modification : July 25, 2006
*****************************************************************************/
mmi_jmms_jdi_get_total_pages(g_jmms_context->msg_handle, &page_count);
if (page_count == 0 && mmi_jmms_compose_settings_auto_sign_status() == E_OFF)
{
MMI_BOOL context_to_free = MMI_FALSE;
JMMS_COMP_ERRCODE err_code = JMMS_COMP_OK;
if(g_jmms_context->compose_context == NULL)
{
g_jmms_context->compose_context =
(jmms_compose_context_struct*) jdd_MemAlloc(sizeof(jmms_compose_context_struct), 1);
if (g_jmms_context->compose_context == NULL)
{
DisplayPopup((PU8) GetString(STR_ID_JMMS_OUT_OF_MEMORY), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, ERROR_TONE);
return;
}
memset( g_jmms_context->compose_context->curr_slide_info.edit_content_buffer,
0,
(JMMS_COMPOSE_TEXT_LENGTH + 1) * ENCODING_LENGTH);
}
DisplayPopupCallBack(
(U8*) GetString(STR_ID_JMMS_ADD_BLANK_SLIDE),
IMG_GLOBAL_WARNING,
1,
JMMS_POPUP_TIME,
(U8) WARNING_TONE,
mmi_jmms_add_blank_slide_popup_callback);
g_jmms_context->compose_context->curr_page_index = 0;
g_jmms_context->compose_context->mms_bg_color = g_jmms_color_RGB_list[COLOR_WHITE];
err_code = mmi_jmms_set_bg_color(g_jmms_context->compose_context->mms_bg_color);
if (JMMS_COMP_OK == err_code)
{
#ifdef MMI_ON_HARDWARE_P
stFontAttribute text_font;
text_font.italic = 0;
text_font.bold = 0;
text_font.size = MEDIUM_FONT;
#endif
mmi_jmms_compose_insert_slide();
#ifdef MMI_ON_HARDWARE_P
if(is_test_sim() == MMI_FALSE)
{
pfnUnicodeStrcpy(
(S8*) g_jmms_context->compose_context->curr_slide_info.edit_content_buffer,
(S8*) GetString(STR_ID_JMMS_BLANK_SLIDE_STRING));
g_jmms_context->disable_warning_popup = 1;
mmi_jmms_compose_add_text((U8) (page_count + 1), &(text_font), g_jmms_color_RGB_list[COLOR_BLACK],1);
g_jmms_context->disable_warning_popup = 0;
}
#endif
}
if (context_to_free == MMI_TRUE)
{
context_to_free = MMI_FALSE;
if (g_jmms_context->compose_context != NULL)
{
jdd_MemFree(g_jmms_context->compose_context);
g_jmms_context->compose_context = NULL;
}
}
return;
}
else
{
g_jmms_context->progress_screen_title = STR_ID_PROGRESS_SENDING;
memset(g_jmms_context->g_jmms_progress_str, 0x00, MAX_PROGRESS_SCREEN_HINT_LEN * ENCODING_LENGTH);
mmi_jmms_entry_communication_progress_screen();
/* PMT VIKAS START 20060325 */
// #ifdef __MMI_MMS_SIGNATURE__
mmi_jmms_insert_auto_signature();
// #endif
}
/*****************************************************************************
End of modification to insert the blank slide into blank MMS.
*****************************************************************************/
/******************************************************************************
This part of the function is modified to make the MMS send process asynch.
Modified By : Raj Kumar Gupta
Date of Modification : 09 June 2006
*****************************************************************************/
/* Register the function that to be execute after the completion of the
encapsulation */
mmi_jmms_add_send_callback_node(mmi_jmms_send_drafts_sent_callback);
mmi_jmms_send_mms(g_jmms_context->msg_handle, E_TYPE_NEW_MMS, E_TRUE, 1, E_TRUE);
DeleteScreenIfPresent(SCR_ID_JMMS_PARSING_PROGRESS);
return;
END:
#ifndef __MMI_UNIFIED_MESSAGE__
if (g_jmms_context->pParseContent != NULL)
{
if (g_jmms_context->pParseContent->pFileName != NULL)
{
jdd_MemFree(g_jmms_context->pParseContent->pFileName);
g_jmms_context->pParseContent->pFileName = NULL;
}
jdd_MemFree(g_jmms_context->pParseContent);
g_jmms_context->pParseContent = NULL;
}
if (eRet != JC_OK)
{
if (g_jmms_context->msg_handle != NULL)
{
mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
g_jmms_context->msg_handle = NULL;
}
}
#endif
DeleteScreenIfPresent(SCR_ID_JMMS_PARSING_PROGRESS);
return;
}
/*****************************************************************************
* FUNCTION
* mmi_jmms_add_blank_slide_popup_callback
* DESCRIPTION
*
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_jmms_add_blank_slide_popup_callback(void)
{
g_jmms_context->progress_screen_title = STR_ID_PROGRESS_SENDING;
memset(g_jmms_context->g_jmms_progress_str, 0x00, MAX_PROGRESS_SCREEN_HINT_LEN * ENCODING_LENGTH);
mmi_jmms_entry_communication_progress_screen();
/* PMT VIKAS START 20060325 */
//#ifdef __MMI_MMS_SIGNATURE__
mmi_jmms_insert_auto_signature();
//#endif
mmi_jmms_add_send_callback_node(mmi_jmms_send_drafts_sent_callback);
mmi_jmms_send_mms(g_jmms_context->msg_handle, E_TYPE_NEW_MMS, E_TRUE, 1, E_TRUE);
DeleteScreenIfPresent(SCR_ID_JMMS_PARSING_PROGRESS);
}
/*****************************************************************************
* FUNCTION
* mmi_jmms_send_drafts_sent_callback
* DESCRIPTION
*
* PARAMETERS
* eRet [IN]
* RETURNS
* void
*****************************************************************************/
void mmi_jmms_send_drafts_sent_callback(JC_RETCODE eRet)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (JC_OK != eRet)
{
/* PMT VIKAS START 20060405 */
// #ifdef __MMI_MMS_SIGNATURE__
mmi_jmms_del_inserted_auto_signature_slide();
// #endif
//PMT VIKAS END 20060405
////DisplayPopup((U8*)GetString(STR_ID_JMMS_ERROR_MMS_SENT) ,IMG_GLOBAL_ERROR, 1,1000,(U8)ERROR_TONE);
if (eRet == E_JMMS_STORAGE_FULL)
{
mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_SENT_STORE_FUL);
}
/* Added by - Raj Kumar Gupta on 31 August, 2006 */
else if(eRet == E_COMMUNICATION_ABORTED)
{
DisplayPopup(
(U8*) GetString(STR_ID_JMMS_COMM_ABORTED),
IMG_GLOBAL_INFO,
1,
JMMS_POPUP_TIME,
(U8) SUCCESS_TONE);
}
else
{
mmi_jmms_handle_pop_up_for_interupt(STR_ID_JMMS_ERROR_MMS_SENT);
}
#ifdef __MMI_UNIFIED_MESSAGE__/* Fixed by Vikram to avoid going to Options screen in case of any error*/
if (IsScreenPresent(SCR_ID_UM_DRAFT))
{
DeleteUptoScrID(SCR_ID_UM_DRAFT);
}
#else
DeleteFromScrUptoScr(SCR_ID_JMMS_PROGRESS, g_jmms_context->last_scr_id);
#endif
mmi_jmms_deinit_mms_context(g_jmms_context);
}
#ifndef __MMI_UNIFIED_MESSAGE__
if (g_jmms_context->pParseContent != NULL)
{
if (g_jmms_context->pParseContent->pFileName != NULL)
{
jdd_MemFree(g_jmms_context->pParseContent->pFileName);
}
jdd_MemFree(g_jmms_context->pParseContent);
g_jmms_context->pParseContent = NULL;
}
if (eRet != JC_OK)
{
if (g_jmms_context->msg_handle != NULL)
{
mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
g_jmms_context->msg_handle = NULL;
}
}
#endif
return;
}
#ifdef __MMI_UNIFIED_MESSAGE__
/*****************************************************************************
* FUNCTION
* mmi_jmms_pre_drafts_edit_message_add_recipients
* DESCRIPTION
*
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_jmms_pre_drafts_edit_message_add_recipients(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
#ifdef __MMI_UNIFIED_MESSAGE__
U8 curr_page = 0;
if(g_jmms_context->msg_handle)
mmi_jmms_jdi_get_current_page_index(g_jmms_context->msg_handle, &curr_page);
g_jmms_context->edit_error_code=JC_OK;
#endif
g_jmms_context->g_use_local_send_setings = 1; // sanjeev 5/1/07
mmi_jmms_edit_message(MMI_JMMS_DRAFTS);
#ifdef __MMI_UNIFIED_MESSAGE__
if(g_jmms_context->edit_error_code!=JC_OK && curr_page>1 && g_jmms_context->msg_handle)
{
gui_lock_double_buffer();
mmi_jmms_jdi_view_event(g_jmms_context->msg_handle, E_VIEW_SET_ACTIVE_SLIDE, &curr_page);
gui_unlock_double_buffer();
}
#endif
}
/*****************************************************************************
* FUNCTION
* mmi_jmms_pre_drafts_edit_message
* DESCRIPTION
*
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_jmms_pre_drafts_edit_message(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
#ifdef __MMI_UNIFIED_MESSAGE__
U8 curr_page = 0;
if(g_jmms_context->msg_handle)
mmi_jmms_jdi_get_current_page_index(g_jmms_context->msg_handle, &curr_page);
g_jmms_context->edit_error_code=JC_OK;
#endif
g_jmms_context->g_use_local_send_setings = 1; // sanjeev 5/1/07
mmi_jmms_edit_message(MMI_JMMS_DRAFTS);
#ifdef __MMI_UNIFIED_MESSAGE__
if(g_jmms_context->edit_error_code!=JC_OK && curr_page>1 && g_jmms_context->msg_handle)
{
gui_lock_double_buffer();
mmi_jmms_jdi_view_event(g_jmms_context->msg_handle, E_VIEW_SET_ACTIVE_SLIDE, &curr_page);
gui_unlock_double_buffer();
}
#endif
}
#endif /* __MMI_UNIFIED_MESSAGE__ */
/*****************************************************************************
* FUNCTION
* mmi_jmms_drafts_edit_message
* DESCRIPTION
*
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
#ifndef __MMI_UNIFIED_MESSAGE__
void mmi_jmms_drafts_edit_message(void)
#else
void mmi_jmms_edit_message(S8 *folder_name)
#endif
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/* CONTENT_DATA Content = {0, }; */
JC_RETCODE eRet = JC_OK;
#ifndef __MMI_UNIFIED_MESSAGE__
JC_INT32 index = 0;
#endif
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
#ifndef __MMI_UNIFIED_MESSAGE__
mmi_jmms_deinit_mms_context(g_jmms_context);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -