mmimms_wintable.c
上传用户:tqh2500
上传日期:2014-05-09
资源大小:163k
文件大小:463k
开发平台:

Visual C++

  1. SCI_TRACE_LOW("FNH open window setting apn_str_len = %d",apn_str_len);
  2. GUIEDITBOX_SetTextEditBoxStringInfo(editbox_ctrl_id,
  3. apn_str_ptr,
  4. apn_str_len,
  5. FALSE);
  6. MMK_SetAtvCtrl(
  7. win_id,
  8. editbox_ctrl_id);
  9. break;
  10. case MSG_FULL_PAINT:
  11. MMIMMS_CLEAR_CLIENT();
  12. break;
  13. case MSG_APP_OK:
  14.     case MSG_CTL_OK:
  15. //save to nv
  16. SCI_MEMSET(&string_info,0,sizeof(TEXTEDIT_STRING_INFO_T));
  17. SCI_TRACE_LOW("FNH before get text string_info.str_ptr = %s",string_info.str_ptr);
  18. SCI_TRACE_LOW("FNH before get text string_info.str_len = %d",string_info.str_len);
  19. GUIEDITBOX_GetTextEditBoxInfo(
  20. editbox_ctrl_id,
  21. &string_info);
  22. string_info.str_ptr[string_info.str_len] = '';
  23. SCI_TRACE_LOW("FNH after get text string_info.str_ptr = %s",string_info.str_ptr);
  24. SCI_TRACE_LOW("FNH after get text string_info.str_len = %d",string_info.str_len);
  25. if (string_info.str_len == 0)
  26. {
  27. //提示用户
  28. PUBWIN_OpenPromptAlertWin(
  29. PUBWIN_SOFTKEY_ONE,
  30. TXT_MMS_INPUT_ERROR,
  31. IMAGE_PROMPT_ICON_FAIL,
  32. ALERT_TIMEOUT,
  33. PNULL);
  34. MMK_CloseWin(win_id);
  35. break;
  36. }
  37. MMIMMS_Setting_SetAPN(string_info.str_ptr, string_info.str_len);
  38. // MMIMMS_SaveConfigFile();
  39. //提示用户
  40.         PUBWIN_OpenPromptAlertWin(
  41.                 PUBWIN_SOFTKEY_ONE,
  42.                 TXT_MMS_DONE,
  43.                 IMAGE_PROMPT_ICON_SUCCESS,
  44.                 ALERT_TIMEOUT,
  45. PNULL);
  46. MMK_CloseWin(win_id);
  47. break;
  48.   
  49. case MSG_APP_CANCEL:
  50.     case MSG_CTL_CANCEL:        
  51. MMK_CloseWin(win_id);//返回上一级
  52.         break;
  53. default:
  54. recode = MMI_RESULT_FALSE;
  55. break;
  56. }
  57. return recode;
  58. }
  59. /*****************************************************************************/
  60. //  Description : to append the info to listbox
  61. // Global resource dependence : 
  62. //  Author:louis.wei
  63. // Note: copy from louise
  64. /*****************************************************************************/
  65. LOCAL void AppendListItemByTextId(
  66.  uint32 text_id,
  67.  MMS_CONTROL_ID_E ctrl_id
  68.  )
  69. {
  70.     GUI_LISTBOX_ITEM_T item_info;
  71.     MMI_STRING_T        item_str;
  72. uint8 copy_len = 0;
  73.     SCI_MEMSET( &item_str, 0, sizeof(MMI_STRING_T) );
  74.     
  75.     SCI_MEMSET(&item_info, 0, sizeof(GUI_LISTBOX_ITEM_T));  
  76.     MMI_GetLabelTextByLang( text_id , &item_str );
  77. item_info.softkey_id[0]  = STXT_OK;
  78. item_info.softkey_id[1] = COMMON_TXT_NULL;
  79. item_info.softkey_id[2] = STXT_EXIT;
  80.   copy_len = ( item_str.length > LISTBOX_STRING_MAX_NUM ) ? LISTBOX_STRING_MAX_NUM : item_str.length;
  81.    
  82. //  SCI_MEMCPY( item_info.str, item_str.str_ptr , copy_len );
  83.     MMI_MEMCPY(item_info.str, LISTBOX_STRING_MAX_NUM, item_str.str_ptr, item_str.length, copy_len );
  84.     
  85.     item_info.str_len =  copy_len ;
  86.     item_info.is_ucs2 = item_str.is_ucs2;
  87.     GUILISTBOX_AppendItem((MMI_CTRL_ID_T)ctrl_id, &item_info);      
  88. }
  89. /*****************************************************************************/
  90. //  Description : to append the info to listbox
  91. // Global resource dependence : 
  92. //  Author:louis.wei
  93. // Note: copy from louis
  94. /*****************************************************************************/
  95. LOCAL void AppendListItem(
  96.                      uint8  *string_ptr,
  97.                      uint8 string_len,
  98.                      BOOLEAN      is_ucs2,
  99.                      MMS_CONTROL_ID_E ctrl_id,
  100.                      uint16 left_softkey_id
  101.                      )
  102. {
  103.     GUI_LISTBOX_ITEM_T item_info;
  104. uint8 copy_len = 0;
  105.     
  106.     SCI_ASSERT( PNULL != string_ptr );
  107.   
  108.     SCI_MEMSET(&item_info, 0, sizeof(GUI_LISTBOX_ITEM_T));  
  109. item_info.softkey_id[0] = left_softkey_id;
  110. item_info.softkey_id[1] = COMMON_TXT_NULL;
  111. item_info.softkey_id[2] = STXT_EXIT;
  112.     
  113. copy_len = ( string_len > LISTBOX_STRING_MAX_NUM ) ? LISTBOX_STRING_MAX_NUM : string_len;
  114. //  SCI_MEMCPY( item_info.str, string_ptr, copy_len );
  115.     MMI_MEMCPY(item_info.str, LISTBOX_STRING_MAX_NUM, string_ptr, string_len, copy_len );
  116.     item_info.str_len = copy_len;
  117.     item_info.is_ucs2 = is_ucs2;
  118.     GUILISTBOX_AppendItem(ctrl_id, &item_info);      
  119. }
  120. /*****************************************************************************/
  121. //  Description : to append the info to listbox
  122. // Global resource dependence : 
  123. //  Author:louis.wei
  124. // Note: copy from louis
  125. /*****************************************************************************/
  126. LOCAL void AppendListItemWithIcon(
  127.                      uint8  *string_ptr,
  128.                      uint8 string_len,
  129.                      uint32                                  icon_id,
  130.                      BOOLEAN      is_ucs2,
  131.                      MMS_CONTROL_ID_E ctrl_id,
  132.                      uint16 left_softkey_id
  133.                      )
  134. {
  135.     GUI_LISTBOX_ITEM_T item_info;
  136. uint8 copy_len = 0;
  137.     
  138.     SCI_ASSERT( PNULL != string_ptr );
  139.   
  140.     SCI_MEMSET(&item_info, 0, sizeof(GUI_LISTBOX_ITEM_T));  
  141. item_info.softkey_id[0] = left_softkey_id;
  142. item_info.softkey_id[1] = COMMON_TXT_NULL;
  143. item_info.softkey_id[2] = STXT_EXIT;
  144. item_info.left_icon_id    =  icon_id;
  145.     
  146. copy_len = ( string_len > LISTBOX_STRING_MAX_NUM ) ? LISTBOX_STRING_MAX_NUM : string_len;
  147. //  SCI_MEMCPY( item_info.str, string_ptr, copy_len );
  148.     MMI_MEMCPY(item_info.str, LISTBOX_STRING_MAX_NUM, string_ptr, string_len, copy_len );
  149.     item_info.str_len = copy_len;
  150.     item_info.is_ucs2 = is_ucs2;
  151.     GUILISTBOX_AppendItem(ctrl_id, &item_info);      
  152. }
  153. /*****************************************************************************/
  154. //  Description : 是否是最后一祯
  155. // Global resource dependence : 
  156. //  Author: nihongf
  157. // Note:
  158. /*****************************************************************************/
  159. LOCAL BOOLEAN Edit_isLastSlide(pMMS_EDocument p_cur_edoc)
  160. {
  161.    if (MMSGetSlideIndex(p_cur_edoc) >= MMSGetSlideCount(p_cur_edoc) )
  162. {
  163. return TRUE;
  164. }
  165. else
  166. {
  167. return FALSE;
  168. }
  169. }
  170. /*****************************************************************************/
  171. //  Description : 添加彩信时打开图片列表供选择
  172. // Global resource dependence : 
  173. //  Author: nihongf
  174. // Note:
  175. /*****************************************************************************/
  176. LOCAL BOOLEAN Edit_OpenInsertDpicWin(
  177.                                      MMS_WINDOW_ID_E    win_id
  178.                                      )
  179. {
  180. if (MMIMULTIM_OpenDpicWinForMms(MMS_MAX_SIZE_OF_MULTIM,win_id))
  181. {
  182. return FALSE;
  183. }
  184. else
  185. {
  186. return TRUE; //don't free it
  187. }
  188. }
  189. /*****************************************************************************/
  190. //  Description : 得到一条MMS可以插入Image的最大空间
  191. // Global resource dependence : 
  192. //  Author: Great.Tian
  193. // Note:
  194. /*****************************************************************************/
  195. uint32 MMIMMS_GetInsertMaxSize()
  196. {
  197.     uint32      max_size = 0;
  198. T_WORD      composer_content_size = 0;
  199. composer_content_size = MMIMMS_GetTotalSize();
  200. if (composer_content_size + EDITMMS_ADDITIONAL_SIZE > MMS_MAX_SIZE_OF_MULTIM)
  201. {
  202. //if already exceed
  203. max_size = 1;
  204. }
  205. else
  206. {
  207. max_size = MMS_MAX_SIZE_OF_MULTIM - EDITMMS_ADDITIONAL_SIZE -  composer_content_size;
  208. }
  209.     SCI_TRACE_LOW("MMIMMS_GetInsertMaxSize: max_size = %d!", max_size);
  210.     return (max_size);
  211. }
  212. /*****************************************************************************/
  213. //  Description : 增加彩信内容时打开声音列表供选择
  214. // Global resource dependence : 
  215. //  Author: nihongf
  216. // Note:
  217. /*****************************************************************************/
  218. LOCAL BOOLEAN Edit_OpenInsertDringWin(
  219.                                       MMS_WINDOW_ID_E   win_id
  220.                                       )
  221. {
  222. if (MMIMULTIM_OpenDringWinForMms(MMS_MAX_SIZE_OF_MULTIM,win_id))
  223. {
  224. return FALSE;
  225. }
  226. else
  227. {
  228. return TRUE; //don't free it
  229. }
  230. }
  231. //created liangliu 2005-10-27 for download mms waiting window
  232. void  MMIMMS_Download_CreateDownloadingWin(void)
  233. {
  234.     //MMK_CreateWin((uint32 *)MMIMMS_RECVING_MMS_WIN,PNULL);
  235. MMI_STRING_T downloading_str = {0};
  236. PUBWIN_ClosePromptQueryWin();
  237. SCI_MEMSET(&downloading_str, 0, sizeof(downloading_str));
  238. MMI_GetLabelTextByLang(TXT_MMS_DOWNLOADING, &downloading_str);
  239.         PUBWIN_OpenWaitingMessageWin(
  240.         MMIMMS_DOWNLOAD_DOWNLOADING_WIN_ID,
  241.         WIN_ONE_LEVEL,
  242.         PUBWIN_SOFTKEY_ONE,
  243.         &downloading_str,
  244.         PNULL,
  245.         IMAGE_PUBWIN_WAITING_ANIM,
  246.         WAIT_TEXT_BACKGROUND_COLOR,//IMAGE_NULL,
  247.         PNULL,
  248.         (ONMESSAGE_FUNC)Download_HandleDownloadingWin
  249. );
  250. }
  251. /* ----------------------------------------------------------------------------
  252. * Function Name: MMIMMS_SendMMS_CreateSendingWin
  253. * Purpose:发送彩信时的等待窗口
  254. * Input:  void
  255. * Returns:void
  256. * Author:nihongf@mobilesoft.com.cn
  257. * ----------------------------------------------------------------------------*/ 
  258. void  MMIMMS_SendMMS_CreateSendingWin(void)
  259. {
  260. MMI_STRING_T downloading_str = {0};
  261. SCI_MEMSET(&downloading_str, 0, sizeof(downloading_str));
  262. MMI_GetLabelTextByLang(TXT_MMS_SENDING, &downloading_str);
  263.         PUBWIN_OpenWaitingMessageWin(
  264.         MMIMMS_SEND_MMS_WAITING_WIN_ID,
  265.         WIN_ONE_LEVEL,
  266.         PUBWIN_SOFTKEY_ONE,
  267.         &downloading_str,
  268.         PNULL,
  269.         IMAGE_SEND_MESSAGE_ANIMA,//IMAGE_EXCEPTIVE_WAIT_ANIMA,
  270.         WAIT_TEXT_BACKGROUND_COLOR,
  271.         PNULL,
  272.        (ONMESSAGE_FUNC) SendMMS_HandleWaitingWin
  273. );
  274. }
  275. /* ----------------------------------------------------------------------------
  276. * Function Name: MMIMMS_SendReadRpt_CreateWaitingWin
  277. * Purpose:发送阅读报告时的等待窗口
  278. * Input:  void
  279. * Returns:void
  280. * Author:nihongf@mobilesoft.com.cn
  281. * ----------------------------------------------------------------------------*/ 
  282.  void  MMIMMS_SendReadRpt_CreateWaitingWin(void)
  283. {
  284. MMI_STRING_T downloading_str = {0};
  285. SCI_MEMSET(&downloading_str, 0, sizeof(downloading_str));
  286. MMI_GetLabelTextByLang(TXT_MMS_SENDING_READRPT, &downloading_str);//TXT_MMS_SENDING_READRPT to  TXT_MMS_SENDING for a while
  287.         PUBWIN_OpenWaitingMessageWin(
  288.         MMIMMS_SEND_MMSREADRPT_WAITING_WIN_ID,
  289.         WIN_ONE_LEVEL,
  290.         PUBWIN_SOFTKEY_ONE,
  291.         &downloading_str,
  292.         PNULL,
  293.         IMAGE_SEND_MESSAGE_ANIMA,//IMAGE_EXCEPTIVE_WAIT_ANIMA,
  294.         WAIT_TEXT_BACKGROUND_COLOR,//IMAGE_NULL,
  295.         PNULL,
  296.         (ONMESSAGE_FUNC)SendReadRpt_HandleWaitingWin
  297. );
  298. }
  299. /* ----------------------------------------------------------------------------
  300. * Function Name: MMIMMS_CreateNormalWaitingWin
  301. * Purpose:删除彩信时的等待窗口
  302. * Input:  void
  303. * Returns:void
  304. * Author:nihongf@mobilesoft.com.cn
  305. * ----------------------------------------------------------------------------*/ 
  306. void  MMIMMS_CreateNormalWaitingWin(void)
  307. {
  308. MMI_STRING_T downloading_str = {0};
  309. SCI_MEMSET(&downloading_str, 0, sizeof(downloading_str));
  310. MMI_GetLabelTextByLang(TXTSYS_WAITING, &downloading_str);
  311.         PUBWIN_OpenWaitingMessageWin(
  312.         MMIMMS_NORMAL_WAITING_WIN_ID,
  313.         WIN_ONE_LEVEL,
  314.         PUBWIN_SOFTKEY_NONE,
  315.         &downloading_str,
  316.         PNULL,
  317.         IMAGE_PUBWIN_WAITING_ANIM,
  318.         WAIT_TEXT_BACKGROUND_COLOR,//IMAGE_NULL,
  319.         PNULL,
  320.         (ONMESSAGE_FUNC)MMIMMS_HandleNormalWaitingWin
  321. );
  322. }
  323. /* ----------------------------------------------------------------------------
  324. * Function Name: MMIMMS_CreateReadMMSWaitingWin
  325. * Purpose:读取彩信时的等待窗口
  326. * Input:  void
  327. * Returns:void
  328. * Author:nihongf@mobilesoft.com.cn
  329. * ----------------------------------------------------------------------------*/ 
  330. void  MMIMMS_CreateReadMMSWaitingWin(void)
  331. {
  332. MMI_STRING_T downloading_str = {0};
  333. SCI_MEMSET(&downloading_str, 0, sizeof(downloading_str));
  334. MMI_GetLabelTextByLang(TXT_MMS_OPENING_MMS, &downloading_str);
  335.         PUBWIN_OpenWaitingMessageWin(
  336.         MMIMMS_READ_MMS_WAITING_WIN_ID,
  337.         WIN_ONE_LEVEL,
  338.         PUBWIN_SOFTKEY_NONE,
  339.         &downloading_str,
  340.         PNULL,
  341.         IMAGE_PUBWIN_WAITING_ANIM,
  342.         WAIT_TEXT_BACKGROUND_COLOR,//IMAGE_NULL,
  343.         PNULL,
  344.        (ONMESSAGE_FUNC) MMIMMS_HandleReadMMSWaitingWin
  345. );
  346. }
  347. /* ----------------------------------------------------------------------------
  348. * Function Name: MMIMMS_CreateSaveMMSWaitingWin
  349. * Purpose:保存彩信时的等待窗口
  350. * Input:  void
  351. * Returns:void
  352. * Author:nihongf@mobilesoft.com.cn
  353. * ----------------------------------------------------------------------------*/ 
  354. void  MMIMMS_CreateSaveMMSWaitingWin(void)
  355. {
  356. MMI_STRING_T downloading_str = {0};
  357. SCI_MEMSET(&downloading_str, 0, sizeof(downloading_str));
  358. MMI_GetLabelTextByLang(TXT_MMS_SAVEING_MMS, &downloading_str);
  359.         PUBWIN_OpenWaitingMessageWin(
  360.         MMIMMS_SAVE_MMS_WAITING_WIN_ID,
  361.         WIN_ONE_LEVEL,
  362.         PUBWIN_SOFTKEY_NONE,
  363.         &downloading_str,
  364.         PNULL,
  365.         IMAGE_PUBWIN_WAITING_ANIM,
  366.         WAIT_TEXT_BACKGROUND_COLOR,//IMAGE_NULL,
  367.         PNULL,
  368.        (ONMESSAGE_FUNC) MMIMMS_HandleSaveMMSWaitingWin
  369. );
  370. }
  371. /* ----------------------------------------------------------------------------
  372. * Function Name: Download_HandleDownloadingWin
  373. * Purpose: 下载彩信的窗口消息处理函数
  374. * Input: MMS_WINDOW_ID_E win_id, 
  375.  MMI_MESSAGE_ID_E msg_id, 
  376.  DPARAM param
  377. * Returns: MMI_RESULT_E
  378. * Author:nihongf@mobilesoft.com.cn
  379. * ----------------------------------------------------------------------------*/ 
  380. LOCAL MMI_RESULT_E  Download_HandleDownloadingWin(
  381.  MMS_WINDOW_ID_E win_id, 
  382.  MMI_MESSAGE_ID_E msg_id, 
  383.  DPARAM param
  384.  )
  385. {
  386.     MMI_RESULT_E recode = MMI_RESULT_TRUE;
  387. FFS_SAVEFILE_RESULT_T * efs_result_ptr;
  388. static  uint16  red_close = 0;//变量指示是否按红键退出的。
  389.     switch(msg_id)
  390. {
  391.      case MSG_FULL_PAINT:
  392. SCI_TRACE_LOW("FNH ifclose is %d",iFClose);
  393. red_close = 0;
  394. if (iFClose == 0)
  395. {
  396. MMIMMS_DisplaySendRecvProgress(  g_progresscurrentsize,g_progressneedsize);
  397. }
  398. recode = PUBWIN_HandleWaiting1MessageWinMsg(win_id, msg_id, param);
  399. break;
  400.     case MSG_OPEN_WINDOW:
  401. iFClose = 0;
  402. g_progresscurrentsize = 0;
  403. //MMIMMS_DisplaySendRecvProgress(  g_progresscurrentsize,g_pCurrentList->size);
  404. break;
  405. case MSG_GET_FOCUS:
  406. iFClose = 0;
  407. break;
  408. case MSG_LOSE_FOCUS:
  409. iFClose = 1;
  410. break;
  411.     case MSG_APP_CANCEL:
  412. //query
  413. iFClose = 1;
  414. PUBWIN_OpenPromptQueryWin(STXT_EXIT, IMAGE_PROMPT_ICON_QUERY);
  415. break;
  416. case MSG_PROMPTWIN_OK:
  417. //clear all
  418. iFClose = 0;
  419. PUBWIN_ClosePromptQueryWin();
  420. SCI_TRACE_LOW("MSG_PROMPTWIN_OK HERE THE g_netusing is %d",g_netusing);
  421. if(g_netusing == MMS_MSG_NETUSING_STEP1)
  422. {
  423.      MMS_SendRecvCancel();
  424. }
  425. else
  426. {
  427.     SCI_TRACE_LOW("here use the MMS_SendRecvCancel is too late---------");
  428. }
  429. //MMK_CloseWin(win_id);
  430. break;
  431. case MSG_PROMPTWIN_CANCEL:
  432. //close query win
  433. SCI_TRACE_LOW("MSG_PROMPTWIN_CANCEL COMMAD IN");
  434. iFClose = 0;
  435. PUBWIN_ClosePromptQueryWin();
  436. break;
  437. case MSG_APP_FLIP://modify 2006-5-12 翻盖不处理    
  438. MMIDEFAULT_HandleFlipKey(FALSE);
  439. break;
  440. case MSG_APP_RED:
  441. recode = MMI_RESULT_TRUE;
  442. break;
  443. case MSG_CLOSE_WINDOW:
  444. //free memory
  445. //MMIMMS_FreeBeginToDownloadMMSMem();
  446. //disconnect wap
  447.     if(g_netusing == MMS_MSG_NETUSING_STEP1||g_netusing == MMS_MSG_NETUSING_STEP2)
  448.     {        
  449.         MMS_Close();
  450. SCI_TRACE_LOW("FNH close Download_HandleDownloadingWin after MMS_Close");
  451.     g_netusing = MMS_MSG_NETUSING_NULL;
  452.     }
  453. SCI_TRACE_LOW("FNH close Download_HandleDownloadingWin");
  454. g_netusing = MMS_MSG_NETUSING_NULL;
  455. if (red_close == 0) //按红键退出的
  456. {
  457. if(g_backautodownload == TRUE)
  458. {
  459. if (g_pCurrentList->needautodw == 1)
  460. {
  461. g_pCurrentList->needautodw = 0;
  462. }
  463. g_backautodownload = FALSE;
  464. }
  465. MMIMMS_DeleteAutodownList();
  466. if(g_inboxneedsave == TRUE)
  467. {
  468. SCI_TRACE_LOW(" TO IDLE MMIMMS_SaveManagerInboxFile");
  469. MMIMMS_StoreFolder(g_pManager->inboxfolder);
  470. MMIMMS_SaveManagerInboxFile(MMS_SAVE_INBOX);//liangliu@mobilesoft.com.cn  modify for inboxfile of mms  save.
  471. g_inboxneedsave = FALSE;
  472. }
  473. }
  474. recode = PUBWIN_HandleWaiting1MessageWinMsg( win_id, msg_id, param);
  475. break;
  476.  case MSG_MMS_RECV_OK:
  477.          SCI_TRACE_LOW("here come to save the mms");
  478. MMS_Close();
  479. g_netusing = MMS_MSG_NETUSING_STEP3;
  480. if (iFClose == 1)
  481. {
  482.    PUBWIN_ClosePromptQueryWin();
  483.    iFClose = 0;
  484. }
  485. g_pManager->inboxfolder->unsettlednumber--;
  486. red_close = 1;
  487.  MMK_CloseWin(win_id);
  488.  MMIMMS_CreateSaveMMSWaitingWin();
  489.  MMIMMS_UpdateRecvMMSMessage(g_pCurrentList);
  490.  MMIMMS_SortManagerFolder(g_pManager->inboxfolder,g_pCurrentList);
  491.  g_savemmsstate = MMS_MSG_SAVEMMS_FOR_RECV;
  492.  MMIMMS_SaveMMS(g_pCurrentList);
  493.  SCI_TRACE_LOW("FNH before g_backautodownload = %d",g_backautodownload);
  494. if(g_backautodownload == TRUE)
  495. {
  496.    g_backautodownload = FALSE;
  497.    g_pCurrentList->needautodw = 0;
  498. }
  499. MMIMMS_DeleteAutodownList();
  500. break;//added by liangl 2005-10-31  for spread save the MMS.
  501. case MSG_MMS_RECV_FAILED:
  502. SCI_TRACE_LOW("recv the mms failed---------");
  503. MMS_Close();
  504. g_netusing = MMS_MSG_NETUSING_STEP3;
  505. if (iFClose == 1)
  506. {
  507. PUBWIN_ClosePromptQueryWin();
  508. }
  509. red_close = 1;
  510. if(g_backautodownload == TRUE)
  511. {
  512. if (g_pCurrentList->needautodw == 1)
  513. {
  514. g_pCurrentList->needautodw = 0;
  515. }
  516. g_backautodownload = FALSE;
  517. }
  518. MMIMMS_DeleteAutodownList();
  519. MMK_CloseWin(win_id);
  520. if(g_inboxneedsave == TRUE)
  521. {
  522. SCI_TRACE_LOW(" TO IDLE MMIMMS_SaveManagerInboxFile");
  523. MMIMMS_StoreFolder(g_pManager->inboxfolder);
  524. MMIMMS_SaveManagerInboxFile(MMS_SAVE_INBOX);//liangliu@mobilesoft.com.cn  modify for inboxfile of mms  save.
  525. g_inboxneedsave = FALSE;
  526. }
  527. PUBWIN_OpenPromptAlertWin(
  528. PUBWIN_SOFTKEY_ONE, 
  529. TXT_MMS_RECV_FAILED,
  530. IMAGE_PROMPT_ICON_FAIL, 
  531. ALERT_TIMEOUT, 
  532. PNULL
  533. );
  534. MMICMSBRW_FreeGlobalBuffer();
  535. break;
  536. case MSG_MMS_RECV_CANCEL:
  537. SCI_TRACE_LOW("recv the mms cancel---------");
  538. MMS_Close();
  539. g_netusing = MMS_MSG_NETUSING_STEP3;
  540. SCI_TRACE_LOW("MSG_MMS_RECV_CANCEL HERE MMS_Close() is OK -----");
  541. if (iFClose == 1)
  542.    PUBWIN_ClosePromptQueryWin();
  543. if(g_backautodownload == TRUE)
  544. {
  545. if (g_pCurrentList->needautodw == 1)
  546. {
  547. g_pCurrentList->needautodw = 0;
  548. }//说明:上面注释的部分是原来的设计,自动下载可以取消两次,现在展讯修改原来的设计,要求自动下载只能取消一次
  549. g_backautodownload = FALSE;
  550. }
  551. MMIMMS_DeleteAutodownList();
  552. red_close = 1;
  553. MMK_CloseWin(win_id);
  554. if(g_inboxneedsave == TRUE)
  555. {
  556.    SCI_TRACE_LOW(" TO IDLE MMIMMS_SaveManagerInboxFile");
  557.    MMIMMS_StoreFolder(g_pManager->inboxfolder);
  558.    MMIMMS_SaveManagerInboxFile(MMS_SAVE_INBOX);//liangliu@mobilesoft.com.cn  modify for inboxfile of mms  save.
  559.    g_inboxneedsave = FALSE;
  560. }
  561. PUBWIN_OpenPromptAlertWin(
  562.    PUBWIN_SOFTKEY_ONE, 
  563.    TXT_MMS_RECV_CANCEL,
  564. IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK, 
  565.    ALERT_TIMEOUT, 
  566.    PNULL
  567.    );
  568. MMICMSBRW_FreeGlobalBuffer();
  569. break;
  570. case MSG_MMS_RECV_INVALIDPERIOD:
  571. SCI_TRACE_LOW("recv the mms invalidreriod---------");
  572. MMS_Close();
  573. g_netusing = MMS_MSG_NETUSING_STEP3;
  574. if (iFClose == 1)
  575. {
  576. PUBWIN_ClosePromptQueryWin();
  577. }
  578. red_close = 1;
  579. MMK_CloseWin(win_id);
  580. PUBWIN_OpenPromptAlertWin(
  581. PUBWIN_SOFTKEY_ONE, 
  582. TXT_MMS_RECV_INVALID,
  583. IMAGE_PROMPT_ICON_FAIL,//IMAGE_PROMPT_ICON_OK, 
  584. ALERT_TIMEOUT, 
  585. PNULL
  586. );
  587. MMICMSBRW_FreeGlobalBuffer();
  588. break;
  589. case MSG_MMS_SAVE_OK:
  590. SCI_TRACE_LOW("HERE THE MSG_ID IS MSG_MMS_SAVE_OK------- ");
  591. efs_result_ptr = (FFS_SAVEFILE_RESULT_T*)param;
  592. if(efs_result_ptr->write_result == SAVEFS_WRITE_SUCCEED)
  593. {
  594. //FILE_Close(efs_result_ptr->hefs);
  595. FFS_Close(g_filetype, efs_result_ptr->hefs);
  596. if(efs_result_ptr->buf_ptr != PNULL)
  597. {
  598. cms_free(efs_result_ptr->buf_ptr);
  599. efs_result_ptr->buf_ptr = PNULL;
  600. }
  601. }
  602. if (iFClose == 1)
  603. PUBWIN_ClosePromptQueryWin();
  604. MMIMMS_StoreFolder(g_pManager->inboxfolder);
  605. g_savestate = MMS_MSG_SAVEFILE_FOR_RECV;
  606. MMIMMS_SaveManagerInboxFile(MMS_SAVE_INBOX);
  607. SCI_TRACE_LOW("here the auto recv mms is ok");
  608. PUBWIN_OpenPromptAlertWin(
  609. PUBWIN_SOFTKEY_ONE, 
  610. TXT_MMS_RECV_SUCCES,
  611. IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK, 
  612. ALERT_TIMEOUT, 
  613. PNULL
  614. );
  615. MMK_CloseWin(MMIMSG_MAIN_MENU_WIN_ID);
  616. red_close = 1;
  617. MMK_CloseWin(win_id);
  618. break;
  619. default:
  620. recode = PUBWIN_HandleWaiting1MessageWinMsg( win_id, msg_id, param);
  621. break;
  622. }
  623.     return (recode);
  624. }
  625. /* ----------------------------------------------------------------------------
  626. * Function Name: SendMMS_HandleWaitingWin
  627. * Purpose: 发送彩信时的等待窗口消息处理函数
  628. * Input: MMS_WINDOW_ID_E win_id, 
  629.  MMI_MESSAGE_ID_E msg_id, 
  630.  DPARAM param
  631. * Returns: MMI_RESULT_E
  632. * Author:nihongf@mobilesoft.com.cn
  633. * ----------------------------------------------------------------------------*/ 
  634. LOCAL MMI_RESULT_E  SendMMS_HandleWaitingWin(
  635.  MMS_WINDOW_ID_E win_id, 
  636.  MMI_MESSAGE_ID_E msg_id, 
  637.  DPARAM param
  638.  )
  639. {
  640.     MMI_RESULT_E recode = MMI_RESULT_TRUE;
  641. pMessageList tlist = PNULL;
  642. static BOOLEAN fromcancel = FALSE;
  643.     switch(msg_id)
  644. {
  645. case MSG_FULL_PAINT:
  646. //MMIMMS_CLEAR_CLIENT();
  647. recode = PUBWIN_HandleWaiting1MessageWinMsg( win_id, msg_id, param);
  648. SCI_TRACE_LOW("FNH ifclose is %d",iFClose);
  649. if (iFClose == 0)
  650. {
  651. MMIMMS_DisplaySendRecvProgress(g_progresscurrentsize,g_progressneedsize);
  652. }
  653. break;
  654.     case MSG_OPEN_WINDOW:
  655. fromcancel = FALSE;
  656. iFClose = 0;
  657. g_progresscurrentsize = 0;
  658. break;
  659.  case MSG_APP_FLIP://modify 2006-5-12 fnh  翻盖不处理    
  660. MMIDEFAULT_HandleFlipKey(FALSE);
  661. break;
  662.  case MSG_APP_RED:
  663. recode = MMI_RESULT_TRUE;
  664. break;
  665.     case MSG_APP_CANCEL:
  666. //query
  667. iFClose = 1;
  668. PUBWIN_OpenPromptQueryWin(STXT_EXIT, IMAGE_PROMPT_ICON_QUERY);
  669. break;
  670. case MSG_GET_FOCUS:
  671. iFClose = 0;
  672. break;
  673. case MSG_LOSE_FOCUS:
  674. iFClose = 1;
  675. break;
  676. case MSG_PROMPTWIN_OK:
  677. //clear all
  678. iFClose = 0;
  679. PUBWIN_ClosePromptQueryWin();
  680. fromcancel = TRUE;
  681. SCI_TRACE_LOW("SEND CANCEL THE MSG_PROMPTWIN IN THE g_netusing is %d",g_netusing);
  682. if(g_netusing == MMS_MSG_NETUSING_STEP1)
  683. {
  684.      MMS_Close();
  685.            mmsf_Remove((char *)g_pManager->outboxfolder->currentmessage->filename);//liangliu modify 2005-11-28
  686.  SCI_TRACE_LOW("FNH after remove");
  687. if(g_mailbox_status != SEND_OUTBOX_MMS)
  688. {
  689.  MMIMMS_DeleteManagerList(g_pManager->outboxfolder);
  690. }
  691.      PUBWIN_OpenPromptAlertWin(
  692. PUBWIN_SOFTKEY_ONE, 
  693. TXT_MMS_CANCEL_SUCCESS,
  694. IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK, 
  695. ALERT_TIMEOUT, 
  696. PNULL
  697. );
  698.  MMK_CloseWin(win_id);
  699. }else if(g_netusing == MMS_MSG_NETUSING_STEP2)
  700. {
  701.    MMS_SendRecvCancel();
  702. }
  703. else
  704. {
  705.     SCI_TRACE_LOW("here use the MMS_SendRecvCancel is too late---------");
  706. }
  707. //MMK_CloseWin(win_id);liangliu modify 2005-11-24 for send cancel for message for send cancel.
  708. break;
  709. case MSG_PROMPTWIN_CANCEL:
  710. //close query win
  711. iFClose = 0;
  712. PUBWIN_ClosePromptQueryWin();
  713. break;
  714. case MSG_CLOSE_WINDOW:
  715. SCI_TRACE_LOW("here the close win come in and the g_netusing is %d",g_netusing);
  716. if(g_netusing == MMS_MSG_NETUSING_STEP1||g_netusing == MMS_MSG_NETUSING_STEP2)
  717. {
  718. SCI_TRACE_LOW("HERE THE fromcancel is %d",fromcancel);
  719. if(fromcancel == FALSE)
  720. {
  721. SCI_TRACE_LOW("COME HERE ------");
  722. if (iFClose == 1)
  723. {
  724. PUBWIN_ClosePromptQueryWin();
  725. }
  726. MMS_Close();
  727. mmsf_Remove((char *)g_pManager->outboxfolder->currentmessage->filename);//liangliu modify 2005-11-28
  728. SCI_TRACE_LOW("FNH after remove");
  729. if(g_mailbox_status != SEND_OUTBOX_MMS)
  730. {
  731. MMIMMS_DeleteManagerList(g_pManager->outboxfolder);
  732. }
  733. }
  734. }
  735. SCI_TRACE_LOW("FNH close SendMMS_HandleWaitingWin");
  736. g_netusing = MMS_MSG_NETUSING_NULL;
  737. recode = PUBWIN_HandleWaiting1MessageWinMsg( win_id, msg_id, param);
  738. break;
  739. case MSG_MMS_SEND_CANCEL:
  740. SCI_TRACE_LOW("FNH ENTER MSG_MMS_SEND_CANCEL");
  741. //MMS_Close();
  742. g_netusing = MMS_MSG_NETUSING_STEP3;
  743.  if (iFClose == 1)
  744. PUBWIN_ClosePromptQueryWin();
  745.  if (g_mailbox_status != SEND_OUTBOX_MMS)
  746.  {
  747.  SCI_TRACE_LOW("FNH g_pManager->outboxfolder->currentmessage->filename = %d",g_pManager->outboxfolder->currentmessage->filename );
  748.  mmsf_Remove((char *)g_pManager->outboxfolder->currentmessage->filename);//liangliu modify 2005-11-28
  749.  SCI_TRACE_LOW("FNH after remove");
  750.  MMIMMS_DeleteManagerList(g_pManager->outboxfolder); 
  751.  SCI_TRACE_LOW("FNH after deletelist");
  752.  SCI_TRACE_LOW("FNH g_pManager->outboxfolder->currentmessage = %d",g_pManager->outboxfolder->currentmessage);
  753.  }
  754.  else if (g_mailbox_status == SEND_OUTBOX_MMS)
  755.  {
  756.         mmsf_Remove((char *)g_pManager->outboxfolder->currentmessage->filename);//liangliu modify 2005-11-28
  757.  g_mailbox_status = SEND_NEW_MMS;
  758.  }
  759. //  destroy_mms_mem_file_info();
  760.  PUBWIN_OpenPromptAlertWin(
  761. PUBWIN_SOFTKEY_ONE, 
  762. TXT_MMS_CANCEL_SUCCESS,
  763. IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK, 
  764. ALERT_TIMEOUT, 
  765. PNULL
  766. );
  767.  SCI_TRACE_LOW("FNH before close win");
  768.  MMK_CloseWin(win_id);
  769. break;
  770. case MSG_MMS_SEND_OK:
  771. //添加代码关于信箱处理的
  772. MMS_Close();
  773. tlist = MMIMMS_ManagerListCopy(g_pManager->outboxfolder->currentmessage);
  774. SCI_TRACE_LOW("MMIMMS_ManagerListCopy COMEOUT-----");
  775. MMIMMS_DeleteManagerList(g_pManager->outboxfolder); 
  776. SCI_TRACE_LOW("MMIMMS_DeleteManagerList COMEOUT-----");
  777. if (iFClose == 1)
  778. {
  779. PUBWIN_ClosePromptQueryWin();
  780. }
  781. g_netusing = MMS_MSG_NETUSING_STEP3;
  782. MMK_CloseWin(win_id);
  783. if (g_mailbox_status != SEND_OUTBOX_MMS)
  784. {
  785. g_filetype = MMICMS_GetCurrentFFS();
  786. if((g_filetype != FS_INVALID)&&MMIMMS_GetManagerTotalNum() <=(MMS_MAX_NUM-1)&&MMIMMS_IsMoreSpace())//modify nihongf
  787. {
  788. MMIMMS_AddManagerList(g_pManager->sentfolder,tlist);
  789. SCI_TRACE_LOW("MMIMMS_AddManagerList COMEOUT-----");
  790. MMIMMS_CreateSaveMMSWaitingWin();
  791. g_savemmsstate = MMS_MSG_SAVEMMS_FOR_SEND_SUCCESS;
  792. MMIMMS_SaveMMS(g_pManager->sentfolder->currentmessage);
  793. }
  794. else
  795. {
  796. if (tlist->filename != NULL)
  797. {
  798. SCI_TRACE_LOW("FNH :space is empty! before remove tlist->filename");
  799. mmsf_Remove((char *)tlist->filename); //
  800. }
  801. PUBWIN_OpenPromptAlertWin(
  802. PUBWIN_SOFTKEY_ONE, 
  803. TXT_MMS_SEND_SUCCEED,
  804. IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK, 
  805. ALERT_TIMEOUT, 
  806. PNULL
  807. );
  808. }
  809. }
  810. else
  811. {
  812. MMIMMS_AddManagerList(g_pManager->sentfolder,tlist);
  813. SCI_TRACE_LOW("MMIMMS_AddManagerList COMEOUT-----");
  814. MMIMMS_CreateSaveMMSWaitingWin();
  815. MMIMMS_StoreFolder(g_pManager->outboxfolder);
  816. MMIMMS_SaveManagerOutboxFile();
  817. PUBWIN_OpenPromptAlertWin(
  818. PUBWIN_SOFTKEY_ONE, 
  819. TXT_MMS_SEND_SUCCEED,
  820. IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK, 
  821. ALERT_TIMEOUT, 
  822. PNULL
  823. );
  824. }
  825.   break;
  826. case MSG_MMS_SENDED_FAILED:
  827. if (iFClose == 1)
  828. {
  829. PUBWIN_ClosePromptQueryWin();
  830. }
  831. MMS_Close();
  832. g_netusing = MMS_MSG_NETUSING_STEP3;
  833. g_filetype = MMICMS_GetCurrentFFS();
  834. SCI_TRACE_LOW("fnh send failed is %d",MMIMMS_GetManagerTotalNum());
  835. if((g_filetype != FS_INVALID)&&MMIMMS_GetManagerTotalNum() <=(MMS_MAX_NUM)&&MMIMMS_IsMoreSpace())//modify 2005-12-14
  836. {
  837. if (g_mailbox_status == SEND_NEW_MMS)
  838. {
  839. SCI_TRACE_LOW("fnh before create save mms waiting");
  840. MMIMMS_CreateSaveMMSWaitingWin();
  841. //g_pManager->currentfolder = g_pManager->outboxfolder;
  842. g_savemmsstate = MMS_MSG_SAVEMMS_FOR_SEND_FAILED;
  843. MMIMMS_SaveMMS(g_pManager->outboxfolder->currentmessage);
  844. }
  845. else if (g_mailbox_status == SEND_OUTBOX_MMS)
  846. {
  847. PUBWIN_OpenPromptAlertWin(
  848. PUBWIN_SOFTKEY_ONE, 
  849. TXT_MMS_SEND_FAILED,
  850. IMAGE_PROMPT_ICON_FAIL, 
  851. ALERT_TIMEOUT, 
  852. PNULL
  853. );
  854. }
  855. }
  856. else
  857. {
  858. PUBWIN_OpenPromptAlertWin(
  859. PUBWIN_SOFTKEY_ONE, 
  860. TXT_MMS_SEND_FAILED,
  861. IMAGE_PROMPT_ICON_FAIL,//IMAGE_PROMPT_ICON_OK, 
  862. ALERT_TIMEOUT, 
  863. PNULL
  864. );
  865. if (g_mailbox_status != SEND_OUTBOX_MMS)
  866. {
  867. SCI_TRACE_LOW("FNH: the space is empty! before remove file!");
  868. mmsf_Remove((char *)g_pManager->outboxfolder->currentmessage->filename);
  869. MMIMMS_DeleteManagerList(g_pManager->outboxfolder); 
  870. SCI_TRACE_LOW("MSG_MMS_SENDED_FAILED MMIMMS_DeleteManagerList COMEOUT-----");
  871. }
  872. }
  873. MMK_CloseWin(win_id);
  874. break;
  875. default:
  876. recode = PUBWIN_HandleWaiting1MessageWinMsg(win_id, msg_id, param);
  877. break;
  878. }
  879.     return (recode);
  880. }
  881. /* ----------------------------------------------------------------------------
  882. * Function Name: SendReadRpt_HandleWaitingWin
  883. * Purpose: 发送阅读报告时的等待窗口消息处理函数
  884. * Input: MMS_WINDOW_ID_E win_id, 
  885.  MMI_MESSAGE_ID_E msg_id, 
  886.  DPARAM param
  887. * Returns: MMI_RESULT_E
  888. * Author:nihongf@mobilesoft.com.cn
  889. * ----------------------------------------------------------------------------*/ 
  890. LOCAL MMI_RESULT_E  SendReadRpt_HandleWaitingWin(
  891.  MMS_WINDOW_ID_E win_id, 
  892.  MMI_MESSAGE_ID_E msg_id, 
  893.  DPARAM param
  894.  )
  895. {
  896.     MMI_RESULT_E recode = MMI_RESULT_TRUE;
  897. static BOOLEAN s_is_save_success = FALSE;
  898. static BOOLEAN s_is_show_new_mms_alert = FALSE;
  899.     switch(msg_id)
  900. {
  901.     case MSG_OPEN_WINDOW:
  902. //init
  903. s_is_save_success = FALSE;
  904. s_is_show_new_mms_alert = FALSE;
  905. recode = PUBWIN_HandleWaiting1MessageWinMsg( win_id, msg_id, param);
  906. break;
  907.     case MSG_APP_CANCEL:
  908. if(g_netusing == MMS_MSG_NETUSING_STEP1||g_netusing == MMS_MSG_NETUSING_STEP2)
  909.     {
  910.             MMS_Close();
  911. SCI_TRACE_LOW("FNH APP_CANCEL SendReadRpt_HandleWaitingWin");
  912. g_netusing = MMS_MSG_NETUSING_NULL;
  913.     }
  914. MMK_CloseWin(win_id);
  915. g_filetype = MMICMS_GetCurrentFFS();
  916. if (g_filetype != FS_INVALID)
  917. {
  918. MMIMMS_CreateReadMMSWaitingWin();
  919. MMIMMS_ReadMMS(g_pCurrentList);
  920. }
  921. break;
  922. case MSG_CLOSE_WINDOW:
  923. //free memory
  924. //MMIMMS_FreeBeginToDownloadMMSMem();
  925. //disconnect wap
  926. if(g_netusing == MMS_MSG_NETUSING_STEP1||g_netusing == MMS_MSG_NETUSING_STEP2)
  927. {
  928. MMS_Close();
  929. //  MMIMMS_DeleteManagerList(g_pManager->outboxfolder); 
  930. //  mmsf_Remove((char *)g_pManager->outboxfolder->currentmessage->filename);//liangliu modify 2005-11-28
  931. SCI_TRACE_LOW("fnh close SendReadRpt_HandleWaitingWin");
  932. g_netusing = MMS_MSG_NETUSING_NULL;
  933. }
  934. g_issendingreadrpt = FALSE;
  935. recode = PUBWIN_HandleWaiting1MessageWinMsg( win_id, msg_id, param);
  936. break;
  937. case MSG_APP_FLIP://modify 2006-5-12 fnh  翻盖不处理   
  938. MMIDEFAULT_HandleFlipKey(FALSE);
  939. break;
  940. case MSG_APP_RED:
  941. recode = MMI_RESULT_TRUE;
  942. break;
  943. case MSG_MMS_SEND_OK://阅读报告无论发送成功或者失败都直接跳到一个画面
  944.         MMS_Close();
  945. g_netusing = MMS_MSG_NETUSING_STEP3;
  946. g_issendingreadrpt = FALSE;
  947. MMK_PostMsg(MMIMMS_INBOX_LIST_WIN_ID,MSG_MMS_SEND_OK,PNULL,PNULL);
  948. MMK_CloseWin(win_id);
  949. break;
  950. case MSG_MMS_SENDED_FAILED:
  951. MMS_Close();
  952. g_netusing = MMS_MSG_NETUSING_STEP3;
  953. g_issendingreadrpt = FALSE;
  954. MMK_PostMsg(MMIMMS_INBOX_LIST_WIN_ID,MSG_MMS_SENDED_FAILED,PNULL,PNULL);
  955. MMK_CloseWin(win_id);
  956. break;
  957. default:
  958. recode = PUBWIN_HandleWaiting1MessageWinMsg(win_id, msg_id, param);
  959. break;
  960. }
  961.     return (recode);
  962. }
  963. LOCAL MMI_RESULT_E Setting_HandleMenuWinMsg(
  964. MMS_WINDOW_ID_E win_id, 
  965. MMI_MESSAGE_ID_E msg_id, 
  966. DPARAM param
  967.   )
  968. {
  969. MMI_RESULT_E      recode = MMI_RESULT_TRUE;
  970. uint32  group_id = 0;
  971.     uint32  menu_id = 0;
  972. switch( msg_id )
  973. {
  974. case MSG_OPEN_WINDOW:
  975. MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
  976. MMK_SetAtvCtrl( win_id, MMIMMS_SETTING_MENU_CTRL_ID);
  977. break;
  978. case MSG_GET_FOCUS:
  979. MMK_SetAtvCtrl( win_id, MMIMMS_SETTING_MENU_CTRL_ID);
  980. break;
  981. case MSG_FULL_PAINT:
  982. {
  983. FILE_DEV_E_T cur_type;
  984. cur_type = MMICMS_GetCurrentFFS();
  985. if (cur_type == FS_INVALID)
  986. {
  987. MMI_EnableGrayed(MENU_MMS_SETTING,ID_MMS_SETTING_SIGN,TRUE);
  988. }
  989. else
  990. {
  991. MMI_EnableGrayed(MENU_MMS_SETTING,ID_MMS_SETTING_SIGN,FALSE);
  992. }
  993. }
  994. break;
  995. case MSG_APP_OK:
  996. case MSG_CTL_OK:
  997. GUIMENU_GetRetID( MMIMMS_SETTING_MENU_CTRL_ID, (MMI_MENU_GROUP_ID_T *)(&group_id),(MMI_MENU_ID_T *) (&menu_id));
  998. switch ( menu_id)
  999. {
  1000. case ID_MMS_SETTING_NETWORK_SETTING:
  1001.     MMK_CreateWin((uint32 *)MMIMMS_SETTING_NETWORK_WIN,PNULL);
  1002. break;
  1003. case ID_MMS_SETTING_ARRIVE_REPORT:
  1004.     MMK_CreateWin((uint32 *)MMIMMS_SETTING_ARRIVE_LIST_WIN,PNULL);
  1005. break;
  1006. case ID_MMS_SETTING_READ_REPORT:
  1007.     MMK_CreateWin((uint32 *)MMIMMS_SETTING_READREPORT_LIST_WIN,PNULL);
  1008. break;
  1009. case ID_MMS_SETTING_ANONYMITY:
  1010. MMK_CreateWin((uint32 *)MMIMMS_SETTING_ANONYMITYWHETHER_LIST_WIN,PNULL);
  1011. break;
  1012. case ID_MMS_SETTING_PRIORITY:
  1013. MMK_CreateWin((uint32 *)MMIMMS_SETTING_PRIORITY_LIST_WIN,PNULL);
  1014. break;
  1015. case ID_MMS_SETTING_AUTO_DOWNLOAD:
  1016. MMK_CreateWin((uint32 *)MMIMMS_SETTING_AUTODOWNLOAD_LIST_WIN,PNULL);
  1017. break;
  1018. case ID_MMS_SETTING_SOUND:
  1019. MMK_CreateWin((uint32 *)MMIMMS_SETTING_SOUNDALLOWABLE_LIST_WIN,PNULL);
  1020. break;
  1021. case ID_MMS_SETTING_ADVERTISING:
  1022. MMK_CreateWin((uint32 *)MMIMMS_SETTING_ADVERTISINGALLOWABLE_LIST_WIN,PNULL);
  1023. break;
  1024. case ID_MMS_SETTING_PERIOD:
  1025. MMK_CreateWin((uint32 *)MMIMMS_SETTING_VALIDE_PERIOD_LIST_WIN, PNULL);
  1026. break;
  1027. case ID_MMS_SETTING_SIGN:
  1028. MMK_CreateWin((uint32 *)MMIMMS_SETTING_SIGN_WIN, PNULL);
  1029. break;
  1030. case ID_MMS_SETTING_DEFAULT:
  1031. PUBWIN_OpenPromptQueryWin(
  1032. TXT_CMS_MMS_RESTORE_DEFAULT,
  1033. IMAGE_PROMPT_ICON_QUERY
  1034. );
  1035. break;
  1036. case ID_MMS_SETTING_OPEN_SIGN:
  1037.     MMK_CreateWin((uint32 *)MMIMMS_SETTING_OPENSIGN_LIST_WIN,PNULL);
  1038. break;
  1039. case ID_MMS_SETTING_EDIT_SIGN:
  1040. g_filetype = MMICMS_GetCurrentFFS();
  1041. if (g_filetype != FS_INVALID)
  1042. {
  1043. MMIMMS_CreateReadMMSWaitingWin();
  1044. g_readsignstate= MMS_MSG_READ_SIGN_FOR_SET;
  1045. MMIMMS_ReadAutosign() ;
  1046. }
  1047. break;
  1048. default:
  1049. break;
  1050. }
  1051. break;
  1052. case MSG_PROMPTWIN_OK:
  1053. MMIMMS_ResetConfig();
  1054. PUBWIN_ClosePromptQueryWin();
  1055. PUBWIN_OpenPromptAlertWin(
  1056.         PUBWIN_SOFTKEY_ONE,
  1057.         TXT_SUCCESS,
  1058.         IMAGE_PROMPT_ICON_SUCCESS,
  1059.         MMI_3SECONDS,
  1060.         PNULL);
  1061. break;
  1062. case MSG_PROMPTWIN_CANCEL:
  1063. PUBWIN_ClosePromptQueryWin();
  1064. break;
  1065.     case MSG_APP_CANCEL:
  1066.     case MSG_CTL_CANCEL:
  1067.       MMK_CloseWin(win_id);
  1068.       break;
  1069.     default:
  1070.       recode = MMI_RESULT_FALSE;
  1071.       break;
  1072. }
  1073. return recode;
  1074. }
  1075. /* ----------------------------------------------------------------------------
  1076. * Function Name: MMIMMS_HandleNormalWaitingWin
  1077. * Purpose: 删除彩信时等待窗口消息处理函数
  1078. * Input: MMS_WINDOW_ID_E win_id, 
  1079.  MMI_MESSAGE_ID_E msg_id, 
  1080.  DPARAM param
  1081. * Returns: MMI_RESULT_E
  1082. * Author:nihongf@mobilesoft.com.cn
  1083. * ----------------------------------------------------------------------------*/ 
  1084. LOCAL MMI_RESULT_E  MMIMMS_HandleNormalWaitingWin(
  1085. MMS_WINDOW_ID_E win_id, 
  1086. MMI_MESSAGE_ID_E msg_id, 
  1087. DPARAM param
  1088.   )
  1089. {
  1090.     MMI_RESULT_E recode = MMI_RESULT_TRUE;
  1091. static BOOLEAN s_is_save_success = FALSE;
  1092. static BOOLEAN s_is_show_new_mms_alert = FALSE;
  1093. FFS_SAVEFILE_RESULT_T * efs_result_ptr;
  1094.     switch(msg_id)
  1095. {
  1096.     case MSG_OPEN_WINDOW:
  1097. //init
  1098. s_is_save_success = FALSE;
  1099. s_is_show_new_mms_alert = FALSE;
  1100. recode = PUBWIN_HandleWaiting1MessageWinMsg( (MMI_WIN_ID_T)win_id, msg_id, param);
  1101. break;
  1102.     //case MSG_APP_CANCEL:
  1103. //query
  1104. // PUBWIN_OpenPromptQueryWin(STXT_EXIT, IMAGE_PROMPT_ICON_QUERY);
  1105. // break;
  1106.  
  1107.      case MSG_APP_FLIP://modify 2006-3-10 翻盖不处理     
  1108.         MMIDEFAULT_HandleFlipKey(FALSE);
  1109.         break;
  1110.  case MSG_APP_RED:
  1111. recode = MMI_RESULT_TRUE;
  1112. break;
  1113. case MSG_MMS_DELETEMMS_OK:
  1114. switch(g_savestate)
  1115. {
  1116. case MMS_MSG_SAVEFILE_FOR_INBOX_DELETE:
  1117. SCI_TRACE_LOW("MMS_MSG_SAVEFILE_FOR_INBOX_DELETE HERE IS NORMAL---------");
  1118. MMIMMS_DeleteManagerList(g_pManager->inboxfolder);
  1119. MMK_CloseWin(win_id);
  1120. MMIMMS_StoreFolder(g_pManager->inboxfolder);
  1121. SCI_TRACE_LOW("MMIMMS_StoreFolder IS OVER");
  1122.        MMIMMS_SaveManagerInboxFile(MMS_SAVE_INBOX);
  1123.        //MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVEINBOXFILE, PNULL, PNULL);
  1124. //MMK_CloseWin(win_id);
  1125.        PUBWIN_OpenPromptAlertWin(
  1126. PUBWIN_SOFTKEY_ONE, 
  1127. TXT_MMS_DONE,
  1128. IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK, 
  1129. ALERT_TIMEOUT, 
  1130. PNULL
  1131. );
  1132. break;
  1133. case MMS_MSG_SAVEFILE_FOR_OUTBOX_DELETE:
  1134. MMIMMS_DeleteManagerList(g_pManager->outboxfolder);
  1135. MMK_CloseWin(win_id);
  1136. MMIMMS_StoreFolder(g_pManager->outboxfolder);
  1137.        MMIMMS_SaveManagerOutboxFile();
  1138.      //  MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVEOUTBOXFILE, PNULL, PNULL);
  1139. //MMK_CloseWin(win_id);
  1140.        PUBWIN_OpenPromptAlertWin(
  1141. PUBWIN_SOFTKEY_ONE, 
  1142. TXT_MMS_DONE,
  1143. IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK, 
  1144. ALERT_TIMEOUT, 
  1145. PNULL
  1146. );
  1147. break;
  1148. case MMS_MSG_SAVEFILE_FOR_SENTBOX_DELETE:
  1149. MMIMMS_DeleteManagerList(g_pManager->sentfolder);
  1150. MMK_CloseWin(win_id);
  1151. MMIMMS_StoreFolder(g_pManager->sentfolder);
  1152.        MMIMMS_SaveManagerSentboxFile();
  1153.        //MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVESENTBOXFILE, PNULL, PNULL);
  1154. //MMK_CloseWin(win_id);
  1155.        PUBWIN_OpenPromptAlertWin(
  1156. PUBWIN_SOFTKEY_ONE, 
  1157. TXT_MMS_DONE,
  1158. IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK, 
  1159. ALERT_TIMEOUT, 
  1160. PNULL
  1161. );
  1162. break;
  1163. case MMS_MSG_SAVEFILE_FOR_DRAFTBOX_DELETE:
  1164. MMIMMS_DeleteManagerList(g_pManager->draftfolder);
  1165. MMK_CloseWin(win_id);
  1166. MMIMMS_StoreFolder(g_pManager->draftfolder);
  1167.        MMIMMS_SaveManagerDraftboxFile();
  1168.       // MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVEDRAFTBOXFILE, PNULL, PNULL);
  1169. //MMK_CloseWin(win_id);
  1170.        PUBWIN_OpenPromptAlertWin(
  1171. PUBWIN_SOFTKEY_ONE, 
  1172. TXT_MMS_DONE,
  1173. IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK, 
  1174. ALERT_TIMEOUT, 
  1175. PNULL
  1176. );
  1177. break;
  1178. default:
  1179. break;
  1180. }
  1181. break;
  1182. case MSG_MMS_DELETEONEMMS_OK:
  1183. MMIMMS_DeleteManagerListOneOfAll(g_pManager->currentfolder);
  1184. if(g_pManager->currentfolder->root != NULL)
  1185. {
  1186. MMIMMS_DeleteMMSOneOfAll(g_pManager->currentfolder);
  1187. }
  1188. else
  1189. {
  1190.    switch(g_savestate)
  1191.       {
  1192.            case MMS_MSG_SAVEFILE_FOR_INBOX_DELETE:
  1193.      MMK_CloseWin(win_id);
  1194.             MMIMMS_StoreFolder(g_pManager->inboxfolder);
  1195.      g_pManager->inboxfolder->unsettlednumber = 0;//modify 2005-12-2
  1196.             SCI_TRACE_LOW("MMIMMS_StoreFolder IS OVER");
  1197.                    MMIMMS_SaveManagerInboxFile(MMS_SAVE_INBOX);
  1198.                   // MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVEINBOXFILE, PNULL, PNULL);
  1199.      //MMK_CloseWin(win_id);
  1200.                     PUBWIN_OpenPromptAlertWin(
  1201. PUBWIN_SOFTKEY_ONE, 
  1202. TXT_MMS_DONE,
  1203. IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK, 
  1204. ALERT_TIMEOUT, 
  1205. PNULL
  1206. );
  1207.             break;
  1208.           case MMS_MSG_SAVEFILE_FOR_OUTBOX_DELETE:          
  1209.             MMIMMS_StoreFolder(g_pManager->outboxfolder);
  1210.                    MMIMMS_SaveManagerOutboxFile();
  1211.                   // MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVEOUTBOXFILE, PNULL, PNULL);
  1212.      MMK_CloseWin(win_id);
  1213.                    PUBWIN_OpenPromptAlertWin(
  1214. PUBWIN_SOFTKEY_ONE, 
  1215. TXT_MMS_DONE,
  1216. IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK, 
  1217. ALERT_TIMEOUT, 
  1218. PNULL
  1219. );
  1220.             break;
  1221.           case MMS_MSG_SAVEFILE_FOR_SENTBOX_DELETE:
  1222.      MMK_CloseWin(win_id);
  1223.             MMIMMS_StoreFolder(g_pManager->sentfolder);
  1224.                    MMIMMS_SaveManagerSentboxFile();
  1225.                   // MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVESENTBOXFILE, PNULL, PNULL);
  1226.      //MMK_CloseWin(win_id);
  1227.                    PUBWIN_OpenPromptAlertWin(
  1228. PUBWIN_SOFTKEY_ONE, 
  1229. TXT_MMS_DONE,
  1230. IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK, 
  1231. ALERT_TIMEOUT, 
  1232. PNULL
  1233. );
  1234.             break;
  1235.           case MMS_MSG_SAVEFILE_FOR_DRAFTBOX_DELETE:
  1236.      MMK_CloseWin(win_id);
  1237.             MMIMMS_StoreFolder(g_pManager->draftfolder);
  1238.                    MMIMMS_SaveManagerDraftboxFile();
  1239.                    //MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVEDRAFTBOXFILE, PNULL, PNULL);
  1240.      //MMK_CloseWin(win_id);
  1241.                    PUBWIN_OpenPromptAlertWin(
  1242. PUBWIN_SOFTKEY_ONE, 
  1243. TXT_MMS_DONE,
  1244. IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK, 
  1245. ALERT_TIMEOUT, 
  1246. PNULL
  1247. );
  1248.             break;
  1249.            default:
  1250.             break;
  1251.      }
  1252. }
  1253. break;
  1254. case MSG_MMS_SAVE_OK:
  1255. efs_result_ptr = (FFS_SAVEFILE_RESULT_T*)param;
  1256. if(efs_result_ptr->write_result == SAVEFS_WRITE_SUCCEED)
  1257.    {
  1258. //FILE_Close(efs_result_ptr->hefs);
  1259. FFS_Close(g_filetype, efs_result_ptr->hefs);
  1260. if(efs_result_ptr->buf_ptr != PNULL)
  1261. {
  1262. cms_free(efs_result_ptr->buf_ptr);
  1263. efs_result_ptr->buf_ptr = PNULL;
  1264. }
  1265.    }
  1266.  MMK_CloseWin(win_id);
  1267.  PUBWIN_OpenPromptAlertWin(
  1268. PUBWIN_SOFTKEY_ONE, 
  1269. TXT_MMI_SAVESUCC,
  1270. IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK, 
  1271. ALERT_TIMEOUT, 
  1272. PNULL
  1273. );
  1274. break;
  1275. case MSG_CLOSE_WINDOW:
  1276. recode = PUBWIN_HandleWaiting1MessageWinMsg( (MMI_WIN_ID_T)win_id, msg_id, param);
  1277. break;
  1278. default:
  1279. recode = PUBWIN_HandleWaiting1MessageWinMsg((MMI_WIN_ID_T)win_id, msg_id, param);
  1280. break;
  1281. }
  1282.     return (recode);
  1283. }
  1284. /* ----------------------------------------------------------------------------
  1285. * Function Name: MMIMMS_HandleReadMMSWaitingWin
  1286. * Purpose: 读取彩信时等待窗口消息处理函数
  1287. * Input: MMS_WINDOW_ID_E win_id, 
  1288.  MMI_MESSAGE_ID_E msg_id, 
  1289.  DPARAM param
  1290. * Returns: MMI_RESULT_E
  1291. * Author:nihongf@mobilesoft.com.cn
  1292. * ----------------------------------------------------------------------------*/ 
  1293. LOCAL MMI_RESULT_E  MMIMMS_HandleReadMMSWaitingWin(
  1294.  MMS_WINDOW_ID_E win_id, 
  1295.  MMI_MESSAGE_ID_E msg_id, 
  1296.  DPARAM param
  1297.  )
  1298. {
  1299.     MMI_RESULT_E recode = MMI_RESULT_TRUE;
  1300. static BOOLEAN s_is_save_success = FALSE;
  1301. static BOOLEAN s_is_show_new_mms_alert = FALSE;
  1302. FFS_READFILE_RESULT_T * efs_readresult_ptr;
  1303. FFS_SAVEFILE_RESULT_T     * efs_writeresult_ptr;
  1304. FILE_HANDLE      cmshandle = NULL;
  1305. uint32        filelen = 0;
  1306. //uint16 selected_index = 0;
  1307.     switch(msg_id)
  1308. {
  1309.     case MSG_OPEN_WINDOW:
  1310. //init
  1311. s_is_save_success = FALSE;
  1312. s_is_show_new_mms_alert = FALSE;
  1313. recode = PUBWIN_HandleWaiting1MessageWinMsg( win_id, msg_id, param);
  1314. break;
  1315. case MSG_MMS_READ_SIGN_FAILED:
  1316. SCI_TRACE_LOW("fnh MSG_MMS_READ_SIGN_FAILED before POST msg!");
  1317. MMK_PostMsg(MMIMSG_MAIN_WIN_ID,MSG_MMS_READ_PLAY_SIGN_FAILED, PNULL, 0);
  1318. MMK_CloseWin(win_id);
  1319. break;
  1320. case MSG_MMS_READ_SIGN_OK:
  1321. SCI_TRACE_LOW("FNH MSG_MMS_READ_SIGN_OK!");
  1322. efs_readresult_ptr = (FFS_READFILE_RESULT_T*)param;
  1323. FFS_Close(g_filetype,efs_readresult_ptr->hefs);
  1324. cmshandle = mmsf_Open((char*)"signtempfile.mms", "wb");
  1325. mmsf_Write((char*)efs_readresult_ptr->buf_ptr,efs_readresult_ptr->buf_size, 1, cmshandle);
  1326. filelen=Cms_GetFileLength(cmshandle);
  1327. SCI_TRACE_LOW("FNH get file length = %d",filelen);
  1328. mmsf_Close(cmshandle);
  1329. if(efs_readresult_ptr->buf_ptr != PNULL)
  1330. {
  1331. cms_free(efs_readresult_ptr->buf_ptr);
  1332. efs_readresult_ptr->buf_ptr = PNULL;
  1333. }
  1334. if (g_readsignstate== MMS_MSG_READ_SIGN_FOR_SET)
  1335. {
  1336. SCI_TRACE_LOW("FNH before postmsg!");
  1337. MMK_PostMsg(MMIMSG_MAIN_WIN_ID,MSG_MMS_READ_PLAY_SIGN_OK, PNULL, 0);
  1338. }
  1339. else if (g_readsignstate== MMS_MSG_READ_SIGN_FOR_EDIT)
  1340. {
  1341. MMK_PostMsg(MMIMSG_MAIN_WIN_ID,MSG_MMS_READ_PLAY_SIGN_OK, PNULL, 0);
  1342. }
  1343. else if (g_readsignstate == MMS_MSG_READ_SIGN_FOR_ANSWER_MMS)
  1344. {
  1345. MMK_PostMsg(MMIMSG_MAIN_WIN_ID,MSG_MMS_READ_PLAY_SIGN_OK, PNULL, 0);
  1346. }
  1347. MMK_CloseWin(win_id);
  1348. break;
  1349.    case MSG_MMS_READ_OK:
  1350. efs_readresult_ptr = (FFS_READFILE_RESULT_T*)param;
  1351. FFS_Close(g_filetype,efs_readresult_ptr->hefs);
  1352. if(g_pManager->currentfolder->type ==MMS_FOLDER_TYPE_INBOX )
  1353. {
  1354.     cmshandle = mmsf_Open((char*)g_pCurrentList->filename, "wb");
  1355. }else
  1356. {
  1357. SCI_TRACE_LOW("fnh in MSG_MMS_READ_OK filename is %s",g_pManager->currentfolder->currentmessage->filename);
  1358.     cmshandle = mmsf_Open((char*)g_pManager->currentfolder->currentmessage->filename, "wb");
  1359. }
  1360. SCI_TRACE_LOW("fnh read ok bufptr len = %d",SCI_STRLEN((char *)efs_readresult_ptr->buf_ptr));
  1361. SCI_TRACE_LOW("fnh size = %d",efs_readresult_ptr->buf_size);
  1362. SCI_TRACE_LOW("fnh filename is %s",g_pManager->currentfolder->currentmessage->filename);
  1363. mmsf_Write((char*)efs_readresult_ptr->buf_ptr,efs_readresult_ptr->buf_size, 1, cmshandle);
  1364. filelen = Cms_GetFileLength(cmshandle);
  1365. SCI_TRACE_LOW("fnh filelen = %d",filelen);
  1366. mmsf_Close(cmshandle);
  1367. if(efs_readresult_ptr->buf_ptr != PNULL)
  1368. {
  1369. cms_free(efs_readresult_ptr->buf_ptr);
  1370. efs_readresult_ptr->buf_ptr = PNULL;
  1371. }
  1372. if(g_pManager->currentfolder->type ==MMS_FOLDER_TYPE_INBOX )
  1373. {
  1374.         SCI_TRACE_LOW("2005-2-15 COME HERE  g_pCurrentList->state = %d",g_pCurrentList->state);
  1375.         if(g_pCurrentList->state == 1)
  1376. {
  1377. SCI_TRACE_LOW("FNH IN state 1");
  1378.             g_pCurrentList->state = 2;
  1379.             MMIMMS_SortManagerFolder(g_pManager->inboxfolder,g_pCurrentList);
  1380. MMIMMS_StoreFolder(g_pManager->inboxfolder);
  1381.             MMIMMS_SaveManagerInboxFile(MMS_SAVE_INBOX_PUSH);
  1382.         }
  1383. else
  1384.         {
  1385. SCI_TRACE_LOW("FNH before switch");
  1386.          switch(g_readforstate)
  1387.          {
  1388.               SCI_TRACE_LOW("2005-2-15 COME HERE  state = 2");
  1389.               case MMS_MSG_INBOX_READ_FOR_PLAY:
  1390.   SCI_TRACE_LOW("FNH postmsg for play");
  1391.                       MMK_PostMsg(MMIMMS_INBOX_MMSOPT_MENU_WIN_ID,MSG_MMS_READ_FOR_PLAY, PNULL, 0);
  1392.                       break;
  1393.               case MMS_MSG_INBOX_READ_FOR_FW:
  1394.                       MMK_PostMsg(MMIMMS_INBOX_MMSOPT_MENU_WIN_ID,MSG_MMS_READ_FOR_FW, PNULL, 0);
  1395.                       break;
  1396.               case MMS_MSG_INBOX_READ_FOR_SAVEPIC:
  1397.                        MMK_PostMsg(MMIMMS_INBOX_MMSOPT_MENU_WIN_ID,MSG_MMS_READ_FOR_SAVEPIC, PNULL, 0);
  1398.                        break;
  1399.               case MMS_MSG_INBOX_READ_FOR_SAVESOUND:
  1400.                        MMK_PostMsg(MMIMMS_INBOX_MMSOPT_MENU_WIN_ID,MSG_MMS_READ_FOR_SAVESOUND, PNULL, 0);
  1401.                        break;
  1402.               case MMS_MSG_INBOX_READ_FOR_SAVEVIDEO:
  1403.                        MMK_PostMsg(MMIMMS_INBOX_MMSOPT_MENU_WIN_ID,MSG_MMS_READ_FOR_SAVEVIDEO, PNULL, 0);
  1404.                        break;
  1405.              default:
  1406.                break;
  1407.           }
  1408.  SCI_TRACE_LOW("FNH before closewin");
  1409.          MMK_CloseWin(win_id);
  1410.          }
  1411.        
  1412.  }else
  1413. {
  1414.  SCI_TRACE_LOW("2005-2-15 COME HERE  else state = 1");
  1415.   switch(g_readforstate)
  1416.   {
  1417.        case MMS_MSG_SENTBOX_READ_FOR_PLAY:
  1418. MMK_PostMsg(MMIMMS_SENTBOX_LIST_WIN_ID,MSG_MMS_READ_FOR_PLAY, PNULL, 0); 
  1419.    break;
  1420.        case MMS_MSG_SENTBOX_READ_FOR_FW:
  1421. MMK_PostMsg(MMIMMS_SENTBOX_LIST_WIN_ID,MSG_MMS_READ_FOR_FW, PNULL, 0);   
  1422.    break;
  1423.        case MMS_MSG_DRAFTBOX_READ_FOR_EDIT:
  1424. MMK_PostMsg(MMIMMS_DRAFTBOX_LIST_WIN_ID,MSG_MMS_READ_FOR_EDIT, PNULL, 0);
  1425.          break;
  1426.        case MMS_MSG_OUTBOX_READ_FOR_EDIT:
  1427. MMK_PostMsg(MMIMMS_OUTBOX_LIST_WIN_ID,MSG_MMS_READ_FOR_EDIT, PNULL, 0);
  1428.    break;
  1429.        case MMS_MSG_OUTBOX_READ_FOR_PLAY:
  1430. MMK_PostMsg(MMIMMS_OUTBOX_LIST_WIN_ID,MSG_MMS_READ_FOR_PLAY, PNULL, 0); 
  1431.    break;
  1432.        case MMS_MSG_OUTBOX_READ_FOR_SEND:
  1433. MMK_PostMsg(MMIMMS_OUTBOX_LIST_WIN_ID,MSG_MMS_READ_FOR_SEND, PNULL, 0);
  1434.    break;
  1435. default:
  1436. break;
  1437.   }
  1438.   MMK_CloseWin(win_id);
  1439. }
  1440. //打开的接着的下一个状态不同,POST不同的消息.
  1441. break;
  1442. case MSG_MANAGERFILEWRITE_INBOX_OK:
  1443. SCI_TRACE_LOW("2005-2-15 READMMS MSG_MANAGERFILEWRITE_INBOX_OK");
  1444. efs_writeresult_ptr = (FFS_SAVEFILE_RESULT_T*)param;
  1445. SCI_TRACE_LOW("2005-2-15 READMMS efs_writeresult_ptr->write_result is  %d",efs_writeresult_ptr->write_result);
  1446. if(efs_writeresult_ptr->write_result == SAVEFS_WRITE_SUCCEED)
  1447. {
  1448. FFS_Close(g_filetype, efs_writeresult_ptr->hefs);
  1449. inboxfile_openstatus = FFS_INVALID_HANDLE;
  1450. mmsf_Remove((char*)"\cmsinbox.cnf");
  1451. switch(g_readforstate)
  1452.          {
  1453.               SCI_TRACE_LOW("2005-2-15 COME HERE");
  1454. SCI_TRACE_LOW("2005-2-15 g_readforstate  is %d",g_readforstate);
  1455.               case MMS_MSG_INBOX_READ_FOR_PLAY:
  1456.                       MMK_PostMsg(MMIMMS_INBOX_MMSOPT_MENU_WIN_ID,MSG_MMS_READ_FOR_PLAY, PNULL, 0);
  1457.                       break;
  1458.               case MMS_MSG_INBOX_READ_FOR_FW:
  1459.                       MMK_PostMsg(MMIMMS_INBOX_MMSOPT_MENU_WIN_ID,MSG_MMS_READ_FOR_FW, PNULL, 0);
  1460.                       break;
  1461.               case MMS_MSG_INBOX_READ_FOR_SAVEPIC:
  1462.                        MMK_PostMsg(MMIMMS_INBOX_MMSOPT_MENU_WIN_ID,MSG_MMS_READ_FOR_SAVEPIC, PNULL, 0);
  1463.                        break;
  1464.               case MMS_MSG_INBOX_READ_FOR_SAVESOUND:
  1465.                        MMK_PostMsg(MMIMMS_INBOX_MMSOPT_MENU_WIN_ID,MSG_MMS_READ_FOR_SAVESOUND, PNULL, 0);
  1466.                        break;
  1467.               case MMS_MSG_INBOX_READ_FOR_SAVEVIDEO:
  1468.                        MMK_PostMsg(MMIMMS_INBOX_MMSOPT_MENU_WIN_ID,MSG_MMS_READ_FOR_SAVEVIDEO, PNULL, 0);
  1469.                        break;
  1470.              default:
  1471.                break;
  1472.           }
  1473.          MMK_CloseWin(win_id);
  1474. }
  1475. break;
  1476. case MSG_MMS_READ_FAILED:
  1477.   PUBWIN_OpenPromptAlertWin(
  1478. PUBWIN_SOFTKEY_ONE, 
  1479. TXT_MMS_READ_FAILED,
  1480. IMAGE_PROMPT_ICON_FAIL,//IMAGE_PROMPT_ICON_OK, 
  1481. ALERT_TIMEOUT, 
  1482. PNULL
  1483. );
  1484. MMK_CloseWin(win_id);
  1485. break;
  1486. case MSG_APP_FLIP://modify 2006-5-12 fnh  翻盖不处理
  1487. MMIDEFAULT_HandleFlipKey(FALSE);
  1488. break;
  1489.  case MSG_APP_RED:
  1490. recode = MMI_RESULT_TRUE;
  1491. break;
  1492. case MSG_CLOSE_WINDOW:
  1493. recode = PUBWIN_HandleWaiting1MessageWinMsg( win_id, msg_id, param);
  1494. break;
  1495. default:
  1496. recode = PUBWIN_HandleWaiting1MessageWinMsg( win_id, msg_id, param);
  1497. break;
  1498. }
  1499.     return (recode);
  1500. }
  1501. /* ----------------------------------------------------------------------------
  1502. * Function Name: MMIMMS_HandleSaveMMSWaitingWin
  1503. * Purpose: 保存彩信时等待窗口消息处理函数
  1504. * Input: MMS_WINDOW_ID_E win_id, 
  1505.  MMI_MESSAGE_ID_E msg_id, 
  1506.  DPARAM param
  1507. * Returns: MMI_RESULT_E
  1508. * Author:nihongf@mobilesoft.com.cn
  1509. * ----------------------------------------------------------------------------*/ 
  1510. LOCAL MMI_RESULT_E  MMIMMS_HandleSaveMMSWaitingWin(
  1511.  MMS_WINDOW_ID_E win_id, 
  1512.  MMI_MESSAGE_ID_E msg_id, 
  1513.  DPARAM param
  1514.  )
  1515. {
  1516.     MMI_RESULT_E recode = MMI_RESULT_TRUE;
  1517. FFS_SAVEFILE_RESULT_T * efs_result_ptr;
  1518.     switch(msg_id)
  1519. {
  1520.    case MSG_FULL_PAINT:
  1521. //MMIMMS_CLEAR_CLIENT();
  1522. recode = PUBWIN_HandleWaiting1MessageWinMsg( win_id, msg_id, param);
  1523. break;
  1524.     case MSG_OPEN_WINDOW:
  1525. break;
  1526. case MSG_MMS_DELETEMANAGERFILE_OK:
  1527.   g_savemmsstate = MMS_MSG_SAVEMMS_FOR_NULL;
  1528. MMIMMS_StoreFolder(g_pManager->sentfolder);
  1529.        MMIMMS_SaveManagerSentboxFile();
  1530.       // MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVESENTBOXFILE, PNULL, PNULL);
  1531.        MMK_CloseWin(win_id);
  1532. PUBWIN_OpenPromptAlertWin(
  1533. PUBWIN_SOFTKEY_ONE, 
  1534. TXT_MMS_SEND_SUCCEED,
  1535. IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK, 
  1536. ALERT_TIMEOUT, 
  1537. PNULL
  1538. );
  1539.      MMIDEFAULT_SetBackLight(TRUE);
  1540.  break;
  1541. case MSG_MANAGERFILEWRITE_OUTBOX_FAILED:
  1542. MMK_CloseWin(win_id);
  1543. g_savemmsstate = MMS_MSG_SAVEMMS_FOR_NULL;
  1544. MMIMMS_StoreFolder(g_pManager->sentfolder);
  1545. MMIMMS_SaveManagerSentboxFile();
  1546. MMIDEFAULT_SetBackLight(TRUE);
  1547. break;
  1548.        case MSG_MANAGERFILEWRITE_OUTBOX_OK:
  1549. efs_result_ptr = (FFS_SAVEFILE_RESULT_T*)param;
  1550. if(efs_result_ptr->write_result == SAVEFS_WRITE_SUCCEED)
  1551. {
  1552. FFS_Close(g_filetype, efs_result_ptr->hefs);
  1553. mmsf_Remove((char*)"\cmsoutbox.cnf" );
  1554. }
  1555.              g_savemmsstate = MMS_MSG_SAVEMMS_FOR_NULL;
  1556. MMIMMS_StoreFolder(g_pManager->sentfolder);
  1557.        MMIMMS_SaveManagerSentboxFile();
  1558.       // MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVESENTBOXFILE, PNULL, PNULL);
  1559.        MMK_CloseWin(win_id);
  1560. PUBWIN_OpenPromptAlertWin(
  1561. PUBWIN_SOFTKEY_ONE, 
  1562. TXT_MMS_SEND_SUCCEED,
  1563. IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK, 
  1564. ALERT_TIMEOUT, 
  1565. PNULL
  1566. );
  1567.      MMIDEFAULT_SetBackLight(TRUE);
  1568. break;
  1569. case MSG_MMS_SAVE_FAILED:
  1570. SCI_TRACE_LOW("HERE THE MSG_ID IS MSG_MMS_SAVE_FAILED");
  1571. switch(g_savemmsstate)
  1572. {
  1573. case MMS_MSG_SAVEMMS_FOR_RECV:
  1574. SCI_TRACE_LOW("HERE TMMS_MSG_SAVEMMS_FOR_RECV------- ");
  1575. g_savemmsstate = MMS_MSG_SAVEMMS_FOR_NULL;
  1576. g_savestate = MMS_MSG_SAVEFILE_FOR_RECV;
  1577. if (g_pManager != NULL)
  1578. {
  1579. MMIMMS_DeleteManagerList(g_pManager->inboxfolder);
  1580. }
  1581. MMK_CloseWin(win_id);
  1582. PUBWIN_OpenPromptAlertWin(
  1583. PUBWIN_SOFTKEY_ONE, 
  1584. TXT_MMS_RECV_FAILED,
  1585. IMAGE_PROMPT_ICON_FAIL,//IMAGE_PROMPT_ICON_OK, 
  1586. ALERT_TIMEOUT, 
  1587. PNULL
  1588. );
  1589. MMICMSBRW_FreeGlobalBuffer(); //fnh add
  1590. break;
  1591. case  MMS_MSG_SAVEMMS_FOR_SEND_SUCCESS:
  1592. SCI_TRACE_LOW("HERE HANDLE MMS_MSG_SAVEMMS_FOR_SEND_SUCCESS ");
  1593. g_savemmsstate = MMS_MSG_SAVEMMS_FOR_NULL;
  1594. SCI_TRACE_LOW( "mmimms_wintable.c, MMIMMS_HandleSaveMMSWaitingWin(), MMS_MSG_SAVEMMS_FOR_SEND_SUCCESS, g_pManager = %X",g_pManager);
  1595. if ( PNULL != g_pManager )
  1596. {
  1597. MMIMMS_DeleteManagerList(g_pManager->sentfolder);
  1598. }
  1599. MMK_CloseWin(win_id);
  1600. PUBWIN_OpenPromptAlertWin(
  1601. PUBWIN_SOFTKEY_ONE, 
  1602. TXT_MMS_SEND_SUCCEED,
  1603. IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK, 
  1604. ALERT_TIMEOUT, 
  1605. PNULL
  1606. );
  1607. MMIDEFAULT_SetBackLight(TRUE);
  1608. break;
  1609.   case  MMS_MSG_SAVEMMS_FOR_SEND_FAILED:
  1610.   SCI_TRACE_LOW("HERE HANDLE MMS_MSG_SAVEMMS_FOR_SEND_FAILED ");
  1611.   g_savemmsstate = MMS_MSG_SAVEMMS_FOR_NULL;
  1612.   if (g_pManager != NULL)
  1613.   {
  1614.   MMIMMS_DeleteManagerList(g_pManager->outboxfolder);
  1615.   }
  1616.   MMK_CloseWin(win_id);
  1617. PUBWIN_OpenPromptAlertWin(
  1618. PUBWIN_SOFTKEY_ONE, 
  1619. TXT_MMS_SEND_FAILED,
  1620. IMAGE_PROMPT_ICON_FAIL, 
  1621. ALERT_TIMEOUT, 
  1622. PNULL
  1623. );
  1624. MMIDEFAULT_SetBackLight(TRUE);
  1625. break;
  1626.   case MMS_MSG_SAVEMMS_FOR_DRAFTSAVE:
  1627.   SCI_TRACE_LOW("HERE HANDLE MMS_MSG_SAVEMMS_FOR_DRAFTSAVE ");
  1628.   
  1629.   SCI_TRACE_LOW( "mmimms_wintable.c, MMIMMS_HandleSaveMMSWaitingWin(), g_pManager = %X",g_pManager);
  1630.   g_savemmsstate = MMS_MSG_SAVEMMS_FOR_NULL;
  1631.   
  1632.   if ( PNULL != g_pManager )
  1633.   {
  1634.   MMIMMS_DeleteManagerList(g_pManager->draftfolder);
  1635.   }
  1636.   MMK_CloseWin(win_id);
  1637.   
  1638.   PUBWIN_OpenPromptAlertWin(
  1639.   PUBWIN_SOFTKEY_ONE, 
  1640.   TXT_MMI_SAVEFAILED,
  1641.   IMAGE_PROMPT_ICON_FAIL,//IMAGE_PROMPT_ICON_OK, 
  1642.   ALERT_TIMEOUT, 
  1643.   PNULL
  1644.   );
  1645.   
  1646.   MMIDEFAULT_SetBackLight(TRUE);
  1647.   SCI_TRACE_LOW( "mmimms_wintable.c, MMIMMS_HandleSaveMMSWaitingWin(), g_pManager = %X",g_pManager);
  1648.   break;
  1649.   
  1650.   default:
  1651.   SCI_TRACE_LOW("HERE HANDLE default ");
  1652.   MMK_CloseWin(win_id);
  1653.   PUBWIN_OpenPromptAlertWin(
  1654.   PUBWIN_SOFTKEY_ONE, 
  1655.   TXT_MMI_SAVEFAILED,
  1656.   IMAGE_PROMPT_ICON_FAIL,//IMAGE_PROMPT_ICON_OK, 
  1657.   ALERT_TIMEOUT, 
  1658.   PNULL
  1659.   );
  1660.   MMIDEFAULT_SetBackLight(TRUE);
  1661.   break;
  1662. }
  1663. break;
  1664. case MSG_MMS_SAVE_OK:
  1665. SCI_TRACE_LOW("HERE THE MSG_ID IS MSG_MMS_SAVE_OK------- ");
  1666. efs_result_ptr = (FFS_SAVEFILE_RESULT_T*)param;
  1667. if(efs_result_ptr->write_result == SAVEFS_WRITE_SUCCEED)
  1668. {
  1669. FFS_Close(g_filetype, efs_result_ptr->hefs);
  1670. mmsf_Remove((char *)g_filename);
  1671. }
  1672. //MMIMMS_StoreMangerDocument();
  1673. switch(g_savemmsstate)
  1674. {
  1675. case MMS_MSG_SAVEMMS_FOR_RECV:
  1676. SCI_TRACE_LOW("HERE TMMS_MSG_SAVEMMS_FOR_RECV------- ");
  1677.   g_savemmsstate = MMS_MSG_SAVEMMS_FOR_NULL;
  1678.   g_savestate = MMS_MSG_SAVEFILE_FOR_RECV;
  1679.   
  1680.                 MMIMMS_StoreFolder(g_pManager->inboxfolder);
  1681.   
  1682.                 MMIMMS_SaveManagerInboxFile(MMS_SAVE_INBOX);
  1683.                 //MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVEINBOXFILE, PNULL, PNULL);
  1684.   MMK_CloseWin(win_id);
  1685.                 PUBWIN_OpenPromptAlertWin(
  1686. PUBWIN_SOFTKEY_ONE, 
  1687. TXT_MMS_RECV_SUCCES,
  1688. IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK, 
  1689. ALERT_TIMEOUT, 
  1690. PNULL
  1691. );
  1692. MMICMSBRW_FreeGlobalBuffer();
  1693.   break;
  1694. case  MMS_MSG_SAVEMMS_FOR_SEND_SUCCESS:
  1695. SCI_TRACE_LOW("HERE HANDLE MMS_MSG_SAVEMMS_FOR_SEND_SUCCESS ");
  1696. g_savemmsstate = MMS_MSG_SAVEMMS_FOR_NULL;
  1697.          SCI_TRACE_LOW( "mmimms_wintable.c, MMIMMS_HandleSaveMMSWaitingWin(), MMS_MSG_SAVEMMS_FOR_SEND_SUCCESS, g_pManager = %X",g_pManager);
  1698. if ( PNULL != g_pManager )
  1699. {
  1700.   MMIMMS_StoreFolder(g_pManager->sentfolder);
  1701.                        MMIMMS_SaveManagerSentboxFile();
  1702.                         // MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVESENTBOXFILE, PNULL, PNULL);
  1703.   MMK_CloseWin(win_id);
  1704.                 PUBWIN_OpenPromptAlertWin(
  1705. PUBWIN_SOFTKEY_ONE, 
  1706. TXT_MMS_SEND_SUCCEED,
  1707. IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK, 
  1708. ALERT_TIMEOUT, 
  1709. PNULL
  1710. );
  1711. MMIDEFAULT_SetBackLight(TRUE);
  1712. }
  1713. else
  1714. {
  1715. SCI_ASSERT(0);
  1716. }
  1717. break;
  1718.       case  MMS_MSG_SAVEMMS_FOR_SEND_FAILED:
  1719. SCI_TRACE_LOW("HERE HANDLE MMS_MSG_SAVEMMS_FOR_SEND_FAILED ");
  1720.  g_savemmsstate = MMS_MSG_SAVEMMS_FOR_NULL;
  1721.   MMIMMS_StoreFolder(g_pManager->outboxfolder);
  1722.                        MMIMMS_SaveManagerOutboxFile();
  1723.                        //MMK_PostMsg(VIRTUAL_WIN_ID, MSG_MMS_TOSAVEOUTBOXFILE, PNULL, PNULL);
  1724.   MMK_CloseWin(win_id);
  1725.                 PUBWIN_OpenPromptAlertWin(
  1726. PUBWIN_SOFTKEY_ONE, 
  1727. TXT_MMS_SEND_FAILED,
  1728. IMAGE_PROMPT_ICON_FAIL, 
  1729. ALERT_TIMEOUT, 
  1730. PNULL
  1731. );
  1732. MMIDEFAULT_SetBackLight(TRUE);
  1733.   break;
  1734.   
  1735. case MMS_MSG_SAVEMMS_FOR_DRAFTSAVE:
  1736. SCI_TRACE_LOW("HERE HANDLE MMS_MSG_SAVEMMS_FOR_DRAFTSAVE ");
  1737. SCI_TRACE_LOW( "mmimms_wintable.c, MMIMMS_HandleSaveMMSWaitingWin(), g_pManager = %X",g_pManager);
  1738. g_savemmsstate = MMS_MSG_SAVEMMS_FOR_NULL;
  1739. if ( PNULL != g_pManager )
  1740. {
  1741. MMIMMS_StoreFolder(g_pManager->draftfolder);
  1742. MMIMMS_SaveManagerDraftboxFile();
  1743.                     MMK_CloseWin(win_id);
  1744.             
  1745. PUBWIN_OpenPromptAlertWin(
  1746. PUBWIN_SOFTKEY_ONE, 
  1747. TXT_MMI_SAVESUCC,
  1748. IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK, 
  1749. ALERT_TIMEOUT, 
  1750. PNULL
  1751. );
  1752. MMIDEFAULT_SetBackLight(TRUE);
  1753. }
  1754. else
  1755. {
  1756. SCI_ASSERT(0);
  1757. }
  1758. SCI_TRACE_LOW( "mmimms_wintable.c, MMIMMS_HandleSaveMMSWaitingWin(), g_pManager = %X",g_pManager);
  1759. break;
  1760. default:
  1761. SCI_TRACE_LOW("HERE HANDLE default ");
  1762. MMK_CloseWin(win_id);
  1763.               PUBWIN_OpenPromptAlertWin(
  1764. PUBWIN_SOFTKEY_ONE, 
  1765. TXT_MMI_SAVESUCC,
  1766. IMAGE_PROMPT_ICON_SUCCESS,//IMAGE_PROMPT_ICON_OK, 
  1767. ALERT_TIMEOUT, 
  1768. PNULL
  1769. );
  1770.  MMIDEFAULT_SetBackLight(TRUE);
  1771. break;
  1772. }
  1773. break;
  1774. case MSG_MMS_SAVE_AUTO_SIGN_OK:
  1775. {
  1776. SCI_TRACE_LOW("in MSG_MMS_SAVE_AUTO_SIGN_OK");
  1777. efs_result_ptr = (FFS_SAVEFILE_RESULT_T*)param;
  1778. if (MMK_IsOpenWin(MAIN_PROMPTALERT_WIN_ID)) //46351
  1779. {
  1780. MMK_CloseWin(MAIN_PROMPTALERT_WIN_ID);
  1781. }
  1782. SCI_TRACE_LOW("fnh write_result = %d",efs_result_ptr->write_result);
  1783. if(efs_result_ptr->write_result == SAVEFS_WRITE_SUCCEED)
  1784. {
  1785. FFS_Close(g_filetype, efs_result_ptr->hefs);
  1786. SCI_TRACE_LOW("size u  is %d",efs_result_ptr->buf_size);
  1787. SCI_TRACE_LOW("buffer ptr is %d",efs_result_ptr->buf_ptr);
  1788. if(efs_result_ptr->buf_ptr != PNULL)
  1789. {
  1790. cms_free(efs_result_ptr->buf_ptr);
  1791. efs_result_ptr->buf_ptr = PNULL;
  1792. }
  1793. PUBWIN_OpenPromptAlertWin(
  1794. PUBWIN_SOFTKEY_ONE,
  1795. TXT_SUCCESS,
  1796. IMAGE_PROMPT_ICON_SUCCESS,
  1797. MMI_3SECONDS,
  1798. PNULL);
  1799. }else
  1800. {
  1801. FFS_Close(g_filetype, efs_result_ptr->hefs);
  1802. PUBWIN_OpenPromptAlertWin(
  1803. PUBWIN_SOFTKEY_ONE,
  1804. TXT_ERROR,
  1805. IMAGE_PROMPT_ICON_SUCCESS,
  1806. MMI_3SECONDS,
  1807. PNULL);
  1808. }
  1809. MMK_CloseWin(win_id);
  1810. }
  1811. break;
  1812. case MSG_MMS_SAVE_AUTO_SIGN_FAILED:
  1813. MMK_CloseWin(win_id);
  1814. PUBWIN_OpenPromptAlertWin(
  1815. PUBWIN_SOFTKEY_ONE,
  1816. TXT_ERROR,
  1817. IMAGE_PROMPT_ICON_SUCCESS,
  1818. MMI_3SECONDS,
  1819. PNULL);
  1820. break;
  1821. case MSG_APP_FLIP://modify 2006-5-12 fnh  翻盖不处理
  1822. MMIDEFAULT_HandleFlipKey(FALSE);
  1823. break;
  1824. case MSG_APP_RED:
  1825. recode = MMI_RESULT_TRUE;
  1826. break;
  1827. case MSG_CLOSE_WINDOW:
  1828. SCI_TRACE_LOW("FNH CLOSE MMIMMS_HandleSaveMMSWaitingWin");
  1829. g_netusing = MMS_MSG_NETUSING_NULL;
  1830. recode = PUBWIN_HandleWaiting1MessageWinMsg( win_id, msg_id, param);
  1831. break;
  1832. default:
  1833. recode = PUBWIN_HandleWaiting1MessageWinMsg( win_id, msg_id, param);
  1834. break;
  1835. }
  1836.     return (recode);
  1837. }
  1838. /******************************************************************************
  1839.  * 函数定义: cmsmms_HandlesavemusicWinMsg
  1840.  * 函数说明: 保存彩信内容中的音乐
  1841.  * 参数说明: win_id:窗口id
  1842. msg_id:消息id
  1843. param:窗口参数
  1844.  * 返回值: 空
  1845. ********************************************************************************/
  1846. LOCAL MMI_RESULT_E  cmsmms_HandlesavemusicWinMsg(
  1847. MMS_WINDOW_ID_E win_id, 
  1848. MMI_MESSAGE_ID_E msg_id, 
  1849. DPARAM param
  1850. )
  1851. {
  1852.     MMI_RESULT_E err_code = MMI_RESULT_TRUE;
  1853. static P_MMS_FOLDER_SAVE_PARAM p_folder_save_param = NULL;  /* 编辑器入口参数 */
  1854. static pMMS_EDocument p_edoc = NULL;
  1855. static pMMS_Slide p_mms_slide_temp = NULL;
  1856. uint8 *buf_ptr = PNULL;
  1857. static uint16 selindex ;
  1858. MMS_CONTROL_ID_E list_ctrl_id = MMIMMS_SAVE_MUSIC_LIST_CTRL_ID;
  1859.     switch(msg_id)
  1860.     {
  1861.     case MSG_FULL_PAINT:
  1862. MMK_SetWinSoftkeyId(win_id,STXT_OK,COMMON_TXT_NULL,STXT_RETURN,TRUE);
  1863. MMIMMS_CLEAR_CLIENT();
  1864. break;
  1865. case MSG_OPEN_WINDOW:
  1866. {
  1867. MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
  1868. GUILISTBOX_SetMaxItem(list_ctrl_id, MMIMMS_GSEND_LIST_MAX_ITEM);
  1869. selindex =0;
  1870. MMK_SetAtvCtrl(win_id, list_ctrl_id);
  1871. p_folder_save_param = (P_MMS_FOLDER_SAVE_PARAM)MMK_GetWinAddDataPtr( win_id);
  1872. {
  1873. p_edoc = p_folder_save_param->p_edit_doc;
  1874. MMS_HeadSlide(p_edoc);
  1875. while(p_edoc->slide_cur)
  1876. {
  1877. p_mms_slide_temp = p_edoc->slide_cur;
  1878. if (p_mms_slide_temp->audio_type != 0)
  1879. {
  1880. buf_ptr = (uint8 *)p_mms_slide_temp->audiofile ;
  1881. AppendListItem(buf_ptr,
  1882. strlen((char *)buf_ptr),
  1883. FALSE,
  1884. list_ctrl_id,
  1885. STXT_OK);
  1886. }
  1887. p_edoc->slide_cur = p_edoc->slide_cur->next;
  1888. }
  1889. }
  1890. }
  1891.          break;
  1892.  
  1893. case MSG_APP_OK:
  1894.     case MSG_CTL_OK:
  1895. {
  1896. uint16 curindex = 0;
  1897. BOOLEAN b_finded = FALSE;
  1898. T_Composer_Audio Audio;
  1899. MMIMULTIM_MUSIC_TYPE_E audio_type = 0;
  1900. selindex=GUILISTBOX_GetCurItemIndex(list_ctrl_id);
  1901. p_edoc = p_folder_save_param->p_edit_doc;
  1902. MMS_HeadSlide(p_edoc);
  1903. while(p_edoc->slide_cur && !b_finded)
  1904. {
  1905. p_mms_slide_temp = p_edoc->slide_cur;
  1906. if (p_mms_slide_temp->audio_type != 0)
  1907. {
  1908. curindex ++;
  1909. if ((curindex-1) == selindex)
  1910. {
  1911. SCI_MEMSET(&Audio,0,sizeof(T_Composer_Audio));
  1912. MMIMMS_GetCurSlideAudio(&Audio,p_edoc);
  1913. if (strcmp(Audio.Type,"audio/wav") == 0)
  1914. {
  1915. audio_type = MMIMULTIM_TYPE_WAV;
  1916. }
  1917. if (strcmp(Audio.Type,"audio/midi") == 0)
  1918. {
  1919. audio_type = MMIMULTIM_TYPE_MIDI;
  1920. }
  1921. #ifdef HAVE_MP3
  1922. if (strcmp(Audio.Type,"audio/mp3") == 0)
  1923. {
  1924. audio_type = MMIMULTIM_TYPE_MP3;
  1925. }
  1926. #endif
  1927. #ifdef HAVE_AMR
  1928. if (strcmp(Audio.Type, "audio/amr") == 0)
  1929. {
  1930. audio_type = MMIMULTIM_TYPE_AMR;
  1931. }
  1932. #endif
  1933. b_finded = TRUE;
  1934. break;
  1935. }
  1936. }
  1937. p_edoc->slide_cur = p_edoc->slide_cur->next;
  1938. }
  1939. if (b_finded)
  1940. {
  1941. SCI_TRACE_LOW("audio was finded ");
  1942. if (audio_type == MMIMULTIM_TYPE_MP3)
  1943. {
  1944. #ifdef HAVE_MP3
  1945. audio_type = MMS_TYPE_MP3;
  1946. MMIMMS_SaveDownloadmp3(Audio.AudBuf,Audio.size,audio_type, PNULL);
  1947. #endif
  1948. }
  1949. else
  1950. {
  1951. MMIMULTIM_SaveDownloadRing(Audio.AudBuf,Audio.size,audio_type,PNULL);
  1952. }
  1953. }
  1954. else
  1955. {
  1956. SCI_TRACE_LOW("warning:audio was not finded");
  1957. }
  1958. // MMK_CloseWin(win_id);
  1959. }
  1960. break;
  1961. case MSG_GET_FOCUS:
  1962. {
  1963. GUILISTBOX_SetMaxItem(list_ctrl_id, MMIMMS_GSEND_LIST_MAX_ITEM);
  1964. p_folder_save_param = (P_MMS_FOLDER_SAVE_PARAM)MMK_GetWinAddDataPtr( win_id);
  1965. {
  1966. p_edoc = p_folder_save_param->p_edit_doc;
  1967. MMS_HeadSlide(p_edoc);
  1968. while(p_edoc->slide_cur)
  1969. {
  1970. p_mms_slide_temp = p_edoc->slide_cur;
  1971. if (p_mms_slide_temp->audio_type != 0)
  1972. {
  1973. buf_ptr = (uint8 *)p_mms_slide_temp->audiofile ;
  1974. AppendListItem(buf_ptr,
  1975. strlen((char *)buf_ptr),
  1976. FALSE,
  1977. list_ctrl_id,
  1978. STXT_OK);
  1979. }
  1980. p_edoc->slide_cur = p_edoc->slide_cur->next;
  1981. }
  1982. }
  1983. SCI_TRACE_LOW("FNH save music MSG_GET_FOCUS selindex = %d",selindex);
  1984. GUILISTBOX_SetCurItemIndex(list_ctrl_id,selindex);
  1985. MMK_SetAtvCtrl(win_id, list_ctrl_id);
  1986. }
  1987. break;
  1988. case MSG_APP_CANCEL:
  1989. case MSG_CTL_CANCEL:
  1990. MMK_CloseWin(win_id);       
  1991. break;
  1992. case MSG_CLOSE_WINDOW: /* 处理关闭窗口消息 */
  1993. if (p_edoc)
  1994. {
  1995. SCI_TRACE_LOW("FNH before free MMS!");
  1996. MMSDelDocument(p_edoc);
  1997. SCI_TRACE_LOW("FNH after free MMS!");
  1998. p_edoc = NULL;
  1999. }
  2000. if (p_folder_save_param)
  2001. {
  2002. SCI_TRACE_LOW("FNH before free p_folder_save_param");
  2003. cms_free(p_folder_save_param);
  2004. SCI_TRACE_LOW("FNH after  free p_folder_save_param");
  2005. p_folder_save_param = NULL;
  2006. }
  2007. break;
  2008.         
  2009. default:
  2010. err_code = MMI_RESULT_FALSE;
  2011. break;
  2012.         }
  2013.        
  2014. return err_code;
  2015. }
  2016. /* ----------------------------------------------------------------------------
  2017. * Function Name: cmsmms_HandlesaveimageWinMsg
  2018. * Purpose: 保存彩信内容中的图象
  2019. * Input: win_id:窗口ID,
  2020.  msg_Id:消息ID,
  2021.  param:窗口参数
  2022. * Returns: MMI_RESULT_E
  2023. * Author:nihongf@mobilesoft.com.cn
  2024. * ----------------------------------------------------------------------------*/ 
  2025. LOCAL MMI_RESULT_E  cmsmms_HandlesaveimageWinMsg(
  2026. MMS_WINDOW_ID_E win_id, 
  2027. MMI_MESSAGE_ID_E msg_id, 
  2028. DPARAM param
  2029. )
  2030. {
  2031.     MMI_RESULT_E err_code = MMI_RESULT_TRUE;
  2032. static P_MMS_FOLDER_SAVE_PARAM p_folder_save_param = NULL;  /* 编辑器入口参数 */
  2033. static pMMS_EDocument p_edoc = NULL;
  2034. static pMMS_Slide p_mms_slide_temp = NULL;
  2035. uint8 *buf_ptr = PNULL;
  2036. static uint16 selindex ;
  2037. MMS_CONTROL_ID_E list_ctrl_id = MMIMMS_SAVE_IMAGE_LIST_CTRL_ID;
  2038.     switch(msg_id)
  2039.     {
  2040.     case MSG_FULL_PAINT:
  2041. MMK_SetWinSoftkeyId(win_id,STXT_OK,COMMON_TXT_NULL,STXT_RETURN,TRUE);
  2042. MMIMMS_CLEAR_CLIENT();
  2043. break;
  2044. case MSG_OPEN_WINDOW:
  2045. {
  2046. SCI_TRACE_LOW("FNH in save image open window");
  2047. selindex = 0;
  2048. GUILISTBOX_SetMaxItem(list_ctrl_id, MMIMMS_GSEND_LIST_MAX_ITEM);
  2049. MMK_SetAtvCtrl(win_id, list_ctrl_id);
  2050. SCI_TRACE_LOW("FNH before get winadddata");
  2051. p_folder_save_param = (P_MMS_FOLDER_SAVE_PARAM)MMK_GetWinAddDataPtr( win_id);
  2052. SCI_TRACE_LOW("FNH after get winadddata");
  2053. {
  2054. pMMS_Content p_content_temp;
  2055. p_edoc = p_folder_save_param->p_edit_doc;
  2056. SCI_TRACE_LOW("FNH p_edoc = %d",p_edoc);
  2057. MMS_HeadSlide(p_edoc);
  2058. while(p_edoc->slide_cur)
  2059. {
  2060. p_mms_slide_temp = p_edoc->slide_cur;
  2061. SCI_TRACE_LOW("FNH p_mms_slide_temp = %d",p_mms_slide_temp);
  2062. SCI_TRACE_LOW("FNH p_mms_slide_temp->image_flag = %d",p_mms_slide_temp->image_flag);
  2063. if (p_mms_slide_temp->image_flag == 1)
  2064. {
  2065. p_content_temp = p_mms_slide_temp->content_root;
  2066. SCI_TRACE_LOW("FNH p_content_temp = %d",p_content_temp);
  2067. while(p_content_temp)
  2068. {
  2069. SCI_TRACE_LOW("FNH p_content_temp->type = %d",p_content_temp->type);
  2070. if (CmsIsSupportType(p_content_temp->type))
  2071. {
  2072. buf_ptr = (uint8 *)p_content_temp->filename;
  2073. SCI_TRACE_LOW("FNH buf_ptr = %s",buf_ptr);
  2074. AppendListItem(buf_ptr,
  2075. strlen((char *)buf_ptr),
  2076. FALSE,
  2077. list_ctrl_id,
  2078. STXT_OK);
  2079. break;
  2080. }
  2081. p_content_temp = p_content_temp->next;
  2082. }
  2083. }
  2084. p_edoc->slide_cur = p_edoc->slide_cur->next;
  2085. }
  2086. }
  2087. }
  2088.          break;
  2089. case MSG_GET_FOCUS:
  2090. {
  2091. SCI_TRACE_LOW("FNH in save image open window");
  2092. GUILISTBOX_SetMaxItem(list_ctrl_id, MMIMMS_GSEND_LIST_MAX_ITEM);
  2093. SCI_TRACE_LOW("FNH before get winadddata");
  2094. p_folder_save_param = (P_MMS_FOLDER_SAVE_PARAM)MMK_GetWinAddDataPtr( win_id);
  2095. SCI_TRACE_LOW("FNH after get winadddata");
  2096. {
  2097. pMMS_Content p_content_temp;
  2098. p_edoc = p_folder_save_param->p_edit_doc;
  2099. SCI_TRACE_LOW("FNH p_edoc = %d",p_edoc);
  2100. MMS_HeadSlide(p_edoc);
  2101. while(p_edoc->slide_cur)
  2102. {
  2103. p_mms_slide_temp = p_edoc->slide_cur;
  2104. SCI_TRACE_LOW("FNH p_mms_slide_temp = %d",p_mms_slide_temp);
  2105. SCI_TRACE_LOW("FNH p_mms_slide_temp->image_flag = %d",p_mms_slide_temp->image_flag);
  2106. if (p_mms_slide_temp->image_flag == 1)
  2107. {
  2108. p_content_temp = p_mms_slide_temp->content_root;
  2109. SCI_TRACE_LOW("FNH p_content_temp = %d",p_content_temp);
  2110. while(p_content_temp)
  2111. {
  2112. SCI_TRACE_LOW("FNH p_content_temp->type = %d",p_content_temp->type);
  2113. if (CmsIsSupportType(p_content_temp->type))
  2114. {
  2115. buf_ptr = (uint8 *)p_content_temp->filename;
  2116. SCI_TRACE_LOW("FNH buf_ptr = %s",buf_ptr);
  2117. AppendListItem(buf_ptr,
  2118. strlen((char *)buf_ptr),
  2119. FALSE,
  2120. list_ctrl_id,
  2121. STXT_OK);
  2122. break;
  2123. }
  2124. p_content_temp = p_content_temp->next;
  2125. }
  2126. }
  2127. p_edoc->slide_cur = p_edoc->slide_cur->next;
  2128. }
  2129. }
  2130. SCI_TRACE_LOW("FNH save image MSG_GET_FOCUS selindex = %d",selindex);
  2131. GUILISTBOX_SetCurItemIndex(list_ctrl_id,selindex);
  2132. MMK_SetAtvCtrl(win_id, list_ctrl_id);
  2133. }
  2134.  
  2135. break;
  2136. case MSG_APP_OK:
  2137.     case MSG_CTL_OK:
  2138. {
  2139. uint16 curindex = 0;
  2140. pMMS_Content p_content_temp;
  2141. BOOLEAN  b_finded = FALSE;
  2142. T_Composer_Image  Image;
  2143. ANIMATE_IMAGE_TYPE_E image_type = 0;
  2144. selindex=GUILISTBOX_GetCurItemIndex(list_ctrl_id);
  2145. SCI_TRACE_LOW("FNH MSG_CTL_OK selindex = %d",selindex);
  2146. p_edoc = p_folder_save_param->p_edit_doc;
  2147. MMS_HeadSlide(p_edoc);
  2148. while( p_edoc->slide_cur && !b_finded )
  2149. {
  2150. p_mms_slide_temp = p_edoc->slide_cur;
  2151. if (p_mms_slide_temp->image_flag == 1)
  2152. {
  2153. p_content_temp = p_mms_slide_temp->content_root;
  2154. SCI_TRACE_LOW("FNH p_content_temp = %d",p_content_temp);
  2155. while(p_content_temp)
  2156. {
  2157. if (CmsIsSupportType(p_content_temp->type))
  2158. {
  2159. SCI_TRACE_LOW("FNH p_content_temp->type = %d",p_content_temp->type);
  2160. curindex ++;
  2161. SCI_TRACE_LOW("fnh curindex = %d",curindex);
  2162. if (curindex == (selindex+1))
  2163. {
  2164. SCI_MEMSET(&Image ,0, sizeof(T_Composer_Image));
  2165. if (MMIMMS_GetCurSlideImage(&Image,p_edoc)!= -1)
  2166. {
  2167. SCI_TRACE_LOW("FNH Image.type = %s",Image.Type);
  2168. if(strcmp(Image.Type,"image/gif") == 0)
  2169. image_type = ANIM_GIF;
  2170. else if(strcmp(Image.Type,"image/vnd.wap.wbmp") == 0)
  2171. image_type = ANIM_WBMP;
  2172. else if(strcmp(Image.Type,"image/jpeg") == 0)
  2173. image_type = ANIM_JPG;
  2174. else if (strcmp(Image.Type,"image/png") == 0)
  2175. image_type = ANIM_PNG;
  2176. else if (strcmp(Image.Type,"image/bmp") == 0)
  2177. image_type = ANIM_BMP;
  2178. SCI_TRACE_LOW("FNH Image.ImgBuf = %s",Image.ImgBuf);
  2179. SCI_TRACE_LOW("FNH Image.size = %d",Image.size);
  2180. SCI_TRACE_LOW("FNH image_type = %d",image_type);
  2181. b_finded = TRUE;
  2182. break;
  2183. }
  2184. }
  2185. }
  2186. p_content_temp = p_content_temp->next;
  2187. }
  2188. }
  2189. p_edoc->slide_cur = p_edoc->slide_cur->next;
  2190. }
  2191. if( b_finded )
  2192. {
  2193. SCI_TRACE_LOW("the image was findedn");
  2194. MMIMULTIM_SaveDownloadPic(Image.ImgBuf,Image.size,image_type,PNULL);
  2195. }
  2196. else
  2197. {
  2198. SCI_TRACE_LOW("warning the image was not findedn");
  2199. }
  2200. // MMK_CloseWin(win_id);
  2201. }
  2202. break;
  2203. case MSG_APP_CANCEL:
  2204. case MSG_CTL_CANCEL:
  2205. MMK_CloseWin(win_id);       
  2206. break;
  2207. case MSG_CLOSE_WINDOW: /* 处理关闭窗口消息 */
  2208. if (p_edoc)
  2209. {
  2210. SCI_TRACE_LOW("FNH before free MMS!");
  2211. MMSDelDocument(p_edoc);
  2212. SCI_TRACE_LOW("FNH after free MMS!");
  2213. p_edoc = NULL;
  2214. }
  2215. if (p_folder_save_param)
  2216. {
  2217. SCI_TRACE_LOW("FNH before free p_folder_save_param");
  2218. cms_free(p_folder_save_param);
  2219. SCI_TRACE_LOW("FNH after  free p_folder_save_param");
  2220. p_folder_save_param = NULL;
  2221. }
  2222. break;
  2223.         
  2224. default:
  2225. err_code = MMI_RESULT_FALSE;
  2226. break;
  2227.         }
  2228.        
  2229. return err_code;
  2230. }
  2231. /* ----------------------------------------------------------------------------
  2232. * Function Name: cmsmms_HandlesavevideoWinMsg
  2233. * Purpose: 保存彩信内容中的视频
  2234. * Input: win_id:窗口ID,
  2235.  msg_Id:消息ID,
  2236.  param:窗口参数
  2237. * Returns: MMI_RESULT_E
  2238. * Author:nihongf@mobilesoft.com.cn
  2239. * ----------------------------------------------------------------------------*/ 
  2240. LOCAL MMI_RESULT_E  cmsmms_HandlesavevideoWinMsg(
  2241. MMS_WINDOW_ID_E win_id, 
  2242. MMI_MESSAGE_ID_E msg_id, 
  2243. DPARAM param
  2244. )
  2245. {
  2246.     MMI_RESULT_E err_code = MMI_RESULT_TRUE;
  2247. static P_MMS_FOLDER_SAVE_PARAM p_folder_save_param = NULL;  /* 编辑器入口参数 */
  2248. static pMMS_EDocument p_edoc = NULL;
  2249. static pMMS_Slide p_mms_slide_temp = NULL;
  2250. uint8 *buf_ptr = PNULL;
  2251. static uint16 selindex;
  2252. MMS_CONTROL_ID_E list_ctrl_id = MMIMMS_SAVE_VIDEO_LIST_CTRL_ID;
  2253.     switch(msg_id)
  2254.     {
  2255.     case MSG_FULL_PAINT:
  2256. MMK_SetWinSoftkeyId(win_id,STXT_OK,COMMON_TXT_NULL,STXT_RETURN,TRUE);
  2257. MMIMMS_CLEAR_CLIENT();
  2258. break;
  2259. case MSG_OPEN_WINDOW:
  2260. {
  2261. MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
  2262. GUILISTBOX_SetMaxItem(list_ctrl_id, MMIMMS_GSEND_LIST_MAX_ITEM);
  2263. selindex = 0;
  2264. MMK_SetAtvCtrl(win_id, list_ctrl_id);
  2265. p_folder_save_param = (P_MMS_FOLDER_SAVE_PARAM)MMK_GetWinAddDataPtr( win_id);
  2266. {
  2267. pMMS_Content p_content_temp;
  2268. p_edoc = p_folder_save_param->p_edit_doc;
  2269. MMS_HeadSlide(p_edoc);
  2270. while(p_edoc->slide_cur)
  2271. {
  2272. p_mms_slide_temp = p_edoc->slide_cur;
  2273. if (p_mms_slide_temp->video_flag == 1)
  2274. {
  2275. p_content_temp = p_mms_slide_temp->content_root;
  2276. while(p_content_temp)
  2277. {
  2278. if (p_content_temp->type ==  MMS_TYPE_MP4 || 
  2279. p_content_temp->type == MMS_TYPE_3GP  )
  2280. {
  2281. buf_ptr = (uint8 *)p_content_temp->filename;
  2282. AppendListItem(buf_ptr,
  2283. strlen((char *)buf_ptr),
  2284. FALSE,
  2285. list_ctrl_id,
  2286. STXT_OK);
  2287. break;
  2288. }
  2289. p_content_temp = p_content_temp->next;
  2290. }
  2291. }
  2292. p_edoc->slide_cur = p_edoc->slide_cur->next;
  2293. }
  2294. }
  2295. }
  2296.           break;
  2297. case MSG_APP_OK:
  2298.     case MSG_CTL_OK:
  2299. {
  2300. uint16 curindex = 0;
  2301. pMMS_Content p_content_temp;
  2302. BOOLEAN b_finded = FALSE;
  2303. T_Composer_Video Video;
  2304. uint32 video_type = 0;
  2305. selindex=GUILISTBOX_GetCurItemIndex(list_ctrl_id);
  2306. p_edoc = p_folder_save_param->p_edit_doc;
  2307. MMS_HeadSlide(p_edoc);
  2308. while(p_edoc->slide_cur && !b_finded)
  2309. {
  2310. p_mms_slide_temp = p_edoc->slide_cur;
  2311. if (p_mms_slide_temp->video_flag == 1)
  2312. {
  2313. p_content_temp = p_mms_slide_temp->content_root;
  2314. while(p_content_temp)
  2315. {
  2316. if (p_content_temp->type ==  MMS_TYPE_MP4 || 
  2317. p_content_temp->type == MMS_TYPE_3GP  )
  2318. {
  2319. curindex ++;
  2320. if (curindex == (selindex+1))
  2321. {
  2322. SCI_MEMSET(&Video ,0, sizeof(T_Composer_Video));
  2323. MMIMMS_GetCurSlideVideo(&Video,p_edoc);
  2324. if(Video.Type == MPEG4_MP4_FILE) 
  2325. {
  2326. video_type = MMS_TYPE_MP4;
  2327. }
  2328. if(Video.Type == MPEG4_3GP_FILE)
  2329. {
  2330. video_type = MMS_TYPE_3GP;
  2331. }
  2332. b_finded = TRUE;
  2333. break;
  2334. }
  2335. }
  2336. p_content_temp = p_content_temp->next;
  2337. }
  2338. }
  2339. p_edoc->slide_cur = p_edoc->slide_cur->next;
  2340. }
  2341. if (b_finded)
  2342. {
  2343. SCI_TRACE_LOW("video is find");
  2344. MMIMMS_SaveDownloadVideo(Video.VidBuf ,Video.size ,video_type, PNULL);
  2345. }
  2346. else
  2347.                     {
  2348.                         SCI_TRACE_LOW("warning is not find");
  2349.                     }         
  2350. }
  2351. break;
  2352. case MSG_GET_FOCUS:
  2353. {
  2354. GUILISTBOX_SetMaxItem(list_ctrl_id, MMIMMS_GSEND_LIST_MAX_ITEM);
  2355. p_folder_save_param = (P_MMS_FOLDER_SAVE_PARAM)MMK_GetWinAddDataPtr( win_id);
  2356. {
  2357. pMMS_Content p_content_temp;
  2358. p_edoc = p_folder_save_param->p_edit_doc;
  2359. MMS_HeadSlide(p_edoc);
  2360. while(p_edoc->slide_cur)
  2361. {
  2362. p_mms_slide_temp = p_edoc->slide_cur;
  2363. if (p_mms_slide_temp->video_flag == 1)
  2364. {
  2365. p_content_temp = p_mms_slide_temp->content_root;
  2366. while(p_content_temp)
  2367. {
  2368. if (p_content_temp->type ==  MMS_TYPE_MP4 || 
  2369. p_content_temp->type == MMS_TYPE_3GP  )
  2370. {
  2371. buf_ptr = (uint8 *)p_content_temp->filename;
  2372. AppendListItem(buf_ptr,
  2373. strlen((char *)buf_ptr),
  2374. FALSE,
  2375. list_ctrl_id,
  2376. STXT_OK);
  2377. break;
  2378. }
  2379. p_content_temp = p_content_temp->next;
  2380. }
  2381. }
  2382. p_edoc->slide_cur = p_edoc->slide_cur->next;
  2383. }
  2384. }
  2385. SCI_TRACE_LOW("FNH save video MSG_GET_FOCUS selindex = %d",selindex);
  2386. GUILISTBOX_SetCurItemIndex(list_ctrl_id,selindex);
  2387. MMK_SetAtvCtrl(win_id, list_ctrl_id);
  2388. }
  2389. break;
  2390. case MSG_APP_CANCEL:
  2391. case MSG_CTL_CANCEL:
  2392. MMK_CloseWin(win_id);       
  2393. break;
  2394. case MSG_CLOSE_WINDOW: /* 处理关闭窗口消息 */
  2395. if (p_edoc)
  2396. {
  2397. MMSDelDocument(p_edoc);
  2398. SCI_TRACE_LOW("FNH after free MMS!");
  2399. p_edoc = NULL;
  2400. }
  2401. if (p_folder_save_param)
  2402. {
  2403. SCI_TRACE_LOW("FNH before free p_folder_save_param");
  2404. cms_free(p_folder_save_param);
  2405. SCI_TRACE_LOW("FNH after  free p_folder_save_param");
  2406. p_folder_save_param = NULL;
  2407. }
  2408. break;
  2409.         
  2410. default:
  2411. err_code = MMI_RESULT_FALSE;
  2412. break;
  2413.         }
  2414.        
  2415. return err_code;
  2416. }
  2417. /******************************************************************************
  2418.  * 函数定义: MMIMMS_SaveDownloadVideo
  2419.  * 函数说明: 保存彩信内容中的视频
  2420.  * 参数说明: video_data_ptr:视频数据指针
  2421. memory_size:视频大小
  2422. image_type:视频类型
  2423.  * 返回值: 空
  2424. ********************************************************************************/
  2425. void MMIMMS_SaveDownloadVideo(
  2426.                                uint8                *video_data_ptr,  //in:
  2427.                                uint32               memory_size,    //in:
  2428.                                uint32 video_type,
  2429.    MMIMULTIM_SAVE_FILE_CALLBACK_PFUNC callback_func
  2430.                                )
  2431. {
  2432.     uint32          free_space = 0;
  2433.     P_MMS_SAVE_VIDEO_PARAM p_save_video_param = NULL;
  2434.     //判断下载图片类型是否支持
  2435.     switch (video_type)
  2436.     {
  2437.     case MMS_TYPE_MP4:
  2438.     case MMS_TYPE_3GP:
  2439.         break;
  2440.     default:
  2441.         PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_ONE,TXT_MP3_NO_SUPPORT,IMAGE_PROMPT_ICON_ALERT,MMI_3SECONDS, PNULL);
  2442.         return;
  2443.     }
  2444.     
  2445.     if (0 == memory_size)
  2446.     {
  2447.         PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_ONE,TXT_SMS_EMPTY_CONTENT,IMAGE_PROMPT_ICON_ALERT,MMI_3SECONDS, PNULL);
  2448.         return;
  2449.     }
  2450.     //判断空间是否足够
  2451. #ifndef _WIN32
  2452.     free_space = FFS_GetFreeSpace(g_filetype);
  2453. #endif
  2454.     if (free_space >= memory_size)
  2455.     { 
  2456. p_save_video_param = (P_MMS_SAVE_VIDEO_PARAM)cms_malloc(sizeof(MMS_SAVE_VIDEO_PARAM));
  2457. p_save_video_param->video_str = video_data_ptr;
  2458. p_save_video_param->video_size = memory_size;
  2459. p_save_video_param->video_type = video_type;
  2460.               p_save_video_param->callback_func = callback_func;
  2461. MMK_CreateWin((uint32*)MMIMMS_DOWNLOAD_VIDEO_NAME_WIN_TAB,(ADD_DATA)p_save_video_param);
  2462.     }
  2463.     else
  2464.     {
  2465.         //提示空间不足
  2466.         PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_ONE,TXT_SMS_PROMPT_NO_SPACE,IMAGE_PROMPT_ICON_ALERT,MMI_3SECONDS, PNULL);
  2467.     }
  2468. }
  2469. /******************************************************************************
  2470.  * 函数定义: MMIMMS_SaveDownloadmp3
  2471.  * 函数说明: 保存彩信内容中的mp3
  2472.  * 参数说明: mp3_data_ptr:mp3数据指针
  2473. memory_size:mp3大小
  2474. image_type:mp3类型
  2475.  * 返回值: 空
  2476. ********************************************************************************/
  2477. void MMIMMS_SaveDownloadmp3(
  2478.                                uint8                *mp3_data_ptr,  //in:
  2479.                                uint32               memory_size,    //in:
  2480.                                uint32 mp3_type,
  2481.    MMIMULTIM_SAVE_FILE_CALLBACK_PFUNC callback_func
  2482.                                )
  2483. {
  2484.     uint32          free_space = 0;
  2485.     P_MMS_SAVE_MP3_PARAM p_save_mp3_param = NULL;
  2486.     //判断下载图片类型是否支持
  2487.     switch (mp3_type)
  2488.     {
  2489.     case MMS_TYPE_MP3:
  2490.         break;
  2491.     default:
  2492.         PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_ONE,TXT_MMS_INVALID_AUDIO,IMAGE_PROMPT_ICON_ALERT,MMI_3SECONDS, PNULL);
  2493.         return;
  2494.     }
  2495.     
  2496.     if (0 == memory_size)
  2497.     {
  2498.         PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_ONE,TXT_SMS_EMPTY_CONTENT,IMAGE_PROMPT_ICON_ALERT,MMI_3SECONDS, PNULL);
  2499.         return;
  2500.     }
  2501.     //judge udisk space is whether enough.
  2502. #ifndef _WIN32
  2503.     free_space = FFS_GetFreeSpace(g_filetype);
  2504. #endif
  2505.     if (free_space >= memory_size)
  2506.     { 
  2507. p_save_mp3_param = (P_MMS_SAVE_MP3_PARAM)cms_malloc(sizeof(MMS_SAVE_MP3_PARAM));
  2508. p_save_mp3_param->mp3_str = mp3_data_ptr;
  2509. p_save_mp3_param->mp3_size = memory_size;
  2510. p_save_mp3_param->mp3_type = mp3_type;
  2511.               p_save_mp3_param->callback_func = callback_func;
  2512. MMK_CreateWin((uint32*)MMIMMS_DOWNLOAD_MP3_NAME_WIN_TAB,(ADD_DATA)p_save_mp3_param);
  2513.     }
  2514.     else
  2515.     {
  2516.         //提示空间不足
  2517.         PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_ONE,TXT_SMS_PROMPT_NO_SPACE,IMAGE_PROMPT_ICON_ALERT,MMI_3SECONDS, PNULL);
  2518.     }
  2519.  
  2520. }
  2521. /******************************************************************************
  2522.  * 函数定义: MMIMMS_GenRandomNameAndSet
  2523.  * 函数说明: 取得随机名字并设置
  2524.  * 参数说明: video_data_ptr:视频数据指针
  2525. memory_size:视频大小
  2526. image_type:视频类型
  2527.  * 返回值: 空
  2528. ********************************************************************************/
  2529. LOCAL void MMIMMS_GenRandomNameAndSet(
  2530.                                uint8                    *suffix_ptr,    
  2531.                                MMS_CONTROL_ID_E         ctrl_id   
  2532.                                )
  2533. {
  2534.     uint16 random = 0,*unicode_name_ptr = PNULL,unicode_name_len = 0;
  2535.     MMI_STRING_T    ucs2_str;
  2536.     SCI_ASSERT(PNULL != suffix_ptr);
  2537.     SCI_MEMSET(&ucs2_str,0,sizeof(MMI_STRING_T));
  2538.     ucs2_str.str_ptr = cms_malloc(MMIMMS_RANDOM_FILE_NAME_MAX_LEN);
  2539.     SCI_MEMSET(ucs2_str.str_ptr,0,MMIMMS_RANDOM_FILE_NAME_MAX_LEN);
  2540.     //generate random
  2541.     srand(SCI_GetTickCount());
  2542. random = rand();
  2543. sprintf((char *)ucs2_str.str_ptr,"%05d",random); 
  2544.     ucs2_str.length = strlen((char*)ucs2_str.str_ptr);
  2545.     ucs2_str.is_ucs2 = FALSE;
  2546.     //convert uint8 to uint16 unicode
  2547.     unicode_name_ptr = cms_malloc((ucs2_str.length+1)<<1);//注意结束符空间的分配
  2548.     SCI_MEMSET(unicode_name_ptr,0,((ucs2_str.length+1)<<1));
  2549.     MMI_Convert8Ucs2To16(unicode_name_ptr,&unicode_name_len,&ucs2_str);
  2550.     //set in editbox
  2551.     GUIEDITBOX_SetTextEditBoxStringInfo(ctrl_id,ucs2_str.str_ptr,ucs2_str.length,ucs2_str.is_ucs2);
  2552.     //free memory
  2553. if (ucs2_str.str_ptr)
  2554. {
  2555. cms_free(ucs2_str.str_ptr);
  2556. ucs2_str.str_ptr = NULL;
  2557. }
  2558. if (unicode_name_ptr)
  2559. {
  2560.     cms_free(unicode_name_ptr);
  2561. unicode_name_ptr = NULL;
  2562. }
  2563. }
  2564. /******************************************************************************
  2565.  * 函数定义: HandleDownloadVideoInputName
  2566.  * 函数说明: 保存视频时重新输入名字
  2567.  * 参数说明: win_id:窗口ID
  2568. msg_id:消息ID
  2569. param:窗口附加值
  2570.  * 返回值: 空
  2571. ********************************************************************************/
  2572. LOCAL MMI_RESULT_E HandleDownloadVideoInputName(
  2573.                                               MMS_WINDOW_ID_E      win_id,
  2574.                                               MMI_MESSAGE_ID_E     msg_id,
  2575.                                               DPARAM             param
  2576.                                               )
  2577. {
  2578.     MMI_RESULT_E            result = MMI_RESULT_TRUE;
  2579.     MMS_CONTROL_ID_E        ctrl_id = MMIMMS_DOWNLOAD_VIDEO_NAME_EDITBOX_CTRL_ID;
  2580. uint32 len = 0;
  2581.     TEXTEDIT_STRING_INFO_T  name_str;
  2582.   GUI_RECT_T rect = MMI_CLIENT_RECT;
  2583. static P_MMS_SAVE_VIDEO_PARAM p_save_video_param;
  2584.    
  2585. switch (msg_id)
  2586. {
  2587. case MSG_OPEN_WINDOW:
  2588. MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
  2589.         //set edibox type
  2590. p_save_video_param = (P_MMS_SAVE_VIDEO_PARAM)MMK_GetWinAddDataPtr(win_id);
  2591.         GUIEDITBOX_SetEditBoxToSingle(ctrl_id, SINGLE_ALIGN_CENTER); 
  2592. if (p_save_video_param->video_type == MMS_TYPE_3GP)
  2593. {
  2594.      MMIMMS_GenRandomNameAndSet((uint8 *)".3GP",ctrl_id);
  2595. }
  2596. else if (p_save_video_param->video_type == MMS_TYPE_MP4)
  2597. {
  2598. MMIMMS_GenRandomNameAndSet((uint8 *)".mp4",ctrl_id);
  2599. }
  2600.         MMK_SetAtvCtrl(win_id,ctrl_id);
  2601. break;
  2602.     case MSG_FULL_PAINT:
  2603. //设置重命名窗口背景色
  2604. LCD_FillRect(MAINLCD_ID,rect,MMI_WINDOW_BACKGROUND_COLOR);
  2605.         break;
  2606. case MSG_APP_OK:
  2607.     case MSG_CTL_OK:
  2608. {
  2609. GUIEDITBOX_GetTextEditBoxInfo(ctrl_id,&name_str);
  2610. if ((!MMIMultim_FileNameIsValid(&name_str))||(name_str.str_len == 0)) //cr46352
  2611. {
  2612. PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_ONE, TXT_MMIMULTIM_NAMEINVALID, IMAGE_PROMPT_ICON_WRONG, MMI_3SECONDS, PNULL);
  2613. break;
  2614. }
  2615. else 
  2616. {
  2617. if(name_str.str_len > MMIMMS_MAX_FILE_NAME_LEN)
  2618. {
  2619. len = MMIMMS_MAX_FILE_NAME_LEN;
  2620. }
  2621. else
  2622. {
  2623. len = name_str.str_len;
  2624. }
  2625. name_str.str_ptr[len] = '';
  2626. }
  2627. SCI_MEMSET(g_videoname_arr,0,MMIMMS_MAX_FILE_NAME_LEN+1);
  2628. if (name_str.is_ucs2 == 0)
  2629. {
  2630. SCI_TRACE_LOW("FNH name_str.is_ucs2 is 0 ");
  2631. SCI_STRCPY((char *)g_videoname_arr,(char *)name_str.str_ptr);
  2632. if (p_save_video_param->video_type == MMS_TYPE_3GP)
  2633. {
  2634. strcat((char *)g_videoname_arr,(char *)".3gp");
  2635. }
  2636. else if (p_save_video_param->video_type == MMS_TYPE_MP4)
  2637. {
  2638. strcat((char *)g_videoname_arr,(char *)".mp4");
  2639. }
  2640. }
  2641. else if (name_str.is_ucs2 == 1)
  2642. {
  2643. len = GUI_UCS2GB((uint8 *)g_videoname_arr,name_str.str_ptr,len);
  2644. g_videoname_arr[len] = '';
  2645. if (p_save_video_param->video_type == MMS_TYPE_3GP)
  2646. {
  2647. strcat((char *)g_videoname_arr,(char *)".3gp");
  2648. }
  2649. else if (p_save_video_param->video_type == MMS_TYPE_MP4)
  2650. {
  2651. strcat((char *)g_videoname_arr,(char *)".mp4");
  2652. }
  2653. }
  2654. //提示请稍后
  2655. 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);
  2656.             switch (MMIMMS_SaveVideo(g_videoname_arr, p_save_video_param->video_str, p_save_video_param->video_size))
  2657.             {
  2658.             case DOWN_ERROR_NONE:
  2659.             break;
  2660.             case DOWN_ERROR_DEFAULT:
  2661.                 //失败
  2662. if (MMK_IsOpenWin(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID))
  2663. {
  2664. MMK_CloseWin(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID);
  2665. }
  2666. PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_NONE,TXT_SMS_PROMPT_FAIL,IMAGE_PROMPT_ICON_WAIT, ALERT_TIMEOUT,PNULL);
  2667.                 break;
  2668.             case DOWN_ERROR_FULL:
  2669. if (MMK_IsOpenWin(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID))
  2670. {
  2671. MMK_CloseWin(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID);
  2672. }
  2673. PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_NONE,TXT_MMIMULTIM_MEMORYFULL,IMAGE_PROMPT_ICON_WAIT, ALERT_TIMEOUT,PNULL);
  2674.                 break;
  2675.             case DOWN_ERROR_REPEAT:
  2676. if (MMK_IsOpenWin(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID))
  2677. {
  2678. MMK_CloseWin(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID);
  2679. }
  2680. PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_NONE,TXT_MMIMULTIM_NAMEREPEATED,IMAGE_PROMPT_ICON_WAIT, ALERT_TIMEOUT,PNULL);
  2681.                 break;
  2682.             default:
  2683.                 break;
  2684.             }
  2685. }
  2686. break;
  2687. case MSG_APP_CANCEL:
  2688.     case MSG_CTL_CANCEL:
  2689.         MMK_CloseWin(win_id);
  2690.         break;
  2691.     case MSG_CLOSE_WINDOW:
  2692.         if (PNULL != p_save_video_param->callback_func)
  2693.         {
  2694.             (*p_save_video_param->callback_func)(p_save_video_param->video_str, PNULL);
  2695.         }
  2696.         if (p_save_video_param)
  2697.         {
  2698.             cms_free(p_save_video_param);
  2699.             p_save_video_param = PNULL;
  2700.         }
  2701.         break;
  2702.         
  2703. default:
  2704.     result = MMI_RESULT_FALSE;
  2705.     break;
  2706. }
  2707. return (result);
  2708. }
  2709. /******************************************************************************
  2710.  * 函数定义: HandleDownloadmp3InputName
  2711.  * 函数说明: 保存mp3时重新输入名字
  2712.  * 参数说明: win_id:窗口ID
  2713. msg_id:消息ID
  2714. param:窗口附加值
  2715.  * 返回值: 空
  2716. ********************************************************************************/
  2717. LOCAL MMI_RESULT_E HandleDownloadmp3InputName(
  2718.                                               MMS_WINDOW_ID_E      win_id,
  2719.                                               MMI_MESSAGE_ID_E     msg_id,
  2720.                                               DPARAM             param
  2721.                                               )
  2722. {
  2723.     MMI_RESULT_E            result = MMI_RESULT_TRUE;
  2724.     MMS_CONTROL_ID_E        ctrl_id = MMIMMS_DOWNLOAD_MP3_NAME_EDITBOX_CTRL_ID;
  2725. uint32 len = 0;
  2726.     TEXTEDIT_STRING_INFO_T  name_str;
  2727.   GUI_RECT_T rect = MMI_CLIENT_RECT;
  2728. static P_MMS_SAVE_MP3_PARAM p_save_mp3_param;
  2729.    
  2730. SCI_TRACE_LOW("mmimms_wintable.c, HandleDownloadmp3InputName(), come in!");
  2731. switch (msg_id)
  2732. {
  2733. case MSG_OPEN_WINDOW:
  2734. MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
  2735.         //set editbox type
  2736. p_save_mp3_param = (P_MMS_SAVE_MP3_PARAM)MMK_GetWinAddDataPtr(win_id);
  2737.         GUIEDITBOX_SetEditBoxToSingle(ctrl_id, SINGLE_ALIGN_CENTER); 
  2738. if (p_save_mp3_param->mp3_type == MMS_TYPE_MP3)
  2739. {
  2740.      MMIMMS_GenRandomNameAndSet((uint8 *)".mp3",ctrl_id);
  2741. }
  2742.         MMK_SetAtvCtrl(win_id,ctrl_id);
  2743. break;
  2744.     case MSG_FULL_PAINT:
  2745. //设置重命名窗口背景色
  2746. LCD_FillRect(MAINLCD_ID,rect,MMI_WINDOW_BACKGROUND_COLOR);
  2747.         break;
  2748. case MSG_APP_OK:
  2749.     case MSG_CTL_OK:
  2750. {
  2751. GUIEDITBOX_GetTextEditBoxInfo(ctrl_id,&name_str);
  2752. if ((!MMIMultim_FileNameIsValid(&name_str))||(name_str.str_len == 0))
  2753. {
  2754. PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_ONE, TXT_MMIMULTIM_NAMEINVALID, IMAGE_PROMPT_ICON_WRONG, MMI_3SECONDS, PNULL);
  2755. break;
  2756. }
  2757. else 
  2758. {
  2759. if(name_str.str_len > MMIMMS_MAX_FILE_NAME_LEN)
  2760. {
  2761. len = MMIMMS_MAX_FILE_NAME_LEN;
  2762. }
  2763. else
  2764. {
  2765. len = name_str.str_len;
  2766. }
  2767. name_str.str_ptr[len] = '';
  2768. }
  2769. SCI_MEMSET(g_mp3name_arr,0,MMIMMS_MAX_FILE_NAME_LEN+1);
  2770. if (name_str.is_ucs2 == 0)
  2771. {
  2772. SCI_TRACE_LOW("FNH name_str.is_ucs2 is 0 ");
  2773. SCI_STRCPY((char *)g_mp3name_arr,(char *)name_str.str_ptr);
  2774. if (p_save_mp3_param->mp3_type == MMS_TYPE_MP3)
  2775. {
  2776. strcat((char *)g_mp3name_arr,(char *)".mp3");
  2777. }
  2778. }
  2779. else if (name_str.is_ucs2 == 1)
  2780. {
  2781. SCI_TRACE_LOW("FNH name_str.is_ucs2 is 1 ");
  2782. len = GUI_UCS2GB((uint8 *)g_mp3name_arr,name_str.str_ptr,len);
  2783. g_mp3name_arr[len] = '';
  2784. if (p_save_mp3_param->mp3_type == MMS_TYPE_MP3)
  2785. {
  2786. strcat((char *)g_mp3name_arr,(char *)".mp3");
  2787. }
  2788. }
  2789. //提示请稍后
  2790. 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);
  2791. // MMIMMS_SaveMp3(g_mp3name_arr);
  2792. SCI_TRACE_LOW("mmimms_wintable.c, HandleDownloadmp3InputName(), come in MMIMMS_SaveMp3()!");
  2793. // MMIMMS_SaveMp3(g_mp3name_arr, p_save_mp3_param->mp3_str, p_save_mp3_param->mp3_size);
  2794.             switch (MMIMMS_SaveMp3(g_mp3name_arr, p_save_mp3_param->mp3_str, p_save_mp3_param->mp3_size))
  2795.             {
  2796.             case DOWN_ERROR_NONE:
  2797.             break;
  2798.             case DOWN_ERROR_DEFAULT:
  2799.                 //失败
  2800. if (MMK_IsOpenWin(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID))
  2801. {
  2802. MMK_CloseWin(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID);
  2803. }
  2804. PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_NONE,TXT_SMS_PROMPT_FAIL,IMAGE_PROMPT_ICON_WAIT, ALERT_TIMEOUT,PNULL);
  2805.                 break;
  2806.             case DOWN_ERROR_FULL:
  2807. if (MMK_IsOpenWin(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID))
  2808. {
  2809. MMK_CloseWin(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID);
  2810. }
  2811. PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_NONE,TXT_MMIMULTIM_MEMORYFULL,IMAGE_PROMPT_ICON_WAIT, ALERT_TIMEOUT,PNULL);
  2812.                 break;
  2813.             case DOWN_ERROR_REPEAT:
  2814. if (MMK_IsOpenWin(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID))
  2815. {
  2816. MMK_CloseWin(MMIMULTIM_DOWANLOAD_WAIT_WIN_ID);
  2817. }
  2818. PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_NONE,TXT_MMIMULTIM_NAMEREPEATED,IMAGE_PROMPT_ICON_WAIT, ALERT_TIMEOUT,PNULL);
  2819.                 break;
  2820.             default:
  2821.                 break;
  2822.             }
  2823. }
  2824. break;
  2825. case MSG_APP_CANCEL:
  2826.     case MSG_CTL_CANCEL:
  2827.         MMK_CloseWin(win_id);
  2828.         break;
  2829.     case MSG_CLOSE_WINDOW:
  2830.         if (PNULL != p_save_mp3_param->callback_func)
  2831.         {
  2832.             (*p_save_mp3_param->callback_func)(p_save_mp3_param->mp3_str, PNULL);
  2833.         }
  2834.         if (p_save_mp3_param)
  2835.         {
  2836.             cms_free(p_save_mp3_param);
  2837.             p_save_mp3_param = PNULL;
  2838.         }
  2839.         break;
  2840.         
  2841. default:
  2842.     result = MMI_RESULT_FALSE;
  2843.     break;
  2844. }
  2845. return (result);
  2846. }
  2847. /******************************************************************************
  2848.  * 函数定义: mmicms_replymmsforsms
  2849.  * 函数说明: 电话本和短信回复彩信
  2850.  * 参数说明: telenum:电话号码
  2851.  * 作者 : 冯倪红
  2852.  * 返回值: 空
  2853. ********************************************************************************/
  2854. void mmicms_replymmsforsms(char *telenum)
  2855. {
  2856. SCI_ASSERT(telenum != NULL);
  2857. g_p_mms_to = NULL;
  2858. g_p_mms_cc = NULL;
  2859. g_p_mms_bcc = NULL;
  2860. g_p_mms_subject = (int8 *)cms_malloc(MMIMMS_MAX_SUBJECTS_LEN+1);
  2861. SCI_ASSERT(g_p_mms_subject != NULL);
  2862. SCI_MEMSET(g_p_mms_subject,0,MMIMMS_MAX_SUBJECTS_LEN+1);
  2863. g_p_mms_to = (p_MMS_RECEPIENT)cms_malloc(sizeof(MMS_RECEPIENT));
  2864. SCI_MEMSET(g_p_mms_to,0,sizeof(MMS_RECEPIENT));
  2865. SCI_STRCPY(g_p_mms_to->m_address,(char *)telenum);
  2866. g_peditdoc = MMS_New();
  2867. SCI_ASSERT(g_peditdoc != NULL);
  2868. SCI_TRACE_LOW("FNH new mms!");
  2869. g_mms_edit_status = MMS_EDIT_ANSWER_SMSORPB;
  2870. MMK_CreateWin((uint32 *)MMIMMS_EDIT_WIN_TAB,PNULL);
  2871. }
  2872. void EditboxStringToGlobalVariable(MMI_CTRL_ID_T ctrl_id)
  2873. {
  2874. uint8 tele_num[MMIMMS_MAX_ADDRESS_LEN + 2] = {0};
  2875. uint16 receiver_len = 0;
  2876. uint16 index = 0;
  2877. TEXTEDIT_STRING_INFO_T edit_string;
  2878.     //get the content which the user input
  2879.     SCI_MEMSET( (void *)&edit_string, 0, sizeof( TEXTEDIT_STRING_INFO_T ) );
  2880.     GUIEDITBOX_GetTextEditBoxInfo(ctrl_id, &edit_string);
  2881. if (edit_string.str_len > MMIMMS_MAX_ADDRESS_LEN)
  2882. {
  2883. edit_string.str_len = MMIMMS_MAX_ADDRESS_LEN;
  2884. }
  2885. edit_string.str_ptr[edit_string.str_len] = '';
  2886. if (edit_string.str_ptr != PNULL && edit_string.str_len != 0)
  2887. {
  2888. for (index=0;index<edit_string.str_len;index++)
  2889. {
  2890. if (edit_string.str_ptr[index] == 32)
  2891. receiver_len ++;
  2892. }
  2893. if (receiver_len != index)
  2894. {
  2895. SCI_MEMSET(tele_num, 0, sizeof(tele_num));
  2896. MMI_MEMCPY(tele_num, (MMIMMS_MAX_ADDRESS_LEN + 1), edit_string.str_ptr, edit_string.str_len, edit_string.str_len);
  2897. SCI_STRCPY(g_p_mms_to->m_address,(char *)tele_num);
  2898. }
  2899. }
  2900. }
  2901. /*****************************************************************************/
  2902. //  Description : initialize MMS application
  2903. // Global resource dependence : none
  2904. //  Author: Bruce.Chi
  2905. // Note:
  2906. /*****************************************************************************/
  2907. PUBLIC BOOLEAN MMIMMS_SendImage(
  2908. ANIMATE_IMAGE_TYPE_E        img_type,
  2909. uint32 img_buf_len,
  2910. void *img_buf_ptr
  2911. )
  2912. {
  2913. T_Composer_Image composer_image;
  2914. if (img_buf_ptr == PNULL || img_buf_len == 0)
  2915. {
  2916. return FALSE;
  2917. }
  2918. ///////fnh add 0325 for send image begin
  2919. if (img_buf_len > MMS_MAX_SIZE_OF_MULTIM) //超过定义的范围
  2920. {
  2921.     PUBWIN_OpenPromptAlertWin(PUBWIN_SOFTKEY_ONE, TXT_DC_PICTOO_LARGE, IMAGE_PROMPT_ICON_ALERT, MMI_3SECONDS, PNULL);
  2922. return FALSE;
  2923. }
  2924. SCI_TRACE_LOW("FNH new mms!");
  2925. MMICMSBRW_InitCache();
  2926. g_p_mms_to = NULL;
  2927. g_p_mms_cc = NULL;
  2928. g_p_mms_bcc = NULL;
  2929. g_p_mms_subject = (int8 *)cms_malloc(MMIMMS_MAX_SUBJECTS_LEN+1);
  2930. SCI_ASSERT(g_p_mms_subject != NULL);
  2931. SCI_MEMSET(g_p_mms_subject,0,MMIMMS_MAX_SUBJECTS_LEN+1);
  2932. g_peditdoc = MMS_New();
  2933. SCI_ASSERT(g_peditdoc != NULL);
  2934. SCI_TRACE_LOW("FNH new mms!");
  2935. MMS_New_Slide(g_peditdoc);
  2936. SCI_MEMSET(&composer_image,0,sizeof(T_Composer_Image));
  2937. composer_image.ImgBuf = (T_UBYTE *)img_buf_ptr;
  2938. composer_image.size = img_buf_len;
  2939. SCI_TRACE_LOW("FNH img_type is %d",img_type);
  2940. composer_image.Type = Edit_GetDeltaMMSImageType2(img_type);
  2941. SCI_TRACE_LOW("FNH composer_image.type is %s",composer_image.Type);
  2942. composer_image.begin = 0;
  2943. SCI_TRACE_LOW("FNH buf = %d,size = %d,type = %s",composer_image.ImgBuf,composer_image.size,composer_image.Type );
  2944. if (composer_image.Type != PNULL)
  2945. {
  2946. MMIMP3_SuspendMp3(TRUE);
  2947. MMIMMS_AddImage(&composer_image,g_peditdoc);
  2948. // MMK_CreateWin((uint32 *)MMIMMS_EDIT_OPTION_TAB,PNULL);
  2949. g_mms_edit_status = MMS_EDIT_SEND_IMAGE;
  2950. MMK_CreateWin((uint32 *)MMIMMS_EDIT_WIN_TAB,PNULL);
  2951. return TRUE;
  2952. }
  2953. else
  2954. {
  2955. MMICMSBRW_FreeGlobalBuffer();
  2956. //alert : not supported image
  2957. PUBWIN_OpenPromptAlertWin(
  2958. PUBWIN_SOFTKEY_ONE, 
  2959. TXT_MMS_INVALID_PIC, 
  2960. IMAGE_PROMPT_ICON_WRONG, 
  2961. ALERT_TIMEOUT, 
  2962. PNULL
  2963. );
  2964. return FALSE;
  2965. }
  2966. //     end
  2967. }
  2968. /*****************************************************************************/
  2969. //     Description : open mms mailbox
  2970. //    Global resource dependence : 
  2971. //  Author: Bruce.chi
  2972. //    Note:    used after mms and sms have been departed
  2973. /*****************************************************************************/
  2974. PUBLIC void MMIMMS_Apart_OpenMMSMailBox(MMIMSG_MAILBOX_TYPE_E mailbox_type)
  2975. {
  2976.     int msg_num_of_mailbox = 0;
  2977.     switch(mailbox_type)
  2978.     {
  2979.     case MMIMESSAGE_INBOX:
  2980. g_pManager->currentfolder = g_pManager->inboxfolder;
  2981. msg_num_of_mailbox = MMIMMS_GetMessageNum(g_pManager->currentfolder );
  2982. if (msg_num_of_mailbox == 0)
  2983. {
  2984. PUBWIN_OpenPromptAlertWin(
  2985. PUBWIN_SOFTKEY_ONE, 
  2986. TXT_MMS_INBOX_EMPTY, 
  2987. IMAGE_PROMPT_ICON_WRONG, 
  2988. ALERT_TIMEOUT, 
  2989. PNULL
  2990. );
  2991. }
  2992. else
  2993. SCI_TRACE_LOW("FNH g_donewmms is %d",g_donewmms);
  2994. if(g_donewmms == TRUE)
  2995. {
  2996. MMIMMS_StoreFolder(g_pManager->inboxfolder);
  2997. g_donewmms = FALSE;
  2998. MMIMMS_SaveManagerInboxFile(MMS_SAVE_INBOX);   //modify liangliu 2006-2-15 
  2999. }
  3000. SCI_TRACE_LOW("fnh inbox before init cache");
  3001. MMICMSBRW_InitCache();
  3002. SCI_TRACE_LOW("fnh after init cache ");
  3003. MMK_CreateWin((uint32 *)MMIMMS_INBOX_LIST_WIN, PNULL);
  3004. }
  3005.         break;
  3006.     case MMIMESSAGE_SENTBOX:
  3007. g_pManager->currentfolder = g_pManager->sentfolder;
  3008. //msg_num_of_mailbox = SaveNV_GetMailboxMsgNum(MMIMMS_INBOX);
  3009. msg_num_of_mailbox = MMIMMS_GetMessageNum(g_pManager->currentfolder );
  3010. if (msg_num_of_mailbox == 0)
  3011. {
  3012. PUBWIN_OpenPromptAlertWin(
  3013. PUBWIN_SOFTKEY_ONE, 
  3014. TXT_MMS_SENTBOX_EMPTY, 
  3015. IMAGE_PROMPT_ICON_WRONG, 
  3016. ALERT_TIMEOUT, 
  3017. PNULL
  3018. );
  3019. }
  3020. else
  3021. SCI_TRACE_LOW("fnh sentbox before init cache");
  3022. MMICMSBRW_InitCache();
  3023. SCI_TRACE_LOW("fnh after init cache ");
  3024. MMK_CreateWin((uint32 *)MMIMMS_SENTBOX_LIST_WIN, PNULL);
  3025. }
  3026. break;
  3027.     case MMIMESSAGE_OUTBOX:
  3028. g_pManager->currentfolder = g_pManager->outboxfolder;
  3029. msg_num_of_mailbox = MMIMMS_GetMessageNum(g_pManager->currentfolder );
  3030. if (msg_num_of_mailbox == 0)
  3031. {
  3032. PUBWIN_OpenPromptAlertWin(
  3033. PUBWIN_SOFTKEY_ONE, 
  3034. TXT_MMS_OUTBOX_EMPTY, 
  3035. IMAGE_PROMPT_ICON_WRONG, 
  3036. ALERT_TIMEOUT, 
  3037. PNULL
  3038. );
  3039. }
  3040. else
  3041. SCI_TRACE_LOW("fnh outbox before init cache");
  3042. MMICMSBRW_InitCache();
  3043. SCI_TRACE_LOW("fnh after init cache ");
  3044. MMK_CreateWin((uint32 *)MMIMMS_OUTBOX_LIST_WIN, PNULL);
  3045. }
  3046. break;
  3047.     case MMIMESSAGE_DRAFTBOX:
  3048. g_pManager->currentfolder = g_pManager->draftfolder;
  3049. msg_num_of_mailbox = MMIMMS_GetMessageNum(g_pManager->currentfolder );
  3050. if (msg_num_of_mailbox == 0)
  3051. {
  3052. PUBWIN_OpenPromptAlertWin(
  3053. PUBWIN_SOFTKEY_ONE, 
  3054. TXT_MMS_DRAFTBOX_EMPTY, 
  3055. IMAGE_PROMPT_ICON_WRONG, 
  3056. ALERT_TIMEOUT, 
  3057. PNULL
  3058. );
  3059. }
  3060. else
  3061. {
  3062. SCI_TRACE_LOW("fnh draftbox before init cache");
  3063. MMICMSBRW_InitCache();
  3064. SCI_TRACE_LOW("fnh after init cache ");
  3065. MMK_CreateWin((uint32 *)MMIMMS_DRAFTBOX_LIST_WIN, PNULL);
  3066. }
  3067. break;
  3068.         
  3069.     default:
  3070.         SCI_ASSERT(FALSE);
  3071.         break;
  3072.     }
  3073. }
  3074. /*****************************************************************************/
  3075. //  Description : this function handle MMS edit, select insert photo or Dpic window message
  3076. //  Global resource dependence : 
  3077. //  Author:Rui.Zhang
  3078. //  Note:
  3079. /*****************************************************************************/
  3080. LOCAL MMI_RESULT_E MMS_HandleEditSelectImageWinMsg( 
  3081.    MMI_WIN_ID_T   win_id, 
  3082.                                                    MMI_MESSAGE_ID_E  msg_id, 
  3083.                                                    DPARAM            param )
  3084. {
  3085.   MMI_RESULT_E  recode = MMI_RESULT_TRUE;
  3086.   MMI_MENU_GROUP_ID_T    group_id = 0;
  3087.   MMI_MENU_ID_T          menu_id  = 0;
  3088.   MMI_WIN_ID_T  source_win_id = 0;
  3089.   switch( msg_id )
  3090.   {
  3091.     case MSG_OPEN_WINDOW:
  3092.       MMK_SetAtvCtrl( win_id,  MMIMMS_EDIT_SELECT_IMAGE_CTRL_ID );
  3093.       MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
  3094.       break;
  3095.     case MSG_FULL_PAINT:
  3096.        break;
  3097.    
  3098. case MSG_CTL_OK:  
  3099. case MSG_APP_OK:
  3100. source_win_id = (MMI_WIN_ID_T)(MMK_GetWinAddDataPtr(win_id));
  3101. GUIMENU_GetRetID(MMIMMS_EDIT_SELECT_IMAGE_CTRL_ID, &group_id, &menu_id);
  3102. switch(menu_id) 
  3103. {  
  3104.   case ID_MMS_INSERT_DPIC:
  3105. s_opt_menu_id = ID_MMS_INSERT_DPIC;
  3106. Edit_OpenInsertDpicWin(source_win_id);
  3107. break;
  3108.             
  3109. case ID_MMS_INSERT_PHOTO:
  3110. s_opt_menu_id = ID_MMS_INSERT_PHOTO;
  3111. // Edit_OpenInsertPhotoWin(MMIMMS_EDIT_WIN_ID);
  3112. MMIDC_OpenAlbumWinForMMS(MMS_MAX_SIZE_OF_MULTIM,source_win_id);
  3113. break;
  3114. }
  3115. MMK_CloseWin(win_id);
  3116.         break;
  3117.  
  3118.     case MSG_APP_CANCEL:
  3119.       MMK_CloseWin(win_id);
  3120.       break;
  3121.     default:
  3122.       recode = MMI_RESULT_FALSE;
  3123.       break;
  3124.   }
  3125.   return recode;
  3126. }
  3127. /*****************************************************************************/
  3128. //  Description : this function handle MMS edit, select insert RING or MP3 window message
  3129. //  Global resource dependence : 
  3130. //  Author:AOKE.HU
  3131. //  Note:
  3132. /*****************************************************************************/
  3133. LOCAL MMI_RESULT_E MMS_HandleEditSelectMusicWinMsg( 
  3134.    MMI_WIN_ID_T   win_id, 
  3135.                                                    MMI_MESSAGE_ID_E  msg_id, 
  3136.                                                    DPARAM            param )
  3137. {
  3138.   MMI_RESULT_E  recode = MMI_RESULT_TRUE;
  3139.   MMI_MENU_GROUP_ID_T    group_id = 0;
  3140.   MMI_MENU_ID_T          menu_id  = 0;
  3141.   MMI_WIN_ID_T  source_win_id = 0;
  3142.   switch( msg_id )
  3143.   {
  3144.     case MSG_OPEN_WINDOW:
  3145.       MMK_SetAtvCtrl( win_id,  MMIMMS_EDIT_SELECT_MUSIC_CTRL_ID );
  3146.       MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
  3147.       break;
  3148.     case MSG_FULL_PAINT:
  3149.        break;
  3150.    
  3151. case MSG_CTL_OK:  
  3152. case MSG_APP_OK:
  3153. source_win_id = (MMI_WIN_ID_T)(MMK_GetWinAddDataPtr(win_id));
  3154. GUIMENU_GetRetID(MMIMMS_EDIT_SELECT_MUSIC_CTRL_ID, &group_id, &menu_id);
  3155. switch(menu_id) 
  3156. {  
  3157.   case ID_MMS_EDIT_INSERT_RING:
  3158. Edit_OpenInsertDringWin(source_win_id);
  3159. break;
  3160.             
  3161. case ID_MMS_EDIT_INSERT_MP3:
  3162. // Edit_OpenInsertPhotoWin(MMIMMS_EDIT_WIN_ID);
  3163. MMIMP3_SelectAndGetFile(MMS_MAX_SIZE_OF_MULTIM,source_win_id);
  3164. break;
  3165. }
  3166. MMK_CloseWin(win_id);
  3167.         break;
  3168.  
  3169.     case MSG_APP_CANCEL:
  3170.       MMK_CloseWin(win_id);
  3171.       break;
  3172.     default:
  3173.       recode = MMI_RESULT_FALSE;
  3174.       break;
  3175.   }
  3176.   return recode;
  3177. }
  3178. /*****************************************************************************/
  3179. //  Description : mms是否将mp3的播放挂起
  3180. // Global resource dependence : none
  3181. //  Author: aoke.hu
  3182. // Note: 仅供Mp3模块调用
  3183. /*****************************************************************************/
  3184. PUBLIC BOOLEAN MMIMMS_IsSuspendMp3(void)
  3185. {
  3186. return (s_is_mms_suspend_mp3);
  3187. }
  3188. /*****************************************************************************/
  3189. //  Description : mms编辑模块是否将mp3的播放挂起
  3190. // Global resource dependence : none
  3191. //  Author: aoke.hu
  3192. // Note: 仅供Mp3模块调用
  3193. /*****************************************************************************/
  3194. PUBLIC BOOLEAN MMIMMS_IsContentSuspendMp3(void)
  3195. {
  3196. return (s_is_mmscontent_suspend_mp3);
  3197. }
  3198. /*****************************************************************************/
  3199. //  Description : 5.8.5 Setting : Network
  3200. // Global resource dependence : 
  3201. //  Author:Aoke.Hu
  3202. // Note: 
  3203. /*****************************************************************************/
  3204. LOCAL BOOLEAN Setting_HandleNetworkWinMsg(
  3205.     MMI_WIN_ID_T win_id, 
  3206.     MMI_MESSAGE_ID_E msg_id, 
  3207.     DPARAM param
  3208.     )
  3209. {
  3210.     MMI_MENU_GROUP_ID_T group_id = 0;
  3211.     MMI_MENU_ID_T menu_id = 0;
  3212.     BOOLEAN recode = TRUE;
  3213.     MMI_CTRL_ID_T ctrl_id = MMIMMS_SETTING_NETWORK_CTRL_ID;
  3214.     switch (msg_id)
  3215.     {
  3216.     case MSG_OPEN_WINDOW:
  3217.         MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
  3218.  MMK_SetAtvCtrl(win_id, MMIMMS_SETTING_NETWORK_CTRL_ID);
  3219.         break;
  3220.     case MSG_GET_FOCUS:
  3221. MMK_SetAtvCtrl(win_id, MMIMMS_SETTING_NETWORK_CTRL_ID);
  3222.         break;
  3223. case MSG_CTL_DBCLICK:
  3224.     case MSG_APP_OK:       
  3225.     case MSG_CTL_OK:
  3226.         //get listmenu id
  3227.         GUIMENU_GetRetID(ctrl_id,&group_id,&menu_id);
  3228.         switch (menu_id)
  3229.         {
  3230.         case ID_MMS_SETTING_MMSC:
  3231.             MMK_CreateWin((uint32 *)MMIMMS_SETTING_MMSC_WIN,PNULL);
  3232.             break;
  3233.             
  3234.         case ID_MMS_SETTING_GATEWAY:
  3235.             MMK_CreateWin((uint32 *)MMIMMS_SETTING_GATEWAY_WIN,PNULL);
  3236.             break;
  3237. case ID_MMS_SETTING_PORT:
  3238.             MMK_CreateWin((uint32 *)MMIMMS_SETTING_PORT_WIN,PNULL);
  3239.             break;
  3240. case ID_MMS_SETTING_USERNAME:
  3241. MMK_CreateWin((uint32 *)MMIMMS_SETTING_USERNAME_WIN,PNULL);
  3242. break;
  3243. case ID_MMS_SETTING_PASSWORD:
  3244. MMK_CreateWin((uint32 *)MMIMMS_SETTING_PASSWORD_WIN,PNULL);
  3245. break;
  3246. case ID_MMS_SETTING_APN:
  3247. MMK_CreateWin((uint32 *)MMIMMS_SETTING_APN_WIN,PNULL);
  3248. break;
  3249.         
  3250.         default:
  3251.             return FALSE;
  3252.             break;
  3253.         }
  3254.         break;
  3255.     case MSG_APP_CANCEL:
  3256.     case MSG_CTL_CANCEL:
  3257.         MMK_CloseWin(win_id);
  3258.         break;
  3259.     
  3260.     default:
  3261.         recode = FALSE;
  3262.         break;
  3263.     }
  3264.     return recode;
  3265. /*****************************************************************************/
  3266. //  Description : Get mail box message number.
  3267. // Global resource dependence : none
  3268. //  Author: Bruce.Chi
  3269. // Input: mms type
  3270. // Output: number of specific mms type
  3271. // Note:
  3272. /*****************************************************************************/
  3273. uint16 MMIMMS_GetMailboxMsgNum(MMIMSG_MAILBOX_TYPE_E mms_type)
  3274. {
  3275. int sum = 0;
  3276. SCI_ASSERT(mms_type <= MMIMESSAGE_BOX_TOTAL);
  3277. if(g_pManager == NULL)
  3278. {
  3279. SCI_TRACE_LOW("MMIMMS_GetMailboxMsgNum g_pManager ==NULL");
  3280. return 0;
  3281. }
  3282. switch(mms_type)
  3283. {
  3284. case MMIMESSAGE_INBOX:
  3285. // sum = SaveNV_GetMailboxMsgNum(MMIMMS_INBOX) + SaveNV_GetMailboxMsgNum(MMIMMS_NOTIFICATION);
  3286. g_pManager->currentfolder =g_pManager->inboxfolder;
  3287. sum = MMIMMS_GetMessageNum(g_pManager->currentfolder);
  3288. break;
  3289. case MMIMESSAGE_SENTBOX:
  3290. // sum = SaveNV_GetMailboxMsgNum(MMIMMS_SENTBOX);
  3291. g_pManager->currentfolder =g_pManager->sentfolder;
  3292. sum = MMIMMS_GetMessageNum(g_pManager->currentfolder);
  3293. break;
  3294. case MMIMESSAGE_OUTBOX:
  3295. // sum = SaveNV_GetMailboxMsgNum(MMIMMS_OUTBOX);
  3296. g_pManager->currentfolder =g_pManager->outboxfolder;
  3297. sum = MMIMMS_GetMessageNum(g_pManager->currentfolder);
  3298. break;
  3299. case MMIMESSAGE_DRAFTBOX:
  3300. // sum = SaveNV_GetMailboxMsgNum(MMIMMS_DRAFTBOX);
  3301. g_pManager->currentfolder =g_pManager->draftfolder;
  3302. sum = MMIMMS_GetMessageNum(g_pManager->currentfolder);
  3303. break;
  3304. case MMIMESSAGE_BOX_TOTAL:
  3305. sum = MMIMMS_GetManagerTotalNum();
  3306. break;
  3307. default:
  3308. SCI_ASSERT(FALSE);
  3309. break;
  3310. }
  3311. return sum;
  3312. }
  3313. /*****************************************************************************/
  3314. //  Description : 5.8.5 Setting : sign
  3315. // Global resource dependence : 
  3316. //  Author:Aoke.Hu
  3317. // Note: 
  3318. /*****************************************************************************/
  3319. LOCAL BOOLEAN Setting_HandleSignWinMsg(
  3320.     MMI_WIN_ID_T win_id, 
  3321.     MMI_MESSAGE_ID_E msg_id, 
  3322.     DPARAM param
  3323.     )
  3324. {
  3325.     MMI_MENU_GROUP_ID_T group_id = 0;
  3326.     MMI_MENU_ID_T menu_id = 0;
  3327.     BOOLEAN recode = TRUE;
  3328.     MMI_CTRL_ID_T ctrl_id = MMIMMS_SETTING_SIGN_CTRL_ID;
  3329.     switch (msg_id)
  3330.     {
  3331.     case MSG_OPEN_WINDOW:
  3332.         MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
  3333.   MMK_SetAtvCtrl(win_id, MMIMMS_SETTING_SIGN_CTRL_ID);
  3334.         break;
  3335.    case MSG_GET_FOCUS:
  3336.     MMK_SetAtvCtrl(win_id, MMIMMS_SETTING_SIGN_CTRL_ID);
  3337.         break;
  3338. case MSG_CTL_DBCLICK:
  3339.     case MSG_APP_OK:       
  3340.     case MSG_CTL_OK:
  3341.         //get listmenu id
  3342.         GUIMENU_GetRetID(ctrl_id,&group_id,&menu_id);
  3343.         switch (menu_id)
  3344.         {
  3345.         case ID_MMS_SETTING_OPEN_SIGN:
  3346.     MMK_CreateWin((uint32 *)MMIMMS_SETTING_OPENSIGN_LIST_WIN,PNULL);
  3347. break;
  3348. case ID_MMS_SETTING_EDIT_SIGN:
  3349. MMIMMS_CreateReadMMSWaitingWin();
  3350. g_readsignstate= MMS_MSG_READ_SIGN_FOR_SET;
  3351. MMIMMS_ReadAutosign() ;
  3352. break;
  3353.         
  3354.         default:
  3355.             return FALSE;
  3356.             break;
  3357.         }
  3358.         break;
  3359.     case MSG_APP_CANCEL:
  3360.     case MSG_CTL_CANCEL:
  3361.         MMK_CloseWin(win_id);
  3362.         break;
  3363.     
  3364.     default:
  3365.         recode = FALSE;
  3366.         break;
  3367.     }
  3368.     return recode;