JMMSUseDetailsUI.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:61k
源码类别:
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_use_details_ui.C
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * This file contains the ui for use details option in all the folders
- *
- * 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!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
- #ifndef _MMI_JMMSUSEDETAILSSECMMI_C
- #define _MMI_JMMSUSEDETAILSSECMMI_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 "PhonebookGprot.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 "CallManagementGprot.h"
- #include "JMMSConfig.h"
- #include "JMMSMessageSettings.h"
- #include "JMMSCoreAPI.h"
- #include "JMMSDrafts.h"
- #include "JMMSExdcl.h"
- #include "JMMSCompose.h"
- #include "JMMSGprot.h"
- #include "JMMSInbox.h"
- #include "JMMSJSRHandler.h"
- #include "JMMSMainMMS.h"
- #include "JMMSMessageSettingsUtils.h"
- #include "JMMSOutbox.h"
- #include "JMMSProtocols.h"
- #include "JMMSPushHandling.h"
- #include "JMMSResEnum.h"
- #include "JMMSSent.h"
- #include "JMMSStoreHandling.h"
- #include "JMMSStructs.h"
- #include "JMMSTemplates.h"
- #include "JMMSUseDetails.h"
- #include "JMMSView.h"
- #include "JMMSWriteMMS.h"
- //KP Jerry add on 2007-4-12 start
- #ifdef __MMI_MESSAGES_SENDMSG_QUICKLY__
- #include "MessagesResourceData.h"
- #endif
- //KP Jerry add on 2007-4-12 end
- /*****************************************************************************
- * Define
- *****************************************************************************/
- /*****************************************************************************
- * Typedef
- *****************************************************************************/
- /*****************************************************************************
- * Local Variable
- *****************************************************************************/
- /*****************************************************************************
- * Local Function
- *****************************************************************************/
- /*****************************************************************************
- * Global Variable
- *****************************************************************************/
- jmms_use_details_struct g_jmms_use_details;
- /*****************************************************************************
- * Global Function
- *****************************************************************************/
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_pre_entry_use_details_screen
- * DESCRIPTION
- * Entry fn for use details screen
- * PARAMETERS
- * folder_name [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_pre_entry_use_details_screen(S8 *folder_name)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 number = 0;
- RETRIEVE_FILTERS StoreRetFilter = {0, };
- MESSAGE_LIST *pMessageList = NULL;
- MESSAGE_LIST *pTempMessageList = NULL;
- JC_CHAR *from_addresses = NULL, *to_addresses = NULL, *cc_addresses = NULL, *bcc_addresses = NULL;
- JC_RETCODE eRet = JC_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- number = g_jmms_context->store_context->nMsgs_in_Current_folder;
- StoreRetFilter.uiStartIndex = number - g_jmms_context->nCurr_scr_hilited_index;
- StoreRetFilter.eRetrieve = E_RETRIEVE_BY_INDEX;
- StoreRetFilter.uiNumMessage = 1;
- eRet = mmi_jmms_get_messages_list(folder_name, &pTempMessageList, &StoreRetFilter);
- pMessageList = pTempMessageList;
- if (eRet != JC_OK || pMessageList == NULL)
- {
- mmi_jmms_error_handler(eRet);
- return;
- }
- if (g_jmms_context->store_context->current_folder_name == E_JMMS_INBOX)
- {
- switch (pMessageList->pMessageHeaders->eMsgType)
- {
- case E_MSG_TYPE_NOTIFICATION:
- {
- MESSAGE_NOTIFICATION *notification_p;
- notification_p = (MESSAGE_NOTIFICATION*) (pMessageList->pMessageHeaders->pHeaders);
- from_addresses = notification_p->pFrom;
- to_addresses = NULL;
- cc_addresses = NULL;
- bcc_addresses = NULL;
- break;
- }
- case E_MSG_TYPE_RECEIVE:
- {
- MESSAGE_RETRIEVAL *retrieval_p;
- retrieval_p = (MESSAGE_RETRIEVAL*) (pMessageList->pMessageHeaders->pHeaders);
- from_addresses = retrieval_p->pFrom;
- to_addresses = retrieval_p->pTo;
- cc_addresses = retrieval_p->pCc;
- bcc_addresses = NULL;
- break;
- }
- case E_MSG_TYPE_DELIVERY_REPORT:
- {
- DELIVERY_REPORT *delievery_report_p;
- delievery_report_p = (DELIVERY_REPORT*) (pMessageList->pMessageHeaders->pHeaders);
- from_addresses = NULL;
- to_addresses = delievery_report_p->pTo;
- cc_addresses = NULL;
- bcc_addresses = NULL;
- break;
- }
- case E_MSG_TYPE_READ_REPORT_RESPONSE:
- {
- READ_REPORT_RESPONSE *read_report_p;
- read_report_p = (READ_REPORT_RESPONSE*) (pMessageList->pMessageHeaders->pHeaders);
- from_addresses = read_report_p->pFrom;
- to_addresses = read_report_p->pTo;
- cc_addresses = NULL;
- bcc_addresses = NULL;
- break;
- }
- default:
- return;
- }
- }
- else
- {
- switch (pMessageList->pMessageHeaders->eMsgType)
- {
- case E_MSG_TYPE_SEND:
- {
- MESSAGE_SEND *send_p;
- send_p = (MESSAGE_SEND*) (pMessageList->pMessageHeaders->pHeaders);
- from_addresses = send_p->pFrom;
- to_addresses = send_p->pTo;
- cc_addresses = send_p->pCc;
- bcc_addresses = send_p->pBcc;
- break;
- }
- default:
- return;
- }
- }
- mmi_jmms_free_use_details_adrresses_list();
- mmi_jmms_create_use_details_addresses_list(from_addresses, to_addresses, cc_addresses, bcc_addresses);
- /* HIMANSHU Put this condition in Unified Messaging only */
- #ifdef __MMI_UNIFIED_MESSAGE__
- if (g_jmms_use_details.addresses_list == NULL)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_JMMS_USE_DETAILS_NO_NUMBER),
- IMG_GLOBAL_EMPTY,
- 1,
- JMMS_POPUP_TIME,
- EMPTY_LIST_TONE);
- return;
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- #ifdef __MMI_UNIFIED_MESSAGE__
- mmi_jmms_use_details_number(); /* sachin */
- #else
- mmi_jmms_entry_use_details_screen();
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_entry_use_details_screen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifndef __MMI_UNIFIED_MESSAGE__
- void mmi_jmms_entry_use_details_screen(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 scrid;
- U16 menuid;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_jmms_context->store_context->current_folder_name == E_JMMS_INBOX)
- {
- scrid = SCR_ID_JMMS_INBOX_OPTIONS_USE_DETAILS;
- menuid = MENU_ID_JMMS_INBOX_OPTIONS_USE_DETAILS;
- }
- else if (g_jmms_context->store_context->current_folder_name == E_JMMS_OUTBOX)
- {
- scrid = SCR_ID_JMMS_OUTBOX_OPTIONS_USE_DETAILS;
- menuid = MENU_ID_JMMS_OUTBOX_OPTIONS_USE_DETAILS;
- }
- else if (g_jmms_context->store_context->current_folder_name == E_JMMS_SENT)
- {
- scrid = SCR_ID_JMMS_SENT_OPTIONS_USE_DETAILS;
- menuid = MENU_ID_JMMS_SENT_OPTIONS_USE_DETAILS;
- }
- else if (g_jmms_context->store_context->current_folder_name == E_JMMS_DRAFTS)
- {
- scrid = SCR_ID_JMMS_DRAFTS_OPTIONS_USE_DETAILS;
- menuid = MENU_ID_JMMS_DRAFTS_OPTIONS_USE_DETAILS;
- }
- else
- {
- return;
- }
- EntryNewScreen(scrid, NULL, mmi_jmms_entry_use_details_screen, NULL);
- gui_buffer = GetCurrGuiBuffer(scrid);
- num_item = GetNumOfChild(menuid);
- GetSequenceStringIds_Ext(menuid, str_item_list);
- SetParentHandler(menuid);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- 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,
- (U8 **) NULL,
- 0,
- 0,
- gui_buffer);
- SetRightSoftkeyFunction(mmi_jmms_back_from_use_details_main_screen, KEY_EVENT_UP);
- SetKeyHandler(mmi_jmms_back_from_use_details_main_screen, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_back_from_use_details_main_screen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_back_from_use_details_main_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_jmms_free_use_details_adrresses_list();
- GoBackHistory();
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_jmms_create_use_details_addresses_list
- * DESCRIPTION
- *
- * PARAMETERS
- * from [IN]
- * to [IN]
- * cc [IN]
- * bcc [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_jmms_create_use_details_addresses_list(JC_CHAR *from, JC_CHAR *to, JC_CHAR *cc, JC_CHAR *bcc)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mms_addresses_list *node = NULL;
- S32 len_to_copy = 0;
- S8 *str = NULL;
- S32 len = 0;
- S32 start_index = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* MAUI_00018175 Start */
- if (g_jmms_context->view_context != NULL &&
- g_jmms_context->view_context->focus_object_type == E_MSG_FOCUS_PHONE_NUMBER)
- /* MAUI_00018175 End */
- {
- ACTIVE_MEDIA_INFO activeMediaInfo;
- mmi_jmms_jdi_get_active_media_info(g_jmms_context->msg_handle, &activeMediaInfo);
- node = (mms_addresses_list*) jdd_MemAlloc(sizeof(mms_addresses_list), 1);
- if (node == NULL)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_JMMS_OUT_OF_MEMORY),
- IMG_GLOBAL_ERROR,
- 1,
- JMMS_POPUP_TIME,
- (U8) ERROR_TONE);
- mmi_jmms_free_use_details_adrresses_list();
- return;
- }
- node->is_email = MMI_FALSE;
- len_to_copy = MAX_POSSIBLE_NUMBER_LENGHT_SENT;
- node->address = (S8*) jdd_MemAlloc(sizeof(S8), (len_to_copy + 1) * ENCODING_LENGTH);
- if (node->address == NULL)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_JMMS_OUT_OF_MEMORY),
- IMG_GLOBAL_ERROR,
- 1,
- JMMS_POPUP_TIME,
- (U8) ERROR_TONE);
- /* HIMANSHU Memory Leak Fix Start */
- if (node != NULL)
- {
- jdd_MemFree(node);
- node = NULL;
- }
- /* HIMANSHU Memory Leak Fix End */
- mmi_jmms_free_use_details_adrresses_list();
- return;
- }
- pfnUnicodeStrncpy((S8*) node->address, (S8*) activeMediaInfo.LinkInfo.pLinkText, len_to_copy);
- /* HIMANSHU Memory Leak Fix Start */
- if (g_jmms_use_details.addresses_list != NULL)
- {
- mmi_jmms_free_use_details_adrresses_list();
- }
- g_jmms_use_details.addresses_list = node;
- /* HIMANSHU Memory Leak Fix End */
- }
- if (from != NULL)
- {
- str = (S8*) (from);
- len = 0;
- start_index = 0;
- node = NULL;
- while (pfnUnicodeStrcmp(str, "