/*! * \brief Initiates MEA in new mode with text (buffer) insertion. *****************************************************************************/ void MEAc_startWithTextInserted(char *subject, char *text, MSF_BOOL isTruncated) { msf_content_data_t contentData; int size; char *str = NULL; char* cmd = msf_cmmn_strdup(MSF_MODID_MSM, "-mode new -i"); #ifdef __USB_IN_NORMAL_MODE__ if (mmi_usb_is_in_mass_storage_mode() && is_mms_storage_exported_to_pc()) { mmi_usb_app_unavailable_popup(0); return; } #endif /* __USB_IN_NORMAL_MODE__ */ MSF_LOG_MSG_NOARG((MSF_LOG_DETAIL_MEDIUM, MSF_MODID_MEA, MEA_ENV_4A93CC25579B8BB435EBA7080B622F30, "MEAc_startWithTextInserted()\n")); memset(&contentData, 0x00, sizeof(msf_content_data_t)); contentData.routingIdentifier = msf_cmmn_strdup(MSF_MODID_MSM, "text/plain"); contentData.routingFormat = MSF_ROUTING_TYPE_MIME; /* Text */ if(text) { size = widget_ucs2_to_utf8_length_in_bytes((kal_uint8*)text); if(size > 0) { contentData.contentData = MSF_MEM_ALLOC(MSF_MODID_MSM, size + 1); widget_ucs2_to_utf8_string((kal_uint8*)contentData.contentData, size + 1, (kal_uint8*)text); contentData.contentDataLength = size + 1; } } /* Subject */ if(subject) { size = widget_ucs2_to_utf8_length_in_bytes((kal_uint8*)subject); if(size > 0) { str = MSF_MEM_ALLOC(MSF_MODID_MSM, size + 1); widget_ucs2_to_utf8_string((kal_uint8*)str, size + 1,(kal_uint8*)subject); MSF_MEM_FREE(MSF_MODID_MSM, cmd); cmd = msf_cmmn_strcat(MSF_MODID_MSM, "-mode new -i -subject ", str); } } if(isTruncated) { contentData.contentDataLength++; } MSF_CONTENT_SEND_DRM_EXT(MSF_MODID_MSM, MSF_MODID_MEA, cmd, &contentData, 0, 0); MSF_MEM_FREE(MSF_MODID_MSM, contentData.routingIdentifier); MSF_MEM_FREE(MSF_MODID_MSM, contentData.contentData); MSF_MEM_FREE(MSF_MODID_MSM, str); MSF_MEM_FREE(MSF_MODID_MSM, cmd); }
/*! * \brief Initiates MEA in new mode with content insertion. *****************************************************************************/ void MEAc_startWithContentInserted(char* contentSource) { msf_content_data_t contentData; int size; const char * strMimeType; char * strContentSource = NULL; MSF_LOG_MSG_OFF((MSF_LOG_DETAIL_HIGH, MSF_MODID_MEA, MEA_ENV_6D82A4C998BF548C524317FF17E024C1, "MEAc_startWithContentInserted()\n")); #ifdef __USB_IN_NORMAL_MODE__ if (mmi_usb_is_in_mass_storage_mode() && is_mms_storage_exported_to_pc()) { mmi_usb_app_unavailable_popup(0); return; } #endif /* __USB_IN_NORMAL_MODE__ */ /* convert UCS2 to UTF8 */ size = widget_ucs2_to_utf8_length_in_bytes((kal_uint8*) contentSource) + 1; strContentSource = MSF_MEM_ALLOC(MSF_MODID_MSM, size); widget_ucs2_to_utf8_string((kal_uint8*)strContentSource,size,(kal_uint8*)contentSource); contentData.contentSource = msf_cmmn_strcat(MSF_MODID_MSM, HDI_EXTERNAL_PATH, strContentSource); strMimeType = meaFileName2MimeType(contentData.contentSource); if (strMimeType == NULL) { #ifdef JPG_ENCODE if(meaIsResizedFile(strContentSource)) { MSF_FILE_REMOVE(strContentSource); } #endif HDIa_widgetExtShowPopup(MSF_MODID_MSM, MEA_GET_STR_ID(MSF_STR_ID_DLG_MIME_ACTION_NONE), MsfAlert, 0); MSF_MEM_FREE(MSF_MODID_MSM, strContentSource); HDIa_widgetExtCloseTransitionAnimation(); return; } contentData.routingIdentifier = MSF_MEM_ALLOC(MSF_MODID_MSM, strlen(strMimeType)+1); strcpy(contentData.routingIdentifier, strMimeType); contentData.contentUrl = NULL; contentData.routingFormat = MSF_ROUTING_TYPE_MIME; contentData.contentParameters = NULL; contentData.contentData = NULL; contentData.contentDataLength=0; contentData.contentHeaders=NULL; contentData.contentDRMData=NULL; contentData.contentDRMDataExists=0; contentData.auxTypeIdentifier = NULL; MSF_CONTENT_SEND_DRM_EXT(MSF_MODID_MSM, MSF_MODID_MEA, "-mode new -i", &contentData,0,0); MSF_MEM_FREE(MSF_MODID_MSM, strContentSource); MSF_MEM_FREE(MSF_MODID_MSM, contentData.routingIdentifier); MSF_MEM_FREE(MSF_MODID_MSM, contentData.contentUrl); if (contentData.contentSource) MSF_MEM_FREE(MSF_MODID_MSM, contentData.contentSource); }
/***************************************************************************** * FUNCTION * mmi_opp_notify_scr_browse * DESCRIPTION * This function is to browse the received folder * PARAMETERS * void * RETURNS * void *****************************************************************************/ void mmi_opp_notify_scr_browse(void) { /*----------------------------------------------------------------*/ /* Local Variables */ /*----------------------------------------------------------------*/ S8 *path_tmpbuf; FMGR_FILTER filter; /*----------------------------------------------------------------*/ /* Code Body */ /*----------------------------------------------------------------*/ FMGR_FILTER_INIT(&filter); FMGR_FILTER_SET_ALL(&filter); path_tmpbuf = (S8*) OslMalloc(FMGR_PATH_BUFFER_SIZE); ASSERT(path_tmpbuf != NULL); kal_wstrcpy((WCHAR *)path_tmpbuf,(WCHAR *)MMI_OPP_CTX(recived_file_path)); #ifdef __USB_IN_NORMAL_MODE__ if (mmi_usb_is_in_mass_storage_mode()) { /* in mass storage mode */ if (mmi_usb_check_path_exported(path_tmpbuf)) { /* phone drive is exported, cant use this app */ mmi_usb_app_unavailable_popup(0); /* pass 0 will show default string */ OslMfree(path_tmpbuf); return; } } #endif /* __USB_IN_NORMAL_MODE__ */ mmi_fmgr_select_path_and_enter( APP_EXTDEVICE, FMGR_SELECT_BROWSE, filter, path_tmpbuf, /* (PS8)L"D:\\Received", */ mmi_opp_notify_scr_browse_cb); OslMfree(path_tmpbuf); mmi_opp_set_recv_files_cnt(0); /* After take action */ #ifdef __MMI_BIP_SUPPORT__ mmi_bt_bip_set_recv_images_cnt(0); #endif }
/*! * \brief Initiates MEA in new mode with text or content insertion, with subject and addr. *****************************************************************************/ void MEAc_startWithGeneralInserted(char *subject, char *text, MSF_BOOL isTruncated, char *addr, char *contentSource) { msf_content_data_t contentData; int size; char *str = NULL; char *tmp_str = NULL; char *cmd = NULL; MSF_LOG_MSG_NOARG((MSF_LOG_DETAIL_MEDIUM, MSF_MODID_MEA, MEA_ENV_4A93CC25579B8BB435EBA7080B622F30, "MEAc_startWithTextInserted()\n")); #ifdef __USB_IN_NORMAL_MODE__ if (mmi_usb_is_in_mass_storage_mode() && is_mms_storage_exported_to_pc()) { mmi_usb_app_unavailable_popup(0); return; } #endif /* __USB_IN_NORMAL_MODE__ */ memset(&contentData, 0x00, sizeof(msf_content_data_t)); contentData.routingIdentifier = msf_cmmn_strdup(MSF_MODID_MSM, "text/plain"); contentData.routingFormat = MSF_ROUTING_TYPE_MIME; /* process file path */ if(contentSource != NULL && contentSource[0] != 0) { const char * strMimeType; char * strContentSource = NULL; MSF_LOG_MSG_OFF((MSF_LOG_DETAIL_HIGH, MSF_MODID_MEA, MEA_ENV_6D82A4C998BF548C524317FF17E024C1, "MEAc_startWithContentInserted()\n")); /* convert UCS2 to UTF8 */ size = widget_ucs2_to_utf8_length_in_bytes((kal_uint8*) contentSource) + 1; strContentSource = MSF_MEM_ALLOC(MSF_MODID_MSM, size); widget_ucs2_to_utf8_string((kal_uint8*)strContentSource,size,(kal_uint8*)contentSource); contentData.contentSource = msf_cmmn_strcat(MSF_MODID_MSM, HDI_EXTERNAL_PATH, strContentSource); strMimeType = meaFileName2MimeType(contentData.contentSource); if (strMimeType == NULL) { #ifdef JPG_ENCODE if(meaIsResizedFile(strContentSource)) { MSF_FILE_REMOVE(strContentSource); } #endif HDIa_widgetExtShowPopup(MSF_MODID_MSM, MEA_GET_STR_ID(MSF_STR_ID_DLG_MIME_ACTION_NONE), MsfAlert, 0); MSF_MEM_FREE(MSF_MODID_MSM, strContentSource); HDIa_widgetExtCloseTransitionAnimation(); return; } contentData.routingIdentifier = MSF_MEM_ALLOC(MSF_MODID_MSM, strlen(strMimeType)+1); strcpy(contentData.routingIdentifier, strMimeType); contentData.contentUrl = NULL; contentData.routingFormat = MSF_ROUTING_TYPE_MIME; contentData.contentParameters = NULL; contentData.contentData = NULL; contentData.contentDataLength=0; contentData.contentHeaders=NULL; contentData.contentDRMData=NULL; contentData.contentDRMDataExists=0; contentData.auxTypeIdentifier = NULL; } /* Text */ if(text) { size = widget_ucs2_to_utf8_length_in_bytes((kal_uint8*)text); if(size > 0) { contentData.contentData = MSF_MEM_ALLOC(MSF_MODID_MSM, size + 1); widget_ucs2_to_utf8_string((kal_uint8*)contentData.contentData, size + 1, (kal_uint8*)text); contentData.contentDataLength = size + 1; } } if(text || contentSource) { cmd = msf_cmmn_strdup(MSF_MODID_MSM, "-mode new -i"); } else { cmd = msf_cmmn_strdup(MSF_MODID_MSM, "-mode new"); } /* Subject */ if(subject) { size = widget_ucs2_to_utf8_length_in_bytes((kal_uint8*)subject); if(size > 0) { str = MSF_MEM_ALLOC(MSF_MODID_MSM, size + 1); widget_ucs2_to_utf8_string((kal_uint8*)str, size + 1,(kal_uint8*)subject); MSF_MEM_FREE(MSF_MODID_MSM, cmd); cmd = msf_cmmn_str3cat(MSF_MODID_MSM, cmd ," -subject ", str); } } if(isTruncated) { contentData.contentDataLength++; } /* addr */ if(addr) { size = widget_ucs2_to_utf8_length_in_bytes((kal_uint8*)addr); if(size > 0) { //str = msf_cmmn_strdup(MSF_MODID_MSM, addr); str = MSF_MEM_ALLOC(MSF_MODID_MSM, size + 1); widget_ucs2_to_utf8_string((kal_uint8*)str, size + 1,(kal_uint8*)addr); tmp_str = msf_cmmn_strdup(MSF_MODID_MSM, cmd); MSF_MEM_FREE(MSF_MODID_MSM, cmd); cmd = msf_cmmn_str3cat(MSF_MODID_MSM, tmp_str, " -to ", str); } } MSF_CONTENT_SEND_DRM_EXT(MSF_MODID_MSM, MSF_MODID_MEA, cmd, &contentData, 0, 0); MSF_MEM_FREE(MSF_MODID_MSM, contentData.routingIdentifier); MSF_MEM_FREE(MSF_MODID_MSM, contentData.contentData); MSF_MEM_FREE(MSF_MODID_MSM, str); MSF_MEM_FREE(MSF_MODID_MSM, cmd); MSF_MEM_FREE(MSF_MODID_MSM, tmp_str); }