JMMSMainMMSUI.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:212k
源码类别:
MTK
开发平台:
C/C++
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2002
- *
- *****************************************************************************/
- /*****************************************************************************
- *
- * Filename:
- * ---------
- * jmms_main_mms_ui.C
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * This is main mms file
- *
- * Author:
- * -------
- * -------
- *
- *============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
- #ifndef _MMI_JMMSSECONDARYMMI_C
- #define _MMI_JMMSSECONDARYMMI_C
- /*****************************************************************************
- * Include
- *****************************************************************************/
- #include "MMI_features.h"
- #if (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT))
- #include "PixtelDataTypes.h"
- #include "Unicodexdcl.h"
- #include "HistoryGprot.h"
- #include "GlobalDefs.h"
- #include "SettingProfile.h"
- #include "DebugInitDef.h"
- #include "CommonScreens.h"
- #include "EventsGprot.h"
- #include "wgui_inputs.h"
- #include "wgui_datetime.h"
- #include "wgui_categories.h"
- #include "wgui_categories_inputs.h"
- #include "MainMenuDef.h"
- #include "JMMSStoreHandling.h"
- #include "JMMSConfig.h"
- #include "JMMSMainMMS.h"
- #include "JMMSUseDetails.h"
- #include "JMMSJSRHandler.h"
- #include <ddl.h>
- #include <jcal.h>
- #include <jcalnet.h>
- #include "jdi_wspdatatype.h"
- #include "jdi_transport.h"
- #include <jdi_communicator.h>
- #include "jdd_memapi.h"
- #include "jdd_fileapi.h"
- #include <MessagingDatatypes.h>
- #include <MessagingAPI.h>
- #ifdef __MMI_USB_SUPPORT__
- #include "USBDeviceGprot.h"
- #endif
- #include "JMMSExdcl.h"
- #include "JBrowserMMIDefs.h"
- #include "MessagesResourceData.h"
- #include "JMMSCoreAPI.h"
- #include "JMMSResEnum.h"
- #include "JMMSCoreAPI.h"
- #include "JMMSDrafts.h"
- #include "JMMSExdcl.h"
- /* /#include "JMMSGdcl.h" */
- #include "JMMSCompose.h"
- #include "JMMSGprot.h"
- #include "JMMSInbox.h"
- #include "JMMSJSRHandler.h"
- #include "JMMSMainMMS.h"
- #include "JMMSMessageSettingsUtils.h"
- #include "JMMSOutbox.h"
- #include "JMMSProtocols.h"
- #include "JMMSPushHandling.h"
- #include "JMMSResEnum.h"
- #include "JMMSSent.h"
- #include "JMMSStoreHandling.h"
- #include "JMMSStructs.h"
- #include "JMMSTemplates.h"
- #include "JMMSUseDetails.h"
- #include "JMMSView.h"
- #include "JMMSWriteMMS.h"
- #include "JSRProts.h"
- #include "miscutils.h"
- #include "DateTimeGprot.h"
- #include "DateTimeType.h"
- #include "JMMSPlutoMMIInterface.h"
- #include "FileSystemDef.h"
- #include "FileMgr.h"
- #include "TimerEvents.h"
- #ifdef __MMI_UNIFIED_MESSAGE__
- #include "UnifiedMessageDef.h"
- #include "UnifiedMessageProt.h"
- #include "JMMSUMHandling.h"
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- /*****************************************************************************
- * Define
- *****************************************************************************/
- /*****************************************************************************
- * Typedef
- *****************************************************************************/
- /*****************************************************************************
- * Local Variable
- *****************************************************************************/
- /*****************************************************************************
- * Local Function
- *****************************************************************************/
- void mmi_jmms_reset_fw_flag_of_message(void);
- /*****************************************************************************
- * Global Variable
- *****************************************************************************/
- /*****************************************************************************
- * Global Function
- *****************************************************************************/
- extern int wap_is_ready(void);
- extern jdd_MemSetActiveModuleID(ETaskID taskId);
- #ifndef __MMI_UNIFIED_MESSAGE__
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_highlight_main_mms
- * DESCRIPTION
- * This function is gihlight handler of main MMS menu item.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_highlight_main_mms(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- SetLeftSoftkeyFunction(mmi_jmms_entry_main_menu, KEY_EVENT_UP);
- SetKeyHandler(mmi_jmms_entry_main_menu, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_jmms_entry_main_menu, KEY_WAP, KEY_EVENT_DOWN);
- } /* end of mmi_mms_highlight_main_mms */
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_main_mms_init
- * DESCRIPTION
- * This function init the hilight handlers of main MMS menu items.
- * This is called at boot up time
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_main_mms_init(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetHiliteHandler(MENU_ID_JMMS_WRITE_MESSAGE, mmi_jmms_highlight_write_message);
- SetHiliteHandler(MENU_ID_JMMS_INBOX, mmi_jmms_highlight_inbox);
- SetHiliteHandler(MENU_ID_JMMS_OUTBOX, mmi_jmms_highlight_outbox);
- SetHiliteHandler(MENU_ID_JMMS_SENT, mmi_jmms_highlight_sent);
- SetHiliteHandler(MENU_ID_JMMS_DRAFTS, mmi_jmms_highlight_drafts);
- SetHiliteHandler(MENU_ID_JMMS_TEMPLATES, mmi_jmms_highlight_templates);
- SetHiliteHandler(MENU_ID_JMMS_MMS_SETTINGS, mmi_jmms_highlight_messages_settings);
- SetHintHandler(MENU_ID_JMMS_INBOX, mmi_jmms_hint_inbox);
- SetHintHandler(MENU_ID_JMMS_OUTBOX, mmi_jmms_hint_outbox);
- SetHintHandler(MENU_ID_JMMS_SENT, mmi_jmms_hint_sent);
- SetHintHandler(MENU_ID_JMMS_DRAFTS, mmi_jmms_hint_drafts);
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_entry_main_menu
- * DESCRIPTION
- * This is the entry fn for main mms screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_entry_main_menu(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PU8 gui_buffer; /* Buffer holding history data */
- U16 str_item_list[MAX_SUB_MENUS]; /* Stores the strings id of submenus returned */
- U16 num_item; /* Stores no of children in the submenu */
- U16 item_icons[MAX_SUB_MENUS];
- PU8 popup_list[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!wap_is_ready())
- {
- DisplayPopup((U8*) GetString(STR_ID_BRW_WAP_NOT_READY), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, (U8) ERROR_TONE);
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "JMMS: WAP is not ready"));
- return;
- }
- if(g_jmms_context->init_done == JMMS_READY_WITHOUT_STORE)
- {
- DisplayPopup((U8*) GetString(STR_ID_JMMS_MEMORY_FULL), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, (U8) ERROR_TONE);
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "JMMS: Store is not ready"));
- return;
- }
- jdd_MemSetActiveModuleID(E_TASK_MMS_UI);
- EntryNewScreen(SCR_ID_JMMS_MAIN_MENU, NULL, mmi_jmms_entry_main_menu, NULL);
- mmi_jmms_reset_fw_flag_of_message();
- gui_buffer = GetCurrGuiBuffer(SCR_ID_JMMS_MAIN_MENU);
- num_item = GetNumOfChild(MESSAGES_MENU_MMS_MENUID);
- GetSequenceStringIds_Ext(MESSAGES_MENU_MMS_MENUID, str_item_list);
- GetSequenceImageIds_Ext(MESSAGES_MENU_MMS_MENUID, item_icons);
- SetParentHandler(MESSAGES_MENU_MMS_MENUID);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ConstructHintsList(MESSAGES_MENU_MMS_MENUID, popup_list);
- /* reset the open msg status- for At delete */
- g_jmms_context->msg_open_status[0] = 0;
- g_jmms_context->msg_open_status[1] = 0;
- g_jmms_context->nCurr_scr_hilited_index = 0;
- ShowCategory52Screen(
- STR_MMS_MENUENTRY,
- GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- num_item,
- str_item_list,
- item_icons,
- (U8 **) popup_list,
- 0,
- 0,
- gui_buffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- mmi_jmms_delete_compose_temp_files();
- }
- #ifndef __MMI_UNIFIED_MESSAGE__
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_exit_main_menu
- * DESCRIPTION
- * THis is the exit fn for main mms screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_exit_main_menu(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* /deinit_the store_module(gmsgcontext->store handle) */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_hint_inbox
- * DESCRIPTION
- * This is the hint handler of inbox menu item
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_hint_inbox(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 value[10];
- U8 number = 0;
- JC_RETCODE eRet = JC_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- eRet = mmi_mms_get_number_of_messages(MMI_JMMS_INBOX, &number);
- if (eRet != JC_OK)
- {
- number = 0;
- }
- /* MAUI_00018221 Start */
- memset((PS8) hintData[index], 0, sizeof(hintData[index]));// sanjeev added
- sprintf((S8*) value, "%d ", number);
- AnsiiToUnicodeString((S8*) hintData[index], (S8*) value);
- pfnUnicodeStrcat((PS8) hintData[index], (S8*) GetString(STR_ID_JMMS_MSGS));
- /* MAUI_00018221 End */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_hint_outbox
- * DESCRIPTION
- * This is the hint handler of outbox menu item
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_hint_outbox(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 value[10];
- U8 number = 0;
- JC_RETCODE eRet = JC_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- eRet = mmi_mms_get_number_of_messages(MMI_JMMS_OUTBOX, &number);
- if (eRet != JC_OK)
- {
- number = 0;
- }
- /* MAUI_00018221 Start */
- memset((PS8) hintData[index], 0, sizeof(hintData[index]));// sanjeev added
- sprintf((S8*) value, "%d ", number);
- AnsiiToUnicodeString((S8*) hintData[index], (S8*) value);
- pfnUnicodeStrcat((PS8) hintData[index], (S8*) GetString(STR_ID_JMMS_MSGS));
- /* MAUI_00018221 End */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_hint_sent
- * DESCRIPTION
- * This is the hint handler of sent menu item
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_hint_sent(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 value[10];
- U8 number = 0;
- JC_RETCODE eRet = JC_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- eRet = mmi_mms_get_number_of_messages(MMI_JMMS_SENT, &number);
- if (eRet != JC_OK)
- {
- number = 0;
- }
- /* MAUI_00018221 Start */
- memset((PS8) hintData[index], 0, sizeof(hintData[index]));// sanjeev added
- sprintf((S8*) value, "%d ", number);
- AnsiiToUnicodeString((S8*) hintData[index], (S8*) value);
- pfnUnicodeStrcat((PS8) hintData[index], (S8*) GetString(STR_ID_JMMS_MSGS));
- /* MAUI_00018221 End */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_hint_drafts
- * DESCRIPTION
- * This is the hint handler of drafts menu item
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_hint_drafts(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 value[10];
- U8 number = 0;
- JC_RETCODE eRet = JC_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- eRet = mmi_mms_get_number_of_messages(MMI_JMMS_DRAFTS, &number);
- if (eRet != JC_OK)
- {
- number = 0;
- }
- /* MAUI_00018221 Start */
- memset((PS8) hintData[index], 0, sizeof(hintData[index]));// sanjeev added
- sprintf((S8*) value, "%d ", number);
- AnsiiToUnicodeString((S8*) hintData[index], (S8*) value);
- pfnUnicodeStrcat((PS8) hintData[index], (S8*) GetString(STR_ID_JMMS_MSGS));
- /* MAUI_00018221 End */
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_folder_list_highlight_hdlr
- * DESCRIPTION
- * This is the highlight handler menu items of main mms screen
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_folder_list_highlight_hdlr(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_jmms_context->nCurr_scr_hilited_index = (U8) index;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_get_folder_msg_list
- * DESCRIPTION
- *
- * PARAMETERS
- * msgs_list [IN]
- * foldername [?] [?] [?]
- * total_num_msgs [IN]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_jmms_get_folder_msg_list(jmms_folder_msgs_list **msgs_list, S8 *foldername, U8 total_num_msgs)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_RETCODE eRet = JC_OK;
- RETRIEVE_FILTERS StoreRetFilter = {0, };
- MESSAGE_LIST *pMessageList = NULL;
- MESSAGE_LIST *pTempMsgList = NULL;
- jmms_folder_msgs_list *msgs_list_node = NULL;
- #ifdef __MMI_UNIFIED_MESSAGE__
- S32 msg_counter = 0;
- um_jmms_attachment_present_list *temp_pending_list_p = NULL;
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StoreRetFilter.uiStartIndex = g_jmms_context->store_context->jmms_start_index;
- StoreRetFilter.eRetrieve = E_RETRIEVE_BY_INDEX;
- if (g_jmms_context->store_context->jmms_start_index <= total_num_msgs)
- {
- if ((StoreRetFilter.uiStartIndex + NUM_MSGS_IN_ONE_UNIT - 1) < total_num_msgs)
- {
- StoreRetFilter.uiNumMessage = NUM_MSGS_IN_ONE_UNIT;
- }
- else
- {
- StoreRetFilter.uiNumMessage = total_num_msgs - StoreRetFilter.uiStartIndex + 1;
- }
- eRet = mmi_jmms_get_messages_list(foldername, &pTempMsgList, &StoreRetFilter);
- if (eRet != JC_OK || pTempMsgList == NULL)
- {
- return JC_ERR_MEMORY_ALLOCATION;
- }
- }
- pMessageList = pTempMsgList;
- #ifdef __MMI_UNIFIED_MESSAGE__
- msg_counter = total_num_msgs; /* StoreRetFilter.uiStartIndex + StoreRetFilter.uiNumMessage - 1; */
- #endif
- while (pMessageList != NULL)
- {
- #ifdef __MMI_UNIFIED_MESSAGE__
- MMI_BOOL is_parsing_check_required = MMI_FALSE;
- #endif
- msgs_list_node = (jmms_folder_msgs_list*) jdd_MemAlloc(sizeof(jmms_folder_msgs_list), 1);
- if (msgs_list_node == NULL)
- {
- return JC_ERR_MEMORY_ALLOCATION;
- }
- #ifdef __MMI_UNIFIED_MESSAGE__
- msgs_list_node->um_msg_info = (mmi_um_msg_info_struct*) jdd_MemAlloc(sizeof(mmi_um_msg_info_struct), 1);
- if (msgs_list_node->um_msg_info == NULL)
- {
- mmi_jmms_free_attacment_pending_status_list();
- temp_pending_list_p = NULL;
- return JC_ERR_MEMORY_ALLOCATION;
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- switch (pMessageList->pMessageHeaders->eMsgType)
- {
- case E_MSG_TYPE_NOTIFICATION:
- {
- MESSAGE_NOTIFICATION *notification_p;
- #ifndef __MMI_UNIFIED_MESSAGE__
- S32 len = 0;
- #endif
- notification_p = (MESSAGE_NOTIFICATION*) (pMessageList->pMessageHeaders->pHeaders);
- msgs_list_node->msg_type = E_MSG_NOTIFICATION;
- if (notification_p->pSubject == NULL)
- {
- #ifdef __MMI_UNIFIED_MESSAGE__
- mmi_um_jmms_add_mms_sub_for_list_info(
- &msgs_list_node->um_msg_info,
- (JC_CHAR*) GetString(STR_ID_NO_SUBJECT),
- (msg_counter - StoreRetFilter.uiStartIndex));
- #else /* __MMI_UNIFIED_MESSAGE__ */
- msgs_list_node->subject_as_caption = (S8*) GetString(STR_ID_NO_SUBJECT);
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- }
- else
- {
- #ifdef __MMI_UNIFIED_MESSAGE__
- mmi_um_jmms_add_mms_sub_for_list_info(
- &msgs_list_node->um_msg_info,
- (JC_CHAR*) (notification_p->pSubject),
- (msg_counter - StoreRetFilter.uiStartIndex));
- #else /* __MMI_UNIFIED_MESSAGE__ */
- len = (pfnUnicodeStrlen((S8*) (notification_p->pSubject)) + 1) * ENCODING_LENGTH;
- if (len > (MAX_SUBJECT_LENGTH * ENCODING_LENGTH))
- {
- len = (MAX_SUBJECT_LENGTH + 1) * ENCODING_LENGTH;
- }
- msgs_list_node->subject_as_caption = (S8*) jdd_MemAlloc(sizeof(S8), len);
- if (msgs_list_node->subject_as_caption == NULL)
- {
- jdd_MemFree(msgs_list_node);
- return JC_ERR_MEMORY_ALLOCATION;
- }
- memcpy(
- (S8*) (msgs_list_node->subject_as_caption),
- (S8*) (notification_p->pSubject),
- len - ENCODING_LENGTH);
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- }
- #ifdef __MMI_UNIFIED_MESSAGE__
- if (notification_p->pFrom != NULL)
- {
- mmi_um_jmms_add_mms_address_for_list_info(
- &msgs_list_node->um_msg_info,
- notification_p->pFrom,
- (msg_counter - StoreRetFilter.uiStartIndex));
- }
- msgs_list_node->um_msg_info->timestamp = (*notification_p).uiReceivedTime;
- is_parsing_check_required = MMI_FALSE;
- #else /* __MMI_UNIFIED_MESSAGE__ */
- if (notification_p->pFrom != NULL)
- {
- len = (pfnUnicodeStrlen((S8*) (notification_p->pFrom)) + 1) * ENCODING_LENGTH;
- msgs_list_node->address_as_hint = (S8*) jdd_MemAlloc(sizeof(S8), len);
- if (msgs_list_node->address_as_hint == NULL)
- {
- jdd_MemFree(msgs_list_node);
- return JC_ERR_MEMORY_ALLOCATION;
- }
- memcpy(
- (S8*) (msgs_list_node->address_as_hint),
- (S8*) (notification_p->pFrom),
- len - ENCODING_LENGTH);
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- break;
- }
- case E_MSG_TYPE_RECEIVE:
- {
- MESSAGE_RETRIEVAL *retrieval_p;
- #ifndef __MMI_UNIFIED_MESSAGE__
- S32 len = 0;
- #endif
- MMI_BOOL is_java_mms = MMI_FALSE;
- retrieval_p = (MESSAGE_RETRIEVAL*) (pMessageList->pMessageHeaders->pHeaders);
- // TODO:: need to test for Java MMS
- #ifdef __MMI_UNIFIED_MESSAGE__
- if ((pMessageList->uiExtraBytes & 0x00FFFFFF) > 0 &&
- (pMessageList->uiExtraBytes & 0x00FFFFFF) < MMI_JMMS_MAX_JAVA_MSG_ID)
- #else /* __MMI_UNIFIED_MESSAGE__ */
- if (pMessageList->uiExtraBytes > 0 && pMessageList->uiExtraBytes < MMI_JMMS_MAX_JAVA_MSG_ID)
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- {
- is_java_mms = MMI_TRUE;
- }
- /* is_java_mms = mmi_jsr_is_java_msg(pMessageList->uiExtraBytes); */
- if (is_java_mms == MMI_TRUE)
- {
- msgs_list_node->msg_type = E_MSG_JAVA_MESSAGE;
- #ifdef __MMI_UNIFIED_MESSAGE__
- is_parsing_check_required = MMI_FALSE;
- #endif
- }
- else
- {
- msgs_list_node->msg_type = E_MSG_RECEIVE;
- #ifdef __MMI_UNIFIED_MESSAGE__
- is_parsing_check_required = MMI_TRUE;
- #endif
- }
- #ifdef __MMI_UNIFIED_MESSAGE__
- if (retrieval_p->pSubject == NULL)
- {
- mmi_um_jmms_add_mms_sub_for_list_info(
- &msgs_list_node->um_msg_info,
- (JC_CHAR*) GetString(STR_ID_NO_SUBJECT),
- (msg_counter - StoreRetFilter.uiStartIndex));
- }
- else
- {
- mmi_um_jmms_add_mms_sub_for_list_info(
- &msgs_list_node->um_msg_info,
- retrieval_p->pSubject,
- (msg_counter - StoreRetFilter.uiStartIndex));
- }
- #else /* __MMI_UNIFIED_MESSAGE__ */
- if (retrieval_p->pSubject == NULL)
- {
- msgs_list_node->subject_as_caption = (S8*) GetString(STR_ID_NO_SUBJECT);
- }
- else
- {
- len = (pfnUnicodeStrlen((S8*) (retrieval_p->pSubject)) + 1) * ENCODING_LENGTH;
- if (len > (MAX_SUBJECT_LENGTH * ENCODING_LENGTH))
- {
- len = (MAX_SUBJECT_LENGTH + 1) * ENCODING_LENGTH;
- }
- msgs_list_node->subject_as_caption = (S8*) jdd_MemAlloc(sizeof(S8), len);
- if (msgs_list_node->subject_as_caption == NULL)
- {
- jdd_MemFree(msgs_list_node);
- return JC_ERR_MEMORY_ALLOCATION;
- }
- memcpy(
- (S8*) (msgs_list_node->subject_as_caption),
- (S8*) (retrieval_p->pSubject),
- len - ENCODING_LENGTH);
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- #ifdef __MMI_UNIFIED_MESSAGE__
- if (retrieval_p->pFrom != NULL)
- {
- mmi_um_jmms_add_mms_address_for_list_info(
- &msgs_list_node->um_msg_info,
- retrieval_p->pFrom,
- (msg_counter - StoreRetFilter.uiStartIndex));
- }
- msgs_list_node->um_msg_info->timestamp = retrieval_p->uiDate;
- #else /* __MMI_UNIFIED_MESSAGE__ */
- if (retrieval_p->pFrom != NULL)
- {
- len = (pfnUnicodeStrlen((S8*) (retrieval_p->pFrom)) + 1) * ENCODING_LENGTH;
- msgs_list_node->address_as_hint = (S8*) jdd_MemAlloc(sizeof(S8), len);
- if (msgs_list_node->address_as_hint == NULL)
- {
- jdd_MemFree(msgs_list_node);
- return JC_ERR_MEMORY_ALLOCATION;
- }
- memcpy(
- (S8*) (msgs_list_node->address_as_hint),
- (S8*) (retrieval_p->pFrom),
- len - ENCODING_LENGTH);
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- break;
- }
- case E_MSG_TYPE_DELIVERY_REPORT:
- {
- #ifdef __MMI_UNIFIED_MESSAGE__
- DELIVERY_REPORT *delivery_p;
- delivery_p = (DELIVERY_REPORT*) (pMessageList->pMessageHeaders->pHeaders);
- mmi_um_jmms_add_mms_sub_for_list_info(
- &msgs_list_node->um_msg_info,
- (JC_CHAR*) GetString(STR_ID_JMMS_DELIVERY_REPORT),
- (msg_counter - StoreRetFilter.uiStartIndex));
- msgs_list_node->um_msg_info->timestamp = delivery_p->uiDate;
- is_parsing_check_required = MMI_FALSE;
- #else /* __MMI_UNIFIED_MESSAGE__ */
- msgs_list_node->subject_as_caption = (S8*) GetString(STR_ID_JMMS_DELIVERY_REPORT);
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- msgs_list_node->msg_type = E_MSG_DELIVERY_REPORT;
- break;
- }
- case E_MSG_TYPE_READ_REPORT_RESPONSE:
- {
- #ifdef __MMI_UNIFIED_MESSAGE__
- READ_REPORT_RESPONSE *read_report_p;
- read_report_p = (READ_REPORT_RESPONSE*) (pMessageList->pMessageHeaders->pHeaders);
- mmi_um_jmms_add_mms_sub_for_list_info(
- &msgs_list_node->um_msg_info,
- (JC_CHAR*) GetString(STR_ID_SETTINGS_READ_REPORT),
- (msg_counter - StoreRetFilter.uiStartIndex));
- if (read_report_p->pFrom != NULL)
- {
- mmi_um_jmms_add_mms_address_for_list_info(
- &msgs_list_node->um_msg_info,
- read_report_p->pFrom,
- (msg_counter - StoreRetFilter.uiStartIndex));
- }
- msgs_list_node->um_msg_info->timestamp = (*read_report_p).uiReceivedTime;
- is_parsing_check_required = MMI_FALSE;
- #else /* __MMI_UNIFIED_MESSAGE__ */
- msgs_list_node->subject_as_caption = (S8*) GetString(STR_ID_SETTINGS_READ_REPORT);
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- msgs_list_node->msg_type = E_MSG_READ_REPORT;
- break;
- }
- case E_MSG_TYPE_SEND:
- {
- MESSAGE_SEND *send_p;
- #ifndef __MMI_UNIFIED_MESSAGE__
- S32 len = 0;
- #endif
- send_p = (MESSAGE_SEND*) (pMessageList->pMessageHeaders->pHeaders);
- #ifdef __MMI_UNIFIED_MESSAGE__
- if (send_p->pSubject == NULL)
- {
- mmi_um_jmms_add_mms_sub_for_list_info(
- &msgs_list_node->um_msg_info,
- (JC_CHAR*) GetString(STR_ID_NO_SUBJECT),
- (msg_counter - StoreRetFilter.uiStartIndex));
- }
- else
- {
- mmi_um_jmms_add_mms_sub_for_list_info(
- &msgs_list_node->um_msg_info,
- send_p->pSubject,
- (msg_counter - StoreRetFilter.uiStartIndex));
- }
- if(send_p->uiDate != 0)
- {
- msgs_list_node->um_msg_info->timestamp = send_p->uiDate;
- }
- else
- {
- U32 extra_byte_1 = 0;
- JC_RETCODE eRet1;
- msgs_list_node->um_msg_info->timestamp = 0;
- // Deepali: PMTSW00004395
- eRet1 = mmi_jmms_jdi_store_get_extra_byte_1(g_jmms_context->hStoreHandle, (total_num_msgs - (msg_counter - StoreRetFilter.uiStartIndex)), &extra_byte_1);
- if(eRet1 == JC_OK)
- {
- msgs_list_node->um_msg_info->timestamp = extra_byte_1;
- }
- }
- mmi_um_jmms_create_new_mms_hint_for_sent(
- &msgs_list_node->um_msg_info,
- send_p->pTo,
- send_p->pCc,
- send_p->pBcc,
- (msg_counter - StoreRetFilter.uiStartIndex));
- is_parsing_check_required = MMI_TRUE;
- #else /* __MMI_UNIFIED_MESSAGE__ */
- if (send_p->pSubject == NULL)
- {
- msgs_list_node->subject_as_caption = (S8*) GetString(STR_ID_NO_SUBJECT);
- }
- else
- {
- len = (pfnUnicodeStrlen((S8*) (send_p->pSubject)) + 1) * ENCODING_LENGTH;
- if (len > (MAX_SUBJECT_LENGTH * ENCODING_LENGTH))
- {
- len = (MAX_SUBJECT_LENGTH + 1) * ENCODING_LENGTH;
- }
- msgs_list_node->subject_as_caption = (S8*) jdd_MemAlloc(sizeof(S8), len);
- if (msgs_list_node->subject_as_caption == NULL)
- {
- jdd_MemFree(msgs_list_node);
- return JC_ERR_MEMORY_ALLOCATION;
- }
- memcpy(
- (S8*) (msgs_list_node->subject_as_caption),
- (S8*) (send_p->pSubject),
- len - ENCODING_LENGTH);
- }
- mmi_jmms_create_new_mms_hint(&msgs_list_node, send_p->pTo, send_p->pCc, send_p->pBcc);
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- break;
- }
- } /* /end of switch */
- #ifdef __MMI_UNIFIED_MESSAGE__
- /* Attachment handling */
- if ((pMessageList->uiExtraBytes) >> 24 == 0 && MMI_TRUE == is_parsing_check_required)
- {
- temp_pending_list_p =
- (um_jmms_attachment_present_list*) jdd_MemAlloc(sizeof(um_jmms_attachment_present_list), 1);
- if (temp_pending_list_p == NULL)
- {
- mmi_jmms_free_attacment_pending_status_list();
- return JC_ERR_MEMORY_ALLOCATION;
- }
- temp_pending_list_p->index_to_parse = msg_counter - StoreRetFilter.uiStartIndex;
- temp_pending_list_p->next = NULL;
- mmi_um_jmms_add_new_node_attachment_pending_list(temp_pending_list_p);
- msgs_list_node->attachment_status = 0;
- }
- else
- {
- if (((*pMessageList).uiExtraBytes) >> 24 == 0 && MMI_FALSE == is_parsing_check_required)
- {
- msgs_list_node->attachment_status = E_JMMS_ATTACHMENT_NOT_PRESENT;
- }
- else
- {
- msgs_list_node->attachment_status = ((*pMessageList).uiExtraBytes) >> 24; /* attachment_status */
- }
- }
- /* Attachment handling End */
- msgs_list_node->um_msg_info->msg_index = msg_counter - StoreRetFilter.uiStartIndex;
- msgs_list_node->msg_index = msgs_list_node->um_msg_info->msg_index;
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- if ((*msgs_list) == NULL)
- {
- *msgs_list = msgs_list_node;
- msgs_list_node = NULL;
- }
- else
- {
- #ifdef __MMI_UNIFIED_MESSAGE__
- /* To sort the message list on bases of timestamp */
- if (msgs_list_node->um_msg_info->timestamp > (*msgs_list)->um_msg_info->timestamp)
- {
- jmms_folder_msgs_list *temp;
- temp = (*msgs_list);
- *msgs_list = msgs_list_node;
- (*msgs_list)->next = temp;
- msgs_list_node = NULL;
- }
- else
- {
- jmms_folder_msgs_list *temp_message_list = NULL;
- jmms_folder_msgs_list *temp = NULL, *prev = NULL;
- temp_message_list = (*msgs_list);
- while (temp_message_list != NULL)
- {
- if (msgs_list_node->um_msg_info->timestamp > temp_message_list->um_msg_info->timestamp)
- {
- break;
- }
- prev = temp_message_list;
- temp_message_list = temp_message_list->next;
- }
- temp = temp_message_list;
- prev->next = msgs_list_node;
- msgs_list_node->next = temp;
- msgs_list_node = NULL;
- }
- #else /* __MMI_UNIFIED_MESSAGE__ */
- ///implement the link list as stack so that last msg can be shown
- //as first
- jmms_folder_msgs_list *temp;
- temp = (*msgs_list);
- *msgs_list = msgs_list_node;
- (*msgs_list)->next = temp;
- msgs_list_node = NULL;
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- }
- #ifdef __MMI_UNIFIED_MESSAGE__
- msg_counter--;
- #endif
- pMessageList = pMessageList->pNext;
- }
- if ((StoreRetFilter.uiStartIndex + StoreRetFilter.uiNumMessage - 1) >= total_num_msgs)
- {
- #ifndef __MMI_UNIFIED_MESSAGE__
- U16 currScrenID = 0;
- currScrenID = GetActiveScreenId();
- if (currScrenID != SCR_ID_JMMS_GET_MSGS_PROGRESS_SCREEN)
- {
- if (strcmp((S8*) MMI_JMMS_INBOX, (S8*) foldername) == 0)
- {
- HistoryReplace(SCR_ID_JMMS_GET_MSGS_PROGRESS_SCREEN, SCR_ID_JMMS_INBOX, mmi_jmms_entry_inbox_screen);
- }
- else if (strcmp((S8*) MMI_JMMS_OUTBOX, (S8*) foldername) == 0)
- {
- HistoryReplace(SCR_ID_JMMS_GET_MSGS_PROGRESS_SCREEN, SCR_ID_JMMS_OUTBOX, mmi_jmms_entry_outbox_screen);
- }
- else if (strcmp((S8*) MMI_JMMS_SENT, (S8*) foldername) == 0)
- {
- HistoryReplace(SCR_ID_JMMS_GET_MSGS_PROGRESS_SCREEN, SCR_ID_JMMS_SENT, mmi_jmms_entry_sent_screen);
- }
- else if (strcmp((S8*) MMI_JMMS_DRAFTS, (S8*) foldername) == 0)
- {
- HistoryReplace(SCR_ID_JMMS_GET_MSGS_PROGRESS_SCREEN, SCR_ID_JMMS_DRAFTS, mmi_jmms_entry_drafts_screen);
- }
- return eRet;
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- #ifdef __MMI_UNIFIED_MESSAGE__
- mmi_um_jmms_folder_list_callback();
- mmi_um_jmms_set_folder_list_callback_function(mmi_um_jmms_dummy_folder_list_callback);
- #else /* __MMI_UNIFIED_MESSAGE__ */
- if (strcmp((S8*) MMI_JMMS_INBOX, (S8*) foldername) == 0)
- {
- mmi_jmms_entry_inbox_screen();
- }
- else if (strcmp((S8*) MMI_JMMS_OUTBOX, (S8*) foldername) == 0)
- {
- mmi_jmms_entry_outbox_screen();
- }
- else if (strcmp((S8*) MMI_JMMS_SENT, (S8*) foldername) == 0)
- {
- mmi_jmms_entry_sent_screen();
- }
- else if (strcmp((S8*) MMI_JMMS_DRAFTS, (S8*) foldername) == 0)
- {
- mmi_jmms_entry_drafts_screen();
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- DeleteScreenIfPresent(SCR_ID_JMMS_GET_MSGS_PROGRESS_SCREEN);
- g_jmms_context->store_context->jmms_start_index = 1;
- }
- else
- {
- g_jmms_context->store_context->jmms_start_index =
- g_jmms_context->store_context->jmms_start_index + StoreRetFilter.uiNumMessage;
- eRet = mmi_jmms_send_get_msg_list_event(foldername, total_num_msgs);
- }
- return eRet;
- }
- #ifndef __MMI_UNIFIED_MESSAGE__
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_create_new_mms_hint
- * DESCRIPTION
- *
- * PARAMETERS
- * node [IN]
- * to [?] [?] [?]
- * cc [?] [?] [?]
- * bcc [?] [?] [?]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_create_new_mms_hint(jmms_folder_msgs_list **node, JC_CHAR *to, JC_CHAR *cc, JC_CHAR *bcc)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 *str = NULL;
- S32 len = 0;
- S32 start_index = 0;
- MMI_BOOL is_email = MMI_FALSE;
- S32 len_to_copy = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (to != NULL)
- {
- str = (S8*) (to);
- len = 0;
- start_index = 0;
- while (((*str) != ';') && ((*str) != ' '))
- {
- if ((*str) == '@')
- {
- is_email = MMI_TRUE;
- }
- len++;
- str = str + ENCODING_LENGTH;
- }
- if (is_email == MMI_FALSE && len > (MAX_POSSIBLE_NUMBER_LENGHT_SENT))
- {
- len_to_copy = MAX_POSSIBLE_NUMBER_LENGHT_SENT;
- }
- else if (is_email == MMI_TRUE && len > (MAX_POSSIBLE_EMAIL_LENGHT_SENT))
- {
- len_to_copy = MAX_POSSIBLE_EMAIL_LENGHT_SENT;
- }
- else
- {
- len_to_copy = len;
- }
- (*node)->address_as_hint = (S8*) jdd_MemAlloc(sizeof(S8), (len_to_copy + 1) * ENCODING_LENGTH);
- if ((*node)->address_as_hint == NULL)
- {
- goto END;
- }
- pfnUnicodeStrncpy((S8*) ((*node)->address_as_hint), (S8*) (to + start_index), len_to_copy);
- return;
- }
- if (cc != NULL)
- {
- str = (S8*) (cc);
- len = 0;
- start_index = 0;
- is_email = MMI_FALSE;
- while (((*str) != ';') && ((*str) != ' '))
- {
- len++;
- if ((*str) == '@')
- {
- is_email = MMI_TRUE;
- }
- str = str + ENCODING_LENGTH;
- }
- if (is_email == MMI_FALSE && len > (MAX_POSSIBLE_NUMBER_LENGHT_SENT))
- {
- len_to_copy = MAX_POSSIBLE_NUMBER_LENGHT_SENT;
- }
- else if (is_email == MMI_TRUE && len > (MAX_POSSIBLE_EMAIL_LENGHT_SENT))
- {
- len_to_copy = MAX_POSSIBLE_EMAIL_LENGHT_SENT;
- }
- else
- {
- len_to_copy = len;
- }
- (*node)->address_as_hint = (S8*) jdd_MemAlloc(sizeof(S8), (len_to_copy + 1) * ENCODING_LENGTH);
- if ((*node)->address_as_hint == NULL)
- {
- goto END;
- }
- pfnUnicodeStrncpy((S8*) ((*node)->address_as_hint), (S8*) (cc + start_index), len_to_copy);
- return;
- }
- /* /Make the BCc Addresses list */
- if (bcc != NULL)
- {
- str = (S8*) (bcc);
- len = 0;
- start_index = 0;
- is_email = MMI_FALSE;
- while (((*str) != ';') && ((*str) != ' '))
- {
- len++;
- if ((*str) == '@')
- {
- is_email = MMI_TRUE;
- }
- str = str + ENCODING_LENGTH;
- }
- if (is_email == MMI_FALSE && len > (MAX_POSSIBLE_NUMBER_LENGHT_SENT))
- {
- len_to_copy = MAX_POSSIBLE_NUMBER_LENGHT_SENT;
- }
- else if (is_email == MMI_TRUE && len > (MAX_POSSIBLE_EMAIL_LENGHT_SENT))
- {
- len_to_copy = MAX_POSSIBLE_EMAIL_LENGHT_SENT;
- }
- else
- {
- len_to_copy = len;
- }
- (*node)->address_as_hint = (S8*) jdd_MemAlloc(sizeof(S8), (len_to_copy + 1) * ENCODING_LENGTH);
- if ((*node)->address_as_hint == NULL)
- {
- goto END;
- }
- pfnUnicodeStrncpy((S8*) ((*node)->address_as_hint), (S8*) (bcc + start_index), len_to_copy);
- return;
- }
- return;
- END:
- mmi_jmms_free_msgs_list(&(g_jmms_context->store_context->messages_list));
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- #ifdef __MMI_UNIFIED_MESSAGE__
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_set_msg_type
- * DESCRIPTION
- *
- * PARAMETERS
- * index [IN]
- * msg_type [IN]
- * RETURNS
- *
- *****************************************************************************/
- U16 mmi_jmms_set_msg_type(U8 index, U16 msg_type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- jmms_folder_msgs_list *msgs_list_node = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgs_list_node = g_jmms_context->store_context->messages_list;
- while (msgs_list_node != NULL)
- {
- if (msgs_list_node->msg_index == index)
- {
- break;
- }
- msgs_list_node = msgs_list_node->next;
- }
- if (msgs_list_node == NULL)
- {
- return E_MSG_UNKNOWN;
- }
- msgs_list_node->msg_type = msg_type;
- return msgs_list_node->msg_type;
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_get_msg_type
- * DESCRIPTION
- *
- * PARAMETERS
- * index [IN]
- * RETURNS
- *
- *****************************************************************************/
- U16 mmi_jmms_get_msg_type(U8 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- jmms_folder_msgs_list *msgs_list_node = NULL;
- #ifndef __MMI_UNIFIED_MESSAGE__
- U8 count = 0;
- #endif
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgs_list_node = g_jmms_context->store_context->messages_list;
- #ifdef __MMI_UNIFIED_MESSAGE__
- while (msgs_list_node != NULL)
- {
- if (msgs_list_node->msg_index == index)
- {
- break;
- }
- msgs_list_node = msgs_list_node->next;
- }
- #else /* __MMI_UNIFIED_MESSAGE__ */
- while (count != index && msgs_list_node != NULL)
- {
- msgs_list_node = msgs_list_node->next;
- count++;
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- if (msgs_list_node == NULL)
- {
- return E_MSG_UNKNOWN;
- }
- return msgs_list_node->msg_type;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_free_msgs_list
- * DESCRIPTION
- *
- * PARAMETERS
- * msgs_list [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_free_msgs_list(jmms_folder_msgs_list **msgs_list)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- jmms_folder_msgs_list *list;
- jmms_folder_msgs_list *list1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- list1 = *msgs_list;
- list = *msgs_list;
- while (list != NULL)
- {
- list1 = list->next;
- #ifdef __MMI_UNIFIED_MESSAGE__
- if (list->um_msg_info != NULL)
- {
- jdd_MemFree(list->um_msg_info);
- list->um_msg_info = NULL;
- }
- #else /* __MMI_UNIFIED_MESSAGE__ */
- if (list->address_as_hint != NULL)
- {
- jdd_MemFree(list->address_as_hint);
- list->address_as_hint = NULL;
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- /* nedd to strcmp all static subjects, Don't call jdd_memfree for them */
- #ifndef __MMI_UNIFIED_MESSAGE__
- if (list->subject_as_caption != NULL
- && (pfnUnicodeStrcmp((S8*) (list->subject_as_caption), (S8*) GetString(STR_ID_NO_SUBJECT)) != 0)
- && (pfnUnicodeStrcmp((S8*) (list->subject_as_caption), (S8*) GetString(STR_ID_JMMS_DELIVERY_REPORT))
- != 0) &&
- (pfnUnicodeStrcmp((S8*) (list->subject_as_caption), (S8*) GetString(STR_ID_SETTINGS_READ_REPORT)) != 0))
- {
- jdd_MemFree(list->subject_as_caption);
- list->subject_as_caption = NULL;
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- jdd_MemFree(list);
- list = NULL;
- list = list1;
- }
- *msgs_list = NULL;
- }
- #ifndef __MMI_UNIFIED_MESSAGE__
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_back_from_msgs_list_screen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_back_from_msgs_list_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_jmms_free_msgs_list(&(g_jmms_context->store_context->messages_list));
- GoBackToHistory(SCR_ID_JMMS_MAIN_MENU);
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_deinit
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_deinit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_deinit Enter"));
- if (g_jmms_context != NULL)
- {
- if(!jmms_is_ready())
- {
- return;
- }
- mmi_jmms_parse_continue_stop_timer();
- mmi_jmms_deinit_view();
- mmi_jmms_end_comm();
- mmi_jmms_deinit_mms_context(g_jmms_context);
- StopTimer(JMMS_ASYNC_SEND_TIMER);
- StopTimer(JMMS_ASYNC_SAVE_TIMER);
- mmi_jmms_clean_send_callback_list();
- mmi_jmms_clean_save_callback_list();
- if (g_jmms_context->orig_file_name_replace_mms)
- {
- jdd_MemFree(g_jmms_context->orig_file_name_replace_mms);
- g_jmms_context->orig_file_name_replace_mms = NULL;
- }
- if (g_jmms_context->store_context != NULL && g_jmms_context->store_context->messages_list != NULL)
- {
- mmi_jmms_free_msgs_list(&(g_jmms_context->store_context->messages_list));
- }
- mmi_jmms_free_use_details_adrresses_list();
- /* free msg headers- properties */
- mmi_jmms_free_recieved_msg_header();
- mmi_jmms_free_notification_header();
- mmi_jmms_free_delivery_report_header();
- mmi_jmms_free_report_report_header();
- mmi_jmms_free_new_mms_sent_header();
- /* reset the open msg status- for At delete */
- g_jmms_context->msg_open_status[0] = 0;
- g_jmms_context->msg_open_status[1] = 0;
- g_jmms_context->is_add_media_warning = 0;
- g_jmms_context->progress_screen_in_history=0;
- }
- PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_deinit Exit"));
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_send_get_msg_list_event
- * DESCRIPTION
- *
- * PARAMETERS
- * foldername [?] [?] [?]
- * total_num_msgs [IN]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_jmms_send_get_msg_list_event(S8 *foldername, U8 total_num_msgs)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_RETCODE eRet = JC_OK;
- JC_EVENT_DATA eventData = {0, };
- mmi_jmms_get_msg_list_queue_event_struct folder_info = {0, };
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- eventData.destTaskInfo.iAppID = E_TASK_MMS_UI;
- eventData.destTaskInfo.iTaskID = E_TASK_MMS_UI;
- eventData.srcTaskInfo.iAppID = E_TASK_MMS_UI;
- eventData.srcTaskInfo.iTaskID = E_TASK_MMS_UI;
- eventData.uiEventInfoSize = sizeof(mmi_jmms_get_msg_list_queue_event_struct);
- eventData.iEventType = E_MMS_GET_MSG_LIST_EVENT;
- if (strcmp((S8*) "Inbox", (S8*) foldername) == 0)
- {
- folder_info.folder_name = E_JMMS_INBOX;
- }
- else if (strcmp((S8*) "Outbox", (S8*) foldername) == 0)
- {
- folder_info.folder_name = E_JMMS_OUTBOX;
- }
- else if (strcmp((S8*) "Sent", (S8*) foldername) == 0)
- {
- folder_info.folder_name = E_JMMS_SENT;
- }
- else if (strcmp((S8*) "Drafts", (S8*) foldername) == 0)
- {
- folder_info.folder_name = E_JMMS_DRAFTS;
- }
- folder_info.total_num_msgs = total_num_msgs;
- eRet = jdd_QueueAlloc(&eventData);
- if (JC_OK != eRet)
- {
- return eRet;
- }
- jc_memcpy(eventData.pEventInfo, &folder_info, sizeof(mmi_jmms_get_msg_list_queue_event_struct));
- eRet = jdd_QueueSend(&eventData);
- if (JC_OK != eRet)
- {
- return eRet;
- }
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_recieve_get_msg_list_event
- * DESCRIPTION
- *
- * PARAMETERS
- * pEventData [?] [?] [?]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_recieve_get_msg_list_event(mmi_jmms_get_msg_list_queue_event_struct *pEventData)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_jmms_get_msg_list_queue_event_struct *folder_info;
- JC_RETCODE eRet = JC_OK;
- U16 currScrenID = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- folder_info = (mmi_jmms_get_msg_list_queue_event_struct*) (pEventData);
- if (folder_info->folder_name == E_JMMS_INBOX)
- {
- eRet = mmi_jmms_get_folder_msg_list(
- &(g_jmms_context->store_context->messages_list),
- MMI_JMMS_INBOX,
- folder_info->total_num_msgs);
- }
- else if (folder_info->folder_name == E_JMMS_OUTBOX)
- {
- eRet = mmi_jmms_get_folder_msg_list(
- &(g_jmms_context->store_context->messages_list),
- MMI_JMMS_OUTBOX,
- folder_info->total_num_msgs);
- }
- else if (folder_info->folder_name == E_JMMS_DRAFTS)
- {
- eRet = mmi_jmms_get_folder_msg_list(
- &(g_jmms_context->store_context->messages_list),
- MMI_JMMS_DRAFTS,
- folder_info->total_num_msgs);
- }
- else if (folder_info->folder_name == E_JMMS_SENT)
- {
- eRet = mmi_jmms_get_folder_msg_list(
- &(g_jmms_context->store_context->messages_list),
- MMI_JMMS_SENT,
- folder_info->total_num_msgs);
- }
- if (eRet != JC_OK)
- {
- currScrenID = GetActiveScreenId();
- mmi_jmms_free_msgs_list(&(g_jmms_context->store_context->messages_list));
- #ifndef __MMI_UNIFIED_MESSAGE__
- if (currScrenID == SCR_ID_JMMS_GET_MSGS_PROGRESS_SCREEN)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_JMMS_ERROR_GET_MSG_LIST),
- IMG_GLOBAL_ERROR,
- 1,
- JMMS_POPUP_TIME,
- (U8) ERROR_TONE);
- DeleteUptoScrID(SCR_ID_JMMS_MAIN_MENU);
- }
- else
- {
- /* to avoid the show of pop up over Phone call or some other screen */
- HistoryReplace(
- SCR_ID_JMMS_GET_MSGS_PROGRESS_SCREEN,
- SCR_ID_JMMS_GET_MSGS_ERROR_SCREEN,
- mmi_jmms_entry_msgs_get_error_screen);
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- }
- return;
- }
- #ifndef __MMI_UNIFIED_MESSAGE__
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_entry_get_msgs_progress_screen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_entry_get_msgs_progress_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_JMMS_GET_MSGS_PROGRESS_SCREEN, NULL, mmi_jmms_entry_get_msgs_progress_screen, NULL);
- // TODO::put an animated image
- ShowCategory8Screen(
- STR_MMS_MENUENTRY,
- GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
- 0,
- 0,
- 0,
- 0,
- STR_ID_JMMS_LOADING_MMS,
- IMG_GLOBAL_PROGRESS,
- NULL);
- ClearAllKeyHandler();
- ClearKeyHandler(KEY_END, KEY_EVENT_UP);
- ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_END, KEY_LONG_PRESS);
- ClearKeyHandler(KEY_END, KEY_REPEAT);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_entry_msgs_get_error_screen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_entry_msgs_get_error_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_JMMS_GET_MSGS_ERROR_SCREEN, NULL, mmi_jmms_entry_msgs_get_error_screen, NULL);
- ShowCategory2Screen(
- STR_MMS_MENUENTRY,
- GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
- 0,
- 0,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- STR_ID_JMMS_ERROR_GET_MSG_LIST,
- NULL);
- SetRightSoftkeyFunction(mmi_jmms_back_from_msgs_list_screen, KEY_EVENT_UP);
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- //PMT VIKAS START 20060325
- //Function store and return the size of MMS base on type pass
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_save_size_of_mms
- * DESCRIPTION
- *
- * PARAMETERS
- * temp_size [?] [?] [?]
- * type [IN]
- * RETURNS
- * void
- *****************************************************************************/
- static void mmi_jmms_save_size_of_mms(S32 *temp_size, S32 type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- static S32 message_size = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (type == MMS_SIZE_STORE)
- {
- message_size = *temp_size;
- }
- else
- {
- *temp_size = message_size;
- }
- }
- /* PMT VIKAS END 20060325 */
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_show_mms_properties
- * DESCRIPTION
- *
- * PARAMETERS
- * msg_type [IN]
- * folder_name [?] [?] [?]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_show_mms_properties(U16 msg_type, S8 *folder_name)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_RETCODE eRet = JC_OK;
- U8 number = 0;
- RETRIEVE_FILTERS StoreRetFilter = {0, };
- MESSAGE_LIST *pMessageList = NULL;
- MESSAGE_LIST *pTempMessageList = NULL;
- U32 extra_byte_1 = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* mmi_mms_get_number_of_messages(folder_name, &number); */
- number = g_jmms_context->store_context->nMsgs_in_Current_folder;
- if(strcmp((S8*)folder_name, (S8*)MMI_JMMS_TEMPLATES) == 0)
- {
- StoreRetFilter.uiStartIndex = g_jmms_context->nCurr_scr_hilited_index + 1;
- }
- else
- {
- StoreRetFilter.uiStartIndex = number - g_jmms_context->nCurr_scr_hilited_index;
- }
- StoreRetFilter.eRetrieve = E_RETRIEVE_BY_INDEX;
- StoreRetFilter.uiNumMessage = 1;
- eRet = mmi_jmms_get_messages_list(folder_name, &pTempMessageList, &StoreRetFilter);
- pMessageList = pTempMessageList;
- if (eRet != JC_OK || pMessageList == NULL)
- {
- mmi_jmms_error_handler(eRet);
- return;
- }
- /* PMT VIKAS START 20060325 */
- mmi_jmms_save_size_of_mms((S32*) & pMessageList->uiBufferLen, MMS_SIZE_STORE);
- /* PMT VIKAS END 20060325 */
- switch (msg_type)
- {
- case E_MSG_NOTIFICATION:
- if (pMessageList->pMessageHeaders->eMsgType != E_MSG_TYPE_NOTIFICATION)
- {
- DisplayPopup((U8*) GetString(STR_GLOBAL_ERROR), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, (U8) ERROR_TONE);
- return;
- }
- /* g_jmms_context->MsgHeader_type_p=(MESSAGE_NOTIFICATION *)(pMessageList->pMessageHeaders->pHeaders); */
- eRet = mmi_jmms_create_notification_header(pMessageList->pMessageHeaders->pHeaders);
- if (eRet != JC_OK)
- {
- mmi_jmms_error_handler(eRet);
- return;
- }
- mmi_jmms_show_notification_properties();
- /* /g_jmms_context->MsgHeader_type_p=NULL; */
- break;
- case E_MSG_RECEIVE:
- if (pMessageList->pMessageHeaders->eMsgType != E_MSG_TYPE_RECEIVE)
- {
- DisplayPopup((U8*) GetString(STR_GLOBAL_ERROR), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, (U8) ERROR_TONE);
- return;
- }
- /* /g_jmms_context->MsgHeader_type_p=(MESSAGE_RETRIEVAL *)(pMessageList->pMessageHeaders->pHeaders); */
- eRet = mmi_jmms_create_recieved_msg_header(pMessageList->pMessageHeaders->pHeaders);
- if (eRet != JC_OK)
- {
- mmi_jmms_error_handler(eRet);
- return;
- }
- mmi_jmms_show_retrieved_mms_properties();
- /* /g_jmms_context->MsgHeader_type_p=NULL; */
- break;
- case E_MSG_JAVA_MESSAGE:
- {
- JC_RETCODE eRet = JC_OK;
- CONTENT_DATA Content = {0, };
- if (pMessageList->pMessageHeaders->eMsgType != E_MSG_TYPE_RECEIVE)
- {
- DisplayPopup((U8*) GetString(STR_GLOBAL_ERROR), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, (U8) ERROR_TONE);
- return;
- }
- Content.bIsStream = E_TRUE;
- eRet = mmi_jmms_get_message("Inbox", &Content, StoreRetFilter.uiStartIndex);
- if (eRet != JC_OK)
- {
- goto CaseEnd;
- }
- #ifdef __MMI_UNIFIED_MESSAGE__
- if (g_jmms_context->msg_handle)
- {
- eRet = mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
- g_jmms_context->msg_handle = NULL;
- }
- #else /* __MMI_UNIFIED_MESSAGE__ */
- mmi_jmms_deinit_mms_context(g_jmms_context);
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- eRet = mmi_jmms_jdi_parse_msg_buffer(&g_jmms_context->msg_handle, &Content, E_TYPE_MMS, E_FALSE);
- /* Async changes begin */
- while (eRet == JC_ERR_MMS_PARSE_PENDING)
- {
- eRet = mmi_jmms_jdi_msg_parse_continue(g_jmms_context->msg_handle);
- };
- /* Async changes end */
- if (eRet != JC_OK)
- {
- goto CaseEnd;
- }
- eRet = mmi_jmms_jdi_get_msg_headers(
- g_jmms_context->msg_handle,
- (MESSAGE_HEADERS **) (&(g_jmms_context->MsgHeaders_p)));
- if (JC_OK != eRet)
- {
- goto CaseEnd;
- }
- g_jmms_context->MsgHeader_type_p =
- (MESSAGE_RETRIEVAL*) ((MESSAGE_HEADERS*) g_jmms_context->MsgHeaders_p)->pHeaders;
- /* umesh end */
- mmi_jmms_entry_java_mms_properties();
- CaseEnd:
- if (Content.pFileName != NULL)
- {
- jdd_MemFree(Content.pFileName);
- Content.pFileName = NULL;
- }
- if (eRet != JC_OK)
- {
- DisplayPopup((U8*) GetString(STR_GLOBAL_ERROR), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, (U8) ERROR_TONE);
- mmi_jmms_deinit_mms_context(g_jmms_context);
- }
- break;
- }
- case E_MSG_DELIVERY_REPORT:
- mmi_jmms_update_status_icon_indicator();
- if (pMessageList->pMessageHeaders->eMsgType != E_MSG_TYPE_DELIVERY_REPORT)
- {
- DisplayPopup((U8*) GetString(STR_GLOBAL_ERROR), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, (U8) ERROR_TONE);
- return;
- }
- /* g_jmms_context->MsgHeader_type_p=(DELIVERY_REPORT *)(pMessageList->pMessageHeaders->pHeaders); */
- eRet = mmi_jmms_create_delivery_report_header(pMessageList->pMessageHeaders->pHeaders);
- if (eRet != JC_OK)
- {
- mmi_jmms_error_handler(eRet);
- return;
- }
- mmi_jmms_entry_view_delivery_report();
- /* /g_jmms_context->MsgHeader_type_p=NULL; */
- break;
- case E_MSG_READ_REPORT:
- mmi_jmms_update_status_icon_indicator();
- if (pMessageList->pMessageHeaders->eMsgType != E_MSG_TYPE_READ_REPORT_RESPONSE)
- {
- DisplayPopup((U8*) GetString(STR_GLOBAL_ERROR), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, (U8) ERROR_TONE);
- return;
- }
- /* /g_jmms_context->MsgHeader_type_p=(READ_REPORT_RESPONSE *)(pMessageList->pMessageHeaders->pHeaders); */
- eRet = mmi_jmms_create_read_report_header(pMessageList->pMessageHeaders->pHeaders);
- if (eRet != JC_OK)
- {
- mmi_jmms_error_handler(eRet);
- return;
- }
- mmi_jmms_entry_view_read_report();
- /* /g_jmms_context->MsgHeader_type_p=NULL; */
- break;
- case E_MSG_NEW_MMS_SEND:
- {
- if (pMessageList->pMessageHeaders->eMsgType != E_MSG_TYPE_SEND)
- {
- DisplayPopup((U8*) GetString(STR_GLOBAL_ERROR), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, (U8) ERROR_TONE);
- return;
- }
- /* /g_jmms_context->MsgHeader_type_p=(MESSAGE_SEND *)(pMessageList->pMessageHeaders->pHeaders); */
- eRet = mmi_jmms_create_new_mms_sent_header(pMessageList->pMessageHeaders->pHeaders);
- if (eRet != JC_OK)
- {
- mmi_jmms_error_handler(eRet);
- return;
- }
- if(g_jmms_context->msg_handle && ((MESSAGING_HANDLER *)g_jmms_context->msg_handle)->mms_file_handle)
- {
- mmi_jmms_jdi_store_get_extra_byte_open_mms(g_jmms_context->hStoreHandle, ((MESSAGING_HANDLER *)g_jmms_context->msg_handle)->mms_file_handle, &extra_byte_1);
- }
- else
- {
- mmi_jmms_jdi_store_get_extra_byte_1(g_jmms_context->hStoreHandle, StoreRetFilter.uiStartIndex, &extra_byte_1);
- }
- if (((MESSAGE_SEND*) (g_jmms_context->send_msg_p))->uiDate == 0)
- {
- ((MESSAGE_SEND*) (g_jmms_context->send_msg_p))->uiDate = extra_byte_1;
- }
- mmi_jmms_entry_new_mms_sent_properties();
- /* /g_jmms_context->MsgHeader_type_p=NULL; */
- break;
- }
- case E_MSG_NEW_MMS_TEMPLATES:
- {
- if (pMessageList->pMessageHeaders->eMsgType != E_MSG_TYPE_SEND)
- {
- DisplayPopup((U8*) GetString(STR_GLOBAL_ERROR), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, (U8) ERROR_TONE);
- return;
- }
- /* /g_jmms_context->MsgHeader_type_p=(MESSAGE_SEND *)(pMessageList->pMessageHeaders->pHeaders); */
- eRet = mmi_jmms_create_new_mms_sent_header(pMessageList->pMessageHeaders->pHeaders);
- if (eRet != JC_OK)
- {
- mmi_jmms_error_handler(eRet);
- return;
- }
- mmi_jmms_entry_new_mms_template_properties();
- /* /g_jmms_context->MsgHeader_type_p=NULL; */
- break;
- }
- default:
- DisplayPopup((U8*) GetString(STR_GLOBAL_ERROR), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, (U8) ERROR_TONE);
- return;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_create_new_mms_sent_header
- * DESCRIPTION
- *
- * PARAMETERS
- * send_msg_header [?] [?] [?]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_jmms_create_new_mms_sent_header(MESSAGE_SEND *send_msg_header)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MESSAGE_SEND *send_msg_p = NULL;
- JC_RETCODE eRet = JC_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- send_msg_p = (MESSAGE_SEND*) jdd_MemAlloc(sizeof(MESSAGE_SEND), 1);
- if (send_msg_p == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- if (send_msg_header->pTo != NULL)
- {
- send_msg_p->pTo = (JC_CHAR*) jdd_MemAlloc(sizeof(JC_CHAR), jc_tcslen(send_msg_header->pTo) + 1);
- if (send_msg_p->pTo == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- jc_tcscpy(send_msg_p->pTo, send_msg_header->pTo);
- }
- if (send_msg_header->pCc != NULL)
- {
- send_msg_p->pCc = (JC_CHAR*) jdd_MemAlloc(sizeof(JC_CHAR), jc_tcslen(send_msg_header->pCc) + 1);
- if (send_msg_p->pCc == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- jc_tcscpy(send_msg_p->pCc, send_msg_header->pCc);
- }
- if (send_msg_header->pBcc != NULL)
- {
- send_msg_p->pBcc = (JC_CHAR*) jdd_MemAlloc(sizeof(JC_CHAR), jc_tcslen(send_msg_header->pBcc) + 1);
- if (send_msg_p->pBcc == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- jc_tcscpy(send_msg_p->pBcc, send_msg_header->pBcc);
- }
- if (send_msg_header->pSubject != NULL)
- {
- send_msg_p->pSubject = (JC_CHAR*) jdd_MemAlloc(sizeof(JC_CHAR), jc_tcslen(send_msg_header->pSubject) + 1);
- if (send_msg_p->pSubject == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- jc_tcscpy(send_msg_p->pSubject, send_msg_header->pSubject);
- }
- send_msg_p->eMsgPriority = send_msg_header->eMsgPriority;
- send_msg_p->eMsgClass = send_msg_header->eMsgClass;
- send_msg_p->uiDate = send_msg_header->uiDate;
- g_jmms_context->send_msg_p = (MESSAGE_SEND*) (send_msg_p);
- ERROR_HANDLE:
- if (eRet != JC_OK && send_msg_p != NULL)
- {
- mmi_jmms_free_new_mms_sent_header();
- }
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_free_new_mms_sent_header
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_free_new_mms_sent_header(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MESSAGE_SEND *send_msg_p = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- send_msg_p = (MESSAGE_SEND*) g_jmms_context->send_msg_p;
- if (send_msg_p == NULL)
- {
- return;
- }
- if (send_msg_p->pTo != NULL)
- {
- jdd_MemFree(send_msg_p->pTo);
- send_msg_p->pTo = NULL;
- }
- if (send_msg_p->pCc != NULL)
- {
- jdd_MemFree(send_msg_p->pCc);
- send_msg_p->pCc = NULL;
- }
- if (send_msg_p->pBcc != NULL)
- {
- jdd_MemFree(send_msg_p->pBcc);
- send_msg_p->pBcc = NULL;
- }
- if (send_msg_p->pSubject != NULL)
- {
- jdd_MemFree(send_msg_p->pSubject);
- send_msg_p->pSubject = NULL;
- }
- jdd_MemFree(send_msg_p);
- send_msg_p = NULL;
- g_jmms_context->send_msg_p = NULL;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_create_read_report_header
- * DESCRIPTION
- *
- * PARAMETERS
- * read_report_header [?] [?] [?]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_jmms_create_read_report_header(READ_REPORT_RESPONSE *read_report_header)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- READ_REPORT_RESPONSE *read_report_p = NULL;
- JC_RETCODE eRet = JC_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- read_report_p = (READ_REPORT_RESPONSE*) jdd_MemAlloc(sizeof(READ_REPORT_RESPONSE), 1);
- if (read_report_p == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- read_report_p->eReadStatus = read_report_header->eReadStatus;
- if (read_report_header->pTo != NULL)
- {
- read_report_p->pTo = (JC_CHAR*) jdd_MemAlloc(sizeof(JC_CHAR), jc_tcslen(read_report_header->pTo) + 1);
- if (read_report_p->pTo == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- jc_tcscpy(read_report_p->pTo, read_report_header->pTo);
- }
- if (read_report_header->pFrom != NULL)
- {
- read_report_p->pFrom = (JC_CHAR*) jdd_MemAlloc(sizeof(JC_CHAR), jc_tcslen(read_report_header->pFrom) + 1);
- if (read_report_p->pFrom == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- jc_tcscpy(read_report_p->pFrom, read_report_header->pFrom);
- }
- if (read_report_header->pMessageID != NULL)
- {
- read_report_p->pMessageID = (JC_INT8*) jdi_UtilsStrdup(read_report_header->pMessageID);
- }
- read_report_p->uiReceivedTime = read_report_header->uiReceivedTime;
- g_jmms_context->read_report_p = (READ_REPORT_RESPONSE*) (read_report_p);
- ERROR_HANDLE:
- if (eRet != JC_OK && read_report_p != NULL)
- {
- mmi_jmms_free_report_report_header();
- }
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_free_report_report_header
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_free_report_report_header(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- READ_REPORT_RESPONSE *read_report_p = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- read_report_p = (READ_REPORT_RESPONSE*) g_jmms_context->read_report_p;
- if (read_report_p == NULL)
- {
- return;
- }
- if (read_report_p->pTo != NULL)
- {
- jdd_MemFree(read_report_p->pTo);
- read_report_p->pTo = NULL;
- }
- if (read_report_p->pFrom != NULL)
- {
- jdd_MemFree(read_report_p->pFrom);
- read_report_p->pFrom = NULL;
- }
- if (read_report_p->pMessageID != NULL)
- {
- jdd_MemFree(read_report_p->pMessageID);
- read_report_p->pMessageID = NULL;
- }
- jdd_MemFree(read_report_p);
- read_report_p = NULL;
- g_jmms_context->read_report_p = NULL;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_create_delivery_report_header
- * DESCRIPTION
- *
- * PARAMETERS
- * delivery_header [?] [?] [?]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_jmms_create_delivery_report_header(DELIVERY_REPORT *delivery_header)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- DELIVERY_REPORT *delivery_p = NULL;
- JC_RETCODE eRet = JC_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- delivery_p = (DELIVERY_REPORT*) jdd_MemAlloc(sizeof(DELIVERY_REPORT), 1);
- if (delivery_p == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- delivery_p->eDeliveryStatus = delivery_header->eDeliveryStatus;
- if (delivery_header->pTo != NULL)
- {
- delivery_p->pTo = (JC_CHAR*) jdd_MemAlloc(sizeof(JC_CHAR), jc_tcslen(delivery_header->pTo) + 1);
- if (delivery_p->pTo == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- jc_tcscpy(delivery_p->pTo, delivery_header->pTo);
- }
- if (delivery_header->pMessageID != NULL)
- {
- delivery_p->pMessageID = (JC_INT8*) jdi_UtilsStrdup(delivery_header->pMessageID);
- }
- delivery_p->uiDate = delivery_header->uiDate;
- g_jmms_context->delivery_p = (DELIVERY_REPORT*) (delivery_p);
- ERROR_HANDLE:
- if (eRet != JC_OK && delivery_p != NULL)
- {
- mmi_jmms_free_delivery_report_header();
- }
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_free_delivery_report_header
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_free_delivery_report_header(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- DELIVERY_REPORT *delivery_p = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- delivery_p = (DELIVERY_REPORT*) g_jmms_context->delivery_p;
- if (delivery_p == NULL)
- {
- return;
- }
- if (delivery_p->pTo != NULL)
- {
- jdd_MemFree(delivery_p->pTo);
- delivery_p->pTo = NULL;
- }
- if (delivery_p->pMessageID != NULL)
- {
- jdd_MemFree(delivery_p->pMessageID);
- delivery_p->pMessageID = NULL;
- }
- jdd_MemFree(delivery_p);
- delivery_p = NULL;
- g_jmms_context->delivery_p = NULL;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_create_notification_header
- * DESCRIPTION
- *
- * PARAMETERS
- * notf_header [?] [?] [?]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_jmms_create_notification_header(MESSAGE_NOTIFICATION *notf_header)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MESSAGE_NOTIFICATION *notification_p = NULL;
- JC_RETCODE eRet = JC_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- notification_p = (MESSAGE_NOTIFICATION*) jdd_MemAlloc(sizeof(MESSAGE_NOTIFICATION), 1);
- if (notification_p == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- if (notf_header->pFrom != NULL)
- {
- notification_p->pFrom = (JC_CHAR*) jdd_MemAlloc(sizeof(JC_CHAR), jc_tcslen(notf_header->pFrom) + 1);
- if (notification_p->pFrom == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- jc_tcscpy(notification_p->pFrom, notf_header->pFrom);
- }
- if (notf_header->pSubject != NULL)
- {
- notification_p->pSubject = (JC_CHAR*) jdd_MemAlloc(sizeof(JC_CHAR), jc_tcslen(notf_header->pSubject) + 1);
- if (notification_p->pSubject == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- jc_tcscpy(notification_p->pSubject, notf_header->pSubject);
- }
- notification_p->uiExpiryTime = notf_header->uiExpiryTime;
- notification_p->uiMessageSize = notf_header->uiMessageSize;
- notification_p->eMsgPriority = notf_header->eMsgPriority;
- notification_p->eMsgClass = notf_header->eMsgClass;
- notification_p->uiReceivedTime = notf_header->uiReceivedTime;
- g_jmms_context->notification_p = (MESSAGE_NOTIFICATION*) (notification_p);
- ERROR_HANDLE:
- if (eRet != JC_OK && notification_p != NULL)
- {
- mmi_jmms_free_notification_header();
- }
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_free_notification_header
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_free_notification_header(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MESSAGE_NOTIFICATION *notification_p = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- notification_p = (MESSAGE_NOTIFICATION*) (g_jmms_context->notification_p);
- if (notification_p == NULL)
- {
- return;
- }
- if (notification_p->pFrom != NULL)
- {
- jdd_MemFree(notification_p->pFrom);
- notification_p->pFrom = NULL;
- }
- if (notification_p->pSubject != NULL)
- {
- jdd_MemFree(notification_p->pSubject);
- notification_p->pSubject = NULL;
- }
- jdd_MemFree(notification_p);
- notification_p = NULL;
- g_jmms_context->notification_p = NULL;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_create_recieved_msg_header
- * DESCRIPTION
- *
- * PARAMETERS
- * recieve_header [?] [?] [?]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_jmms_create_recieved_msg_header(MESSAGE_RETRIEVAL *recieve_header)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MESSAGE_RETRIEVAL *retrieval_p = NULL;
- JC_RETCODE eRet = JC_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- retrieval_p = (MESSAGE_RETRIEVAL*) jdd_MemAlloc(sizeof(MESSAGE_RETRIEVAL), 1);
- if (retrieval_p == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- if (recieve_header->pFrom != NULL)
- {
- retrieval_p->pFrom = (JC_CHAR*) jdd_MemAlloc(sizeof(JC_CHAR), jc_tcslen(recieve_header->pFrom) + 1);
- if (retrieval_p->pFrom == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- jc_tcscpy(retrieval_p->pFrom, recieve_header->pFrom);
- }
- if (recieve_header->pTo != NULL)
- {
- retrieval_p->pTo = (JC_CHAR*) jdd_MemAlloc(sizeof(JC_CHAR), jc_tcslen(recieve_header->pTo) + 1);
- if (retrieval_p->pTo == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- jc_tcscpy(retrieval_p->pTo, recieve_header->pTo);
- }
- if (recieve_header->pCc != NULL)
- {
- retrieval_p->pCc = (JC_CHAR*) jdd_MemAlloc(sizeof(JC_CHAR), jc_tcslen(recieve_header->pCc) + 1);
- if (retrieval_p->pCc == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- jc_tcscpy(retrieval_p->pCc, recieve_header->pCc);
- }
- if (recieve_header->pSubject != NULL)
- {
- retrieval_p->pSubject = (JC_CHAR*) jdd_MemAlloc(sizeof(JC_CHAR), jc_tcslen(recieve_header->pSubject) + 1);
- if (retrieval_p->pSubject == NULL)
- {
- eRet = JC_ERR_MEMORY_ALLOCATION;
- goto ERROR_HANDLE;
- }
- jc_tcscpy(retrieval_p->pSubject, recieve_header->pSubject);
- }
- retrieval_p->eMsgPriority = recieve_header->eMsgPriority;
- retrieval_p->eMsgClass = recieve_header->eMsgClass;
- retrieval_p->uiDate = recieve_header->uiDate;
- g_jmms_context->retrieval_p = (MESSAGE_RETRIEVAL*) (retrieval_p);
- ERROR_HANDLE:
- if (eRet != JC_OK && retrieval_p != NULL)
- {
- mmi_jmms_free_recieved_msg_header();
- }
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_free_recieved_msg_header
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_free_recieved_msg_header(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MESSAGE_RETRIEVAL *retrieval_p = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- retrieval_p = (MESSAGE_RETRIEVAL*) (g_jmms_context->retrieval_p);
- if (retrieval_p == NULL)
- {
- return;
- }
- if (retrieval_p->pFrom != NULL)
- {
- jdd_MemFree(retrieval_p->pFrom);
- retrieval_p->pFrom = NULL;
- }
- if (retrieval_p->pTo != NULL)
- {
- jdd_MemFree(retrieval_p->pTo);
- retrieval_p->pTo = NULL;
- }
- if (retrieval_p->pCc != NULL)
- {
- jdd_MemFree(retrieval_p->pCc);
- retrieval_p->pCc = NULL;
- }
- if (retrieval_p->pSubject != NULL)
- {
- jdd_MemFree(retrieval_p->pSubject);
- retrieval_p->pSubject = NULL;
- }
- jdd_MemFree(retrieval_p);
- retrieval_p = NULL;
- g_jmms_context->retrieval_p = NULL;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_entry_new_mms_sent_properties
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_entry_new_mms_sent_properties(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PU8 gui_buffer; /* Buffer holding history data */
- S8 temp[14];
- MYTIME time, time1;
- /* PMT VIKAS START 20060325 */
- S32 size = 0, size_kb = 0, size_bytes = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* PMT VIKAS END 20060325 */
- EntryNewScreen(SCR_ID_JMMS_RETRIEVED_MMS_PROPERTIES, NULL, mmi_jmms_entry_new_mms_sent_properties, NULL);
- gui_buffer = GetCurrGuiBuffer(SCR_ID_JMMS_RETRIEVED_MMS_PROPERTIES);
- /* /TO */
- pfnUnicodeStrcpy((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_TO));
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- if (((MESSAGE_SEND*) g_jmms_context->send_msg_p)->pTo == NULL)
- {
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
- }
- else
- {
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) ((MESSAGE_SEND*) g_jmms_context->send_msg_p)->pTo);
- }
- /* /CC */
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_CC));
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- if (((MESSAGE_SEND*) g_jmms_context->send_msg_p)->pCc == NULL)
- {
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
- }
- else
- {
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) ((MESSAGE_SEND*) g_jmms_context->send_msg_p)->pCc);
- }
- /* /BCC */
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_BCC));
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- if (((MESSAGE_SEND*) g_jmms_context->send_msg_p)->pBcc == NULL)
- {
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
- }
- else
- {
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) ((MESSAGE_SEND*) g_jmms_context->send_msg_p)->pBcc);
- }
- /* /Subject */
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_SUBJECT));
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- if (((MESSAGE_SEND*) g_jmms_context->send_msg_p)->pSubject == NULL)
- {
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
- }
- else
- {
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) ((MESSAGE_SEND*) g_jmms_context->send_msg_p)->pSubject);
- }
- /* /Priority */
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_SETTINGS_PRIORITY));
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- /* MAUI_00017989 Start */
- /* MAUI_00018625 Start */
- switch (((MESSAGE_SEND*) g_jmms_context->send_msg_p)->eMsgPriority )
- /* MAUI_00018625 End */
- /* MAUI_00017989 End */
- {
- case E_MSG_PRIORITY_LOW:
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_SETTINGS_LOW));
- break;
- case E_MSG_PRIORITY_NORMAL:
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_NORMAL));
- break;
- case E_MSG_PRIORITY_HIGH:
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_SETTINGS_HIGH));
- break;
- default:
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_UNKNOWN));
- break;
- }
- /* //message class */
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_MSG_CLASS));
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- switch (((MESSAGE_SEND*) g_jmms_context->send_msg_p)->eMsgClass)
- {
- case E_MSG_PERSONAL_CLASS:
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_PERSONEL_MSG_CLASS));
- break;
- case E_MSG_ADVERTISEMENT_CLASS:
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_SETTINGS_ADVERTISMENT));
- break;
- case E_MSG_INFORMATION_CLASS:
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_INFORMATIONAL_MSG_CLASS));
- break;
- case E_MSG_AUTO_CLASS:
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_AUTO_MSG_CLASS));
- break;
- default:
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_UNKNOWN));
- break;
- }
- /* /Creation Date */
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_DATE));
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- if (((MESSAGE_SEND*) (g_jmms_context->send_msg_p))->uiDate == 0)
- {
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
- }
- else
- {
- U8 dttemp[40];
- FLOAT timezone;
- timezone = mmi_dt_get_tz();
- mmi_dt_utc_sec_2_mytime((U32) ((MESSAGE_SEND*) g_jmms_context->send_msg_p)->uiDate, &time1, MMI_TRUE);
- mmi_dt_utc_to_rtc(timezone, time1, time);
- /* PMT RAJ KUMAR GUPTA on Sep 05, 2006 */
- /* Date */
- memset(dttemp, 0x00, 40);
- date_string(&time, (UI_string_type)dttemp, DT_IDLE_SCREEN);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) dttemp);
- memset(temp, 0x00, 6);
- AnsiiToUnicodeString((PS8) temp, (PS8) "n");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- /* Time */
- memset(dttemp, 0x00, 40);
- time_string(&time, (UI_string_type)dttemp, DT_IDLE_SCREEN);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) dttemp);
- /* END of changes - RAJ KUMAR GUPTA */
- }
- //PMT VIKAS START 20060325
- ///MMS Size
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_SIZE));
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- mmi_jmms_save_size_of_mms(&size, MMS_SIZE_RETRIVE);
- size_kb = size / 1024;
- size_bytes = size % 1024;
- if (size_kb >= 1)
- {
- size_kb++;
- memset(temp, 0x00, 14);
- gui_itoa((S32) size_kb, (UI_string_type) temp, 10);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- memset(temp, 0x00, 4);
- AnsiiToUnicodeString((PS8) temp, (PS8) " ");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_KB));
- }
- else
- {
- memset(temp, 0x00, 14);
- gui_itoa((S32) size_bytes, (UI_string_type) temp, 10);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- memset(temp, 0x00, 4);
- AnsiiToUnicodeString((PS8) temp, (PS8) " ");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_BYTES));
- }
- /* PMT VIKAS END 20060325 */
- ShowCategory78Screen(
- /* MAUI_00018481 Start */
- STR_ID_JMMS_OPTIONS_PROPERTIES,
- /* MAUI_00018481 End */
- GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
- NULL,
- NULL,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- NULL,
- (U8*) subMenuData,
- pfnUnicodeStrlen((S8*) subMenuData),
- gui_buffer);
- SetRightSoftkeyFunction(mm_jmms_back_from_sent_msg_properties, KEY_EVENT_UP);
- SetKeyHandler(mm_jmms_back_from_sent_msg_properties, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- if (isInCall() == FALSE)
- SetKeyHandler(mm_jmms_end_from_sent_msg_properties, KEY_END, KEY_EVENT_DOWN);
- return;
- }
- /*Added by dilip on 10th sept to show Template properties screen*/
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_entry_new_mms_template_properties
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_entry_new_mms_template_properties(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PU8 gui_buffer; /* Buffer holding history data */
- S8 temp[14];
- /* PMT VIKAS START 20060325 */
- S32 size = 0, size_kb = 0, size_bytes = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* PMT VIKAS END 20060325 */
- EntryNewScreen(SCR_ID_JMMS_RETRIEVED_MMS_PROPERTIES, NULL, mmi_jmms_entry_new_mms_template_properties, NULL);
- gui_buffer = GetCurrGuiBuffer(SCR_ID_JMMS_RETRIEVED_MMS_PROPERTIES);
- /* /Subject */
- pfnUnicodeStrcpy((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_SUBJECT));
- memset(temp, 0x00, 14);
- AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
- if (((MESSAGE_SEND*) g_jmms_context->send_msg_p)->pSubject == NULL)
- {
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
- }
- else
- {
- pfnUnicodeStrcat((S8*) subMenuData, (S8*) ((MESSAGE_SEND*) g_jmms_context->send_msg_p)->pSubject);
- }