📄 jmmswritemmsui.c
字号:
mmi_jmms_deinit_mms_context(g_jmms_context);
}
else
{
#ifdef __MMI_UNIFIED_MESSAGE__
if(g_jmms_context->message_to_fw == MMI_TRUE)
{
mmi_jmms_deinit_mms_context(g_jmms_context);
}
else
{
#endif
mmi_jmms_free_addresses_list();
mmi_jmms_free_mms_pdu_memory(g_jmms_context);
#ifdef __MMI_UNIFIED_MESSAGE__
}
#endif
}
g_jmms_context->nCurr_scr_hilited_index = 0;
g_jmms_context->nCurr_focused_med_type = 0;
g_jmms_context->num_attachments = 0;
g_jmms_context->nSent_retry_counter = 0;
memset(g_jmms_context->subject_input_buffer, 0x00, (MAX_SUBJECT_LENGTH + 1) * ENCODING_LENGTH);
g_jmms_context->g_write_mms_right_soft_key = STR_GLOBAL_BACK;
}
/*****************************************************************************
* FUNCTION
* mmi_jmms_entry_write_message_screen_in_history
* DESCRIPTION
* Entry fn for Write MMS
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_jmms_entry_write_message_screen_in_history(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
history hist;
historyNode *saved_history;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
memset(&hist, 0, sizeof(history));
hist.scrnID = SCR_ID_JMMS_WRITE_MMS_HISTORY;
hist.entryFuncPtr = mmi_jmms_entry_write_message_screen;
AddHistory(hist);
/* This is a workaround to make sure that if small screen is the current screen on MMI.
Its state is not changed and SCR_ID_JMMS_WRITE_MMS_HISTORY is not saved as small screen */
GetHistoryPointer(SCR_ID_JMMS_WRITE_MMS_HISTORY, &saved_history);
if (saved_history->isSmallScreen == 1)
{
saved_history->isSmallScreen = 0;
set_small_screen();
}
}
/*****************************************************************************
* FUNCTION
* mmi_jmms_entry_write_message_screen
* DESCRIPTION
* Entry fn for Write MMS
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_jmms_entry_write_message_screen(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U8 *guiBuffer;
U8 *inputBuffer; /* added for inline edit history */
U16 inputBufferSize; /* added for inline edit history */
U16 image_list[WRITE_MMS_INLINE_TOTAL] = {0};
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
#ifdef __MMI_UNIFIED_MESSAGE__
mmi_jmms_jdi_deinitview(g_jmms_context->msg_handle);
#endif
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;
}
}
EntryNewScreen(SCR_ID_JMMS_WRITE_MMS, mmi_jmms_exit_write_message, NULL, NULL);
set_leading_zero(FALSE);
guiBuffer = GetCurrGuiBuffer(SCR_ID_JMMS_WRITE_MMS);
InitializeCategory57Screen();
mmi_jmms_write_mms_fill_inline_struct();
RegisterHighlightHandler(mmi_jmms_write_mms_highlight_hdlr);
inputBuffer = GetCurrNInputBuffer(SCR_ID_JMMS_WRITE_MMS, &inputBufferSize); /* added for inline edit history */
if (inputBuffer) /* added for inline edit history */
{
SetCategory57Data(wgui_inline_items, WRITE_MMS_INLINE_TOTAL, inputBuffer); /* sets the data */
}
image_list[E_WRITE_MMS_TO] = IMG_ID_WRITE_MMS_TO;
image_list[E_WRITE_MMS_CC] = IMG_ID_WRITE_MMS_CC;
image_list[E_WRITE_MMS_BCC] = IMG_ID_WRITE_MMS_BCC;
image_list[E_WRITE_MMS_SUBJECT] = IMG_ID_WRITE_MMS_SUBJECT;
image_list[E_WRITE_MMS_ATTACHMENT_CAPTION] = IMG_ID_WRITE_MMS_ATTACHMENT;
image_list[E_WRITE_MMS_EDIT_CONTENT_CAPTION] = IMG_ID_WRITE_MMS_EDIT_CONTENT;
ShowCategory57Screen(
NULL,
GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
NULL,
NULL,
(g_jmms_context->g_write_mms_right_soft_key),
NULL,
WRITE_MMS_INLINE_TOTAL,
image_list,
wgui_inline_items,
0,
guiBuffer);
SetCategory57RightSoftkeyFunctions(mmi_jmms_done_write_mms, GoBackHistory);
// SetKeyHandler(mmi_jmms_free_addresses_list_on_end, KEY_END, KEY_EVENT_DOWN);
}
/*****************************************************************************
* FUNCTION
* mmi_jmms_free_addresses_list_on_end
* DESCRIPTION
* This fn will free the addresses list and retrun back to idle screen
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
/*void mmi_jmms_free_addresses_list_on_end(void)
{
mmi_jmms_free_addresses_list();
DisplayIdleScreen();
}
*/
/*****************************************************************************
* FUNCTION
* mmi_jmms_free_addresses_list
* DESCRIPTION
* This fn will free the addresses(To,Cc,Bcc) list
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_jmms_free_addresses_list(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
jmms_address_list *address_node;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (g_jmms_context->to_address_p != NULL)
{
address_node = g_jmms_context->to_address_p;
while (address_node != NULL)
{
g_jmms_context->to_address_p = address_node->next;
jdd_MemFree(address_node->address);
jdd_MemFree(address_node);
address_node = g_jmms_context->to_address_p;
}
}
g_jmms_context->num_to_addresses = 0;
g_jmms_context->to_address_p = NULL;
address_node = g_jmms_context->cc_address_p;
if (g_jmms_context->cc_address_p != NULL)
{
address_node = g_jmms_context->cc_address_p;
while (address_node != NULL)
{
g_jmms_context->cc_address_p = address_node->next;
jdd_MemFree(address_node->address);
jdd_MemFree(address_node);
address_node = g_jmms_context->cc_address_p;
}
}
g_jmms_context->num_cc_addresses = 0;
g_jmms_context->cc_address_p = NULL;
address_node = g_jmms_context->bcc_address_p;
if (g_jmms_context->bcc_address_p != NULL)
{
address_node = g_jmms_context->bcc_address_p;
while (address_node != NULL)
{
g_jmms_context->bcc_address_p = address_node->next;
jdd_MemFree(address_node->address);
jdd_MemFree(address_node);
address_node = g_jmms_context->bcc_address_p;
}
}
g_jmms_context->num_bcc_addresses = 0;
g_jmms_context->bcc_address_p = NULL;
g_jmms_context->num_total_addresses = 0;
}
/*****************************************************************************
* FUNCTION
* mmi_jmms_write_mms_fill_inline_struct
* DESCRIPTION
* Fills the inline structure for write mms screen
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_jmms_write_mms_fill_inline_struct(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S8 *to_caption = NULL;
S8 *cc_caption = NULL;
S8 *bcc_caption = NULL;
S8 *attachment_caption = g_jmms_context->g_jmms_files_caption_buff;
S8 *slides_caption = g_jmms_context->g_jmms_slide_caption_buff;
S32 len = 0, temp_len = 0;
U8 no_attachments;
/* PMT VIKAS START 20050325 */
S8 str[20];
S8 tempstr[20 * ENCODING_LENGTH] = {0x00};
U8 page_count;
U32 mms_size;
U32 size_kb;
U32 size_bytes;
float32 size_mb =0, size_gb = 0;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
/* PMT VIKAS END 20050325 */
/* TO */
SetInlineItemActivation(&wgui_inline_items[E_WRITE_MMS_TO], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
if (g_jmms_context->num_to_addresses == 0)
{
to_caption = GetString(STR_ID_WRITE_MMS_TO_BLANK_CAPTION);
}
else if (g_jmms_context->num_to_addresses == 1)
{
to_caption = g_jmms_context->to_address_p->address;
}
else
{
to_caption = g_jmms_context->g_jmms_to_caption_buff;
memset(to_caption, 0x00, (MAX_RECIPIENTS_CAPTION_LENGTH + 1) * ENCODING_LENGTH);
sprintf(str, "%d ", g_jmms_context->num_to_addresses);
AnsiiToUnicodeString((PS8) to_caption, (PS8) str);
len = pfnUnicodeStrlen((PS8) to_caption);
temp_len = len;
len = len + pfnUnicodeStrlen((PS8) GetString(STR_ID_JMMS_RECIPIENTS));
if (len > MAX_RECIPIENTS_CAPTION_LENGTH)
{
len = MAX_RECIPIENTS_CAPTION_LENGTH - temp_len;
pfnUnicodeStrncat((S8*) to_caption, (const S8*)GetString(STR_ID_JMMS_RECIPIENTS), len);
}
else
{
pfnUnicodeStrcat((S8*) to_caption, (const S8*)GetString(STR_ID_JMMS_RECIPIENTS));
}
}
SetInlineItemDisplayOnly(&wgui_inline_items[E_WRITE_MMS_TO], (U8*) (to_caption));
/* CC */
SetInlineItemActivation(&wgui_inline_items[E_WRITE_MMS_CC], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
if (g_jmms_context->num_cc_addresses == 0)
{
cc_caption = GetString(STR_ID_WRITE_MMS_CC_BLANK_CAPTION);
}
else if (g_jmms_context->num_cc_addresses == 1)
{
cc_caption = g_jmms_context->cc_address_p->address;
}
else
{
cc_caption = g_jmms_context->g_jmms_cc_caption_buff;
memset(cc_caption, 0x00, (MAX_RECIPIENTS_CAPTION_LENGTH + 1) * ENCODING_LENGTH);
sprintf(str, "%d ", g_jmms_context->num_cc_addresses);
AnsiiToUnicodeString((PS8) cc_caption, (PS8) str);
len = pfnUnicodeStrlen((PS8) cc_caption);
temp_len = len;
len = len + pfnUnicodeStrlen((PS8) GetString(STR_ID_JMMS_RECIPIENTS));
if (len > MAX_RECIPIENTS_CAPTION_LENGTH)
{
len = MAX_RECIPIENTS_CAPTION_LENGTH - temp_len;
pfnUnicodeStrncat((S8*) cc_caption, (const S8*)GetString(STR_ID_JMMS_RECIPIENTS), len);
}
else
{
pfnUnicodeStrcat((S8*) cc_caption, (const S8*)GetString(STR_ID_JMMS_RECIPIENTS));
}
}
SetInlineItemDisplayOnly(&wgui_inline_items[E_WRITE_MMS_CC], (U8*) cc_caption);
/* BCC */
SetInlineItemActivation(&wgui_inline_items[E_WRITE_MMS_BCC], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
if (g_jmms_context->num_bcc_addresses == 0)
{
bcc_caption = GetString(STR_ID_WRITE_MMS_BCC_BLANK_CAPTION);
}
else if (g_jmms_context->num_bcc_addresses == 1)
{
bcc_caption = g_jmms_context->bcc_address_p->address;
}
else
{
bcc_caption = g_jmms_context->g_jmms_bcc_caption_buff;
memset(bcc_caption, 0x00, (MAX_RECIPIENTS_CAPTION_LENGTH + 1) * ENCODING_LENGTH);
sprintf(str, "%d ", g_jmms_context->num_bcc_addresses);
AnsiiToUnicodeString((PS8) bcc_caption, (PS8) str);
len = pfnUnicodeStrlen((PS8) bcc_caption);
temp_len = len;
len = len + pfnUnicodeStrlen((PS8) GetString(STR_ID_JMMS_RECIPIENTS));
if (len > MAX_RECIPIENTS_CAPTION_LENGTH)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -