mmimms_wintable.c
资源名称:mms.rar [点击查看]
上传用户:amanda_214
上传日期:2014-04-26
资源大小:163k
文件大小:463k
源码类别:
手机彩信(MMS)编程
开发平台:
C/C++
- SCI_TRACE_LOW("FNH open window setting apn_str_len = %d",apn_str_len);
- GUIEDITBOX_SetTextEditBoxStringInfo(editbox_ctrl_id,
- apn_str_ptr,
- apn_str_len,
- FALSE);
- MMK_SetAtvCtrl(
- win_id,
- editbox_ctrl_id);
- break;
- case MSG_FULL_PAINT:
- MMIMMS_CLEAR_CLIENT();
- break;
- case MSG_APP_OK:
- case MSG_CTL_OK:
- //save to nv
- SCI_MEMSET(&string_info,0,sizeof(TEXTEDIT_STRING_INFO_T));
- SCI_TRACE_LOW("FNH before get text string_info.str_ptr = %s",string_info.str_ptr);
- SCI_TRACE_LOW("FNH before get text string_info.str_len = %d",string_info.str_len);
- GUIEDITBOX_GetTextEditBoxInfo(
- editbox_ctrl_id,
- &string_info);
- string_info.str_ptr[string_info.str_len] = ' ';
- SCI_TRACE_LOW("FNH after get text string_info.str_ptr = %s",string_info.str_ptr);
- SCI_TRACE_LOW("FNH after get text string_info.str_len = %d",string_info.str_len);
- if (string_info.str_len == 0)
- {
- //提示用户
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_INPUT_ERROR,
- IMAGE_PROMPT_ICON_FAIL,
- ALERT_TIMEOUT,
- PNULL);
- MMK_CloseWin(win_id);
- break;
- }
- MMIMMS_Setting_SetAPN(string_info.str_ptr, string_info.str_len);
- // MMIMMS_SaveConfigFile();
- //提示用户
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_DONE,
- IMAGE_PROMPT_ICON_SUCCESS,
- ALERT_TIMEOUT,
- PNULL);
- MMK_CloseWin(win_id);
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- MMK_CloseWin(win_id);//返回上一级
- break;
- default:
- recode = MMI_RESULT_FALSE;
- break;
- }
- return recode;
- }
- /*****************************************************************************/
- // Description : to append the info to listbox
- // Global resource dependence :
- // Author:louis.wei
- // Note: copy from louise
- /*****************************************************************************/
- LOCAL void AppendListItemByTextId(
- uint32 text_id,
- MMS_CONTROL_ID_E ctrl_id
- )
- {
- GUI_LISTBOX_ITEM_T item_info;
- MMI_STRING_T item_str;
- uint8 copy_len = 0;
- SCI_MEMSET( &item_str, 0, sizeof(MMI_STRING_T) );
- SCI_MEMSET(&item_info, 0, sizeof(GUI_LISTBOX_ITEM_T));
- MMI_GetLabelTextByLang( text_id , &item_str );
- item_info.softkey_id[0] = STXT_OK;
- item_info.softkey_id[1] = COMMON_TXT_NULL;
- item_info.softkey_id[2] = STXT_EXIT;
- copy_len = ( item_str.length > LISTBOX_STRING_MAX_NUM ) ? LISTBOX_STRING_MAX_NUM : item_str.length;
- // SCI_MEMCPY( item_info.str, item_str.str_ptr , copy_len );
- MMI_MEMCPY(item_info.str, LISTBOX_STRING_MAX_NUM, item_str.str_ptr, item_str.length, copy_len );
- item_info.str_len = copy_len ;
- item_info.is_ucs2 = item_str.is_ucs2;
- GUILISTBOX_AppendItem((MMI_CTRL_ID_T)ctrl_id, &item_info);
- }
- /*****************************************************************************/
- // Description : to append the info to listbox
- // Global resource dependence :
- // Author:louis.wei
- // Note: copy from louis
- /*****************************************************************************/
- LOCAL void AppendListItem(
- uint8 *string_ptr,
- uint8 string_len,
- BOOLEAN is_ucs2,
- MMS_CONTROL_ID_E ctrl_id,
- uint16 left_softkey_id
- )
- {
- GUI_LISTBOX_ITEM_T item_info;
- uint8 copy_len = 0;
- SCI_ASSERT( PNULL != string_ptr );
- SCI_MEMSET(&item_info, 0, sizeof(GUI_LISTBOX_ITEM_T));
- item_info.softkey_id[0] = left_softkey_id;
- item_info.softkey_id[1] = COMMON_TXT_NULL;
- item_info.softkey_id[2] = STXT_EXIT;
- copy_len = ( string_len > LISTBOX_STRING_MAX_NUM ) ? LISTBOX_STRING_MAX_NUM : string_len;
- // SCI_MEMCPY( item_info.str, string_ptr, copy_len );
- MMI_MEMCPY(item_info.str, LISTBOX_STRING_MAX_NUM, string_ptr, string_len, copy_len );
- item_info.str_len = copy_len;
- item_info.is_ucs2 = is_ucs2;
- GUILISTBOX_AppendItem(ctrl_id, &item_info);
- }
- /*****************************************************************************/
- // Description : to append the info to listbox
- // Global resource dependence :
- // Author:louis.wei
- // Note: copy from louis
- /*****************************************************************************/
- LOCAL void AppendListItemWithIcon(
- uint8 *string_ptr,
- uint8 string_len,
- uint32 icon_id,
- BOOLEAN is_ucs2,
- MMS_CONTROL_ID_E ctrl_id,
- uint16 left_softkey_id
- )
- {
- GUI_LISTBOX_ITEM_T item_info;
- uint8 copy_len = 0;
- SCI_ASSERT( PNULL != string_ptr );
- SCI_MEMSET(&item_info, 0, sizeof(GUI_LISTBOX_ITEM_T));
- item_info.softkey_id[0] = left_softkey_id;
- item_info.softkey_id[1] = COMMON_TXT_NULL;
- item_info.softkey_id[2] = STXT_EXIT;
- item_info.left_icon_id = icon_id;
- copy_len = ( string_len > LISTBOX_STRING_MAX_NUM ) ? LISTBOX_STRING_MAX_NUM : string_len;
- // SCI_MEMCPY( item_info.str, string_ptr, copy_len );
- MMI_MEMCPY(item_info.str, LISTBOX_STRING_MAX_NUM, string_ptr, string_len, copy_len );
- item_info.str_len = copy_len;
- item_info.is_ucs2 = is_ucs2;
- GUILISTBOX_AppendItem(ctrl_id, &item_info);
- }
- /*****************************************************************************/
- // Description : 是否是最后一祯
- // Global resource dependence :
- // Author: nihongf
- // Note:
- /*****************************************************************************/
- LOCAL BOOLEAN Edit_isLastSlide(pMMS_EDocument p_cur_edoc)
- {
- if (MMSGetSlideIndex(p_cur_edoc) >= MMSGetSlideCount(p_cur_edoc) )
- {
- return TRUE;
- }
- else
- {
- return FALSE;
- }
- }
- /*****************************************************************************/
- // Description : 添加彩信时打开图片列表供选择
- // Global resource dependence :
- // Author: nihongf
- // Note:
- /*****************************************************************************/
- LOCAL BOOLEAN Edit_OpenInsertDpicWin(
- MMS_WINDOW_ID_E win_id
- )
- {
- if (MMIMULTIM_OpenDpicWinForMms(MMS_MAX_SIZE_OF_MULTIM,win_id))
- {
- return FALSE;
- }
- else
- {
- return TRUE; //don't free it
- }
- }
- /*****************************************************************************/
- // Description : 得到一条MMS可以插入Image的最大空间
- // Global resource dependence :
- // Author: Great.Tian
- // Note:
- /*****************************************************************************/
- uint32 MMIMMS_GetInsertMaxSize()
- {
- uint32 max_size = 0;
- T_WORD composer_content_size = 0;
- composer_content_size = MMIMMS_GetTotalSize();
- if (composer_content_size + EDITMMS_ADDITIONAL_SIZE > MMS_MAX_SIZE_OF_MULTIM)
- {
- //if already exceed
- max_size = 1;
- }
- else
- {
- max_size = MMS_MAX_SIZE_OF_MULTIM - EDITMMS_ADDITIONAL_SIZE - composer_content_size;
- }
- SCI_TRACE_LOW("MMIMMS_GetInsertMaxSize: max_size = %d!", max_size);
- return (max_size);
- }
- /*****************************************************************************/
- // Description : 增加彩信内容时打开声音列表供选择
- // Global resource dependence :
- // Author: nihongf
- // Note:
- /*****************************************************************************/
- LOCAL BOOLEAN Edit_OpenInsertDringWin(
- MMS_WINDOW_ID_E win_id
- )
- {
- if (MMIMULTIM_OpenDringWinForMms(MMS_MAX_SIZE_OF_MULTIM,win_id))
- {
- return FALSE;
- }
- else
- {
- return TRUE; //don't free it
- }
- }
- //created liangliu 2005-10-27 for download mms waiting window
- void MMIMMS_Download_CreateDownloadingWin(void)
- {
- //MMK_CreateWin((uint32 *)MMIMMS_RECVING_MMS_WIN,PNULL);
- MMI_STRING_T downloading_str = {0};
- PUBWIN_ClosePromptQueryWin();
- SCI_MEMSET(&downloading_str, 0, sizeof(downloading_str));
- MMI_GetLabelTextByLang(TXT_MMS_DOWNLOADING, &downloading_str);
- PUBWIN_OpenWaitingMessageWin(
- MMIMMS_DOWNLOAD_DOWNLOADING_WIN_ID,
- WIN_ONE_LEVEL,
- PUBWIN_SOFTKEY_ONE,
- &downloading_str,
- PNULL,
- IMAGE_PUBWIN_WAITING_ANIM,
- WAIT_TEXT_BACKGROUND_COLOR,//IMAGE_NULL,
- PNULL,
- (ONMESSAGE_FUNC)Download_HandleDownloadingWin
- );
- }
- /* ----------------------------------------------------------------------------
- * Function Name: MMIMMS_SendMMS_CreateSendingWin
- * Purpose:发送彩信时的等待窗口
- * Input: void
- * Returns:void
- * Author:nihongf@mobilesoft.com.cn
- * ----------------------------------------------------------------------------*/
- void MMIMMS_SendMMS_CreateSendingWin(void)
- {
- MMI_STRING_T downloading_str = {0};
- SCI_MEMSET(&downloading_str, 0, sizeof(downloading_str));
- MMI_GetLabelTextByLang(TXT_MMS_SENDING, &downloading_str);
- PUBWIN_OpenWaitingMessageWin(
- MMIMMS_SEND_MMS_WAITING_WIN_ID,
- WIN_ONE_LEVEL,
- PUBWIN_SOFTKEY_ONE,
- &downloading_str,
- PNULL,
- IMAGE_SEND_MESSAGE_ANIMA,//IMAGE_EXCEPTIVE_WAIT_ANIMA,
- WAIT_TEXT_BACKGROUND_COLOR,
- PNULL,
- (ONMESSAGE_FUNC) SendMMS_HandleWaitingWin
- );
- }
- /* ----------------------------------------------------------------------------
- * Function Name: MMIMMS_SendReadRpt_CreateWaitingWin
- * Purpose:发送阅读报告时的等待窗口
- * Input: void
- * Returns:void
- * Author:nihongf@mobilesoft.com.cn
- * ----------------------------------------------------------------------------*/
- void MMIMMS_SendReadRpt_CreateWaitingWin(void)
- {
- MMI_STRING_T downloading_str = {0};
- SCI_MEMSET(&downloading_str, 0, sizeof(downloading_str));
- MMI_GetLabelTextByLang(TXT_MMS_SENDING_READRPT, &downloading_str);//TXT_MMS_SENDING_READRPT to TXT_MMS_SENDING for a while
- PUBWIN_OpenWaitingMessageWin(
- MMIMMS_SEND_MMSREADRPT_WAITING_WIN_ID,
- WIN_ONE_LEVEL,
- PUBWIN_SOFTKEY_ONE,
- &downloading_str,
- PNULL,
- IMAGE_SEND_MESSAGE_ANIMA,//IMAGE_EXCEPTIVE_WAIT_ANIMA,
- WAIT_TEXT_BACKGROUND_COLOR,//IMAGE_NULL,
- PNULL,
- (ONMESSAGE_FUNC)SendReadRpt_HandleWaitingWin
- );
- }
- /* ----------------------------------------------------------------------------
- * Function Name: MMIMMS_CreateNormalWaitingWin
- * Purpose:删除彩信时的等待窗口
- * Input: void
- * Returns:void
- * Author:nihongf@mobilesoft.com.cn
- * ----------------------------------------------------------------------------*/
- void MMIMMS_CreateNormalWaitingWin(void)
- {
- MMI_STRING_T downloading_str = {0};
- SCI_MEMSET(&downloading_str, 0, sizeof(downloading_str));
- MMI_GetLabelTextByLang(TXTSYS_WAITING, &downloading_str);
- PUBWIN_OpenWaitingMessageWin(
- MMIMMS_NORMAL_WAITING_WIN_ID,
- WIN_ONE_LEVEL,
- PUBWIN_SOFTKEY_NONE,
- &downloading_str,
- PNULL,
- IMAGE_PUBWIN_WAITING_ANIM,
- WAIT_TEXT_BACKGROUND_COLOR,//IMAGE_NULL,
- PNULL,
- (ONMESSAGE_FUNC)MMIMMS_HandleNormalWaitingWin
- );
- }
- /* ----------------------------------------------------------------------------
- * Function Name: MMIMMS_CreateReadMMSWaitingWin
- * Purpose:读取彩信时的等待窗口
- * Input: void
- * Returns:void
- * Author:nihongf@mobilesoft.com.cn
- * ----------------------------------------------------------------------------*/
- void MMIMMS_CreateReadMMSWaitingWin(void)
- {
- MMI_STRING_T downloading_str = {0};
- SCI_MEMSET(&downloading_str, 0, sizeof(downloading_str));
- MMI_GetLabelTextByLang(TXT_MMS_OPENING_MMS, &downloading_str);
- PUBWIN_OpenWaitingMessageWin(
- MMIMMS_READ_MMS_WAITING_WIN_ID,
- WIN_ONE_LEVEL,
- PUBWIN_SOFTKEY_NONE,
- &downloading_str,
- PNULL,
- IMAGE_PUBWIN_WAITING_ANIM,
- WAIT_TEXT_BACKGROUND_COLOR,//IMAGE_NULL,
- PNULL,
- (ONMESSAGE_FUNC) MMIMMS_HandleReadMMSWaitingWin
- );
- }
- /* ----------------------------------------------------------------------------
- * Function Name: MMIMMS_CreateSaveMMSWaitingWin
- * Purpose:保存彩信时的等待窗口
- * Input: void
- * Returns:void
- * Author:nihongf@mobilesoft.com.cn
- * ----------------------------------------------------------------------------*/
- void MMIMMS_CreateSaveMMSWaitingWin(void)
- {
- MMI_STRING_T downloading_str = {0};
- SCI_MEMSET(&downloading_str, 0, sizeof(downloading_str));
- MMI_GetLabelTextByLang(TXT_MMS_SAVEING_MMS, &downloading_str);
- PUBWIN_OpenWaitingMessageWin(
- MMIMMS_SAVE_MMS_WAITING_WIN_ID,
- WIN_ONE_LEVEL,
- PUBWIN_SOFTKEY_NONE,
- &downloading_str,
- PNULL,
- IMAGE_PUBWIN_WAITING_ANIM,
- WAIT_TEXT_BACKGROUND_COLOR,//IMAGE_NULL,
- PNULL,
- (ONMESSAGE_FUNC) MMIMMS_HandleSaveMMSWaitingWin
- );
- }
- /* ----------------------------------------------------------------------------
- * Function Name: Download_HandleDownloadingWin
- * Purpose: 下载彩信的窗口消息处理函数
- * Input: MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- * Returns: MMI_RESULT_E
- * Author:nihongf@mobilesoft.com.cn
- * ----------------------------------------------------------------------------*/
- LOCAL MMI_RESULT_E Download_HandleDownloadingWin(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_RESULT_E recode = MMI_RESULT_TRUE;
- FFS_SAVEFILE_RESULT_T * efs_result_ptr;
- static uint16 red_close = 0;//变量指示是否按红键退出的。
- switch(msg_id)
- {
- case MSG_FULL_PAINT:
- SCI_TRACE_LOW("FNH ifclose is %d",iFClose);
- red_close = 0;
- if (iFClose == 0)
- {
- MMIMMS_DisplaySendRecvProgress( g_progresscurrentsize,g_progressneedsize);
- }
- recode = PUBWIN_HandleWaiting1MessageWinMsg(win_id, msg_id, param);
- break;
- case MSG_OPEN_WINDOW:
- iFClose = 0;
- g_progresscurrentsize = 0;
- //MMIMMS_DisplaySendRecvProgress( g_progresscurrentsize,g_pCurrentList->size);
- break;
- case MSG_GET_FOCUS:
- iFClose = 0;
- break;
- case MSG_LOSE_FOCUS:
- iFClose = 1;
- break;
- case MSG_APP_CANCEL:
- //query
- iFClose = 1;
- PUBWIN_OpenPromptQueryWin(STXT_EXIT, IMAGE_PROMPT_ICON_QUERY);
- break;
- case MSG_PROMPTWIN_OK:
- //clear all
- iFClose = 0;
- PUBWIN_ClosePromptQueryWin();
- SCI_TRACE_LOW("MSG_PROMPTWIN_OK HERE THE g_netusing is %d",g_netusing);
- if(g_netusing == MMS_MSG_NETUSING_STEP1)
- {
- MMS_SendRecvCancel();
- }
- else
- {
- SCI_TRACE_LOW("here use the MMS_SendRecvCancel is too late---------");
- }
- //MMK_CloseWin(win_id);
- break;
- case MSG_PROMPTWIN_CANCEL:
- //close query win
- SCI_TRACE_LOW("MSG_PROMPTWIN_CANCEL COMMAD IN");
- iFClose = 0;
- PUBWIN_ClosePromptQueryWin();
- break;
- case MSG_APP_FLIP://modify 2006-5-12 翻盖不处理
- MMIDEFAULT_HandleFlipKey(FALSE);
- break;
- case MSG_APP_RED:
- recode = MMI_RESULT_TRUE;
- break;
- case MSG_CLOSE_WINDOW:
- //free memory
- //MMIMMS_FreeBeginToDownloadMMSMem();
- //disconnect wap
- if(g_netusing == MMS_MSG_NETUSING_STEP1||g_netusing == MMS_MSG_NETUSING_STEP2)
- {
- MMS_Close();
- SCI_TRACE_LOW("FNH close Download_HandleDownloadingWin after MMS_Close");
- g_netusing = MMS_MSG_NETUSING_NULL;
- }
- SCI_TRACE_LOW("FNH close Download_HandleDownloadingWin");
- g_netusing = MMS_MSG_NETUSING_NULL;
- if (red_close == 0) //按红键退出的
- {
- if(g_backautodownload == TRUE)
- {
- if (g_pCurrentList->needautodw == 1)
- {
- g_pCurrentList->needautodw = 0;
- }
- g_backautodownload = FALSE;
- }
- MMIMMS_DeleteAutodownList();
- if(g_inboxneedsave == TRUE)
- {
- SCI_TRACE_LOW(" TO IDLE MMIMMS_SaveManagerInboxFile");
- MMIMMS_StoreFolder(g_pManager->inboxfolder);
- MMIMMS_SaveManagerInboxFile(MMS_SAVE_INBOX);//liangliu@mobilesoft.com.cn modify for inboxfile of mms save.
- g_inboxneedsave = FALSE;
- }
- }
- recode = PUBWIN_HandleWaiting1MessageWinMsg( win_id, msg_id, param);
- break;
- case MSG_MMS_RECV_OK:
- SCI_TRACE_LOW("here come to save the mms");
- MMS_Close();
- g_netusing = MMS_MSG_NETUSING_STEP3;
- if (iFClose == 1)
- {
- PUBWIN_ClosePromptQueryWin();
- iFClose = 0;
- }
- g_pManager->inboxfolder->unsettlednumber--;
- red_close = 1;
- MMK_CloseWin(win_id);
- MMIMMS_CreateSaveMMSWaitingWin();
- MMIMMS_UpdateRecvMMSMessage(g_pCurrentList);
- MMIMMS_SortManagerFolder(g_pManager->inboxfolder,g_pCurrentList);
- g_savemmsstate = MMS_MSG_SAVEMMS_FOR_RECV;
- MMIMMS_SaveMMS(g_pCurrentList);
- SCI_TRACE_LOW("FNH before g_backautodownload = %d",g_backautodownload);
- if(g_backautodownload == TRUE)
- {
- g_backautodownload = FALSE;
- g_pCurrentList->needautodw = 0;
- }
- MMIMMS_DeleteAutodownList();
- break;//added by liangl 2005-10-31 for spread save the MMS.
- case MSG_MMS_RECV_FAILED:
- SCI_TRACE_LOW("recv the mms failed---------");
- MMS_Close();
- g_netusing = MMS_MSG_NETUSING_STEP3;
- if (iFClose == 1)
- {
- PUBWIN_ClosePromptQueryWin();
- }
- red_close = 1;
- if(g_backautodownload == TRUE)
- {
- if (g_pCurrentList->needautodw == 1)
- {
- g_pCurrentList->needautodw = 0;
- }
- g_backautodownload = FALSE;
- }
- MMIMMS_DeleteAutodownList();
- MMK_CloseWin(win_id);
- if(g_inboxneedsave == TRUE)
- {
- SCI_TRACE_LOW(" TO IDLE MMIMMS_SaveManagerInboxFile");
- MMIMMS_StoreFolder(g_pManager->inboxfolder);
- MMIMMS_SaveManagerInboxFile(MMS_SAVE_INBOX);//liangliu@mobilesoft.com.cn modify for inboxfile of mms save.
- g_inboxneedsave = FALSE;
- }
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_RECV_FAILED,
- IMAGE_PROMPT_ICON_FAIL,
- ALERT_TIMEOUT,
- PNULL
- );
- MMICMSBRW_FreeGlobalBuffer();
- break;
- case MSG_MMS_RECV_CANCEL:
- SCI_TRACE_LOW("recv the mms cancel---------");
- MMS_Close();
- g_netusing = MMS_MSG_NETUSING_STEP3;
- SCI_TRACE_LOW("MSG_MMS_RECV_CANCEL HERE MMS_Close() is OK -----");
- if (iFClose == 1)
- PUBWIN_ClosePromptQueryWin();
- if(g_backautodownload == TRUE)
- {
- if (g_pCurrentList->needautodw == 1)
- {
- g_pCurrentList->needautodw = 0;
- }//说明:上面注释的部分是原来的设计,自动下载可以取消两次,现在展讯修改原来的设计,要求自动下载只能取消一次
- g_backautodownload = FALSE;
- }
- MMIMMS_DeleteAutodownList();
- red_close = 1;
- MMK_CloseWin(win_id);
- if(g_inboxneedsave == TRUE)
- {
- SCI_TRACE_LOW(" TO IDLE MMIMMS_SaveManagerInboxFile");
- MMIMMS_StoreFolder(g_pManager->inboxfolder);
- MMIMMS_SaveManagerInboxFile(MMS_SAVE_INBOX);//liangliu@mobilesoft.com.cn modify for inboxfile of mms save.
- g_inboxneedsave = FALSE;
- }
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_RECV_CANCEL,
- IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- MMICMSBRW_FreeGlobalBuffer();
- break;
- case MSG_MMS_RECV_INVALIDPERIOD:
- SCI_TRACE_LOW("recv the mms invalidreriod---------");
- MMS_Close();
- g_netusing = MMS_MSG_NETUSING_STEP3;
- if (iFClose == 1)
- {
- PUBWIN_ClosePromptQueryWin();
- }
- red_close = 1;
- MMK_CloseWin(win_id);
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_RECV_INVALID,
- IMAGE_PROMPT_ICON_FAIL,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- MMICMSBRW_FreeGlobalBuffer();
- break;
- case MSG_MMS_SAVE_OK:
- SCI_TRACE_LOW("HERE THE MSG_ID IS MSG_MMS_SAVE_OK------- ");
- efs_result_ptr = (FFS_SAVEFILE_RESULT_T*)param;
- if(efs_result_ptr->write_result == SAVEFS_WRITE_SUCCEED)
- {
- //FILE_Close(efs_result_ptr->hefs);
- FFS_Close(g_filetype, efs_result_ptr->hefs);
- if(efs_result_ptr->buf_ptr != PNULL)
- {
- cms_free(efs_result_ptr->buf_ptr);
- efs_result_ptr->buf_ptr = PNULL;
- }
- }
- if (iFClose == 1)
- PUBWIN_ClosePromptQueryWin();
- MMIMMS_StoreFolder(g_pManager->inboxfolder);
- g_savestate = MMS_MSG_SAVEFILE_FOR_RECV;
- MMIMMS_SaveManagerInboxFile(MMS_SAVE_INBOX);
- SCI_TRACE_LOW("here the auto recv mms is ok");
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_RECV_SUCCES,
- IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- MMK_CloseWin(MMIMSG_MAIN_MENU_WIN_ID);
- red_close = 1;
- MMK_CloseWin(win_id);
- break;
- default:
- recode = PUBWIN_HandleWaiting1MessageWinMsg( win_id, msg_id, param);
- break;
- }
- return (recode);
- }
- /* ----------------------------------------------------------------------------
- * Function Name: SendMMS_HandleWaitingWin
- * Purpose: 发送彩信时的等待窗口消息处理函数
- * Input: MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- * Returns: MMI_RESULT_E
- * Author:nihongf@mobilesoft.com.cn
- * ----------------------------------------------------------------------------*/
- LOCAL MMI_RESULT_E SendMMS_HandleWaitingWin(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_RESULT_E recode = MMI_RESULT_TRUE;
- pMessageList tlist = PNULL;
- static BOOLEAN fromcancel = FALSE;
- switch(msg_id)
- {
- case MSG_FULL_PAINT:
- //MMIMMS_CLEAR_CLIENT();
- recode = PUBWIN_HandleWaiting1MessageWinMsg( win_id, msg_id, param);
- SCI_TRACE_LOW("FNH ifclose is %d",iFClose);
- if (iFClose == 0)
- {
- MMIMMS_DisplaySendRecvProgress(g_progresscurrentsize,g_progressneedsize);
- }
- break;
- case MSG_OPEN_WINDOW:
- fromcancel = FALSE;
- iFClose = 0;
- g_progresscurrentsize = 0;
- break;
- case MSG_APP_FLIP://modify 2006-5-12 fnh 翻盖不处理
- MMIDEFAULT_HandleFlipKey(FALSE);
- break;
- case MSG_APP_RED:
- recode = MMI_RESULT_TRUE;
- break;
- case MSG_APP_CANCEL:
- //query
- iFClose = 1;
- PUBWIN_OpenPromptQueryWin(STXT_EXIT, IMAGE_PROMPT_ICON_QUERY);
- break;
- case MSG_GET_FOCUS:
- iFClose = 0;
- break;
- case MSG_LOSE_FOCUS:
- iFClose = 1;
- break;
- case MSG_PROMPTWIN_OK:
- //clear all
- iFClose = 0;
- PUBWIN_ClosePromptQueryWin();
- fromcancel = TRUE;
- SCI_TRACE_LOW("SEND CANCEL THE MSG_PROMPTWIN IN THE g_netusing is %d",g_netusing);
- if(g_netusing == MMS_MSG_NETUSING_STEP1)
- {
- MMS_Close();
- mmsf_Remove((char *)g_pManager->outboxfolder->currentmessage->filename);//liangliu modify 2005-11-28
- SCI_TRACE_LOW("FNH after remove");
- if(g_mailbox_status != SEND_OUTBOX_MMS)
- {
- MMIMMS_DeleteManagerList(g_pManager->outboxfolder);
- }
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_CANCEL_SUCCESS,
- IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- MMK_CloseWin(win_id);
- }else if(g_netusing == MMS_MSG_NETUSING_STEP2)
- {
- MMS_SendRecvCancel();
- }
- else
- {
- SCI_TRACE_LOW("here use the MMS_SendRecvCancel is too late---------");
- }
- //MMK_CloseWin(win_id);liangliu modify 2005-11-24 for send cancel for message for send cancel.
- break;
- case MSG_PROMPTWIN_CANCEL:
- //close query win
- iFClose = 0;
- PUBWIN_ClosePromptQueryWin();
- break;
- case MSG_CLOSE_WINDOW:
- SCI_TRACE_LOW("here the close win come in and the g_netusing is %d",g_netusing);
- if(g_netusing == MMS_MSG_NETUSING_STEP1||g_netusing == MMS_MSG_NETUSING_STEP2)
- {
- SCI_TRACE_LOW("HERE THE fromcancel is %d",fromcancel);
- if(fromcancel == FALSE)
- {
- SCI_TRACE_LOW("COME HERE ------");
- if (iFClose == 1)
- {
- PUBWIN_ClosePromptQueryWin();
- }
- MMS_Close();
- mmsf_Remove((char *)g_pManager->outboxfolder->currentmessage->filename);//liangliu modify 2005-11-28
- SCI_TRACE_LOW("FNH after remove");
- if(g_mailbox_status != SEND_OUTBOX_MMS)
- {
- MMIMMS_DeleteManagerList(g_pManager->outboxfolder);
- }
- }
- }
- SCI_TRACE_LOW("FNH close SendMMS_HandleWaitingWin");
- g_netusing = MMS_MSG_NETUSING_NULL;
- recode = PUBWIN_HandleWaiting1MessageWinMsg( win_id, msg_id, param);
- break;
- case MSG_MMS_SEND_CANCEL:
- SCI_TRACE_LOW("FNH ENTER MSG_MMS_SEND_CANCEL");
- //MMS_Close();
- g_netusing = MMS_MSG_NETUSING_STEP3;
- if (iFClose == 1)
- PUBWIN_ClosePromptQueryWin();
- if (g_mailbox_status != SEND_OUTBOX_MMS)
- {
- SCI_TRACE_LOW("FNH g_pManager->outboxfolder->currentmessage->filename = %d",g_pManager->outboxfolder->currentmessage->filename );
- mmsf_Remove((char *)g_pManager->outboxfolder->currentmessage->filename);//liangliu modify 2005-11-28
- SCI_TRACE_LOW("FNH after remove");
- MMIMMS_DeleteManagerList(g_pManager->outboxfolder);
- SCI_TRACE_LOW("FNH after deletelist");
- SCI_TRACE_LOW("FNH g_pManager->outboxfolder->currentmessage = %d",g_pManager->outboxfolder->currentmessage);
- }
- else if (g_mailbox_status == SEND_OUTBOX_MMS)
- {
- mmsf_Remove((char *)g_pManager->outboxfolder->currentmessage->filename);//liangliu modify 2005-11-28
- g_mailbox_status = SEND_NEW_MMS;
- }
- // destroy_mms_mem_file_info();
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_CANCEL_SUCCESS,
- IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- SCI_TRACE_LOW("FNH before close win");
- MMK_CloseWin(win_id);
- break;
- case MSG_MMS_SEND_OK:
- //添加代码关于信箱处理的
- MMS_Close();
- tlist = MMIMMS_ManagerListCopy(g_pManager->outboxfolder->currentmessage);
- SCI_TRACE_LOW("MMIMMS_ManagerListCopy COMEOUT-----");
- MMIMMS_DeleteManagerList(g_pManager->outboxfolder);
- SCI_TRACE_LOW("MMIMMS_DeleteManagerList COMEOUT-----");
- if (iFClose == 1)
- {
- PUBWIN_ClosePromptQueryWin();
- }
- g_netusing = MMS_MSG_NETUSING_STEP3;
- MMK_CloseWin(win_id);
- if (g_mailbox_status != SEND_OUTBOX_MMS)
- {
- g_filetype = MMICMS_GetCurrentFFS();
- if((g_filetype != FS_INVALID)&&MMIMMS_GetManagerTotalNum() <=(MMS_MAX_NUM-1)&&MMIMMS_IsMoreSpace())//modify nihongf
- {
- MMIMMS_AddManagerList(g_pManager->sentfolder,tlist);
- SCI_TRACE_LOW("MMIMMS_AddManagerList COMEOUT-----");
- MMIMMS_CreateSaveMMSWaitingWin();
- g_savemmsstate = MMS_MSG_SAVEMMS_FOR_SEND_SUCCESS;
- MMIMMS_SaveMMS(g_pManager->sentfolder->currentmessage);
- }
- else
- {
- if (tlist->filename != NULL)
- {
- SCI_TRACE_LOW("FNH :space is empty! before remove tlist->filename");
- mmsf_Remove((char *)tlist->filename); //
- }
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_SEND_SUCCEED,
- IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- }
- }
- else
- {
- MMIMMS_AddManagerList(g_pManager->sentfolder,tlist);
- SCI_TRACE_LOW("MMIMMS_AddManagerList COMEOUT-----");
- MMIMMS_CreateSaveMMSWaitingWin();
- MMIMMS_StoreFolder(g_pManager->outboxfolder);
- MMIMMS_SaveManagerOutboxFile();
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_SEND_SUCCEED,
- IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- }
- break;
- case MSG_MMS_SENDED_FAILED:
- if (iFClose == 1)
- {
- PUBWIN_ClosePromptQueryWin();
- }
- MMS_Close();
- g_netusing = MMS_MSG_NETUSING_STEP3;
- g_filetype = MMICMS_GetCurrentFFS();
- SCI_TRACE_LOW("fnh send failed is %d",MMIMMS_GetManagerTotalNum());
- if((g_filetype != FS_INVALID)&&MMIMMS_GetManagerTotalNum() <=(MMS_MAX_NUM)&&MMIMMS_IsMoreSpace())//modify 2005-12-14
- {
- if (g_mailbox_status == SEND_NEW_MMS)
- {
- SCI_TRACE_LOW("fnh before create save mms waiting");
- MMIMMS_CreateSaveMMSWaitingWin();
- //g_pManager->currentfolder = g_pManager->outboxfolder;
- g_savemmsstate = MMS_MSG_SAVEMMS_FOR_SEND_FAILED;
- MMIMMS_SaveMMS(g_pManager->outboxfolder->currentmessage);
- }
- else if (g_mailbox_status == SEND_OUTBOX_MMS)
- {
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_SEND_FAILED,
- IMAGE_PROMPT_ICON_FAIL,
- ALERT_TIMEOUT,
- PNULL
- );
- }
- }
- else
- {
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_SEND_FAILED,
- IMAGE_PROMPT_ICON_FAIL,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- if (g_mailbox_status != SEND_OUTBOX_MMS)
- {
- SCI_TRACE_LOW("FNH: the space is empty! before remove file!");
- mmsf_Remove((char *)g_pManager->outboxfolder->currentmessage->filename);
- MMIMMS_DeleteManagerList(g_pManager->outboxfolder);
- SCI_TRACE_LOW("MSG_MMS_SENDED_FAILED MMIMMS_DeleteManagerList COMEOUT-----");
- }
- }
- MMK_CloseWin(win_id);
- break;
- default:
- recode = PUBWIN_HandleWaiting1MessageWinMsg(win_id, msg_id, param);
- break;
- }
- return (recode);
- }
- /* ----------------------------------------------------------------------------
- * Function Name: SendReadRpt_HandleWaitingWin
- * Purpose: 发送阅读报告时的等待窗口消息处理函数
- * Input: MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- * Returns: MMI_RESULT_E
- * Author:nihongf@mobilesoft.com.cn
- * ----------------------------------------------------------------------------*/
- LOCAL MMI_RESULT_E SendReadRpt_HandleWaitingWin(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_RESULT_E recode = MMI_RESULT_TRUE;
- static BOOLEAN s_is_save_success = FALSE;
- static BOOLEAN s_is_show_new_mms_alert = FALSE;
- switch(msg_id)
- {
- case MSG_OPEN_WINDOW:
- //init
- s_is_save_success = FALSE;
- s_is_show_new_mms_alert = FALSE;
- recode = PUBWIN_HandleWaiting1MessageWinMsg( win_id, msg_id, param);
- break;
- case MSG_APP_CANCEL:
- if(g_netusing == MMS_MSG_NETUSING_STEP1||g_netusing == MMS_MSG_NETUSING_STEP2)
- {
- MMS_Close();
- SCI_TRACE_LOW("FNH APP_CANCEL SendReadRpt_HandleWaitingWin");
- g_netusing = MMS_MSG_NETUSING_NULL;
- }
- MMK_CloseWin(win_id);
- g_filetype = MMICMS_GetCurrentFFS();
- if (g_filetype != FS_INVALID)
- {
- MMIMMS_CreateReadMMSWaitingWin();
- MMIMMS_ReadMMS(g_pCurrentList);
- }
- break;
- case MSG_CLOSE_WINDOW:
- //free memory
- //MMIMMS_FreeBeginToDownloadMMSMem();
- //disconnect wap
- if(g_netusing == MMS_MSG_NETUSING_STEP1||g_netusing == MMS_MSG_NETUSING_STEP2)
- {
- MMS_Close();
- // MMIMMS_DeleteManagerList(g_pManager->outboxfolder);
- // mmsf_Remove((char *)g_pManager->outboxfolder->currentmessage->filename);//liangliu modify 2005-11-28
- SCI_TRACE_LOW("fnh close SendReadRpt_HandleWaitingWin");
- g_netusing = MMS_MSG_NETUSING_NULL;
- }
- g_issendingreadrpt = FALSE;
- recode = PUBWIN_HandleWaiting1MessageWinMsg( win_id, msg_id, param);
- break;
- case MSG_APP_FLIP://modify 2006-5-12 fnh 翻盖不处理
- MMIDEFAULT_HandleFlipKey(FALSE);
- break;
- case MSG_APP_RED:
- recode = MMI_RESULT_TRUE;
- break;
- case MSG_MMS_SEND_OK://阅读报告无论发送成功或者失败都直接跳到一个画面
- MMS_Close();
- g_netusing = MMS_MSG_NETUSING_STEP3;
- g_issendingreadrpt = FALSE;
- MMK_PostMsg(MMIMMS_INBOX_LIST_WIN_ID,MSG_MMS_SEND_OK,PNULL,PNULL);
- MMK_CloseWin(win_id);
- break;
- case MSG_MMS_SENDED_FAILED:
- MMS_Close();
- g_netusing = MMS_MSG_NETUSING_STEP3;
- g_issendingreadrpt = FALSE;
- MMK_PostMsg(MMIMMS_INBOX_LIST_WIN_ID,MSG_MMS_SENDED_FAILED,PNULL,PNULL);
- MMK_CloseWin(win_id);
- break;
- default:
- recode = PUBWIN_HandleWaiting1MessageWinMsg(win_id, msg_id, param);
- break;
- }
- return (recode);
- }
- LOCAL MMI_RESULT_E Setting_HandleMenuWinMsg(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_RESULT_E recode = MMI_RESULT_TRUE;
- uint32 group_id = 0;
- uint32 menu_id = 0;
- switch( msg_id )
- {
- case MSG_OPEN_WINDOW:
- MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- MMK_SetAtvCtrl( win_id, MMIMMS_SETTING_MENU_CTRL_ID);
- break;
- case MSG_GET_FOCUS:
- MMK_SetAtvCtrl( win_id, MMIMMS_SETTING_MENU_CTRL_ID);
- break;
- case MSG_FULL_PAINT:
- {
- FILE_DEV_E_T cur_type;
- cur_type = MMICMS_GetCurrentFFS();
- if (cur_type == FS_INVALID)
- {
- MMI_EnableGrayed(MENU_MMS_SETTING,ID_MMS_SETTING_SIGN,TRUE);
- }
- else
- {
- MMI_EnableGrayed(MENU_MMS_SETTING,ID_MMS_SETTING_SIGN,FALSE);
- }
- }
- break;
- case MSG_APP_OK:
- case MSG_CTL_OK:
- GUIMENU_GetRetID( MMIMMS_SETTING_MENU_CTRL_ID, (MMI_MENU_GROUP_ID_T *)(&group_id),(MMI_MENU_ID_T *) (&menu_id));
- switch ( menu_id)
- {
- case ID_MMS_SETTING_NETWORK_SETTING:
- MMK_CreateWin((uint32 *)MMIMMS_SETTING_NETWORK_WIN,PNULL);
- break;
- case ID_MMS_SETTING_ARRIVE_REPORT:
- MMK_CreateWin((uint32 *)MMIMMS_SETTING_ARRIVE_LIST_WIN,PNULL);
- break;
- case ID_MMS_SETTING_READ_REPORT:
- MMK_CreateWin((uint32 *)MMIMMS_SETTING_READREPORT_LIST_WIN,PNULL);
- break;
- case ID_MMS_SETTING_ANONYMITY:
- MMK_CreateWin((uint32 *)MMIMMS_SETTING_ANONYMITYWHETHER_LIST_WIN,PNULL);
- break;
- case ID_MMS_SETTING_PRIORITY:
- MMK_CreateWin((uint32 *)MMIMMS_SETTING_PRIORITY_LIST_WIN,PNULL);
- break;
- case ID_MMS_SETTING_AUTO_DOWNLOAD:
- MMK_CreateWin((uint32 *)MMIMMS_SETTING_AUTODOWNLOAD_LIST_WIN,PNULL);
- break;
- case ID_MMS_SETTING_SOUND:
- MMK_CreateWin((uint32 *)MMIMMS_SETTING_SOUNDALLOWABLE_LIST_WIN,PNULL);
- break;
- case ID_MMS_SETTING_ADVERTISING:
- MMK_CreateWin((uint32 *)MMIMMS_SETTING_ADVERTISINGALLOWABLE_LIST_WIN,PNULL);
- break;
- case ID_MMS_SETTING_PERIOD:
- MMK_CreateWin((uint32 *)MMIMMS_SETTING_VALIDE_PERIOD_LIST_WIN, PNULL);
- break;
- case ID_MMS_SETTING_SIGN:
- MMK_CreateWin((uint32 *)MMIMMS_SETTING_SIGN_WIN, PNULL);
- break;
- case ID_MMS_SETTING_DEFAULT:
- PUBWIN_OpenPromptQueryWin(
- TXT_CMS_MMS_RESTORE_DEFAULT,
- IMAGE_PROMPT_ICON_QUERY
- );
- break;
- case ID_MMS_SETTING_OPEN_SIGN:
- MMK_CreateWin((uint32 *)MMIMMS_SETTING_OPENSIGN_LIST_WIN,PNULL);
- break;
- case ID_MMS_SETTING_EDIT_SIGN:
- g_filetype = MMICMS_GetCurrentFFS();
- if (g_filetype != FS_INVALID)
- {
- MMIMMS_CreateReadMMSWaitingWin();
- g_readsignstate= MMS_MSG_READ_SIGN_FOR_SET;
- MMIMMS_ReadAutosign() ;
- }
- break;
- default:
- break;
- }
- break;
- case MSG_PROMPTWIN_OK:
- MMIMMS_ResetConfig();
- PUBWIN_ClosePromptQueryWin();
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_SUCCESS,
- IMAGE_PROMPT_ICON_SUCCESS,
- MMI_3SECONDS,
- PNULL);
- break;
- case MSG_PROMPTWIN_CANCEL:
- PUBWIN_ClosePromptQueryWin();
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- MMK_CloseWin(win_id);
- break;
- default:
- recode = MMI_RESULT_FALSE;
- break;
- }
- return recode;
- }
- /* ----------------------------------------------------------------------------
- * Function Name: MMIMMS_HandleNormalWaitingWin
- * Purpose: 删除彩信时等待窗口消息处理函数
- * Input: MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- * Returns: MMI_RESULT_E
- * Author:nihongf@mobilesoft.com.cn
- * ----------------------------------------------------------------------------*/
- LOCAL MMI_RESULT_E MMIMMS_HandleNormalWaitingWin(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_RESULT_E recode = MMI_RESULT_TRUE;
- static BOOLEAN s_is_save_success = FALSE;
- static BOOLEAN s_is_show_new_mms_alert = FALSE;
- FFS_SAVEFILE_RESULT_T * efs_result_ptr;
- switch(msg_id)
- {
- case MSG_OPEN_WINDOW:
- //init
- s_is_save_success = FALSE;
- s_is_show_new_mms_alert = FALSE;
- recode = PUBWIN_HandleWaiting1MessageWinMsg( (MMI_WIN_ID_T)win_id, msg_id, param);
- break;
- //case MSG_APP_CANCEL:
- //query
- // PUBWIN_OpenPromptQueryWin(STXT_EXIT, IMAGE_PROMPT_ICON_QUERY);
- // break;
- case MSG_APP_FLIP://modify 2006-3-10 翻盖不处理
- MMIDEFAULT_HandleFlipKey(FALSE);
- break;
- case MSG_APP_RED:
- recode = MMI_RESULT_TRUE;
- break;
- case MSG_MMS_DELETEMMS_OK:
- switch(g_savestate)
- {
- case MMS_MSG_SAVEFILE_FOR_INBOX_DELETE:
- SCI_TRACE_LOW("MMS_MSG_SAVEFILE_FOR_INBOX_DELETE HERE IS NORMAL---------");
- MMIMMS_DeleteManagerList(g_pManager->inboxfolder);
- MMK_CloseWin(win_id);
- MMIMMS_StoreFolder(g_pManager->inboxfolder);
- SCI_TRACE_LOW("MMIMMS_StoreFolder IS OVER");
- MMIMMS_SaveManagerInboxFile(MMS_SAVE_INBOX);
- //MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVEINBOXFILE, PNULL, PNULL);
- //MMK_CloseWin(win_id);
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_DONE,
- IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- break;
- case MMS_MSG_SAVEFILE_FOR_OUTBOX_DELETE:
- MMIMMS_DeleteManagerList(g_pManager->outboxfolder);
- MMK_CloseWin(win_id);
- MMIMMS_StoreFolder(g_pManager->outboxfolder);
- MMIMMS_SaveManagerOutboxFile();
- // MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVEOUTBOXFILE, PNULL, PNULL);
- //MMK_CloseWin(win_id);
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_DONE,
- IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- break;
- case MMS_MSG_SAVEFILE_FOR_SENTBOX_DELETE:
- MMIMMS_DeleteManagerList(g_pManager->sentfolder);
- MMK_CloseWin(win_id);
- MMIMMS_StoreFolder(g_pManager->sentfolder);
- MMIMMS_SaveManagerSentboxFile();
- //MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVESENTBOXFILE, PNULL, PNULL);
- //MMK_CloseWin(win_id);
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_DONE,
- IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- break;
- case MMS_MSG_SAVEFILE_FOR_DRAFTBOX_DELETE:
- MMIMMS_DeleteManagerList(g_pManager->draftfolder);
- MMK_CloseWin(win_id);
- MMIMMS_StoreFolder(g_pManager->draftfolder);
- MMIMMS_SaveManagerDraftboxFile();
- // MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVEDRAFTBOXFILE, PNULL, PNULL);
- //MMK_CloseWin(win_id);
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_DONE,
- IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- break;
- default:
- break;
- }
- break;
- case MSG_MMS_DELETEONEMMS_OK:
- MMIMMS_DeleteManagerListOneOfAll(g_pManager->currentfolder);
- if(g_pManager->currentfolder->root != NULL)
- {
- MMIMMS_DeleteMMSOneOfAll(g_pManager->currentfolder);
- }
- else
- {
- switch(g_savestate)
- {
- case MMS_MSG_SAVEFILE_FOR_INBOX_DELETE:
- MMK_CloseWin(win_id);
- MMIMMS_StoreFolder(g_pManager->inboxfolder);
- g_pManager->inboxfolder->unsettlednumber = 0;//modify 2005-12-2
- SCI_TRACE_LOW("MMIMMS_StoreFolder IS OVER");
- MMIMMS_SaveManagerInboxFile(MMS_SAVE_INBOX);
- // MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVEINBOXFILE, PNULL, PNULL);
- //MMK_CloseWin(win_id);
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_DONE,
- IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- break;
- case MMS_MSG_SAVEFILE_FOR_OUTBOX_DELETE:
- MMIMMS_StoreFolder(g_pManager->outboxfolder);
- MMIMMS_SaveManagerOutboxFile();
- // MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVEOUTBOXFILE, PNULL, PNULL);
- MMK_CloseWin(win_id);
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_DONE,
- IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- break;
- case MMS_MSG_SAVEFILE_FOR_SENTBOX_DELETE:
- MMK_CloseWin(win_id);
- MMIMMS_StoreFolder(g_pManager->sentfolder);
- MMIMMS_SaveManagerSentboxFile();
- // MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVESENTBOXFILE, PNULL, PNULL);
- //MMK_CloseWin(win_id);
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_DONE,
- IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- break;
- case MMS_MSG_SAVEFILE_FOR_DRAFTBOX_DELETE:
- MMK_CloseWin(win_id);
- MMIMMS_StoreFolder(g_pManager->draftfolder);
- MMIMMS_SaveManagerDraftboxFile();
- //MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVEDRAFTBOXFILE, PNULL, PNULL);
- //MMK_CloseWin(win_id);
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_DONE,
- IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- break;
- default:
- break;
- }
- }
- break;
- case MSG_MMS_SAVE_OK:
- efs_result_ptr = (FFS_SAVEFILE_RESULT_T*)param;
- if(efs_result_ptr->write_result == SAVEFS_WRITE_SUCCEED)
- {
- //FILE_Close(efs_result_ptr->hefs);
- FFS_Close(g_filetype, efs_result_ptr->hefs);
- if(efs_result_ptr->buf_ptr != PNULL)
- {
- cms_free(efs_result_ptr->buf_ptr);
- efs_result_ptr->buf_ptr = PNULL;
- }
- }
- MMK_CloseWin(win_id);
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMI_SAVESUCC,
- IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- break;
- case MSG_CLOSE_WINDOW:
- recode = PUBWIN_HandleWaiting1MessageWinMsg( (MMI_WIN_ID_T)win_id, msg_id, param);
- break;
- default:
- recode = PUBWIN_HandleWaiting1MessageWinMsg((MMI_WIN_ID_T)win_id, msg_id, param);
- break;
- }
- return (recode);
- }
- /* ----------------------------------------------------------------------------
- * Function Name: MMIMMS_HandleReadMMSWaitingWin
- * Purpose: 读取彩信时等待窗口消息处理函数
- * Input: MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- * Returns: MMI_RESULT_E
- * Author:nihongf@mobilesoft.com.cn
- * ----------------------------------------------------------------------------*/
- LOCAL MMI_RESULT_E MMIMMS_HandleReadMMSWaitingWin(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_RESULT_E recode = MMI_RESULT_TRUE;
- static BOOLEAN s_is_save_success = FALSE;
- static BOOLEAN s_is_show_new_mms_alert = FALSE;
- FFS_READFILE_RESULT_T * efs_readresult_ptr;
- FFS_SAVEFILE_RESULT_T * efs_writeresult_ptr;
- FILE_HANDLE cmshandle = NULL;
- uint32 filelen = 0;
- //uint16 selected_index = 0;
- switch(msg_id)
- {
- case MSG_OPEN_WINDOW:
- //init
- s_is_save_success = FALSE;
- s_is_show_new_mms_alert = FALSE;
- recode = PUBWIN_HandleWaiting1MessageWinMsg( win_id, msg_id, param);
- break;
- case MSG_MMS_READ_SIGN_FAILED:
- SCI_TRACE_LOW("fnh MSG_MMS_READ_SIGN_FAILED before POST msg!");
- MMK_PostMsg(MMIMSG_MAIN_WIN_ID,MSG_MMS_READ_PLAY_SIGN_FAILED, PNULL, 0);
- MMK_CloseWin(win_id);
- break;
- case MSG_MMS_READ_SIGN_OK:
- SCI_TRACE_LOW("FNH MSG_MMS_READ_SIGN_OK!");
- efs_readresult_ptr = (FFS_READFILE_RESULT_T*)param;
- FFS_Close(g_filetype,efs_readresult_ptr->hefs);
- cmshandle = mmsf_Open((char*)"signtempfile.mms", "wb");
- mmsf_Write((char*)efs_readresult_ptr->buf_ptr,efs_readresult_ptr->buf_size, 1, cmshandle);
- filelen=Cms_GetFileLength(cmshandle);
- SCI_TRACE_LOW("FNH get file length = %d",filelen);
- mmsf_Close(cmshandle);
- if(efs_readresult_ptr->buf_ptr != PNULL)
- {
- cms_free(efs_readresult_ptr->buf_ptr);
- efs_readresult_ptr->buf_ptr = PNULL;
- }
- if (g_readsignstate== MMS_MSG_READ_SIGN_FOR_SET)
- {
- SCI_TRACE_LOW("FNH before postmsg!");
- MMK_PostMsg(MMIMSG_MAIN_WIN_ID,MSG_MMS_READ_PLAY_SIGN_OK, PNULL, 0);
- }
- else if (g_readsignstate== MMS_MSG_READ_SIGN_FOR_EDIT)
- {
- MMK_PostMsg(MMIMSG_MAIN_WIN_ID,MSG_MMS_READ_PLAY_SIGN_OK, PNULL, 0);
- }
- else if (g_readsignstate == MMS_MSG_READ_SIGN_FOR_ANSWER_MMS)
- {
- MMK_PostMsg(MMIMSG_MAIN_WIN_ID,MSG_MMS_READ_PLAY_SIGN_OK, PNULL, 0);
- }
- MMK_CloseWin(win_id);
- break;
- case MSG_MMS_READ_OK:
- efs_readresult_ptr = (FFS_READFILE_RESULT_T*)param;
- FFS_Close(g_filetype,efs_readresult_ptr->hefs);
- if(g_pManager->currentfolder->type ==MMS_FOLDER_TYPE_INBOX )
- {
- cmshandle = mmsf_Open((char*)g_pCurrentList->filename, "wb");
- }else
- {
- SCI_TRACE_LOW("fnh in MSG_MMS_READ_OK filename is %s",g_pManager->currentfolder->currentmessage->filename);
- cmshandle = mmsf_Open((char*)g_pManager->currentfolder->currentmessage->filename, "wb");
- }
- SCI_TRACE_LOW("fnh read ok bufptr len = %d",SCI_STRLEN((char *)efs_readresult_ptr->buf_ptr));
- SCI_TRACE_LOW("fnh size = %d",efs_readresult_ptr->buf_size);
- SCI_TRACE_LOW("fnh filename is %s",g_pManager->currentfolder->currentmessage->filename);
- mmsf_Write((char*)efs_readresult_ptr->buf_ptr,efs_readresult_ptr->buf_size, 1, cmshandle);
- filelen = Cms_GetFileLength(cmshandle);
- SCI_TRACE_LOW("fnh filelen = %d",filelen);
- mmsf_Close(cmshandle);
- if(efs_readresult_ptr->buf_ptr != PNULL)
- {
- cms_free(efs_readresult_ptr->buf_ptr);
- efs_readresult_ptr->buf_ptr = PNULL;
- }
- if(g_pManager->currentfolder->type ==MMS_FOLDER_TYPE_INBOX )
- {
- SCI_TRACE_LOW("2005-2-15 COME HERE g_pCurrentList->state = %d",g_pCurrentList->state);
- if(g_pCurrentList->state == 1)
- {
- SCI_TRACE_LOW("FNH IN state 1");
- g_pCurrentList->state = 2;
- MMIMMS_SortManagerFolder(g_pManager->inboxfolder,g_pCurrentList);
- MMIMMS_StoreFolder(g_pManager->inboxfolder);
- MMIMMS_SaveManagerInboxFile(MMS_SAVE_INBOX_PUSH);
- }
- else
- {
- SCI_TRACE_LOW("FNH before switch");
- switch(g_readforstate)
- {
- SCI_TRACE_LOW("2005-2-15 COME HERE state = 2");
- case MMS_MSG_INBOX_READ_FOR_PLAY:
- SCI_TRACE_LOW("FNH postmsg for play");
- MMK_PostMsg(MMIMMS_INBOX_MMSOPT_MENU_WIN_ID,MSG_MMS_READ_FOR_PLAY, PNULL, 0);
- break;
- case MMS_MSG_INBOX_READ_FOR_FW:
- MMK_PostMsg(MMIMMS_INBOX_MMSOPT_MENU_WIN_ID,MSG_MMS_READ_FOR_FW, PNULL, 0);
- break;
- case MMS_MSG_INBOX_READ_FOR_SAVEPIC:
- MMK_PostMsg(MMIMMS_INBOX_MMSOPT_MENU_WIN_ID,MSG_MMS_READ_FOR_SAVEPIC, PNULL, 0);
- break;
- case MMS_MSG_INBOX_READ_FOR_SAVESOUND:
- MMK_PostMsg(MMIMMS_INBOX_MMSOPT_MENU_WIN_ID,MSG_MMS_READ_FOR_SAVESOUND, PNULL, 0);
- break;
- case MMS_MSG_INBOX_READ_FOR_SAVEVIDEO:
- MMK_PostMsg(MMIMMS_INBOX_MMSOPT_MENU_WIN_ID,MSG_MMS_READ_FOR_SAVEVIDEO, PNULL, 0);
- break;
- default:
- break;
- }
- SCI_TRACE_LOW("FNH before closewin");
- MMK_CloseWin(win_id);
- }
- }else
- {
- SCI_TRACE_LOW("2005-2-15 COME HERE else state = 1");
- switch(g_readforstate)
- {
- case MMS_MSG_SENTBOX_READ_FOR_PLAY:
- MMK_PostMsg(MMIMMS_SENTBOX_LIST_WIN_ID,MSG_MMS_READ_FOR_PLAY, PNULL, 0);
- break;
- case MMS_MSG_SENTBOX_READ_FOR_FW:
- MMK_PostMsg(MMIMMS_SENTBOX_LIST_WIN_ID,MSG_MMS_READ_FOR_FW, PNULL, 0);
- break;
- case MMS_MSG_DRAFTBOX_READ_FOR_EDIT:
- MMK_PostMsg(MMIMMS_DRAFTBOX_LIST_WIN_ID,MSG_MMS_READ_FOR_EDIT, PNULL, 0);
- break;
- case MMS_MSG_OUTBOX_READ_FOR_EDIT:
- MMK_PostMsg(MMIMMS_OUTBOX_LIST_WIN_ID,MSG_MMS_READ_FOR_EDIT, PNULL, 0);
- break;
- case MMS_MSG_OUTBOX_READ_FOR_PLAY:
- MMK_PostMsg(MMIMMS_OUTBOX_LIST_WIN_ID,MSG_MMS_READ_FOR_PLAY, PNULL, 0);
- break;
- case MMS_MSG_OUTBOX_READ_FOR_SEND:
- MMK_PostMsg(MMIMMS_OUTBOX_LIST_WIN_ID,MSG_MMS_READ_FOR_SEND, PNULL, 0);
- break;
- default:
- break;
- }
- MMK_CloseWin(win_id);
- }
- //打开的接着的下一个状态不同,POST不同的消息.
- break;
- case MSG_MANAGERFILEWRITE_INBOX_OK:
- SCI_TRACE_LOW("2005-2-15 READMMS MSG_MANAGERFILEWRITE_INBOX_OK");
- efs_writeresult_ptr = (FFS_SAVEFILE_RESULT_T*)param;
- SCI_TRACE_LOW("2005-2-15 READMMS efs_writeresult_ptr->write_result is %d",efs_writeresult_ptr->write_result);
- if(efs_writeresult_ptr->write_result == SAVEFS_WRITE_SUCCEED)
- {
- FFS_Close(g_filetype, efs_writeresult_ptr->hefs);
- inboxfile_openstatus = FFS_INVALID_HANDLE;
- mmsf_Remove((char*)"\cmsinbox.cnf");
- switch(g_readforstate)
- {
- SCI_TRACE_LOW("2005-2-15 COME HERE");
- SCI_TRACE_LOW("2005-2-15 g_readforstate is %d",g_readforstate);
- case MMS_MSG_INBOX_READ_FOR_PLAY:
- MMK_PostMsg(MMIMMS_INBOX_MMSOPT_MENU_WIN_ID,MSG_MMS_READ_FOR_PLAY, PNULL, 0);
- break;
- case MMS_MSG_INBOX_READ_FOR_FW:
- MMK_PostMsg(MMIMMS_INBOX_MMSOPT_MENU_WIN_ID,MSG_MMS_READ_FOR_FW, PNULL, 0);
- break;
- case MMS_MSG_INBOX_READ_FOR_SAVEPIC:
- MMK_PostMsg(MMIMMS_INBOX_MMSOPT_MENU_WIN_ID,MSG_MMS_READ_FOR_SAVEPIC, PNULL, 0);
- break;
- case MMS_MSG_INBOX_READ_FOR_SAVESOUND:
- MMK_PostMsg(MMIMMS_INBOX_MMSOPT_MENU_WIN_ID,MSG_MMS_READ_FOR_SAVESOUND, PNULL, 0);
- break;
- case MMS_MSG_INBOX_READ_FOR_SAVEVIDEO:
- MMK_PostMsg(MMIMMS_INBOX_MMSOPT_MENU_WIN_ID,MSG_MMS_READ_FOR_SAVEVIDEO, PNULL, 0);
- break;
- default:
- break;
- }
- MMK_CloseWin(win_id);
- }
- break;
- case MSG_MMS_READ_FAILED:
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_READ_FAILED,
- IMAGE_PROMPT_ICON_FAIL,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- MMK_CloseWin(win_id);
- break;
- case MSG_APP_FLIP://modify 2006-5-12 fnh 翻盖不处理
- MMIDEFAULT_HandleFlipKey(FALSE);
- break;
- case MSG_APP_RED:
- recode = MMI_RESULT_TRUE;
- break;
- case MSG_CLOSE_WINDOW:
- recode = PUBWIN_HandleWaiting1MessageWinMsg( win_id, msg_id, param);
- break;
- default:
- recode = PUBWIN_HandleWaiting1MessageWinMsg( win_id, msg_id, param);
- break;
- }
- return (recode);
- }
- /* ----------------------------------------------------------------------------
- * Function Name: MMIMMS_HandleSaveMMSWaitingWin
- * Purpose: 保存彩信时等待窗口消息处理函数
- * Input: MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- * Returns: MMI_RESULT_E
- * Author:nihongf@mobilesoft.com.cn
- * ----------------------------------------------------------------------------*/
- LOCAL MMI_RESULT_E MMIMMS_HandleSaveMMSWaitingWin(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_RESULT_E recode = MMI_RESULT_TRUE;
- FFS_SAVEFILE_RESULT_T * efs_result_ptr;
- switch(msg_id)
- {
- case MSG_FULL_PAINT:
- //MMIMMS_CLEAR_CLIENT();
- recode = PUBWIN_HandleWaiting1MessageWinMsg( win_id, msg_id, param);
- break;
- case MSG_OPEN_WINDOW:
- break;
- case MSG_MMS_DELETEMANAGERFILE_OK:
- g_savemmsstate = MMS_MSG_SAVEMMS_FOR_NULL;
- MMIMMS_StoreFolder(g_pManager->sentfolder);
- MMIMMS_SaveManagerSentboxFile();
- // MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVESENTBOXFILE, PNULL, PNULL);
- MMK_CloseWin(win_id);
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_SEND_SUCCEED,
- IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- MMIDEFAULT_SetBackLight(TRUE);
- break;
- case MSG_MANAGERFILEWRITE_OUTBOX_FAILED:
- MMK_CloseWin(win_id);
- g_savemmsstate = MMS_MSG_SAVEMMS_FOR_NULL;
- MMIMMS_StoreFolder(g_pManager->sentfolder);
- MMIMMS_SaveManagerSentboxFile();
- MMIDEFAULT_SetBackLight(TRUE);
- break;
- case MSG_MANAGERFILEWRITE_OUTBOX_OK:
- efs_result_ptr = (FFS_SAVEFILE_RESULT_T*)param;
- if(efs_result_ptr->write_result == SAVEFS_WRITE_SUCCEED)
- {
- FFS_Close(g_filetype, efs_result_ptr->hefs);
- mmsf_Remove((char*)"\cmsoutbox.cnf" );
- }
- g_savemmsstate = MMS_MSG_SAVEMMS_FOR_NULL;
- MMIMMS_StoreFolder(g_pManager->sentfolder);
- MMIMMS_SaveManagerSentboxFile();
- // MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVESENTBOXFILE, PNULL, PNULL);
- MMK_CloseWin(win_id);
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_SEND_SUCCEED,
- IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- MMIDEFAULT_SetBackLight(TRUE);
- break;
- case MSG_MMS_SAVE_FAILED:
- SCI_TRACE_LOW("HERE THE MSG_ID IS MSG_MMS_SAVE_FAILED");
- switch(g_savemmsstate)
- {
- case MMS_MSG_SAVEMMS_FOR_RECV:
- SCI_TRACE_LOW("HERE TMMS_MSG_SAVEMMS_FOR_RECV------- ");
- g_savemmsstate = MMS_MSG_SAVEMMS_FOR_NULL;
- g_savestate = MMS_MSG_SAVEFILE_FOR_RECV;
- if (g_pManager != NULL)
- {
- MMIMMS_DeleteManagerList(g_pManager->inboxfolder);
- }
- MMK_CloseWin(win_id);
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_RECV_FAILED,
- IMAGE_PROMPT_ICON_FAIL,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- MMICMSBRW_FreeGlobalBuffer(); //fnh add
- break;
- case MMS_MSG_SAVEMMS_FOR_SEND_SUCCESS:
- SCI_TRACE_LOW("HERE HANDLE MMS_MSG_SAVEMMS_FOR_SEND_SUCCESS ");
- g_savemmsstate = MMS_MSG_SAVEMMS_FOR_NULL;
- SCI_TRACE_LOW( "mmimms_wintable.c, MMIMMS_HandleSaveMMSWaitingWin(), MMS_MSG_SAVEMMS_FOR_SEND_SUCCESS, g_pManager = %X",g_pManager);
- if ( PNULL != g_pManager )
- {
- MMIMMS_DeleteManagerList(g_pManager->sentfolder);
- }
- MMK_CloseWin(win_id);
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_SEND_SUCCEED,
- IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- MMIDEFAULT_SetBackLight(TRUE);
- break;
- case MMS_MSG_SAVEMMS_FOR_SEND_FAILED:
- SCI_TRACE_LOW("HERE HANDLE MMS_MSG_SAVEMMS_FOR_SEND_FAILED ");
- g_savemmsstate = MMS_MSG_SAVEMMS_FOR_NULL;
- if (g_pManager != NULL)
- {
- MMIMMS_DeleteManagerList(g_pManager->outboxfolder);
- }
- MMK_CloseWin(win_id);
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_SEND_FAILED,
- IMAGE_PROMPT_ICON_FAIL,
- ALERT_TIMEOUT,
- PNULL
- );
- MMIDEFAULT_SetBackLight(TRUE);
- break;
- case MMS_MSG_SAVEMMS_FOR_DRAFTSAVE:
- SCI_TRACE_LOW("HERE HANDLE MMS_MSG_SAVEMMS_FOR_DRAFTSAVE ");
- SCI_TRACE_LOW( "mmimms_wintable.c, MMIMMS_HandleSaveMMSWaitingWin(), g_pManager = %X",g_pManager);
- g_savemmsstate = MMS_MSG_SAVEMMS_FOR_NULL;
- if ( PNULL != g_pManager )
- {
- MMIMMS_DeleteManagerList(g_pManager->draftfolder);
- }
- MMK_CloseWin(win_id);
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMI_SAVEFAILED,
- IMAGE_PROMPT_ICON_FAIL,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- MMIDEFAULT_SetBackLight(TRUE);
- SCI_TRACE_LOW( "mmimms_wintable.c, MMIMMS_HandleSaveMMSWaitingWin(), g_pManager = %X",g_pManager);
- break;
- default:
- SCI_TRACE_LOW("HERE HANDLE default ");
- MMK_CloseWin(win_id);
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMI_SAVEFAILED,
- IMAGE_PROMPT_ICON_FAIL,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- MMIDEFAULT_SetBackLight(TRUE);
- break;
- }
- break;
- case MSG_MMS_SAVE_OK:
- SCI_TRACE_LOW("HERE THE MSG_ID IS MSG_MMS_SAVE_OK------- ");
- efs_result_ptr = (FFS_SAVEFILE_RESULT_T*)param;
- if(efs_result_ptr->write_result == SAVEFS_WRITE_SUCCEED)
- {
- FFS_Close(g_filetype, efs_result_ptr->hefs);
- mmsf_Remove((char *)g_filename);
- }
- //MMIMMS_StoreMangerDocument();
- switch(g_savemmsstate)
- {
- case MMS_MSG_SAVEMMS_FOR_RECV:
- SCI_TRACE_LOW("HERE TMMS_MSG_SAVEMMS_FOR_RECV------- ");
- g_savemmsstate = MMS_MSG_SAVEMMS_FOR_NULL;
- g_savestate = MMS_MSG_SAVEFILE_FOR_RECV;
- MMIMMS_StoreFolder(g_pManager->inboxfolder);
- MMIMMS_SaveManagerInboxFile(MMS_SAVE_INBOX);
- //MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVEINBOXFILE, PNULL, PNULL);
- MMK_CloseWin(win_id);
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_RECV_SUCCES,
- IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- MMICMSBRW_FreeGlobalBuffer();
- break;
- case MMS_MSG_SAVEMMS_FOR_SEND_SUCCESS:
- SCI_TRACE_LOW("HERE HANDLE MMS_MSG_SAVEMMS_FOR_SEND_SUCCESS ");
- g_savemmsstate = MMS_MSG_SAVEMMS_FOR_NULL;
- SCI_TRACE_LOW( "mmimms_wintable.c, MMIMMS_HandleSaveMMSWaitingWin(), MMS_MSG_SAVEMMS_FOR_SEND_SUCCESS, g_pManager = %X",g_pManager);
- if ( PNULL != g_pManager )
- {
- MMIMMS_StoreFolder(g_pManager->sentfolder);
- MMIMMS_SaveManagerSentboxFile();
- // MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVESENTBOXFILE, PNULL, PNULL);
- MMK_CloseWin(win_id);
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_SEND_SUCCEED,
- IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- MMIDEFAULT_SetBackLight(TRUE);
- }
- else
- {
- SCI_ASSERT(0);
- }
- break;
- case MMS_MSG_SAVEMMS_FOR_SEND_FAILED:
- SCI_TRACE_LOW("HERE HANDLE MMS_MSG_SAVEMMS_FOR_SEND_FAILED ");
- g_savemmsstate = MMS_MSG_SAVEMMS_FOR_NULL;
- MMIMMS_StoreFolder(g_pManager->outboxfolder);
- MMIMMS_SaveManagerOutboxFile();
- //MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVEOUTBOXFILE, PNULL, PNULL);
- MMK_CloseWin(win_id);
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_SEND_FAILED,
- IMAGE_PROMPT_ICON_FAIL,
- ALERT_TIMEOUT,
- PNULL
- );
- MMIDEFAULT_SetBackLight(TRUE);
- break;
- case MMS_MSG_SAVEMMS_FOR_DRAFTSAVE:
- SCI_TRACE_LOW("HERE HANDLE MMS_MSG_SAVEMMS_FOR_DRAFTSAVE ");
- SCI_TRACE_LOW( "mmimms_wintable.c, MMIMMS_HandleSaveMMSWaitingWin(), g_pManager = %X",g_pManager);
- g_savemmsstate = MMS_MSG_SAVEMMS_FOR_NULL;
- if ( PNULL != g_pManager )
- {
- MMIMMS_StoreFolder(g_pManager->draftfolder);
- MMIMMS_SaveManagerDraftboxFile();
- MMK_CloseWin(win_id);
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMI_SAVESUCC,
- IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- MMIDEFAULT_SetBackLight(TRUE);
- }
- else
- {
- SCI_ASSERT(0);
- }
- SCI_TRACE_LOW( "mmimms_wintable.c, MMIMMS_HandleSaveMMSWaitingWin(), g_pManager = %X",g_pManager);
- break;
- default:
- SCI_TRACE_LOW("HERE HANDLE default ");
- MMK_CloseWin(win_id);
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMI_SAVESUCC,
- IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK,
- ALERT_TIMEOUT,
- PNULL
- );
- MMIDEFAULT_SetBackLight(TRUE);
- break;
- }
- break;
- case MSG_MMS_SAVE_AUTO_SIGN_OK:
- {
- SCI_TRACE_LOW("in MSG_MMS_SAVE_AUTO_SIGN_OK");
- efs_result_ptr = (FFS_SAVEFILE_RESULT_T*)param;
- if (MMK_IsOpenWin(MAIN_PROMPTALERT_WIN_ID)) //46351
- {
- MMK_CloseWin(MAIN_PROMPTALERT_WIN_ID);
- }
- SCI_TRACE_LOW("fnh write_result = %d",efs_result_ptr->write_result);
- if(efs_result_ptr->write_result == SAVEFS_WRITE_SUCCEED)
- {
- FFS_Close(g_filetype, efs_result_ptr->hefs);
- SCI_TRACE_LOW("size u is %d",efs_result_ptr->buf_size);
- SCI_TRACE_LOW("buffer ptr is %d",efs_result_ptr->buf_ptr);
- if(efs_result_ptr->buf_ptr != PNULL)
- {
- cms_free(efs_result_ptr->buf_ptr);
- efs_result_ptr->buf_ptr = PNULL;
- }
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_SUCCESS,
- IMAGE_PROMPT_ICON_SUCCESS,
- MMI_3SECONDS,
- PNULL);
- }else
- {
- FFS_Close(g_filetype, efs_result_ptr->hefs);
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_ERROR,
- IMAGE_PROMPT_ICON_SUCCESS,
- MMI_3SECONDS,
- PNULL);
- }
- MMK_CloseWin(win_id);
- }
- break;
- case MSG_MMS_SAVE_AUTO_SIGN_FAILED:
- MMK_CloseWin(win_id);
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_ERROR,
- IMAGE_PROMPT_ICON_SUCCESS,
- MMI_3SECONDS,
- PNULL);
- break;
- case MSG_APP_FLIP://modify 2006-5-12 fnh 翻盖不处理
- MMIDEFAULT_HandleFlipKey(FALSE);
- break;
- case MSG_APP_RED:
- recode = MMI_RESULT_TRUE;
- break;
- case MSG_CLOSE_WINDOW:
- SCI_TRACE_LOW("FNH CLOSE MMIMMS_HandleSaveMMSWaitingWin");
- g_netusing = MMS_MSG_NETUSING_NULL;
- recode = PUBWIN_HandleWaiting1MessageWinMsg( win_id, msg_id, param);
- break;
- default:
- recode = PUBWIN_HandleWaiting1MessageWinMsg( win_id, msg_id, param);
- break;
- }
- return (recode);
- }
- /******************************************************************************
- * 函数定义: cmsmms_HandlesavemusicWinMsg
- * 函数说明: 保存彩信内容中的音乐
- * 参数说明: win_id:窗口id
- msg_id:消息id
- param:窗口参数
- * 返回值: 空
- ********************************************************************************/
- LOCAL MMI_RESULT_E cmsmms_HandlesavemusicWinMsg(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_RESULT_E err_code = MMI_RESULT_TRUE;
- static P_MMS_FOLDER_SAVE_PARAM p_folder_save_param = NULL; /* 编辑器入口参数 */
- static pMMS_EDocument p_edoc = NULL;
- static pMMS_Slide p_mms_slide_temp = NULL;
- uint8 *buf_ptr = PNULL;
- static uint16 selindex ;
- MMS_CONTROL_ID_E list_ctrl_id = MMIMMS_SAVE_MUSIC_LIST_CTRL_ID;
- switch(msg_id)
- {
- case MSG_FULL_PAINT:
- MMK_SetWinSoftkeyId(win_id,STXT_OK,COMMON_TXT_NULL,STXT_RETURN,TRUE);
- MMIMMS_CLEAR_CLIENT();
- break;
- case MSG_OPEN_WINDOW:
- {
- MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- GUILISTBOX_SetMaxItem(list_ctrl_id, MMIMMS_GSEND_LIST_MAX_ITEM);
- selindex =0;
- MMK_SetAtvCtrl(win_id, list_ctrl_id);
- p_folder_save_param = (P_MMS_FOLDER_SAVE_PARAM)MMK_GetWinAddDataPtr( win_id);
- {
- p_edoc = p_folder_save_param->p_edit_doc;
- MMS_HeadSlide(p_edoc);
- while(p_edoc->slide_cur)
- {
- p_mms_slide_temp = p_edoc->slide_cur;
- if (p_mms_slide_temp->audio_type != 0)
- {
- buf_ptr = (uint8 *)p_mms_slide_temp->audiofile ;
- AppendListItem(buf_ptr,
- strlen((char *)buf_ptr),
- FALSE,
- list_ctrl_id,
- STXT_OK);
- }
- p_edoc->slide_cur = p_edoc->slide_cur->next;
- }
- }
- }
- break;
- case MSG_APP_OK:
- case MSG_CTL_OK:
- {
- uint16 curindex = 0;
- BOOLEAN b_finded = FALSE;
- T_Composer_Audio Audio;
- MMIMULTIM_MUSIC_TYPE_E audio_type = 0;
- selindex=GUILISTBOX_GetCurItemIndex(list_ctrl_id);
- p_edoc = p_folder_save_param->p_edit_doc;
- MMS_HeadSlide(p_edoc);
- while(p_edoc->slide_cur && !b_finded)
- {
- p_mms_slide_temp = p_edoc->slide_cur;
- if (p_mms_slide_temp->audio_type != 0)
- {
- curindex ++;
- if ((curindex-1) == selindex)
- {
- SCI_MEMSET(&Audio,0,sizeof(T_Composer_Audio));
- MMIMMS_GetCurSlideAudio(&Audio,p_edoc);
- if (strcmp(Audio.Type,"audio/wav") == 0)
- {
- audio_type = MMIMULTIM_TYPE_WAV;
- }
- if (strcmp(Audio.Type,"audio/midi") == 0)
- {
- audio_type = MMIMULTIM_TYPE_MIDI;
- }
- #ifdef HAVE_MP3
- if (strcmp(Audio.Type,"audio/mp3") == 0)
- {
- audio_type = MMIMULTIM_TYPE_MP3;
- }
- #endif
- #ifdef HAVE_AMR
- if (strcmp(Audio.Type, "audio/amr") == 0)
- {
- audio_type = MMIMULTIM_TYPE_AMR;
- }
- #endif
- b_finded = TRUE;
- break;
- }
- }
- p_edoc->slide_cur = p_edoc->slide_cur->next;
- }
- if (b_finded)
- {
- SCI_TRACE_LOW("audio was finded ");
- if (audio_type == MMIMULTIM_TYPE_MP3)
- {
- #ifdef HAVE_MP3
- audio_type = MMS_TYPE_MP3;
- MMIMMS_SaveDownloadmp3(Audio.AudBuf,Audio.size,audio_type, PNULL);
- #endif
- }
- else
- {
- MMIMULTIM_SaveDownloadRing(Audio.AudBuf,Audio.size,audio_type,PNULL);
- }
- }
- else
- {
- SCI_TRACE_LOW("warning:audio was not finded");
- }
- // MMK_CloseWin(win_id);
- }
- break;
- case MSG_GET_FOCUS:
- {
- GUILISTBOX_SetMaxItem(list_ctrl_id, MMIMMS_GSEND_LIST_MAX_ITEM);
- p_folder_save_param = (P_MMS_FOLDER_SAVE_PARAM)MMK_GetWinAddDataPtr( win_id);
- {
- p_edoc = p_folder_save_param->p_edit_doc;
- MMS_HeadSlide(p_edoc);
- while(p_edoc->slide_cur)
- {
- p_mms_slide_temp = p_edoc->slide_cur;
- if (p_mms_slide_temp->audio_type != 0)
- {
- buf_ptr = (uint8 *)p_mms_slide_temp->audiofile ;
- AppendListItem(buf_ptr,
- strlen((char *)buf_ptr),
- FALSE,
- list_ctrl_id,
- STXT_OK);
- }
- p_edoc->slide_cur = p_edoc->slide_cur->next;
- }
- }
- SCI_TRACE_LOW("FNH save music MSG_GET_FOCUS selindex = %d",selindex);
- GUILISTBOX_SetCurItemIndex(list_ctrl_id,selindex);
- MMK_SetAtvCtrl(win_id, list_ctrl_id);
- }
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- MMK_CloseWin(win_id);
- break;
- case MSG_CLOSE_WINDOW: /* 处理关闭窗口消息 */
- if (p_edoc)
- {
- SCI_TRACE_LOW("FNH before free MMS!");
- MMSDelDocument(p_edoc);
- SCI_TRACE_LOW("FNH after free MMS!");
- p_edoc = NULL;
- }
- if (p_folder_save_param)
- {
- SCI_TRACE_LOW("FNH before free p_folder_save_param");
- cms_free(p_folder_save_param);
- SCI_TRACE_LOW("FNH after free p_folder_save_param");
- p_folder_save_param = NULL;
- }
- break;
- default:
- err_code = MMI_RESULT_FALSE;
- break;
- }
- return err_code;
- }
- /* ----------------------------------------------------------------------------
- * Function Name: cmsmms_HandlesaveimageWinMsg
- * Purpose: 保存彩信内容中的图象
- * Input: win_id:窗口ID,
- msg_Id:消息ID,
- param:窗口参数
- * Returns: MMI_RESULT_E
- * Author:nihongf@mobilesoft.com.cn
- * ----------------------------------------------------------------------------*/
- LOCAL MMI_RESULT_E cmsmms_HandlesaveimageWinMsg(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_RESULT_E err_code = MMI_RESULT_TRUE;
- static P_MMS_FOLDER_SAVE_PARAM p_folder_save_param = NULL; /* 编辑器入口参数 */
- static pMMS_EDocument p_edoc = NULL;
- static pMMS_Slide p_mms_slide_temp = NULL;
- uint8 *buf_ptr = PNULL;
- static uint16 selindex ;
- MMS_CONTROL_ID_E list_ctrl_id = MMIMMS_SAVE_IMAGE_LIST_CTRL_ID;
- switch(msg_id)
- {
- case MSG_FULL_PAINT:
- MMK_SetWinSoftkeyId(win_id,STXT_OK,COMMON_TXT_NULL,STXT_RETURN,TRUE);
- MMIMMS_CLEAR_CLIENT();
- break;
- case MSG_OPEN_WINDOW:
- {
- SCI_TRACE_LOW("FNH in save image open window");
- selindex = 0;
- GUILISTBOX_SetMaxItem(list_ctrl_id, MMIMMS_GSEND_LIST_MAX_ITEM);
- MMK_SetAtvCtrl(win_id, list_ctrl_id);
- SCI_TRACE_LOW("FNH before get winadddata");
- p_folder_save_param = (P_MMS_FOLDER_SAVE_PARAM)MMK_GetWinAddDataPtr( win_id);
- SCI_TRACE_LOW("FNH after get winadddata");
- {
- pMMS_Content p_content_temp;
- p_edoc = p_folder_save_param->p_edit_doc;
- SCI_TRACE_LOW("FNH p_edoc = %d",p_edoc);
- MMS_HeadSlide(p_edoc);
- while(p_edoc->slide_cur)
- {
- p_mms_slide_temp = p_edoc->slide_cur;
- SCI_TRACE_LOW("FNH p_mms_slide_temp = %d",p_mms_slide_temp);
- SCI_TRACE_LOW("FNH p_mms_slide_temp->image_flag = %d",p_mms_slide_temp->image_flag);
- if (p_mms_slide_temp->image_flag == 1)
- {
- p_content_temp = p_mms_slide_temp->content_root;
- SCI_TRACE_LOW("FNH p_content_temp = %d",p_content_temp);
- while(p_content_temp)
- {
- SCI_TRACE_LOW("FNH p_content_temp->type = %d",p_content_temp->type);
- if (CmsIsSupportType(p_content_temp->type))
- {
- buf_ptr = (uint8 *)p_content_temp->filename;
- SCI_TRACE_LOW("FNH buf_ptr = %s",buf_ptr);
- AppendListItem(buf_ptr,
- strlen((char *)buf_ptr),
- FALSE,
- list_ctrl_id,
- STXT_OK);
- break;
- }
- p_content_temp = p_content_temp->next;
- }
- }
- p_edoc->slide_cur = p_edoc->slide_cur->next;
- }
- }
- }
- break;
- case MSG_GET_FOCUS:
- {
- SCI_TRACE_LOW("FNH in save image open window");
- GUILISTBOX_SetMaxItem(list_ctrl_id, MMIMMS_GSEND_LIST_MAX_ITEM);
- SCI_TRACE_LOW("FNH before get winadddata");
- p_folder_save_param = (P_MMS_FOLDER_SAVE_PARAM)MMK_GetWinAddDataPtr( win_id);
- SCI_TRACE_LOW("FNH after get winadddata");
- {
- pMMS_Content p_content_temp;
- p_edoc = p_folder_save_param->p_edit_doc;
- SCI_TRACE_LOW("FNH p_edoc = %d",p_edoc);
- MMS_HeadSlide(p_edoc);
- while(p_edoc->slide_cur)
- {
- p_mms_slide_temp = p_edoc->slide_cur;
- SCI_TRACE_LOW("FNH p_mms_slide_temp = %d",p_mms_slide_temp);
- SCI_TRACE_LOW("FNH p_mms_slide_temp->image_flag = %d",p_mms_slide_temp->image_flag);
- if (p_mms_slide_temp->image_flag == 1)
- {
- p_content_temp = p_mms_slide_temp->content_root;
- SCI_TRACE_LOW("FNH p_content_temp = %d",p_content_temp);
- while(p_content_temp)
- {
- SCI_TRACE_LOW("FNH p_content_temp->type = %d",p_content_temp->type);
- if (CmsIsSupportType(p_content_temp->type))
- {
- buf_ptr = (uint8 *)p_content_temp->filename;
- SCI_TRACE_LOW("FNH buf_ptr = %s",buf_ptr);
- AppendListItem(buf_ptr,
- strlen((char *)buf_ptr),
- FALSE,
- list_ctrl_id,
- STXT_OK);
- break;
- }
- p_content_temp = p_content_temp->next;
- }
- }
- p_edoc->slide_cur = p_edoc->slide_cur->next;
- }
- }
- SCI_TRACE_LOW("FNH save image MSG_GET_FOCUS selindex = %d",selindex);
- GUILISTBOX_SetCurItemIndex(list_ctrl_id,selindex);
- MMK_SetAtvCtrl(win_id, list_ctrl_id);
- }
- break;
- case MSG_APP_OK:
- case MSG_CTL_OK:
- {
- uint16 curindex = 0;
- pMMS_Content p_content_temp;
- BOOLEAN b_finded = FALSE;
- T_Composer_Image Image;
- ANIMATE_IMAGE_TYPE_E image_type = 0;
- selindex=GUILISTBOX_GetCurItemIndex(list_ctrl_id);
- SCI_TRACE_LOW("FNH MSG_CTL_OK selindex = %d",selindex);
- p_edoc = p_folder_save_param->p_edit_doc;
- MMS_HeadSlide(p_edoc);
- while( p_edoc->slide_cur && !b_finded )
- {
- p_mms_slide_temp = p_edoc->slide_cur;
- if (p_mms_slide_temp->image_flag == 1)
- {
- p_content_temp = p_mms_slide_temp->content_root;
- SCI_TRACE_LOW("FNH p_content_temp = %d",p_content_temp);
- while(p_content_temp)
- {
- if (CmsIsSupportType(p_content_temp->type))
- {
- SCI_TRACE_LOW("FNH p_content_temp->type = %d",p_content_temp->type);
- curindex ++;
- SCI_TRACE_LOW("fnh curindex = %d",curindex);
- if (curindex == (selindex+1))
- {
- SCI_MEMSET(&Image ,0, sizeof(T_Composer_Image));
- if (MMIMMS_GetCurSlideImage(&Image,p_edoc)!= -1)
- {
- SCI_TRACE_LOW("FNH Image.type = %s",Image.Type);
- if(strcmp(Image.Type,"image/gif") == 0)
- image_type = ANIM_GIF;
- else if(strcmp(Image.Type,"image/vnd.wap.wbmp") == 0)
- image_type = ANIM_WBMP;
- else if(strcmp(Image.Type,"image/jpeg") == 0)
- image_type = ANIM_JPG;
- else if (strcmp(Image.Type,"image/png") == 0)
- image_type = ANIM_PNG;
- else if (strcmp(Image.Type,"image/bmp") == 0)
- image_type = ANIM_BMP;
- SCI_TRACE_LOW("FNH Image.ImgBuf = %s",Image.ImgBuf);
- SCI_TRACE_LOW("FNH Image.size = %d",Image.size);
- SCI_TRACE_LOW("FNH image_type = %d",image_type);
- b_finded = TRUE;
- break;
- }
- }
- }
- p_content_temp = p_content_temp->next;
- }
- }
- p_edoc->slide_cur = p_edoc->slide_cur->next;
- }
- if( b_finded )
- {
- SCI_TRACE_LOW("the image was findedn");
- MMIMULTIM_SaveDownloadPic(Image.ImgBuf,Image.size,image_type,PNULL);
- }
- else
- {
- SCI_TRACE_LOW("warning the image was not findedn");
- }
- // MMK_CloseWin(win_id);
- }
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- MMK_CloseWin(win_id);
- break;
- case MSG_CLOSE_WINDOW: /* 处理关闭窗口消息 */
- if (p_edoc)
- {
- SCI_TRACE_LOW("FNH before free MMS!");
- MMSDelDocument(p_edoc);
- SCI_TRACE_LOW("FNH after free MMS!");
- p_edoc = NULL;
- }
- if (p_folder_save_param)
- {
- SCI_TRACE_LOW("FNH before free p_folder_save_param");
- cms_free(p_folder_save_param);
- SCI_TRACE_LOW("FNH after free p_folder_save_param");
- p_folder_save_param = NULL;
- }
- break;
- default:
- err_code = MMI_RESULT_FALSE;
- break;
- }
- return err_code;
- }
- /* ----------------------------------------------------------------------------
- * Function Name: cmsmms_HandlesavevideoWinMsg
- * Purpose: 保存彩信内容中的视频
- * Input: win_id:窗口ID,
- msg_Id:消息ID,
- param:窗口参数
- * Returns: MMI_RESULT_E
- * Author:nihongf@mobilesoft.com.cn
- * ----------------------------------------------------------------------------*/
- LOCAL MMI_RESULT_E cmsmms_HandlesavevideoWinMsg(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_RESULT_E err_code = MMI_RESULT_TRUE;
- static P_MMS_FOLDER_SAVE_PARAM p_folder_save_param = NULL; /* 编辑器入口参数 */
- static pMMS_EDocument p_edoc = NULL;
- static pMMS_Slide p_mms_slide_temp = NULL;
- uint8 *buf_ptr = PNULL;
- static uint16 selindex;
- MMS_CONTROL_ID_E list_ctrl_id = MMIMMS_SAVE_VIDEO_LIST_CTRL_ID;
- switch(msg_id)
- {
- case MSG_FULL_PAINT:
- MMK_SetWinSoftkeyId(win_id,STXT_OK,COMMON_TXT_NULL,STXT_RETURN,TRUE);
- MMIMMS_CLEAR_CLIENT();
- break;
- case MSG_OPEN_WINDOW:
- {
- MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- GUILISTBOX_SetMaxItem(list_ctrl_id, MMIMMS_GSEND_LIST_MAX_ITEM);
- selindex = 0;
- MMK_SetAtvCtrl(win_id, list_ctrl_id);
- p_folder_save_param = (P_MMS_FOLDER_SAVE_PARAM)MMK_GetWinAddDataPtr( win_id);
- {
- pMMS_Content p_content_temp;
- p_edoc = p_folder_save_param->p_edit_doc;
- MMS_HeadSlide(p_edoc);
- while(p_edoc->slide_cur)
- {
- p_mms_slide_temp = p_edoc->slide_cur;
- if (p_mms_slide_temp->video_flag == 1)
- {
- p_content_temp = p_mms_slide_temp->content_root;
- while(p_content_temp)
- {
- if (p_content_temp->type == MMS_TYPE_MP4 ||
- p_content_temp->type == MMS_TYPE_3GP )
- {
- buf_ptr = (uint8 *)p_content_temp->filename;
- AppendListItem(buf_ptr,
- strlen((char *)buf_ptr),
- FALSE,
- list_ctrl_id,
- STXT_OK);
- break;
- }
- p_content_temp = p_content_temp->next;
- }
- }
- p_edoc->slide_cur = p_edoc->slide_cur->next;
- }
- }
- }
- break;
- case MSG_APP_OK:
- case MSG_CTL_OK:
- {
- uint16 curindex = 0;
- pMMS_Content p_content_temp;
- BOOLEAN b_finded = FALSE;
- T_Composer_Video Video;
- uint32 video_type = 0;
- selindex=GUILISTBOX_GetCurItemIndex(list_ctrl_id);
- p_edoc = p_folder_save_param->p_edit_doc;
- MMS_HeadSlide(p_edoc);
- while(p_edoc->slide_cur && !b_finded)
- {
- p_mms_slide_temp = p_edoc->slide_cur;
- if (p_mms_slide_temp->video_flag == 1)
- {
- p_content_temp = p_mms_slide_temp->content_root;
- while(p_content_temp)
- {
- if (p_content_temp->type == MMS_TYPE_MP4 ||
- p_content_temp->type == MMS_TYPE_3GP )
- {
- curindex ++;
- if (curindex == (selindex+1))
- {
- SCI_MEMSET(&Video ,0, sizeof(T_Composer_Video));
- MMIMMS_GetCurSlideVideo(&Video,p_edoc);
- if(Video.Type == MPEG4_MP4_FILE)
- {
- video_type = MMS_TYPE_MP4;
- }
- if(Video.Type == MPEG4_3GP_FILE)
- {
- video_type = MMS_TYPE_3GP;
- }
- b_finded = TRUE;
- break;
- }
- }
- p_content_temp = p_content_temp->next;
- }
- }
- p_edoc->slide_cur = p_edoc->slide_cur->next;
- }
- if (b_finded)
- {
- SCI_TRACE_LOW("video is find");
- MMIMMS_SaveDownloadVideo(Video.VidBuf ,Video.size ,video_type, PNULL);
- }
- else
- {
- SCI_TRACE_LOW("warning is not find");
- }
- }
- break;
- case MSG_GET_FOCUS:
- {
- GUILISTBOX_SetMaxItem(list_ctrl_id, MMIMMS_GSEND_LIST_MAX_ITEM);
- p_folder_save_param = (P_MMS_FOLDER_SAVE_PARAM)MMK_GetWinAddDataPtr( win_id);
- {
- pMMS_Content p_content_temp;
- p_edoc = p_folder_save_param->p_edit_doc;
- MMS_HeadSlide(p_edoc);
- while(p_edoc->slide_cur)
- {
- p_mms_slide_temp = p_edoc->slide_cur;
- if (p_mms_slide_temp->video_flag == 1)
- {
- p_content_temp = p_mms_slide_temp->content_root;
- while(p_content_temp)
- {
- if (p_content_temp->type == MMS_TYPE_MP4 ||
- p_content_temp->type == MMS_TYPE_3GP )
- {
- buf_ptr = (uint8 *)p_content_temp->filename;
- AppendListItem(buf_ptr,
- strlen((char *)buf_ptr),
- FALSE,
- list_ctrl_id,
- STXT_OK);
- break;
- }
- p_content_temp = p_content_temp->next;
- }
- }
- p_edoc->slide_cur = p_edoc->slide_cur->next;
- }
- }
- SCI_TRACE_LOW("FNH save video MSG_GET_FOCUS selindex = %d",selindex);
- GUILISTBOX_SetCurItemIndex(list_ctrl_id,selindex);
- MMK_SetAtvCtrl(win_id, list_ctrl_id);
- }
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- MMK_CloseWin(win_id);
- break;
- case MSG_CLOSE_WINDOW: /* 处理关闭窗口消息 */
- if (p_edoc)
- {
- MMSDelDocument(p_edoc);
- SCI_TRACE_LOW("FNH after free MMS!");
- p_edoc = NULL;
- }
- if (p_folder_save_param)
- {
- SCI_TRACE_LOW("FNH before free p_folder_save_param");
- cms_free(p_folder_save_param);
- SCI_TRACE_LOW("FNH after free p_folder_save_param");
- p_folder_save_param = NULL;
- }
- break;
- default:
- err_code = MMI_RESULT_FALSE;
- break;
- }
- return err_code;
- }
- /******************************************************************************
- * 函数定义: MMIMMS_SaveDownloadVideo
- * 函数说明: 保存彩信内容中的视频
- * 参数说明: video_data_ptr:视频数据指针
- memory_size:视频大小
- image_type:视频类型
- * 返回值: 空
- ********************************************************************************/
- void MMIMMS_SaveDownloadVideo(
- uint8 *video_data_ptr, //in:
- uint32 memory_size, //in:
- uint32 video_type,
- MMIMULTIM_SAVE_FILE_CALLBACK_PFUNC callback_func
- )
- {
- uint32 free_space = 0;
- P_MMS_SAVE_VIDEO_PARAM p_save_video_param = NULL;
- //判断下载图片类型是否支持
- switch (video_type)
- {
- case MMS_TYPE_MP4:
- case MMS_TYPE_3GP:
- break;
- default:
- PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_ONE,TXT_MP3_NO_SUPPORT,IMAGE_PROMPT_ICON_ALERT,MMI_3SECONDS, PNULL);
- return;
- }
- if (0 == memory_size)
- {
- PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_ONE,TXT_SMS_EMPTY_CONTENT,IMAGE_PROMPT_ICON_ALERT,MMI_3SECONDS, PNULL);
- return;
- }
- //判断空间是否足够
- #ifndef _WIN32
- free_space = FFS_GetFreeSpace(g_filetype);
- #endif
- if (free_space >= memory_size)
- {
- p_save_video_param = (P_MMS_SAVE_VIDEO_PARAM)cms_malloc(sizeof(MMS_SAVE_VIDEO_PARAM));
- p_save_video_param->video_str = video_data_ptr;
- p_save_video_param->video_size = memory_size;
- p_save_video_param->video_type = video_type;
- p_save_video_param->callback_func = callback_func;
- MMK_CreateWin((uint32*)MMIMMS_DOWNLOAD_VIDEO_NAME_WIN_TAB,(ADD_DATA)p_save_video_param);
- }
- else
- {
- //提示空间不足
- PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_ONE,TXT_SMS_PROMPT_NO_SPACE,IMAGE_PROMPT_ICON_ALERT,MMI_3SECONDS, PNULL);
- }
- }
- /******************************************************************************
- * 函数定义: MMIMMS_SaveDownloadmp3
- * 函数说明: 保存彩信内容中的mp3
- * 参数说明: mp3_data_ptr:mp3数据指针
- memory_size:mp3大小
- image_type:mp3类型
- * 返回值: 空
- ********************************************************************************/
- void MMIMMS_SaveDownloadmp3(
- uint8 *mp3_data_ptr, //in:
- uint32 memory_size, //in:
- uint32 mp3_type,
- MMIMULTIM_SAVE_FILE_CALLBACK_PFUNC callback_func
- )
- {
- uint32 free_space = 0;
- P_MMS_SAVE_MP3_PARAM p_save_mp3_param = NULL;
- //判断下载图片类型是否支持
- switch (mp3_type)
- {
- case MMS_TYPE_MP3:
- break;
- default:
- PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_ONE,TXT_MMS_INVALID_AUDIO,IMAGE_PROMPT_ICON_ALERT,MMI_3SECONDS, PNULL);
- return;
- }
- if (0 == memory_size)
- {
- PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_ONE,TXT_SMS_EMPTY_CONTENT,IMAGE_PROMPT_ICON_ALERT,MMI_3SECONDS, PNULL);
- return;
- }
- //judge udisk space is whether enough.
- #ifndef _WIN32
- free_space = FFS_GetFreeSpace(g_filetype);
- #endif
- if (free_space >= memory_size)
- {
- p_save_mp3_param = (P_MMS_SAVE_MP3_PARAM)cms_malloc(sizeof(MMS_SAVE_MP3_PARAM));
- p_save_mp3_param->mp3_str = mp3_data_ptr;
- p_save_mp3_param->mp3_size = memory_size;
- p_save_mp3_param->mp3_type = mp3_type;
- p_save_mp3_param->callback_func = callback_func;
- MMK_CreateWin((uint32*)MMIMMS_DOWNLOAD_MP3_NAME_WIN_TAB,(ADD_DATA)p_save_mp3_param);
- }
- else
- {
- //提示空间不足
- PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_ONE,TXT_SMS_PROMPT_NO_SPACE,IMAGE_PROMPT_ICON_ALERT,MMI_3SECONDS, PNULL);
- }
- }
- /******************************************************************************
- * 函数定义: MMIMMS_GenRandomNameAndSet
- * 函数说明: 取得随机名字并设置
- * 参数说明: video_data_ptr:视频数据指针
- memory_size:视频大小
- image_type:视频类型
- * 返回值: 空
- ********************************************************************************/
- LOCAL void MMIMMS_GenRandomNameAndSet(
- uint8 *suffix_ptr,
- MMS_CONTROL_ID_E ctrl_id
- )
- {
- uint16 random = 0,*unicode_name_ptr = PNULL,unicode_name_len = 0;
- MMI_STRING_T ucs2_str;
- SCI_ASSERT(PNULL != suffix_ptr);
- SCI_MEMSET(&ucs2_str,0,sizeof(MMI_STRING_T));
- ucs2_str.str_ptr = cms_malloc(MMIMMS_RANDOM_FILE_NAME_MAX_LEN);
- SCI_MEMSET(ucs2_str.str_ptr,0,MMIMMS_RANDOM_FILE_NAME_MAX_LEN);
- //generate random
- srand(SCI_GetTickCount());
- random = rand();
- sprintf((char *)ucs2_str.str_ptr,"%05d",random);
- ucs2_str.length = strlen((char*)ucs2_str.str_ptr);
- ucs2_str.is_ucs2 = FALSE;
- //convert uint8 to uint16 unicode
- unicode_name_ptr = cms_malloc((ucs2_str.length+1)<<1);//注意结束符空间的分配
- SCI_MEMSET(unicode_name_ptr,0,((ucs2_str.length+1)<<1));
- MMI_Convert8Ucs2To16(unicode_name_ptr,&unicode_name_len,&ucs2_str);
- //set in editbox
- GUIEDITBOX_SetTextEditBoxStringInfo(ctrl_id,ucs2_str.str_ptr,ucs2_str.length,ucs2_str.is_ucs2);
- //free memory
- if (ucs2_str.str_ptr)
- {
- cms_free(ucs2_str.str_ptr);
- ucs2_str.str_ptr = NULL;
- }
- if (unicode_name_ptr)
- {
- cms_free(unicode_name_ptr);
- unicode_name_ptr = NULL;
- }
- }
- /******************************************************************************
- * 函数定义: HandleDownloadVideoInputName
- * 函数说明: 保存视频时重新输入名字
- * 参数说明: win_id:窗口ID
- msg_id:消息ID
- param:窗口附加值
- * 返回值: 空
- ********************************************************************************/
- LOCAL MMI_RESULT_E HandleDownloadVideoInputName(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_RESULT_E result = MMI_RESULT_TRUE;
- MMS_CONTROL_ID_E ctrl_id = MMIMMS_DOWNLOAD_VIDEO_NAME_EDITBOX_CTRL_ID;
- uint32 len = 0;
- TEXTEDIT_STRING_INFO_T name_str;
- GUI_RECT_T rect = MMI_CLIENT_RECT;
- static P_MMS_SAVE_VIDEO_PARAM p_save_video_param;
- switch (msg_id)
- {
- case MSG_OPEN_WINDOW:
- MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- //set edibox type
- p_save_video_param = (P_MMS_SAVE_VIDEO_PARAM)MMK_GetWinAddDataPtr(win_id);
- GUIEDITBOX_SetEditBoxToSingle(ctrl_id, SINGLE_ALIGN_CENTER);
- if (p_save_video_param->video_type == MMS_TYPE_3GP)
- {
- MMIMMS_GenRandomNameAndSet((uint8 *)".3GP",ctrl_id);
- }
- else if (p_save_video_param->video_type == MMS_TYPE_MP4)
- {
- MMIMMS_GenRandomNameAndSet((uint8 *)".mp4",ctrl_id);
- }
- MMK_SetAtvCtrl(win_id,ctrl_id);
- break;
- case MSG_FULL_PAINT:
- //设置重命名窗口背景色
- LCD_FillRect(MAINLCD_ID,rect,MMI_WINDOW_BACKGROUND_COLOR);
- break;
- case MSG_APP_OK:
- case MSG_CTL_OK:
- {
- GUIEDITBOX_GetTextEditBoxInfo(ctrl_id,&name_str);
- if ((!MMIMultim_FileNameIsValid(&name_str))||(name_str.str_len == 0)) //cr46352
- {
- PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_ONE, TXT_MMIMULTIM_NAMEINVALID, IMAGE_PROMPT_ICON_WRONG, MMI_3SECONDS, PNULL);
- break;
- }
- else
- {
- if(name_str.str_len > MMIMMS_MAX_FILE_NAME_LEN)
- {
- len = MMIMMS_MAX_FILE_NAME_LEN;
- }
- else
- {
- len = name_str.str_len;
- }
- name_str.str_ptr[len] = ' ';
- }
- SCI_MEMSET(g_videoname_arr,0,MMIMMS_MAX_FILE_NAME_LEN+1);
- if (name_str.is_ucs2 == 0)
- {
- SCI_TRACE_LOW("FNH name_str.is_ucs2 is 0 ");
- SCI_STRCPY((char *)g_videoname_arr,(char *)name_str.str_ptr);
- if (p_save_video_param->video_type == MMS_TYPE_3GP)
- {
- strcat((char *)g_videoname_arr,(char *)".3gp");
- }
- else if (p_save_video_param->video_type == MMS_TYPE_MP4)
- {
- strcat((char *)g_videoname_arr,(char *)".mp4");
- }
- }
- else if (name_str.is_ucs2 == 1)
- {
- len = GUI_UCS2GB((uint8 *)g_videoname_arr,name_str.str_ptr,len);
- g_videoname_arr[len] = ' ';
- if (p_save_video_param->video_type == MMS_TYPE_3GP)
- {
- strcat((char *)g_videoname_arr,(char *)".3gp");
- }
- else if (p_save_video_param->video_type == MMS_TYPE_MP4)
- {
- strcat((char *)g_videoname_arr,(char *)".mp4");
- }
- }
- //提示请稍后
- PUBWIN_OpenPromptAlertWinExt2(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID,WIN_ONE_LEVEL,PUBWIN_SOFTKEY_NONE,(MMI_TEXT_ID_T)TXTSYS_WAITING,IMAGE_PROMPT_ICON_WAIT,0, MMIMP3_NotInterruptFfs);
- switch (MMIMMS_SaveVideo(g_videoname_arr, p_save_video_param->video_str, p_save_video_param->video_size))
- {
- case DOWN_ERROR_NONE:
- break;
- case DOWN_ERROR_DEFAULT:
- //失败
- if (MMK_IsOpenWin(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID))
- {
- MMK_CloseWin(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID);
- }
- PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_NONE,TXT_SMS_PROMPT_FAIL,IMAGE_PROMPT_ICON_WAIT, ALERT_TIMEOUT,PNULL);
- break;
- case DOWN_ERROR_FULL:
- if (MMK_IsOpenWin(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID))
- {
- MMK_CloseWin(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID);
- }
- PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_NONE,TXT_MMIMULTIM_MEMORYFULL,IMAGE_PROMPT_ICON_WAIT, ALERT_TIMEOUT,PNULL);
- break;
- case DOWN_ERROR_REPEAT:
- if (MMK_IsOpenWin(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID))
- {
- MMK_CloseWin(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID);
- }
- PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_NONE,TXT_MMIMULTIM_NAMEREPEATED,IMAGE_PROMPT_ICON_WAIT, ALERT_TIMEOUT,PNULL);
- break;
- default:
- break;
- }
- }
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- MMK_CloseWin(win_id);
- break;
- case MSG_CLOSE_WINDOW:
- if (PNULL != p_save_video_param->callback_func)
- {
- (*p_save_video_param->callback_func)(p_save_video_param->video_str, PNULL);
- }
- if (p_save_video_param)
- {
- cms_free(p_save_video_param);
- p_save_video_param = PNULL;
- }
- break;
- default:
- result = MMI_RESULT_FALSE;
- break;
- }
- return (result);
- }
- /******************************************************************************
- * 函数定义: HandleDownloadmp3InputName
- * 函数说明: 保存mp3时重新输入名字
- * 参数说明: win_id:窗口ID
- msg_id:消息ID
- param:窗口附加值
- * 返回值: 空
- ********************************************************************************/
- LOCAL MMI_RESULT_E HandleDownloadmp3InputName(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_RESULT_E result = MMI_RESULT_TRUE;
- MMS_CONTROL_ID_E ctrl_id = MMIMMS_DOWNLOAD_MP3_NAME_EDITBOX_CTRL_ID;
- uint32 len = 0;
- TEXTEDIT_STRING_INFO_T name_str;
- GUI_RECT_T rect = MMI_CLIENT_RECT;
- static P_MMS_SAVE_MP3_PARAM p_save_mp3_param;
- SCI_TRACE_LOW("mmimms_wintable.c, HandleDownloadmp3InputName(), come in!");
- switch (msg_id)
- {
- case MSG_OPEN_WINDOW:
- MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- //set editbox type
- p_save_mp3_param = (P_MMS_SAVE_MP3_PARAM)MMK_GetWinAddDataPtr(win_id);
- GUIEDITBOX_SetEditBoxToSingle(ctrl_id, SINGLE_ALIGN_CENTER);
- if (p_save_mp3_param->mp3_type == MMS_TYPE_MP3)
- {
- MMIMMS_GenRandomNameAndSet((uint8 *)".mp3",ctrl_id);
- }
- MMK_SetAtvCtrl(win_id,ctrl_id);
- break;
- case MSG_FULL_PAINT:
- //设置重命名窗口背景色
- LCD_FillRect(MAINLCD_ID,rect,MMI_WINDOW_BACKGROUND_COLOR);
- break;
- case MSG_APP_OK:
- case MSG_CTL_OK:
- {
- GUIEDITBOX_GetTextEditBoxInfo(ctrl_id,&name_str);
- if ((!MMIMultim_FileNameIsValid(&name_str))||(name_str.str_len == 0))
- {
- PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_ONE, TXT_MMIMULTIM_NAMEINVALID, IMAGE_PROMPT_ICON_WRONG, MMI_3SECONDS, PNULL);
- break;
- }
- else
- {
- if(name_str.str_len > MMIMMS_MAX_FILE_NAME_LEN)
- {
- len = MMIMMS_MAX_FILE_NAME_LEN;
- }
- else
- {
- len = name_str.str_len;
- }
- name_str.str_ptr[len] = ' ';
- }
- SCI_MEMSET(g_mp3name_arr,0,MMIMMS_MAX_FILE_NAME_LEN+1);
- if (name_str.is_ucs2 == 0)
- {
- SCI_TRACE_LOW("FNH name_str.is_ucs2 is 0 ");
- SCI_STRCPY((char *)g_mp3name_arr,(char *)name_str.str_ptr);
- if (p_save_mp3_param->mp3_type == MMS_TYPE_MP3)
- {
- strcat((char *)g_mp3name_arr,(char *)".mp3");
- }
- }
- else if (name_str.is_ucs2 == 1)
- {
- SCI_TRACE_LOW("FNH name_str.is_ucs2 is 1 ");
- len = GUI_UCS2GB((uint8 *)g_mp3name_arr,name_str.str_ptr,len);
- g_mp3name_arr[len] = ' ';
- if (p_save_mp3_param->mp3_type == MMS_TYPE_MP3)
- {
- strcat((char *)g_mp3name_arr,(char *)".mp3");
- }
- }
- //提示请稍后
- PUBWIN_OpenPromptAlertWinExt2(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID,WIN_ONE_LEVEL,PUBWIN_SOFTKEY_NONE,(MMI_TEXT_ID_T)TXTSYS_WAITING,IMAGE_PROMPT_ICON_WAIT,0, MMIMP3_NotInterruptFfs);
- // MMIMMS_SaveMp3(g_mp3name_arr);
- SCI_TRACE_LOW("mmimms_wintable.c, HandleDownloadmp3InputName(), come in MMIMMS_SaveMp3()!");
- // MMIMMS_SaveMp3(g_mp3name_arr, p_save_mp3_param->mp3_str, p_save_mp3_param->mp3_size);
- switch (MMIMMS_SaveMp3(g_mp3name_arr, p_save_mp3_param->mp3_str, p_save_mp3_param->mp3_size))
- {
- case DOWN_ERROR_NONE:
- break;
- case DOWN_ERROR_DEFAULT:
- //失败
- if (MMK_IsOpenWin(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID))
- {
- MMK_CloseWin(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID);
- }
- PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_NONE,TXT_SMS_PROMPT_FAIL,IMAGE_PROMPT_ICON_WAIT, ALERT_TIMEOUT,PNULL);
- break;
- case DOWN_ERROR_FULL:
- if (MMK_IsOpenWin(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID))
- {
- MMK_CloseWin(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID);
- }
- PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_NONE,TXT_MMIMULTIM_MEMORYFULL,IMAGE_PROMPT_ICON_WAIT, ALERT_TIMEOUT,PNULL);
- break;
- case DOWN_ERROR_REPEAT:
- if (MMK_IsOpenWin(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID))
- {
- MMK_CloseWin(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID);
- }
- PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_NONE,TXT_MMIMULTIM_NAMEREPEATED,IMAGE_PROMPT_ICON_WAIT, ALERT_TIMEOUT,PNULL);
- break;
- default:
- break;
- }
- }
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- MMK_CloseWin(win_id);
- break;
- case MSG_CLOSE_WINDOW:
- if (PNULL != p_save_mp3_param->callback_func)
- {
- (*p_save_mp3_param->callback_func)(p_save_mp3_param->mp3_str, PNULL);
- }
- if (p_save_mp3_param)
- {
- cms_free(p_save_mp3_param);
- p_save_mp3_param = PNULL;
- }
- break;
- default:
- result = MMI_RESULT_FALSE;
- break;
- }
- return (result);
- }
- /******************************************************************************
- * 函数定义: mmicms_replymmsforsms
- * 函数说明: 电话本和短信回复彩信
- * 参数说明: telenum:电话号码
- * 作者 : 冯倪红
- * 返回值: 空
- ********************************************************************************/
- void mmicms_replymmsforsms(char *telenum)
- {
- SCI_ASSERT(telenum != NULL);
- g_p_mms_to = NULL;
- g_p_mms_cc = NULL;
- g_p_mms_bcc = NULL;
- g_p_mms_subject = (int8 *)cms_malloc(MMIMMS_MAX_SUBJECTS_LEN+1);
- SCI_ASSERT(g_p_mms_subject != NULL);
- SCI_MEMSET(g_p_mms_subject,0,MMIMMS_MAX_SUBJECTS_LEN+1);
- g_p_mms_to = (p_MMS_RECEPIENT)cms_malloc(sizeof(MMS_RECEPIENT));
- SCI_MEMSET(g_p_mms_to,0,sizeof(MMS_RECEPIENT));
- SCI_STRCPY(g_p_mms_to->m_address,(char *)telenum);
- g_peditdoc = MMS_New();
- SCI_ASSERT(g_peditdoc != NULL);
- SCI_TRACE_LOW("FNH new mms!");
- g_mms_edit_status = MMS_EDIT_ANSWER_SMSORPB;
- MMK_CreateWin((uint32 *)MMIMMS_EDIT_WIN_TAB,PNULL);
- }
- void EditboxStringToGlobalVariable(MMI_CTRL_ID_T ctrl_id)
- {
- uint8 tele_num[MMIMMS_MAX_ADDRESS_LEN + 2] = {0};
- uint16 receiver_len = 0;
- uint16 index = 0;
- TEXTEDIT_STRING_INFO_T edit_string;
- //get the content which the user input
- SCI_MEMSET( (void *)&edit_string, 0, sizeof( TEXTEDIT_STRING_INFO_T ) );
- GUIEDITBOX_GetTextEditBoxInfo(ctrl_id, &edit_string);
- if (edit_string.str_len > MMIMMS_MAX_ADDRESS_LEN)
- {
- edit_string.str_len = MMIMMS_MAX_ADDRESS_LEN;
- }
- edit_string.str_ptr[edit_string.str_len] = ' ';
- if (edit_string.str_ptr != PNULL && edit_string.str_len != 0)
- {
- for (index=0;index<edit_string.str_len;index++)
- {
- if (edit_string.str_ptr[index] == 32)
- receiver_len ++;
- }
- if (receiver_len != index)
- {
- SCI_MEMSET(tele_num, 0, sizeof(tele_num));
- MMI_MEMCPY(tele_num, (MMIMMS_MAX_ADDRESS_LEN + 1), edit_string.str_ptr, edit_string.str_len, edit_string.str_len);
- SCI_STRCPY(g_p_mms_to->m_address,(char *)tele_num);
- }
- }
- }
- /*****************************************************************************/
- // Description : initialize MMS application
- // Global resource dependence : none
- // Author: Bruce.Chi
- // Note:
- /*****************************************************************************/
- PUBLIC BOOLEAN MMIMMS_SendImage(
- ANIMATE_IMAGE_TYPE_E img_type,
- uint32 img_buf_len,
- void *img_buf_ptr
- )
- {
- T_Composer_Image composer_image;
- if (img_buf_ptr == PNULL || img_buf_len == 0)
- {
- return FALSE;
- }
- ///////fnh add 0325 for send image begin
- if (img_buf_len > MMS_MAX_SIZE_OF_MULTIM) //超过定义的范围
- {
- PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_ONE, TXT_DC_PICTOO_LARGE, IMAGE_PROMPT_ICON_ALERT, MMI_3SECONDS, PNULL);
- return FALSE;
- }
- SCI_TRACE_LOW("FNH new mms!");
- MMICMSBRW_InitCache();
- g_p_mms_to = NULL;
- g_p_mms_cc = NULL;
- g_p_mms_bcc = NULL;
- g_p_mms_subject = (int8 *)cms_malloc(MMIMMS_MAX_SUBJECTS_LEN+1);
- SCI_ASSERT(g_p_mms_subject != NULL);
- SCI_MEMSET(g_p_mms_subject,0,MMIMMS_MAX_SUBJECTS_LEN+1);
- g_peditdoc = MMS_New();
- SCI_ASSERT(g_peditdoc != NULL);
- SCI_TRACE_LOW("FNH new mms!");
- MMS_New_Slide(g_peditdoc);
- SCI_MEMSET(&composer_image,0,sizeof(T_Composer_Image));
- composer_image.ImgBuf = (T_UBYTE *)img_buf_ptr;
- composer_image.size = img_buf_len;
- SCI_TRACE_LOW("FNH img_type is %d",img_type);
- composer_image.Type = Edit_GetDeltaMMSImageType2(img_type);
- SCI_TRACE_LOW("FNH composer_image.type is %s",composer_image.Type);
- composer_image.begin = 0;
- SCI_TRACE_LOW("FNH buf = %d,size = %d,type = %s",composer_image.ImgBuf,composer_image.size,composer_image.Type );
- if (composer_image.Type != PNULL)
- {
- MMIMP3_SuspendMp3(TRUE);
- MMIMMS_AddImage(&composer_image,g_peditdoc);
- // MMK_CreateWin((uint32 *)MMIMMS_EDIT_OPTION_TAB,PNULL);
- g_mms_edit_status = MMS_EDIT_SEND_IMAGE;
- MMK_CreateWin((uint32 *)MMIMMS_EDIT_WIN_TAB,PNULL);
- return TRUE;
- }
- else
- {
- MMICMSBRW_FreeGlobalBuffer();
- //alert : not supported image
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_INVALID_PIC,
- IMAGE_PROMPT_ICON_WRONG,
- ALERT_TIMEOUT,
- PNULL
- );
- return FALSE;
- }
- // end
- }
- /*****************************************************************************/
- // Description : open mms mailbox
- // Global resource dependence :
- // Author: Bruce.chi
- // Note: used after mms and sms have been departed
- /*****************************************************************************/
- PUBLIC void MMIMMS_Apart_OpenMMSMailBox(MMIMSG_MAILBOX_TYPE_E mailbox_type)
- {
- int msg_num_of_mailbox = 0;
- switch(mailbox_type)
- {
- case MMIMESSAGE_INBOX:
- g_pManager->currentfolder = g_pManager->inboxfolder;
- msg_num_of_mailbox = MMIMMS_GetMessageNum(g_pManager->currentfolder );
- if (msg_num_of_mailbox == 0)
- {
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_INBOX_EMPTY,
- IMAGE_PROMPT_ICON_WRONG,
- ALERT_TIMEOUT,
- PNULL
- );
- }
- else
- {
- SCI_TRACE_LOW("FNH g_donewmms is %d",g_donewmms);
- if(g_donewmms == TRUE)
- {
- MMIMMS_StoreFolder(g_pManager->inboxfolder);
- g_donewmms = FALSE;
- MMIMMS_SaveManagerInboxFile(MMS_SAVE_INBOX); //modify liangliu 2006-2-15
- }
- SCI_TRACE_LOW("fnh inbox before init cache");
- MMICMSBRW_InitCache();
- SCI_TRACE_LOW("fnh after init cache ");
- MMK_CreateWin((uint32 *)MMIMMS_INBOX_LIST_WIN, PNULL);
- }
- break;
- case MMIMESSAGE_SENTBOX:
- g_pManager->currentfolder = g_pManager->sentfolder;
- //msg_num_of_mailbox = SaveNV_GetMailboxMsgNum(MMIMMS_INBOX);
- msg_num_of_mailbox = MMIMMS_GetMessageNum(g_pManager->currentfolder );
- if (msg_num_of_mailbox == 0)
- {
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_SENTBOX_EMPTY,
- IMAGE_PROMPT_ICON_WRONG,
- ALERT_TIMEOUT,
- PNULL
- );
- }
- else
- {
- SCI_TRACE_LOW("fnh sentbox before init cache");
- MMICMSBRW_InitCache();
- SCI_TRACE_LOW("fnh after init cache ");
- MMK_CreateWin((uint32 *)MMIMMS_SENTBOX_LIST_WIN, PNULL);
- }
- break;
- case MMIMESSAGE_OUTBOX:
- g_pManager->currentfolder = g_pManager->outboxfolder;
- msg_num_of_mailbox = MMIMMS_GetMessageNum(g_pManager->currentfolder );
- if (msg_num_of_mailbox == 0)
- {
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_OUTBOX_EMPTY,
- IMAGE_PROMPT_ICON_WRONG,
- ALERT_TIMEOUT,
- PNULL
- );
- }
- else
- {
- SCI_TRACE_LOW("fnh outbox before init cache");
- MMICMSBRW_InitCache();
- SCI_TRACE_LOW("fnh after init cache ");
- MMK_CreateWin((uint32 *)MMIMMS_OUTBOX_LIST_WIN, PNULL);
- }
- break;
- case MMIMESSAGE_DRAFTBOX:
- g_pManager->currentfolder = g_pManager->draftfolder;
- msg_num_of_mailbox = MMIMMS_GetMessageNum(g_pManager->currentfolder );
- if (msg_num_of_mailbox == 0)
- {
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_DRAFTBOX_EMPTY,
- IMAGE_PROMPT_ICON_WRONG,
- ALERT_TIMEOUT,
- PNULL
- );
- }
- else
- {
- SCI_TRACE_LOW("fnh draftbox before init cache");
- MMICMSBRW_InitCache();
- SCI_TRACE_LOW("fnh after init cache ");
- MMK_CreateWin((uint32 *)MMIMMS_DRAFTBOX_LIST_WIN, PNULL);
- }
- break;
- default:
- SCI_ASSERT(FALSE);
- break;
- }
- }
- /*****************************************************************************/
- // Description : this function handle MMS edit, select insert photo or Dpic window message
- // Global resource dependence :
- // Author:Rui.Zhang
- // Note:
- /*****************************************************************************/
- LOCAL MMI_RESULT_E MMS_HandleEditSelectImageWinMsg(
- MMI_WIN_ID_T win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param )
- {
- MMI_RESULT_E recode = MMI_RESULT_TRUE;
- MMI_MENU_GROUP_ID_T group_id = 0;
- MMI_MENU_ID_T menu_id = 0;
- MMI_WIN_ID_T source_win_id = 0;
- switch( msg_id )
- {
- case MSG_OPEN_WINDOW:
- MMK_SetAtvCtrl( win_id, MMIMMS_EDIT_SELECT_IMAGE_CTRL_ID );
- MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- break;
- case MSG_FULL_PAINT:
- break;
- case MSG_CTL_OK:
- case MSG_APP_OK:
- source_win_id = (MMI_WIN_ID_T)(MMK_GetWinAddDataPtr(win_id));
- GUIMENU_GetRetID(MMIMMS_EDIT_SELECT_IMAGE_CTRL_ID, &group_id, &menu_id);
- switch(menu_id)
- {
- case ID_MMS_INSERT_DPIC:
- s_opt_menu_id = ID_MMS_INSERT_DPIC;
- Edit_OpenInsertDpicWin(source_win_id);
- break;
- case ID_MMS_INSERT_PHOTO:
- s_opt_menu_id = ID_MMS_INSERT_PHOTO;
- // Edit_OpenInsertPhotoWin(MMIMMS_EDIT_WIN_ID);
- MMIDC_OpenAlbumWinForMMS(MMS_MAX_SIZE_OF_MULTIM,source_win_id);
- break;
- }
- MMK_CloseWin(win_id);
- break;
- case MSG_APP_CANCEL:
- MMK_CloseWin(win_id);
- break;
- default:
- recode = MMI_RESULT_FALSE;
- break;
- }
- return recode;
- }
- /*****************************************************************************/
- // Description : this function handle MMS edit, select insert RING or MP3 window message
- // Global resource dependence :
- // Author:AOKE.HU
- // Note:
- /*****************************************************************************/
- LOCAL MMI_RESULT_E MMS_HandleEditSelectMusicWinMsg(
- MMI_WIN_ID_T win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param )
- {
- MMI_RESULT_E recode = MMI_RESULT_TRUE;
- MMI_MENU_GROUP_ID_T group_id = 0;
- MMI_MENU_ID_T menu_id = 0;
- MMI_WIN_ID_T source_win_id = 0;
- switch( msg_id )
- {
- case MSG_OPEN_WINDOW:
- MMK_SetAtvCtrl( win_id, MMIMMS_EDIT_SELECT_MUSIC_CTRL_ID );
- MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- break;
- case MSG_FULL_PAINT:
- break;
- case MSG_CTL_OK:
- case MSG_APP_OK:
- source_win_id = (MMI_WIN_ID_T)(MMK_GetWinAddDataPtr(win_id));
- GUIMENU_GetRetID(MMIMMS_EDIT_SELECT_MUSIC_CTRL_ID, &group_id, &menu_id);
- switch(menu_id)
- {
- case ID_MMS_EDIT_INSERT_RING:
- Edit_OpenInsertDringWin(source_win_id);
- break;
- case ID_MMS_EDIT_INSERT_MP3:
- // Edit_OpenInsertPhotoWin(MMIMMS_EDIT_WIN_ID);
- MMIMP3_SelectAndGetFile(MMS_MAX_SIZE_OF_MULTIM,source_win_id);
- break;
- }
- MMK_CloseWin(win_id);
- break;
- case MSG_APP_CANCEL:
- MMK_CloseWin(win_id);
- break;
- default:
- recode = MMI_RESULT_FALSE;
- break;
- }
- return recode;
- }
- /*****************************************************************************/
- // Description : mms是否将mp3的播放挂起
- // Global resource dependence : none
- // Author: aoke.hu
- // Note: 仅供Mp3模块调用
- /*****************************************************************************/
- PUBLIC BOOLEAN MMIMMS_IsSuspendMp3(void)
- {
- return (s_is_mms_suspend_mp3);
- }
- /*****************************************************************************/
- // Description : mms编辑模块是否将mp3的播放挂起
- // Global resource dependence : none
- // Author: aoke.hu
- // Note: 仅供Mp3模块调用
- /*****************************************************************************/
- PUBLIC BOOLEAN MMIMMS_IsContentSuspendMp3(void)
- {
- return (s_is_mmscontent_suspend_mp3);
- }
- /*****************************************************************************/
- // Description : 5.8.5 Setting : Network
- // Global resource dependence :
- // Author:Aoke.Hu
- // Note:
- /*****************************************************************************/
- LOCAL BOOLEAN Setting_HandleNetworkWinMsg(
- MMI_WIN_ID_T win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_MENU_GROUP_ID_T group_id = 0;
- MMI_MENU_ID_T menu_id = 0;
- BOOLEAN recode = TRUE;
- MMI_CTRL_ID_T ctrl_id = MMIMMS_SETTING_NETWORK_CTRL_ID;
- switch (msg_id)
- {
- case MSG_OPEN_WINDOW:
- MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- MMK_SetAtvCtrl(win_id, MMIMMS_SETTING_NETWORK_CTRL_ID);
- break;
- case MSG_GET_FOCUS:
- MMK_SetAtvCtrl(win_id, MMIMMS_SETTING_NETWORK_CTRL_ID);
- break;
- case MSG_CTL_DBCLICK:
- case MSG_APP_OK:
- case MSG_CTL_OK:
- //get listmenu id
- GUIMENU_GetRetID(ctrl_id,&group_id,&menu_id);
- switch (menu_id)
- {
- case ID_MMS_SETTING_MMSC:
- MMK_CreateWin((uint32 *)MMIMMS_SETTING_MMSC_WIN,PNULL);
- break;
- case ID_MMS_SETTING_GATEWAY:
- MMK_CreateWin((uint32 *)MMIMMS_SETTING_GATEWAY_WIN,PNULL);
- break;
- case ID_MMS_SETTING_PORT:
- MMK_CreateWin((uint32 *)MMIMMS_SETTING_PORT_WIN,PNULL);
- break;
- case ID_MMS_SETTING_USERNAME:
- MMK_CreateWin((uint32 *)MMIMMS_SETTING_USERNAME_WIN,PNULL);
- break;
- case ID_MMS_SETTING_PASSWORD:
- MMK_CreateWin((uint32 *)MMIMMS_SETTING_PASSWORD_WIN,PNULL);
- break;
- case ID_MMS_SETTING_APN:
- MMK_CreateWin((uint32 *)MMIMMS_SETTING_APN_WIN,PNULL);
- break;
- default:
- return FALSE;
- break;
- }
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- MMK_CloseWin(win_id);
- break;
- default:
- recode = FALSE;
- break;
- }
- return recode;
- }
- /*****************************************************************************/
- // Description : Get mail box message number.
- // Global resource dependence : none
- // Author: Bruce.Chi
- // Input: mms type
- // Output: number of specific mms type
- // Note:
- /*****************************************************************************/
- uint16 MMIMMS_GetMailboxMsgNum(MMIMSG_MAILBOX_TYPE_E mms_type)
- {
- int sum = 0;
- SCI_ASSERT(mms_type <= MMIMESSAGE_BOX_TOTAL);
- if(g_pManager == NULL)
- {
- SCI_TRACE_LOW("MMIMMS_GetMailboxMsgNum g_pManager ==NULL");
- return 0;
- }
- switch(mms_type)
- {
- case MMIMESSAGE_INBOX:
- // sum = SaveNV_GetMailboxMsgNum(MMIMMS_INBOX) + SaveNV_GetMailboxMsgNum(MMIMMS_NOTIFICATION);
- g_pManager->currentfolder =g_pManager->inboxfolder;
- sum = MMIMMS_GetMessageNum(g_pManager->currentfolder);
- break;
- case MMIMESSAGE_SENTBOX:
- // sum = SaveNV_GetMailboxMsgNum(MMIMMS_SENTBOX);
- g_pManager->currentfolder =g_pManager->sentfolder;
- sum = MMIMMS_GetMessageNum(g_pManager->currentfolder);
- break;
- case MMIMESSAGE_OUTBOX:
- // sum = SaveNV_GetMailboxMsgNum(MMIMMS_OUTBOX);
- g_pManager->currentfolder =g_pManager->outboxfolder;
- sum = MMIMMS_GetMessageNum(g_pManager->currentfolder);
- break;
- case MMIMESSAGE_DRAFTBOX:
- // sum = SaveNV_GetMailboxMsgNum(MMIMMS_DRAFTBOX);
- g_pManager->currentfolder =g_pManager->draftfolder;
- sum = MMIMMS_GetMessageNum(g_pManager->currentfolder);
- break;
- case MMIMESSAGE_BOX_TOTAL:
- sum = MMIMMS_GetManagerTotalNum();
- break;
- default:
- SCI_ASSERT(FALSE);
- break;
- }
- return sum;
- }
- /*****************************************************************************/
- // Description : 5.8.5 Setting : sign
- // Global resource dependence :
- // Author:Aoke.Hu
- // Note:
- /*****************************************************************************/
- LOCAL BOOLEAN Setting_HandleSignWinMsg(
- MMI_WIN_ID_T win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_MENU_GROUP_ID_T group_id = 0;
- MMI_MENU_ID_T menu_id = 0;
- BOOLEAN recode = TRUE;
- MMI_CTRL_ID_T ctrl_id = MMIMMS_SETTING_SIGN_CTRL_ID;
- switch (msg_id)
- {
- case MSG_OPEN_WINDOW:
- MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- MMK_SetAtvCtrl(win_id, MMIMMS_SETTING_SIGN_CTRL_ID);
- break;
- case MSG_GET_FOCUS:
- MMK_SetAtvCtrl(win_id, MMIMMS_SETTING_SIGN_CTRL_ID);
- break;
- case MSG_CTL_DBCLICK:
- case MSG_APP_OK:
- case MSG_CTL_OK:
- //get listmenu id
- GUIMENU_GetRetID(ctrl_id,&group_id,&menu_id);
- switch (menu_id)
- {
- case ID_MMS_SETTING_OPEN_SIGN:
- MMK_CreateWin((uint32 *)MMIMMS_SETTING_OPENSIGN_LIST_WIN,PNULL);
- break;
- case ID_MMS_SETTING_EDIT_SIGN:
- MMIMMS_CreateReadMMSWaitingWin();
- g_readsignstate= MMS_MSG_READ_SIGN_FOR_SET;
- MMIMMS_ReadAutosign() ;
- break;
- default:
- return FALSE;
- break;
- }
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- MMK_CloseWin(win_id);
- break;
- default:
- recode = FALSE;
- break;
- }
- return recode;
- }