JMMSUMHandling.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:79k
源码类别:
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) 2005
- *
- * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
- * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
- * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
- *
- * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
- * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
- * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
- * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
- * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
- * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
- *
- *****************************************************************************/
- /*****************************************************************************
- *
- * Filename:
- * ---------
- * JMMSUMHandling.c
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * This file contains all the function calls for handling UM requests.
- *
- * 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!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
- #ifndef _MMI_JMMSUMHANDLE_C
- #define _MMI_JMMSUMHANDLE_C
- #include "MMI_features.h"
- #if defined (JATAAYU_SUPPORT) && defined (WAP_SUPPORT)
- #ifdef __MMI_UNIFIED_MESSAGE__
- #include "PixtelDataTypes.h"
- #include "Unicodexdcl.h"
- #include "HistoryGprot.h"
- #include "GlobalDefs.h"
- #include "CommonScreens.h"
- #include "SettingProfile.h"
- #include "NVRAMType.h"
- #include "NVRAMProt.h"
- #include "NVRAMEnum.h"
- #include "MessagesResourceData.h"
- #include "wgui_categories.h"
- #include "wgui_categories_inputs.h"
- #include "wap_ps_struct.h"
- #include "wapadp.h"
- #include "ddl.h"
- #include "jcal.h"
- #include "jdd_memapi.h"
- #include "jdi_communicator.h"
- #include "jdi_BrowserDatatype.h"
- #include "JBrowserMMIDefs.h"
- #include "JBrowserMMIProts.h"
- #include "JBrowserMMITypes.h"
- // #include "JBrowserStartup.h"
- /* PMT DARA PROFILE HANDLER 020106 */
- #include "JProfileHandlerTypes.h"
- #include "JProfileHandlerProts.h"
- #include "time.h"
- #include "JMMSCoreAPI.h"
- #include "JMMSStoreHandling.h"
- #include "JMMSMainMMS.h"
- #include "JMMSStructs.h"
- #include "JMMSConfig.h"
- #include "JMMSExdcl.h"
- #include "JMMSUMHandling.h"
- #include "JMMSInbox.h"
- #include "JMMSOutbox.h"
- #include "JMMSDrafts.h"
- #include "JMMSSent.h"
- #include "JMMSTemplates.h"
- #include "JPushInboxCommonAPIs.h"
- #include "JPushInboxUM.h"
- #include "JPushInboxCommonUI.h"
- #include "wgui_status_icons.h"
- #include "SubLCDHistoryGprot.h"
- #include "jdi_MMSErr.h"
- #include "JMMSResEnum.h"
- #include "UnifiedMessageProt.h"
- #include "DateTimeGprot.h"
- #include "app_datetime.h"
- #include "PhoneBookGprot.h"
- #include "JMMSProtocols.h" // compiler warning removal
- extern void *g_um_jmms_rsp_struct = NULL;
- extern void mmi_jmms_set_folder_message_size(S32 number);
- void (*mmi_um_jmms_folder_list_callback) (void) = NULL;
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_set_folder_list_callback_function
- * DESCRIPTION
- *
- * PARAMETERS
- * f [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_set_folder_list_callback_function(void (*f) (void))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_um_jmms_folder_list_callback = f;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_dummy_folder_list_callback
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_dummy_folder_list_callback(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* dummy call */
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_delete_all_msgs_list
- * DESCRIPTION
- *
- * PARAMETERS
- * folder_type_list [IN]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_jmms_delete_all_msgs_list(UmMsgBoxType folder_type_list)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_RETCODE eRet = JC_OK;
- U8 msgs = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* folder_type = UM_MSG_BOX_TYPE_INBOX | UM_MSG_BOX_TYPE_UNSENT | UM_MSG_BOX_TYPE_SENT | UM_MSG_BOX_TYPE_DRAFT; */
- if (folder_type_list & UM_MSG_BOX_TYPE_INBOX)
- {
- if(mmi_jmms_is_immediate_retrival_underway())
- {
- return -1;
- }
- eRet = mmi_mms_get_number_of_messages(MMI_JMMS_INBOX, &msgs);
- if (eRet == JC_OK && msgs != 0)
- {
- eRet = mmi_jmms_delete_all_message(MMI_JMMS_INBOX);
- /* reset all msgs status as unread */
- mmi_jmms_delete_all_msgs_status();
- 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));
- }
- if (eRet != JC_OK)
- {
- return eRet;
- }
- }
- if (eRet != JC_OK)
- {
- return eRet;
- }
- }
- if (folder_type_list & UM_MSG_BOX_TYPE_UNSENT)
- {
- eRet = mmi_mms_get_number_of_messages(MMI_JMMS_OUTBOX, &msgs);
- if (eRet == JC_OK && msgs != 0)
- {
- eRet = mmi_jmms_delete_all_message(MMI_JMMS_OUTBOX);
- 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));
- }
- }
- if (eRet != JC_OK)
- {
- return eRet;
- }
- }
- if (folder_type_list & UM_MSG_BOX_TYPE_SENT)
- {
- eRet = mmi_mms_get_number_of_messages(MMI_JMMS_SENT, &msgs);
- if (eRet == JC_OK && msgs != 0)
- {
- eRet = mmi_jmms_delete_all_message(MMI_JMMS_SENT);
- 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));
- }
- }
- if (eRet != JC_OK)
- {
- return eRet;
- }
- }
- if (folder_type_list & UM_MSG_BOX_TYPE_DRAFT)
- {
- eRet = mmi_mms_get_number_of_messages(MMI_JMMS_DRAFTS, &msgs);
- if (eRet == JC_OK && msgs != 0)
- {
- eRet = mmi_jmms_delete_all_message(MMI_JMMS_DRAFTS);
- 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));
- }
- }
- if (eRet != JC_OK)
- {
- return eRet;
- }
- }
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jataayu_entry_message_mms
- * DESCRIPTION
- *
- * PARAMETERS
- * msg_box_type [IN]
- * msg_index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jataayu_entry_message_mms(UmMsgBoxType msg_box_type, kal_uint16 msg_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 total_msgs = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_jmms_context->nCurr_scr_hilited_index = msg_index;
- mmi_um_jmms_free_msgs_list();
- switch (msg_box_type)
- {
- case UM_MSG_BOX_TYPE_INBOX:
- mmi_mms_get_number_of_messages(MMI_JMMS_INBOX, &total_msgs);
- g_jmms_context->store_context->nMsgs_in_Current_folder = total_msgs;
- g_jmms_context->store_context->update_nmsgs_in_current_folder = 0;
- g_jmms_context->store_context->current_folder_name = E_JMMS_INBOX;
- g_jmms_context->store_context->jmms_start_index = 1;
- /* 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] =
- (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);
- g_jmms_context->last_scr_id = 0; /* To fix LSK option issue for Notification, RReport,DReport & JSR Mesages */
- mmi_jmms_inbox_view();
- break;
- case UM_MSG_BOX_TYPE_UNSENT:
- mmi_mms_get_number_of_messages(MMI_JMMS_OUTBOX, &total_msgs);
- g_jmms_context->store_context->nMsgs_in_Current_folder = total_msgs;
- g_jmms_context->store_context->update_nmsgs_in_current_folder = 0;
- g_jmms_context->store_context->current_folder_name = E_JMMS_OUTBOX;
- g_jmms_context->store_context->jmms_start_index = 1;
- /* set the open msg status- for At delete */
- g_jmms_context->msg_open_status[0] = E_JMMS_OUTBOX;
- g_jmms_context->msg_open_status[1] =
- (U32) mmi_jmms_get_message_id(
- MMI_JMMS_OUTBOX,
- g_jmms_context->store_context->nMsgs_in_Current_folder - g_jmms_context->nCurr_scr_hilited_index);
- mmi_jmms_outbox_view();
- break;
- case UM_MSG_BOX_TYPE_SENT:
- mmi_mms_get_number_of_messages(MMI_JMMS_SENT, &total_msgs);
- g_jmms_context->store_context->nMsgs_in_Current_folder = total_msgs;
- g_jmms_context->store_context->update_nmsgs_in_current_folder = 0;
- g_jmms_context->store_context->current_folder_name = E_JMMS_SENT;
- g_jmms_context->store_context->jmms_start_index = 1;
- /* set the open msg status- for At delete */
- g_jmms_context->msg_open_status[0] = E_JMMS_SENT;
- g_jmms_context->msg_open_status[1] =
- (U32) mmi_jmms_get_message_id(
- MMI_JMMS_SENT,
- g_jmms_context->store_context->nMsgs_in_Current_folder - g_jmms_context->nCurr_scr_hilited_index);
- mmi_um_jmms_set_folder_list_callback_function(mmi_jmms_sent_view);
- mmi_jmms_sent_view();
- break;
- case UM_MSG_BOX_TYPE_DRAFT:
- mmi_mms_get_number_of_messages(MMI_JMMS_DRAFTS, &total_msgs);
- g_jmms_context->store_context->nMsgs_in_Current_folder = total_msgs;
- g_jmms_context->store_context->update_nmsgs_in_current_folder = 0;
- g_jmms_context->store_context->current_folder_name = E_JMMS_DRAFTS;
- g_jmms_context->store_context->jmms_start_index = 1;
- /* set the open msg status- for At delete */
- g_jmms_context->msg_open_status[0] = E_JMMS_DRAFTS;
- g_jmms_context->msg_open_status[1] =
- (U32) mmi_jmms_get_message_id(
- MMI_JMMS_DRAFTS,
- g_jmms_context->store_context->nMsgs_in_Current_folder - g_jmms_context->nCurr_scr_hilited_index);
- mmi_jmms_drafts_view();
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_free_msgs_list
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_free_msgs_list(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- jmms_folder_msgs_list *list;
- jmms_folder_msgs_list *list1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_jmms_context->store_context != NULL && g_jmms_context->store_context->messages_list != NULL)
- {
- list = g_jmms_context->store_context->messages_list;
- while (list != NULL)
- {
- list1 = list->next;
- if (list->um_msg_info != NULL && list->um_msg_info->msg_index != g_jmms_context->nCurr_scr_hilited_index)
- {
- jdd_MemFree(list->um_msg_info);
- list->um_msg_info = NULL;
- }
- list = list1;
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_create_new_mms_hint_for_sent
- * DESCRIPTION
- *
- * PARAMETERS
- * mms_info_rsp [IN]
- * to [?]
- * cc [?]
- * bcc [?]
- * msg_counter [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_create_new_mms_hint_for_sent(
- mmi_um_msg_info_struct **mms_info_rsp,
- JC_CHAR *to,
- JC_CHAR *cc,
- JC_CHAR *bcc,
- S32 msg_counter)
- {
- /*----------------------------------------------------------------*/
- /* 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;
- }
- if (is_email == MMI_TRUE)
- {
- (*mms_info_rsp)->address_type = UM_ADDR_TYPE_EMAIL_ADDRESS;
- }
- else
- {
- (*mms_info_rsp)->address_type = UM_ADDR_TYPE_PHONE_NUMBER;
- }
- pfnUnicodeStrncpy((S8*) (*mms_info_rsp)->address, (S8*) (to + start_index), len_to_copy);
- (*mms_info_rsp)->address_length = 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;
- }
- if (is_email == MMI_TRUE)
- {
- (*mms_info_rsp)->address_type = UM_ADDR_TYPE_EMAIL_ADDRESS;
- }
- else
- {
- (*mms_info_rsp)->address_type = UM_ADDR_TYPE_PHONE_NUMBER;
- }
- pfnUnicodeStrncpy((S8*) (*mms_info_rsp)->address, (S8*) (cc + start_index), len_to_copy);
- (*mms_info_rsp)->address_length = 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;
- }
- if (is_email == MMI_TRUE)
- {
- (*mms_info_rsp)->address_type = UM_ADDR_TYPE_EMAIL_ADDRESS;
- }
- else
- {
- (*mms_info_rsp)->address_type = UM_ADDR_TYPE_PHONE_NUMBER;
- }
- pfnUnicodeStrncpy((S8*) (*mms_info_rsp)->address, (S8*) (bcc + start_index), len_to_copy);
- (*mms_info_rsp)->address_length = len_to_copy;
- return;
- }
- (*mms_info_rsp)->address_length = 0;
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_add_mms_sub_for_list_info
- * DESCRIPTION
- *
- * PARAMETERS
- * mms_info_rsp [IN]
- * subject_p [?]
- * msg_counter [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_add_mms_sub_for_list_info(mmi_um_msg_info_struct **mms_info_rsp, JC_CHAR *subject_p, S32 msg_counter)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 len_to_copy = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- len_to_copy = pfnUnicodeStrlen((S8*) (subject_p)) * ENCODING_LENGTH;
- if (len_to_copy > MMI_UM_MAX_SUBJECT_LEN)
- {
- len_to_copy = MMI_UM_MAX_SUBJECT_LEN;
- }
- pfnUnicodeStrncpy((S8*) (*mms_info_rsp)->subject, (S8*) (subject_p), len_to_copy);
- (*mms_info_rsp)->subject_length = len_to_copy;
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_add_mms_address_for_list_info
- * DESCRIPTION
- *
- * PARAMETERS
- * mms_info_p [IN]
- * from_p [?]
- * msg_counter [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_add_mms_address_for_list_info(mmi_um_msg_info_struct **mms_info_p, JC_CHAR *from_p, S32 msg_counter)
- {
- /*----------------------------------------------------------------*/
- /* 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 (from_p != NULL)
- {
- str = (S8*) (from_p);
- 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;
- }
- if (is_email == MMI_TRUE)
- {
- (*mms_info_p)->address_type = UM_ADDR_TYPE_EMAIL_ADDRESS;
- }
- else
- {
- (*mms_info_p)->address_type = UM_ADDR_TYPE_PHONE_NUMBER;
- }
- pfnUnicodeStrncpy((S8*) (*mms_info_p)->address, (S8*) (from_p + start_index), len_to_copy);
- (*mms_info_p)->address_length = len_to_copy;
- return;
- }
- (*mms_info_p)->address_length = len_to_copy;
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_at_delete_pre_set
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_at_delete_pre_set(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_jmms_context->msg_open_status[0] = 0;
- g_jmms_context->msg_open_status[1] = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_store_update_message
- * DESCRIPTION
- *
- * PARAMETERS
- * pFolderName [?]
- * uiExtraBytes [IN]
- * media_count [IN]
- * uiMsgIndex [IN]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_um_jmms_store_update_message(
- S8 *pFolderName,
- JC_UINT32 uiExtraBytes,
- U8 media_count,
- JC_UINT32 uiMsgIndex)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MESSAGE_HEADERS *pMsgHeaders = NULL;
- JC_RETCODE eRet = JC_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- eRet = mmi_jmms_jdi_get_msg_headers(g_jmms_context->msg_handle, &pMsgHeaders);
- if (eRet != JC_OK || pMsgHeaders == NULL)
- {
- return eRet;
- }
- if (media_count > 0)
- {
- uiExtraBytes = uiExtraBytes | 0x01000000;
- mmi_um_update_status_attachment(
- g_jmms_context->g_attachment_pending_list->index_to_parse,
- E_JMMS_ATTACHMENT_PRESENT);
- }
- else
- {
- uiExtraBytes = uiExtraBytes | 0x02000000;
- mmi_um_update_status_attachment(
- g_jmms_context->g_attachment_pending_list->index_to_parse,
- E_JMMS_ATTACHMENT_NOT_PRESENT);
- }
- if (g_jmms_context->msg_handle != NULL)
- {
- mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
- g_jmms_context->msg_handle = NULL;
- }
- eRet = mmi_jmms_store_update_message_extrabyte(pFolderName, uiMsgIndex, uiExtraBytes);
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_free_attacment_pending_status_list
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_free_attacment_pending_status_list(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- um_jmms_attachment_present_list *temp_pending_list_p = g_jmms_context->g_attachment_pending_list;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- while (temp_pending_list_p != NULL)
- {
- g_jmms_context->g_attachment_pending_list = g_jmms_context->g_attachment_pending_list->next;
- jdd_MemFree(temp_pending_list_p);
- temp_pending_list_p = g_jmms_context->g_attachment_pending_list;
- }
- temp_pending_list_p = NULL;
- g_jmms_context->g_attachment_pending_list = NULL;
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_add_new_node_attachment_pending_list
- * DESCRIPTION
- *
- * PARAMETERS
- * temp_pending_list_p [?]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_add_new_node_attachment_pending_list(um_jmms_attachment_present_list *temp_pending_list_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- um_jmms_attachment_present_list *pending_list_p = g_jmms_context->g_attachment_pending_list;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (pending_list_p == NULL)
- {
- g_jmms_context->g_attachment_pending_list = temp_pending_list_p;
- }
- else
- {
- while (pending_list_p->next != NULL)
- {
- pending_list_p = pending_list_p->next;
- }
- pending_list_p->next = temp_pending_list_p;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_parse_attachment_async_callback
- * DESCRIPTION
- *
- * PARAMETERS
- * eRet [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_parse_attachment_async_callback(JC_RETCODE eRet)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 media_count = 0;
- U32 uiExtraBytes = 0;
- mmi_um_get_list_rsp_struct *mms_info_rsp = NULL;
- um_jmms_attachment_present_list *temp_pending_list_p = NULL;
- U8 number = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mms_info_rsp = (mmi_um_get_list_rsp_struct*) g_um_jmms_rsp_struct;
- temp_pending_list_p = g_jmms_context->g_attachment_pending_list;
- if (temp_pending_list_p != NULL && eRet == JC_OK)
- {
- mmi_jmms_jdi_get_media_count(g_jmms_context->msg_handle, 0, &media_count, E_TRUE);
- switch (mms_info_rsp->msg_box_type)
- {
- case UM_MSG_BOX_TYPE_INBOX:
- mmi_mms_get_number_of_messages(MMI_JMMS_INBOX, &number);
- uiExtraBytes =
- (U32) mmi_jmms_get_message_id(MMI_JMMS_INBOX, (U16) (number - temp_pending_list_p->index_to_parse));
- eRet = mmi_um_jmms_store_update_message(
- MMI_JMMS_INBOX,
- uiExtraBytes,
- media_count,
- (number - temp_pending_list_p->index_to_parse));
- break;
- case UM_MSG_BOX_TYPE_UNSENT:
- mmi_mms_get_number_of_messages(MMI_JMMS_OUTBOX, &number);
- uiExtraBytes =
- (U32) mmi_jmms_get_message_id(
- MMI_JMMS_OUTBOX,
- (U16) (number - temp_pending_list_p->index_to_parse));
- eRet = mmi_um_jmms_store_update_message(
- MMI_JMMS_OUTBOX,
- uiExtraBytes,
- media_count,
- (number - temp_pending_list_p->index_to_parse));
- break;
- case UM_MSG_BOX_TYPE_SENT:
- mmi_mms_get_number_of_messages(MMI_JMMS_SENT, &number);
- uiExtraBytes =
- (U32) mmi_jmms_get_message_id(MMI_JMMS_SENT, (U16) (number - temp_pending_list_p->index_to_parse));
- eRet = mmi_um_jmms_store_update_message(
- MMI_JMMS_SENT,
- uiExtraBytes,
- media_count,
- (number - temp_pending_list_p->index_to_parse));
- break;
- case UM_MSG_BOX_TYPE_DRAFT:
- mmi_mms_get_number_of_messages(MMI_JMMS_DRAFTS, &number);
- uiExtraBytes =
- (U32) mmi_jmms_get_message_id(
- MMI_JMMS_DRAFTS,
- (U16) (number - temp_pending_list_p->index_to_parse));
- eRet = mmi_um_jmms_store_update_message(
- MMI_JMMS_DRAFTS,
- uiExtraBytes,
- media_count,
- (number - temp_pending_list_p->index_to_parse));
- }
- }
- if (g_jmms_context->pParseContent != NULL)
- {
- if (g_jmms_context->pParseContent->pFileName != NULL)
- {
- jdd_MemFree(g_jmms_context->pParseContent->pFileName);
- g_jmms_context->pParseContent->pFileName = NULL;
- }
- jdd_MemFree(g_jmms_context->pParseContent);
- g_jmms_context->pParseContent = NULL;
- }
- if (g_jmms_context->msg_handle != NULL)
- {
- mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
- g_jmms_context->msg_handle = NULL;
- }
- /* if (eRet!=JC_OK)
- {
- mmi_jmms_free_attacment_pending_status_list();
- mmi_um_jmms_get_message_list_rsp();
- return;
- } */
- if (temp_pending_list_p != NULL)
- {
- g_jmms_context->g_attachment_pending_list = g_jmms_context->g_attachment_pending_list->next;
- jdd_MemFree(temp_pending_list_p);
- temp_pending_list_p = NULL;
- if (g_jmms_context->g_attachment_pending_list != NULL)
- {
- mmi_um_jmms_parse_mms_for_attachment();
- }
- else
- {
- mmi_um_jmms_get_message_list_rsp();
- }
- }
- else
- {
- mmi_um_jmms_get_message_list_rsp();
- }
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_update_status_attachment
- * DESCRIPTION
- *
- * PARAMETERS
- * msg_index [IN]
- * attachment_status [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_update_status_attachment(U16 msg_index, mmi_jmms_mms_attachment_status_enum attachment_status)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- jmms_folder_msgs_list *msg_list_p = g_jmms_context->store_context->messages_list;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- while (msg_list_p != NULL)
- {
- if (msg_list_p->um_msg_info->msg_index == msg_index)
- {
- msg_list_p->attachment_status = attachment_status;
- return;
- }
- msg_list_p = msg_list_p->next;
- }
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_get_fill_list_info
- * DESCRIPTION
- *
- * PARAMETERS
- * mms_info_rsp [?]
- * msg_info_req [?]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_get_fill_list_info(
- mmi_um_get_msg_info_rsp_struct *mms_info_rsp,
- mmi_um_get_msg_info_req_struct *msg_info_req)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 tzdiff = 0;
- S32 msg_counter = 0;
- jmms_folder_msgs_list *msg_list_p = g_jmms_context->store_context->messages_list;
- S8 *name = NULL;
- applib_time_struct time;
- FLOAT tz;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- tz = mmi_dt_get_tz();
- if(tz < 0)
- {
- time = applib_conv_tz_to_mytime(tz * (-1));
- }
- else
- {
- time = applib_conv_tz_to_mytime(tz);
- }
- tzdiff = time.nHour * 3600 + time.nMin * 60 + time.nSec; //mmi_dt_mytime_2_utc_sec(&time, MMI_TRUE);
- while (msg_list_p != NULL && msg_list_p->um_msg_info->msg_index != mms_info_rsp->start_entry)
- {
- msg_list_p = msg_list_p->next;
- }
- for (msg_counter = 0; (msg_list_p != NULL && msg_counter <= mms_info_rsp->msg_number); msg_counter++)
- {
- mms_info_rsp->msg_info[msg_counter].timestamp = msg_list_p->um_msg_info->timestamp;
- if(mms_info_rsp->msg_info[msg_counter].timestamp)
- {
- if(tz > 0)
- {
- mms_info_rsp->msg_info[msg_counter].timestamp += tzdiff;
- }
- else
- {
- mms_info_rsp->msg_info[msg_counter].timestamp -= tzdiff;
- }
- }
- switch (msg_list_p->attachment_status)
- {
- case E_JMMS_ATTACHMENT_PRESENT:
- mms_info_rsp->msg_info[msg_counter].icon_id = IMG_ID_JMMS_MMS_WITH_ATTACHMENT;
- break;
- case E_JMMS_ATTACHMENT_NOT_PRESENT:
- mms_info_rsp->msg_info[msg_counter].icon_id = IMG_ID_JMMS_MMS_WITHOUT_ATTACHMENT;
- break;
- default:
- mms_info_rsp->msg_info[msg_counter].icon_id = IMG_ID_JMMS_MMS_WITHOUT_ATTACHMENT;
- break;
- break;
- }
- mms_info_rsp->msg_info[msg_counter].msg_index = msg_list_p->um_msg_info->msg_index;
- pfnUnicodeStrcpy((S8*) mms_info_rsp->msg_info[msg_counter].address, (S8*) msg_list_p->um_msg_info->address);
- mms_info_rsp->msg_info[msg_counter].address_length = msg_list_p->um_msg_info->address_length;
- mms_info_rsp->msg_info[msg_counter].address_type = msg_list_p->um_msg_info->address_type;
- pfnUnicodeStrcpy((S8*) mms_info_rsp->msg_info[msg_counter].subject, (S8*) msg_list_p->um_msg_info->subject);
- mms_info_rsp->msg_info[msg_counter].subject_length = msg_list_p->um_msg_info->subject_length;
- if (mms_info_rsp->msg_info[msg_counter].address_type == UM_ADDR_TYPE_PHONE_NUMBER)
- {
- name = (S8*) lookUpNumber((PS8) mms_info_rsp->msg_info[msg_counter].address);
- if (pfnUnicodeStrlen(name))
- {
- pfnUnicodeStrncpy(
- (S8*) mms_info_rsp->msg_info[msg_counter].address,
- (S8*) name,
- pfnUnicodeStrlen(name));
- mms_info_rsp->msg_info[msg_counter].address_length = pfnUnicodeStrlen(name);
- }
- }
- name = NULL;
- msg_list_p = msg_list_p->next;
- } /* End of For Loop */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_parse_mms_for_attachment
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_parse_mms_for_attachment(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_RETCODE eRet = JC_OK;
- U8 number = 0;
- um_jmms_attachment_present_list *temp_pending_list_p = NULL;
- mmi_um_get_list_rsp_struct *mms_info_rsp = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mms_info_rsp = (mmi_um_get_list_rsp_struct*) g_um_jmms_rsp_struct;
- temp_pending_list_p = g_jmms_context->g_attachment_pending_list;
- if (g_jmms_context->pParseContent == NULL)
- {
- g_jmms_context->pParseContent = (CONTENT_DATA*) jdd_MemAlloc(sizeof(CONTENT_DATA), 1);
- }
- g_jmms_context->pParseContent->bIsStream = E_TRUE;
- if (g_jmms_context->msg_handle != NULL)
- {
- mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
- g_jmms_context->msg_handle = NULL;
- }
- if (temp_pending_list_p != NULL)
- {
- switch (mms_info_rsp->msg_box_type)
- {
- case UM_MSG_BOX_TYPE_INBOX:
- mmi_mms_get_number_of_messages(MMI_JMMS_INBOX, &number);
- eRet = mmi_jmms_get_message(
- MMI_JMMS_INBOX,
- g_jmms_context->pParseContent,
- number - temp_pending_list_p->index_to_parse);
- break;
- case UM_MSG_BOX_TYPE_UNSENT:
- mmi_mms_get_number_of_messages(MMI_JMMS_OUTBOX, &number);
- eRet = mmi_jmms_get_message(
- MMI_JMMS_OUTBOX,
- g_jmms_context->pParseContent,
- number - temp_pending_list_p->index_to_parse);
- break;
- case UM_MSG_BOX_TYPE_SENT:
- mmi_mms_get_number_of_messages(MMI_JMMS_SENT, &number);
- eRet = mmi_jmms_get_message(
- MMI_JMMS_SENT,
- g_jmms_context->pParseContent,
- number - temp_pending_list_p->index_to_parse);
- break;
- case UM_MSG_BOX_TYPE_DRAFT:
- mmi_mms_get_number_of_messages(MMI_JMMS_DRAFTS, &number);
- eRet = mmi_jmms_get_message(
- MMI_JMMS_DRAFTS,
- g_jmms_context->pParseContent,
- number - temp_pending_list_p->index_to_parse);
- break;
- }
- if (eRet != JC_OK)
- {
- mmi_um_jmms_parse_attachment_async_callback(eRet);
- return;
- }
- eRet = mmi_jmms_jdi_parse_msg_buffer(
- &g_jmms_context->msg_handle,
- g_jmms_context->pParseContent,
- E_TYPE_MMS,
- E_TRUE);
- if (eRet == JC_ERR_MMS_PARSE_PENDING)
- {
- mmi_jmms_parse_continue_start_timer(
- g_jmms_context->msg_handle,
- mmi_um_jmms_parse_attachment_async_callback, mmi_jmms_only_abort_parsing_progress);
- return;
- }
- }
- mmi_um_jmms_parse_attachment_async_callback(eRet);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_get_fill_list
- * DESCRIPTION
- *
- * PARAMETERS
- * mms_list_rsp [?]
- * msg_list_req [?]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_get_fill_list(mmi_um_get_list_rsp_struct *mms_list_rsp, mmi_um_get_list_req_struct *msg_list_req)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_RETCODE eRet = JC_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_jmms_context->store_context->jmms_start_index = mms_list_rsp->start_entry + 1;
- switch (mms_list_rsp->msg_box_type)
- {
- case UM_MSG_BOX_TYPE_INBOX:
- eRet = mmi_jmms_get_folder_msg_list(
- &(g_jmms_context->store_context->messages_list),
- MMI_JMMS_INBOX,
- mms_list_rsp->msg_number);
- break;
- case UM_MSG_BOX_TYPE_UNSENT:
- eRet = mmi_jmms_get_folder_msg_list(
- &(g_jmms_context->store_context->messages_list),
- MMI_JMMS_OUTBOX,
- mms_list_rsp->msg_number);
- break;
- case UM_MSG_BOX_TYPE_SENT:
- eRet = mmi_jmms_get_folder_msg_list(
- &(g_jmms_context->store_context->messages_list),
- MMI_JMMS_SENT,
- mms_list_rsp->msg_number);
- break;
- case UM_MSG_BOX_TYPE_DRAFT:
- eRet = mmi_jmms_get_folder_msg_list(
- &(g_jmms_context->store_context->messages_list),
- MMI_JMMS_DRAFTS,
- mms_list_rsp->msg_number);
- break;
- }
- if (eRet != JC_OK || g_jmms_context->store_context->messages_list == NULL)
- {
- return;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_generate_list
- * DESCRIPTION
- *
- * PARAMETERS
- * mms_list_rsp [?]
- * RETURNS
- *
- *****************************************************************************/
- JC_RETCODE mmi_um_jmms_generate_list(mmi_um_get_list_rsp_struct *mms_list_rsp)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_RETCODE eRet = JC_OK;
- S32 msg_counter = 0;
- U32 tzdiff = 0;
- applib_time_struct time;
- FLOAT tz;
- jmms_folder_msgs_list *msg_list_p = g_jmms_context->store_context->messages_list;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msg_counter = 0;
- if (msg_list_p == NULL)
- {
- return JC_ERR_MEMORY_ALLOCATION;
- }
- tz = mmi_dt_get_tz();
- if(tz < 0)
- {
- time = applib_conv_tz_to_mytime(tz * (-1));
- }
- else
- {
- time = applib_conv_tz_to_mytime(tz);
- }
- tzdiff = time.nHour * 3600 + time.nMin * 60 + time.nSec;
- while (msg_list_p != NULL)
- {
- mms_list_rsp->list_info[msg_counter].timestamp = msg_list_p->um_msg_info->timestamp;
- if(mms_list_rsp->list_info[msg_counter].timestamp)
- {
- if(tz > 0)
- {
- mms_list_rsp->list_info[msg_counter].timestamp += tzdiff;
- }
- else
- {
- mms_list_rsp->list_info[msg_counter].timestamp -= tzdiff;
- }
- }
- mms_list_rsp->list_info[msg_counter].msg_index = msg_list_p->um_msg_info->msg_index;
- msg_counter++;
- msg_list_p = msg_list_p->next;
- }
- return eRet;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_delete_all
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_delete_all(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_jmms_context->msg_handle != NULL)
- {
- mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
- g_jmms_context->msg_handle = NULL;
- }
- switch (g_jmms_context->store_context->current_folder_name)
- {
- case E_JMMS_INBOX:
- HistoryReplace(SCR_ID_UM_INBOX, SCR_ID_UM_INBOX, mmi_um_jmms_pre_entry_inbox);
- DeleteUptoScrID(SCR_ID_UM_INBOX);
- mmi_um_delete_highlight_folder(UM_MSG_BOX_TYPE_INBOX);
- break;
- case E_JMMS_OUTBOX:
- HistoryReplace(SCR_ID_UM_UNSENT, SCR_ID_UM_UNSENT, mmi_um_jmms_pre_entry_outbox);
- DeleteUptoScrID(SCR_ID_UM_UNSENT);
- mmi_um_delete_highlight_folder(UM_MSG_BOX_TYPE_UNSENT);
- break;
- case E_JMMS_SENT:
- HistoryReplace(SCR_ID_UM_SENT, SCR_ID_UM_SENT, mmi_um_jmms_pre_entry_sent);
- DeleteUptoScrID(SCR_ID_UM_SENT);
- mmi_um_delete_highlight_folder(UM_MSG_BOX_TYPE_SENT);
- break;
- case E_JMMS_DRAFTS:
- HistoryReplace(SCR_ID_UM_DRAFT, SCR_ID_UM_DRAFT, mmi_um_jmms_pre_entry_draft);
- DeleteUptoScrID(SCR_ID_UM_DRAFT);
- mmi_um_delete_highlight_folder(UM_MSG_BOX_TYPE_DRAFT);
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_get_push_message_count_req
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_get_push_message_count_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- mmi_um_get_msg_num_rsp_struct *mms_count_rsp_p;
- U8 total_num_unread_messages = 0;
- U8 number = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mms_count_rsp_p = (mmi_um_get_msg_num_rsp_struct*) OslConstructDataPtr(sizeof(mmi_um_get_msg_num_rsp_struct));
- mms_count_rsp_p->result = KAL_TRUE;
- mms_count_rsp_p->msg_type = UM_MSG_TYPE_MMS;
- mmi_jmms_get_number_of_unread_messages_in_inbox(&total_num_unread_messages); /* mms_count_rsp_p->inbox_unread_msg_number = 0; */
- mmi_mms_get_number_of_messages(MMI_JMMS_INBOX, &number);
- mms_count_rsp_p->inbox_unread_msg_number = total_num_unread_messages;
- mms_count_rsp_p->inbox_read_msg_number = number - total_num_unread_messages;
- mmi_mms_get_number_of_messages(MMI_JMMS_OUTBOX, &number);
- mms_count_rsp_p->unsent_msg_number = number;
- mmi_mms_get_number_of_messages(MMI_JMMS_SENT, &number);
- mms_count_rsp_p->sent_msg_number = number;
- mmi_mms_get_number_of_messages(MMI_JMMS_DRAFTS, &number);
- mms_count_rsp_p->draft_msg_number = number;
- 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));
- }
- /* Prepare response structure */
- Message.oslSrcId = MOD_WAP;
- Message.oslDestId = MOD_MMI;
- Message.oslMsgId = MSG_ID_MMI_UM_GET_MSG_NUM_RSP;
- Message.oslDataPtr = (oslParaType*) mms_count_rsp_p;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_get_message_list_rsp
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_get_message_list_rsp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- mmi_um_get_list_rsp_struct *mms_list_rsp = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mms_list_rsp = (mmi_um_get_list_rsp_struct*) g_um_jmms_rsp_struct;
- mms_list_rsp->result = KAL_TRUE;
- mmi_um_jmms_generate_list(mms_list_rsp);
- /* Prepare response structure */
- Message.oslSrcId = MOD_WAP;
- Message.oslDestId = MOD_MMI;
- Message.oslMsgId = MSG_ID_MMI_UM_GET_LIST_RSP;
- /* Send Response to MMI Queue */
- Message.oslDataPtr = (oslParaType*) mms_list_rsp;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_get_mms_message_list_req
- * DESCRIPTION
- *
- * PARAMETERS
- * msg_list_req [?]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_get_mms_message_list_req(mmi_um_get_list_req_struct *msg_list_req)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_um_get_list_rsp_struct *mms_list_rsp;
- U8 number = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (msg_list_req->msg_box_type)
- {
- case UM_MSG_BOX_TYPE_INBOX:
- mmi_mms_get_number_of_messages(MMI_JMMS_INBOX, &number);
- break;
- case UM_MSG_BOX_TYPE_UNSENT:
- mmi_mms_get_number_of_messages(MMI_JMMS_OUTBOX, &number);
- break;
- case UM_MSG_BOX_TYPE_SENT:
- mmi_mms_get_number_of_messages(MMI_JMMS_SENT, &number);
- break;
- case UM_MSG_BOX_TYPE_DRAFT:
- mmi_mms_get_number_of_messages(MMI_JMMS_DRAFTS, &number);
- break;
- }
- mms_list_rsp = (mmi_um_get_list_rsp_struct*) OslConstructDataPtr(sizeof(mmi_um_get_list_rsp_struct));
- // memset(mms_list_rsp, 0, sizeof(mmi_um_get_list_rsp_struct));
- mms_list_rsp->msg_type = UM_MSG_TYPE_MMS;
- mms_list_rsp->msg_box_type = msg_list_req->msg_box_type;
- mms_list_rsp->start_entry = msg_list_req->start_entry;
- if (mms_list_rsp->start_entry + MMI_UM_MAX_GET_LIST_MSG_NUMBER < number)
- {
- mms_list_rsp->msg_number = MMI_UM_MAX_GET_LIST_MSG_NUMBER;
- mms_list_rsp->more = TRUE;
- }
- else
- {
- mms_list_rsp->msg_number = number - mms_list_rsp->start_entry;
- mms_list_rsp->more = FALSE;
- }
- g_um_jmms_rsp_struct = (void*)mms_list_rsp;
- mmi_um_jmms_set_folder_list_callback_function(mmi_um_jmms_parse_mms_for_attachment);
- 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_um_jmms_get_fill_list(mms_list_rsp, ((mmi_um_get_list_req_struct*) msg_list_req));
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_get_mms_message_info_req
- * DESCRIPTION
- *
- * PARAMETERS
- * msg_info_req [?]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_get_mms_message_info_req(mmi_um_get_msg_info_req_struct *msg_info_req)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- mmi_um_get_msg_info_rsp_struct *mms_info_rsp = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mms_info_rsp = (mmi_um_get_msg_info_rsp_struct*) OslConstructDataPtr(sizeof(mmi_um_get_msg_info_rsp_struct));
- // memset(mms_info_rsp, 0, sizeof(mmi_um_get_msg_info_rsp_struct));
- mms_info_rsp->result = KAL_TRUE;
- mms_info_rsp->msg_type = UM_MSG_TYPE_MMS;
- mms_info_rsp->msg_box_type = msg_info_req->msg_box_type;
- mms_info_rsp->start_entry = msg_info_req->start_entry;
- mms_info_rsp->msg_number = msg_info_req->msg_number;
- mmi_um_jmms_get_fill_list_info(mms_info_rsp, msg_info_req);
- mmi_um_jmms_at_delete_pre_set();
- /* Prepare response structure */
- Message.oslSrcId = MOD_WAP;
- Message.oslDestId = MOD_MMI;
- Message.oslMsgId = MSG_ID_MMI_UM_GET_MSG_INFO_RSP;
- /* Send Response to MMI Queue */
- Message.oslDataPtr = (oslParaType*) mms_info_rsp;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_delete_all_mms_message_req
- * DESCRIPTION
- *
- * PARAMETERS
- * msg_delete_all_req [?]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_delete_all_mms_message_req(mmi_um_delete_folder_req_struct *msg_delete_all_req)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- mmi_um_delete_folder_rsp_struct *mms_delete_all_rsp = NULL;
- JC_RETCODE eRet = JC_OK;
- S16 number = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mms_delete_all_rsp =
- (mmi_um_delete_folder_rsp_struct*) OslConstructDataPtr(sizeof(mmi_um_delete_folder_rsp_struct));
- /* memset(mms_delete_all_rsp, 0, sizeof(mmi_um_delete_folder_rsp_struct)); */
- mms_delete_all_rsp->msg_type = msg_delete_all_req->msg_type;
- number = mmi_jmms_get_number_of_messages_from_msg_box_type(msg_delete_all_req->msg_box_type);
- if(number >= 0)
- {
- if(number == 0)
- {
- mms_delete_all_rsp->result = KAL_TRUE;
- }
- else
- {
- #ifdef __USB_IN_NORMAL_MODE__
- if(mmi_jmms_check_usb_mode() == 0)
- #endif /*__USB_IN_NORMAL_MODE__*/
- {
- eRet = mmi_jmms_delete_all_msgs_list(msg_delete_all_req->msg_box_type);
- if (eRet == JC_OK)
- {
- mms_delete_all_rsp->result = KAL_TRUE;
- }
- else
- {
- mms_delete_all_rsp->result = KAL_FALSE;
- }
- }
- #ifdef __USB_IN_NORMAL_MODE__
- else
- {
- mms_delete_all_rsp->result = KAL_FALSE;
- }
- #endif
- }
- }
- else
- {
- mms_delete_all_rsp->result = KAL_FALSE;
- }
- /* Prepare response structure */
- Message.oslSrcId = MOD_WAP;
- Message.oslDestId = MOD_MMI;
- Message.oslMsgId = MSG_ID_MMI_UM_DELETE_FOLDER_RSP;
- /* Send Response to MMI Queue */
- Message.oslDataPtr = (oslParaType*) mms_delete_all_rsp;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_ready_ind
- * DESCRIPTION
- * Function to send an indication to UM that browser is ready.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_ready_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- mmi_um_ready_ind_struct *mms_um_ready_ind;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mms_um_ready_ind = (mmi_um_ready_ind_struct*) OslConstructDataPtr(sizeof(mmi_um_ready_ind_struct));
- mms_um_ready_ind->result = KAL_TRUE;
- mms_um_ready_ind->msg_type = UM_MSG_TYPE_MMS;
- /* Prepare response structure */
- Message.oslSrcId = MOD_WAP;
- Message.oslDestId = MOD_MMI;
- Message.oslMsgId = MSG_ID_MMI_UM_READY_IND;
- /* Send Response to MMI Queue */
- Message.oslDataPtr = (oslParaType*) mms_um_ready_ind;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_delete_all_mms_messages_rsp
- * DESCRIPTION
- * Function to recieve information that if user has confirmed
- * to delete all mms messages or not.
- * PARAMETERS
- * result [IN] - confirmation of deletion of all messages.
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_delete_all_mms_messages_rsp(U16 result)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (result == KAL_TRUE && !(IsScreenPresent(SCR_ID_UM_INBOX) || IsScreenPresent(SCR_ID_UM_UNSENT)
- || IsScreenPresent(SCR_ID_UM_SENT) ||IsScreenPresent(SCR_ID_UM_DRAFT) ))
- {
- DeleteUptoScrID(SCR_ID_UM_MAIN);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_delete_highlight_folder
- * DESCRIPTION
- *
- * PARAMETERS
- * folder [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_delete_highlight_folder(um_msg_delete_folder_enum folder)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- mmi_um_delete_all_ind_struct *mms_delete_all_ind;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mms_delete_all_ind = (mmi_um_delete_all_ind_struct*) OslConstructDataPtr(sizeof(mmi_um_delete_all_ind_struct));
- mms_delete_all_ind->msg_type = UM_MSG_TYPE_MMS;
- mms_delete_all_ind->msg_box_type = folder;
- /* Prepare response structure */
- Message.oslSrcId = MOD_WAP;
- Message.oslDestId = MOD_MMI;
- Message.oslMsgId = MSG_ID_MMI_UM_DELETE_ALL_IND;
- /* Send Response to MMI Queue */
- Message.oslDataPtr = (oslParaType*) mms_delete_all_ind;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_new_mms_timestamp
- * DESCRIPTION
- * Function to send an indication to UM that a new mms message has arrived.
- * PARAMETERS
- * void
- * pServiceValue [?](?)
- * RETURNS
- * void
- *****************************************************************************/
- U64 mmi_um_jmms_new_mms_timestamp(U16 msg_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- JC_RETCODE eRet = JC_OK;
- RETRIEVE_FILTERS StoreRetFilter = {0, };
- MESSAGE_LIST *pMessageList = NULL;
- MESSAGE_LIST *pTempMsgList = NULL;
- U64 timestamp = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StoreRetFilter.uiStartIndex = msg_index;
- StoreRetFilter.uiNumMessage = 1;
- StoreRetFilter.eRetrieve = E_RETRIEVE_BY_INDEX;
- eRet = mmi_jmms_get_messages_list("Inbox", &pTempMsgList, &StoreRetFilter);
- if (eRet != JC_OK || pTempMsgList == NULL)
- {
- return timestamp; /* JC_ERR_MEMORY_ALLOCATION; */
- }
- pMessageList = pTempMsgList;
- switch (pMessageList->pMessageHeaders->eMsgType)
- {
- case E_MSG_TYPE_NOTIFICATION:
- {
- MESSAGE_NOTIFICATION *notification_p;
- notification_p = (MESSAGE_NOTIFICATION*) (pMessageList->pMessageHeaders->pHeaders);
- timestamp = (*notification_p).uiReceivedTime;
- break;
- }
- case E_MSG_TYPE_RECEIVE:
- {
- MESSAGE_RETRIEVAL *retrieval_p;
- retrieval_p = (MESSAGE_RETRIEVAL*) (pMessageList->pMessageHeaders->pHeaders);
- timestamp = retrieval_p->uiDate;
- break;
- }
- case E_MSG_TYPE_DELIVERY_REPORT:
- {
- DELIVERY_REPORT *delivery_p;
- delivery_p = (DELIVERY_REPORT*) (pMessageList->pMessageHeaders->pHeaders);
- timestamp = delivery_p->uiDate;
- break;
- }
- case E_MSG_TYPE_READ_REPORT_RESPONSE:
- {
- READ_REPORT_RESPONSE *read_report_p;
- read_report_p = (READ_REPORT_RESPONSE*) (pMessageList->pMessageHeaders->pHeaders);
- timestamp = (*read_report_p).uiReceivedTime;
- break;
- }
- }
- return timestamp;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_new_mms_message_ind
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_new_mms_message_ind(U16 msg_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- mmi_um_new_msg_ind_struct *mms_new_msg_ind;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mms_new_msg_ind = (mmi_um_new_msg_ind_struct*) OslConstructDataPtr(sizeof(mmi_um_new_msg_ind_struct));
- mms_new_msg_ind->msg_type = UM_MSG_TYPE_MMS;
- mms_new_msg_ind->msg_box_type = UM_MSG_BOX_TYPE_INBOX;
- mms_new_msg_ind->msg_index = msg_index;
- mms_new_msg_ind->timestamp = mmi_um_jmms_new_mms_timestamp(msg_index);
- /* Prepare response structure */
- Message.oslSrcId = MOD_WAP;
- Message.oslDestId = MOD_MMI;
- Message.oslMsgId = MSG_ID_MMI_UM_NEW_MSG_IND;
- Message.oslDataPtr = (oslParaType*) mms_new_msg_ind;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_refresh_ind
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_refresh_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- mmi_um_refresh_ind_struct *mms_ref_msg_ind;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mms_ref_msg_ind = (mmi_um_refresh_ind_struct*) OslConstructDataPtr(sizeof(mmi_um_refresh_ind_struct));
- mms_ref_msg_ind->msg_type = UM_MSG_TYPE_MMS;
- mms_ref_msg_ind->msg_box_type = mmi_um_get_current_msg_box_type();
- /* Prepare response structure */
- Message.oslSrcId = MOD_WAP;
- Message.oslDestId = MOD_MMI;
- Message.oslMsgId = MSG_ID_MMI_UM_REFRESH_IND;
- Message.oslDataPtr = (oslParaType*) mms_ref_msg_ind;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_highlight_mms_message_ind
- * DESCRIPTION
- * Function to send information to UM about the currently highlighted item.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_highlight_mms_message_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- mmi_um_highlight_msg_ind_struct *mms_highlight_ind;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mms_highlight_ind =
- (mmi_um_highlight_msg_ind_struct*) OslConstructDataPtr(sizeof(mmi_um_highlight_msg_ind_struct));
- mms_highlight_ind->msg_type = UM_MSG_TYPE_MMS;
- mms_highlight_ind->msg_box_type = mmi_um_get_current_msg_box_type();
- mms_highlight_ind->msg_index = g_jmms_context->nCurr_scr_hilited_index;
- /* Prepare response structure */
- Message.oslSrcId = MOD_WAP;
- Message.oslDestId = MOD_MMI;
- Message.oslMsgId = MSG_ID_MMI_UM_HIGHLIGHT_MSG_IND;
- /* Send Response to MMI Queue */
- Message.oslDataPtr = (oslParaType*) mms_highlight_ind;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_pre_entry_inbox
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_pre_entry_inbox(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_um_jmms_at_delete_pre_set();
- mmi_um_pre_entry_inbox();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_pre_entry_outbox
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_pre_entry_outbox(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_um_jmms_at_delete_pre_set();
- mmi_um_pre_entry_unsent();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_pre_entry_sent
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_pre_entry_sent(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_um_jmms_at_delete_pre_set();
- mmi_um_pre_entry_sent();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_pre_entry_draft
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_pre_entry_draft(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_um_jmms_at_delete_pre_set();
- mmi_um_pre_entry_draft();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_get_curr_folder_name
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- *
- *****************************************************************************/
- U16 mmi_um_get_curr_folder_name(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 folderScrnId = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (mmi_um_get_current_msg_box_type())
- {
- case UM_MSG_BOX_TYPE_INBOX:
- folderScrnId = SCR_ID_UM_INBOX;
- break;
- case UM_MSG_BOX_TYPE_UNSENT:
- folderScrnId = SCR_ID_UM_UNSENT;
- break;
- case UM_MSG_BOX_TYPE_SENT:
- folderScrnId = SCR_ID_UM_SENT;
- break;
- case UM_MSG_BOX_TYPE_DRAFT:
- folderScrnId = SCR_ID_UM_DRAFT;
- break;
- default:
- folderScrnId = 0;
- break;
- }
- return folderScrnId;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_pre_entry_inbox_including_highlighter
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_pre_entry_inbox_including_highlighter(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_um_jmms_at_delete_pre_set();
- mmi_um_jmms_highlight_mms_message_ind();
- mmi_um_pre_entry_inbox();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_um_jmms_pre_entry_draft_including_highlighter
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_um_jmms_pre_entry_draft_including_highlighter(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_um_jmms_at_delete_pre_set();
- mmi_um_jmms_highlight_mms_message_ind();
- mmi_um_pre_entry_draft();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_get_number_of_messages_from_msg_box_type
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- S16 mmi_jmms_get_number_of_messages_from_msg_box_type(UmMsgBoxType msg_box_type)
- {
- JC_RETCODE eRet = 0;
- U8 number = 0;
- S16 total = 0;
- if(msg_box_type & UM_MSG_BOX_TYPE_INBOX)
- {
- eRet = mmi_mms_get_number_of_messages(MMI_JMMS_INBOX, &number);
- if(eRet != JC_OK)
- {
- goto ERROR;
- }
- total += number;
- }
- if(msg_box_type & UM_MSG_BOX_TYPE_UNSENT)
- {
- eRet = mmi_mms_get_number_of_messages(MMI_JMMS_OUTBOX, &number);
- if(eRet != JC_OK)
- {
- goto ERROR;
- }
- total += number;
- }
- if(msg_box_type & UM_MSG_BOX_TYPE_SENT)
- {
- eRet = mmi_mms_get_number_of_messages(MMI_JMMS_SENT, &number);
- if(eRet != JC_OK)
- {
- goto ERROR;
- }
- total += number;
- }
- if(msg_box_type & UM_MSG_BOX_TYPE_DRAFT)
- {
- eRet = mmi_mms_get_number_of_messages(MMI_JMMS_DRAFTS, &number);
- if(eRet != JC_OK)
- {
- goto ERROR;
- }
- total += number;
- }
- ERROR:
- if(eRet != JC_OK)
- {
- total = -1;
- }
- return total;
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- #endif /* defined (JATAAYU_SUPPORT) && defined (WAP_SUPPORT) */
- #endif /* _MMI_JMMSUMHANDLE_C */