mmimms_wintable.c
资源名称:mms.rar [点击查看]
上传用户:amanda_214
上传日期:2014-04-26
资源大小:163k
文件大小:463k
源码类别:
手机彩信(MMS)编程
开发平台:
C/C++
- MMK_SetAtvCtrl(win_id, menu_ctrl_id);
- break;
- case MSG_CLOSE_WINDOW:
- destroy_mms_mem_file_info();
- break;
- case MSG_APP_OK:
- case MSG_CTL_OK:
- GUIMENU_GetRetID( menu_ctrl_id, (MMI_MENU_GROUP_ID_T *)(&group_id),(MMI_MENU_ID_T *) (&menu_id));
- switch ( menu_id )
- {
- case ID_MMS_INBOX_PLAY:
- g_filetype = MMICMS_GetCurrentFFS();
- if (g_filetype != FS_INVALID)
- {
- g_readforstate = MMS_MSG_INBOX_READ_FOR_PLAY;
- MMIMMS_CreateReadMMSWaitingWin();
- MMIMMS_ReadMMS(g_pCurrentList);
- }
- break;
- case ID_MMS_INBOX_ANSWER_SMS://modify 2006-3-10 for reply sms for test liangliu
- MMISMS_WriteNewMessage(PNULL, g_pCurrentList->sender, strlen((char *)g_pCurrentList->sender));
- break;
- case ID_MMS_INBOX_ANSWER_MMS:
- {
- MMSHANDLE p_mmsdoc = NULL;
- int8 from[MAX_NAME_LENGTH];
- SCI_MEMSET(from,0,sizeof(from));
- p_mmsdoc = (MMSHANDLE)MMS_NewMms();
- if(p_mmsdoc==0)
- {
- return err_code;
- }
- g_p_mms_subject = (int8 *)cms_malloc(MMIMMS_MAX_SUBJECTS_LEN+1);
- SCI_ASSERT(g_p_mms_subject != NULL);
- SCI_MEMSET(g_p_mms_subject,0,MMIMMS_MAX_SUBJECTS_LEN+1);
- if (g_pCurrentList->subject!= NULL)
- {
- uint16 outlen = 0;
- uint8 * uni_16 =PNULL;
- outlen = Cms_UTF8toUTF16Len(g_pCurrentList->subject);
- SCI_TRACE_LOW("fnh outlen = %d",outlen);
- uni_16 = (uint8 *)cms_malloc(outlen);
- SCI_MEMSET(uni_16,0,outlen);
- Cms_UTF8toUTF16(g_pCurrentList->subject,SCI_STRLEN((char *)g_pCurrentList->subject),outlen,uni_16);
- if (outlen > MMIMMS_MAX_SUBJECTS_LEN-2)
- {
- outlen = MMIMMS_MAX_SUBJECTS_LEN-2;
- }
- SCI_MEMCPY(g_p_mms_subject,&outlen,2);
- SCI_MEMCPY((int8 *)(g_p_mms_subject+2),uni_16,outlen);
- SCI_TRACE_BUF("FNH g_p_mms_subject = %x",g_p_mms_subject,10);
- if (uni_16)
- {
- cms_free(uni_16);
- uni_16 = NULL;
- }
- MMIMMS_OptionSubject(MMSRE);
- }
- else
- {
- MMIMMS_OptionSubject(MMSRE);
- }
- MMS_SetMmsFile(p_mmsdoc, (char *)g_pCurrentList->filename);
- /* 获得发件人信息,作为收件人 */
- MMS_DecodeMms(p_mmsdoc);
- if (g_pCurrentList->sender != NULL)
- {
- SCI_ASSERT(SCI_STRLEN((char *)g_pCurrentList->sender) < MAX_NAME_LENGTH);
- if ( (SCI_STRLEN((char *)g_pCurrentList->sender) < MAX_NAME_LENGTH) && (SCI_STRLEN((char *)g_pManager->currentfolder->currentmessage->sender)>0) )
- {
- g_p_mms_to = (p_MMS_RECEPIENT)cms_malloc(sizeof(MMS_RECEPIENT));
- SCI_MEMSET(g_p_mms_to,0,sizeof(MMS_RECEPIENT));
- SCI_STRCPY(g_p_mms_to->m_address,(char *)g_pCurrentList->sender);
- }
- }
- /* 删除临时彩信文档 */
- MMS_DeleteMms(p_mmsdoc);
- g_peditdoc = MMS_New();
- SCI_ASSERT(g_peditdoc != NULL);
- SCI_TRACE_LOW("FNH new mms!");
- SCI_ASSERT(g_peditdoc != NULL);
- g_mms_edit_status = MMS_EDIT_ANSWER_MMS;
- if ((g_nv_setting_mirror.auto_sign == MMS_MSG_SETTINGS_ON) && (g_filetype != FS_INVALID))
- {
- MMIMMS_CreateReadMMSWaitingWin();
- g_readsignstate = MMS_MSG_READ_SIGN_FOR_ANSWER_MMS;
- MMIMMS_ReadAutosign() ;
- }
- else if (g_nv_setting_mirror.auto_sign == MMS_MSG_SETTINGS_OFF)
- {
- MMK_CreateWin((uint32 *)MMIMMS_EDIT_WIN_TAB,PNULL);
- }
- }
- break;
- case ID_MMS_INBOX_FORWARD:
- g_filetype = MMICMS_GetCurrentFFS();
- if (g_filetype != FS_INVALID)
- {
- g_readforstate = MMS_MSG_INBOX_READ_FOR_FW;
- MMIMMS_CreateReadMMSWaitingWin();
- MMIMMS_ReadMMS(g_pCurrentList);
- }
- break;
- case ID_MMS_INBOX_SAVE_IMAGE:
- g_filetype = MMICMS_GetCurrentFFS();
- if (g_filetype != FS_INVALID)
- {
- g_readforstate = MMS_MSG_INBOX_READ_FOR_SAVEPIC;
- MMIMMS_CreateReadMMSWaitingWin();
- MMIMMS_ReadMMS(g_pCurrentList);
- }
- break;
- case ID_MMS_INBOX_SAVE_SOUND:
- g_filetype = MMICMS_GetCurrentFFS();
- if (g_filetype != FS_INVALID)
- {
- g_readforstate = MMS_MSG_INBOX_READ_FOR_SAVESOUND;
- MMIMMS_CreateReadMMSWaitingWin();
- MMIMMS_ReadMMS(g_pCurrentList);
- }
- break;
- case ID_MMS_INBOX_SAVE_VIDEO:
- #ifdef HAVE_MPEG4
- g_filetype = MMICMS_GetCurrentFFS();
- if (g_filetype != FS_INVALID)
- {
- g_readforstate = MMS_MSG_INBOX_READ_FOR_SAVEVIDEO;
- MMIMMS_CreateReadMMSWaitingWin();
- MMIMMS_ReadMMS(g_pCurrentList);
- }
- #else
- #endif
- break;
- case ID_MMS_INBOX_DEL:
- PUBWIN_OpenPromptQueryWin(TXT_MMS_IF_DEL, IMAGE_PROMPT_ICON_QUERY);
- break;
- case ID_MMS_INBOX_DEL_ALL:
- PUBWIN_OpenPromptQueryWin(TXT_MMS_IF_DEL, IMAGE_PROMPT_ICON_QUERY);
- break;
- case ID_MMS_INBOX_DOWNLOAD_MMS:
- //judge whether it's making a call
- if (CC_IsInCall())
- {
- //alert : TXT_MMS_CANNOT_DOWNLOAD_IN_CALL
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_CANNOT_DOWNLOAD_IN_CALL,
- IMAGE_PROMPT_ICON_ALERT,
- ALERT_TIMEOUT,
- PNULL
- );
- }
- else
- {
- g_filetype = MMICMS_GetCurrentFFS();
- if((g_filetype == FS_INVALID)||MMIMMS_GetManagerTotalNum() > (MMS_MAX_NUM -1)||!MMIMMS_IsMoreSpace())//modify liangliu 2005-12-14
- {
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_MEMORYFULL,
- IMAGE_PROMPT_ICON_ALERT,
- ALERT_TIMEOUT,
- PNULL);
- }else
- {
- MMK_CloseWin(win_id);
- MMIMMS_Download_CreateDownloadingWin();
- g_backautodownload = FALSE;
- g_netusing = MMS_MSG_NETUSING_STEP1 ;
- //MMK_CreateWin((uint32 *)MMIMMS_SEND_WIN_TAB,PNULL);
- g_progressneedsize = g_pCurrentList->size;
- MMIMMS_Receive_MMS(g_pCurrentList);
- }
- }
- break;
- case ID_MMS_INBOX_DETAIL:
- MMK_CreateWin((uint32 *)MMIMMS_INBOX_DETAIL_WIN, PNULL);
- break;
- default:
- SCI_ASSERT(0);
- break;
- }
- break;
- case MSG_PROMPTWIN_OK:
- GUIMENU_GetRetID(menu_ctrl_id, (MMI_MENU_GROUP_ID_T *)(&group_id),(MMI_MENU_ID_T *) (&menu_id));
- switch(menu_id)
- {
- case ID_MMS_INBOX_DEL:
- //close query win
- g_pCurrentList->needautodw = 0;
- MMIMMS_DeleteAutodownList();
- PUBWIN_ClosePromptQueryWin();//here should close the win and open the waitwin for delete.
- g_savestate = MMS_MSG_SAVEFILE_FOR_INBOX_DELETE;
- MMIMMS_CreateNormalWaitingWin();
- MMIMMS_DeleteMMS(g_pManager->currentfolder);
- MMK_CloseWin(win_id);
- break;
- case ID_MMS_INBOX_DEL_ALL:
- PUBWIN_ClosePromptQueryWin();//here should close the win and open the waitwin for delete.
- MMK_CloseWin(win_id);
- g_savestate = MMS_MSG_SAVEFILE_FOR_INBOX_DELETE;
- MMIMMS_CreateNormalWaitingWin();
- MMIMMS_DeleteAllMMS(g_pManager->currentfolder);
- MMIMMS_FreeAutodownList();
- break;
- default:
- break;
- }
- break;
- case MSG_PROMPTWIN_CANCEL:
- PUBWIN_ClosePromptQueryWin();
- break;
- case MSG_MMS_READ_FOR_PLAY:
- g_peditdoc = MMS_New();
- SCI_ASSERT(g_peditdoc != NULL);
- SCI_TRACE_LOW("FNH new mms!");
- SCI_TRACE_LOW("FNH before cms_parse_mms");
- //SCI_TRACE_LOW("FNH IN READ FOR PLAY g_pManager->currentfolder->currentmessage = %d",g_pManager->currentfolder->currentmessage);
- SCI_TRACE_LOW("FNH IN READ FOR PLAY g_pManager->currentfolder->currentmessage->filename = %d",g_pCurrentList->filename);
- cms_parse_mms((char *)g_pCurrentList->filename,g_peditdoc);
- mmsf_Remove((char *)g_pCurrentList->filename);
- SCI_TRACE_LOW("FNH IN READ FOR PLAY g_peditdoc->size = %d",g_peditdoc->totalsize);
- if (g_peditdoc->slide_cur == NULL)
- {
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_EDIT_NO_CONTENT,
- IMAGE_PROMPT_ICON_ALERT,
- ALERT_TIMEOUT,
- PNULL
- );
- break;
- }
- else
- {
- play_or_preview = MMS_PLAY;//播放
- SCI_TRACE_LOW("FNH before play mms!");
- MMK_CreateWin((uint32 *)MMIMMS_EDIT_PREVIEW_TAB,(ADD_DATA)g_peditdoc);
- }
- break;
- case MSG_MMS_READ_FOR_FW:
- {
- MMSHANDLE p_mmsdoc = NULL;
- int8 from[MAX_NAME_LENGTH];
- SCI_MEMSET(from,0,sizeof(from));
- p_mmsdoc = (MMSHANDLE)MMS_NewMms();
- if(p_mmsdoc==0)
- {
- return err_code;
- }
- g_p_mms_subject = (int8 *)cms_malloc(MMIMMS_MAX_SUBJECTS_LEN+1);
- SCI_ASSERT(g_p_mms_subject != NULL);
- SCI_MEMSET(g_p_mms_subject,0,MMIMMS_MAX_SUBJECTS_LEN+1);
- if (g_pCurrentList->subject!= NULL)
- {
- uint16 outlen = 0;
- uint8 * uni_16 =PNULL;
- outlen = Cms_UTF8toUTF16Len(g_pCurrentList->subject);
- uni_16 = (uint8 *)cms_malloc(outlen);
- SCI_MEMSET(uni_16,0,outlen);
- Cms_UTF8toUTF16(g_pCurrentList->subject,SCI_STRLEN((char *)g_pCurrentList->subject),outlen,uni_16);
- if (outlen > MMIMMS_MAX_SUBJECTS_LEN-2)
- {
- outlen = MMIMMS_MAX_SUBJECTS_LEN-2;
- }
- SCI_MEMCPY(g_p_mms_subject,&outlen,2);
- SCI_MEMCPY((int8 *)(g_p_mms_subject+2),uni_16,outlen);
- SCI_TRACE_BUF("FNH g_p_mms_subject = ",g_p_mms_subject,10);
- if (uni_16)
- {
- cms_free(uni_16);
- uni_16 = NULL;
- }
- MMIMMS_OptionSubject(MMSFW);
- }
- else
- {
- MMIMMS_OptionSubject(MMSFW);
- }
- MMS_SetMmsFile(p_mmsdoc, (char *)g_pCurrentList->filename);
- /* 获得发件人信息,作为收件人 */
- MMS_DecodeMms(p_mmsdoc);
- /* 删除临时彩信文档 */
- MMS_DeleteMms(p_mmsdoc);
- g_peditdoc = MMS_New();
- SCI_ASSERT(g_peditdoc != NULL);
- SCI_TRACE_LOW("FNH before cms_parse_mms");
- cms_parse_mms((char *)g_pCurrentList->filename,g_peditdoc);
- mmsf_Remove((char *)g_pCurrentList->filename);
- // cms_parse_mms((char *)transit_filename,g_peditdoc);
- SCI_TRACE_LOW("FNH after cms_parse_Mms");
- g_mms_edit_status = MMS_EDIT_FORWARD_MMS;
- MMK_CreateWin((uint32 *)MMIMMS_EDIT_WIN_TAB,PNULL);
- }
- //reedit, then add "Fw" to subject
- break;
- case MSG_MMS_READ_FOR_SAVEVIDEO:
- #ifdef HAVE_MPEG4
- {
- BOOLEAN video_exist = FALSE;
- pMMS_EDocument p_edoc = NULL;
- int8 slide_count = 0;
- if(g_pCurrentList->filename[0] == ' ')
- {
- break;
- }
- p_edoc = MMS_New();
- SCI_ASSERT(p_edoc != NULL);
- SCI_TRACE_LOW("FNH new mms!");
- SCI_TRACE_LOW("FNH before cms_parse_mms");
- cms_parse_mms((char *)g_pCurrentList->filename,p_edoc);
- mmsf_Remove((char *)g_pCurrentList->filename);
- SCI_TRACE_LOW("FNH AFTER cms_parse_mms");
- slide_count = MMSGetSlideCount(p_edoc);
- if (slide_count > 0)//彩信有内容
- {
- pMMS_Slide p_mms_slide_temp = NULL;
- MMS_HeadSlide(p_edoc);
- while(p_edoc->slide_cur)
- {
- p_mms_slide_temp = p_edoc->slide_cur;
- if (p_mms_slide_temp->video_flag == 1)
- {
- video_exist = TRUE;
- break;
- }
- p_edoc->slide_cur = p_edoc->slide_cur->next;
- }
- }
- else //彩信没有内容
- {
- MMSDelDocument(p_edoc);
- SCI_TRACE_LOW("FNH after free MMS!");
- p_edoc = NULL;
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_EDIT_NO_CONTENT,
- IMAGE_PROMPT_ICON_ALERT,
- ALERT_TIMEOUT,
- PNULL
- );
- break;
- }
- if (video_exist ) //如果存在视频
- {
- P_MMS_FOLDER_SAVE_PARAM p_folder_save_param = NULL; /* 编辑器入口参数 */
- /*编辑器入口参数创建*/
- p_folder_save_param = cms_malloc(sizeof(MMS_FOLDER_SAVE_PARAM));
- SCI_ASSERT(p_folder_save_param != NULL);
- SCI_MEMSET(p_folder_save_param,0,sizeof(MMS_FOLDER_SAVE_PARAM));
- p_folder_save_param->p_edit_doc = p_edoc;
- p_folder_save_param->save_type = MMS_FOLDER_SAVE_TYPE_IMAGE;
- MMK_CreateWin((uint32*)MMIMMS_SAVE_VIDEO_LIST_TAB,(ADD_DATA)p_folder_save_param);
- }
- else if (!video_exist) //不存在视频
- {
- MMSDelDocument(p_edoc);
- SCI_TRACE_LOW("FNH after free MMS!");
- p_edoc = NULL;
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_VIDEO_EMPTY,
- IMAGE_PROMPT_ICON_ALERT,
- ALERT_TIMEOUT,
- PNULL
- );
- }
- }
- #else
- #endif
- break;
- case MSG_MMS_READ_FOR_SAVEPIC:
- {
- BOOLEAN image_exist = FALSE;
- pMMS_EDocument p_edoc = NULL;
- int8 slide_count = 0;
- if(g_pCurrentList->filename[0] == ' ')
- {
- break;
- }
- p_edoc = MMS_New();
- SCI_ASSERT(p_edoc != NULL);
- SCI_TRACE_LOW("FNH new mms!");
- SCI_TRACE_LOW("FNH before cms_parse_mms");
- cms_parse_mms((char *)g_pCurrentList->filename,p_edoc);
- mmsf_Remove((char *)g_pCurrentList->filename);
- SCI_TRACE_LOW("FNH AFTER cms_parse_mms");
- slide_count = MMSGetSlideCount(p_edoc);
- SCI_TRACE_LOW("FNH slide_count = %d",slide_count);
- if (slide_count > 0)//彩信有内容
- {
- pMMS_Slide p_mms_slide_temp = NULL;
- MMS_HeadSlide(p_edoc);
- while(p_edoc->slide_cur)
- {
- p_mms_slide_temp = p_edoc->slide_cur;
- if (p_mms_slide_temp->image_flag == 1)
- {
- image_exist = TRUE;
- SCI_TRACE_LOW("FNH image_exist = %d",image_exist);
- break;
- }
- p_edoc->slide_cur = p_edoc->slide_cur->next;
- }
- SCI_TRACE_LOW("FNH image_exist = %d",image_exist);
- }
- else //彩信没有内容
- {
- MMSDelDocument(p_edoc);
- SCI_TRACE_LOW("FNH after free MMS!");
- p_edoc = NULL;
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_EDIT_NO_CONTENT,
- IMAGE_PROMPT_ICON_ALERT,
- ALERT_TIMEOUT,
- PNULL
- );
- break;
- }
- if (image_exist ) //如果存在图象
- {
- P_MMS_FOLDER_SAVE_PARAM p_folder_save_param = NULL; /* 编辑器入口参数 */
- /*编辑器入口参数创建*/
- p_folder_save_param = cms_malloc(sizeof(MMS_FOLDER_SAVE_PARAM));
- SCI_ASSERT(p_folder_save_param != NULL);
- SCI_MEMSET(p_folder_save_param,0,sizeof(MMS_FOLDER_SAVE_PARAM));
- p_folder_save_param->p_edit_doc = p_edoc;
- p_folder_save_param->save_type = MMS_FOLDER_SAVE_TYPE_IMAGE;
- SCI_TRACE_LOW("FNH before mmimms_save_image_list_tab");
- MMK_CreateWin((uint32*)MMIMMS_SAVE_IMAGE_LIST_TAB,(ADD_DATA)p_folder_save_param);
- }
- else if (!image_exist) //不存在图象
- {
- MMSDelDocument(p_edoc);
- SCI_TRACE_LOW("FNH after free MMS!");
- p_edoc = NULL;
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_IMAGE_EMPTY,
- IMAGE_PROMPT_ICON_ALERT,
- ALERT_TIMEOUT,
- PNULL
- );
- }
- }
- break;
- case MSG_MMS_READ_FOR_SAVESOUND:
- {
- BOOLEAN audio_exist = FALSE;
- pMMS_EDocument p_edoc = NULL;
- int8 slide_count = 0;
- if(g_pCurrentList->filename[0] == ' ')
- {
- break;
- }
- p_edoc = MMS_New();
- SCI_ASSERT(p_edoc != NULL);
- SCI_TRACE_LOW("FNH new mms!");
- SCI_TRACE_LOW("FNH before cms_parse_mms");
- cms_parse_mms((char *)g_pCurrentList->filename,p_edoc);
- mmsf_Remove((char *)g_pCurrentList->filename);
- slide_count = MMSGetSlideCount(p_edoc);
- if (slide_count > 0)//彩信有内容
- {
- pMMS_Slide p_mms_slide_temp = NULL;
- MMS_HeadSlide(p_edoc);
- while(p_edoc->slide_cur)
- {
- p_mms_slide_temp = p_edoc->slide_cur;
- if (p_mms_slide_temp->audio_type != 0)
- {
- audio_exist = TRUE;
- break;
- }
- p_edoc->slide_cur = p_edoc->slide_cur->next;
- }
- }
- else //彩信没有内容
- {
- MMSDelDocument(p_edoc);
- SCI_TRACE_LOW("FNH after free MMS!");
- p_edoc = NULL;
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_EDIT_NO_CONTENT,
- IMAGE_PROMPT_ICON_ALERT,
- ALERT_TIMEOUT,
- PNULL
- );
- break;
- }
- if (audio_exist ) //如果存在音乐
- {
- P_MMS_FOLDER_SAVE_PARAM p_folder_save_param = NULL; /* 编辑器入口参数 */
- /*编辑器入口参数创建*/
- p_folder_save_param = cms_malloc(sizeof(MMS_FOLDER_SAVE_PARAM));
- SCI_ASSERT(p_folder_save_param != NULL);
- SCI_MEMSET(p_folder_save_param,0,sizeof(MMS_FOLDER_SAVE_PARAM));
- p_folder_save_param->p_edit_doc = p_edoc;
- p_folder_save_param->save_type = MMS_FOLDER_SAVE_TYPE_IMAGE;
- MMK_CreateWin((uint32*)MMIMMS_SAVE_MUSIC_LIST_TAB,(ADD_DATA)p_folder_save_param);
- }
- else if (!audio_exist) //不存在音乐
- {
- MMSDelDocument(p_edoc);
- SCI_TRACE_LOW("FNH after free MMS!");
- p_edoc = NULL;
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_MUSIC_EMPTY,
- IMAGE_PROMPT_ICON_ALERT,
- ALERT_TIMEOUT,
- PNULL
- );
- }
- }
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- // close the option window
- if(g_donewmms == TRUE)
- {
- MMIMMS_StoreFolder(g_pManager->inboxfolder);
- g_donewmms = FALSE;
- MMIMMS_SaveManagerInboxFile(MMS_SAVE_INBOX); //modify liangliu 2006-2-15
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXTSYS_WAITING,
- IMAGE_PROMPT_ICON_WAIT,
- ALERT_TIMEOUT,
- PNULL);
- }else
- {
- MMK_CloseWin(win_id);
- if(g_peditdoc != NULL)
- {
- MMSDelDocument(g_peditdoc);
- SCI_TRACE_LOW("FNH after free MMS!");
- g_peditdoc = NULL;
- }
- }
- break;
- default:
- err_code = MMI_RESULT_FALSE;
- break;
- }
- return err_code;
- }
- /*****************************************************************************/
- // Description : 5.4.7 Inbox : MMS detail window message handler
- // Global resource dependence :
- // Author:Bruce.Chi
- // changed liangliu for detail show
- // Note:
- /*****************************************************************************/
- LOCAL MMI_RESULT_E Inbox_HandleMMSDetailWinMsg(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_RESULT_E err_code = MMI_RESULT_TRUE;
- MMI_STRING_T dst_ptr = {0};
- MMI_STRING_T dst_temp = {0};
- MMI_STRING_T dst_temp1 = {0};
- MMI_STRING_T dst_temp2 ={0};
- MMI_STRING_T dst_temp3 ={0};
- MMI_STRING_T dst_temp4 ={0};
- MMI_STRING_T dst_temp5 ={0};
- MMI_STRING_T dst_temp6 ={0};
- MMI_STRING_T dst_time ={0};
- MMI_STRING_T dst_subject ={0};
- MMI_STRING_T dst_size ={0};
- MMI_STRING_T dst_pritority ={0};
- MMI_STRING_T dst_expiry = {0};
- MMI_STRING_T dst_sender = {0};
- MMI_STRING_T dst_to = {0};
- MMI_STRING_T dst_cc = {0};
- MMI_STRING_T changeline_ptr;
- char * changeline_str2_ptr = PNULL;
- uint8 * nowsubject = PNULL ;
- pMessageList tlist = PNULL;
- changeline_str2_ptr = (char *)cms_malloc(4);
- SCI_MEMSET(changeline_str2_ptr, 0, 4);
- sprintf(changeline_str2_ptr, "r");
- changeline_ptr.str_ptr = (uint8*)changeline_str2_ptr;
- changeline_ptr.is_ucs2 = FALSE;
- changeline_ptr.length =strlen(changeline_str2_ptr);
- switch(msg_id)
- {
- case MSG_FULL_PAINT:
- //clear
- MMIMMS_CLEAR_CLIENT();
- SCI_MEMSET(&dst_ptr, 0, sizeof(MMI_STRING_T));
- SCI_MEMSET(&dst_temp, 0, sizeof(MMI_STRING_T));
- SCI_MEMSET(&dst_temp1, 0, sizeof(MMI_STRING_T));
- SCI_MEMSET(&dst_temp2, 0, sizeof(MMI_STRING_T));
- SCI_MEMSET(&dst_temp3, 0, sizeof(MMI_STRING_T));
- SCI_MEMSET(&dst_temp4, 0, sizeof(MMI_STRING_T));
- SCI_MEMSET(&dst_temp5, 0, sizeof(MMI_STRING_T));
- SCI_MEMSET(&dst_temp6, 0, sizeof(MMI_STRING_T));
- SCI_MEMSET(&dst_time, 0, sizeof(MMI_STRING_T));
- SCI_MEMSET(&dst_subject, 0, sizeof(MMI_STRING_T));
- SCI_MEMSET(&dst_size, 0, sizeof(MMI_STRING_T));
- SCI_MEMSET(&dst_pritority, 0, sizeof(MMI_STRING_T));
- SCI_MEMSET(&dst_expiry, 0, sizeof(MMI_STRING_T));
- SCI_MEMSET(&dst_sender, 0, sizeof(MMI_STRING_T));
- SCI_MEMSET(&dst_to, 0, sizeof(MMI_STRING_T));
- SCI_MEMSET(&dst_cc, 0, sizeof(MMI_STRING_T));
- if(g_pManager->currentfolder->type == MMS_FOLDER_TYPE_INBOX)
- {
- tlist = g_pCurrentList;
- if (tlist->state == 0)
- {
- //notification
- /*fnh add 0509*/
- nowsubject = MMIMMS_GetListSubject(tlist);
- SCI_TRACE_BUF("nowsubject is %x",nowsubject,100);
- Detail_FormTime(&dst_time,tlist->date);
- Detail_FormSize(&dst_size,tlist->size);
- Detail_FormSubject(&dst_subject,nowsubject);
- Detail_FormPriority(&dst_pritority,tlist->pritority);
- Detail_FormExpiry(&dst_expiry,tlist->expiry);
- CatString(&dst_temp, &dst_time,&dst_size);
- CatString(&dst_temp2,&dst_temp,&dst_subject);
- CatString(&dst_temp3,&dst_temp2,&changeline_ptr);
- CatString(&dst_temp4, &dst_temp3,&dst_pritority);
- CatString(&dst_ptr, &dst_temp4, &dst_expiry);
- }
- else
- {
- nowsubject = MMIMMS_GetListSubject(tlist);
- SCI_TRACE_BUF("nowsubject is %x",nowsubject,100);
- Detail_FormTime(&dst_time,tlist->date);
- Detail_FormSize(&dst_size,tlist->size);
- Detail_FormSubject(&dst_subject,nowsubject);
- Detail_FormSender(&dst_sender,tlist->sender);
- if (strcmp((char *)tlist->to_address,MMIMMS_UNKNOWN_SENDER) == 0)
- {
- Detail_FormTo(&dst_to,NULL);
- }
- else
- {
- Detail_FormTo(&dst_to, tlist->to_address);
- }
- Detail_FormCc(&dst_cc, tlist->cc_address);
- Detail_FormPriority(&dst_pritority,tlist->pritority);
- CatString(&dst_temp, &dst_time,&dst_size);
- CatString(&dst_temp1,&dst_temp,&dst_subject);
- CatString(&dst_temp2,&dst_temp1,&changeline_ptr);
- CatString(&dst_temp3, &dst_temp2,&dst_sender);
- CatString(&dst_temp4, &dst_temp3, &dst_to);
- CatString(&dst_temp5, &dst_temp4, &dst_cc);
- CatString(&dst_ptr, &dst_temp5, &dst_pritority);
- }
- }else
- {
- tlist = g_pManager->currentfolder->currentmessage;
- nowsubject = MMIMMS_GetListSubject(tlist);
- SCI_TRACE_BUF("nowsubject is %x",nowsubject,100);
- SCI_TRACE_LOW("FNH in detail tlist->date = %s",tlist->date);
- Detail_FormTime(&dst_time,tlist->date);
- Detail_FormSize(&dst_size,tlist->size);
- Detail_FormSubject(&dst_subject,nowsubject);
- // Detail_FormSender(&dst_sender,tlist->sender);
- // SCI_TRACE_LOW("FNH to string is %s",tlist->to_address);
- if (strcmp((char *)tlist->to_address,MMIMMS_UNKNOWN_SENDER) == 0)
- {
- Detail_FormTo(&dst_to,NULL);
- }
- else
- {
- Detail_FormTo(&dst_to, tlist->to_address);
- }
- Detail_FormCc(&dst_cc, tlist->cc_address);
- Detail_FormPriority(&dst_pritority,tlist->pritority);
- CatString(&dst_temp, &dst_time,&dst_size);
- CatString(&dst_temp1,&dst_temp,&dst_subject);
- CatString(&dst_temp2,&dst_temp1,&changeline_ptr);
- // CatString(&dst_temp3, &dst_temp2,&dst_sender);
- CatString(&dst_temp4, &dst_temp2, &dst_to);
- CatString(&dst_temp5, &dst_temp4, &dst_cc);
- CatString(&dst_ptr, &dst_temp5, &dst_pritority);
- }
- /*fnh add 0509*/
- GUITEXTBOX_SetText(MMIMMS_DETAIL_TEXTBOX_CTRL_ID, &dst_ptr, TRUE);
- //set sofkey
- MMK_SetWinSoftkeyId(win_id, COMMON_TXT_NULL, COMMON_TXT_NULL, STXT_RETURN, TRUE);
- break;
- case MSG_OPEN_WINDOW:
- //set active control
- MMK_SetAtvCtrl(win_id, MMIMMS_DETAIL_TEXTBOX_CTRL_ID);
- break;
- case MSG_APP_CANCEL:
- // close the edit window
- MMK_CloseWin(win_id);
- break;
- case MSG_CLOSE_WINDOW:
- if(changeline_str2_ptr!=PNULL)
- {
- cms_free(changeline_str2_ptr);
- changeline_str2_ptr = PNULL;
- }
- if(nowsubject != PNULL)
- {
- cms_free(nowsubject);
- nowsubject = PNULL;
- }
- break;
- default:
- err_code = MMI_RESULT_FALSE;
- break;
- }
- return err_code;
- }
- /* ----------------------------------------------------------------------------
- * Function Name: Detail_FormSize
- * Purpose: 详情中得到彩信大小字符串
- * Input: MMI_STRING_T *str_dst, //out.
- uint8* size
- * Returns: BOOLEAN
- * Author:nihongf@mobilesoft.com.cn
- * ----------------------------------------------------------------------------*/
- BOOLEAN Detail_FormSize(
- MMI_STRING_T *str_dst, //out.
- uint32 size
- )
- {
- char* label_str2_ptr = PNULL;
- MMI_STRING_T label_string2;
- uint8 display_str[16] = {0};
- sprintf((void*)display_str,":%.1fkr",(float)size/ONE_K_LEN);
- label_string2.is_ucs2 = FALSE;
- label_string2.str_ptr = (uint8 *)display_str;
- label_string2.length = strlen((char*)display_str);
- CatStringByTextID(str_dst, TXT_MMS_DETAIL_SIZE, &label_string2);
- if(label_str2_ptr != PNULL)
- {
- cms_free(label_str2_ptr);
- label_str2_ptr = PNULL;
- }
- return TRUE;
- }
- /* ----------------------------------------------------------------------------
- * Function Name: Detail_FormTime
- * Purpose: 详情中得到时间字符串
- * Input: MMI_STRING_T *str_dst, //out.
- uint8* time
- * Returns: BOOLEAN
- * Author:nihongf@mobilesoft.com.cn
- * ----------------------------------------------------------------------------*/
- LOCAL BOOLEAN Detail_FormTime(
- MMI_STRING_T *str_dst, //out.
- uint8* time
- )
- {
- char* label_str2_ptr = PNULL;
- uint32 label_str2_len = 0;
- MMI_STRING_T label_string2;
- //fill label_string2 with "from"
- label_str2_len = 64;
- label_str2_ptr = (char*)cms_malloc(label_str2_len + 1);
- SCI_MEMSET(label_str2_ptr, 0, label_str2_len+1);
- sprintf(label_str2_ptr,
- ":%sr",time);
- // strcat(label_str2_ptr,"r");
- label_string2.is_ucs2 = FALSE;
- label_string2.str_ptr = (uint8 *)label_str2_ptr;
- label_string2.length = strlen(label_str2_ptr);
- // CatStringByTextID(&str_dst, TXT_MMS_DETAIL_RCV_TIME, &label_string2);
- CatStringByTextID(str_dst, TXT_TIME, &label_string2);
- if(label_str2_ptr != PNULL)
- {
- cms_free(label_str2_ptr);
- label_str2_ptr = PNULL;
- }
- return TRUE;
- }
- /*****************************************************************************/
- // Description : get the time string
- // Global resource dependence :
- // Author:liangliu 2005-11-25
- // Note:
- /*****************************************************************************/
- LOCAL BOOLEAN Detail_FormSubject(
- MMI_STRING_T *str_dst, //out.
- uint8* subject
- )
- {
- //char* label_str2_ptr = PNULL;
- //uint32 label_str2_len = 0;
- MMI_STRING_T label_string2 = {0};
- //UTF8_T utf8_str = {0};
- uint8* usc2_ptr = PNULL;
- label_string2.is_ucs2 = TRUE;
- label_string2.str_ptr = subject;//subject+2 to subject 2006-11-12 for download reset.
- label_string2.length = Cms_UTF16Strlen(subject)*2;
- CatStringByTextID(str_dst, TXT_MMS_VIEW_SUBJECT, &label_string2);
- //cms_free(label_str2_ptr);
- if(usc2_ptr != PNULL)
- {
- cms_free(usc2_ptr);
- usc2_ptr = PNULL;
- }
- return TRUE;
- }
- /* ----------------------------------------------------------------------------
- * Function Name: Detail_FormCc
- * Purpose: 详情中得到抄送人的字符串
- * Input: MMI_STRING_T *str_dst, //out.
- uint8* cc
- * Returns: BOOLEAN
- * Author:nihongf@mobilesoft.com.cn
- * ----------------------------------------------------------------------------*/
- LOCAL BOOLEAN Detail_FormCc(
- MMI_STRING_T *str_dst, //out.
- uint8* cc
- )
- {
- char* label_str2_ptr = PNULL;
- uint32 label_str2_len = 0;
- MMI_STRING_T label_string2;
- //fill label_string2 with "from"
- label_str2_len = 512;
- label_str2_ptr = (char*)cms_malloc(label_str2_len + 1);
- SCI_MEMSET(label_str2_ptr, 0, label_str2_len + 1);
- if(cc)
- {
- sprintf(label_str2_ptr,
- ":%sr",cc);
- label_string2.is_ucs2 = FALSE;
- label_string2.str_ptr = (uint8 *)label_str2_ptr;
- label_string2.length = strlen(label_str2_ptr);
- }
- else
- {
- sprintf(label_str2_ptr,
- ":%sr"," ");
- label_string2.str_ptr = (uint8 *)label_str2_ptr;
- label_string2.is_ucs2 = FALSE;
- label_string2.length =strlen(label_str2_ptr);
- }
- // CatStringByTextID(&str_dst, TXT_MMS_DETAIL_RCV_TIME, &label_string2);
- CatStringByTextID(str_dst, TXT_MMS_VIEW_CC, &label_string2);
- if(label_str2_ptr != PNULL)
- {
- cms_free(label_str2_ptr);
- label_str2_ptr = PNULL;
- }
- return TRUE;
- }
- /* ----------------------------------------------------------------------------
- * Function Name: Detail_FormSender
- * Purpose: 详情中得到发件人的字符串
- * Input: MMI_STRING_T *str_dst, //out.
- uint8* sender
- * Returns: BOOLEAN
- * Author:nihongf@mobilesoft.com.cn
- * ----------------------------------------------------------------------------*/
- LOCAL BOOLEAN Detail_FormSender(
- MMI_STRING_T *str_dst, //out.
- uint8* sender
- )
- {
- char* label_str2_ptr = PNULL;
- uint32 label_str2_len = 0;
- MMI_STRING_T label_string2;
- //fill label_string2 with "from"
- label_str2_len = 64;
- label_str2_ptr = (char*)cms_malloc(label_str2_len + 1);
- SCI_MEMSET(label_str2_ptr, 0, label_str2_len + 1);
- if(sender)
- {
- sprintf(label_str2_ptr,
- "%sr",sender);
- label_string2.is_ucs2 = FALSE;
- label_string2.str_ptr = (uint8 *)label_str2_ptr;
- label_string2.length = strlen(label_str2_ptr);
- }
- else
- {
- sprintf(label_str2_ptr,
- "%sr"," ");
- label_string2.str_ptr = (uint8 *)label_str2_ptr;
- label_string2.is_ucs2 = FALSE;
- label_string2.length =strlen(label_str2_ptr);
- }
- // CatStringByTextID(&str_dst, TXT_MMS_DETAIL_RCV_TIME, &label_string2);
- CatStringByTextID(str_dst, TXT_MMS_DETAIL_FROM, &label_string2);
- if(label_str2_ptr != PNULL)
- {
- cms_free(label_str2_ptr);
- label_str2_ptr = PNULL;
- }
- return TRUE;
- }
- /* ----------------------------------------------------------------------------
- * Function Name: Detail_FormTo
- * Purpose: 详情中得到收件人的字符串
- * Input: MMI_STRING_T *str_dst, //out.
- uint8* to
- * Returns: BOOLEAN
- * Author:nihongf@mobilesoft.com.cn
- * ----------------------------------------------------------------------------*/
- LOCAL BOOLEAN Detail_FormTo(
- MMI_STRING_T *str_dst, //out.
- uint8* to
- )
- {
- char* label_str2_ptr = PNULL;
- uint32 label_str2_len = 0;
- MMI_STRING_T label_string2;
- //fill label_string2 with "from"
- label_str2_len = 512;
- label_str2_ptr = (char*)cms_malloc(label_str2_len + 1);
- SCI_MEMSET(label_str2_ptr, 0, label_str2_len + 1);
- // SCI_TRACE_LOW("fnh in formto is %s",to);
- if(to)
- {
- sprintf(label_str2_ptr,
- ":%sr",to);
- // SCI_TRACE_LOW("fnh label_str2_ptr = %s",label_str2_ptr);
- label_string2.is_ucs2 = FALSE;
- label_string2.str_ptr = (uint8 *)label_str2_ptr;
- label_string2.length = strlen(label_str2_ptr);
- }
- else
- {
- sprintf(label_str2_ptr,
- ":%sr"," ");
- label_string2.str_ptr = (uint8 *)label_str2_ptr;
- label_string2.is_ucs2 = FALSE;
- label_string2.length =strlen(label_str2_ptr);
- }
- // CatStringByTextID(&str_dst, TXT_MMS_DETAIL_RCV_TIME, &label_string2);
- CatStringByTextID(str_dst, TXT_MMS_DETAIL_TO, &label_string2);
- if(label_str2_ptr != PNULL)
- {
- cms_free(label_str2_ptr);
- label_str2_ptr = PNULL;
- }
- return TRUE;
- }
- /* ----------------------------------------------------------------------------
- * Function Name: Detail_FormPriority
- * Purpose: 详情中得到优先级的字符串
- * Input: MMI_STRING_T *str_dst, //out.
- uint8* prioruty
- * Returns: BOOLEAN
- * Author:nihongf@mobilesoft.com.cn
- * ----------------------------------------------------------------------------*/
- LOCAL BOOLEAN Detail_FormPriority(
- MMI_STRING_T *str_dst, //out.
- uint32 priority
- )
- {
- uint32 text_id2 = COMMON_TXT_NULL;
- //char end_str[2] = "r";
- //MMI_STRING_T dst_str;
- //MMI_STRING_T label_string;
- //MMI_STRING_T label_string1;
- SCI_TRACE_LOW("FNH priority = %d",priority);
- switch(priority)
- {
- case MMS_PRIORITY_VALUE_LOW:
- text_id2 = TXT_MMS_PRIORITY_LOW;
- CatStringByTextID2(str_dst, TXT_MMS_DETAIL_PRIO, text_id2);
- break;
- case MMS_PRIORITY_VALUE_NORMAL:
- text_id2 = TXT_MMS_PRIORITY_MID;
- CatStringByTextID2(str_dst, TXT_MMS_DETAIL_PRIO, text_id2);
- break;
- case MMS_PRIORITY_VALUE_HIGH:
- text_id2 = TXT_MMS_PRIORITY_HIGH;
- CatStringByTextID2(str_dst, TXT_MMS_DETAIL_PRIO, text_id2);
- break;
- default:
- {
- char* label_str2_ptr = PNULL;
- uint32 label_str2_len = 0;
- MMI_STRING_T label_string2;
- label_str2_len = 10;
- label_str2_ptr = (char*)cms_malloc(label_str2_len + 1);
- SCI_MEMSET(label_str2_ptr, 0, label_str2_len + 1);
- sprintf(label_str2_ptr,
- "%sr"," ");
- label_string2.str_ptr = (uint8 *)label_str2_ptr;
- label_string2.is_ucs2 = FALSE;
- label_string2.length =strlen(label_str2_ptr);
- CatStringByTextID(str_dst, TXT_MMS_DETAIL_PRIO, &label_string2);
- }
- break;
- }
- return TRUE;
- }
- /* ----------------------------------------------------------------------------
- * Function Name: Detail_FormExpiry
- * Purpose: 详情中得到有效期的字符串
- * Input: MMI_STRING_T *str_dst, //out.
- uint8* expiry
- * Returns: BOOLEAN
- * Author:nihongf@mobilesoft.com.cn
- * ----------------------------------------------------------------------------*/
- LOCAL BOOLEAN Detail_FormExpiry(
- MMI_STRING_T *str_dst, //out.
- uint32 expiry
- )
- {
- char* label_str2_ptr = PNULL;
- uint32 label_str2_len = 0;
- MMI_STRING_T label_string2;
- label_str2_len = 16;
- label_str2_ptr = (char*)cms_malloc(label_str2_len + 1);
- SCI_MEMSET(label_str2_ptr, 0, label_str2_len + 1);
- sprintf(label_str2_ptr,":%ld hoursr",expiry);
- label_string2.str_ptr = (uint8 *)label_str2_ptr;
- label_string2.is_ucs2 = FALSE;
- label_string2.length =SCI_STRLEN((char *)label_str2_ptr);
- CatStringByTextID(str_dst, TXT_MMS_DURATION, &label_string2);
- if(label_str2_ptr != PNULL)
- {
- cms_free(label_str2_ptr);
- label_str2_ptr = PNULL;
- }
- return TRUE;
- }
- /*****************************************************************************/
- // Description : 5.5.1A Sentbox: message list window message handler
- // Global resource dependence :
- // Author:Bruce.Chi
- //changed liangl for message show
- // Note:
- /*****************************************************************************/
- LOCAL MMI_RESULT_E Sentbox_HandleListWinMsg(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_RESULT_E err_code = MMI_RESULT_TRUE;
- uint16 list_index = 0;
- int i = 0;
- MMS_CONTROL_ID_E list_ctrl_id = MMIMMS_SENTBOX_LIST_CTRL_ID;
- MMI_STRING_T name_ptr;
- MMI_MENU_GROUP_ID_T group_id = 0;
- MMI_MENU_ID_T menu_id = 0;
- uint16 message_num = 0;
- BOOLEAN is_content_ucs2 = FALSE;
- pMessageList tlist = PNULL;
- uint8 listptr[LISTMAXLENGTH];
- switch(msg_id)
- {
- case MSG_FULL_PAINT:
- MMIMMS_CLEAR_CLIENT();
- break;
- case MSG_OPEN_WINDOW:
- // MMK_SetWinSoftkeyId(win_id, STXT_OK, 0, STXT_RETURN, FALSE);
- MMK_SetWinSoftkeyId(win_id, STXT_OPTION, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- message_num = MMIMMS_GetMessageNum(g_pManager->currentfolder);
- if (message_num == 0)
- {
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_DRAFTBOX_EMPTY,
- IMAGE_PROMPT_ICON_WRONG,
- ALERT_TIMEOUT,
- PNULL
- );
- MMK_CloseWin(win_id);
- break;
- }
- GUILISTBOX_SetMaxItem(list_ctrl_id, MMIMMS_MAX_MMS_AND_MMSNOTI_NUM);
- //mms_sort_ptr = MMIMMS_Sort(MMIMESSAGE_INBOX, &message_num);
- //SCI_ASSERT(mms_sort_ptr != PNULL);
- if (message_num > 0)
- {
- tlist = g_pManager->currentfolder->root;
- for(i = 0; i < message_num; i++)
- {
- //is_content_ucs2 = ((mms_sort_ptr[i].status_flag & FLAG_MMS_CONTENT_IS_UCS2) != 0) ? TRUE : FALSE;
- if(tlist == g_pManager->currentfolder->currentmessage)
- {
- list_index = i ;
- }
- if(tlist->to_address != NULL)
- {
- // SCI_TRACE_LOW("FNH tlist->to_address = %s",tlist->to_address);
- SCI_TRACE_LOW("FNH address length = %d",strlen((char *)tlist->to_address));
- }
- else
- {
- SCI_TRACE_LOW("to address is NULL");
- }
- SCI_MEMSET(&name_ptr, 0, sizeof(MMI_STRING_T));
- name_ptr.str_ptr = cms_malloc(MMIPB_NAME_MAX_LEN);
- SCI_MEMSET(listptr, 0, LISTMAXLENGTH)
- if(SCI_STRLEN((char*)tlist->to_address) > LISTMAXLENGTH)
- {
- // tlist->to_address[LISTMAXLENGTH-1] = ' ';
- strncpy((char*)listptr,(char*)tlist->to_address,LISTMAXLENGTH);
- }else
- {
- SCI_STRCPY((char*)listptr,(char*)tlist->to_address);
- }
- // SCI_TRACE_LOW("fnh after strcpy tlist->to_address is %s",tlist->to_address);
- if (MMIMMS_GetPBNameByNumber(listptr,&name_ptr)== 1) //从电话簿中选择与号码匹配的名字
- {
- SCI_TRACE_BUF("fnh get pb_name = %x",name_ptr.str_ptr,10);
- SCI_TRACE_LOW("FNH GET PB_NAME_LENGTH = %d",name_ptr.length);
- SCI_TRACE_LOW("FNH is_ucs2 = %d",name_ptr.is_ucs2);
- AppendListItemWithIcon(
- (uint8 *)name_ptr.str_ptr,
- name_ptr.length,
- IMAGE_READ_MMS_ICON,
- name_ptr.is_ucs2,
- list_ctrl_id,
- STXT_OPTION
- );
- }
- else
- {
- AppendListItemWithIcon(
- listptr,
- SCI_STRLEN((char *)listptr),
- IMAGE_READ_MMS_ICON,
- is_content_ucs2,
- list_ctrl_id,
- STXT_OPTION
- );
- }
- if(tlist->next!=NULL)
- {
- tlist = tlist->next;//这里还要增加意外判断
- }
- else
- {
- tlist = g_pManager->currentfolder->root;
- }
- if (name_ptr.str_ptr)
- {
- cms_free(name_ptr.str_ptr);
- name_ptr.str_ptr = NULL;
- }
- }
- }
- //GUILISTBOX_SetCurItemIndex(list_ctrl_id,list_index);
- MMK_SetAtvCtrl(win_id, list_ctrl_id);
- GUILISTBOX_SetCurItemIndex(list_ctrl_id,list_index);
- break;
- case MSG_APP_OK:
- MMK_TrackPopupMenu(win_id);
- break;
- case MSG_GET_FOCUS://be careful, memory leak.
- g_pManager->currentfolder =g_pManager->sentfolder;
- message_num = MMIMMS_GetMessageNum(g_pManager->currentfolder);
- if (message_num == 0)
- {
- MMK_CloseWin(win_id);
- break;
- }
- GUILISTBOX_SetMaxItem(list_ctrl_id, MMIMMS_MAX_MMS_AND_MMSNOTI_NUM);
- if (message_num > 0)
- {
- tlist = g_pManager->currentfolder->root;
- for(i = 0; i < message_num; i++)
- {
- if(tlist == g_pManager->currentfolder->currentmessage)
- {
- list_index = i ;
- }
- SCI_MEMSET(&name_ptr, 0, sizeof(MMI_STRING_T));
- name_ptr.str_ptr = cms_malloc(MMIPB_NAME_MAX_LEN);
- SCI_MEMSET(listptr, 0, LISTMAXLENGTH)
- if(SCI_STRLEN((char*)tlist->to_address) > LISTMAXLENGTH)
- {
- strncpy((char*)listptr,(char*)tlist->to_address,LISTMAXLENGTH);
- }else
- {
- SCI_STRCPY((char*)listptr,(char*)tlist->to_address);
- }
- // SCI_TRACE_LOW("fnh get_focus to is %s",tlist->to_address);
- if (MMIMMS_GetPBNameByNumber(listptr,&name_ptr)== 1) //从电话簿中选择与号码匹配的名字
- {
- SCI_TRACE_BUF("fnh get pb_name = %x",name_ptr.str_ptr,10);
- SCI_TRACE_LOW("FNH GET PB_NAME_LENGTH = %d",name_ptr.length);
- SCI_TRACE_LOW("FNH is_ucs2 = %d",name_ptr.is_ucs2);
- AppendListItemWithIcon(
- (uint8 *)name_ptr.str_ptr,
- name_ptr.length,
- IMAGE_READ_MMS_ICON,
- name_ptr.is_ucs2,
- list_ctrl_id,
- STXT_OPTION
- );
- }
- else
- {
- AppendListItemWithIcon(
- listptr,
- SCI_STRLEN((char*)listptr),
- IMAGE_READ_MMS_ICON,
- is_content_ucs2,
- list_ctrl_id,
- STXT_OPTION
- );
- }
- if(tlist->next!=NULL)
- {
- tlist = tlist->next;//这里还要增加意外判断
- }
- else
- {
- tlist = g_pManager->currentfolder->root;
- }
- if (name_ptr.str_ptr)
- {
- cms_free(name_ptr.str_ptr);
- name_ptr.str_ptr = NULL;
- }
- }
- }
- GUILISTBOX_SetCurItemIndex(list_ctrl_id,list_index);
- MMK_SetAtvCtrl(win_id, list_ctrl_id);
- //GUILISTBOX_SetCurItemIndex(list_ctrl_id,list_index);
- break;
- case MSG_LOSE_FOCUS:
- break;
- case MSG_CTL_OK:
- if ( MMIMMS_SENTBOX_POPMENU_CTRL_ID != (MMI_CTRL_ID_T)param )
- {
- break;
- }
- //get selected list index
- list_index = GUILISTBOX_GetCurItemIndex(list_ctrl_id);
- g_pManager->currentfolder->currentmessage = g_pManager->currentfolder->root;
- for(i = 0 ;i < list_index;i++)
- {
- g_pManager->currentfolder->currentmessage = g_pManager->currentfolder->currentmessage->next;
- }
- GUIMENU_GetRetID((MMI_CTRL_ID_T)param, &group_id, &menu_id);
- switch( menu_id )
- {
- case ID_MMS_SENTBOX_FORWARD:
- g_filetype = MMICMS_GetCurrentFFS();
- if (g_filetype != FS_INVALID)
- {
- g_readforstate = MMS_MSG_SENTBOX_READ_FOR_FW;
- MMIMMS_CreateReadMMSWaitingWin();
- MMIMMS_ReadMMS(g_pManager->currentfolder->currentmessage);
- }
- break;
- case ID_MMS_SENTBOX_PLAY:
- g_filetype = MMICMS_GetCurrentFFS();
- if (g_filetype != FS_INVALID)
- {
- g_readforstate = MMS_MSG_SENTBOX_READ_FOR_PLAY;
- MMIMMS_CreateReadMMSWaitingWin();
- MMIMMS_ReadMMS(g_pManager->currentfolder->currentmessage);
- }
- break;
- case ID_MMS_SENTBOX_DEL:
- PUBWIN_OpenPromptQueryWin(TXT_MMS_IF_DEL, IMAGE_PROMPT_ICON_QUERY);
- break;
- case ID_MMS_SENTBOX_DEL_MORE:
- PUBWIN_OpenPromptQueryWin(TXT_MMS_IF_DEL, IMAGE_PROMPT_ICON_QUERY);
- break;
- case ID_MMS_SENTBOX_DETAIL:
- MMK_CreateWin((uint32 *)MMIMMS_INBOX_DETAIL_WIN, PNULL);
- break;
- default:
- SCI_ASSERT(0);
- break;
- }
- break;
- case MSG_PROMPTWIN_OK:
- GUIMENU_GetRetID((MMI_CTRL_ID_T)MMIMMS_SENTBOX_POPMENU_CTRL_ID, (MMI_MENU_GROUP_ID_T *)(&group_id),(MMI_MENU_ID_T *) (&menu_id));
- switch(menu_id )
- {
- case ID_MMS_SENTBOX_DEL:
- PUBWIN_ClosePromptQueryWin();//here should close the win and open the waitwin for delete.
- g_savestate = MMS_MSG_SAVEFILE_FOR_SENTBOX_DELETE;
- MMIMMS_CreateNormalWaitingWin();
- MMIMMS_DeleteMMS(g_pManager->currentfolder);
- // MMK_CloseWin(win_id);
- break;
- case ID_MMS_SENTBOX_DEL_MORE:
- PUBWIN_ClosePromptQueryWin();//here should close the win and open the waitwin for delete.
- // MMK_CloseWin(win_id);
- g_savestate = MMS_MSG_SAVEFILE_FOR_SENTBOX_DELETE;
- MMIMMS_CreateNormalWaitingWin();
- MMIMMS_DeleteAllMMS(g_pManager->currentfolder);
- break;
- default:
- break;
- }
- break;
- case MSG_MMS_READ_FOR_PLAY:
- {
- g_peditdoc = MMS_New();
- SCI_ASSERT(g_peditdoc != NULL);
- SCI_TRACE_LOW("FNH new mms!");
- SCI_TRACE_LOW("FNH before cms_parse_mms");
- cms_parse_mms((char *)g_pManager->currentfolder->currentmessage->filename,g_peditdoc);
- SCI_TRACE_LOW("FNH after cms_parse_Mms");
- mmsf_Remove((char *)g_pManager->currentfolder->currentmessage->filename);
- SCI_TRACE_LOW("FNH after mmsf_Remove");
- if (g_peditdoc->slide_cur == NULL)
- {
- MMSDelDocument(g_peditdoc);
- g_peditdoc = NULL;
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_EDIT_NO_CONTENT,
- IMAGE_PROMPT_ICON_ALERT,
- ALERT_TIMEOUT,
- PNULL
- );
- break;
- }
- else
- {
- play_or_preview = MMS_PLAY;//播放
- SCI_TRACE_LOW("FNH before play mms!");
- MMK_CreateWin((uint32 *)MMIMMS_EDIT_PREVIEW_TAB,(ADD_DATA)g_peditdoc);
- }
- break;
- }
- case MSG_MMS_READ_FOR_FW:
- {
- MMSHANDLE p_mmsdoc = NULL;
- int8 from[MAX_NAME_LENGTH];
- SCI_MEMSET(from,0,sizeof(from));
- g_p_mms_subject = (int8 *)cms_malloc(MMIMMS_MAX_SUBJECTS_LEN+1);
- SCI_ASSERT(g_p_mms_subject != NULL);
- SCI_MEMSET(g_p_mms_subject,0,MMIMMS_MAX_SUBJECTS_LEN+1);
- p_mmsdoc = (MMSHANDLE)MMS_NewMms();
- if(p_mmsdoc==0)
- {
- return err_code;
- }
- if (g_pManager->currentfolder->currentmessage->subject!= NULL)
- {
- uint16 outlen = 0;
- uint8 * uni_16 =PNULL;
- outlen = Cms_UTF8toUTF16Len(g_pManager->currentfolder->currentmessage->subject);
- uni_16 =(uint8 *)cms_malloc(outlen);
- SCI_MEMSET(uni_16,0,outlen);
- Cms_UTF8toUTF16(g_pManager->currentfolder->currentmessage->subject,SCI_STRLEN((char *)g_pManager->currentfolder->currentmessage->subject),outlen,uni_16);
- if (outlen > MMIMMS_MAX_SUBJECTS_LEN-2)
- {
- outlen = MMIMMS_MAX_SUBJECTS_LEN-2;
- }
- SCI_MEMCPY(g_p_mms_subject,&outlen,2);
- SCI_MEMCPY((int8 *)(g_p_mms_subject+2),uni_16,outlen);
- SCI_TRACE_BUF("FNH g_p_mms_subject = ",g_p_mms_subject,10);
- if (uni_16)
- {
- cms_free(uni_16);
- uni_16 = NULL;
- }
- MMIMMS_OptionSubject(MMSFW);
- }
- else
- {
- MMIMMS_OptionSubject(MMSFW);
- }
- MMS_SetMmsFile(p_mmsdoc, (char *)g_pManager->currentfolder->currentmessage->filename);
- /* 获得发件人信息,作为收件人 */
- MMS_DecodeMms(p_mmsdoc);
- /* 删除临时彩信文档 */
- MMS_DeleteMms(p_mmsdoc);
- g_peditdoc = MMS_New();
- SCI_ASSERT(g_peditdoc != NULL);
- SCI_TRACE_LOW("FNH before cms_parse_mms");
- cms_parse_mms((char *)g_pManager->currentfolder->currentmessage->filename,g_peditdoc);
- mmsf_Remove((char *)g_pManager->currentfolder->currentmessage->filename);
- SCI_TRACE_LOW("FNH after cms_parse_Mms");
- // MMK_CreateWin((uint32 *)MMIMMS_EDIT_OPTION_TAB,PNULL);
- g_mms_edit_status = MMS_EDIT_FORWARD_MMS;
- MMK_CreateWin((uint32 *)MMIMMS_EDIT_WIN_TAB,PNULL);
- }
- break;
- case MSG_PROMPTWIN_CANCEL:
- //close query window
- PUBWIN_ClosePromptQueryWin();
- break;
- case MSG_CTL_DBCLICK:
- // if ( MMIMMS_SENTBOX_POPMENU_CTRL_ID != (MMI_CTRL_ID_T)param )
- // {
- // break;
- // }
- //get selected list index
- list_index = GUILISTBOX_GetCurItemIndex(list_ctrl_id);
- g_pManager->currentfolder->currentmessage = g_pManager->currentfolder->root;
- for(i = 0 ;i < list_index;i++)
- {
- g_pManager->currentfolder->currentmessage = g_pManager->currentfolder->currentmessage->next;
- }
- g_readforstate = MMS_MSG_SENTBOX_READ_FOR_PLAY;
- MMIMMS_CreateReadMMSWaitingWin();
- MMIMMS_ReadMMS(g_pManager->currentfolder->currentmessage);
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- if(MMK_GetActiveCtrlId(win_id) == MMIMMS_SENTBOX_POPMENU_CTRL_ID)
- {
- uint8 i = 4;
- uint32 j = 0x00ad0002;
- MMK_SetAtvCtrl(win_id, MMIMMS_SENTBOX_LIST_CTRL_ID);
- MMK_PostMsg(win_id, MSG_TP_PRESS_DOWN, (DPARAM)&j, i);
- }
- else
- {
- MMK_CloseWin(win_id);
- } //cloud6
- break;
- case MSG_CLOSE_WINDOW:
- /* 删除编辑器资源 */
- if(g_peditdoc != NULL)
- {
- MMSDelDocument(g_peditdoc);
- SCI_TRACE_LOW("FNH after free MMS!");
- g_peditdoc = NULL;
- }
- break;
- default:
- err_code = MMI_RESULT_FALSE;
- break;
- }
- return err_code;
- }
- /*****************************************************************************/
- // Description : 5.7.1A Outbox: message list window message handler
- // Global resource dependence :
- // Author:Bruce.Chi
- //changed liangl for messsage show
- // Note:
- /*****************************************************************************/
- LOCAL MMI_RESULT_E Outbox_HandleListWinMsg(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_RESULT_E err_code = MMI_RESULT_TRUE;
- uint16 list_index = 0;
- int i = 0;
- MMS_CONTROL_ID_E list_ctrl_id = MMIMMS_OUTBOX_LIST_CTRL_ID;
- uint16 message_num = 0;
- BOOLEAN is_content_ucs2 = FALSE;
- pMessageList tlist = PNULL;
- MMI_STRING_T name_ptr;
- MMI_MENU_ID_T menu_id = 0;
- MMI_MENU_GROUP_ID_T group_id = 0;
- uint8 listptr[LISTMAXLENGTH];
- switch(msg_id)
- {
- case MSG_FULL_PAINT:
- MMIMMS_CLEAR_CLIENT();
- break;
- case MSG_OPEN_WINDOW:
- MMK_SetWinSoftkeyId(win_id, STXT_OPTION, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- message_num = MMIMMS_GetMessageNum(g_pManager->currentfolder);
- g_pManager->currentfolder->currentmessage = g_pManager->currentfolder->root;//modify 2005-12-2
- if (message_num == 0)
- {
- MMK_CloseWin(win_id);
- break;
- }
- GUILISTBOX_SetMaxItem(list_ctrl_id, MMIMMS_MAX_MMS_AND_MMSNOTI_NUM);
- if (message_num > 0)
- {
- tlist = g_pManager->currentfolder->root;
- for(i = 0; i < message_num; i++)
- {
- //is_content_ucs2 = ((mms_sort_ptr[i].status_flag & FLAG_MMS_CONTENT_IS_UCS2) != 0) ? TRUE : FALSE;
- if(tlist == g_pManager->currentfolder->currentmessage)
- {
- list_index = i ;
- }
- SCI_MEMSET(&name_ptr, 0, sizeof(MMI_STRING_T));
- name_ptr.str_ptr = cms_malloc(MMIPB_NAME_MAX_LEN);
- SCI_MEMSET(listptr, 0, LISTMAXLENGTH)
- if(SCI_STRLEN((char*)tlist->to_address) > LISTMAXLENGTH)
- {
- strncpy((char*)listptr,(char*)tlist->to_address,LISTMAXLENGTH);
- }else
- {
- SCI_STRCPY((char*)listptr,(char*)tlist->to_address);
- }
- if (MMIMMS_GetPBNameByNumber(listptr,&name_ptr)== 1) //从电话簿中选择与号码匹配的名字
- {
- SCI_TRACE_LOW("fnh get pb_name = %s",name_ptr.str_ptr);
- SCI_TRACE_LOW("FNH GET PB_NAME_LENGTH = %d",name_ptr.length);
- AppendListItemWithIcon(
- (uint8 *)name_ptr.str_ptr,
- name_ptr.length,
- IMAGE_READ_MMS_ICON,
- name_ptr.is_ucs2,
- list_ctrl_id,
- STXT_OPTION
- );
- }
- else
- {
- AppendListItemWithIcon(
- listptr,
- SCI_STRLEN((char*)listptr),
- IMAGE_READ_MMS_ICON,
- is_content_ucs2,
- list_ctrl_id,
- STXT_OPTION
- );
- }
- if(tlist->next!=NULL)
- {
- tlist = tlist->next;//这里还要增加意外判断
- }
- else
- {
- tlist = g_pManager->currentfolder->root;
- }
- if (name_ptr.str_ptr)
- {
- cms_free(name_ptr.str_ptr);
- name_ptr.str_ptr = NULL;
- }
- }
- }
- //GUILISTBOX_SetCurItemIndex(list_ctrl_id,list_index);
- MMK_SetAtvCtrl(win_id, list_ctrl_id);
- GUILISTBOX_SetCurItemIndex(list_ctrl_id,list_index);
- break;
- case MSG_GET_FOCUS://be careful, memory leak.
- //total_num = MMIMMS_GetMailboxMsgNum(MMIMESSAGE_INBOX);
- g_pManager->currentfolder =g_pManager->outboxfolder;
- message_num = MMIMMS_GetMessageNum(g_pManager->currentfolder);
- if (message_num == 0)
- {
- MMK_CloseWin(win_id);
- break;
- }
- GUILISTBOX_SetMaxItem(list_ctrl_id, MMIMMS_MAX_MMS_AND_MMSNOTI_NUM);
- //mms_sort_ptr = MMIMMS_Sort(MMIMESSAGE_INBOX, &message_num);
- //SCI_ASSERT(mms_sort_ptr != PNULL);
- if (message_num > 0)
- {
- tlist = g_pManager->currentfolder->root;
- for(i = 0; i < message_num; i++)
- {
- //is_content_ucs2 = ((mms_sort_ptr[i].status_flag & FLAG_MMS_CONTENT_IS_UCS2) != 0) ? TRUE : FALSE;
- if(tlist == g_pManager->currentfolder->currentmessage)
- {
- list_index = i ;
- }
- SCI_MEMSET(&name_ptr, 0, sizeof(MMI_STRING_T));
- name_ptr.str_ptr = cms_malloc(MMIPB_NAME_MAX_LEN);
- SCI_MEMSET(listptr, 0, LISTMAXLENGTH)
- if(SCI_STRLEN((char*)tlist->to_address) > LISTMAXLENGTH)
- {
- strncpy((char*)listptr,(char*)tlist->to_address,LISTMAXLENGTH);
- }else
- {
- SCI_STRCPY((char*)listptr,(char*)tlist->to_address);
- }
- if (MMIMMS_GetPBNameByNumber(listptr,&name_ptr)== 1) //从电话簿中选择与号码匹配的名字
- {
- SCI_TRACE_LOW("fnh get pb_name = %s",name_ptr.str_ptr);
- SCI_TRACE_LOW("FNH GET PB_NAME_LENGTH = %d",name_ptr.length);
- AppendListItemWithIcon(
- (uint8 *)name_ptr.str_ptr,
- name_ptr.length,
- IMAGE_READ_MMS_ICON,
- name_ptr.is_ucs2,
- list_ctrl_id,
- STXT_OPTION
- );
- }
- else
- {
- AppendListItemWithIcon(
- listptr,
- SCI_STRLEN((char*)listptr),
- IMAGE_READ_MMS_ICON,
- is_content_ucs2,
- list_ctrl_id,
- STXT_OPTION
- );
- }
- if(tlist->next!=NULL)
- {
- tlist = tlist->next;//这里还要增加意外判断
- }
- else
- {
- tlist = g_pManager->currentfolder->root;
- }
- if (name_ptr.str_ptr)
- {
- cms_free(name_ptr.str_ptr);
- name_ptr.str_ptr = NULL;
- }
- }
- }
- GUILISTBOX_SetCurItemIndex(list_ctrl_id,list_index);
- MMK_SetAtvCtrl(win_id, list_ctrl_id);
- //GUILISTBOX_SetCurItemIndex(list_ctrl_id,list_index);
- break;
- case MSG_LOSE_FOCUS:
- break;
- case MSG_APP_OK:
- if(MMK_GetActiveCtrlId(win_id) != MMIMMS_OUTBOX_POPMENU_CTRL_ID)
- MMK_TrackPopupMenu(win_id);
- break;
- case MSG_CTL_OK:
- if ( MMIMMS_OUTBOX_POPMENU_CTRL_ID != (MMI_CTRL_ID_T)param )
- {
- break;
- }
- //get selected list index
- list_index = GUILISTBOX_GetCurItemIndex(list_ctrl_id);
- g_pManager->currentfolder->currentmessage = g_pManager->currentfolder->root;
- for(i = 0 ;i < list_index;i++)
- {
- g_pManager->currentfolder->currentmessage = g_pManager->currentfolder->currentmessage->next;
- }
- GUIMENU_GetRetID((MMI_CTRL_ID_T)param, &group_id, &menu_id);
- switch( menu_id )
- {
- case ID_MMS_OUTBOX_SEND:
- if (CC_IsInCall())
- {
- //alert : TXT_MMS_CANNOT_SEND_IN_CALL
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_CANNOT_SEND_IN_CALL,
- IMAGE_PROMPT_ICON_ALERT,
- ALERT_TIMEOUT,
- PNULL
- );
- }
- else
- {
- g_filetype = MMICMS_GetCurrentFFS();
- if (g_filetype != FS_INVALID)
- {
- g_readforstate = MMS_MSG_OUTBOX_READ_FOR_SEND;
- MMIMMS_CreateReadMMSWaitingWin();
- MMIMMS_ReadMMS(g_pManager->currentfolder->currentmessage);
- }
- break;
- }
- break;
- case ID_MMS_OUTBOX_PLAY:
- g_filetype = MMICMS_GetCurrentFFS();
- if (g_filetype != FS_INVALID)
- {
- g_readforstate = MMS_MSG_OUTBOX_READ_FOR_PLAY;
- MMIMMS_CreateReadMMSWaitingWin();
- MMIMMS_ReadMMS(g_pManager->currentfolder->currentmessage);
- }
- break;
- case ID_MMS_OUTBOX_EDIT:
- g_filetype = MMICMS_GetCurrentFFS();
- if (g_filetype != FS_INVALID)
- {
- g_readforstate = MMS_MSG_OUTBOX_READ_FOR_EDIT;
- MMIMMS_CreateReadMMSWaitingWin();
- MMIMMS_ReadMMS(g_pManager->currentfolder->currentmessage);
- }
- break;
- case ID_MMS_OUTBOX_DEL:
- PUBWIN_OpenPromptQueryWin(TXT_MMS_IF_DEL, IMAGE_PROMPT_ICON_QUERY);
- break;
- case ID_MMS_OUTBOX_DEL_MORE:
- PUBWIN_OpenPromptQueryWin(TXT_MMS_IF_DEL, IMAGE_PROMPT_ICON_QUERY);
- break;
- default:
- SCI_ASSERT(0);
- break;
- }
- break;
- case MSG_MMS_READ_FOR_SEND:
- if (CC_IsInCall()) //judge whether it's making a call
- {
- //alert : TXT_MMS_CANNOT_SEND_IN_CALL
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_CANNOT_SEND_IN_CALL,
- IMAGE_PROMPT_ICON_ALERT,
- ALERT_TIMEOUT,
- PNULL
- );
- }
- else if (! (MMISMS_IsReady() && MMISMS_IsOrderOk())) //judge whether sms_order ready
- {
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXTSYS_WAITING,
- IMAGE_PROMPT_ICON_WAIT,
- MMISMS_3SECOND, PNULL
- );
- }
- else
- {
- g_mailbox_status = SEND_OUTBOX_MMS;
- g_progressneedsize = g_pManager->currentfolder->currentmessage->size;
- MMIMMS_SendMMS_CreateSendingWin();
- g_netusing = MMS_MSG_NETUSING_STEP1;//modify 2006-2-10 liangliu
- CmsSendMessage(SEND_OUTBOX_MMS);
- // MMK_CloseWin(win_id);//liangliu modify 2005-12-2
- }
- break;
- case MSG_MMS_READ_FOR_PLAY:
- {
- g_peditdoc = MMS_New();
- SCI_ASSERT(g_peditdoc != NULL);
- SCI_TRACE_LOW("FNH new mms!");
- SCI_TRACE_LOW("FNH before cms_parse_mms");
- cms_parse_mms((char *)g_pManager->currentfolder->currentmessage->filename,g_peditdoc);
- mmsf_Remove((char *)g_pManager->currentfolder->currentmessage->filename);
- //SCI_MEMSET(g_peditdoc, 0, sizeof(MMS_EDOCUMENT) );
- //cms_parse_mms(transit_filename,g_peditdoc);
- SCI_TRACE_LOW("FNH after cms_parse_Mms");
- if (g_peditdoc->slide_cur == NULL)
- {
- MMSDelDocument(g_peditdoc);
- g_peditdoc = NULL;
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_EDIT_NO_CONTENT,
- IMAGE_PROMPT_ICON_ALERT,
- ALERT_TIMEOUT,
- PNULL
- );
- break;
- }
- else
- {
- play_or_preview = MMS_PLAY;//播放
- SCI_TRACE_LOW("FNH before play mms!");
- MMK_CreateWin((uint32 *)MMIMMS_EDIT_PREVIEW_TAB,(ADD_DATA)g_peditdoc);
- }
- }
- break;
- case MSG_MMS_READ_FOR_EDIT:
- {
- g_peditdoc = MMS_New();
- SCI_ASSERT(g_peditdoc != NULL);
- SCI_TRACE_LOW("FNH new mms!");
- g_p_mms_subject = (int8 *)cms_malloc(MMIMMS_MAX_SUBJECTS_LEN+1);
- SCI_ASSERT(g_p_mms_subject != NULL);
- SCI_MEMSET(g_p_mms_subject,0,MMIMMS_MAX_SUBJECTS_LEN+1);
- if (g_pManager->currentfolder->currentmessage->subject!= NULL)
- {
- uint16 outlen = 0;
- uint8 * uni_16 =PNULL;
- outlen = Cms_UTF8toUTF16Len(g_pManager->currentfolder->currentmessage->subject);
- uni_16 =(uint8 *)cms_malloc(outlen);
- SCI_MEMSET(uni_16,0,outlen);
- Cms_UTF8toUTF16(g_pManager->currentfolder->currentmessage->subject,SCI_STRLEN((char *)g_pManager->currentfolder->currentmessage->subject),outlen,uni_16);
- if (outlen > MMIMMS_MAX_SUBJECTS_LEN-2)
- {
- outlen = MMIMMS_MAX_SUBJECTS_LEN-2;
- }
- SCI_MEMCPY(g_p_mms_subject,&outlen,2);
- SCI_MEMCPY((int8 *)(g_p_mms_subject+2),uni_16,outlen);
- SCI_TRACE_BUF("FNH g_p_mms_subject = ",g_p_mms_subject,10);
- if (uni_16)
- {
- cms_free(uni_16);
- uni_16 = NULL;
- }
- MMIMMS_OptionSubject(MMSEDIT);
- }
- if ((g_pManager->currentfolder->currentmessage->to_address != NULL)
- && (strcmp((char *)g_pManager->currentfolder->currentmessage->to_address ,MMIMMS_UNKNOWN_SENDER)!=0))
- {
- g_p_mms_to = (p_MMS_RECEPIENT)cms_malloc(sizeof(MMS_RECEPIENT));
- SCI_MEMSET(g_p_mms_to,0,sizeof(MMS_RECEPIENT));
- CmsMmsParseRecepient(g_p_mms_to,(char *)g_pManager->currentfolder->currentmessage->to_address);
- }
- if (g_pManager->currentfolder->currentmessage->cc_address != NULL)
- {
- g_p_mms_cc = (p_MMS_RECEPIENT)cms_malloc(sizeof(MMS_RECEPIENT));
- SCI_MEMSET(g_p_mms_cc,0,sizeof(MMS_RECEPIENT));
- CmsMmsParseRecepient(g_p_mms_cc,(char *)g_pManager->currentfolder->currentmessage->cc_address);
- }
- if (g_pManager->currentfolder->currentmessage->bcc_address != NULL)
- {
- g_p_mms_bcc = (p_MMS_RECEPIENT)cms_malloc(sizeof(MMS_RECEPIENT));
- SCI_MEMSET(g_p_mms_bcc,0,sizeof(MMS_RECEPIENT));
- CmsMmsParseRecepient(g_p_mms_bcc,(char *)g_pManager->currentfolder->currentmessage->bcc_address);
- }
- SCI_TRACE_LOW("before cms_parse_mms");
- SCI_TRACE_LOW("fnh filename = %s",g_pManager->currentfolder->currentmessage->filename);
- cms_parse_mms((char *)g_pManager->currentfolder->currentmessage->filename,g_peditdoc);
- SCI_TRACE_LOW("fnh g_peditdoc->slide_cur = %d",g_peditdoc->slide_cur);
- mmsf_Remove((char *)g_pManager->currentfolder->currentmessage->filename);
- // cms_parse_mms((char *)transit_filename,g_peditdoc);
- SCI_TRACE_LOW("FNH after cms_parse_Mms");
- // MMK_CreateWin((uint32 *)MMIMMS_EDIT_OPTION_TAB,PNULL);
- g_mms_edit_status = MMS_EDIT_REPEAT_EDIT_MMS;
- MMK_CreateWin((uint32 *)MMIMMS_EDIT_WIN_TAB,PNULL);
- }
- break;
- case MSG_PROMPTWIN_OK:
- GUIMENU_GetRetID((MMI_CTRL_ID_T)MMIMMS_OUTBOX_POPMENU_CTRL_ID, (MMI_MENU_GROUP_ID_T *)(&group_id),(MMI_MENU_ID_T *) (&menu_id));
- switch(menu_id)
- {
- case ID_MMS_OUTBOX_DEL:
- PUBWIN_ClosePromptQueryWin();//here should close the win and open the waitwin for delete.
- g_savestate = MMS_MSG_SAVEFILE_FOR_OUTBOX_DELETE;
- MMIMMS_CreateNormalWaitingWin();
- MMIMMS_DeleteMMS(g_pManager->currentfolder);
- // MMK_CloseWin(win_id);
- break;
- case ID_MMS_OUTBOX_DEL_MORE:
- PUBWIN_ClosePromptQueryWin();//here should close the win and open the waitwin for delete.
- // MMK_CloseWin(win_id);
- g_savestate = MMS_MSG_SAVEFILE_FOR_OUTBOX_DELETE;
- MMIMMS_CreateNormalWaitingWin();
- MMIMMS_DeleteAllMMS(g_pManager->currentfolder);
- break;
- default:
- break;
- }
- break;
- case MSG_PROMPTWIN_CANCEL:
- //close query window
- PUBWIN_ClosePromptQueryWin();
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- if(MMK_GetActiveCtrlId(win_id) == MMIMMS_OUTBOX_POPMENU_CTRL_ID)
- {
- uint8 i = 4;
- uint32 j = 0x00ad0002;
- MMK_SetAtvCtrl(win_id, MMIMMS_OUTBOX_LIST_CTRL_ID);
- MMK_PostMsg(win_id, MSG_TP_PRESS_DOWN, (DPARAM)&j, i);
- }
- else
- {
- MMK_CloseWin(win_id);
- } //cloud6
- /* FILENAME */
- break;
- case MSG_CTL_DBCLICK:
- list_index = GUILISTBOX_GetCurItemIndex(list_ctrl_id);
- g_pManager->currentfolder->currentmessage = g_pManager->currentfolder->root;
- for(i = 0 ;i < list_index;i++)
- {
- g_pManager->currentfolder->currentmessage = g_pManager->currentfolder->currentmessage->next;
- }
- g_readforstate = MMS_MSG_OUTBOX_READ_FOR_PLAY;
- MMIMMS_CreateReadMMSWaitingWin();
- MMIMMS_ReadMMS(g_pManager->currentfolder->currentmessage);
- break;
- default:
- err_code = MMI_RESULT_FALSE;
- break;
- }
- return err_code;
- }
- /*****************************************************************************/
- // Description : 5.7.1A DraftBox : list of draft window message handler
- // Global resource dependence :
- // Author:Bruce.Chi
- // changed liangl for message show
- // Note:
- /*****************************************************************************/
- LOCAL MMI_RESULT_E DraftBox_HandleListWinMsg(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_RESULT_E err_code = MMI_RESULT_TRUE;
- uint16 list_index = 0;
- int i = 0;
- MMS_CONTROL_ID_E list_ctrl_id = MMIMMS_DRAFTBOX_LIST_CTRL_ID;
- MMI_STRING_T name_ptr;
- MMI_MENU_ID_T menu_id = 0;
- MMI_MENU_GROUP_ID_T group_id = 0;
- uint16 message_num = 0;
- BOOLEAN is_content_ucs2 = FALSE;
- pMessageList tlist = PNULL;
- uint8 listptr[LISTMAXLENGTH];
- switch(msg_id)
- {
- case MSG_FULL_PAINT:
- MMIMMS_CLEAR_CLIENT();
- break;
- case MSG_OPEN_WINDOW:
- // MMK_SetWinSoftkeyId(win_id, STXT_OK, 0, STXT_RETURN, FALSE);
- MMK_SetWinSoftkeyId(win_id, STXT_OPTION, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- g_pManager->currentfolder =g_pManager->draftfolder;
- message_num = MMIMMS_GetMessageNum(g_pManager->currentfolder);
- g_pManager->currentfolder->currentmessage = g_pManager->currentfolder->root;//modify 2006-2-16
- SCI_TRACE_LOW("message number is %d",message_num);
- if (message_num == 0)
- {
- // PUBWIN_OpenPromptAlertWin(
- // PUBWIN_SOFTKEY_ONE,
- // TXT_MMS_DRAFTBOX_EMPTY,
- // IMAGE_PROMPT_ICON_WRONG,
- // ALERT_TIMEOUT,
- // PNULL
- // );
- MMK_CloseWin(win_id);
- break;
- }
- GUILISTBOX_SetMaxItem(list_ctrl_id, MMIMMS_MAX_MMS_AND_MMSNOTI_NUM);
- //mms_sort_ptr = MMIMMS_Sort(MMIMESSAGE_INBOX, &message_num);
- //SCI_ASSERT(mms_sort_ptr != PNULL);
- if (message_num > 0)
- {
- tlist = g_pManager->currentfolder->root;
- for(i = 0; i < message_num; i++)
- {
- //is_content_ucs2 = ((mms_sort_ptr[i].status_flag & FLAG_MMS_CONTENT_IS_UCS2) != 0) ? TRUE : FALSE;
- if(tlist == g_pManager->currentfolder->currentmessage)
- {
- list_index = i ;
- }
- if(tlist->to_address != NULL)
- {
- // SCI_TRACE_LOW("FNH tlist->to_address = %s",tlist->to_address);
- SCI_TRACE_LOW("FNH address length = %d",strlen((char *)tlist->to_address));
- }
- else
- {
- SCI_TRACE_LOW("to address is NULL");
- }
- SCI_MEMSET(&name_ptr, 0, sizeof(MMI_STRING_T));
- name_ptr.str_ptr = cms_malloc(MMIPB_NAME_MAX_LEN);
- SCI_MEMSET(listptr, 0, LISTMAXLENGTH)
- if(SCI_STRLEN((char*)tlist->to_address) > LISTMAXLENGTH)
- {
- strncpy((char*)listptr,(char*)tlist->to_address,LISTMAXLENGTH);
- }else
- {
- SCI_STRCPY((char*)listptr,(char*)tlist->to_address);
- }
- if (MMIMMS_GetPBNameByNumber(listptr,&name_ptr)== 1) //从电话簿中选择与号码匹配的名字
- {
- SCI_TRACE_BUF("fnh get pb_name = %x",name_ptr.str_ptr,10);
- SCI_TRACE_LOW("FNH GET PB_NAME_LENGTH = %d",name_ptr.length);
- SCI_TRACE_LOW("FNH is_ucs2 = %d",name_ptr.is_ucs2);
- AppendListItemWithIcon(
- (uint8 *)name_ptr.str_ptr,
- name_ptr.length,
- IMAGE_READ_MMS_ICON,
- name_ptr.is_ucs2,
- list_ctrl_id,
- STXT_OPTION
- );
- }
- else
- {
- AppendListItemWithIcon(
- listptr,
- SCI_STRLEN((char*)listptr),
- IMAGE_READ_MMS_ICON,
- is_content_ucs2,
- list_ctrl_id,
- STXT_OPTION
- );
- }
- if(tlist->next!=NULL)
- {
- tlist = tlist->next;//这里还要增加意外判断
- }
- else
- {
- tlist = g_pManager->currentfolder->root;
- }
- if (name_ptr.str_ptr)
- {
- cms_free(name_ptr.str_ptr);
- name_ptr.str_ptr = NULL;
- }
- }
- }
- //GUILISTBOX_SetCurItemIndex(list_ctrl_id,list_index);
- MMK_SetAtvCtrl(win_id, list_ctrl_id);
- GUILISTBOX_SetCurItemIndex(list_ctrl_id,list_index);
- break;
- case MSG_GET_FOCUS://be careful, memory leak.
- g_pManager->currentfolder =g_pManager->draftfolder;
- message_num = MMIMMS_GetMessageNum(g_pManager->currentfolder);
- if (message_num == 0)
- {
- // PUBWIN_OpenPromptAlertWin(
- // PUBWIN_SOFTKEY_ONE,
- // TXT_MMS_DRAFTBOX_EMPTY,
- // IMAGE_PROMPT_ICON_WRONG,
- // ALERT_TIMEOUT,
- // PNULL
- // );
- MMK_CloseWin(win_id);
- break;
- }
- GUILISTBOX_SetMaxItem(list_ctrl_id, MMIMMS_MAX_MMS_AND_MMSNOTI_NUM);
- if (message_num > 0)
- {
- tlist = g_pManager->currentfolder->root;
- for(i = 0; i < message_num; i++)
- {
- if(tlist == g_pManager->currentfolder->currentmessage)
- {
- list_index = i ;
- }
- SCI_MEMSET(&name_ptr, 0, sizeof(MMI_STRING_T));
- name_ptr.str_ptr = cms_malloc(MMIPB_NAME_MAX_LEN);
- SCI_MEMSET(listptr, 0, LISTMAXLENGTH)
- if(SCI_STRLEN((char*)tlist->to_address) > LISTMAXLENGTH)
- {
- strncpy((char*)listptr,(char*)tlist->to_address,LISTMAXLENGTH);
- }else
- {
- SCI_STRCPY((char*)listptr, (char*)tlist->to_address);
- }
- if (MMIMMS_GetPBNameByNumber(listptr,&name_ptr)== 1) //从电话簿中选择与号码匹配的名字
- {
- SCI_TRACE_BUF("fnh get pb_name = %x",name_ptr.str_ptr,10);
- SCI_TRACE_LOW("FNH GET PB_NAME_LENGTH = %d",name_ptr.length);
- SCI_TRACE_LOW("FNH is_ucs2 = %d",name_ptr.is_ucs2);
- AppendListItemWithIcon(
- (uint8 *)name_ptr.str_ptr,
- name_ptr.length,
- IMAGE_READ_MMS_ICON,
- name_ptr.is_ucs2,
- list_ctrl_id,
- STXT_OPTION
- );
- }
- else
- {
- AppendListItemWithIcon(
- listptr,
- SCI_STRLEN((char *)listptr),
- IMAGE_READ_MMS_ICON,
- is_content_ucs2,
- list_ctrl_id,
- STXT_OPTION
- );
- }
- if(tlist->next!=NULL)
- {
- tlist = tlist->next;//这里还要增加意外判断
- }
- else
- {
- tlist = g_pManager->currentfolder->root;
- }
- if (name_ptr.str_ptr)
- {
- cms_free(name_ptr.str_ptr);
- name_ptr.str_ptr = NULL;
- }
- }
- }
- GUILISTBOX_SetCurItemIndex(list_ctrl_id,list_index);
- MMK_SetAtvCtrl(win_id, list_ctrl_id);
- //GUILISTBOX_SetCurItemIndex(list_ctrl_id,list_index);
- break;
- case MSG_LOSE_FOCUS:
- break;
- case MSG_APP_OK:
- if(MMK_GetActiveCtrlId(win_id) != MMIMMS_DRAFTBOX_POPMENU_CTRL_ID)
- MMK_TrackPopupMenu(win_id);
- break;
- case MSG_CTL_OK:
- if ( MMIMMS_DRAFTBOX_POPMENU_CTRL_ID != (MMI_CTRL_ID_T)param )
- {
- break;
- }
- //get selected list index
- list_index = GUILISTBOX_GetCurItemIndex(list_ctrl_id);
- g_pManager->currentfolder->currentmessage = g_pManager->currentfolder->root;
- for(i = 0 ;i < list_index;i++)
- {
- g_pManager->currentfolder->currentmessage = g_pManager->currentfolder->currentmessage->next;
- }
- GUIMENU_GetRetID((MMI_CTRL_ID_T)param, &group_id, &menu_id);
- switch( menu_id )
- {
- case ID_MMS_DRAFTBOX_SEND:
- break;
- case ID_MMS_DRAFTBOX_EDIT:
- g_filetype = MMICMS_GetCurrentFFS();
- if (g_filetype != FS_INVALID)
- {
- g_readforstate = MMS_MSG_DRAFTBOX_READ_FOR_EDIT;
- MMIMMS_CreateReadMMSWaitingWin();
- MMIMMS_ReadMMS(g_pManager->currentfolder->currentmessage);
- }
- break;
- case ID_MMS_DRAFTBOX_DEL:
- PUBWIN_OpenPromptQueryWin(TXT_MMS_IF_DEL, IMAGE_PROMPT_ICON_QUERY);
- break;
- case ID_MMS_DRAFTBOX_DEL_MORE:
- PUBWIN_OpenPromptQueryWin(TXT_MMS_IF_DEL, IMAGE_PROMPT_ICON_QUERY);
- break;
- default:
- SCI_ASSERT(0);
- break;
- }
- break;
- case MSG_MMS_READ_FOR_EDIT:
- {
- g_peditdoc = MMS_New();
- SCI_ASSERT(g_peditdoc != NULL);
- SCI_TRACE_LOW("draftbox message read for edit!");
- g_p_mms_subject = (int8 *)cms_malloc(MMIMMS_MAX_SUBJECTS_LEN+1);
- SCI_ASSERT(g_p_mms_subject != NULL);
- SCI_MEMSET(g_p_mms_subject,0,MMIMMS_MAX_SUBJECTS_LEN+1);
- if (g_pManager->currentfolder->currentmessage->subject!= NULL)
- {
- uint16 outlen = 0;
- uint8 * uni_16 =PNULL;
- outlen = Cms_UTF8toUTF16Len(g_pManager->currentfolder->currentmessage->subject);
- uni_16 = cms_malloc(outlen);
- SCI_MEMSET(uni_16,0,outlen);
- Cms_UTF8toUTF16(g_pManager->currentfolder->currentmessage->subject,SCI_STRLEN((char *)g_pManager->currentfolder->currentmessage->subject),outlen,uni_16);
- if (outlen > MMIMMS_MAX_SUBJECTS_LEN-2)
- {
- outlen = MMIMMS_MAX_SUBJECTS_LEN-2;
- }
- SCI_MEMCPY(g_p_mms_subject,&outlen,2);
- SCI_MEMCPY((int8 *)(g_p_mms_subject+2),uni_16,outlen);
- SCI_TRACE_BUF("FNH g_p_mms_subject = ",g_p_mms_subject,10);
- if (uni_16)
- {
- cms_free(uni_16);
- uni_16 = NULL;
- }
- MMIMMS_OptionSubject(MMSEDIT);
- }
- if ((g_pManager->currentfolder->currentmessage->to_address != NULL)
- && (strcmp((char *)g_pManager->currentfolder->currentmessage->to_address ,MMIMMS_UNKNOWN_SENDER)!=0))
- {
- g_p_mms_to = (p_MMS_RECEPIENT)cms_malloc(sizeof(MMS_RECEPIENT));
- SCI_MEMSET(g_p_mms_to,0,sizeof(MMS_RECEPIENT));
- CmsMmsParseRecepient(g_p_mms_to,(char *)g_pManager->currentfolder->currentmessage->to_address);
- }
- if (g_pManager->currentfolder->currentmessage->cc_address != NULL)
- {
- g_p_mms_cc = (p_MMS_RECEPIENT)cms_malloc(sizeof(MMS_RECEPIENT));
- SCI_MEMSET(g_p_mms_cc,0,sizeof(MMS_RECEPIENT));
- CmsMmsParseRecepient(g_p_mms_cc,(char *)g_pManager->currentfolder->currentmessage->cc_address);
- }
- if (g_pManager->currentfolder->currentmessage->bcc_address != NULL)
- {
- g_p_mms_bcc = (p_MMS_RECEPIENT)cms_malloc(sizeof(MMS_RECEPIENT));
- SCI_MEMSET(g_p_mms_bcc,0,sizeof(MMS_RECEPIENT));
- CmsMmsParseRecepient(g_p_mms_bcc,(char *)g_pManager->currentfolder->currentmessage->bcc_address);
- }
- cms_parse_mms((char *)g_pManager->currentfolder->currentmessage->filename,g_peditdoc);
- mmsf_Remove((char *)g_pManager->currentfolder->currentmessage->filename);
- // cms_parse_mms((char *)transit_filename,g_peditdoc);
- SCI_TRACE_LOW("FNH after cms_parse_Mms");
- // MMK_CreateWin((uint32 *)MMIMMS_EDIT_OPTION_TAB,PNULL);
- g_mms_edit_status = MMS_EDIT_REPEAT_EDIT_MMS;
- MMK_CreateWin((uint32 *)MMIMMS_EDIT_WIN_TAB,PNULL);
- }
- break;
- case MSG_PROMPTWIN_OK:
- GUIMENU_GetRetID(MMIMMS_DRAFTBOX_POPMENU_CTRL_ID, (MMI_MENU_GROUP_ID_T *)(&group_id),(MMI_MENU_ID_T *) (&menu_id));
- switch(menu_id)
- {
- case ID_MMS_DRAFTBOX_DEL:
- PUBWIN_ClosePromptQueryWin();//here should close the win and open the waitwin for delete.
- g_savestate = MMS_MSG_SAVEFILE_FOR_DRAFTBOX_DELETE;
- MMIMMS_CreateNormalWaitingWin();
- MMIMMS_DeleteMMS(g_pManager->draftfolder);//modify 2005-12-8
- // MMK_CloseWin(win_id);
- break;
- case ID_MMS_DRAFTBOX_DEL_MORE:
- PUBWIN_ClosePromptQueryWin();//here should close the win and open the waitwin for delete.
- // MMK_CloseWin(win_id);
- g_savestate = MMS_MSG_SAVEFILE_FOR_DRAFTBOX_DELETE;
- MMIMMS_CreateNormalWaitingWin();
- MMIMMS_DeleteAllMMS(g_pManager->draftfolder);
- break;
- default:
- break;
- }
- break;
- case MSG_PROMPTWIN_CANCEL:
- //close query window
- PUBWIN_ClosePromptQueryWin();
- break;
- case MSG_CTL_DBCLICK:
- list_index = GUILISTBOX_GetCurItemIndex(list_ctrl_id);
- g_pManager->currentfolder->currentmessage = g_pManager->currentfolder->root;
- for(i = 0 ;i < list_index;i++)
- {
- g_pManager->currentfolder->currentmessage = g_pManager->currentfolder->currentmessage->next;
- }
- g_readforstate = MMS_MSG_DRAFTBOX_READ_FOR_EDIT;
- MMIMMS_CreateReadMMSWaitingWin();
- MMIMMS_ReadMMS(g_pManager->currentfolder->currentmessage);
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- //
- // close the edit window
- if(MMK_GetActiveCtrlId(win_id) == MMIMMS_DRAFTBOX_POPMENU_CTRL_ID)
- {
- uint8 i = 4;
- uint32 j = 0x00ad0002;
- MMK_SetAtvCtrl(win_id, MMIMMS_DRAFTBOX_LIST_CTRL_ID);
- MMK_PostMsg(win_id, MSG_TP_PRESS_DOWN, (DPARAM)&j, i);
- }
- else
- {
- MMK_CloseWin(win_id);
- } //cloud6
- break;
- case MSG_CLOSE_WINDOW:
- break;
- default:
- err_code = MMI_RESULT_FALSE;
- break;
- }
- return err_code;
- }
- /*****************************************************************************/
- // Description : 5.8.1 Setting : autodownload window message handler
- // Global resource dependence :
- // Author:Bruce.Chi
- // Note:
- /*****************************************************************************/
- LOCAL MMI_RESULT_E Setting_HandleAutoDownloadListWinMsg(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_RESULT_E err_code = MMI_RESULT_TRUE;
- MMS_CONTROL_ID_E list_ctrl_id = MMIMMS_SETTING_AUTO_DOWNLOAD_LIST_CTRL_ID;
- uint16 list_index = 0;
- MESSAGES_MMS_MSG_SETTINGS_RETRIEVE auto_download = MMS_MSG_SETTINGS_RETRIEVE_MANUAL;
- switch(msg_id)
- {
- case MSG_FULL_PAINT:
- MMIMMS_CLEAR_CLIENT();
- break;
- case MSG_OPEN_WINDOW:
- MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- GUILISTBOX_SetMaxItem(list_ctrl_id, NUM_MMS_MSG_SETTINGS_ONOFF);
- AppendListItemByTextId( //open
- TXT_MMS_RETRIEVE_MANUAL,
- list_ctrl_id
- );
- AppendListItemByTextId( //close
- TXT_MMS_RETRIEVE_AUTO,
- list_ctrl_id
- );
- auto_download = MMIMMS_Setting_GetAutoDownload();
- SCI_TRACE_LOW("auto_download is %d",g_nv_setting_mirror.retrieve_mode);
- GUILISTBOX_SetSelectedItem(list_ctrl_id, auto_download, TRUE);
- GUILISTBOX_SetCurItemIndex(list_ctrl_id, auto_download);
- MMK_SetAtvCtrl(win_id, list_ctrl_id);
- break;
- case MSG_APP_OK:
- case MSG_CTL_OK:
- //get selected list index
- list_index = GUILISTBOX_GetCurItemIndex(list_ctrl_id);
- SCI_TRACE_LOW("auto_download is %d",g_nv_setting_mirror.retrieve_mode);
- SCI_ASSERT(list_index < NUM_MMS_MSG_SETTINGS_ONOFF);
- MMIMMS_Setting_SetAutoDownload(list_index);
- // MMIMMS_SaveConfigFile();
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_DONE,
- IMAGE_PROMPT_ICON_SUCCESS,
- ALERT_TIMEOUT,
- PNULL
- );
- MMK_CloseWin(win_id);
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- MMK_CloseWin(win_id);
- break;
- default:
- err_code = MMI_RESULT_FALSE;
- break;
- }
- return err_code;
- }
- /*****************************************************************************/
- // Description : 5.8.6 Setting : Arrive report window message handler
- // Global resource dependence :
- // Author:liangliu
- // date : 2005-11-15
- // Note:
- /*****************************************************************************/
- LOCAL MMI_RESULT_E Setting_HandleArriveReportWinMsg(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_RESULT_E err_code = MMI_RESULT_TRUE;
- MMS_CONTROL_ID_E list_ctrl_id = MMIMMS_SETTING_ARRIVE_REPORT_LIST_CTRL_ID;
- uint16 list_index = 0;
- MESSAGES_MMS_MSG_SETTINGS_ONOFF arrivereport = MMS_MSG_SETTINGS_OFF;
- switch(msg_id)
- {
- case MSG_FULL_PAINT:
- MMIMMS_CLEAR_CLIENT();
- break;
- case MSG_OPEN_WINDOW:
- MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- GUILISTBOX_SetMaxItem(list_ctrl_id, NUM_MMS_MSG_SETTINGS_ONOFF);
- AppendListItemByTextId( //close
- TXT_MMS_SR_DISABLE,
- list_ctrl_id
- );
- AppendListItemByTextId( //open
- TXT_MMS_SR_ENABLE,
- list_ctrl_id
- );
- arrivereport = MMIMMS_Setting_GetDeliveryReport();
- GUILISTBOX_SetSelectedItem(list_ctrl_id, arrivereport, TRUE);
- GUILISTBOX_SetCurItemIndex(list_ctrl_id, arrivereport);
- MMK_SetAtvCtrl(win_id, list_ctrl_id);
- break;
- case MSG_APP_OK:
- case MSG_CTL_OK:
- //get selected list index
- list_index = GUILISTBOX_GetCurItemIndex(list_ctrl_id);
- SCI_ASSERT(list_index < NUM_MMS_MSG_SETTINGS_ONOFF);
- MMIMMS_Setting_SetDeliveryReport(list_index);
- // MMIMMS_SaveConfigFile();
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_DONE,
- IMAGE_PROMPT_ICON_SUCCESS,
- ALERT_TIMEOUT,
- PNULL
- );
- MMK_CloseWin(win_id);
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- MMK_CloseWin(win_id);
- break;
- default:
- err_code = MMI_RESULT_FALSE;
- break;
- }
- return err_code;
- }
- /*****************************************************************************/
- // Description : 5.8.6 Setting : Arrive report window message handler
- // Global resource dependence :
- // Author:liangliu@palmsource.com
- // date : 2005-11-15
- // Note:
- /*****************************************************************************/
- LOCAL MMI_RESULT_E Setting_HandleReadReportWinMsg(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_RESULT_E err_code = MMI_RESULT_TRUE;
- MMS_CONTROL_ID_E list_ctrl_id = MMIMMS_SETTING_READ_REPORT_LIST_CTRL_ID;
- uint16 list_index = 0;
- MESSAGES_MMS_MSG_SETTINGS_ONOFF readreport = MMS_MSG_SETTINGS_OFF;
- switch(msg_id)
- {
- case MSG_FULL_PAINT:
- MMIMMS_CLEAR_CLIENT();
- break;
- case MSG_OPEN_WINDOW:
- MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- GUILISTBOX_SetMaxItem(list_ctrl_id, NUM_MMS_MSG_SETTINGS_ONOFF);
- AppendListItemByTextId( //close
- TXT_MMS_SR_DISABLE,
- list_ctrl_id
- );
- AppendListItemByTextId( //open
- TXT_MMS_SR_ENABLE,
- list_ctrl_id
- );
- readreport = MMIMMS_Setting_GetReadReport();
- GUILISTBOX_SetSelectedItem(list_ctrl_id, readreport, TRUE);
- GUILISTBOX_SetCurItemIndex(list_ctrl_id, readreport);
- MMK_SetAtvCtrl(win_id, list_ctrl_id);
- break;
- case MSG_APP_OK:
- case MSG_CTL_OK:
- //get selected list index
- list_index = GUILISTBOX_GetCurItemIndex(list_ctrl_id);
- SCI_ASSERT(list_index < NUM_MMS_MSG_SETTINGS_ONOFF);
- MMIMMS_Setting_SetReadReport(list_index);
- // MMIMMS_SaveConfigFile();
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_DONE,
- IMAGE_PROMPT_ICON_SUCCESS,
- ALERT_TIMEOUT,
- PNULL
- );
- MMK_CloseWin(win_id);
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- MMK_CloseWin(win_id);
- break;
- default:
- err_code = MMI_RESULT_FALSE;
- break;
- }
- return err_code;
- }
- /*****************************************************************************/
- // Description : 5.8.6 Setting : OPEN sign window message handler
- // Global resource dependence :
- // Author:nihong.feng@palmsource.com
- // date : 2006-05-16
- // Note:
- /*****************************************************************************/
- LOCAL MMI_RESULT_E Setting_HandleOpenSignWinMsg(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_RESULT_E err_code = MMI_RESULT_TRUE;
- MMS_CONTROL_ID_E list_ctrl_id = MMIMMS_SETTING_OPEN_SIGN_LIST_CTRL_ID;
- uint16 list_index = 0;
- MESSAGES_MMS_MSG_SETTINGS_ONOFF opensign = MMS_MSG_SETTINGS_OFF;
- switch(msg_id)
- {
- case MSG_FULL_PAINT:
- MMIMMS_CLEAR_CLIENT();
- break;
- case MSG_OPEN_WINDOW:
- MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- GUILISTBOX_SetMaxItem(list_ctrl_id, NUM_MMS_MSG_SETTINGS_ONOFF);
- AppendListItemByTextId( //close
- TXT_MMS_SR_DISABLE,
- list_ctrl_id
- );
- AppendListItemByTextId( //open
- TXT_MMS_SR_ENABLE,
- list_ctrl_id
- );
- opensign = MMIMMS_Setting_GetAutoSign();
- GUILISTBOX_SetSelectedItem(list_ctrl_id, opensign, TRUE);
- GUILISTBOX_SetCurItemIndex(list_ctrl_id, opensign);
- MMK_SetAtvCtrl(win_id, list_ctrl_id);
- break;
- case MSG_GET_FOCUS:
- MMK_SetAtvCtrl(win_id, list_ctrl_id);
- break;
- case MSG_CTL_DBCLICK:
- case MSG_APP_OK:
- case MSG_CTL_OK:
- //get selected list index
- list_index = GUILISTBOX_GetCurItemIndex(list_ctrl_id);
- SCI_ASSERT(list_index < NUM_MMS_MSG_SETTINGS_ONOFF);
- MMIMMS_Setting_SetAutoSign(list_index);
- // MMIMMS_SaveConfigFile();
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_DONE,
- IMAGE_PROMPT_ICON_SUCCESS,
- ALERT_TIMEOUT,
- PNULL
- );
- MMK_CloseWin(win_id);
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- MMK_CloseWin(win_id);
- break;
- default:
- err_code = MMI_RESULT_FALSE;
- break;
- }
- return err_code;
- }
- /*****************************************************************************/
- // Description : 5.8.6 Setting : Arrive report window message handler
- // Global resource dependence :
- // Author:liangliu
- // date : 2005-11-15
- // Note:
- /*****************************************************************************/
- LOCAL MMI_RESULT_E Setting_HandleAnonymityWinMsg(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_RESULT_E err_code = MMI_RESULT_TRUE;
- MMS_CONTROL_ID_E list_ctrl_id = MMIMMS_SETTING_ANONYMITY_LIST_CTRL_ID;
- uint16 list_index = 0;
- MESSAGES_MMS_MSG_SETTINGS_ONOFF anonymouson = MMS_MSG_SETTINGS_OFF;
- switch(msg_id)
- {
- case MSG_FULL_PAINT:
- MMIMMS_CLEAR_CLIENT();
- break;
- case MSG_OPEN_WINDOW:
- MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- GUILISTBOX_SetMaxItem(list_ctrl_id, NUM_MMS_MSG_SETTINGS_ONOFF);
- AppendListItemByTextId( //close
- TXT_MMS_SR_DISABLE,
- list_ctrl_id
- );
- AppendListItemByTextId( //open
- TXT_MMS_SR_ENABLE,
- list_ctrl_id
- );
- anonymouson = MMIMMS_Setting_GetAnonymous();
- GUILISTBOX_SetSelectedItem(list_ctrl_id, anonymouson, TRUE);
- GUILISTBOX_SetCurItemIndex(list_ctrl_id, anonymouson);
- MMK_SetAtvCtrl(win_id, list_ctrl_id);
- break;
- case MSG_APP_OK:
- case MSG_CTL_OK:
- //get selected list index
- list_index = GUILISTBOX_GetCurItemIndex(list_ctrl_id);
- SCI_ASSERT(list_index < NUM_MMS_MSG_SETTINGS_ONOFF);
- MMIMMS_Setting_SetAnonymous(list_index);
- // MMIMMS_SaveConfigFile();
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_DONE,
- IMAGE_PROMPT_ICON_SUCCESS,
- ALERT_TIMEOUT,
- PNULL
- );
- MMK_CloseWin(win_id);
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- MMK_CloseWin(win_id);
- break;
- default:
- err_code = MMI_RESULT_FALSE;
- break;
- }
- return err_code;
- }
- /*****************************************************************************/
- // Description : 5.8.6 Setting : Arrive report window message handler
- // Global resource dependence :
- // Author:liangliu
- // date : 2005-11-15
- // Note:
- /*****************************************************************************/
- LOCAL MMI_RESULT_E Setting_HandleSoundWinMsg(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_RESULT_E err_code = MMI_RESULT_TRUE;
- MMS_CONTROL_ID_E list_ctrl_id = MMIMMS_SETTING_SOUND_LIST_CTRL_ID;
- uint16 list_index = 0;
- MESSAGES_MMS_MSG_SETTINGS_ONOFF play_sound = MMS_MSG_SETTINGS_OFF;
- switch(msg_id)
- {
- case MSG_FULL_PAINT:
- MMIMMS_CLEAR_CLIENT();
- break;
- case MSG_OPEN_WINDOW:
- MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- GUILISTBOX_SetMaxItem(list_ctrl_id, NUM_MMS_MSG_SETTINGS_ONOFF);
- AppendListItemByTextId( //open
- TXT_MMS_SR_ENABLE,
- list_ctrl_id
- );
- AppendListItemByTextId( //close
- TXT_MMS_SR_DISABLE,
- list_ctrl_id
- );
- play_sound = MMIMMS_Setting_GetPlaySoundAble();
- GUILISTBOX_SetSelectedItem(list_ctrl_id, 1-play_sound, TRUE);
- GUILISTBOX_SetCurItemIndex(list_ctrl_id, 1-play_sound);
- MMK_SetAtvCtrl(win_id, list_ctrl_id);
- break;
- case MSG_APP_OK:
- case MSG_CTL_OK:
- //get selected list index
- list_index = GUILISTBOX_GetCurItemIndex(list_ctrl_id);
- SCI_ASSERT(list_index < NUM_MMS_MSG_SETTINGS_ONOFF);
- MMIMMS_Setting_SetPlaySound(list_index);
- // MMIMMS_SaveConfigFile();
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_DONE,
- IMAGE_PROMPT_ICON_SUCCESS,
- ALERT_TIMEOUT,
- PNULL
- );
- MMK_CloseWin(win_id);
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- MMK_CloseWin(win_id);
- break;
- default:
- err_code = MMI_RESULT_FALSE;
- break;
- }
- return err_code;
- }
- /*****************************************************************************/
- // Description : 5.8.6 Setting : Arrive report window message handler
- // Global resource dependence :
- // Author:liangliu
- // date : 2005-11-15
- // Note:
- /*****************************************************************************/
- LOCAL MMI_RESULT_E Setting_HandleAdvertisingWinMsg(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_RESULT_E err_code = MMI_RESULT_TRUE;
- MMS_CONTROL_ID_E list_ctrl_id = MMIMMS_SETTING_ADVERTISING_LIST_CTRL_ID;
- uint16 list_index = 0;
- MESSAGES_MMS_MSG_SETTINGS_ONOFF advertisingallowable = MMS_MSG_SETTINGS_OFF;
- switch(msg_id)
- {
- case MSG_FULL_PAINT:
- MMIMMS_CLEAR_CLIENT();
- break;
- case MSG_OPEN_WINDOW:
- MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- GUILISTBOX_SetMaxItem(list_ctrl_id, NUM_MMS_MSG_SETTINGS_ONOFF);
- AppendListItemByTextId( //close
- TXT_MMS_SR_DISABLE,
- list_ctrl_id
- );
- AppendListItemByTextId( //open
- TXT_MMS_SR_ENABLE,
- list_ctrl_id
- );
- advertisingallowable = MMIMMS_Setting_GetAdvertisingallowable();
- GUILISTBOX_SetSelectedItem(list_ctrl_id, advertisingallowable, TRUE);
- GUILISTBOX_SetCurItemIndex(list_ctrl_id, advertisingallowable);
- MMK_SetAtvCtrl(win_id, list_ctrl_id);
- break;
- case MSG_APP_OK:
- case MSG_CTL_OK:
- //get selected list index
- list_index = GUILISTBOX_GetCurItemIndex(list_ctrl_id);
- SCI_ASSERT(list_index < NUM_MMS_MSG_SETTINGS_ONOFF);
- MMIMMS_Setting_SetAdvertising(list_index);
- // MMIMMS_SaveConfigFile();
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_DONE,
- IMAGE_PROMPT_ICON_SUCCESS,
- ALERT_TIMEOUT,
- PNULL
- );
- MMK_CloseWin(win_id);
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- MMK_CloseWin(win_id);
- break;
- default:
- err_code = MMI_RESULT_FALSE;
- break;
- }
- return err_code;
- }
- /*****************************************************************************/
- // Description : 5.8.2 Setting : Priority window message handler
- // Global resource dependence :
- // Author:Bruce.Chi
- // Note:
- /*****************************************************************************/
- LOCAL MMI_RESULT_E Setting_HandlePriorityListWinMsg(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_RESULT_E err_code = MMI_RESULT_TRUE;
- MMS_CONTROL_ID_E list_ctrl_id = MMIMMS_SETTING_PRIORITY_LIST_CTRL_ID;
- uint16 list_index = 0;
- MESSAGES_MMS_MSG_SETTINGS_PRIORITY priority;
- switch(msg_id)
- {
- case MSG_FULL_PAINT:
- MMIMMS_CLEAR_CLIENT();
- break;
- case MSG_OPEN_WINDOW:
- MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- GUILISTBOX_SetMaxItem(list_ctrl_id, NUM_MMS_MSG_SETTINGS_PRIORITY);
- AppendListItemByTextId(
- TXT_MMS_PRIORITY_HIGH,
- list_ctrl_id
- );
- AppendListItemByTextId(
- TXT_MMS_PRIORITY_MID,
- list_ctrl_id
- ); //fnh modify 0323
- AppendListItemByTextId(
- TXT_MMS_PRIORITY_LOW,
- list_ctrl_id
- );
- priority = MMIMMS_Setting_GetPriority();
- GUILISTBOX_SetSelectedItem(list_ctrl_id, priority, TRUE);
- GUILISTBOX_SetCurItemIndex(list_ctrl_id, priority);
- MMK_SetAtvCtrl(win_id, list_ctrl_id);
- break;
- case MSG_APP_OK:
- case MSG_CTL_OK:
- //get selected list index
- list_index = GUILISTBOX_GetCurItemIndex(list_ctrl_id);
- SCI_ASSERT(list_index < MMIMMS_PRIORITY_TOTAL);
- MMIMMS_Setting_SetPriority(list_index);
- // MMIMMS_SaveConfigFile();
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_DONE,
- IMAGE_PROMPT_ICON_SUCCESS,
- ALERT_TIMEOUT,
- PNULL
- );
- MMK_CloseWin(win_id);
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- MMK_CloseWin(win_id);
- break;
- default:
- err_code = MMI_RESULT_FALSE;
- break;
- }
- return err_code;
- }
- /*****************************************************************************/
- // Description : 5.8.3 Setting : mms duaration window message handler
- // Global resource dependence :
- // Author:Bruce.Chi
- // Note:
- /*****************************************************************************/
- LOCAL MMI_RESULT_E Setting_HandleValidPeriodListWinMsg(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMI_RESULT_E err_code = MMI_RESULT_TRUE;
- MMS_CONTROL_ID_E list_ctrl_id = MMIMMS_SETTING_VALIDATE_PERIOD_LIST_CTRL_ID;
- uint16 list_index = 0;
- MESSAGES_MMS_SETTING_VALID_PERIOD valid_period;
- switch(msg_id)
- {
- case MSG_FULL_PAINT:
- MMIMMS_CLEAR_CLIENT();
- break;
- case MSG_OPEN_WINDOW:
- MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- GUILISTBOX_SetMaxItem(list_ctrl_id, MMS_MSG_VALID_PERIOD_TOTAL);
- AppendListItemByTextId(
- TXT_MMS_TWELVE_HOUR,
- list_ctrl_id
- );
- AppendListItemByTextId(
- TXT_MMS_ONE_DAY,
- list_ctrl_id
- );
- AppendListItemByTextId(
- TXT_MMS_ONE_WEEK,
- list_ctrl_id
- );
- AppendListItemByTextId(
- TXT_MMS_LONGGEST_DURATION,
- list_ctrl_id
- );
- valid_period = MMIMMS_Setting_GetValidPeriod();
- GUILISTBOX_SetSelectedItem(list_ctrl_id, valid_period, TRUE);
- GUILISTBOX_SetCurItemIndex(list_ctrl_id, valid_period);
- MMK_SetAtvCtrl(win_id, list_ctrl_id);
- break;
- case MSG_APP_OK:
- case MSG_CTL_OK:
- //get selected list index
- list_index = GUILISTBOX_GetCurItemIndex(list_ctrl_id);
- SCI_ASSERT(list_index < MMIMMS_VALID_PERIOD_TOTAL);
- MMIMMS_Setting_SetValidPeriod(list_index);
- // MMIMMS_SaveConfigFile();
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_DONE,
- IMAGE_PROMPT_ICON_SUCCESS,
- ALERT_TIMEOUT,
- PNULL
- );
- MMK_CloseWin(win_id);
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- MMK_CloseWin(win_id);
- break;
- default:
- err_code = MMI_RESULT_FALSE;
- break;
- }
- return err_code;
- }
- /*****************************************************************************/
- // Description : 5.8.5 Setting : mmsc
- // Global resource dependence :
- // Author:Bruce.Chi
- // Note:
- /*****************************************************************************/
- LOCAL MMI_RESULT_E Setting_HandleMMSCWinMsg(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMS_CONTROL_ID_E editbox_ctrl_id = MMIMMS_SETTING_MMSC_CTRL_ID;
- MMI_RESULT_E recode = MMI_RESULT_TRUE;
- uint8* mmsc_str_ptr = 0;
- uint16 mmsc_str_len = 0;
- TEXTEDIT_STRING_INFO_T string_info = {0};
- switch(msg_id)
- {
- case MSG_OPEN_WINDOW:
- MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- //set text according to former setting
- mmsc_str_ptr = MMIMMS_Setting_GetMMSC();
- SCI_TRACE_LOW("FNH open window setting mmsc_str_ptr = %s",mmsc_str_ptr);
- if (mmsc_str_ptr != NULL)
- {
- mmsc_str_len = strlen((char *)mmsc_str_ptr);
- }
- SCI_TRACE_LOW("FNH open window setting mmsc_str_len = %d",mmsc_str_len);
- GUIEDITBOX_SetTextEditBoxStringInfo(editbox_ctrl_id,
- mmsc_str_ptr,
- mmsc_str_len,
- FALSE);
- MMK_SetAtvCtrl(
- win_id,
- editbox_ctrl_id);
- break;
- case MSG_FULL_PAINT:
- MMIMMS_CLEAR_CLIENT();
- break;
- case MSG_APP_OK:
- case MSG_CTL_OK:
- //save to nv
- SCI_MEMSET(&string_info,0,sizeof(TEXTEDIT_STRING_INFO_T));
- SCI_TRACE_LOW("FNH before get text string_info.str_ptr = %s",string_info.str_ptr);
- SCI_TRACE_LOW("FNH before get text string_info.str_len = %d",string_info.str_len);
- GUIEDITBOX_GetTextEditBoxInfo(
- editbox_ctrl_id,
- &string_info);
- string_info.str_ptr[string_info.str_len] = ' ';
- SCI_TRACE_LOW("FNH after get text string_info.str_ptr = %s",string_info.str_ptr);
- SCI_TRACE_LOW("FNH after get text string_info.str_len = %d",string_info.str_len);
- if (string_info.str_len == 0)
- {
- //提示用户
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_INPUT_ERROR,
- IMAGE_PROMPT_ICON_FAIL,
- ALERT_TIMEOUT,
- PNULL);
- MMK_CloseWin(win_id);
- break;
- }
- MMIMMS_Setting_SetMMSC(string_info.str_ptr, string_info.str_len);
- // MMIMMS_SaveConfigFile();
- //提示用户
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_DONE,
- IMAGE_PROMPT_ICON_SUCCESS,
- ALERT_TIMEOUT,
- PNULL);
- MMK_CloseWin(win_id);
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- MMK_CloseWin(win_id);//返回上一级
- break;
- default:
- recode = MMI_RESULT_FALSE;
- break;
- }
- return recode;
- }
- /*****************************************************************************/
- // Description : 5.8.5 Setting : GateWay
- // Global resource dependence :
- // Author:Bruce.Chi
- // Note:
- /*****************************************************************************/
- LOCAL MMI_RESULT_E Setting_HandleGateWayWinMsg(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMS_CONTROL_ID_E editbox_ctrl_id = MMIMMS_SETTING_GATEWAY_CTRL_ID;
- MMI_RESULT_E recode = MMI_RESULT_TRUE;
- uint8* mmsc_str_ptr = 0;
- uint16 mmsc_str_len = 0;
- TEXTEDIT_STRING_INFO_T string_info = {0};
- switch(msg_id)
- {
- case MSG_OPEN_WINDOW:
- MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- //set text according to former setting
- mmsc_str_ptr = MMIMMS_Setting_GetGATEWAY();
- if (mmsc_str_ptr != NULL)
- {
- mmsc_str_len = strlen((char *)mmsc_str_ptr);
- }
- GUIEDITBOX_SetTextEditBoxStringInfo(editbox_ctrl_id,
- mmsc_str_ptr,
- mmsc_str_len,
- FALSE);
- MMK_SetAtvCtrl(
- win_id,
- editbox_ctrl_id);
- break;
- case MSG_FULL_PAINT:
- MMIMMS_CLEAR_CLIENT();
- break;
- case MSG_APP_OK:
- case MSG_CTL_OK:
- {
- BOOLEAN isipaddress = FALSE;
- GUIEDITBOX_GetTextEditBoxInfo(
- editbox_ctrl_id,
- &string_info);
- if (string_info.str_ptr != NULL)
- {
- string_info.str_ptr[string_info.str_len] = ' ';
- }
- isipaddress = MMIMMS_IsIPAddress((char *)string_info.str_ptr);
- if (!isipaddress)
- {
- //提示用户
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_INPUT_ERROR,
- IMAGE_PROMPT_ICON_FAIL,
- ALERT_TIMEOUT,
- PNULL);
- MMK_CloseWin(win_id);
- break;
- }
- MMIMMS_Setting_SetGATEWAY(string_info.str_ptr, string_info.str_len);
- // MMIMMS_SaveConfigFile();
- //提示用户
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_DONE,
- IMAGE_PROMPT_ICON_SUCCESS,
- ALERT_TIMEOUT,
- PNULL);
- MMK_CloseWin(win_id);
- }
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- MMK_CloseWin(win_id);//返回上一级
- break;
- default:
- recode = MMI_RESULT_FALSE;
- break;
- }
- return recode;
- }
- /*****************************************************************************/
- // Description : 5.8.5 Setting : Port
- // Global resource dependence :
- // Author:Bruce.Chi
- // Note:
- /*****************************************************************************/
- LOCAL MMI_RESULT_E Setting_HandlePortWinMsg(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMS_CONTROL_ID_E editbox_ctrl_id = MMIMMS_SETTING_PORT_CTRL_ID;
- MMI_RESULT_E recode = MMI_RESULT_TRUE;
- uint8* mmsc_str_ptr = 0;
- uint16 mmsc_str_len = 0;
- TEXTEDIT_STRING_INFO_T string_info = {0};
- switch(msg_id)
- {
- case MSG_OPEN_WINDOW:
- MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- //set text according to former setting
- mmsc_str_ptr = MMIMMS_Setting_GetPORT();
- SCI_TRACE_LOW("FNH in get port mmsc_str_ptr = %s",mmsc_str_ptr);
- if (mmsc_str_ptr != NULL)
- {
- mmsc_str_len = strlen((char *)mmsc_str_ptr);
- }
- SCI_TRACE_LOW("FNH in get port mmsc_str_len = %d",mmsc_str_len);
- GUIEDITBOX_SetTextEditBoxStringInfo(MMIMMS_SETTING_PORT_CTRL_ID,
- mmsc_str_ptr,
- mmsc_str_len,
- FALSE);
- MMK_SetAtvCtrl(
- win_id,
- editbox_ctrl_id);
- break;
- case MSG_FULL_PAINT:
- MMIMMS_CLEAR_CLIENT();
- break;
- case MSG_APP_OK:
- case MSG_CTL_OK:
- //save to nv
- SCI_MEMSET(&string_info ,0,sizeof(STRING_INFO_T));
- SCI_TRACE_LOW("FNH before get string_info.str_ptr = %s",string_info.str_ptr);
- SCI_TRACE_LOW("FNH before get string_info.str_len = %d",string_info.str_len);
- GUIEDITBOX_GetTextEditBoxInfo(
- MMIMMS_SETTING_PORT_CTRL_ID,
- &string_info);
- SCI_TRACE_LOW("FNH after get string_info.str_ptr = %s",string_info.str_ptr);
- SCI_TRACE_LOW("FNH after get string_info.str_len = %d",string_info.str_len);
- if (string_info.str_ptr != NULL)
- {
- string_info.str_ptr[string_info.str_len] = ' ';
- }
- if (string_info.str_len == 0)
- {
- //提示用户
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_INPUT_ERROR,
- IMAGE_PROMPT_ICON_FAIL,
- ALERT_TIMEOUT,
- PNULL);
- MMK_CloseWin(win_id);
- break;
- }
- MMIMMS_Setting_SetPORT((uint8 *)string_info.str_ptr, string_info.str_len);
- // MMIMMS_SaveConfigFile();
- //提示用户
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_DONE,
- IMAGE_PROMPT_ICON_SUCCESS,
- ALERT_TIMEOUT,
- PNULL);
- MMK_CloseWin(win_id);
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- MMK_CloseWin(win_id);//返回上一级
- break;
- default:
- recode = MMI_RESULT_FALSE;
- break;
- }
- return recode;
- }
- /*****************************************************************************/
- // Description : 5.8.5 Setting : UserName
- // Global resource dependence :
- // Author:Bruce.Chi
- // Note:
- /*****************************************************************************/
- LOCAL MMI_RESULT_E Setting_HandleUserNameWinMsg(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMS_CONTROL_ID_E editbox_ctrl_id = MMIMMS_SETTING_USERNAME_CTRL_ID;
- MMI_RESULT_E recode = MMI_RESULT_TRUE;
- uint8* username_str_ptr = 0;
- uint16 username_str_len = 0;
- TEXTEDIT_STRING_INFO_T string_info = {0};
- switch(msg_id)
- {
- case MSG_OPEN_WINDOW:
- MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- //set text according to former setting
- username_str_ptr = MMIMMS_Setting_GetUserName();
- SCI_TRACE_LOW("FNH open window setting username_str_ptr = %s",username_str_ptr);
- if (username_str_ptr != NULL)
- {
- username_str_len = strlen((char *)username_str_ptr);
- }
- SCI_TRACE_LOW("FNH open window setting username_str_len = %d",username_str_len);
- GUIEDITBOX_SetTextEditBoxStringInfo(editbox_ctrl_id,
- username_str_ptr,
- username_str_len,
- FALSE);
- MMK_SetAtvCtrl(
- win_id,
- editbox_ctrl_id);
- break;
- case MSG_FULL_PAINT:
- MMIMMS_CLEAR_CLIENT();
- break;
- case MSG_APP_OK:
- case MSG_CTL_OK:
- //save to nv
- SCI_MEMSET(&string_info,0,sizeof(TEXTEDIT_STRING_INFO_T));
- SCI_TRACE_LOW("FNH before get text string_info.str_ptr = %s",string_info.str_ptr);
- SCI_TRACE_LOW("FNH before get text string_info.str_len = %d",string_info.str_len);
- GUIEDITBOX_GetTextEditBoxInfo(
- editbox_ctrl_id,
- &string_info);
- string_info.str_ptr[string_info.str_len] = ' ';
- SCI_TRACE_LOW("FNH after get text string_info.str_ptr = %s",string_info.str_ptr);
- SCI_TRACE_LOW("FNH after get text string_info.str_len = %d",string_info.str_len);
- MMIMMS_Setting_SetUserName(string_info.str_ptr, string_info.str_len);
- // MMIMMS_SaveConfigFile();
- //提示用户
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_DONE,
- IMAGE_PROMPT_ICON_SUCCESS,
- ALERT_TIMEOUT,
- PNULL);
- MMK_CloseWin(win_id);
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- MMK_CloseWin(win_id);//返回上一级
- break;
- default:
- recode = MMI_RESULT_FALSE;
- break;
- }
- return recode;
- }
- /*****************************************************************************/
- // Description : 5.8.5 Setting : Password
- // Global resource dependence :
- // Author:Bruce.Chi
- // Note:
- /*****************************************************************************/
- LOCAL MMI_RESULT_E Setting_HandlePasswordWinMsg(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMS_CONTROL_ID_E editbox_ctrl_id = MMIMMS_SETTING_PASSWORD_CTRL_ID;
- MMI_RESULT_E recode = MMI_RESULT_TRUE;
- uint8* password_str_ptr = 0;
- uint16 password_str_len = 0;
- TEXTEDIT_STRING_INFO_T string_info = {0};
- switch(msg_id)
- {
- case MSG_OPEN_WINDOW:
- MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- //set text according to former setting
- password_str_ptr = MMIMMS_Setting_GetPassword();
- SCI_TRACE_LOW("FNH open window setting password_str_ptr = %s",password_str_ptr);
- if (password_str_ptr != NULL)
- {
- password_str_len = strlen((char *)password_str_ptr);
- }
- SCI_TRACE_LOW("FNH open window setting password_str_len = %d",password_str_len);
- GUIEDITBOX_SetTextEditBoxStringInfo(editbox_ctrl_id,
- password_str_ptr,
- password_str_len,
- FALSE);
- MMK_SetAtvCtrl(
- win_id,
- editbox_ctrl_id);
- break;
- case MSG_FULL_PAINT:
- MMIMMS_CLEAR_CLIENT();
- break;
- case MSG_APP_OK:
- case MSG_CTL_OK:
- //save to nv
- SCI_MEMSET(&string_info,0,sizeof(TEXTEDIT_STRING_INFO_T));
- SCI_TRACE_LOW("FNH before get text string_info.str_ptr = %s",string_info.str_ptr);
- SCI_TRACE_LOW("FNH before get text string_info.str_len = %d",string_info.str_len);
- GUIEDITBOX_GetTextEditBoxInfo(
- editbox_ctrl_id,
- &string_info);
- string_info.str_ptr[string_info.str_len] = ' ';
- SCI_TRACE_LOW("FNH after get text string_info.str_ptr = %s",string_info.str_ptr);
- SCI_TRACE_LOW("FNH after get text string_info.str_len = %d",string_info.str_len);
- MMIMMS_Setting_SetPassword(string_info.str_ptr, string_info.str_len);
- // MMIMMS_SaveConfigFile();
- //提示用户
- PUBWIN_OpenPromptAlertWin(
- PUBWIN_SOFTKEY_ONE,
- TXT_MMS_DONE,
- IMAGE_PROMPT_ICON_SUCCESS,
- ALERT_TIMEOUT,
- PNULL);
- MMK_CloseWin(win_id);
- break;
- case MSG_APP_CANCEL:
- case MSG_CTL_CANCEL:
- MMK_CloseWin(win_id);//返回上一级
- break;
- default:
- recode = MMI_RESULT_FALSE;
- break;
- }
- return recode;
- }
- /*****************************************************************************/
- // Description : 5.8.5 Setting : APN
- // Global resource dependence :
- // Author:Bruce.Chi
- // Note:
- /*****************************************************************************/
- LOCAL MMI_RESULT_E Setting_HandleAPNWinMsg(
- MMS_WINDOW_ID_E win_id,
- MMI_MESSAGE_ID_E msg_id,
- DPARAM param
- )
- {
- MMS_CONTROL_ID_E editbox_ctrl_id = MMIMMS_SETTING_APN_CTRL_ID;
- MMI_RESULT_E recode = MMI_RESULT_TRUE;
- uint8* apn_str_ptr = 0;
- uint16 apn_str_len = 0;
- TEXTEDIT_STRING_INFO_T string_info = {0};
- switch(msg_id)
- {
- case MSG_OPEN_WINDOW:
- MMK_SetWinSoftkeyId(win_id, STXT_OK, COMMON_TXT_NULL, STXT_RETURN, FALSE);
- //set text according to former setting
- apn_str_ptr = MMIMMS_Setting_GetAPN();
- SCI_TRACE_LOW("FNH open window setting apn_str_ptr = %s",apn_str_ptr);
- if (apn_str_ptr != NULL)
- {
- apn_str_len = strlen((char *)apn_str_ptr);
- }