UnifiedComposerMain.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:491k
源码类别:
MTK
开发平台:
C/C++
- if (IsScreenPresent(SCR_ID_UC_EDITOR))
- {
- GoBackToHistory(SCR_ID_UC_EDITOR);
- }
- else
- {
- MMI_ASSERT(0);
- }
- if (result == 0)
- {
- mmi_uc_display_popup(MMI_UC_NO_SPACE);
- }
- }
- }
- else
- {
- if (MMI_TRUE == mmi_msg_check_interrupt())
- {
- if (IsScreenPresent(SCR_ID_UC_EDITOR))
- {
- DeleteUptoScrID(SCR_ID_UC_EDITOR);
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- else
- {
- if (IsScreenPresent(SCR_ID_UC_EDITOR))
- {
- GoBackToHistory(SCR_ID_UC_EDITOR);
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_insert_phb_number
- * DESCRIPTION
- * Highlight Insert PHB number handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_insert_phb_number(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_phb_list_pre_entry_for_number_and_email(MMI_PHB_ENTRY_FIELD_ALL_NUMBER, mmi_uc_insert_number_from_phb);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_insert_phb_name
- * DESCRIPTION
- * Highlight Insert PHB name handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_insert_phb_name(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_phb_list_pre_entry_for_number_and_email(MMI_PHB_ENTRY_FIELD_NAME, mmi_uc_insert_name_from_phb);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_insert_number_from_phb
- * DESCRIPTION
- * Insert phonebook number into write msg
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_insert_number_from_phb(S8* name, S8* number)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- historyNode *History;
- U16 char_num;
- U8 result = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_insert_number_from_phb *n"));
- if (NULL != number && (char_num = pfnUnicodeStrlen(number)) > 0)
- {
- if (GetHistoryScrID(SCR_ID_UC_EDITOR, &History) == ST_SUCCESS)
- {
- result = wgui_uce_insert_text_template ((U8*) number, char_num, History->guiBuffer);
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- GoBackToHistory(SCR_ID_UC_EDITOR);
- if (result == 0)
- {
- mmi_uc_display_popup(MMI_UC_NO_SPACE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_insert_name_from_phb
- * DESCRIPTION
- * Insert phonebook name into write msg
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_insert_name_from_phb(S8* name, S8* number)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- historyNode *History;
- U16 char_num;
- U8 result = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_insert_name_from_phb *n"));
- if (NULL != name && (char_num = pfnUnicodeStrlen(name)) > 0)
- {
- if (GetHistoryScrID(SCR_ID_UC_EDITOR, &History) == ST_SUCCESS)
- {
- result = wgui_uce_insert_text_template ((U8*) name, char_num, History->guiBuffer);
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- GoBackToHistory(SCR_ID_UC_EDITOR);
- if (result == 0)
- {
- mmi_uc_display_popup(MMI_UC_NO_SPACE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_remove
- * DESCRIPTION
- * Entry function for remove type list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_remove(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- U16 numItems = 0;
- U16 nStrItemList[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_UC_OPT_REMOVE, mmi_uc_exit_generic, mmi_uc_entry_remove, NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_entry_remove *n"));
- guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_OPT_REMOVE);
- if (g_uc_p->msg.current_slide->image.object)
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_REMOVE_IMAGE);
- }
- else
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_REMOVE_IMAGE);
- }
- if (g_uc_p->msg.current_slide->audio.object)
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_REMOVE_AUDIO);
- }
- else
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_REMOVE_AUDIO);
- }
- if (g_uc_p->msg.current_slide->video.object)
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_REMOVE_VIDEO);
- }
- else
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_REMOVE_VIDEO);
- }
- if (g_uc_p->msg.total_attachment_num)
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_REMOVE_ATTACHMENT);
- }
- else
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_REMOVE_ATTACHMENT);
- }
- numItems = GetNumOfChild_Ext(MENU_ID_UC_OPT_REMOVE);
- GetSequenceStringIds_Ext(MENU_ID_UC_OPT_REMOVE, nStrItemList);
- SetParentHandler(MENU_ID_UC_OPT_REMOVE);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_UC_REMOVE_ID,
- IMG_UC_ENTRY_SCRN_CAPTION_ID,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- NULL,
- 0,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_remove_image
- * DESCRIPTION
- * Funtion is called when remove image menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_remove_image(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->main.highlighted_object_type = MMI_UC_OBJECT_TYPE_IMAGE;
- SetLeftSoftkeyFunction(mmi_uc_remove_object, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_remove_object, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_remove_audio
- * DESCRIPTION
- * Funtion is called when remove audio menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_remove_audio(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->main.highlighted_object_type = MMI_UC_OBJECT_TYPE_AUDIO;
- SetLeftSoftkeyFunction(mmi_uc_remove_object, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_remove_object, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_remove_video
- * DESCRIPTION
- * Funtion is called when remove video menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_remove_video(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->main.highlighted_object_type = MMI_UC_OBJECT_TYPE_VIDEO;
- SetLeftSoftkeyFunction(mmi_uc_remove_object, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_remove_object, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_remove_attachment
- * DESCRIPTION
- * Funtion is called when remove attachment menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_remove_attachment(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->main.highlighted_object_type = MMI_UC_OBJECT_TYPE_ATTACHMENT;
- SetLeftSoftkeyFunction(mmi_uc_entry_attachment_list, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_attachment_list, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_remove_object
- * DESCRIPTION
- * Remove the object from current slide
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_remove_object(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch(g_uc_p->main.highlighted_object_type)
- {
- case MMI_UC_OBJECT_TYPE_IMAGE:
- {
- if (g_uc_p->msg.current_slide->image.object->reference_count > 1)
- {
- g_uc_p->msg.current_slide->image.object->reference_count--;
- }
- else
- {
- mmi_uc_delete_object_from_list(g_uc_p->msg.current_slide->image.object);
- }
- memset(&(g_uc_p->msg.current_slide->image), 0, sizeof(mmi_uc_object_info_struct));
- wgui_uce_delete_object(mmi_uc_convert_to_editor_object_type(MMI_UC_OBJECT_TYPE_IMAGE));
- mmi_uc_reset_layout_if_needed();
- if (mmi_uc_change_msg_type_if_needed())
- {
- mmi_uc_insert_signature_check();
- }
- mmi_uc_update_msg_size();
- GoBackToHistory(SCR_ID_UC_EDITOR);
- }
- break;
- case MMI_UC_OBJECT_TYPE_AUDIO:
- {
- if (g_uc_p->msg.current_slide->audio.object->reference_count > 1)
- {
- g_uc_p->msg.current_slide->audio.object->reference_count--;
- }
- else
- {
- mmi_uc_delete_object_from_list(g_uc_p->msg.current_slide->audio.object);
- }
- memset(&(g_uc_p->msg.current_slide->audio), 0, sizeof(mmi_uc_object_info_struct));
- wgui_uce_delete_object(mmi_uc_convert_to_editor_object_type(MMI_UC_OBJECT_TYPE_AUDIO));
- if (mmi_uc_change_msg_type_if_needed())
- {
- mmi_uc_insert_signature_check();
- }
- mmi_uc_update_msg_size();
- GoBackToHistory(SCR_ID_UC_EDITOR);
- }
- break;
- case MMI_UC_OBJECT_TYPE_VIDEO:
- {
- if (g_uc_p->msg.current_slide->video.object->reference_count > 1)
- {
- g_uc_p->msg.current_slide->video.object->reference_count--;
- }
- else
- {
- mmi_uc_delete_object_from_list(g_uc_p->msg.current_slide->video.object);
- }
- memset(&(g_uc_p->msg.current_slide->video), 0, sizeof(mmi_uc_object_info_struct));
- wgui_uce_delete_object(mmi_uc_convert_to_editor_object_type(MMI_UC_OBJECT_TYPE_VIDEO));
- mmi_uc_reset_layout_if_needed();
- if (mmi_uc_change_msg_type_if_needed())
- {
- mmi_uc_insert_signature_check();
- }
- mmi_uc_update_msg_size();
- GoBackToHistory(SCR_ID_UC_EDITOR);
- }
- break;
- case MMI_UC_OBJECT_TYPE_ATTACHMENT:
- {
- mmi_uc_attachment_info_struct* att = mmi_uc_get_attachment_by_index(g_uc_p->main.object_index);
- MMI_ASSERT(att->object->reference_count == 1);
- mmi_uc_delete_object_from_list(att->object);
- mmi_uc_delete_attachment_from_list(att);
- if (mmi_uc_change_msg_type_if_needed())
- {
- mmi_uc_insert_signature_check();
- }
- mmi_uc_update_msg_size();
- DisplayPopup((PU8) GetString(STR_UC_REMOVED_ID),
- IMG_GLOBAL_OK,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) SUCCESS_TONE);
- if (g_uc_p->msg.total_attachment_num == 0)
- {
- wgui_uce_delete_object(mmi_uc_convert_to_editor_object_type(MMI_UC_OBJECT_TYPE_ATTACHMENT));
- DeleteBetweenScreen(SCR_ID_UC_OPT, SCR_ID_UC_OPT_ATTACHMENT_LIST);
- }
- }
- break;
- default:
- {
- MMI_ASSERT(0);
- }
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_attachment_list
- * DESCRIPTION
- * Entry function of attachment list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_attachment_list(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- U32 i = 0;
- mmi_uc_attachment_info_struct* attachment = g_uc_p->msg.attachment_head;
- U16 lsk_id = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_entry_attachment_list *n"));
- EntryNewScreen(SCR_ID_UC_OPT_ATTACHMENT_LIST, mmi_uc_exit_generic, mmi_uc_entry_attachment_list, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_OPT_ATTACHMENT_LIST);
- SetParentHandler(MENU_ID_UC_OPT_REMOVE_ATTACHMENT);
- RegisterHighlightHandler(mmi_uc_set_index);
- for (; i < g_uc_p->msg.total_attachment_num; i++)
- {
- MMI_ASSERT(attachment);
- pfnUnicodeStrcpy((S8*) subMenuDataPtrs[i], (S8*) attachment->object->file_name);
- attachment = attachment->next;
- }
- if (IsScreenPresent(SCR_ID_UC_OPT_REMOVE))
- {
- lsk_id = STR_UC_REMOVE_ID;
- }
- else if (IsScreenPresent(SCR_ID_UC_OPT_REPLACE))
- {
- lsk_id = STR_UC_REPLACE_ID;
- }
- else
- {
- MMI_ASSERT(0);
- }
- ShowCategory84Screen(
- STR_UC_ATTACHMENT_ID,
- IMG_UC_ENTRY_SCRN_CAPTION_ID,
- lsk_id,
- 0,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- g_uc_p->msg.total_attachment_num,
- (U8 **) subMenuDataPtrs,
- (PU16) gIndexIconsImageList,
- 0,
- 0,
- guiBuffer);
- if (lsk_id == STR_UC_REMOVE_ID)
- {
- SetLeftSoftkeyFunction(mmi_uc_remove_object, KEY_EVENT_UP);
- }
- else
- {
- SetLeftSoftkeyFunction(mmi_uc_select_fmgr_object, KEY_EVENT_UP);
- }
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_replace
- * DESCRIPTION
- * Entry function for replace type list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_replace(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- U16 numItems = 0;
- U16 nStrItemList[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_UC_OPT_REPLACE, mmi_uc_exit_generic, mmi_uc_entry_replace, NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_entry_replace *n"));
- guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_OPT_REMOVE);
- if (g_uc_p->msg.current_slide->image.object)
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_REPLACE_IMAGE);
- }
- else
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_REPLACE_IMAGE);
- }
- if (g_uc_p->msg.current_slide->audio.object)
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_REPLACE_AUDIO);
- }
- else
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_REPLACE_AUDIO);
- }
- if (g_uc_p->msg.current_slide->video.object)
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_REPLACE_VIDEO);
- }
- else
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_REPLACE_VIDEO);
- }
- if (g_uc_p->msg.total_attachment_num)
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_REPLACE_ATTACHMENT);
- }
- else
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_REPLACE_ATTACHMENT);
- }
- numItems = GetNumOfChild_Ext(MENU_ID_UC_OPT_REPLACE);
- GetSequenceStringIds_Ext(MENU_ID_UC_OPT_REPLACE, nStrItemList);
- SetParentHandler(MENU_ID_UC_OPT_REPLACE);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_UC_REPLACE_ID,
- IMG_UC_ENTRY_SCRN_CAPTION_ID,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- NULL,
- 0,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_remove_image
- * DESCRIPTION
- * Funtion is called when replace image menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_replace_image(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->main.highlighted_object_type = MMI_UC_OBJECT_TYPE_IMAGE;
- SetLeftSoftkeyFunction(mmi_uc_select_fmgr_object, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_select_fmgr_object, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_replace_audio
- * DESCRIPTION
- * Funtion is called when replace audio menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_replace_audio(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->main.highlighted_object_type = MMI_UC_OBJECT_TYPE_AUDIO;
- SetLeftSoftkeyFunction(mmi_uc_select_fmgr_object, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_select_fmgr_object, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_replace_video
- * DESCRIPTION
- * Funtion is called when replace video menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_replace_video(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->main.highlighted_object_type = MMI_UC_OBJECT_TYPE_VIDEO;
- SetLeftSoftkeyFunction(mmi_uc_select_fmgr_object, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_select_fmgr_object, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_replace_attachment
- * DESCRIPTION
- * Funtion is called when replace attachment menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_replace_attachment(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->main.highlighted_object_type = MMI_UC_OBJECT_TYPE_ATTACHMENT;
- SetLeftSoftkeyFunction(mmi_uc_entry_attachment_list, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_attachment_list, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_select_object_from_fm_to_replace
- * DESCRIPTION
- * Select object from file manager
- * PARAMETERS
- * filePath [IN]
- * is_short [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_select_object_from_fm_to_replace(PU16 filePath, S32 is_short)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 mmi_uc_image_path[MMI_UC_MAX_TEMP_FILE_LEN];
- mmi_uc_result result;
- mma_insert_check_struct check_result;
- mmi_uc_slide_struct* slide = g_uc_p->msg.current_slide;
- mmi_uc_object_struct* new_object = NULL;
- mmi_uc_object_struct* duplicated_object = NULL;
- mmi_uc_object_struct* replaced_object = NULL;
- mmi_uc_attachment_info_struct* att = NULL;
- mma_insert_type_enum mms_type = mmi_uc_convert_to_mms_insert_type(g_uc_p->main.highlighted_object_type);
- U32 new_obj_smil_size = 0;
- U32 replaced_obj_smil_size = 0;
- U32 replaced_obj_body_size = 0;
- U32 new_msg_size = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(&check_result, 0, sizeof(mma_insert_check_struct));
- memset(mmi_uc_image_path, 0, MMI_UC_MAX_TEMP_FILE_LEN);
- if (filePath == NULL)
- {
- if (g_uc_p->main.highlighted_object_type == MMI_UC_OBJECT_TYPE_ATTACHMENT)
- {
- if (g_uc_p->msg.total_attachment_num > 0)
- {
- GoBackToHistory(SCR_ID_UC_OPT_ATTACHMENT_LIST);
- }
- else
- {
- GoBackToHistory(SCR_ID_UC_OPT_REPLACE);
- }
- }
- else
- {
- GoBackToHistory(SCR_ID_UC_OPT_REPLACE);
- }
- return;
- }
- mmi_uc_set_processing_screen(STR_UC_REPLACE_ID, STR_UC_PLEASE_WAIT_ID, IMG_GLOBAL_PROGRESS, 0);
- mmi_uc_entry_processing_generic();
- if (g_uc_p->main.highlighted_object_type == MMI_UC_OBJECT_TYPE_ATTACHMENT)
- {
- if (g_uc_p->main.object_index != MMI_UC_INVALID_INDEX)
- {
- att = mmi_uc_get_attachment_by_index(g_uc_p->main.object_index);
- replaced_object = att->object;
- }
- else
- {
- DisplayPopup(
- (PU8) GetString(STR_UC_CONTENT_ERROR_ID),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- DeleteUptoScrID(SCR_ID_UC_EDITOR);
- return;
- }
- }
- else
- {
- replaced_object = mmi_uc_get_object_in_slide(slide, g_uc_p->main.highlighted_object_type);
- if (replaced_object == NULL)
- {
- DisplayPopup(
- (PU8) GetString(STR_UC_CONTENT_ERROR_ID),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- DeleteUptoScrID(SCR_ID_UC_EDITOR);
- return;
- }
- }
- if (g_uc_p->main.highlighted_object_type == MMI_UC_OBJECT_TYPE_IMAGE &&
- g_uc_p->mms_info.image_resize.enable)
- {
- S32 resize_result;
- MMI_UC_MAKE_IMAGE_FILE_PATH(mmi_uc_image_path, ++g_uc_p->main.image_no);
- resize_result = mmi_uc_resize_image(
- (U8*)filePath,
- mmi_uc_image_path,
- g_uc_p->mms_info.image_resize.width,
- g_uc_p->mms_info.image_resize.height);
- /* Error ! */
- if (resize_result < 0)
- {
- /* Check if it is DRM file */
- wap_mma_uc_insert_object_check(filePath,
- mms_type,
- g_uc_p->msg.msg_size,
- g_uc_p->mms_info.max_mms_size,
- &check_result);
- if (check_result.result == MMI_TRUE && check_result.drm_type == MMA_DRM_SD_NO_RIGHT)
- {
- /* allows inserted but display default image for thumbnail. */
- }
- else
- {
- mmi_uc_display_resize_result_popup(resize_result);
- DeleteScreenIfPresent(SCR_ID_UC_PROCESSING);
- return;
- }
- memset(&check_result, 0, sizeof(mma_insert_check_struct));
- }
- /* resized */
- else if (resize_result)
- {
- filePath = (U16*)mmi_uc_image_path;
- }
- /* resize_result == 0 means no need to resize */
- }
- duplicated_object = mmi_uc_check_duplicate_object(filePath);
- new_obj_smil_size = wap_mma_uc_calc_object_smil_size(mms_type, filePath);
- replaced_obj_smil_size = wap_mma_uc_calc_object_smil_size(mmi_uc_convert_to_mms_insert_type(replaced_object->type),
- (const kal_wchar*)replaced_object->file_path);
- if (g_uc_p->main.highlighted_object_type != MMI_UC_OBJECT_TYPE_ATTACHMENT &&
- duplicated_object &&
- duplicated_object->type != MMI_UC_OBJECT_TYPE_ATTACHMENT)
- {
- /* if the original object and the new object are the same, no need to delete the original object. */
- if (replaced_object->reference_count == 1 &&
- replaced_object != duplicated_object)
- {
- replaced_obj_body_size = wap_mma_uc_calc_object_multipart_size(replaced_object->file_path);
- }
- else
- {
- replaced_obj_body_size = 0;
- }
- new_msg_size = g_uc_p->msg.msg_size + new_obj_smil_size - replaced_obj_smil_size - replaced_obj_body_size;
- if (!mmi_uc_check_if_exceed_MMS_size_limitation(new_msg_size))
- {
- replaced_object->reference_count--;
- mmi_uc_insert_object_to_slide(duplicated_object, slide, g_uc_p->main.highlighted_object_type);
- if (replaced_object->reference_count == 0)
- {
- mmi_uc_delete_object_from_list(replaced_object);
- }
- }
- else
- {
- mmi_uc_display_popup(MMI_UC_SIZE_EXCEEDS);
- DeleteScreenIfPresent(SCR_ID_UC_PROCESSING);
- if (pfnUnicodeStrlen((S8*)mmi_uc_image_path))
- {
- FS_Delete((WCHAR*)mmi_uc_image_path);
- }
- return;
- }
- }
- else
- {
- if (replaced_object->reference_count == 1)
- {
- replaced_obj_body_size = wap_mma_uc_calc_object_multipart_size(replaced_object->file_path);
- }
- else
- {
- replaced_obj_body_size = 0;
- }
- new_msg_size = g_uc_p->msg.msg_size - replaced_obj_smil_size - replaced_obj_body_size;
- wap_mma_uc_insert_object_check(filePath,
- mms_type,
- new_msg_size,
- g_uc_p->mms_info.max_mms_size,
- &check_result);
- if (!(check_result.result))
- {
- result = mmi_uc_convert_mms_check_result(&check_result);
- mmi_uc_display_popup(result);
- DeleteScreenIfPresent(SCR_ID_UC_PROCESSING);
- if (pfnUnicodeStrlen((S8*)mmi_uc_image_path))
- {
- FS_Delete((WCHAR*)mmi_uc_image_path);
- }
- return;
- }
- replaced_object->reference_count--;
- if (replaced_object->reference_count == 0)
- {
- mmi_uc_delete_object_from_list(replaced_object);
- }
- new_object = mmi_uc_insert_object((S8*) filePath, g_uc_p->main.highlighted_object_type);
- new_object->drm_type = check_result.drm_type;
- if (g_uc_p->main.highlighted_object_type == MMI_UC_OBJECT_TYPE_ATTACHMENT)
- {
- mmi_uc_insert_object_to_attachment(new_object, att);
- }
- else
- {
- mmi_uc_insert_object_to_slide(new_object, slide, g_uc_p->main.highlighted_object_type);
- }
- }
- fmgr_reset_app_select();
- if (mmi_uc_change_msg_type_if_needed())
- {
- mmi_uc_insert_signature_check();
- }
- mmi_uc_update_msg_size();
- mmi_uc_editor_initialize();
- mmi_uc_set_editor_info(g_uc_p->msg.current_slide);
- if (g_uc_p->main.highlighted_object_type == MMI_UC_OBJECT_TYPE_ATTACHMENT)
- {
- if (GetExitScrnID() == SCR_ID_UC_PROCESSING)
- {
- GoBackToHistory(SCR_ID_UC_OPT_ATTACHMENT_LIST);
- }
- else
- {
- U16 screen_id = 0;
- if (GetNextScrnIdOf(SCR_ID_UC_OPT_ATTACHMENT_LIST,&screen_id))
- {
- DeleteBetweenScreen(screen_id, SCR_ID_UC_PROCESSING);
- }
- else
- {
- MMI_ASSERT(0);
- DeleteScreenIfPresent(SCR_ID_UC_PROCESSING);
- }
- }
- }
- else
- {
- if (GetExitScrnID() == SCR_ID_UC_PROCESSING)
- {
- GoBackToHistory(SCR_ID_UC_EDITOR);
- }
- else
- {
- U16 screen_id = 0;
- if (GetNextScrnIdOf(SCR_ID_UC_EDITOR,&screen_id))
- {
- DeleteBetweenScreen(screen_id, SCR_ID_UC_PROCESSING);
- }
- else
- {
- MMI_ASSERT(0);
- DeleteScreenIfPresent(SCR_ID_UC_PROCESSING);
- }
- }
- }
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_slide_opt
- * DESCRIPTION
- * Entry function for slide option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_slide_opt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- U16 numItems = 0;
- U16 nStrItemList[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_UC_OPT_SLIDE_OPT, mmi_uc_exit_generic, mmi_uc_entry_slide_opt, NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_entry_slide_opt *n"));
- guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_OPT_SLIDE_OPT);
- if (g_uc_p->msg.total_slide_num < MMI_UC_MAX_MMS_SLIDE_NUM)
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT_INSERT);
- }
- else
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT_INSERT);
- }
- if (g_uc_p->msg.total_slide_num > 1)
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT_DELETE);
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT_GO_TO);
- }
- else
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT_DELETE);
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT_GO_TO);
- }
- if (g_uc_p->msg.current_slide->previous)
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT_PREVIOUS);
- }
- else
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT_PREVIOUS);
- }
- if (g_uc_p->msg.current_slide->next)
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT_NEXT);
- }
- else
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT_NEXT);
- }
- if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT_TIMING);
- }
- else
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT_TIMING);
- }
- numItems = GetNumOfChild_Ext(MENU_ID_UC_OPT_SLIDE_OPT);
- GetSequenceStringIds_Ext(MENU_ID_UC_OPT_SLIDE_OPT, nStrItemList);
- SetParentHandler(MENU_ID_UC_OPT_SLIDE_OPT);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_UC_SLIDE_OPTION_ID,
- IMG_UC_ENTRY_SCRN_CAPTION_ID,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- NULL,
- 0,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_insert_slide
- * DESCRIPTION
- * insert new slide
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_insert_slide(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 new_slide_size = 0;
- mmi_uc_slide_struct* slide;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- new_slide_size = wap_mma_uc_calc_object_smil_size(MMA_INSERT_EMPTY_SLIDE, NULL);
- if (!mmi_uc_check_if_exceed_MMS_size_limitation(new_slide_size + g_uc_p->msg.msg_size))
- {
- slide = mmi_uc_insert_slide(g_uc_p->msg.current_slide);
- g_uc_p->msg.current_slide = slide;
- g_uc_p->msg.current_slide_num = slide->slide_num;
- 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_reset_text_buffer();
- //mmi_uc_editor_initialize();
- GoBackToHistory(SCR_ID_UC_EDITOR);
- }
- else
- {
- mmi_uc_display_popup(MMI_UC_SIZE_EXCEEDS);
- return;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_delete_slide
- * DESCRIPTION
- * insert new slide
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_delete_slide(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_uc_slide_struct* slide = g_uc_p->msg.current_slide;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (slide->next)
- {
- g_uc_p->msg.current_slide = slide->next;
- }
- else if (slide->previous)
- {
- g_uc_p->msg.current_slide = slide->previous;
- }
- else
- {
- g_uc_p->msg.current_slide = NULL;
- }
- mmi_uc_delete_slide_with_object(slide);
- g_uc_p->msg.current_slide_num = g_uc_p->msg.current_slide->slide_num;
- mmi_uc_switch_slide(g_uc_p->msg.current_slide);
- if (mmi_uc_change_msg_type_if_needed())
- {
- mmi_uc_insert_signature_check();
- }
- mmi_uc_update_msg_size();
- GoBackToHistory(SCR_ID_UC_EDITOR);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_previous_slide
- * DESCRIPTION
- * Go to previous slide
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_previous_slide(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_uc_slide_struct* slide = g_uc_p->msg.current_slide;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_ASSERT(slide->previous);
- g_uc_p->msg.current_slide = slide->previous;
- g_uc_p->msg.current_slide_num = g_uc_p->msg.current_slide->slide_num;
- mmi_uc_switch_slide(g_uc_p->msg.current_slide);
- GoBackToHistory(SCR_ID_UC_EDITOR);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_next_slide
- * DESCRIPTION
- * Go to next slide
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_next_slide(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_uc_slide_struct* slide = g_uc_p->msg.current_slide;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_ASSERT(slide->next);
- g_uc_p->msg.current_slide = slide->next;
- g_uc_p->msg.current_slide_num = g_uc_p->msg.current_slide->slide_num;
- mmi_uc_switch_slide(g_uc_p->msg.current_slide);
- GoBackToHistory(SCR_ID_UC_EDITOR);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_goto_slide
- * DESCRIPTION
- * Entry screen to edit slide number to enter
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_goto_slide(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U8 slide_number_digit = 0;
- U32 max_slide_number = MMI_UC_MAX_MMS_SLIDE_NUM;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_UC_OPT_SLIDE_OPT_GOTO, NULL, mmi_uc_entry_goto_slide, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_OPT_SLIDE_OPT_GOTO);
- if (max_slide_number < 10)
- {
- slide_number_digit = 2;
- }
- else if (max_slide_number < 100)
- {
- slide_number_digit = 3;
- }
- else if (max_slide_number < 1000)
- {
- slide_number_digit = 4;
- }
- else if (max_slide_number < 10000)
- {
- slide_number_digit = 5;
- }
- else if (max_slide_number < 100000)
- {
- slide_number_digit = 6;
- }
- else
- {
- MMI_ASSERT(0);
- }
- ShowCategory5Screen(
- STR_UC_GO_TO_SOME_SLIDE_ID,
- IMG_UC_ENTRY_SCRN_CAPTION_ID,
- STR_GLOBAL_OK,
- 0,
- STR_GLOBAL_BACK,
- 0,
- INPUT_TYPE_NUMERIC,
- (U8*) g_uc_p->main.slide_number,
- slide_number_digit,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_uc_entry_goto_slide_done, KEY_EVENT_UP);
- SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_goto_slide_done
- * DESCRIPTION
- * Goto slide
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_goto_slide_done(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 ascii_buff[10];
- U16 slide_number;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UnicodeToAnsii((S8*)ascii_buff, (S8*)g_uc_p->main.slide_number);
- slide_number = (U16) atoi(ascii_buff);
- if (slide_number == 0 ||
- slide_number > g_uc_p->msg.total_slide_num)
- {
- DisplayPopup((PU8) GetString(STR_GLOBAL_INVALID),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- }
- else
- {
- mmi_uc_slide_struct* slide = g_uc_p->msg.slide_head;
- U32 i = 1;
- MMI_ASSERT(slide);
- for (; i < slide_number; i++)
- {
- slide = slide->next;
- MMI_ASSERT(slide);
- }
- g_uc_p->msg.current_slide = slide;
- g_uc_p->msg.current_slide_num = g_uc_p->msg.current_slide->slide_num;
- mmi_uc_switch_slide(g_uc_p->msg.current_slide);
- GoBackToHistory(SCR_ID_UC_EDITOR);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_slide_timing
- * DESCRIPTION
- * Entry screen to edit slide timing
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_slide_timing(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_UC_OPT_SLIDE_OPT_SLIDE_TIMING, NULL, mmi_uc_entry_slide_timing, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_OPT_SLIDE_OPT_SLIDE_TIMING);
- ShowCategory5Screen(
- STR_UC_SLIDE_TIMING_ID,
- IMG_UC_ENTRY_SCRN_CAPTION_ID,
- STR_GLOBAL_OK,
- 0,
- STR_GLOBAL_BACK,
- 0,
- INPUT_TYPE_NUMERIC,
- (U8*) g_uc_p->main.slide_timing,
- (MMI_UC_MAX_SLIDE_TIMING_DIGIT + 1),
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_uc_entry_slide_timing_done, KEY_EVENT_UP);
- SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_slide_timing_done
- * DESCRIPTION
- * Set slide timing and go back to editor
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_slide_timing_done(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 ascii_buff[6];
- U16 slide_timing;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UnicodeToAnsii((S8*)ascii_buff, (S8*)g_uc_p->main.slide_timing);
- slide_timing = (U16) atoi(ascii_buff);
- if (slide_timing < g_uc_p->mms_info.sliding_time.min ||
- slide_timing > g_uc_p->mms_info.sliding_time.max )
- {
- DisplayPopup((PU8) GetString(STR_GLOBAL_INVALID),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- }
- else
- {
- g_uc_p->msg.slide_timing = slide_timing;
- GoBackToHistory(SCR_ID_UC_EDITOR);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_slide_opt_insert
- * DESCRIPTION
- * Funtion is called when insert slide menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_slide_opt_insert(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_uc_entry_insert_slide, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_insert_slide, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_slide_opt_delete
- * DESCRIPTION
- * Funtion is called when delete slide menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_slide_opt_delete(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_uc_entry_delete_slide, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_delete_slide, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_slide_opt_previous
- * DESCRIPTION
- * Funtion is called when previous slide menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_slide_opt_previous(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_uc_entry_previous_slide, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_previous_slide, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_slide_opt_next
- * DESCRIPTION
- * Funtion is called when next slide menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_slide_opt_next(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_uc_entry_next_slide, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_next_slide, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_slide_opt_goto
- * DESCRIPTION
- * Funtion is called when goto slide menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_slide_opt_goto(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(g_uc_p->main.slide_number, 0, sizeof(g_uc_p->main.slide_number));
- SetLeftSoftkeyFunction(mmi_uc_entry_goto_slide, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_goto_slide, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_slide_opt_timing
- * DESCRIPTION
- * Funtion is called when slide timing menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_slide_opt_timing(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- kal_wsprintf( (kal_uint16 *)g_uc_p->main.slide_timing, "%d", g_uc_p->msg.slide_timing);
- SetLeftSoftkeyFunction(mmi_uc_entry_slide_timing, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_slide_timing, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_save_msg_type
- * DESCRIPTION
- * Save msg type
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_save_msg_type(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_uc_p->main.object_index == 0)
- {
- g_uc_p->msg_type.curr_msg_type = MMI_UC_MSG_TYPE_SMS_PREFER;
- g_uc_p->msg_type.caller_specific_msg_type = MMI_UC_MSG_TYPE_SMS_PREFER;
- }
- else if (g_uc_p->main.object_index == 1)
- {
- g_uc_p->msg_type.curr_msg_type = MMI_UC_MSG_TYPE_MMS_PREFER;
- g_uc_p->msg_type.caller_specific_msg_type = MMI_UC_MSG_TYPE_MMS_PREFER;
- }
- else
- {
- MMI_ASSERT(0);
- }
- mmi_uc_insert_signature_check();
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_OK,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) SUCCESS_TONE);
- if (g_uc_p->main.state == MMI_UC_STATE_FORWARD ||
- g_uc_p->main.state == MMI_UC_STATE_SEND)
- {
- /* Prevent the msg change ind popup display */
- g_uc_p->done.pre_msg_type = g_uc_p->msg_type.curr_msg_type;
- if (IsScreenPresent(SCR_ID_UC_OPT_DONE_OPT))
- {
- DeleteUptoScrID(SCR_ID_UC_OPT_DONE_OPT);
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- else
- {
- if (IsScreenPresent(SCR_ID_UC_EDITOR))
- {
- DeleteUptoScrID(SCR_ID_UC_EDITOR);
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_msg_type
- * DESCRIPTION
- * Entry msg type screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_msg_type(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U16 nNumofItem = 2;
- S32 hiliteitem = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_UC_OPT_MSG_TYPE_OPT, mmi_uc_exit_generic, mmi_uc_entry_msg_type, NULL);
- subMenuDataPtrs[0] = (PU8) GetString(STR_UC_TEXT_MESSAGE_ID);
- subMenuDataPtrs[1] = (PU8) GetString(STR_UC_MULTIMEDIA_MESSAGE_ID);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_OPT_MSG_TYPE_OPT);
- if ((guiBuffer != NULL))
- {
- hiliteitem = g_uc_p->main.object_index;
- MMI_ASSERT(hiliteitem < nNumofItem);
- }
- else
- {
- if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_SMS_PREFER)
- {
- hiliteitem = 0;
- }
- else if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- hiliteitem = 1;
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- RegisterHighlightHandler(mmi_uc_set_index);
- ShowCategory109Screen(
- STR_UC_MESSAGE_TYPE_ID,
- IMG_UC_ENTRY_SCRN_CAPTION_ID,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- subMenuDataPtrs,
- NULL,
- hiliteitem,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_uc_save_msg_type, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_send_opt
- * DESCRIPTION
- * Entry function of send option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_send_opt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U8 *inputBuffer = NULL; /* added for inline edit history */
- U16 inputBufferSize; /* added for inline edit history */
- U16 image_list[MMI_UC_SEND_OPT_TOTAL_NUM] = {0};
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_ASSERT(g_uc_p->msg_type.caller_specific_msg_type != MMI_UC_MSG_TYPE_SMS_ONLY);
- EntryNewScreen(SCR_ID_UC_OPT_SEND_OPT, mmi_uc_exit_send_opt, NULL, NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_entry_send_opt *n"));
- guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_OPT_SEND_OPT);
- InitializeCategory57Screen();
- mmi_uc_send_opt_fill_inline_struct(image_list);
- if (guiBuffer)
- {
- inputBuffer = GetCurrNInputBuffer(SCR_ID_UC_OPT_SEND_OPT, &inputBufferSize); /* added for inline edit history */
- }
- if (inputBuffer) /* added for inline edit history */
- {
- SetCategory57Data(wgui_inline_items, MMI_UC_SEND_OPT_TOTAL_NUM, inputBuffer); /* sets the data */
- }
- ShowCategory57Screen(
- STR_UC_SEND_OPTION_ID,
- IMG_UC_ENTRY_SCRN_CAPTION_ID,
- 0,
- 0,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- MMI_UC_SEND_OPT_TOTAL_NUM,
- image_list,
- wgui_inline_items,
- 0,
- guiBuffer);
- /* set key hdlr */
- SetCategory57RightSoftkeyFunctions(GoBackHistory, GoBackHistory);
- SetCategory57RightSoftkeyFunctions(mmi_uc_send_opt_done_hdlr, GoBackHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_exit_send_opt
- * DESCRIPTION
- * Exit function of send option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_exit_send_opt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history currHistory;
- U16 inputBufferSize = 0;
- S16 nHistory = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- CloseCategory57Screen();
- currHistory.scrnID = SCR_ID_UC_OPT_SEND_OPT;
- currHistory.entryFuncPtr = mmi_uc_entry_send_opt;
- pfnUnicodeStrcpy((S8*) currHistory.inputBuffer, (S8*) & nHistory);
- GetCategory57History(currHistory.guiBuffer);
- inputBufferSize = (U16) GetCategory57DataSize();
- GetCategory57Data((U8*) currHistory.inputBuffer);
- AddNHistory(currHistory, inputBufferSize);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_send_opt_fill_inline_struct
- * DESCRIPTION
- * Fill inline item of send option menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_send_opt_fill_inline_struct(U16* image_list)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- image_list[MMI_UC_SEND_OPT_VALIDITY_PERIOD_CAPTION] = IMG_UC_VALIDITY_PERIOD_ID;
- image_list[MMI_UC_SEND_OPT_VALIDITY_PERIOD] = 0;
- image_list[MMI_UC_SEND_OPT_DELIVERY_REPORT_CAPTION] = IMG_UC_DELIVERY_REPORT_ID;
- image_list[MMI_UC_SEND_OPT_DELIVERY_REPORT] = 0;
- image_list[MMI_UC_SEND_OPT_READ_REPORT_CAPTION] = IMG_UC_READ_REPORT_ID;
- image_list[MMI_UC_SEND_OPT_READ_REPORT] = 0;
- image_list[MMI_UC_SEND_OPT_PRIORITY_CAPTION] = IMG_UC_PRIORITY_ID;
- image_list[MMI_UC_SEND_OPT_PRIORITY] = 0;
- image_list[MMI_UC_SEND_OPT_DELIVERY_TIME_CAPTION] = IMG_UC_DELIVERY_TIME_ID;
- image_list[MMI_UC_SEND_OPT_DELIVERY_TIME] = 0;
- g_uc_p->send_opt.read_report_str[0] = (UI_string_type)GetString((U16) (STR_GLOBAL_OFF));
- g_uc_p->send_opt.read_report_str[1] = (UI_string_type)GetString((U16) (STR_GLOBAL_ON));
- g_uc_p->send_opt.read_report = g_uc_p->msg.read_report;
- g_uc_p->send_opt.delivery_report_str[0] = (UI_string_type)GetString((U16) (STR_GLOBAL_OFF));
- g_uc_p->send_opt.delivery_report_str[1] = (UI_string_type)GetString((U16) (STR_GLOBAL_ON));
- g_uc_p->send_opt.delivery_report = g_uc_p->msg.delivery_report;
- g_uc_p->send_opt.priority_str[0] = (UI_string_type)GetString((U16) (STR_UC_PRIORITY_LOW_ID));
- g_uc_p->send_opt.priority_str[1] = (UI_string_type)GetString((U16) (STR_UC_PRIORITY_MEDIUM_ID));
- g_uc_p->send_opt.priority_str[2] = (UI_string_type)GetString((U16) (STR_UC_PRIORITY_HIGH_ID));
- g_uc_p->send_opt.priority = g_uc_p->msg.priority - 1;
- g_uc_p->send_opt.validity_period_str[0] = (UI_string_type)GetString((U16) (STR_UC_VALIDITY_PERIOD_1_HOUR_ID));
- g_uc_p->send_opt.validity_period_str[1] = (UI_string_type)GetString((U16) (STR_UC_VALIDITY_PERIOD_12_HOUR_ID));
- g_uc_p->send_opt.validity_period_str[2] = (UI_string_type)GetString((U16) (STR_UC_VALIDITY_PERIOD_1_DAY_ID));
- g_uc_p->send_opt.validity_period_str[3] = (UI_string_type)GetString((U16) (STR_UC_VALIDITY_PERIOD_1_WEEK_ID));
- g_uc_p->send_opt.validity_period_str[4] = (UI_string_type)GetString((U16) (STR_UC_VALIDITY_PERIOD_MAX_ID));
- g_uc_p->send_opt.validity_period = g_uc_p->msg.expiry_time - 1;
- g_uc_p->send_opt.delivery_time_str[0] = (UI_string_type)GetString((U16) (STR_UC_DELIVERY_TIME_IMMEDIATE_ID));
- g_uc_p->send_opt.delivery_time_str[1] = (UI_string_type)GetString((U16) (STR_UC_DELIVERY_TIME_1_HOUR_ID));
- g_uc_p->send_opt.delivery_time_str[2] = (UI_string_type)GetString((U16) (STR_UC_DELIVERY_TIME_12_HOUR_ID));
- g_uc_p->send_opt.delivery_time_str[3] = (UI_string_type)GetString((U16) (STR_UC_DELIVERY_TIME_24_HOUR_ID));
- g_uc_p->send_opt.delivery_time = g_uc_p->msg.delivery_time - 1;
- /* Validity period */
- SetInlineItemActivation(&wgui_inline_items[MMI_UC_SEND_OPT_VALIDITY_PERIOD_CAPTION],
- INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
- 0);
- SetInlineItemCaption(&wgui_inline_items[MMI_UC_SEND_OPT_VALIDITY_PERIOD_CAPTION],
- (U8*) GetString(STR_UC_VALIDITY_PERIOD_ID));
- SetInlineItemSelect(&wgui_inline_items[MMI_UC_SEND_OPT_VALIDITY_PERIOD],
- 5,
- (U8 **) g_uc_p->send_opt.validity_period_str,
- &g_uc_p->send_opt.validity_period);
- SetInlineItemActivation(&wgui_inline_items[MMI_UC_SEND_OPT_VALIDITY_PERIOD],
- INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
- 0);
- /* Delivery Report */
- SetInlineItemActivation(&wgui_inline_items[MMI_UC_SEND_OPT_DELIVERY_REPORT_CAPTION],
- INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
- 0);
- SetInlineItemCaption(&wgui_inline_items[MMI_UC_SEND_OPT_DELIVERY_REPORT_CAPTION],
- (U8*) GetString(STR_UC_DELIVERY_REPORT_ID));
- SetInlineItemSelect(&wgui_inline_items[MMI_UC_SEND_OPT_DELIVERY_REPORT],
- 2,
- (U8 **) g_uc_p->send_opt.delivery_report_str,
- &g_uc_p->send_opt.delivery_report);
- SetInlineItemActivation(&wgui_inline_items[MMI_UC_SEND_OPT_DELIVERY_REPORT],
- INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
- 0);
- /* Read Report */
- SetInlineItemActivation(&wgui_inline_items[MMI_UC_SEND_OPT_READ_REPORT_CAPTION],
- INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
- 0);
- SetInlineItemCaption(&wgui_inline_items[MMI_UC_SEND_OPT_READ_REPORT_CAPTION],
- (U8*) GetString(STR_UC_READ_REPORT_ID));
- SetInlineItemSelect(&wgui_inline_items[MMI_UC_SEND_OPT_READ_REPORT],
- 2,
- (U8 **) g_uc_p->send_opt.read_report_str,
- &g_uc_p->send_opt.read_report);
- SetInlineItemActivation(&wgui_inline_items[MMI_UC_SEND_OPT_READ_REPORT],
- INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
- 0);
- /* Priotiry */
- SetInlineItemActivation(&wgui_inline_items[MMI_UC_SEND_OPT_PRIORITY_CAPTION],
- INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
- 0);
- SetInlineItemCaption(&wgui_inline_items[MMI_UC_SEND_OPT_PRIORITY_CAPTION],
- (U8*) GetString(STR_UC_PRIORITY_ID));
- SetInlineItemSelect(&wgui_inline_items[MMI_UC_SEND_OPT_PRIORITY],
- 3,
- (U8 **) g_uc_p->send_opt.priority_str,
- &g_uc_p->send_opt.priority);
- SetInlineItemActivation(&wgui_inline_items[MMI_UC_SEND_OPT_PRIORITY],
- INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
- 0);
- /* Delivery Time */
- SetInlineItemActivation(&wgui_inline_items[MMI_UC_SEND_OPT_DELIVERY_TIME_CAPTION],
- INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
- 0);
- SetInlineItemCaption(&wgui_inline_items[MMI_UC_SEND_OPT_DELIVERY_TIME_CAPTION],
- (U8*) GetString(STR_UC_DELIVERY_TIME_ID));
- SetInlineItemSelect(&wgui_inline_items[MMI_UC_SEND_OPT_DELIVERY_TIME],
- 4,
- (U8 **) g_uc_p->send_opt.delivery_time_str,
- &g_uc_p->send_opt.delivery_time);
- SetInlineItemActivation(&wgui_inline_items[MMI_UC_SEND_OPT_DELIVERY_TIME],
- INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
- 0);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_send_opt_done_no_hdlr
- * DESCRIPTION
- * Save the setting to context
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_send_opt_done_no_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_uc_p->main.state == MMI_UC_STATE_FORWARD ||
- g_uc_p->main.state == MMI_UC_STATE_SEND)
- {
- if (IsScreenPresent(SCR_ID_UC_OPT_DONE_OPT))
- {
- GoBackToHistory(SCR_ID_UC_OPT_DONE_OPT);
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- else
- {
- if (IsScreenPresent(SCR_ID_UC_EDITOR))
- {
- GoBackToHistory(SCR_ID_UC_EDITOR);
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_send_opt_done_yes_hdlr
- * DESCRIPTION
- * Save the setting to context
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_send_opt_done_yes_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_OK,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) SUCCESS_TONE);
- g_uc_p->msg.read_report = g_uc_p->send_opt.read_report;
- g_uc_p->msg.delivery_report = g_uc_p->send_opt.delivery_report;
- g_uc_p->msg.priority = g_uc_p->send_opt.priority + 1;
- g_uc_p->msg.expiry_time = g_uc_p->send_opt.validity_period + 1;
- g_uc_p->msg.delivery_time = g_uc_p->send_opt.delivery_time + 1;
- if (g_uc_p->main.state == MMI_UC_STATE_FORWARD ||
- g_uc_p->main.state == MMI_UC_STATE_SEND)
- {
- if (IsScreenPresent(SCR_ID_UC_OPT_DONE_OPT))
- {
- DeleteUptoScrID(SCR_ID_UC_OPT_DONE_OPT);
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- else
- {
- if (IsScreenPresent(SCR_ID_UC_EDITOR))
- {
- DeleteUptoScrID(SCR_ID_UC_EDITOR);
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_send_opt_done_hdlr
- * DESCRIPTION
- * Save the setting to context
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_send_opt_done_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_GLOBAL_SAVE),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetLeftSoftkeyFunction(mmi_uc_send_opt_done_yes_hdlr, KEY_EVENT_UP);
- SetRightSoftkeyFunction(mmi_uc_send_opt_done_no_hdlr, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_input_method_done
- * DESCRIPTION
- * Funtion is called when type of input method is selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_input_method_done(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GoBackToHistory(SCR_ID_UC_EDITOR);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_opt_done
- * DESCRIPTION
- * Funtion is called when done menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_opt_done(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->done.pre_msg_type = g_uc_p->msg_type.curr_msg_type;
- SetLeftSoftkeyFunction(mmi_uc_entry_done, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_done, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_opt_insert
- * DESCRIPTION
- * Funtion is called when insert menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_opt_insert(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_uc_entry_insert, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_insert, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_opt_remove
- * DESCRIPTION
- * Funtion is called when remove menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_opt_remove(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_uc_entry_remove, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_remove, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_opt_replace
- * DESCRIPTION
- * Funtion is called when replace menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_opt_replace(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_uc_entry_replace, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_replace, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_opt_slide_opt
- * DESCRIPTION
- * Funtion is called when slide option menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_opt_slide_opt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_uc_entry_slide_opt, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_slide_opt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_opt_msg_type
- * DESCRIPTION
- * Funtion is called when msg type menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_opt_msg_type(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_uc_entry_msg_type, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_msg_type, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_opt_send_opt
- * DESCRIPTION
- * Funtion is called when send option menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_opt_send_opt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_uc_entry_send_opt, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_send_opt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_opt_msg_detail
- * DESCRIPTION
- * Funtion is called when msg detail menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_opt_msg_detail(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_uc_entry_msg_detail, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_msg_detail, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_opt_input_method
- * DESCRIPTION
- * Funtion is called when input method menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_opt_input_method(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetInputMethodAndDoneCaptionIcon(IMG_UC_ENTRY_SCRN_CAPTION_ID);
- SetLeftSoftkeyFunction(EntryInputMethodScreen, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- RegisterInputMethodScreenCloseFunction(mmi_uc_entry_input_method_done);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_opt_preview
- * DESCRIPTION
- * Funtion is called when preview menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_opt_preview(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_uc_entry_preview, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_preview, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_preview
- * DESCRIPTION
- * Entry preview dummy screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_preview(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_BOOL is_back = CheckIsBackHistory();
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_UC_MSG_PREVIEW, mmi_uc_exit_generic, mmi_uc_entry_preview, NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_entry_preview *n"));
- if (is_back)
- {
- g_uc_p->send_info.action = MMI_UC_ACTION_IDLE;
- if (g_uc_p->send_info.new_msg_id)
- {
- mmi_uc_clear_msg_bearer(MMI_UC_MSG_TYPE_MMS_PREFER);
- }
- GoBackToHistory(SCR_ID_UC_EDITOR);
- }
- else
- {
- g_uc_p->send_info.action = MMI_UC_ACTION_PREVIEW;
- MMI_ASSERT(g_uc_p->send_info.new_msg_id == 0);
- mmi_uc_create_mms();
- }
- SetDelScrnIDCallbackHandler(SCR_ID_UC_MSG_PREVIEW, (HistoryDelCBPtr) mmi_uc_preview_delete_history_hdlr);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_preview_delete_history_hdlr
- * DESCRIPTION
- *
- * PARAMETERS
- * in_param [?]
- * RETURNS
- * U8
- *****************************************************************************/
- U8 mmi_uc_preview_delete_history_hdlr(void *in_param)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->send_info.action = MMI_UC_ACTION_IDLE;
- if (g_uc_p->send_info.new_msg_id)
- {
- mmi_uc_clear_msg_bearer(MMI_UC_MSG_TYPE_MMS_PREFER);
- }
- return FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_preview_mms
- * DESCRIPTION
- * Preview mms
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_preview_mms(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_uc_set_processing_screen(STR_UC_PREVIEW_ID, STR_UC_PLEASE_WAIT_ID, IMG_GLOBAL_PROGRESS, 0);
- mmi_uc_entry_processing_generic();
- DeleteScreenIfPresent(SCR_ID_UC_PROCESSING);
- mmi_uc_preview_mms_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_exit_generic
- * DESCRIPTION
- * Generic exit function for unified composer
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_exit_generic(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_set_processing_screen
- * DESCRIPTION
- * Set string and image for UC processing screen
- * PARAMETERS
- * captionStrId [IN]
- * bodyStrId [IN]
- * animationImageId [IN]
- * rskStrId [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_set_processing_screen(U16 captionStrId, U16 bodyStrId, U16 animationImageId, U16 rskStrId)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->processing.caption_str_id = captionStrId;
- g_uc_p->processing.body_str_id = bodyStrId;
- g_uc_p->processing.animation_image_id = animationImageId;
- g_uc_p->processing.RSK_str_id = rskStrId;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_exit_processing_generic
- * DESCRIPTION
- * Exit generic processing screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_exit_processing_generic(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopTimer(UC_INPROGRESS_TIMER_ID);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_time_out_processing_generic
- * DESCRIPTION
- * Time out call back of processing screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_time_out_processing_generic(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopTimer(UC_INPROGRESS_TIMER_ID);
- if (GetExitScrnID() == SCR_ID_UC_PROCESSING)
- {
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_UNFINISHED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- }
- DeleteScreenIfPresent(SCR_ID_UC_PROCESSING);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_processing_generic
- * DESCRIPTION
- * Entry MSG generic processing screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_processing_generic(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_UC_PROCESSING, mmi_uc_exit_processing_generic, mmi_uc_entry_processing_generic, NULL);
- #ifdef __MMI_MAINLCD_240X320__
- /* passing 0xffff for Title string and Title icon for the disbling the status bar and title display. */
- ShowCategory8Screen(
- 0xffff,
- 0xffff,
- 0,
- 0,
- g_uc_p->processing.RSK_str_id,
- 0,
- g_uc_p->processing.body_str_id,
- g_uc_p->processing.animation_image_id,
- NULL);
- #else /* __MMI_MAINLCD_240X320__ */
- ShowCategory8Screen(
- g_uc_p->processing.caption_str_id,
- IMG_UC_ENTRY_SCRN_CAPTION_ID,
- 0,
- 0,
- g_uc_p->processing.RSK_str_id,
- 0,
- g_uc_p->processing.body_str_id,
- g_uc_p->processing.animation_image_id,
- NULL);
- #endif /* __MMI_MAINLCD_240X320__ */
- if (g_uc_p->processing.RSK_str_id == 0)
- {
- ClearInputEventHandler(MMI_DEVICE_ALL);
- ClearKeyHandler(KEY_END, KEY_EVENT_UP);
- ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_END, KEY_LONG_PRESS);
- ClearKeyHandler(KEY_END, KEY_REPEAT);
- if (isInCall())
- {
- SetKeyHandler(HangupAllCalls, KEY_END, KEY_EVENT_DOWN);
- }
- StartTimer(UC_INPROGRESS_TIMER_ID, MMI_UC_INPROGRESS_TIME_OUT, mmi_uc_time_out_processing_generic);
- }
- else
- {
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_preferred_type
- * DESCRIPTION
- * Funtion is called when preferred msg type menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_preferred_type(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_uc_entry_preferred_type, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_preferred_type, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_preferred_type
- * DESCRIPTION
- * Entry preferred msg type screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_preferred_type(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U16 nNumofItem = 2;
- S32 hiliteitem;
- S8 index;
- S16 errorCode;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_UC_PREFERRED_MSG_TYPE, mmi_uc_exit_generic, mmi_uc_entry_preferred_type, NULL);
- subMenuDataPtrs[0] = (PU8) GetString(STR_UC_TEXT_MESSAGE_ID);
- subMenuDataPtrs[1] = (PU8) GetString(STR_UC_MULTIMEDIA_MESSAGE_ID);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_PREFERRED_MSG_TYPE);
- if ((guiBuffer != NULL))
- {
- hiliteitem = g_uc_p->main.object_index;
- MMI_ASSERT(hiliteitem < nNumofItem);
- }
- else
- {
- ReadValue(NVRAM_UC_PREFERRED_MSG_TYPE, &index, DS_BYTE, &errorCode);
- hiliteitem = index;
- }
- RegisterHighlightHandler(mmi_uc_set_index);
- ShowCategory109Screen(
- STR_UC_MESSAGE_TYPE_ID,
- IMG_UC_ENTRY_SCRN_CAPTION_ID,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- subMenuDataPtrs,
- NULL,
- hiliteitem,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_uc_save_preferred_type, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_preferred_type
- * DESCRIPTION
- * Entry preferred msg type screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_save_preferred_type(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 errorCode;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_OK),
- IMG_GLOBAL_OK,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) SUCCESS_TONE);
- WriteValue(NVRAM_UC_PREFERRED_MSG_TYPE, &(g_uc_p->main.object_index), DS_BYTE, &errorCode);
- DeleteScreenIfPresent(SCR_ID_UC_PREFERRED_MSG_TYPE);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_handle_text_in_current_slide
- * DESCRIPTION
- * Save content of text buffer to file OR delete text object
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- S32 mmi_uc_handle_text_in_current_slide(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 mmi_uc_text_path[MMI_UC_MAX_TEMP_FILE_LEN];
- mmi_uc_object_struct * object = NULL;
- S32 result = FS_NO_ERROR;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- 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_num);
- /* Add text object with empty content to the slide */
- if (g_uc_p->msg.current_slide->text.char_count > 0)
- {
- result = mmi_uc_save_buffer_to_file(mmi_uc_text_path, g_uc_p->main.text_buffer,g_uc_p->msg.current_slide->text.char_count);
- if (result == FS_NO_ERROR)
- {
- if (g_uc_p->msg.current_slide->text.object == NULL)
- {
- 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
- {
- g_uc_p->msg.current_slide->text.object->size = applib_get_file_size((kal_wchar*)mmi_uc_text_path);
- }
- }
- }
- /* Delete the text object */
- else if (g_uc_p->msg.current_slide->text.char_count == 0)
- {
- if (g_uc_p->msg.current_slide->text.object)
- {
- MMI_ASSERT(FS_Delete((U16*)mmi_uc_text_path) == FS_NO_ERROR);
- mmi_uc_delete_object_from_list(g_uc_p->msg.current_slide->text.object);
- memset(&(g_uc_p->msg.current_slide->text), 0, sizeof(mmi_uc_text_object_info_struct));
- }
- }
- else
- {
- MMI_ASSERT(0);
- }
- return result;
- }
- #endif /* __MMI_UNIFIED_COMPOSER__ */
- #endif /* _MMI_UNIFIED_COMPOSER_MAIN_C */