JMMSInboxUI.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:101k
源码类别:
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_inbox_ui.C
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * This file contains the ui of inbox folder in mms
- *
- * 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!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
- #ifndef _MMI_JMMSINBOXSECMMI_C
- #define _MMI_JMMSINBOXSECMMI_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_categories.h"
- #include "wgui_categories_inputs.h"
- #include "JMMSStoreHandling.h"
- #include "MainMenuDef.h"
- #include "JMMSConfig.h"
- #include "JMMSMainMMS.h"
- #include "JMMSUseDetails.h"
- #include "JMMSInbox.h"
- #include "JMMSWriteMMS.h"
- #include "JMMSCoreAPI.h"
- #include "JMMSDRMHandler.h"
- #include <ddl.h>
- #include <jcal.h>
- #include <jcalnet.h>
- #include "jdi_wspdatatype.h"
- #include "jdi_transport.h"
- #include <jdi_communicator.h>
- #include <MessagingDatatypes.h>
- #include <MessagingAPI.h>
- #include "JMMSExdcl.h"
- #include "JMMSPushHandling.h"
- #include "NVRAMEnum.h"
- #include "NVRAMType.h"
- #include "NVRAMProt.h"
- #include "JMMSCompose.h"
- #include <PrvMessagingDataTypes.h>
- #include <MM1DataTypes.h>
- #include <ComposeUtils.h>
- #include "JMMSResEnum.h"
- #include "JMMSCoreAPI.h"
- #include "JMMSMainMMS.h"
- #include "JMMSProtocols.h"
- #include "JMMSView.h"
- #include "JMMSMessageSettingsUtils.h"
- #include "JMMSPushHandling.h"
- #include "MessagesResourceData.h"
- #include "JMMSTemplates.h"
- #ifdef __MMI_UNIFIED_MESSAGE__
- #include "JMMSUMHandling.h"
- #endif
- #include "wapadp.h" // compiler warning removal
- /*****************************************************************************
- * Define
- *****************************************************************************/
- /*****************************************************************************
- * Typedef
- *****************************************************************************/
- /*****************************************************************************
- * Local Variable
- *****************************************************************************/
- /*****************************************************************************
- * Local Function
- *****************************************************************************/
- /*****************************************************************************
- * Global Variable
- *****************************************************************************/
- /*****************************************************************************
- * Global Function
- *****************************************************************************/
- /* PMT VIKAS START 20060405 */
- //#ifdef __MMI_MMS_SIGNATURE__
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_is_fw_from_inbox
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- *
- *****************************************************************************/
- MMI_BOOL mmi_jmms_is_fw_from_inbox(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return g_jmms_context->fw_from_inbox;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_set_fw_flag_of_inbox
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_set_fw_flag_of_inbox(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_jmms_context->fw_from_inbox = MMI_TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_reset_fw_flag_of_inbox
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_reset_fw_flag_of_inbox(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_jmms_context->fw_from_inbox = MMI_FALSE;
- }
- //#endif /* __MMI_MMS_SIGNATURE__ */
- /* PMT VIKAS END 20060405 */
- #ifndef __MMI_UNIFIED_MESSAGE__
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_highlight_inbox
- * DESCRIPTION
- * This function is highlight handler of Inbox menu item in main mms screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_highlight_inbox(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- SetLeftSoftkeyFunction(mmi_jmms_entry_inbox, KEY_EVENT_UP);
- SetKeyHandler(mmi_jmms_entry_inbox, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_jmms_entry_inbox, KEY_WAP, KEY_EVENT_DOWN);
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_inbox_init
- * DESCRIPTION
- * This function init the hilight handlers of inbox menu items.
- * This is called at boot up time
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_inbox_init(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- /* U8 i = 0; */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Inbox options Highlight handlers */
- SetHiliteHandler(MENU_ID_JMMS_INBOX_OPTIONS_VIEW, mmi_jmms_highlight_inbox_options_view);
- SetHiliteHandler(MENU_ID_JMMS_INBOX_OPTIONS_REPLY, mmi_jmms_highlight_inbox_options_reply);
- SetHiliteHandler(MENU_ID_JMMS_INBOX_OPTIONS_REPLY_ALL, mmi_jmms_highlight_inbox_options_reply_all);
- SetHiliteHandler(MENU_ID_JMMS_INBOX_OPTIONS_FORWARD, mmi_jmms_highlight_inbox_options_forward);
- SetHiliteHandler(MENU_ID_JMMS_INBOX_OPTIONS_DOWNLOAD, mmi_jmms_highlight_inbox_options_download);
- SetHiliteHandler(MENU_ID_JMMS_INBOX_OPTIONS_DELETE, mmi_jmms_highlight_inbox_options_delete);
- SetHiliteHandler(MENU_ID_JMMS_INBOX_OPTIONS_DELETE_ALL, mmi_jmms_highlight_inbox_options_delete_all);
- SetHiliteHandler(MENU_ID_JMMS_INBOX_OPTIONS_PROPERTIES, mmi_jmms_highlight_inbox_options_properties);
- /* Inbox use details highlight handlers */
- SetHiliteHandler(
- MENU_ID_JMMS_INBOX_USE_DETAILS_ADDRESSES_ADD_TO_CONTACT,
- mmi_jmms_highlight_options_use_details_add_to_contact);
- SetHiliteHandler(MENU_ID_JMMS_INBOX_USE_DETAILS_ADDRESSES_CALL, mmi_jmms_highlight_options_use_details_call);
- //KP Jerry add on 2007-4-12 start
- #ifdef __MMI_MESSAGES_SENDMSG_QUICKLY__
- SetHiliteHandler(MENU_ID_JMMS_INBOX_USE_DETAILS_ADDRESSES_DAILIP, mmi_jmms_highlight_options_use_details_dialIP);
- SetHiliteHandler(MENU_ID_JMMS_INBOX_USE_DETAILS_ADDRESSES_SENDSMS, mmi_jmms_highlight_options_use_details_sendsms);
- SetHiliteHandler(MENU_ID_JMMS_INBOX_USE_DETAILS_ADDRESSES_SENDMMS, mmi_jmms_highlight_options_use_details_sendmms);
- #endif
- //KP Jerry add on 2007-4-12 end
- SetHiliteHandler(MENU_ID_JMMS_INBOX_OPTIONS_SAVE_OBJECTS, mmi_jmms_highlight_inbox_options_save_object);
- #ifdef __MMI_UNIFIED_MESSAGE__
- SetHiliteHandler(MENU_ID_JMMS_INBOX_OPTIONS_EDIT_MESSAGE, mmi_jmms_highlight_inbox_options_edit_message);
- SetHiliteHandler(MENU_ID_JMMS_INBOX_OPTIONS_USE_DETAILS_NUMBER, mmi_jmms_highlight_inbox_options_use_number);
- #else /* __MMI_UNIFIED_MESSAGE__ */
- SetHiliteHandler(MENU_ID_JMMS_INBOX_OPTIONS_USE_DETAILS, mmi_jmms_highlight_inbox_options_use_details);
- SetHiliteHandler(MENU_ID_JMMS_INBOX_OPTIONS_USE_DETAILS_EMAIL, mmi_jmms_highlight_options_use_details_email);
- SetHiliteHandler(MENU_ID_JMMS_INBOX_OPTIONS_USE_DETAILS_NUMBER, mmi_jmms_highlight_options_use_details_number);
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- g_jmms_context->store_context->inbox_msgs_read_status =
- (U8*) jdd_MemAlloc(sizeof(U8), MAX_READ_UNREAD_STATUS_BYTES);
- if (g_jmms_context->store_context->inbox_msgs_read_status == NULL)
- {
- return;
- }
- ReadRecord(
- NVRAM_EF_JMMS_INBOX_READ_UNREAD_LID,
- 1,
- (g_jmms_context->store_context->inbox_msgs_read_status),
- (U16) MAX_READ_UNREAD_STATUS_BYTES,
- &error);
- /*
- * if (g_jmms_context->store_context->inbox_msgs_read_status[0] == 0xFF)
- * {
- * for (i = 0; i < MAX_READ_UNREAD_STATUS_BYTES; i++)
- * {
- * g_jmms_context->store_context->inbox_msgs_read_status[i] = 0x00;
- * }
- *
- * WriteRecord(
- * NVRAM_EF_JMMS_INBOX_READ_UNREAD_LID,
- * 1,
- * (g_jmms_context->store_context->inbox_msgs_read_status),
- * (U16) MAX_READ_UNREAD_STATUS_BYTES,
- * &error);
- * ReadRecord(
- * NVRAM_EF_JMMS_INBOX_READ_UNREAD_LID,
- * 1,
- * (g_jmms_context->store_context->inbox_msgs_read_status),
- * (U16) MAX_READ_UNREAD_STATUS_BYTES,
- * &error);
- * }
- */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_free_read_unread_status_bytes
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_free_read_unread_status_bytes(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_jmms_context->store_context->inbox_msgs_read_status != NULL)
- {
- jdd_MemFree(g_jmms_context->store_context->inbox_msgs_read_status);
- }
- }
- #ifndef __MMI_UNIFIED_MESSAGE__
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_entry_inbox
- * DESCRIPTION
- * This is pre entry fn for Inbox screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_entry_inbox(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 total_num_msgs = 0;
- JC_RETCODE eRet = JC_OK;
- U16 currScrenID = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- eRet = mmi_mms_get_number_of_messages(MMI_JMMS_INBOX, &total_num_msgs);
- if (eRet != JC_OK)
- {
- ASSERT(0);
- }
- /* set the open msg status- for At delete */
- g_jmms_context->msg_open_status[0] = E_JMMS_INBOX;
- g_jmms_context->msg_open_status[1] = 0;
- if (total_num_msgs == 0)
- {
- DisplayPopup((U8*) GetString(STR_GLOBAL_EMPTY), IMG_GLOBAL_EMPTY, 1, JMMS_POPUP_TIME, EMPTY_LIST_TONE);
- return;
- }
- g_jmms_context->store_context->nMsgs_in_Current_folder = total_num_msgs;
- g_jmms_context->store_context->update_nmsgs_in_current_folder = 0;
- g_jmms_context->store_context->current_folder_name = E_JMMS_INBOX;
- mmi_jmms_free_msgs_list(&(g_jmms_context->store_context->messages_list));
- g_jmms_context->store_context->jmms_start_index = 1;
- mmi_jmms_entry_get_msgs_progress_screen();
- eRet = mmi_jmms_get_folder_msg_list(&(g_jmms_context->store_context->messages_list), MMI_JMMS_INBOX, total_num_msgs);
- if (eRet != JC_OK || g_jmms_context->store_context->messages_list == NULL)
- {
- currScrenID = GetActiveScreenId();
- mmi_jmms_free_msgs_list(&(g_jmms_context->store_context->messages_list));
- 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);
- }
- }
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_entry_inbox_screen
- * DESCRIPTION
- * Entry fn for inbox screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_entry_inbox_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PU8 gui_buffer; /* Buffer holding history data */
- U8 num_item = 0;
- JC_RETCODE eRet = JC_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_mms_get_number_of_messages(MMI_JMMS_INBOX, &num_item);
- if (eRet != JC_OK)
- {
- ASSERT(0);
- }
- //if number of msga in fodelr is not same to as in global var then
- //it means some has been recieved as user was in inbox so need to update
- ///the msgs list
- if (g_jmms_context->store_context->update_nmsgs_in_current_folder)
- {
- mmi_jmms_entry_inbox();
- return;
- }
- ///Free any pending node to show on ideal screen
- //because after entering into inbox we can't show these nodes on ideal screen
- ///because user may can change the mms e.g. may downlaod a mms notificaction
- //so that notification will not be notification.
- mmi_jmms_delete_mms_pop_ups_list_on_inbox_entry();
- EntryNewScreen(SCR_ID_JMMS_INBOX, NULL, mmi_jmms_entry_inbox_screen, NULL);
- gui_buffer = GetCurrGuiBuffer(SCR_ID_JMMS_INBOX);
- SetParentHandler(MENU_ID_JMMS_INBOX);
- RegisterHighlightHandler(mmi_jmms_folder_list_highlight_hdlr);
- /* reset the open msg status- for At delete */
- g_jmms_context->msg_open_status[0] = 0;
- g_jmms_context->msg_open_status[1] = 0;
- ShowCategory184Screen(
- STR_ID_JMMS_INBOX,
- GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
- STR_GLOBAL_OPTIONS,
- IMG_GLOBAL_OPTIONS,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- g_jmms_context->store_context->nMsgs_in_Current_folder,
- mmi_jmms_get_item_data_inbox,
- mmi_jmms_get_item_hint_inbox,
- g_jmms_context->nCurr_scr_hilited_index,
- gui_buffer);
- SetLeftSoftkeyFunction(mmi_jmms_pre_entry_inbox_options_scren, KEY_EVENT_UP);
- SetKeyHandler(mmi_jmms_pre_entry_inbox_options_scren, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_jmms_pre_entry_inbox_options_scren, KEY_WAP, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(mmi_jmms_back_from_msgs_list_screen, KEY_EVENT_UP);
- SetKeyHandler(mmi_jmms_back_from_msgs_list_screen, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_get_item_data_inbox
- * DESCRIPTION
- * fn retrun the item data
- * PARAMETERS
- * item_index [IN] (index of item to be drawn)
- * str_buff [IN] (string of item)
- * img_buff_p [?] [?] (image corrsponding to item
- * str_img_mask [IN]
- * RETURNS
- * void
- *****************************************************************************/
- pBOOL mmi_jmms_get_item_data_inbox(S32 item_index, UI_string_type str_buff, PU8 *img_buff_p, U8 str_img_mask)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 count = 0;
- jmms_folder_msgs_list *msgs_list_node = NULL;
- U8 msg_index = 0;
- MMI_BOOL is_msg_read = MMI_TRUE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((item_index < 0) || (item_index > MAX_POSSIBLE_MESSAGES))
- {
- return FALSE;
- }
- msgs_list_node = g_jmms_context->store_context->messages_list;
- while (count != item_index && msgs_list_node != NULL)
- {
- msgs_list_node = msgs_list_node->next;
- count++;
- }
- if (msgs_list_node == NULL)
- {
- return FALSE;
- }
- pfnUnicodeStrcpy((S8*) str_buff, msgs_list_node->subject_as_caption);
- msg_index = g_jmms_context->store_context->nMsgs_in_Current_folder - item_index;
- msg_index = msg_index - 1;
- switch (msgs_list_node->msg_type)
- {
- case E_MSG_NOTIFICATION:
- *img_buff_p = (PU8) GetImage((U16) (IMG_ID_JMMS_MMS_NOTIFICATION));
- break;
- case E_MSG_RECEIVE:
- is_msg_read = mmi_jmms_is_msg_read(msg_index);
- if (is_msg_read == MMI_TRUE)
- {
- *img_buff_p = (PU8) GetImage((U16) (IMG_ID_JMMS_NEW_MMS_READ));
- }
- else
- {
- *img_buff_p = (PU8) GetImage((U16) (IMG_ID_JMMS_NEW_MMS_UNREAD));
- }
- break;
- case E_MSG_DELIVERY_REPORT:
- is_msg_read = mmi_jmms_is_msg_read(msg_index);
- if (is_msg_read == MMI_TRUE)
- {
- *img_buff_p = (PU8) GetImage((U16) (IMG_ID_JMMS_DELIVERY_READ));
- }
- else
- {
- *img_buff_p = (PU8) GetImage((U16) (IMG_ID_JMMS_DELIVERY_UNREAD));
- }
- break;
- case E_MSG_JAVA_MESSAGE:
- *img_buff_p = (PU8) GetImage((U16) (IMG_ID_JMMS_JAVA_MMS));
- break;
- case E_MSG_READ_REPORT:
- is_msg_read = mmi_jmms_is_msg_read(msg_index);
- if (is_msg_read == MMI_TRUE)
- {
- *img_buff_p = (PU8) GetImage((U16) (IMG_ID_JMMS_READ_REPORT_READ));
- }
- else
- {
- *img_buff_p = (PU8) GetImage((U16) (IMG_ID_JMMS_READ_REPORT_UNREAD));
- }
- break;
- }
- return TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_get_item_hint_inbox
- * DESCRIPTION
- * Retrun the hint fot the item to be drawn
- * PARAMETERS
- * item_index [IN] (index of item to be drawn)
- * hint_array [?] [?] (hint buufer for the item_index)
- * RETURNS
- * void
- *****************************************************************************/
- S32 mmi_jmms_get_item_hint_inbox(S32 item_index, UI_string_type *hint_array)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 count = 0;
- jmms_folder_msgs_list *msgs_list_node = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((item_index < 0) || (item_index > MAX_POSSIBLE_MESSAGES))
- {
- return FALSE;
- }
- msgs_list_node = g_jmms_context->store_context->messages_list;
- while (count != item_index && msgs_list_node != NULL)
- {
- msgs_list_node = msgs_list_node->next;
- count++;
- }
- if (msgs_list_node == NULL || msgs_list_node->address_as_hint == NULL)
- {
- return 0;
- }
- if (pfnUnicodeStrlen((S8*) (msgs_list_node->address_as_hint)))
- {
- pfnUnicodeStrcpy((S8*) hint_array[0], (S8*) (msgs_list_node->address_as_hint));
- }
- else
- {
- return 0; /* No Hint Data */
- }
- return TRUE;
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_pre_entry_inbox_options_scren
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_pre_entry_inbox_options_scren(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_BOOL status = MMI_FALSE;
- U16 msg_type = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msg_type = mmi_jmms_get_msg_type(g_jmms_context->nCurr_scr_hilited_index);
- if (msg_type == E_MSG_NOTIFICATION)
- {
- status = mmi_jmms_is_notifiction_in_use((U16)
- (g_jmms_context->store_context->nMsgs_in_Current_folder -
- g_jmms_context->nCurr_scr_hilited_index));
- if (status == MMI_TRUE)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_JMMS_NOTF_IN_USE),
- IMG_GLOBAL_WARNING,
- 1,
- JMMS_POPUP_TIME,
- (U8) WARNING_TONE);
- return;
- }
- }
- mmi_jmms_entry_inbox_options_scren();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_entry_inbox_options_scren
- * DESCRIPTION
- * Entry fn for inbox options screeen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_entry_inbox_options_scren(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 msg_type = 0;
- U16 parentid;
- #ifdef __MMI_UNIFIED_MESSAGE__
- U8 curr_page =0;
- MEDIA_INFO *image_info;
- U8 media_count = 0;
- #endif
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msg_type = mmi_jmms_get_msg_type(g_jmms_context->nCurr_scr_hilited_index);
- /* PMT VIKAS START 20060405 */
- //#ifdef __MMI_MMS_SIGNATURE__
- mmi_jmms_reset_fw_flag_of_inbox();
- //#endif
- /* PMT VIKAS END 20060405 */
- mmi_jmms_reset_fw_flag_of_message();
- switch (msg_type)
- {
- case E_MSG_NOTIFICATION:
- parentid = MENU_ID_JMMS_INBOX_OPTIONS_NOTIFICATION;
- break;
- case E_MSG_RECEIVE:
- parentid = MENU_ID_JMMS_INBOX_OPTIONS_NEW_MMS;
- break;
- case E_MSG_DELIVERY_REPORT:
- parentid = MENU_ID_JMMS_INBOX_OPTIONS_DELIVERY_REPORT;
- break;
- case E_MSG_READ_REPORT: /* /Read report have same options as Delivery Report */
- parentid = MENU_ID_JMMS_INBOX_OPTIONS_DELIVERY_REPORT;
- break;
- case E_MSG_JAVA_MESSAGE:
- parentid = MENU_ID_JMMS_INBOX_OPTIONS_JAVA_MMS;
- break;
- default:
- return;
- }
- EntryNewScreen(SCR_ID_JMMS_INBOX_OPTIONS, NULL, mmi_jmms_entry_inbox_options_scren, NULL);
- #ifdef __MMI_UNIFIED_MESSAGE__
- DeleteScreenIfPresent(SCR_ID_JMMS_NOTIFICATION_PROPERTIES);
- DeleteScreenIfPresent(SCR_ID_JMMS_RETRIEVED_MMS_PROPERTIES);
- DeleteScreenIfPresent(SCR_ID_JMMS_NEW_MMS);
- DeleteScreenIfPresent(SCR_ID_JMMS_READ_REPORT_QUERY);
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- gui_buffer = GetCurrGuiBuffer(SCR_ID_JMMS_INBOX_OPTIONS);
- #ifdef __MMI_UNIFIED_MESSAGE__
- DeleteScreenIfPresent(SCR_ID_JMMS_INBOX_OPTIONS);
- #endif
- num_item = GetNumOfChild(parentid);
- #ifdef __MMI_UNIFIED_MESSAGE__
- mmi_jmms_jdi_get_media_count(g_jmms_context->msg_handle, 0, &media_count, E_TRUE);
- mmi_jmms_jdi_get_current_page_index(g_jmms_context->msg_handle, &curr_page);
- image_info = mmi_jmms_jdi_get_image_data(curr_page);
- if (g_jmms_context->view_context != NULL)
- {
- if (/*g_jmms_context->view_context->focus_object_type == E_MSG_FOCUS_IMAGE ||
- g_jmms_context->view_context->focus_object_type == E_MSG_FOCUS_AUDIO ||
- g_jmms_context->view_context->focus_object_type == E_MSG_FOCUS_VIDEO ||
- */
- media_count || g_jmms_context->view_context->view_audio_id || g_jmms_context->view_context->view_video_id || image_info != NULL)
- {
- mmi_frm_unhide_menu_item(MENU_ID_JMMS_INBOX_OPTIONS_SAVE_OBJECTS);
- }
- else
- {
- if (msg_type == E_MSG_RECEIVE)
- {
- mmi_frm_hide_menu_item(MENU_ID_JMMS_INBOX_OPTIONS_SAVE_OBJECTS);
- num_item--;
- }
- }
- }
- else
- {
- if (msg_type == E_MSG_RECEIVE)
- {
- mmi_frm_hide_menu_item(MENU_ID_JMMS_INBOX_OPTIONS_SAVE_OBJECTS);
- num_item--;
- }
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- GetSequenceStringIds_Ext(parentid, str_item_list);
- SetParentHandler(parentid);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- #ifndef __MMI_UNIFIED_MESSAGE__
- /* set the open msg status- for At delete */
- g_jmms_context->msg_open_status[0] = E_JMMS_INBOX;
- //PMT HIMANSHU START 20060425
- // g_jmms_context->msg_open_status[1]=(U16)(g_jmms_context->store_context->nMsgs_in_Current_folder - g_jmms_context->nCurr_scr_hilited_index);
- g_jmms_context->msg_open_status[1] =
- (U32) mmi_jmms_get_message_id(
- MMI_JMMS_INBOX,
- (g_jmms_context->store_context->nMsgs_in_Current_folder - g_jmms_context->nCurr_scr_hilited_index));
- /* PMT HIMANSHU END 20060425 */
- #endif
- ShowCategory52Screen(
- STR_GLOBAL_OPTIONS,
- GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- num_item,
- str_item_list,
- (U16*) gIndexIconsImageList,
- NULL,
- 0,
- 0,
- gui_buffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_is_notifiction_in_use
- * DESCRIPTION
- *
- * PARAMETERS
- * msg_index [IN]
- * RETURNS
- *
- *****************************************************************************/
- MMI_BOOL mmi_jmms_is_notifiction_in_use(U16 msg_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- jmms_communication_state_node *temp_node = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- temp_node = g_jmms_context->comm_state;
- while (temp_node != NULL)
- {
- if (temp_node->msg_index == msg_index)
- {
- return MMI_TRUE;
- }
- temp_node = temp_node->next;
- }
- return MMI_FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_highlight_inbox_options_view
- * DESCRIPTION
- * highlight hdlr of view menu item in Inbox options
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_highlight_inbox_options_view(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- #ifdef __MMI_UNIFIED_MESSAGE__
- SetLeftSoftkeyFunction(mmi_jmms_pre_entry_view, KEY_EVENT_UP);
- SetKeyHandler(mmi_jmms_pre_entry_view, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_jmms_pre_entry_view, KEY_WAP, KEY_EVENT_DOWN);
- #else
- SetLeftSoftkeyFunction(mmi_jmms_inbox_view, KEY_EVENT_UP);
- /* MAUI_00018463 Start */
- // SetKeyHandler(mmi_jmms_inbox_view, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- /* MAUI_00018463 End */
- SetKeyHandler(mmi_jmms_inbox_view, KEY_WAP, KEY_EVENT_DOWN);
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_highlight_inbox_options_reply
- * DESCRIPTION
- * highlight hdlr of view menu item in Inbox options
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_highlight_inbox_options_reply(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- SetLeftSoftkeyFunction(mmi_jmms_inbox_reply, KEY_EVENT_UP);
- SetKeyHandler(mmi_jmms_inbox_reply, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_jmms_inbox_reply, KEY_WAP, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_highlight_inbox_options_reply_all
- * DESCRIPTION
- * highlight hdlr of view menu item in Inbox options
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_highlight_inbox_options_reply_all(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- SetLeftSoftkeyFunction(mmi_jmms_inbox_reply_all, KEY_EVENT_UP);
- SetKeyHandler(mmi_jmms_inbox_reply_all, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_jmms_inbox_reply_all, KEY_WAP, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_highlight_inbox_options_forward
- * DESCRIPTION
- * highlight hdlr of view menu item in Inbox options
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_highlight_inbox_options_forward(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- SetLeftSoftkeyFunction(mmi_jmms_inbox_forward, KEY_EVENT_UP);
- SetKeyHandler(mmi_jmms_inbox_forward, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_jmms_inbox_forward, KEY_WAP, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_highlight_inbox_options_download
- * DESCRIPTION
- * highlight hdlr of view menu item in Inbox options
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_highlight_inbox_options_download(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- SetLeftSoftkeyFunction(mmi_jmms_inbox_download, KEY_EVENT_UP);
- SetKeyHandler(mmi_jmms_inbox_download, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_jmms_inbox_download, KEY_WAP, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_highlight_inbox_options_delete
- * DESCRIPTION
- * highlight hdlr of view menu item in Inbox options
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_highlight_inbox_options_delete(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- SetLeftSoftkeyFunction(mmi_jmms_inbox_pre_delete, KEY_EVENT_UP);
- SetKeyHandler(NULL, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_jmms_inbox_pre_delete, KEY_WAP, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_highlight_inbox_options_delete_all
- * DESCRIPTION
- * highlight hdlr of delete all menu item in Inbox options
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_highlight_inbox_options_delete_all(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- SetLeftSoftkeyFunction(mmi_jmms_inbox_delete_all, KEY_EVENT_UP);
- SetKeyHandler(NULL, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_jmms_inbox_delete_all, KEY_WAP, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_highlight_inbox_options_use_details
- * DESCRIPTION
- * highlight hdlr of use details menu item in Inbox options
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_UNIFIED_MESSAGE__
- void mmi_jmms_highlight_inbox_options_use_number(void)
- #else
- void mmi_jmms_highlight_inbox_options_use_details(void)
- #endif
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- SetLeftSoftkeyFunction(mmi_jmms_inbox_use_details, KEY_EVENT_UP);
- SetKeyHandler(mmi_jmms_inbox_use_details, KEY_SEND, KEY_EVENT_UP);
- SetKeyHandler(mmi_jmms_inbox_use_details, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_jmms_inbox_use_details, KEY_WAP, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_highlight_inbox_options_properties
- * DESCRIPTION
- * highlight hdlr of properties menu item in Inbox options
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_highlight_inbox_options_properties(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- SetLeftSoftkeyFunction(mmi_jmms_inbox_properties, KEY_EVENT_UP);
- SetKeyHandler(mmi_jmms_inbox_properties, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_jmms_inbox_properties, KEY_WAP, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_inbox_view
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_inbox_view(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 msg_index = 0;
- #ifndef __MMI_UNIFIED_MESSAGE__
- U8 index = 0;
- #endif
- jmms_folder_msgs_list *node = NULL;
- MMI_BOOL is_msg_read = MMI_TRUE;
- JC_RETCODE eRet = JC_OK;
- CONTENT_DATA Content = {0, };
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- node = g_jmms_context->store_context->messages_list;
- #ifdef __MMI_UNIFIED_MESSAGE__
- while (node != NULL)
- {
- if (node->msg_index == g_jmms_context->nCurr_scr_hilited_index)
- {
- break;
- }
- node = node->next;
- }
- if (node == NULL)
- {
- return;
- }
- #else /* __MMI_UNIFIED_MESSAGE__ */
- while (index < g_jmms_context->nCurr_scr_hilited_index)
- {
- node = node->next;
- index++;
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- /* /set the msg status as read if first time read */
- msg_index = g_jmms_context->store_context->nMsgs_in_Current_folder - g_jmms_context->nCurr_scr_hilited_index;
- msg_index = msg_index - 1;
- is_msg_read = mmi_jmms_is_msg_read(msg_index);
- #ifdef __MMI_UNIFIED_MESSAGE__
- if ((is_msg_read == MMI_FALSE) && node->msg_type != E_MSG_NOTIFICATION && node->msg_type != E_MSG_JAVA_MESSAGE)
- #else
- if (is_msg_read == MMI_FALSE)
- #endif
- {
- mmi_jmms_set_msg_as_read(msg_index);
- }
- //TODO:: need to test read report PDU and Delivery Report PDU
- ///currently not able to save these PDUs. Will able to test
- ///in T3
- #ifdef __MMI_UNIFIED_MESSAGE__
- if (node->msg_type == E_MSG_DELIVERY_REPORT || node->msg_type == E_MSG_READ_REPORT ||
- node->msg_type == E_MSG_NOTIFICATION || node->msg_type == E_MSG_JAVA_MESSAGE)
- #else /* __MMI_UNIFIED_MESSAGE__ */
- if (node->msg_type == E_MSG_DELIVERY_REPORT || node->msg_type == E_MSG_READ_REPORT)
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- {
- #ifdef __MMI_UNIFIED_MESSAGE__
- if (node->msg_type == E_MSG_NOTIFICATION)
- {
- MMI_BOOL status = mmi_jmms_is_notifiction_in_use((U16)
- (g_jmms_context->store_context->nMsgs_in_Current_folder -
- g_jmms_context->nCurr_scr_hilited_index));
- if (status == MMI_TRUE)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_JMMS_NOTF_IN_USE),
- IMG_GLOBAL_WARNING,
- 1,
- JMMS_POPUP_TIME,
- (U8) WARNING_TONE);
- return;
- }
- }
- #endif
- mmi_jmms_show_mms_properties(node->msg_type, MMI_JMMS_INBOX);
- return;
- }
- else
- {
- Content.bIsStream = E_TRUE;
- eRet = mmi_jmms_get_message(
- "Inbox",
- &Content,
- (g_jmms_context->store_context->nMsgs_in_Current_folder - g_jmms_context->nCurr_scr_hilited_index));
- if (eRet != JC_OK)
- {
- goto END;
- }
- if (is_msg_read == MMI_FALSE)
- {
- ///it means first time viewing the mms.
- ///so need to check for read report require to send
- mmi_jmms_deinit_mms_context(g_jmms_context);
- eRet = mmi_jmms_jdi_parse_msg_buffer(&(g_jmms_context->msg_handle), &Content, E_TYPE_MMS, E_FALSE);
- /* Async changes start */
- while (eRet == JC_ERR_MMS_PARSE_PENDING)
- {
- eRet = mmi_jmms_jdi_msg_parse_continue(g_jmms_context->msg_handle);
- };
- /* Async changes end */
- if (JC_OK != eRet)
- {
- goto END;
- }
- eRet = mmi_jmms_jdi_get_msg_headers(
- g_jmms_context->msg_handle,
- (MESSAGE_HEADERS **) (&(g_jmms_context->MsgHeaders_p)));
- if (JC_OK != eRet)
- {
- goto END;
- }
- g_jmms_context->MsgHeader_type_p =
- (MESSAGE_RETRIEVAL*) ((MESSAGE_HEADERS*) g_jmms_context->MsgHeaders_p)->pHeaders;
- g_jmms_context->last_scr_id = SCR_ID_JMMS_INBOX_OPTIONS;
- g_jmms_context->mms_index =
- g_jmms_context->store_context->nMsgs_in_Current_folder - g_jmms_context->nCurr_scr_hilited_index;
- g_jmms_context->is_unread_msg_deleted = 0;
- #ifdef __MMI_UNIFIED_MESSAGE__
- g_jmms_context->show_property_screen = MMI_FALSE;
- #endif
- mmi_jmms_handle_read_report(g_jmms_context->MsgHeader_type_p);
- }
- else
- {
- /* /TODO:: to be added by deeapali */
- g_jmms_context->last_scr_id = SCR_ID_JMMS_INBOX_OPTIONS;
- #ifdef __MMI_UNIFIED_MESSAGE__
- mmi_jmms_deinit_view();
- #endif
- eRet = mmi_jmms_pre_entry_mms_view(&Content);
- if (eRet == JC_ERR_MMS_PARSE_PENDING)
- {
- return;
- }
- }
- }
- END:
- if (eRet != JC_OK && g_jmms_context->msg_handle != NULL)
- {
- eRet = mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
- g_jmms_context->msg_handle = NULL;
- }
- if (eRet != JC_OK)
- {
- DisplayPopup((U8*) GetString(STR_GLOBAL_ERROR), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, (U8) ERROR_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_inbox_reply
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_inbox_reply(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_jmms_reply_message(E_FALSE);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_inbox_reply_all
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_inbox_reply_all(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_jmms_reply_message(E_TRUE);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_reply_message
- * DESCRIPTION
- *
- * PARAMETERS
- * bReplyAll [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_reply_message(JC_BOOLEAN bReplyAll)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- CONTENT_DATA Content = {0, };
- MSG_HANDLE hTempMsg = NULL;
- S8 *temp_str = NULL;
- S8 *str = NULL;
- S32 len = 0;
- S32 start_index = 0;
- JC_RETCODE eRet = JC_OK;
- U8 ret = 0;
- MESSAGE_HEADERS *pMsgHeaders = NULL;
- MESSAGE_SEND *send_p = NULL;
- MMI_BOOL is_email = MMI_FALSE;
- S32 len_to_copy = 0;
- U8 number = 0;
- MMI_BOOL is_duplicate = MMI_FALSE;
- #if 0
- /* under construction !*/
- /* under construction !*/
- #endif
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- number = g_jmms_context->store_context->nMsgs_in_Current_folder;
- eRet = jdi_MsgInit(&hTempMsg, NULL);
- if (JC_OK != eRet)
- {
- mmi_jmms_error_handler(eRet);
- goto END;
- }
- Content.bIsStream = E_TRUE;
- eRet = mmi_jmms_get_message("Inbox", &Content, (number - g_jmms_context->nCurr_scr_hilited_index));
- if (eRet != JC_OK)
- {
- mmi_jmms_error_handler(eRet);
- goto END;
- }
- if (g_jmms_context->msg_handle != NULL)
- {
- eRet = mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
- g_jmms_context->msg_handle = NULL;
- }
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif
- eRet = mmi_jmms_jdi_msg_reply(hTempMsg, &Content, bReplyAll, &(g_jmms_context->msg_handle));
- if (eRet != JC_OK)
- {
- mmi_jmms_error_handler(eRet);
- goto END;
- }
- eRet = mmi_jmms_jdi_msg_register_callback(g_jmms_context->msg_handle, E_CB_ERROR_IND, (void*)mmi_jmms_error_ind_cb);
- if (eRet != JC_OK)
- {
- mmi_jmms_error_handler(eRet);
- goto END;
- }
- eRet = mmi_jmms_jdi_set_content_class(g_jmms_context->msg_handle, MMS_SUPPORTED_CONTENT_CLASS);
- if (eRet != JC_OK)
- {
- mmi_jmms_error_handler(eRet);
- goto END;
- }
- eRet = mmi_jmms_jdi_set_creation_mode(g_jmms_context->msg_handle, mmi_jmms_compose_settings_creation_mode());
- if (eRet != JC_OK)
- {
- mmi_jmms_error_handler(eRet);
- goto END;
- }
- eRet = mmi_jmms_jdi_set_msg_type(g_jmms_context->msg_handle, E_TYPE_MMS);
- if (eRet != JC_OK)
- {
- mmi_jmms_error_handler(eRet);
- goto END;
- }
- eRet = mmi_jmms_jdi_set_presentation_type(g_jmms_context->msg_handle, E_PRESENTATION_SMIL);
- if (eRet != JC_OK)
- {
- mmi_jmms_error_handler(eRet);
- goto END;
- }
- eRet = mmi_jmms_jdi_set_max_pages(g_jmms_context->msg_handle, (U8) mmi_jmms_compose_settings_max_no_pages());
- if (eRet != JC_OK)
- {
- mmi_jmms_error_handler(eRet);
- goto END;
- }
- eRet = mmi_jmms_jdi_msg_register_callback(
- g_jmms_context->msg_handle,
- E_CB_REPLY_CHARGING,
- (void*)mmi_jmms_reply_charging_ind_cb);
- if (eRet != JC_OK)
- {
- mmi_jmms_error_handler(eRet);
- goto END;
- }
- eRet = mmi_jmms_jdi_get_msg_headers(g_jmms_context->msg_handle, &pMsgHeaders);
- if (eRet != JC_OK || pMsgHeaders == NULL)
- {
- eRet = JC_ERR_STORE_FILE_CORRUPTED;
- mmi_jmms_error_handler(eRet);
- goto END;
- }
- if (pMsgHeaders->eMsgType != E_MSG_TYPE_SEND)
- {
- DisplayPopup((U8*) GetString(STR_GLOBAL_ERROR), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, (U8) ERROR_TONE);
- goto END;
- }
- send_p = (MESSAGE_SEND*) (pMsgHeaders->pHeaders);
- mmi_jmms_free_addresses_list();
- /* /Make the To Addresses list */
- if (send_p->pTo != NULL)
- {
- str = (S8*) (send_p->pTo);
- len = 0;
- start_index = 0;
- g_jmms_context->address_list_flag = E_TO_ADDRESSES;
- while (pfnUnicodeStrcmp(str, "