UnifiedComposerMiscell.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:253k
源码类别:
MTK
开发平台:
C/C++
- }
- while (g_uc_p->msg.object_head)
- {
- mmi_uc_delete_object_from_list(g_uc_p->msg.object_head);
- }
- memset(&(g_uc_p->msg), 0, sizeof(mmi_uc_msg_struct));
- if (g_uc_p->main.file_handle)
- {
- FS_Close(g_uc_p->main.file_handle);
- g_uc_p->main.file_handle = 0;
- }
- mmi_uc_init_uc_folder();
- if (g_uc_p->send_info.fail_cause)
- {
- kal_adm_free(g_uc_p->main.mem_pool_id, g_uc_p->send_info.fail_cause);
- g_uc_p->send_info.fail_cause = NULL;
- }
- memset(&(g_uc_p->send_info),0,sizeof(g_uc_p->send_info));
- mmi_uc_reset_mms_signature();
- g_uc_p->main.image_no = 0;
- if (g_uc_p->main.callback != NULL)
- {
- g_uc_p->main.callback((void*)g_uc_p->main.callback_para);
- g_uc_p->main.callback = NULL;
- }
- g_uc_p->main.callback_para = NULL;
- kal_adm_delete(g_uc_p->main.mem_pool_id);
- mmi_uc_create_adm_mem();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_init_setting
- * DESCRIPTION
- * Init msg setting
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_init_setting(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 index = 0;
- S16 errorCode = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ReadValue(NVRAM_UC_PREFERRED_MSG_TYPE, &index, DS_BYTE, &errorCode);
- if (index >= 2)
- {
- index = 0;
- WriteValue(NVRAM_UC_PREFERRED_MSG_TYPE, &index, DS_BYTE, &errorCode);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_get_setting_msg_type
- * DESCRIPTION
- * Get msg type
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- mmi_uc_msg_type_enum mmi_uc_get_setting_msg_type(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 index = 0;
- S16 errorCode = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ReadValue(NVRAM_UC_PREFERRED_MSG_TYPE, &index, DS_BYTE, &errorCode);
- if (index == 0)
- {
- return MMI_UC_MSG_TYPE_SMS_PREFER;
- }
- else if (index == 1)
- {
- return MMI_UC_MSG_TYPE_MMS_PREFER;
- }
- else
- {
- MMI_ASSERT(0);
- return MMI_UC_MSG_TYPE_SMS_PREFER;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_get_setting_msg_type
- * DESCRIPTION
- * Get msg type
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_clear_msg_bearer(mmi_uc_msg_type_enum msg_type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (msg_type == MMI_UC_MSG_TYPE_DEFAULT || msg_type == MMI_UC_MSG_TYPE_SMS_PREFER)
- {
- ReleaseEMSEditBuffer();
- }
- if (msg_type == MMI_UC_MSG_TYPE_DEFAULT || msg_type == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- /* Delete MMS temp msg ID*/
- mmi_uc_delete_mms_req(g_uc_p->send_info.new_msg_id);
- g_uc_p->send_info.new_msg_id = 0; /* tricky! */
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_delete_sms_frm_screen
- * DESCRIPTION
- * Delete SMS framework screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_delete_sms_frm_screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_frm_sms_delete_screen_history();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_get_addr
- * DESCRIPTION
- * Get addr by type and index
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- mmi_uc_addr_struct* mmi_uc_get_addr(mmi_uc_address_group_type_enum addr_type, U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 i = 0;
- mmi_uc_addr_struct* addr = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (addr_type)
- {
- case MMI_UC_ADDRESS_GROUP_TYPE_TO:
- {
- addr = g_uc_p->msg.to_head;
- }
- break;
- case MMI_UC_ADDRESS_GROUP_TYPE_CC:
- {
- addr = g_uc_p->msg.cc_head;
- }
- break;
- case MMI_UC_ADDRESS_GROUP_TYPE_BCC:
- {
- addr = g_uc_p->msg.bcc_head;
- }
- break;
- default:
- {
- MMI_ASSERT(0);
- return NULL;
- }
- }
- for ( ; i < index ; i++)
- {
- MMI_ASSERT(addr->next);
- addr = addr->next;
- }
- return addr;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_save_sms_after_send
- * DESCRIPTION
- * Save sms after send
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_save_sms_after_send(U8 status, void *number)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_frm_sms_send_struct *sendData = OslMalloc(sizeof(mmi_frm_sms_send_struct));
- EMSData *data = GetEMSDataForEdit(0, 0);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset((S8*) sendData, 0, sizeof(mmi_frm_sms_send_struct));
- sendData->dcs = data->dcs;
- sendData->status = status;
- strncpy((S8*) sendData->number, (S8*) number,MAX_DIGITS_SMS - 1);
- mmi_frm_sms_save_sms(mmi_uc_save_sms_rsp, MOD_MMI, sendData);
- OslMfree(sendData);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_create_mms_xml_description_file
- * DESCRIPTION
- * Create the mms xml description file
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- S32 mmi_uc_create_mms_xml_description_file(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 file_path[MMI_UC_MAX_TEMP_FILE_LEN];
- FS_HANDLE fh;
- S32 result = FS_NO_ERROR;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_uc_update_object_id();
- /* Make sure every object name is unique. */
- mmi_uc_replace_duplicate_object_file_name();
- memset(file_path, 0, MMI_UC_MAX_TEMP_FILE_LEN);
- MMI_UC_MAKE_MMS_XML_FILE_PATH(file_path, 0);
- /* Open the file to write, overwrite if already exists. */
- fh = FS_Open((U16*) file_path, FS_CREATE_ALWAYS | FS_READ_WRITE);
- if (fh > 0)
- {
- /* <mms> */
- if ((result = mmi_uc_create_xml_element_start(fh, (U8*)MMI_UC_XML_ELEMENT_MMS, NULL)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_new_line(fh))!= FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- /* <header> */
- if ((result = mmi_uc_create_xml_element_start(fh, (U8*)MMI_UC_XML_ELEMENT_HEADER, NULL)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_new_line(fh)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- /* To address */
- if (g_uc_p->msg.to_num)
- {
- if ((result = mmi_uc_create_xml_addr(fh, MMI_UC_ADDRESS_GROUP_TYPE_TO))
- != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- }
- /* Cc address */
- if (g_uc_p->msg.cc_num)
- {
- if ((result = mmi_uc_create_xml_addr(fh, MMI_UC_ADDRESS_GROUP_TYPE_CC))
- != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- }
- /* Bcc address */
- if (g_uc_p->msg.bcc_num)
- {
- if ((result = mmi_uc_create_xml_addr(fh, MMI_UC_ADDRESS_GROUP_TYPE_BCC))
- != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- }
- /* subject */
- if (pfnUnicodeStrlen((S8*)g_uc_p->msg.subject))
- {
- if ((result = mmi_uc_create_xml_element_start(fh, (U8*)MMI_UC_XML_ELEMENT_SUBJECT, NULL)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_data_usc2_to_utf8(fh, (U8*)g_uc_p->msg.subject)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_element_end(fh, (U8*)MMI_UC_XML_ELEMENT_SUBJECT)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_new_line(fh)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- }
- /* Read Report */
- if ((result = mmi_uc_create_xml_element_start(fh, (U8*)MMI_UC_XML_ELEMENT_READ_REPORT, NULL)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_data_numeric_to_char(fh, g_uc_p->msg.read_report)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_element_end(fh, (U8*)MMI_UC_XML_ELEMENT_READ_REPORT)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_new_line(fh)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- /* Delivery Report */
- if ((result = mmi_uc_create_xml_element_start(fh, (U8*)MMI_UC_XML_ELEMENT_DELIVERY_REPORT, NULL)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_data_numeric_to_char(fh, g_uc_p->msg.delivery_report)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_element_end(fh, (U8*)MMI_UC_XML_ELEMENT_DELIVERY_REPORT)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_new_line(fh)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- /* Priority */
- if ((result = mmi_uc_create_xml_element_start(fh, (U8*)MMI_UC_XML_ELEMENT_PRIORITY, NULL)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_data_numeric_to_char(fh, g_uc_p->msg.priority)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_element_end(fh, (U8*)MMI_UC_XML_ELEMENT_PRIORITY)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_new_line(fh)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- /* Expiry time */
- if ((result = mmi_uc_create_xml_element_start(fh, (U8*)MMI_UC_XML_ELEMENT_EXPIRY, NULL)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_data_numeric_to_char(fh, g_uc_p->msg.expiry_time)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_element_end(fh, (U8*)MMI_UC_XML_ELEMENT_EXPIRY)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_new_line(fh)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- /* Delivery time */
- if ((result = mmi_uc_create_xml_element_start(fh, (U8*)MMI_UC_XML_ELEMENT_DELIVERY_TIME, NULL)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_data_numeric_to_char(fh, g_uc_p->msg.delivery_time)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_element_end(fh, (U8*)MMI_UC_XML_ELEMENT_DELIVERY_TIME)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_new_line(fh)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- /* Sender visibility */
- if ((result = mmi_uc_create_xml_element_start(fh, (U8*)MMI_UC_XML_ELEMENT_VISIBLE, NULL)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_data_numeric_to_char(fh, g_uc_p->msg.sender_visibility)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_element_end(fh, (U8*)MMI_UC_XML_ELEMENT_VISIBLE)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_new_line(fh)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- /* </header> */
- if ((result = mmi_uc_create_xml_element_end(fh, (U8*)MMI_UC_XML_ELEMENT_HEADER)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_new_line(fh)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((g_uc_p->main.state != MMI_UC_STATE_FORWARD && g_uc_p->main.state != MMI_UC_STATE_SEND) ||
- ((g_uc_p->main.state == MMI_UC_STATE_FORWARD || g_uc_p->main.state == MMI_UC_STATE_SEND) &&
- (g_uc_p->send_info.existed_msg_type != MMI_UC_MSG_TYPE_MMS_PREFER)))
- {
- /* <body> */
- {
- U16 color_str_len = 10; /* size of bg_color and fg_color */
- U16 str_len = 5; /* size of slide_num, obj_num, and layout */
- U16 attr_num = 5; /* size of arrt_list would be attr_num * 2 + 1 */
- U8 bg_color[10];
- U8 fg_color[10];
- U8 slide_num[5];
- U8 obj_num[5];
- U8 layout[5];
- U8* attr_list[5 * 2 + 1];
- U8 i = 0;
- memset(bg_color, 0, color_str_len);
- sprintf((char*)bg_color, "0x%06x", g_uc_p->msg.background_color);
- attr_list[i++] = (U8*)MMI_UC_XML_ATTR_BGCOLOR;
- attr_list[i++] = bg_color;
- memset(fg_color, 0, color_str_len);
- sprintf((char*)fg_color, "0x%06x", g_uc_p->msg.foreground_color);
- attr_list[i++] = (U8*)MMI_UC_XML_ATTR_FGCOLOR;
- attr_list[i++] = fg_color;
- /* If only attachments and one slide without any content, do not send slide info.*/
- /* reference phone behavior */
- memset(slide_num, 0, str_len);
- if (mmi_uc_check_only_attachment() && g_uc_p->send_info.action != MMI_UC_ACTION_PREVIEW)
- {
- sprintf((char*)slide_num, "%d", 0);
- }
- else
- {
- sprintf((char*)slide_num, "%d", g_uc_p->msg.total_slide_num);
- }
- attr_list[i++] = (U8*)MMI_UC_XML_ATTR_SLIDE_NUM;
- attr_list[i++] = slide_num;
- memset(obj_num, 0, str_len);
- sprintf((char*)obj_num, "%d", g_uc_p->msg.total_object_num);
- attr_list[i++] = (U8*)MMI_UC_XML_ATTR_OBJ_NUM;
- attr_list[i++] = obj_num;
- memset(layout, 0, str_len);
- sprintf((char*)layout, "%d", mmi_uc_convert_to_mms_layout_type(g_uc_p->msg.layout));
- attr_list[i++] = (U8*)MMI_UC_XML_ATTR_LAYOUT;
- attr_list[i++] = layout;
- attr_list[i++] = NULL;
- MMI_ASSERT(i == (attr_num * 2 + 1));
- if ((result = mmi_uc_create_xml_element_start(fh, (U8*)MMI_UC_XML_ELEMENT_BODY, attr_list)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_new_line(fh)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- }
- /* Slide */
- if (mmi_uc_check_only_attachment() && g_uc_p->send_info.action != MMI_UC_ACTION_PREVIEW)
- {
- /* If only attachments and one slide without any content, do not send slide info.*/
- /* reference phone behavior */
- }
- else
- {
- if (g_uc_p->msg.total_slide_num)
- {
- mmi_uc_slide_struct* slide = g_uc_p->msg.slide_head;
- U16 i = 0;
- while (i < g_uc_p->msg.total_slide_num)
- {
- MMI_ASSERT(slide);
- if ((result = mmi_uc_create_xml_slide(fh, slide)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- slide = slide->next;
- i++;
- }
- }
- }
- /* Object */
- if (g_uc_p->msg.total_object_num)
- {
- mmi_uc_object_struct* object = g_uc_p->msg.object_head;
- U16 i = 0;
- while (i < g_uc_p->msg.total_object_num)
- {
- MMI_ASSERT(object);
- if ((result = mmi_uc_create_xml_object(fh, object)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- object = object->next;
- i++;
- }
- }
- /* </body> */
- if ((result = mmi_uc_create_xml_element_end(fh, (U8*)MMI_UC_XML_ELEMENT_BODY)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_new_line(fh)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- }
- /* </mms> */
- if ((result = mmi_uc_create_xml_element_end(fh, (U8*)MMI_UC_XML_ELEMENT_MMS)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- if ((result = mmi_uc_create_xml_new_line(fh)) != FS_NO_ERROR)
- {
- FS_Close(fh);
- return result;
- }
- FS_Close(fh);
- }
- else
- {
- result = (S32)fh;
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
- "*[UnifiedComposerMiscell.c] mmi_uc_create_mms_xml_description_file Create xml file FAIL! res=%d *n", result));
- }
- return result;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_create_xml_element_start
- * DESCRIPTION
- * Create the xml start element
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- S32 mmi_uc_create_xml_element_start(FS_HANDLE fh, U8* element_name, U8** attr_list)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8* temp_str = OslMalloc(MMI_UC_XML_TEMP_STR_LEN);
- S32 result = FS_NO_ERROR;
- U32 write_len = 0;
- U32 i = 0;
- U32 offset = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(temp_str,0,MMI_UC_XML_TEMP_STR_LEN);
- offset += sprintf((char*)temp_str, "%s%s", XML_TAG_ELEMENT_START, element_name);
- if (attr_list)
- {
- while (attr_list[i])
- {
- offset += sprintf((char*)temp_str + offset, " %s="%s"", attr_list[i], attr_list[i + 1]);
- i = i + 2;
- }
- }
- offset += sprintf((char*)(temp_str + offset), "%s", XML_TAG_GENERAL_END);
- MMI_ASSERT(offset < MMI_UC_XML_TEMP_STR_LEN);
- result = FS_Write(fh, temp_str, offset, &write_len);
- OslMfree(temp_str);
- return result;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_create_xml_element_end
- * DESCRIPTION
- * Create the xml end element
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- S32 mmi_uc_create_xml_element_end(FS_HANDLE fh, U8* element_name)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8* temp_str = OslMalloc(MMI_UC_XML_TEMP_STR_LEN);
- S32 result = FS_NO_ERROR;
- U32 write_len = 0;
- U32 offset = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(temp_str,0,MMI_UC_XML_TEMP_STR_LEN);
- offset += sprintf((char*)temp_str, "%s%s%s", XML_TAG_ELEMENT_END, element_name,XML_TAG_GENERAL_END);
- MMI_ASSERT(offset < MMI_UC_XML_TEMP_STR_LEN);
- result = FS_Write(fh, temp_str, offset, &write_len);
- OslMfree(temp_str);
- return result;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_create_xml_new_line
- * DESCRIPTION
- * Insert new line
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- S32 mmi_uc_create_xml_new_line(FS_HANDLE fh)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8* temp_str = OslMalloc(MMI_UC_XML_TEMP_STR_LEN);
- S32 result = FS_NO_ERROR;
- U32 write_len = 0;
- U32 offset = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(temp_str,0,MMI_UC_XML_TEMP_STR_LEN);
- offset += sprintf((char*)temp_str, "n");
- result = FS_Write(fh, temp_str, offset, &write_len);
- OslMfree(temp_str);
- return result;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_create_xml_data
- * DESCRIPTION
- * Add data
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- S32 mmi_uc_create_xml_data(FS_HANDLE fh, U8* data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 result = FS_NO_ERROR;
- U32 write_len = 0;
- U32 offset = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- offset = strlen((char*)data);
- result = FS_Write(fh, data, offset, &write_len);
- return result;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_create_xml_data
- * DESCRIPTION
- * Add data
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- S32 mmi_uc_create_xml_data_usc2_to_utf8(FS_HANDLE fh, U8* data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8* utf8_data;
- U32 utf8_data_len = pfnUnicodeStrlen((S8*)data) * 3 + 1;
- S32 result;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- utf8_data = OslMalloc(utf8_data_len);
- memset(utf8_data,0,utf8_data_len);
- mmi_chset_ucs2_to_utf8_string(
- (kal_uint8*) utf8_data,
- utf8_data_len,
- (kal_uint8*) data);
- result = mmi_uc_create_xml_data(fh, utf8_data);
- OslMfree(utf8_data);
- return result;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_create_xml_data_numeric_to_char
- * DESCRIPTION
- * Add numeric data
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- S32 mmi_uc_create_xml_data_numeric_to_char(FS_HANDLE fh, U32 value)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8* data;
- U32 data_len = 10;
- S32 result;
- U32 offset = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- data = OslMalloc(data_len);
- memset(data,0,data_len);
- offset += sprintf((char*)data, "%d", value);
- result = mmi_uc_create_xml_data(fh, data);
- OslMfree(data);
- return result;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_create_xml_addr
- * DESCRIPTION
- * Add data
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- S32 mmi_uc_create_xml_addr(FS_HANDLE fh, mmi_uc_address_group_type_enum type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 result;
- U32 i = 0;
- mmi_uc_addr_struct* addr = NULL;
- U8* attr_list[3];
- U8* xml_addr_type = NULL;
- U32 total = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (type)
- {
- case MMI_UC_ADDRESS_GROUP_TYPE_TO:
- {
- addr = g_uc_p->msg.to_head;
- total = g_uc_p->msg.to_num;
- xml_addr_type = (U8*)MMI_UC_XML_ELEMENT_TO;
- }
- break;
- case MMI_UC_ADDRESS_GROUP_TYPE_CC:
- {
- addr = g_uc_p->msg.cc_head;
- total = g_uc_p->msg.cc_num;
- xml_addr_type = (U8*)MMI_UC_XML_ELEMENT_CC;
- }
- break;
- case MMI_UC_ADDRESS_GROUP_TYPE_BCC:
- {
- addr = g_uc_p->msg.bcc_head;
- total = g_uc_p->msg.bcc_num;
- xml_addr_type = (U8*)MMI_UC_XML_ELEMENT_BCC;
- }
- break;
- default:
- {
- MMI_ASSERT(0);
- }
- break;
- }
- attr_list[0] = (U8*)MMI_UC_XML_ATTR_TYPE;
- attr_list[2] = NULL;
- while (i < total)
- {
- MMI_ASSERT(addr);
- if (addr->type == MMI_UC_ADDRESS_TYPE_PHONE_NUMBER)
- {
- attr_list[1] = (U8*)MMI_UC_XML_ATTR_POHNE_NUMBER;
- if ((result = mmi_uc_create_xml_element_start(fh,xml_addr_type,attr_list))
- != FS_NO_ERROR)
- {
- return result;
- }
- if ((result = mmi_uc_create_xml_data(fh, addr->addr)) != FS_NO_ERROR)
- {
- return result;
- }
- }
- else if (addr->type == MMI_UC_ADDRESS_TYPE_EMAIL)
- {
- attr_list[1] = (U8*)MMI_UC_XML_ATTR_EMAIL_ADDR;
- if ((result = mmi_uc_create_xml_element_start(fh,xml_addr_type,attr_list))
- != FS_NO_ERROR)
- {
- return result;
- }
- if ((result = mmi_uc_create_xml_data_usc2_to_utf8(fh, addr->addr)) != FS_NO_ERROR)
- {
- return result;
- }
- }
- else
- {
- MMI_ASSERT(0);
- }
- if ((result = mmi_uc_create_xml_element_end(fh, xml_addr_type))
- != FS_NO_ERROR)
- {
- return result;
- }
- if ((result = mmi_uc_create_xml_new_line(fh)) != FS_NO_ERROR)
- {
- return result;
- }
- addr = addr->next;
- i++;
- }
- return FS_NO_ERROR;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_create_xml_slide
- * DESCRIPTION
- * Add data
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- S32 mmi_uc_create_xml_slide(FS_HANDLE fh, mmi_uc_slide_struct* slide)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 result;
- U16 str_len = 5; /* size of index and duration */
- U16 attr_num = 2; /* size of attr_list would be attr_num * 2 + 1 */
- U8 index[5];
- U8 duration[5];
- U8* attr_list[2 * 2 + 1];
- U8 j = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_ASSERT(slide);
- memset(index, 0, str_len);
- sprintf((char*)index, "%d", (slide->slide_num));
- attr_list[j++] = (U8*)MMI_UC_XML_ATTR_INDEX;
- attr_list[j++] = index;
- memset(duration, 0, str_len);
- sprintf((char*)duration, "%d", g_uc_p->msg.slide_timing);
- attr_list[j++] = (U8*)MMI_UC_XML_ATTR_DURATION;
- attr_list[j++] = duration;
- attr_list[j++] = NULL;
- MMI_ASSERT(j == (attr_num * 2 + 1));
- if ((result = mmi_uc_create_xml_element_start(fh, (U8*)MMI_UC_XML_ELEMENT_SLIDE, attr_list)) != FS_NO_ERROR)
- {
- return result;
- }
- if ((result = mmi_uc_create_xml_new_line(fh)) != FS_NO_ERROR)
- {
- return result;
- }
- /* text */
- if (slide->text.object)
- {
- if ((result = mmi_uc_create_xml_slide_object(fh, slide, MMI_UC_OBJECT_TYPE_TEXT)) != FS_NO_ERROR)
- {
- return result;
- }
- }
- /* image */
- if (slide->image.object)
- {
- if ((result = mmi_uc_create_xml_slide_object(fh, slide, MMI_UC_OBJECT_TYPE_IMAGE)) != FS_NO_ERROR)
- {
- return result;
- }
- }
- /* audio */
- if (slide->audio.object)
- {
- if ((result = mmi_uc_create_xml_slide_object(fh, slide, MMI_UC_OBJECT_TYPE_AUDIO)) != FS_NO_ERROR)
- {
- return result;
- }
- }
- /* video */
- if (slide->video.object)
- {
- if ((result = mmi_uc_create_xml_slide_object(fh, slide, MMI_UC_OBJECT_TYPE_VIDEO)) != FS_NO_ERROR)
- {
- return result;
- }
- }
- if ((result = mmi_uc_create_xml_element_end(fh, (U8*)MMI_UC_XML_ELEMENT_SLIDE)) != FS_NO_ERROR)
- {
- return result;
- }
- if ((result = mmi_uc_create_xml_new_line(fh)) != FS_NO_ERROR)
- {
- return result;
- }
- return FS_NO_ERROR;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_create_xml_slide_object
- * DESCRIPTION
- * Add data
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- S32 mmi_uc_create_xml_slide_object(FS_HANDLE fh, mmi_uc_slide_struct* slide, mmi_uc_object_type obj_type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 result;
- U32 bg_color = 0;
- U32 fg_color = 0;
- U16 color_str_len = 10; /* size of bg_color_str and fg_color_str */
- U16 str_len = 5; /* size of id_str , start_str, and end_str */
- U16 attr_num = 5; /* size of attr_list would be attr_num * 2 + 1 */
- U32 id = 0;
- U8 bg_color_str[10];
- U8 fg_color_str[10];
- U8 id_str[5];
- U8 start_str[5];
- U8 end_str[5];
- U8* attr_list[5 * 2 + 1];
- U8 i = 0;
- U8 begin = 0;
- U8 end = 0;
- U8* obj_xml_type = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_ASSERT(slide);
- switch (obj_type)
- {
- case MMI_UC_OBJECT_TYPE_TEXT:
- {
- MMI_ASSERT(slide->text.object);
- fg_color = slide->text.foreground_color;
- bg_color = slide->text.background_color;
- id = slide->text.object->id;
- begin = slide->text.begin;
- end = slide->text.end;
- obj_xml_type = (U8*)MMI_UC_XML_ELEMENT_TEXT;
- }
- break;
- case MMI_UC_OBJECT_TYPE_IMAGE:
- {
- MMI_ASSERT(slide->image.object);
- id = slide->image.object->id;
- begin = slide->image.begin;
- end = slide->image.end;
- obj_xml_type = (U8*)MMI_UC_XML_ELEMENT_IMAGE;
- }
- break;
- case MMI_UC_OBJECT_TYPE_AUDIO:
- {
- MMI_ASSERT(slide->audio.object);
- id = slide->audio.object->id;
- begin = slide->audio.begin;
- end = slide->audio.end;
- obj_xml_type = (U8*)MMI_UC_XML_ELEMENT_AUDIO;
- }
- break;
- case MMI_UC_OBJECT_TYPE_VIDEO:
- {
- MMI_ASSERT(slide->video.object);
- id = slide->video.object->id;
- begin = slide->video.begin;
- end = slide->video.end;
- obj_xml_type = (U8*)MMI_UC_XML_ELEMENT_VIDEO;
- }
- break;
- default:
- {
- MMI_ASSERT(0);
- }
- break;
- }
- if (obj_type == MMI_UC_OBJECT_TYPE_TEXT)
- {
- memset(bg_color_str, 0, color_str_len);
- sprintf((char*)bg_color_str, "0x%06x", bg_color);
- attr_list[i++] = (U8*)MMI_UC_XML_ATTR_BGCOLOR;
- attr_list[i++] = bg_color_str;
- memset(fg_color_str, 0, color_str_len);
- sprintf((char*)fg_color_str, "0x%06x", fg_color);
- attr_list[i++] = (U8*)MMI_UC_XML_ATTR_FGCOLOR;
- attr_list[i++] = fg_color_str;
- }
- memset(id_str, 0, str_len);
- sprintf((char*)id_str, "%d", id);
- attr_list[i++] = (U8*)MMI_UC_XML_ATTR_ID;
- attr_list[i++] = id_str;
- if (begin != MMI_UC_INVALID_VALUE &&
- end != MMI_UC_INVALID_VALUE)
- {
- memset(start_str, 0, str_len);
- sprintf((char*)start_str, "%d", slide->text.begin);
- attr_list[i++] = (U8*)MMI_UC_XML_ATTR_BEGIN;
- attr_list[i++] = start_str;
- memset(end_str, 0, str_len);
- sprintf((char*)end_str, "%d", slide->text.end);
- attr_list[i++] = (U8*)MMI_UC_XML_ATTR_END;
- attr_list[i++] = end_str;
- }
- attr_list[i] = NULL;
- MMI_ASSERT(i <= (attr_num * 2 + 1));
- if ((result = mmi_uc_create_xml_element_single(fh, obj_xml_type, attr_list)) != FS_NO_ERROR)
- {
- return result;
- }
- if ((result = mmi_uc_create_xml_new_line(fh)) != FS_NO_ERROR)
- {
- return result;
- }
- return FS_NO_ERROR;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_create_xml_element_single
- * DESCRIPTION
- * Create the xml single element
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- S32 mmi_uc_create_xml_element_single(FS_HANDLE fh, U8* element_name, U8** attr_list)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8* temp_str = OslMalloc(MMI_UC_XML_TEMP_STR_LEN);
- S32 result = FS_NO_ERROR;
- U32 write_len = 0;
- U32 i = 0;
- U32 offset = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(temp_str,0,MMI_UC_XML_TEMP_STR_LEN);
- offset += sprintf((char*)temp_str, "%s%s", XML_TAG_ELEMENT_START, element_name);
- if (attr_list)
- {
- while (attr_list[i])
- {
- offset += sprintf((char*)(temp_str + offset), " %s="%s"", attr_list[i], attr_list[i + 1]);
- i = i + 2;
- }
- }
- offset += sprintf((char*)(temp_str + offset), "%s", XML_TAG_SINGLE_END);
- MMI_ASSERT(offset < MMI_UC_XML_TEMP_STR_LEN);
- result = FS_Write(fh, temp_str, offset, &write_len);
- OslMfree(temp_str);
- return result;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_create_xml_object
- * DESCRIPTION
- * Add data
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- S32 mmi_uc_create_xml_object(FS_HANDLE fh, mmi_uc_object_struct* obj)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 result;
- U16 str_len = 5; /* size of id, attach, vf, and drm */
- U16 byte_len = 10; /* size of size and offset */
- U16 attr_num = 6; /* size of attr_list would be attr_num * 2 + 1 */
- U8 id[5];
- U8 attach[5];
- U8 vf[5];
- U8 drm[5];
- U8 size[10];
- U8 offset[10];
- U8* attr_list[6 * 2 + 1];
- U8 j = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_ASSERT(obj);
- memset(id, 0, str_len);
- sprintf((char*)id, "%d", obj->id);
- attr_list[j++] = (U8*)MMI_UC_XML_ATTR_ID;
- attr_list[j++] = id;
- memset(attach, 0, str_len);
- if (obj->type == MMI_UC_OBJECT_TYPE_ATTACHMENT)
- {
- sprintf((char*)attach, "%d", 1);
- }
- else
- {
- sprintf((char*)attach, "%d", 0);
- }
- attr_list[j++] = (U8*)MMI_UC_XML_ATTR_ATTACH;
- attr_list[j++] = attach;
- memset(vf, 0, str_len);
- sprintf((char*)vf, "%d", obj->is_virtual_file);
- attr_list[j++] = (U8*)MMI_UC_XML_ATTR_VIRTUAL_FILE;
- attr_list[j++] = vf;
- memset(drm, 0, str_len);
- sprintf((char*)drm, "%d", obj->drm_type);
- attr_list[j++] = (U8*)MMI_UC_XML_ATTR_DRM;
- attr_list[j++] = drm;
- memset(size, 0, byte_len);
- sprintf((char*)size, "%d", obj->size);
- attr_list[j++] = (U8*)MMI_UC_XML_ATTR_SIZE;
- attr_list[j++] = size;
- memset(offset, 0, byte_len);
- sprintf((char*)offset, "%d", obj->offset);
- attr_list[j++] = (U8*)MMI_UC_XML_ATTR_OFFSET;
- attr_list[j++] = offset;
- attr_list[j++] = NULL;
- MMI_ASSERT(j == (attr_num * 2 + 1));
- /* <obj> */
- if ((result = mmi_uc_create_xml_element_start(fh, (U8*)MMI_UC_XML_ELEMENT_OBJECT, attr_list)) != FS_NO_ERROR)
- {
- return result;
- }
- if ((result = mmi_uc_create_xml_new_line(fh)) != FS_NO_ERROR)
- {
- return result;
- }
- /* name */
- if ((result = mmi_uc_create_xml_element_start(fh, (U8*)MMI_UC_XML_ELEMENT_NAME, NULL)) != FS_NO_ERROR)
- {
- return result;
- }
- if ((result = mmi_uc_create_xml_data_usc2_to_utf8(fh, (U8*)obj->file_name)) != FS_NO_ERROR)
- {
- return result;
- }
- if ((result = mmi_uc_create_xml_element_end(fh, (U8*)MMI_UC_XML_ELEMENT_NAME)) != FS_NO_ERROR)
- {
- return result;
- }
- if ((result = mmi_uc_create_xml_new_line(fh)) != FS_NO_ERROR)
- {
- return result;
- }
- /* file path */
- if ((result = mmi_uc_create_xml_element_start(fh, (U8*)MMI_UC_XML_ELEMENT_FILE_PATH, NULL)) != FS_NO_ERROR)
- {
- return result;
- }
- if ((result = mmi_uc_create_xml_data_usc2_to_utf8(fh, (U8*)obj->file_path)) != FS_NO_ERROR)
- {
- return result;
- }
- if ((result = mmi_uc_create_xml_element_end(fh, (U8*)MMI_UC_XML_ELEMENT_FILE_PATH)) != FS_NO_ERROR)
- {
- return result;
- }
- if ((result = mmi_uc_create_xml_new_line(fh)) != FS_NO_ERROR)
- {
- return result;
- }
- /* </obj> */
- if ((result = mmi_uc_create_xml_element_end(fh, (U8*)MMI_UC_XML_ELEMENT_OBJECT)) != FS_NO_ERROR)
- {
- return result;
- }
- if ((result = mmi_uc_create_xml_new_line(fh)) != FS_NO_ERROR)
- {
- return result;
- }
- return FS_NO_ERROR;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_update_object_id
- * DESCRIPTION
- * Update object ID
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_update_object_id(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 i = 1;
- mmi_uc_object_struct* object = g_uc_p->msg.object_head;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for(;i <= g_uc_p->msg.total_object_num; i++)
- {
- MMI_ASSERT(object);
- object->id = i;
- object = object->next;
- }
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_parse_mms_xml_description_file
- * DESCRIPTION
- * Pare mms xml description file
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- S32 mmi_uc_parse_mms_xml_description_file(U16* file_path)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 result = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->xml.xml_parser = OslMalloc(sizeof(XML_PARSER_STRUCT));
- memset(g_uc_p->xml.xml_parser, 0, sizeof(XML_PARSER_STRUCT));
- result = xml_new_parser(g_uc_p->xml.xml_parser);
- if (result)
- {
- xml_close_parser(g_uc_p->xml.xml_parser);
- OslMfree(g_uc_p->xml.xml_parser);
- g_uc_p->xml.xml_parser = NULL;
- return MMI_UC_XML_ERROR;
- }
- xml_register_element_handler(g_uc_p->xml.xml_parser, mmi_uc_xml_start_element_hdlr, mmi_uc_xml_end_element_hdlr);
- xml_register_data_handler(g_uc_p->xml.xml_parser, mmi_uc_xml_data_hdlr);
- result = xml_parse(g_uc_p->xml.xml_parser, file_path);
- xml_close_parser(g_uc_p->xml.xml_parser);
- OslMfree(g_uc_p->xml.xml_parser);
- g_uc_p->xml.xml_parser = NULL;
- if (result)
- {
- return MMI_UC_XML_ERROR;
- }
- else
- {
- if (mmi_uc_match_object_id() == FS_NO_ERROR)
- {
- return MMI_UC_OK;
- }
- else
- {
- return MMI_UC_STORAGE_FULL;
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_convert_mms_app_mode_to_uc_state
- * DESCRIPTION
- * Convert mma_app_mode_enum to mmi_uc_state_enum
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- U16 mmi_uc_convert_mms_app_mode_to_uc_state(U16 app_mode)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 uc_state = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (app_mode)
- {
- case MMA_MODE_SEND:
- {
- uc_state = MMI_UC_STATE_SEND;
- }
- break;
- case MMA_MODE_FORWARD:
- {
- uc_state = MMI_UC_STATE_FORWARD;
- }
- break;
- case MMA_MODE_REPLY:
- {
- uc_state = MMI_UC_STATE_REPLY;
- }
- break;
- case MMA_MODE_REPLY_ALL:
- {
- uc_state = MMI_UC_STATE_REPLY_ALL;
- }
- break;
- case MMA_MODE_EDIT:
- {
- uc_state = MMI_UC_STATE_EDIT_EXISTED_MSG;
- }
- break;
- default:
- {
- MMI_ASSERT(0);
- }
- break;
- }
- return uc_state;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_convert_uc_state_to_mms_app_mode
- * DESCRIPTION
- * Convert mmi_uc_state_enum to mma_app_mode_enum
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- U16 mmi_uc_convert_uc_state_to_mms_app_mode(U16 uc_state)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 app_mode = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (uc_state)
- {
- case MMI_UC_STATE_SEND:
- {
- app_mode = MMA_MODE_SEND;
- }
- break;
- case MMI_UC_STATE_FORWARD:
- {
- app_mode = MMA_MODE_FORWARD;
- }
- break;
- case MMI_UC_STATE_REPLY:
- {
- app_mode = MMA_MODE_REPLY;
- }
- break;
- case MMI_UC_STATE_REPLY_ALL:
- {
- app_mode = MMA_MODE_REPLY_ALL;
- }
- break;
- case MMI_UC_STATE_EDIT_EXISTED_MSG:
- {
- app_mode = MMA_MODE_EDIT;
- }
- break;
- default:
- {
- MMI_ASSERT(0);
- }
- break;
- }
- return app_mode;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_xml_start_element_hdlr
- * DESCRIPTION
- * Start element handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_xml_start_element_hdlr(void *data, const char *el, const char **attr)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((!strcmp(MMI_UC_XML_ELEMENT_TO, el)) ||
- (!strcmp(MMI_UC_XML_ELEMENT_CC, el)) ||
- (!strcmp(MMI_UC_XML_ELEMENT_BCC, el))||
- (!strcmp(MMI_UC_XML_ELEMENT_FROM, el)))
- {
- if (!strcmp(MMI_UC_XML_ATTR_TYPE, attr[0]))
- {
- if (!strcmp(MMI_UC_XML_ATTR_POHNE_NUMBER, attr[1]))
- {
- g_uc_p->xml.addr_type = MMI_UC_ADDRESS_TYPE_PHONE_NUMBER;
- }
- else if (!strcmp(MMI_UC_XML_ATTR_EMAIL_ADDR, attr[1]))
- {
- g_uc_p->xml.addr_type = MMI_UC_ADDRESS_TYPE_EMAIL;
- }
- else
- {
- MMI_ASSERT(0);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
- "*[UnifiedComposerMain.c] mmi_uc_xml_start_element_hdlr addr type error*n"));
- g_uc_p->xml.addr_type = MMI_UC_ADDRESS_TYPE_PHONE_NUMBER;
- }
- }
- }
- else if (!strcmp(MMI_UC_XML_ELEMENT_BODY , el))
- {
- for (i = 0; attr[i]; i = i + 2)
- {
- if (!strcmp(MMI_UC_XML_ATTR_BGCOLOR , attr[i]))
- {
- g_uc_p->msg.background_color = mmi_uc_convert_ascii_hex_to_dec((U8*) attr[i + 1]);
- }
- else if (!strcmp(MMI_UC_XML_ATTR_FGCOLOR , attr[i]))
- {
- g_uc_p->msg.foreground_color = mmi_uc_convert_ascii_hex_to_dec((U8*) attr[i + 1]);
- }
- else if (!strcmp(MMI_UC_XML_ATTR_SLIDE_NUM , attr[i]))
- {
- /* updated in mmi_uc_insert_slide_by_number*/
- //g_uc_p->msg.total_slide_num = atoi((S8*) attr[i + 1]);
- }
- else if (!strcmp(MMI_UC_XML_ATTR_OBJ_NUM , attr[i]))
- {
- /* updated in mmi_uc_insert_object_to_list_tail() */
- //g_uc_p->msg.total_object_num = atoi((S8*) attr[i + 1]);
- }
- else if (!strcmp(MMI_UC_XML_ATTR_LAYOUT , attr[i]))
- {
- g_uc_p->msg.layout = mmi_uc_convert_mms_layout_type_to_uc((U8)atoi((S8*) attr[i + 1]));
- }
- }
- }
- else if (!strcmp(MMI_UC_XML_ELEMENT_SLIDE , el))
- {
- U8 slide_number = 0;
- U8 duration = 0;
- for (i = 0; attr[i]; i = i + 2)
- {
- if (!strcmp(MMI_UC_XML_ATTR_INDEX, attr[i]))
- {
- slide_number = atoi((S8*) attr[i + 1]);
- }
- else if (!strcmp(MMI_UC_XML_ATTR_DURATION , attr[i]))
- {
- duration = atoi((S8*) attr[i + 1]);
- }
- }
- if (slide_number)
- {
- g_uc_p->xml.slide = mmi_uc_insert_slide_by_number(slide_number);
- if (g_uc_p->xml.slide)
- {
- MMI_ASSERT(g_uc_p->xml.slide->slide_num == slide_number);
- if (duration)
- {
- g_uc_p->xml.slide->duration = duration;
- }
- }
- else
- {
- MMI_ASSERT(0);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
- "*[UnifiedComposerMain.c] mmi_uc_xml_start_element_hdlr slide error*n"));
- }
- }
- else
- {
- MMI_ASSERT(0);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
- "*[UnifiedComposerMain.c] mmi_uc_xml_start_element_hdlr slide number error*n"));
- }
- }
- else if (!strcmp(MMI_UC_XML_ELEMENT_TEXT , el))
- {
- for (i = 0; attr[i]; i = i + 2)
- {
- if (!strcmp(MMI_UC_XML_ATTR_ID , attr[i]))
- {
- g_uc_p->xml.slide->text.id = (atoi((S8*) attr[i + 1]));
- }
- else if (!strcmp(MMI_UC_XML_ATTR_BEGIN , attr[i]))
- {
- g_uc_p->xml.slide->text.begin = atoi((S8*) attr[i + 1]);
- }
- else if (!strcmp(MMI_UC_XML_ATTR_END , attr[i]))
- {
- g_uc_p->xml.slide->text.end = atoi((S8*) attr[i + 1]);
- }
- else if (!strcmp(MMI_UC_XML_ATTR_BGCOLOR , attr[i]))
- {
- g_uc_p->xml.slide->text.background_color = mmi_uc_convert_ascii_hex_to_dec((U8*) attr[i + 1]);
- }
- else if (!strcmp(MMI_UC_XML_ATTR_FGCOLOR , attr[i]))
- {
- g_uc_p->xml.slide->text.foreground_color = mmi_uc_convert_ascii_hex_to_dec((U8*) attr[i + 1]);
- }
- }
- }
- else if (!strcmp(MMI_UC_XML_ELEMENT_IMAGE, el))
- {
- for (i = 0; attr[i]; i = i + 2)
- {
- if (!strcmp(MMI_UC_XML_ATTR_ID , attr[i]))
- {
- g_uc_p->xml.slide->image.id = (atoi((S8*) attr[i + 1]));
- }
- else if (!strcmp(MMI_UC_XML_ATTR_BEGIN , attr[i]))
- {
- g_uc_p->xml.slide->image.begin = atoi((S8*) attr[i + 1]);
- }
- else if (!strcmp(MMI_UC_XML_ATTR_END , attr[i]))
- {
- g_uc_p->xml.slide->image.end = atoi((S8*) attr[i + 1]);
- }
- }
- }
- else if (!strcmp(MMI_UC_XML_ELEMENT_AUDIO, el))
- {
- for (i = 0; attr[i]; i = i + 2)
- {
- if (!strcmp(MMI_UC_XML_ATTR_ID , attr[i]))
- {
- g_uc_p->xml.slide->audio.id = (atoi((S8*) attr[i + 1]));
- }
- else if (!strcmp(MMI_UC_XML_ATTR_BEGIN , attr[i]))
- {
- g_uc_p->xml.slide->audio.begin = atoi((S8*) attr[i + 1]);
- }
- else if (!strcmp(MMI_UC_XML_ATTR_END , attr[i]))
- {
- g_uc_p->xml.slide->audio.end = atoi((S8*) attr[i + 1]);
- }
- }
- }
- else if (!strcmp(MMI_UC_XML_ELEMENT_VIDEO, el))
- {
- for (i = 0; attr[i]; i = i + 2)
- {
- if (!strcmp(MMI_UC_XML_ATTR_ID , attr[i]))
- {
- g_uc_p->xml.slide->video.id = (atoi((S8*) attr[i + 1]));
- }
- else if (!strcmp(MMI_UC_XML_ATTR_BEGIN , attr[i]))
- {
- g_uc_p->xml.slide->video.begin = atoi((S8*) attr[i + 1]);
- }
- else if (!strcmp(MMI_UC_XML_ATTR_END , attr[i]))
- {
- g_uc_p->xml.slide->video.end = atoi((S8*) attr[i + 1]);
- }
- }
- }
- else if (!strcmp(MMI_UC_XML_ELEMENT_OBJECT, el))
- {
- g_uc_p->xml.object = mmi_uc_insert_object_to_list_tail();
- for (i = 0; attr[i]; i = i + 2)
- {
- if (!strcmp(MMI_UC_XML_ATTR_ID , attr[i]))
- {
- g_uc_p->xml.object->id = (atoi((S8*) attr[i + 1]));
- }
- else if (!strcmp(MMI_UC_XML_ATTR_ATTACH , attr[i]))
- {
- if (atoi((S8*) attr[i + 1]))
- {
- g_uc_p->xml.object->type = MMI_UC_OBJECT_TYPE_ATTACHMENT;
- }
- }
- else if (!strcmp(MMI_UC_XML_ATTR_VIRTUAL_FILE , attr[i]))
- {
- if (atoi((S8*) attr[i + 1]))
- {
- g_uc_p->xml.object->is_virtual_file = MMI_TRUE;
- }
- else
- {
- g_uc_p->xml.object->is_virtual_file = MMI_FALSE;
- }
- }
- else if (!strcmp(MMI_UC_XML_ATTR_DRM, attr[i]))
- {
- if (atoi((S8*) attr[i + 1]))
- {
- g_uc_p->xml.object->drm_type = (atoi((S8*) attr[i + 1]));
- }
- }
- else if (!strcmp(MMI_UC_XML_ATTR_SIZE , attr[i]))
- {
- if (atoi((S8*) attr[i + 1]))
- {
- g_uc_p->xml.object->size = (atoi((S8*) attr[i + 1]));
- }
- }
- else if (!strcmp(MMI_UC_XML_ATTR_OFFSET , attr[i]))
- {
- if (atoi((S8*) attr[i + 1]))
- {
- g_uc_p->xml.object->offset = (atoi((S8*) attr[i + 1]));
- }
- }
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_xml_end_element_hdlr
- * DESCRIPTION
- * end element handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_xml_end_element_hdlr(void *data, const char *el)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!strcmp(MMI_UC_XML_ELEMENT_OBJECT, el))
- {
- if (g_uc_p->xml.object->type == MMI_UC_OBJECT_TYPE_ATTACHMENT)
- {
- mmi_uc_attachment_info_struct* att;
- att = mmi_uc_insert_attachment();
- mmi_uc_insert_object_to_attachment(g_uc_p->xml.object, att);
- }
- }
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_xml_start_element_hdlr
- * DESCRIPTION
- * Start element handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_xml_data_hdlr(void *data, const char *el, const char *value, int len)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!strcmp(MMI_UC_XML_ELEMENT_TO, el))
- {
- if (g_uc_p->main.state == MMI_UC_STATE_REPLY ||
- g_uc_p->main.state == MMI_UC_STATE_FORWARD)
- {
- /* Do nothing */
- }
- else
- {
- mmi_uc_xml_data_address_hdlr(
- (U8*)value,
- len,
- g_uc_p->xml.addr_type,
- MMI_UC_ADDRESS_GROUP_TYPE_TO);
- }
- }
- else if (!strcmp(MMI_UC_XML_ELEMENT_CC, el))
- {
- if (g_uc_p->main.state == MMI_UC_STATE_REPLY||
- g_uc_p->main.state == MMI_UC_STATE_FORWARD)
- {
- /* Do nothing */
- }
- else
- {
- mmi_uc_xml_data_address_hdlr(
- (U8*)value,
- len,
- g_uc_p->xml.addr_type,
- MMI_UC_ADDRESS_GROUP_TYPE_CC);
- }
- }
- else if (!strcmp(MMI_UC_XML_ELEMENT_BCC, el))
- {
- if (g_uc_p->main.state == MMI_UC_STATE_REPLY||
- g_uc_p->main.state == MMI_UC_STATE_FORWARD)
- {
- /* Do nothing */
- }
- else
- {
- mmi_uc_xml_data_address_hdlr(
- (U8*)value,
- len,
- g_uc_p->xml.addr_type,
- MMI_UC_ADDRESS_GROUP_TYPE_BCC);
- }
- }
- else if (!strcmp(MMI_UC_XML_ELEMENT_FROM, el))
- {
- if (g_uc_p->main.state == MMI_UC_STATE_REPLY ||
- g_uc_p->main.state == MMI_UC_STATE_REPLY_ALL )
- {
- mmi_uc_xml_data_address_hdlr(
- (U8*)value,
- len,
- g_uc_p->xml.addr_type,
- MMI_UC_ADDRESS_GROUP_TYPE_TO);
- }
- }
- else if (!strcmp(MMI_UC_XML_ELEMENT_SUBJECT, el))
- {
- memset(g_uc_p->msg.subject, 0 ,MMI_UC_MAX_SUBJECT_LEN * ENCODING_LENGTH);
- mmi_chset_utf8_to_ucs2_string((kal_uint8*)g_uc_p->msg.subject, MMI_UC_MAX_SUBJECT_LEN * ENCODING_LENGTH, (kal_uint8*)value);
- }
- else if (!strcmp(MMI_UC_XML_ELEMENT_READ_REPORT, el))
- {
- if (g_uc_p->main.state == MMI_UC_STATE_REPLY ||
- g_uc_p->main.state == MMI_UC_STATE_REPLY_ALL ||
- g_uc_p->main.state == MMI_UC_STATE_FORWARD)
- {
- /* Do nothing */
- }
- else
- {
- if (atoi((S8*) value))
- {
- g_uc_p->msg.read_report = MMI_TRUE;
- }
- else
- {
- g_uc_p->msg.read_report = MMI_FALSE;
- }
- }
- }
- else if (!strcmp(MMI_UC_XML_ELEMENT_DELIVERY_REPORT, el))
- {
- if (g_uc_p->main.state == MMI_UC_STATE_REPLY ||
- g_uc_p->main.state == MMI_UC_STATE_REPLY_ALL ||
- g_uc_p->main.state == MMI_UC_STATE_FORWARD)
- {
- /* Do nothing */
- }
- else
- {
- if (atoi((S8*) value))
- {
- g_uc_p->msg.delivery_report = MMI_TRUE;
- }
- else
- {
- g_uc_p->msg.delivery_report = MMI_FALSE;
- }
- }
- }
- else if (!strcmp(MMI_UC_XML_ELEMENT_PRIORITY , el))
- {
- if (g_uc_p->main.state == MMI_UC_STATE_REPLY ||
- g_uc_p->main.state == MMI_UC_STATE_REPLY_ALL ||
- g_uc_p->main.state == MMI_UC_STATE_FORWARD)
- {
- /* Do nothing */
- }
- else
- {
- g_uc_p->msg.priority = atoi((S8*) value);
- }
- }
- else if (!strcmp(MMI_UC_XML_ELEMENT_EXPIRY , el))
- {
- if (g_uc_p->main.state == MMI_UC_STATE_REPLY ||
- g_uc_p->main.state == MMI_UC_STATE_REPLY_ALL ||
- g_uc_p->main.state == MMI_UC_STATE_FORWARD)
- {
- /* Do nothing */
- }
- else
- {
- g_uc_p->msg.expiry_time = atoi((S8*) value);
- }
- }
- else if (!strcmp(MMI_UC_XML_ELEMENT_DELIVERY_TIME , el))
- {
- if (g_uc_p->main.state == MMI_UC_STATE_REPLY ||
- g_uc_p->main.state == MMI_UC_STATE_REPLY_ALL ||
- g_uc_p->main.state == MMI_UC_STATE_FORWARD)
- {
- /* Do nothing */
- }
- else
- {
- g_uc_p->msg.delivery_time = atoi((S8*) value);
- }
- }
- else if (!strcmp(MMI_UC_XML_ELEMENT_VISIBLE , el))
- {
- if (g_uc_p->main.state == MMI_UC_STATE_REPLY ||
- g_uc_p->main.state == MMI_UC_STATE_REPLY_ALL ||
- g_uc_p->main.state == MMI_UC_STATE_FORWARD)
- {
- /* Do nothing */
- }
- else
- {
- if (atoi((S8*) value))
- {
- g_uc_p->msg.sender_visibility = MMI_TRUE;
- }
- else
- {
- g_uc_p->msg.sender_visibility = MMI_FALSE;
- }
- }
- }
- else if (!strcmp(MMI_UC_XML_ELEMENT_NAME , el))
- {
- U32 ucs2_len = (len + 1) * ENCODING_LENGTH;
- MMI_ASSERT(g_uc_p->xml.object);
- MMI_ASSERT(g_uc_p->xml.object->file_name == NULL);
- g_uc_p->xml.object->file_name = kal_adm_alloc(g_uc_p->main.mem_pool_id, ucs2_len);
- MMI_ASSERT(g_uc_p->xml.object->file_name);
- memset(g_uc_p->xml.object->file_name, 0, ucs2_len);
- mmi_chset_utf8_to_ucs2_string((kal_uint8*)g_uc_p->xml.object->file_name, ucs2_len, (kal_uint8*)value);
- }
- else if (!strcmp(MMI_UC_XML_ELEMENT_FILE_PATH , el))
- {
- U32 ucs2_len = (len + 1) * ENCODING_LENGTH;
- MMI_ASSERT(g_uc_p->xml.object);
- MMI_ASSERT(g_uc_p->xml.object->file_path == NULL);
- g_uc_p->xml.object->file_path = kal_adm_alloc(g_uc_p->main.mem_pool_id, ucs2_len);
- MMI_ASSERT(g_uc_p->xml.object->file_path);
- memset(g_uc_p->xml.object->file_path, 0, ucs2_len);
- mmi_chset_utf8_to_ucs2_string((kal_uint8*)g_uc_p->xml.object->file_path, ucs2_len, (kal_uint8*)value);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_xml_data_address_hdlr
- * DESCRIPTION
- * Add address
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_xml_data_address_hdlr(U8* utf8_addr,
- S32 addr_len,
- mmi_uc_address_type_enum addr_type,
- mmi_uc_address_group_type_enum addr_group_type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *ucs2;
- U32 ucs2_len;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ucs2_len = (addr_len + 1) * ENCODING_LENGTH;
- ucs2 = OslMalloc(ucs2_len);
- memset(ucs2, 0, ucs2_len);
- mmi_chset_utf8_to_ucs2_string(ucs2, ucs2_len, utf8_addr);
- if (mmi_uc_check_duplicate_address(ucs2, addr_type, addr_group_type) != NULL)
- {
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMiscell.c] mmi_uc_xml_data_address_hdlr duplicate addr *n"));
- }
- else
- {
- if (addr_type == MMI_UC_ADDRESS_TYPE_PHONE_NUMBER ||
- addr_type == MMI_UC_ADDRESS_TYPE_EMAIL )
- {
- mmi_uc_add_address(ucs2, addr_type, addr_group_type);
- }
- else
- {
- MMI_ASSERT(0);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
- "*[UnifiedComposerMiscell.c] mmi_uc_xml_data_address_hdlr addr type error*n"));
- }
- }
- OslMfree(ucs2);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_convert_ascii_hex_to_dec
- * DESCRIPTION
- * Converts Ascii value to Decimal value
- * PARAMETERS
- * character [IN]
- * S8 ascii values(?)
- * RETURNS
- * U8 Decimal value.
- *****************************************************************************/
- U32 mmi_uc_convert_ascii_hex_to_dec(U8* character)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 i = 0;
- U32 value = 0;
- U8 c = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Skip prefix "0x" or "0X" */
- if (character[0] == '0' && (character[1] == 'x' || character[1] == 'X'))
- {
- i = 2;
- }
- while ((c = character[i]) != 0)
- {
- value = value * 16;
- if (c > 47 && c < 58) /* Digits 0..9 */
- {
- value += (c - 48);
- }
- else if (c > 64 && c < 71) /* Characters A..F */
- {
- value += (c - 55);
- }
- else if (c > 96 && c < 103) /* Characters a..f */
- {
- value += (c - 87);
- }
- i++;
- }
- return value;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_insert_slide_by_number
- * DESCRIPTION
- * Insert slide by slide number
- * PARAMETERS
- * character [IN]
- * S8 ascii values(?)
- * RETURNS
- * U8 Decimal value.
- *****************************************************************************/
- mmi_uc_slide_struct* mmi_uc_insert_slide_by_number(U8 slide_number)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_uc_slide_struct* cur_slide = g_uc_p->msg.slide_head;
- mmi_uc_slide_struct* pre_slide = cur_slide;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (slide_number == 1)
- {
- return mmi_uc_insert_slide(NULL);
- }
- else
- {
- while (cur_slide && (cur_slide->slide_num < slide_number))
- {
- pre_slide = cur_slide;
- cur_slide = cur_slide->next;
- }
- return mmi_uc_insert_slide(pre_slide);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_insert_object_to_list_tail
- * DESCRIPTION
- * Insert object to object list tail
- * PARAMETERS
- * character [IN]
- * S8 ascii values(?)
- * RETURNS
- * U8 Decimal value.
- *****************************************************************************/
- mmi_uc_object_struct* mmi_uc_insert_object_to_list_tail(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_uc_object_struct* new_object;
- U32 object_size;
- U32 i = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- object_size = sizeof(mmi_uc_object_struct);
- new_object = kal_adm_alloc(g_uc_p->main.mem_pool_id, object_size);
- MMI_ASSERT(new_object);
- memset(new_object, 0, object_size);
- /* First object */
- if (g_uc_p->msg.object_head == NULL)
- {
- g_uc_p->msg.object_head = new_object;
- new_object->next = NULL;
- new_object->previous = NULL;
- }
- else
- {
- mmi_uc_object_struct* cur_object = g_uc_p->msg.object_head;
- while (cur_object->next)
- {
- MMI_ASSERT( i < g_uc_p->msg.total_object_num);
- cur_object = cur_object->next;
- i++;
- }
- cur_object->next = new_object;
- new_object->next = NULL;
- new_object->previous = cur_object;
- }
- g_uc_p->msg.total_object_num++;
- return new_object;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_match_object_id
- * DESCRIPTION
- * Match object id after parsing xml file
- * PARAMETERS
- * character [IN]
- * S8 ascii values(?)
- * RETURNS
- * U8 Decimal value.
- *****************************************************************************/
- S32 mmi_uc_match_object_id(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_uc_slide_struct* cur_slide = g_uc_p->msg.slide_head;
- U32 slide_num = 0;
- mmi_uc_object_struct* cur_object = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (; cur_slide != NULL; cur_slide = cur_slide->next, slide_num++)
- {
- if (cur_slide->text.id)
- {
- wgui_uce_text_info_struct text_info;
- U8 mmi_uc_text_path[MMI_UC_MAX_TEMP_FILE_LEN];
- U8 virtual_file_name[FS_GenVFN_SIZE];
- S32 ori_file_handle;
- S32 result;
- U8* file_name;
- U16 file_path_len = 0;
- U16 file_name_len = 0;
- memset(mmi_uc_text_path, 0, MMI_UC_MAX_TEMP_FILE_LEN);
- MMI_UC_MAKE_TEXT_FILE_PATH(mmi_uc_text_path, cur_slide->slide_num);
- MMI_ASSERT((cur_object = mmi_uc_get_object_by_id(cur_slide->text.id)) != NULL);
- mmi_uc_insert_object_to_slide(cur_object, cur_slide, MMI_UC_OBJECT_TYPE_TEXT);
- cur_slide->text.object->type = MMI_UC_OBJECT_TYPE_TEXT;
- MMI_ASSERT(cur_slide->text.object->file_path);
- if (cur_slide->text.object->is_virtual_file)
- {
- ori_file_handle = FS_Open(cur_slide->text.object->file_path, FS_READ_ONLY | FS_OPEN_SHARED);
- if (ori_file_handle <= 0)
- {
- MMI_ASSERT(0);
- return ori_file_handle;
- }
- result = FS_GenVirtualFileName(
- ori_file_handle,
- (U16*)virtual_file_name,
- (unsigned int)FS_GenVFN_SIZE,
- cur_slide->text.object->offset,
- cur_slide->text.object->size);
- if (result < 0)
- {
- MMI_ASSERT(0);
- return result;
- }
- mmi_uc_read_file_to_text_buffer(virtual_file_name);
- FS_Close(ori_file_handle);
- }
- else
- {
- mmi_uc_read_file_to_text_buffer((U8*)cur_slide->text.object->file_path);
- }
- memset(&text_info, 0, sizeof(wgui_uce_text_info_struct));
- wgui_uce_get_text_info_for_buffer(&text_info, g_uc_p->main.text_buffer);
- mmi_uc_set_text_info_to_slide(cur_slide, &text_info);
- if ((result = mmi_uc_save_buffer_to_file(mmi_uc_text_path, g_uc_p->main.text_buffer, text_info.char_count)) != FS_NO_ERROR)
- {
- return result;
- }
- if (cur_slide->text.object->is_virtual_file)
- {
- /* file path */
- kal_adm_free(g_uc_p->main.mem_pool_id, cur_slide->text.object->file_path);
- file_path_len = pfnUnicodeStrlen((S8*)mmi_uc_text_path);
- cur_slide->text.object->file_path = kal_adm_alloc(g_uc_p->main.mem_pool_id, (file_path_len + 1 ) * 2);
- MMI_ASSERT(cur_slide->text.object->file_path);
- memset(cur_slide->text.object->file_path, 0, (file_path_len + 1) * 2);
- pfnUnicodeStrncpy((S8*)cur_slide->text.object->file_path, (S8*)mmi_uc_text_path, file_path_len);
- /* file name */
- if (cur_slide->text.object->file_name)
- {
- kal_adm_free(g_uc_p->main.mem_pool_id, cur_slide->text.object->file_name);
- }
- file_name = (U8*)mmi_uc_get_file_name((U16*)mmi_uc_text_path);
- file_name_len = pfnUnicodeStrlen((S8*)file_name);
- cur_slide->text.object->file_name = kal_adm_alloc(g_uc_p->main.mem_pool_id, (file_name_len + 1 ) * 2);
- MMI_ASSERT(cur_slide->text.object->file_name);
- memset(cur_slide->text.object->file_name, 0, (file_name_len + 1) * 2);
- pfnUnicodeStrncpy((S8*)cur_slide->text.object->file_name, (S8*)file_name, file_name_len);
- cur_slide->text.object->offset = 0;
- cur_slide->text.object->size = applib_get_file_size((kal_wchar*)cur_slide->text.object->file_path);
- cur_slide->text.object->drm_type = MMA_DRM_NONE;
- cur_slide->text.object->is_virtual_file = MMI_FALSE;
- }
- }
- if (cur_slide->image.id)
- {
- MMI_ASSERT((cur_object = mmi_uc_get_object_by_id(cur_slide->image.id)) != NULL);
- mmi_uc_insert_object_to_slide(cur_object, cur_slide, MMI_UC_OBJECT_TYPE_IMAGE);
- cur_slide->image.object->type = MMI_UC_OBJECT_TYPE_IMAGE;
- }
- if (cur_slide->audio.id)
- {
- MMI_ASSERT((cur_object = mmi_uc_get_object_by_id(cur_slide->audio.id)) != NULL);
- mmi_uc_insert_object_to_slide(cur_object, cur_slide, MMI_UC_OBJECT_TYPE_AUDIO);
- cur_slide->audio.object->type = MMI_UC_OBJECT_TYPE_AUDIO;
- }
- if (cur_slide->video.id)
- {
- MMI_ASSERT((cur_object = mmi_uc_get_object_by_id(cur_slide->video.id)) != NULL);
- mmi_uc_insert_object_to_slide(cur_object, cur_slide, MMI_UC_OBJECT_TYPE_VIDEO);
- cur_slide->video.object->type = MMI_UC_OBJECT_TYPE_VIDEO;
- }
- }
- MMI_ASSERT( slide_num == g_uc_p->msg.total_slide_num);
- return FS_NO_ERROR;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_get_object_by_id
- * DESCRIPTION
- * Get object pointer by object id
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- mmi_uc_object_struct* mmi_uc_get_object_by_id(U32 object_id)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_uc_object_struct* cur_object = g_uc_p->msg.object_head;
- U32 object_num = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (; cur_object != NULL; cur_object = cur_object->next, object_num++)
- {
- MMI_ASSERT( object_num <= g_uc_p->msg.total_object_num);
- if (cur_object->id == object_id)
- {
- return cur_object;
- }
- }
- return NULL;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_check_only_attachment
- * DESCRIPTION
- * Only attachments and one empty slide.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- BOOL mmi_uc_check_only_attachment (void)
- {
- #if (0)
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* (0) */
- return MMI_FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_resize_image
- * DESCRIPTION
- * Resize image
- * PARAMETERS
- * void
- * RETURNS
- * 1: resized. 0: no need to resize. negative: error!
- *****************************************************************************/
- S32 mmi_uc_resize_image(U8 *file, U8 *dest_file, U32 resize_w, U32 resize_h)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 img_width = 0, img_height = 0;
- GDI_RESULT gdi_ret = GDI_FAILED;
- S32 ret = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_ASSERT(file != NULL);
- MMI_ASSERT(dest_file != NULL);
- /* Get the image dimension */
- gdi_image_get_dimension_file((PS8) file, &img_width, &img_height);
- if ((img_width != 0) && (img_height != 0))
- {
- /* calculate the dimension of the resize JPEG */
- if ((img_width > resize_w) || (img_height > resize_h))
- {
- S32 w = 0, h = 0, buf_size = 0;
- U8 *buf_ptr = NULL;
- /* need to resize */
- if ((img_width * resize_h) > (img_height * resize_w))
- {
- w = resize_w;
- h = img_height * resize_w / img_width;
- if (h == 0)
- {
- h = 1;
- }
- }
- else
- {
- w = img_width * resize_h / img_height;
- h = resize_h;
- if (w == 0)
- {
- w = 1;
- }
- }
- /* resize the image and encode to jpeg file */
- buf_size = (w * h * GDI_MAINLCD_BIT_PER_PIXEL) >> 3;
- buf_size = ((buf_size + 3) / 4) * 4;
- if (buf_size > 0)
- {
- media_get_ext_buffer(MOD_MMI, (void **)&buf_ptr, buf_size);
- if (buf_ptr != NULL)
- {
- gdi_ret = gdi_image_encode_file_to_jpeg((PS8) file, (S8*)dest_file, w, h, buf_ptr, buf_size);
- media_free_ext_buffer(MOD_MMI, (void **)&buf_ptr);
- }
- switch (gdi_ret)
- {
- case GDI_SUCCEED:
- ret = MMI_UC_RESIZING_SUCCEED;
- break;
- case GDI_IMAGE_ENCODER_ERR_DISK_FULL:
- ret = MMI_UC_RESIZING_FAILED_IN_GDI_ENCODER_ERR_DISK_FULL;
- break;
- case GDI_IMAGE_ENCODER_ERR_WRITE_PROTECTION:
- ret = MMI_UC_RESIZING_FAILED_IN_GDI_ENCODER_ERR_WRITE_PROTECTION;
- break;
- case GDI_IMAGE_ENCODER_ERR_NO_DISK:
- ret = MMI_UC_RESIZING_FAILED_IN_GDI_ENCODER_ERR_NO_DISK;
- break;
- default:
- ret = MMI_UC_RESIZING_FAILED_IN_GDI_FAILED;
- }
- }
- else
- {
- /* -12: can't allocate gdi_layer for drawing image */
- ret = MMI_UC_RESIZING_FAILED_IN_INSUFFICIENT_DRAWING_BUF;
- }
- }
- else
- {
- /* the dimension of the original image is smaller */
- ret = MMI_UC_RESIZING_SUCCEED_WITH_UNCHANGED;
- }
- }
- else
- {
- /* -11: can't get the image dimension */
- ret = MMI_UC_RESIZING_FAILED_IN_UNKNOWN_DIMENSION;
- }
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
- "*[UnifiedComposerMiscell.c] mmi_uc_resize_image(), ret=%d",
- ret));
- return ret;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_write_msg_with_content
- * DESCRIPTION
- * Entry unified composer with content
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_write_msg_with_content(mmi_uc_done_type_enum type, mmi_uc_entry_write_struct* data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 addr_num = 0;
- mmi_uc_addr_struct* addr = data->addr;
- mmi_uc_object_struct* object;
- wgui_uce_text_info_struct text_info;
- U8 mmi_uc_text_path[MMI_UC_MAX_TEMP_FILE_LEN];
- S32 result;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!mmi_um_check_ready())
- {
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_NOT_AVAILABLE),
- IMG_GLOBAL_ERROR,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- return;
- }
- #ifdef __USB_IN_NORMAL_MODE__
- if (mmi_usb_is_in_mass_storage_mode())
- {
- /* in mass storage mode */
- if (mmi_usb_check_path_exported((PS8) MMI_UC_FOLDER_DRV))
- {
- /* MMI public drive is exported, cannot use this app */
- mmi_usb_app_unavailable_popup(0); /* pass 0 will show default string */
- return;
- }
- }
- #endif /* __USB_IN_NORMAL_MODE__ */
- if (g_uc_p->send_info.action != MMI_UC_ACTION_IDLE ||
- IsScreenPresent(SCR_ID_UC_EDITOR))
- {
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_NOT_AVAILABLE),
- IMG_GLOBAL_ERROR,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- return;
- }
- mmi_uc_reset_msg();
- g_uc_p->main.state = type;
- if (type != MMI_UC_STATE_WRITE_NEW_MSG)
- {
- if (data->info_type == MMI_UC_INFO_TYPE_SMS)
- {
- U16* msg_id = data->info;
- g_uc_p->send_info.existed_msg_type = MMI_UC_MSG_TYPE_SMS_PREFER;
- g_uc_p->send_info.existed_msg_id = *msg_id;
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- for (; addr_num < data->addr_num; addr_num++)
- {
- MMI_ASSERT(addr);
- if (mmi_uc_check_duplicate_address(addr->addr, addr->type, addr->group) != NULL)
- {
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMiscell.c] mmi_uc_entry_write_msg_with_content duplicate addr *n"));
- }
- else
- {
- mmi_uc_add_address(addr->addr, addr->type, addr->group);
- }
- addr = addr->next;
- }
- g_uc_p->msg.current_slide = mmi_uc_insert_slide(NULL);
- g_uc_p->msg.current_slide_num = g_uc_p->msg.current_slide->slide_num;
- if (pfnUnicodeStrlen((S8*)data->subject))
- {
- pfnUnicodeStrncpy((S8*)g_uc_p->msg.subject, (S8*)data->subject, MMI_UC_MAX_SUBJECT_LEN);
- }
- /* text file */
- if (data->text_num)
- {
- U32 buffer_size = (data->text_num + 1) * ENCODING_LENGTH;
- U8* buffer = applib_mem_screen_alloc(buffer_size);
- U32 buffer_len = 0;
- MMI_ASSERT(buffer_size <= MMI_UC_UTF8_TEXT_BUFFER_SIZE);
- memset(buffer , 0, buffer_size);
- mmi_frm_sms_remove_escape_symbol_for_extension_char((U16*)buffer, (U16*)data->text_buffer,(U16)data->text_num);
- buffer_len = pfnUnicodeStrlen((S8*)buffer);
- memset(mmi_uc_text_path, 0, MMI_UC_MAX_TEMP_FILE_LEN);
- MMI_UC_MAKE_TEXT_FILE_PATH(mmi_uc_text_path, g_uc_p->msg.current_slide->slide_num);
- mmi_uc_reset_text_buffer();
- if (buffer_len <= (MMI_UC_TEXT_BUFFER_SIZE / ENCODING_LENGTH) - 1)
- {
- pfnUnicodeStrncpy((S8*)g_uc_p->main.text_buffer, (S8*)buffer, buffer_len);
- }
- else
- {
- pfnUnicodeStrncpy(
- (S8*)g_uc_p->main.text_buffer,
- (S8*)buffer,
- (MMI_UC_TEXT_BUFFER_SIZE / ENCODING_LENGTH) - 1);
- }
- applib_mem_screen_free(buffer);
- mmi_uc_editor_initialize();
- memset(&text_info, 0, sizeof(wgui_uce_text_info_struct));
- wgui_uce_get_text_info_for_buffer(&text_info, g_uc_p->main.text_buffer);
- result = mmi_uc_save_buffer_to_file(mmi_uc_text_path, g_uc_p->main.text_buffer, text_info.char_count);
- if (result == FS_NO_ERROR)
- {
- mmi_uc_set_text_info_to_slide(g_uc_p->msg.current_slide, &text_info);
- object = mmi_uc_insert_object((S8*)mmi_uc_text_path, MMI_UC_OBJECT_TYPE_TEXT);
- mmi_uc_insert_object_to_slide(object, g_uc_p->msg.current_slide, MMI_UC_OBJECT_TYPE_TEXT);
- }
- else
- {
- mmi_uc_display_popup(MMI_UC_STORAGE_FULL);
- return;
- }
- }
- mmi_uc_update_msg_size();
- if (data->info_type == MMI_UC_INFO_TYPE_SMS)
- {
- MMI_ASSERT(data->file_path == NULL);
- }
- if (data->file_path)
- {
- U32 flie_path_len = pfnUnicodeStrlen((S8*)data->file_path);
- if (g_uc_p->main.file_path)
- {
- kal_adm_free(g_uc_p->main.mem_pool_id, g_uc_p->main.file_path);
- }
- g_uc_p->main.file_path = kal_adm_alloc(
- g_uc_p->main.mem_pool_id,
- (flie_path_len + 1) * ENCODING_LENGTH);
- MMI_ASSERT(g_uc_p->main.file_path);
- pfnUnicodeStrncpy((S8*)g_uc_p->main.file_path, (S8*)data->file_path, flie_path_len);
- }
- if (data->callback != NULL)
- {
- g_uc_p->main.callback = data->callback;
- g_uc_p->main.callback_para = data->callback_para;
- }
- g_uc_p->msg_type.setting_msg_type = mmi_uc_get_setting_msg_type();
- g_uc_p->msg_type.curr_msg_type = g_uc_p->msg_type.setting_msg_type;
- if (data->msg_type == MMI_UC_MSG_TYPE_SMS_ONLY)
- {
- g_uc_p->msg_type.curr_msg_type = MMI_UC_MSG_TYPE_SMS_PREFER;
- }
- else if (data->msg_type == MMI_UC_MSG_TYPE_MMS_ONLY)
- {
- g_uc_p->msg_type.curr_msg_type = MMI_UC_MSG_TYPE_MMS_PREFER;
- }
- g_uc_p->msg_type.caller_specific_msg_type = data->msg_type;
- g_uc_p->msg_type.backup_msg_type = MMI_UC_MSG_TYPE_DEFAULT;
- mmi_uc_process_entry_write_msg();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_done_option_with_content
- * DESCRIPTION
- * Entry unified composer with content
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_done_option_with_content(mmi_uc_done_type_enum type, mmi_uc_entry_write_struct* data)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_uc_entry_write_msg_with_content(type, data);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_calc_file_size_in_utf8
- * DESCRIPTION
- * Read the file to text buffer
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- U32 mmi_uc_calc_file_size_in_utf8 (U8* file_path)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- FS_HANDLE file_handle;
- U32 result;
- U32 read_len = 0;
- U32 length = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Open the file to read*/
- file_handle = FS_Open((U16*) file_path, FS_READ_ONLY | FS_OPEN_SHARED );
- if (file_handle > 0)
- {
- U8* temp_buffer = applib_mem_screen_alloc(MMI_UC_UTF8_TEXT_BUFFER_SIZE);
- memset(temp_buffer, 0, MMI_UC_UTF8_TEXT_BUFFER_SIZE);
- result = FS_Read(file_handle,
- temp_buffer,
- MMI_UC_UTF8_TEXT_BUFFER_SIZE - ENCODING_LENGTH,
- &read_len);
- FS_Close(file_handle);
- if (result == FS_NO_ERROR)
- {
- length = mmi_charset_ucs2_to_utf8_length_in_bytes(temp_buffer);
- }
- applib_mem_screen_free(temp_buffer);
- }
- return length;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_text_change_callback
- * DESCRIPTION
- * Check if the text is allowed to be inserted
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- wgui_uce_text_change_result_enum mmi_uc_text_change_callback(wgui_uce_text_info_struct *new_text_info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (new_text_info->char_count > MMI_UC_MAX_CHAR_NUM_IN_ONE_SLIDE)
- {
- return WGUI_UCE_TEXT_CHANGE_NOT_ALLOWED;
- }
- else
- {
- g_uc_p->msg.current_slide->text.char_count = new_text_info->char_count;
- g_uc_p->msg.current_slide->text.utf8_msg_len = new_text_info->utf8_msg_len;
- g_uc_p->msg.current_slide->text.extension_char_count = new_text_info->extension_char_count;
- g_uc_p->msg.current_slide->text.UCS2_count = new_text_info->UCS2_count;
- /* For better performance, only update text buffer to text object when char count is one or zero */
- /* That is, text object is existed or not. */
- if (new_text_info->char_count == 1 || new_text_info->char_count == 0)
- {
- mmi_uc_exit_write_msg();
- mmi_uc_update_msg_size();
- }
- return WGUI_UCE_TEXT_CHANGE_ALLOWED;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_get_message_size_callback
- * DESCRIPTION
- * Return msg size
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- U32 mmi_uc_get_message_size_callback (wgui_uce_text_info_struct *current_text_info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 msg_size = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_SMS_PREFER)
- {
- msg_size = current_text_info->char_count;
- }
- else if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- msg_size = current_text_info->utf8_msg_len + g_uc_p->msg.msg_size_without_text_buffer;
- }
- else
- {
- MMI_ASSERT(0);
- }
- if (mmi_uc_change_msg_type_if_needed())
- {
- StartTimer(UC_MSG_TYPE_CHECK_TIMER_ID, MMI_UC_MSG_TYPE_CHECK_TIME, mmi_uc_disply_msg_type_change);
- }
- return msg_size;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_get_message_size_callback
- * DESCRIPTION
- * Return msg size
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- BOOL mmi_uc_is_pending_content(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_uc_p->msg.total_slide_num > 0)
- {
- if (g_uc_p->msg.current_slide->text.char_count ||
- g_uc_p->msg.total_slide_num > 1 ||
- g_uc_p->msg.object_head ||
- g_uc_p->msg.to_num + g_uc_p->msg.cc_num + g_uc_p->msg.bcc_num > 0 ||
- pfnUnicodeStrlen((S8*)g_uc_p->msg.subject))
- {
- return TRUE;
- }
- else
- {
- return FALSE;
- }
- }
- else
- {
- return FALSE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_get_sms_setting
- * DESCRIPTION
- * Get SMS setting
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_get_sms_setting(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->sms_info.max_gsm7bit_char_num = EMSUsableTextLen(SMSAL_DEFAULT_DCS) / 2;
- g_uc_p->sms_info.max_ucs2_char_num = EMSUsableTextLen(SMSAL_UCS2_DCS) / 2;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_get_sms_segment_number
- * DESCRIPTION
- * Get SMS segment
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- U8 mmi_uc_get_sms_segment_number(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 segment = 0;
- mmi_uc_slide_struct* slide = g_uc_p->msg.current_slide;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (slide)
- {
- if (slide->text.UCS2_count)
- {
- if (EMSCalculateSeg(SMSAL_UCS2_DCS, (U16)(slide->text.char_count * 2), &segment) == EMS_OK)
- {
- return segment;
- }
- else
- {
- return 0;
- }
- }
- else
- {
- if (EMSCalculateSeg(SMSAL_DEFAULT_DCS, (U16)((slide->text.char_count + slide->text.extension_char_count) * 2), &segment) == EMS_OK)
- {
- return segment;
- }
- else
- {
- return 0;
- }
- }
- }
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_sd_plug_out_hdlr
- * DESCRIPTION
- * Handler when memory card is removed
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_sd_plug_out_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_uc_slide_struct* slide = NULL;
- mmi_uc_object_struct* object = NULL;
- mmi_uc_attachment_info_struct* attachment = g_uc_p->msg.attachment_head;
- U16 shift_attachment_num = 0;
- U8 cur_slide_num = 0;
- U8 cur_attachment_num = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* There is a popup when memory card is removed! */
- if (IsScreenPresent(SCR_ID_UC_EDITOR) &&
- (g_uc_p->send_info.action == MMI_UC_ACTION_IDLE || g_uc_p->send_info.action == MMI_UC_ACTION_PREVIEW))
- {
- for (slide = g_uc_p->msg.slide_head; cur_slide_num < g_uc_p->msg.total_slide_num; cur_slide_num++)
- {
- MMI_ASSERT(slide);
- if (slide->image.object)
- {
- object = slide->image.object;
- if (!(object->is_virtual_file))
- {
- if (FS_GetAttributes(object->file_path) < 0)
- {
- if (object->reference_count > 1)
- {
- object->reference_count--;
- }
- else
- {
- mmi_uc_delete_object_from_list(object);
- }
- memset(&slide->image, 0, sizeof(mmi_uc_object_info_struct));
- }
- }
- }
- if (slide->audio.object)
- {
- object = slide->audio.object;
- if (!(object->is_virtual_file))
- {
- if (FS_GetAttributes(object->file_path) < 0)
- {
- if (object->reference_count > 1)
- {
- object->reference_count--;
- }
- else
- {
- mmi_uc_delete_object_from_list(object);
- }
- memset(&slide->audio, 0, sizeof(mmi_uc_object_info_struct));
- }
- }
- }
- if (slide->video.object)
- {
- object = slide->video.object;
- if (!(object->is_virtual_file))
- {
- if (FS_GetAttributes(object->file_path) < 0)
- {
- if (object->reference_count > 1)
- {
- object->reference_count--;
- }
- else
- {
- mmi_uc_delete_object_from_list(object);
- }
- memset(&slide->video, 0, sizeof(mmi_uc_object_info_struct));
- }
- }
- }
- slide = slide->next;
- }
- while (attachment != NULL)
- {
- object = attachment->object;
- if (!(object->is_virtual_file))
- {
- if (FS_GetAttributes(object->file_path) < 0)
- {
- mmi_uc_attachment_info_struct* att_temp = attachment->next;
- MMI_ASSERT(object->reference_count == 1);
- mmi_uc_delete_object_from_list(object);
- /* Replace attachment handling */
- if (IsScreenPresent(SCR_ID_UC_OPT_REPLACE) &&
- IsScreenPresent(SCR_ID_UC_OPT_ATTACHMENT_LIST))
- {
- if (g_uc_p->main.object_index == cur_attachment_num)
- {
- shift_attachment_num = MMI_UC_INVALID_INDEX;
- }
- if (shift_attachment_num != MMI_UC_INVALID_INDEX &&
- g_uc_p->main.object_index > cur_attachment_num )
- {
- shift_attachment_num++;
- }
- }
- mmi_uc_delete_attachment_from_list(attachment);
- attachment = att_temp;
- cur_attachment_num++;
- continue;
- }
- }
- cur_attachment_num++;
- attachment = attachment->next;
- }
- /* Replace attachment handling */
- if (shift_attachment_num > 0)
- {
- if (shift_attachment_num == MMI_UC_INVALID_INDEX)
- {
- g_uc_p->main.object_index = MMI_UC_INVALID_INDEX;
- }
- else
- {
- MMI_ASSERT(g_uc_p->main.object_index >= shift_attachment_num);
- g_uc_p->main.object_index -= shift_attachment_num;
- }
- }
- mmi_uc_reset_layout_if_needed();
- if (mmi_uc_change_msg_type_if_needed())
- {
- mmi_uc_insert_signature_check();
- }
- mmi_uc_update_msg_size();
- //mmi_uc_switch_slide(g_uc_p->msg.current_slide);
- mmi_uc_editor_initialize();
- mmi_uc_set_editor_info(g_uc_p->msg.current_slide);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_sd_plug_out_hdlr
- * DESCRIPTION
- * Handler when memory card is removed
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_reset_layout_if_needed(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_uc_object_struct* object = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (object = g_uc_p->msg.object_head ; object != NULL ; object = object->next)
- {
- if (object->type == MMI_UC_OBJECT_TYPE_IMAGE ||
- object->type == MMI_UC_OBJECT_TYPE_VIDEO )
- {
- break;
- }
- }
- if (object == NULL)
- {
- g_uc_p->msg.layout = MMI_UC_LAYOUT_DEFAULT;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_reset_editor_history_guibuffer
- * DESCRIPTION
- * reset editor history gui buffer
- * PARAMETERS
- * screen_id [IN]
- * RETURNS
- * kal_bool
- *****************************************************************************/
- BOOL mmi_uc_reset_history_guibuffer(U16 screen_id)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- historyNode* history = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GetHistoryPointer(screen_id, &history);
- if (history != NULL)
- {
- if (history->guiBuffer != NULL)
- {
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
- "*[UnifiedComposerMiscell.c] mmi_uc_reset_history_guibuffer(), screen_id=%d",
- screen_id));
- OslMfree(history->guiBuffer);
- history->guiBuffer = NULL;
- }
- return KAL_TRUE;
- }
- else
- {
- return KAL_FALSE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_is_uc_screen_in_history
- * DESCRIPTION
- * Return if unified composer screen is in the history
- * PARAMETERS
- * screen_id [IN]
- * RETURNS
- * kal_bool
- *****************************************************************************/
- kal_bool mmi_uc_is_uc_screen_in_history(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (kal_bool)IsScreenPresent(SCR_ID_UC_EDITOR);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_is_email_addr_valid
- * DESCRIPTION
- * Return if email address valid
- * PARAMETERS
- * screen_id [IN]
- * RETURNS
- * kal_bool
- *****************************************************************************/
- BOOL mmi_uc_is_email_addr_valid(U8* addr)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 email_addr_len = pfnUnicodeStrlen((S8*)addr);
- U16 i = 0;
- U16* email_addr = (U16*)addr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for ( ; i< email_addr_len ; i++ )
- {
- if (pfnUnicodeStrncmp((S8*)&email_addr[i], (S8*)L"@", 1) == 0)
- {
- if (i == 0 || i == (email_addr_len - 1))
- {
- return FALSE;
- }
- else
- {
- return TRUE;
- }
- }
- }
- return FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_handle_msg_type_check
- * DESCRIPTION
- * Handler for checking if msg type changes
- * PARAMETERS
- * screen_id [IN]
- * RETURNS
- * kal_bool
- *****************************************************************************/
- void mmi_uc_handle_msg_type_check(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMiscell.c] mmi_uc_handle_msg_type_check *n"));
- if (mmi_uc_change_msg_type_if_needed())
- {
- mmi_uc_insert_signature_check();
- }
- if (GetExitScrnID() == SCR_ID_UC_OPT_DONE)
- {
- if (g_uc_p->done.pre_msg_type != g_uc_p->msg_type.curr_msg_type)
- {
- g_uc_p->done.pre_msg_type = g_uc_p->msg_type.curr_msg_type;
- if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_SMS_PREFER)
- {
- DisplayPopup(
- (PU8) GetString(STR_UC_CHANGED_TO_TEXT_MSG_ID),
- 0,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) WARNING_TONE);
- }
- else if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- DisplayPopup(
- (PU8) GetString(STR_UC_CHANGED_TO_MULTIMEDIA_MSG_ID),
- 0,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) WARNING_TONE);
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- }
- else
- {
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMiscell.c] mmi_uc_handle_msg_type_check IGNORE! *n"));
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_disply_msg_type_change
- * DESCRIPTION
- * display msg type is changed
- * PARAMETERS
- * screen_id [IN]
- * RETURNS
- * kal_bool
- *****************************************************************************/
- void mmi_uc_disply_msg_type_change(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMiscell.c] mmi_uc_disply_msg_type_change *n"));
- if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_SMS_PREFER)
- {
- DisplayPopup(
- (PU8) GetString(STR_UC_CHANGED_TO_TEXT_MSG_ID),
- 0,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) WARNING_TONE);
- }
- else if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- DisplayPopup(
- (PU8) GetString(STR_UC_CHANGED_TO_MULTIMEDIA_MSG_ID),
- 0,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) WARNING_TONE);
- }
- else
- {
- MMI_ASSERT(0);
- }
- mmi_uc_insert_signature_check();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_replace_duplicate_object_file_name
- * DESCRIPTION
- * Replace duplicate object file name
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_replace_duplicate_object_file_name(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_uc_object_struct* obj = g_uc_p->msg.object_head;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- while (obj != NULL)
- {
- mmi_uc_object_struct* handle_obj = obj->next;
- U8 i = 1;
- while (handle_obj != NULL)
- {
- handle_obj = mmi_uc_check_duplicate_object_by_filename(obj->file_name, handle_obj);
- if (handle_obj != NULL)
- {
- if (handle_obj->is_virtual_file != MMI_TRUE)
- {
- /* replace file name */
- U16 file_name_len = pfnUnicodeStrlen((S8*)handle_obj->file_name);
- U16* new_file_name = kal_adm_alloc(g_uc_p->main.mem_pool_id, (file_name_len + 3 ) * ENCODING_LENGTH);
- U16 file_suffix[5];
- U16* file_extension = mmi_uc_get_file_extension(handle_obj->file_name);
- U16 file_extension_len = 0;
- if (file_extension != NULL)
- {
- file_extension_len = pfnUnicodeStrlen((S8*)file_extension);
- pfnUnicodeStrncpy((S8*)new_file_name, (S8*)handle_obj->file_name, (file_name_len - file_extension_len - 1));
- }
- else
- {
- pfnUnicodeStrncpy((S8*)new_file_name, (S8*)handle_obj->file_name, file_name_len);
- }
- memset(file_suffix, 0x00, sizeof(file_suffix));
- kal_wsprintf( (kal_uint16 *)file_suffix, "%02d", i);
- pfnUnicodeStrcat((PS8) new_file_name, (PS8) file_suffix);
- if (file_extension != NULL)
- {
- pfnUnicodeStrcat((PS8) new_file_name, (PS8) L".");
- pfnUnicodeStrcat((PS8) new_file_name, (PS8) file_extension);
- }
- kal_adm_free(g_uc_p->main.mem_pool_id, handle_obj->file_name);
- handle_obj->file_name = new_file_name;
- i++;
- }
- handle_obj = handle_obj->next;
- }
- }
- obj = obj->next;
- }
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_compare_string_ignore_case
- * DESCRIPTION
- * Compare string by ignoring case.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- BOOL mmi_uc_compare_string_ignore_case(U16* addr_1, U16* addr_2)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 addr_index = 0;
- U16 char_A = 0x0041;
- U16 char_Z = 0x005A;
- U16 char_a = 0x0061;
- U16 addr_1_len = pfnUnicodeStrlen((S8*)addr_1);
- U16 addr_2_len = pfnUnicodeStrlen((S8*)addr_2);
- U16 addr_1_char = 0;
- U16 addr_2_char = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (addr_1_len != addr_2_len)
- {
- return MMI_FALSE;
- }
- while (addr_index < addr_1_len)
- {
- if (addr_1[addr_index] >= char_A && addr_1[addr_index] <= char_Z)
- {
- addr_1_char = char_a + addr_1[addr_index] - char_A;
- }
- else
- {
- addr_1_char = addr_1[addr_index];
- }
- if (addr_2[addr_index] >= char_A && addr_2[addr_index] <= char_Z)
- {
- addr_2_char = char_a + addr_2[addr_index] - char_A;
- }
- else
- {
- addr_2_char = addr_2[addr_index];
- }
- if (addr_1_char != addr_2_char)
- {
- return MMI_FALSE;
- }
- addr_index++;
- }
- return MMI_TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_delete_existed_mms
- * DESCRIPTION
- * Delete existed MMS msg
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_delete_existed_mms(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_uc_p->main.file_handle > 0)
- {
- FS_Close(g_uc_p->main.file_handle);
- g_uc_p->main.file_handle = 0;
- }
- mmi_uc_delete_mms_req(g_uc_p->send_info.existed_msg_id);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_update_text_object_path
- * DESCRIPTION
- * Update text object file path
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_update_text_object_path(mmi_uc_slide_struct* slide)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 mmi_uc_text_path[MMI_UC_MAX_TEMP_FILE_LEN];
- mmi_uc_object_struct* object = NULL;
- U16* file_name;
- U16 file_path_len = 0;
- U16 file_name_len = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_ASSERT(slide != NULL);
- memset(mmi_uc_text_path, 0, MMI_UC_MAX_TEMP_FILE_LEN);
- MMI_UC_MAKE_TEXT_FILE_PATH(mmi_uc_text_path, slide->slide_num);
- file_path_len = pfnUnicodeStrlen((S8*)mmi_uc_text_path);
- if ((object = slide->text.object) != NULL)
- {
- MMI_ASSERT(FS_Rename((U16*)object->file_path, (U16*)mmi_uc_text_path) == FS_NO_ERROR);
- /* file path */
- if (object->file_path != NULL)
- {
- kal_adm_free(g_uc_p->main.mem_pool_id, object->file_path);
- object->file_path = NULL;
- }
- object->file_path = kal_adm_alloc(g_uc_p->main.mem_pool_id, (file_path_len + 1 ) * 2);
- MMI_ASSERT(object->file_path);
- memset(object->file_path, 0, (file_path_len + 1) * 2);
- pfnUnicodeStrncpy((S8*)object->file_path, (S8*)mmi_uc_text_path, file_path_len);
- /* file name */
- if (object->file_name != NULL)
- {
- kal_adm_free(g_uc_p->main.mem_pool_id, object->file_name);
- object->file_name = NULL;
- }
- file_name = mmi_uc_get_file_name((U16*)mmi_uc_text_path);
- file_name_len = pfnUnicodeStrlen((S8*)file_name);
- object->file_name = kal_adm_alloc(g_uc_p->main.mem_pool_id, (file_name_len + 1 ) * 2);
- MMI_ASSERT(object->file_name);
- memset(object->file_name, 0, (file_name_len + 1) * 2);
- pfnUnicodeStrncpy((S8*)object->file_name, (S8*)file_name, file_name_len);
- }
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_get_end_slide
- * DESCRIPTION
- * get the last slide
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- mmi_uc_slide_struct* mmi_uc_get_end_slide(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_uc_slide_struct* slide = g_uc_p->msg.slide_head;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if(slide == NULL)
- {
- return NULL;
- }
- while (slide->next != NULL)
- {
- slide = slide->next;
- }
- return slide;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_delete_between_screens
- * DESCRIPTION
- * Delete screens including start_sreen and end_screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- BOOL mmi_uc_delete_between_screens(U16 start_screen_id, U16 end_screen_id)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
- "*[UnifiedComposerMiscell.c] mmi_uc_delete_between_screens(), start_scr=%d, end_scr=%d",
- start_screen_id, end_screen_id));
- if (!IsScreenPresent(start_screen_id))
- {
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
- "*[UnifiedComposerMiscell.c] mmi_uc_delete_between_screens(), start_scr=%d NOT present",
- start_screen_id));
- return MMI_FALSE;
- }
- if (!IsScreenPresent(end_screen_id))
- {
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
- "*[UnifiedComposerMiscell.c] mmi_uc_delete_between_screens(), end_scr=%d NOT present",
- end_screen_id));
- return MMI_FALSE;
- }
- return DeleteBetweenScreen(start_screen_id, end_screen_id);
- }
- #endif /* __MMI_UNIFIED_COMPOSER__ */
- #endif /* _MMI_UNIFIED_COMPOSER_MISCELL_C */