UnifiedComposerMain.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:491k
源码类别:
MTK
开发平台:
C/C++
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2005
- *
- * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
- * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
- * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
- *
- * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
- * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
- * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
- * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
- * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
- * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
- *
- *****************************************************************************/
- /*****************************************************************************
- *
- * Filename:
- * ---------
- * UnifiedComposerMain.c
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * This file implements main utilities for Unified Composer.
- *
- * Author:
- * -------
- * -------
- *
- *============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
- #ifndef _MMI_UNIFIED_COMPOSER_MAIN_C
- #define _MMI_UNIFIED_COMPOSER_MAIN_C
- #include "MMI_features.h"
- #ifdef __MMI_UNIFIED_COMPOSER__
- #include "stdC.h"
- #include "L4Dr1.h"
- #include "FileSystemDef.h"
- #include "FileMgr.h"
- #include "FileManagerGprot.h"
- #include "mdi_datatype.h"
- #include "mdi_audio.h"
- /* micha1230 */
- #include "custom_nvram_editor_data_item.h"
- #include "custom_data_account.h"
- #include "NVRAMEnum.h"
- #include "NVRAMProt.h"
- #include "NVRAMType.h"
- #include "MessagesExDcl.h"
- #include "MessagesResourceData.h"
- #include "KeyBrd.h"
- #include "USBDeviceGprot.h"
- #include "GlobalDefs.h"
- #include "DebugInitDef.h"
- #include "GlobalConstants.h"
- #include "FrameworkStruct.h"
- #include "EventsGprot.h"
- #include "HistoryGprot.h"
- #include "wgui_categories.h"
- #include "wgui_status_icons.h"
- #include "CommonScreens.h"
- #include "CustDataRes.h"
- #include "SettingProfile.h"
- #include "ProfileGprots.h"
- #include "SubLCDHistoryGprot.h"
- #include "PhoneBookGprot.h"
- #include "TimerEvents.h"
- #include "PhoneBookDef.h"
- #include "PhonebookTypes.h"
- #include "FileSystemDef.h"
- #include "FileSystemGProt.h"
- #include "Conversions.h"
- #include "MemPoolContainerProt.h"
- #include "wgui_asyncdynamic_menuitems.h"
- #include "Wgui_categories_inputs.h"
- #include "Wgui_categories_defs.h"
- #include "wgui_categories_UCE.h"
- #include "GlobalScrEnum.h"
- #include "Gdi_include.h"
- #include "Wgui_categories_multimedia.h"
- #include "Wgui_categories_popup.h"
- #include "AudioPlayerProt.h"
- #include "VdoPlyGProt.h"
- #include "CallManagementGprot.h"
- #include "mmi_trc.h" /* debug info */
- #include "CommonScreens.h"
- #include "fmt_struct.h"
- #include "DateTimeGprot.h"
- #include "MessagesMiscell.h"
- #include "SmsGuiInterfaceProt.h"
- #include "EventsDef.h"
- #include "wgui_categories_email.h"
- #include "wapadp.h"
- #include "mmsadp.h"
- #include "wap_ps_struct.h"
- #include "custom_wap_config.h"
- #include "App_mem.h"
- #include "customer_ps_inc.h"
- #include "mmi_msg_context.h"
- #include "MessagesL4Def.h"
- #include "MessagesResourceData.h"
- #include "MessagesMiscell.h"
- #include "MessagesExDcl.h"
- #include "SmsGuiInterfaceProt.h"
- #include "SMsGuiInterfaceType.h"
- #include "SmsPsHandler.h"
- #include "SMSApi.h"
- #include "SMSStruct.h"
- #include "SMSFunc.h"
- #include "IdleAppDef.h"
- #include "xml_def.h"
- #include "app_asyncfile.h"
- #include "UnifiedMessageGProt.h"
- #include "custom_uc_config.h"
- #include "UnifiedComposerDef.h"
- #include "UnifiedComposerGProt.h"
- #include "UnifiedComposerProt.h"
- mmi_uc_context_struct g_uc_cntx; /* global context of uc */
- mmi_uc_context_struct *g_uc_p = &g_uc_cntx;
- extern MMI_PHB_ENTRY_BCD_STRUCT PhoneBook[];
- extern U8 mmi_phb_convert_to_digit(U8 *dest, U8 *source, U8 max_dest_len);
- extern int wap_entry_select_bookmark(void);
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_init
- * DESCRIPTION
- * Initialize Unified Composer application
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_init(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_uc_init_context();
- mmi_uc_set_protocol_event_handler();
- mmi_uc_create_adm_mem();
- mmi_uc_set_highlight_handler();
- mmi_uc_init_uc_folder();
- mmi_uc_init_setting();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_set_highlight_handler
- * DESCRIPTION
- * Set highlight handler for uc app.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_set_highlight_handler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* set the option menu highlight handlers */
- SetHiliteHandler(MENU_ID_UC_OPT_DONE, mmi_uc_highlight_opt_done);
- SetHiliteHandler(MENU_ID_UC_OPT_INSERT, mmi_uc_highlight_opt_insert);
- SetHiliteHandler(MENU_ID_UC_OPT_REMOVE, mmi_uc_highlight_opt_remove);
- SetHiliteHandler(MENU_ID_UC_OPT_REPLACE, mmi_uc_highlight_opt_replace);
- SetHiliteHandler(MENU_ID_UC_OPT_PREVIEW, mmi_uc_highlight_opt_preview);
- SetHiliteHandler(MENU_ID_UC_OPT_SLIDE_OPT, mmi_uc_highlight_opt_slide_opt);
- SetHiliteHandler(MENU_ID_UC_OPT_MSG_TYPE_OPT, mmi_uc_highlight_opt_msg_type);
- SetHiliteHandler(MENU_ID_UC_OPT_SEND_OPT, mmi_uc_highlight_opt_send_opt);
- SetHiliteHandler(MENU_ID_UC_OPT_MSG_DETAIL, mmi_uc_highlight_opt_msg_detail);
- SetHiliteHandler(MENU_ID_UC_OPT_INPUT_METHOD, mmi_uc_highlight_opt_input_method);
- /* set address option menu highlight handlers */
- SetHiliteHandler(MENU_ID_UC_OPT_ADDR_DONE, mmi_uc_highlight_addr_opt_done);
- SetHiliteHandler(MENU_ID_UC_OPT_ADDR_ADD_NUMBER, mmi_uc_highlight_addr_opt_add_number);
- SetHiliteHandler(MENU_ID_UC_OPT_ADDR_ADD_EMAIL, mmi_uc_highlight_addr_opt_add_email);
- SetHiliteHandler(MENU_ID_UC_OPT_ADDR_EDIT, mmi_uc_highlight_addr_opt_edit);
- SetHiliteHandler(MENU_ID_UC_OPT_ADDR_DELETE, mmi_uc_highlight_addr_opt_delete);
- SetHiliteHandler(MENU_ID_UC_OPT_ADDR_DELETE_ALL, mmi_uc_highlight_addr_opt_delete_all);
- SetHiliteHandler(MENU_ID_UC_OPT_ADDR_ADD_NUMBER_GROUP, mmi_uc_highlight_addr_opt_add_number_group);
- SetHiliteHandler(MENU_ID_UC_OPT_ADDR_ADD_EMAIL_GROUP, mmi_uc_highlight_addr_opt_add_email_group);
- /* set insert menu highlight handlers */
- SetHiliteHandler(MENU_ID_UC_OPT_INSERT_IMAGE, mmi_uc_highlight_insert_image);
- SetHiliteHandler(MENU_ID_UC_OPT_INSERT_AUDIO, mmi_uc_highlight_insert_audio);
- SetHiliteHandler(MENU_ID_UC_OPT_INSERT_VIDEO, mmi_uc_highlight_insert_video);
- SetHiliteHandler(MENU_ID_UC_OPT_INSERT_TEXT_TEMPLATE, mmi_uc_highlight_insert_text_template);
- SetHiliteHandler(MENU_ID_UC_OPT_INSERT_ATTACHMENT, mmi_uc_highlight_insert_attachment);
- SetHiliteHandler(MENU_ID_UC_OPT_INSERT_PHB_NUMBER, mmi_uc_highlight_insert_phb_number);
- SetHiliteHandler(MENU_ID_UC_OPT_INSERT_PHB_NAME, mmi_uc_highlight_insert_phb_name);
- SetHiliteHandler(MENU_ID_UC_OPT_INSERT_BOOKMARK, mmi_uc_highlight_insert_bookmark);
- /* set remove menu highlight handlers */
- SetHiliteHandler(MENU_ID_UC_OPT_REMOVE_IMAGE, mmi_uc_highlight_remove_image);
- SetHiliteHandler(MENU_ID_UC_OPT_REMOVE_AUDIO, mmi_uc_highlight_remove_audio);
- SetHiliteHandler(MENU_ID_UC_OPT_REMOVE_VIDEO, mmi_uc_highlight_remove_video);
- SetHiliteHandler(MENU_ID_UC_OPT_REMOVE_ATTACHMENT, mmi_uc_highlight_remove_attachment);
- /* set replace menu highlight handlers */
- SetHiliteHandler(MENU_ID_UC_OPT_REPLACE_IMAGE, mmi_uc_highlight_replace_image);
- SetHiliteHandler(MENU_ID_UC_OPT_REPLACE_AUDIO, mmi_uc_highlight_replace_audio);
- SetHiliteHandler(MENU_ID_UC_OPT_REPLACE_VIDEO, mmi_uc_highlight_replace_video);
- SetHiliteHandler(MENU_ID_UC_OPT_REPLACE_ATTACHMENT, mmi_uc_highlight_replace_attachment);
- /* set slide option menu highlight handlers */
- SetHiliteHandler(MENU_ID_UC_OPT_SLIDE_OPT_INSERT, mmi_uc_highlight_slide_opt_insert);
- SetHiliteHandler(MENU_ID_UC_OPT_SLIDE_OPT_DELETE, mmi_uc_highlight_slide_opt_delete);
- SetHiliteHandler(MENU_ID_UC_OPT_SLIDE_OPT_PREVIOUS, mmi_uc_highlight_slide_opt_previous);
- SetHiliteHandler(MENU_ID_UC_OPT_SLIDE_OPT_NEXT, mmi_uc_highlight_slide_opt_next);
- SetHiliteHandler(MENU_ID_UC_OPT_SLIDE_OPT_GO_TO, mmi_uc_highlight_slide_opt_goto);
- SetHiliteHandler(MENU_ID_UC_OPT_SLIDE_OPT_TIMING, mmi_uc_highlight_slide_opt_timing);
- /* set slide option menu highlight handlers */
- SetHiliteHandler(MENU_ID_UC_SETTING_PREFERRED_TYPE, mmi_uc_highlight_preferred_type);
- /* set done option menu highlight handlers */
- SetHiliteHandler(MENU_ID_UC_OPT_DONE_SEND, mmi_uc_highlight_done_opt_send);
- SetHiliteHandler(MENU_ID_UC_OPT_DONE_SEND_AND_SAVE, mmi_uc_highlight_done_opt_send_and_save);
- SetHiliteHandler(MENU_ID_UC_OPT_DONE_SAVE, mmi_uc_highlight_done_opt_save);
- SetHiliteHandler(MENU_ID_UC_OPT_DONE_BACK_TO_EDIT_MSG, mmi_uc_highlight_done_opt_back_to_edit);
- SetHiliteHandler(MENU_ID_UC_OPT_DONE_MSG_TYPE, mmi_uc_highlight_opt_msg_type);
- SetHiliteHandler(MENU_ID_UC_OPT_DONE_SEND_OPT, mmi_uc_highlight_done_opt_send_opt);
- SetHiliteHandler(MENU_ID_UC_OPT_DONE_EXIT, mmi_uc_highlight_done_opt_exit);
- /* set remove menu highlight handlers */
- SetHiliteHandler(MENU_ID_UC_EXIT_OPT_SAVE, mmi_uc_highlight_exit_opt_save);
- SetHiliteHandler(MENU_ID_UC_EXIT_OPT_EXIT, mmi_uc_highlight_exit_opt_exit);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_pre_entry_write_msg
- * DESCRIPTION
- * Pre entry function of unified composer
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_pre_entry_write_msg(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* 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)
- {
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_NOT_AVAILABLE),
- IMG_GLOBAL_ERROR,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- return;
- }
- g_uc_p->main.state = MMI_UC_STATE_WRITE_NEW_MSG;
- if (g_uc_p->msg.total_slide_num > 0 &&
- IsScreenPresent(SCR_ID_UC_EDITOR))
- {
- /* UC in entered by other apps, ex, bar code reader. And then MT call. Optionmessage centerwrite message */
- MMI_ASSERT(isInCall());
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_UC_DISCARD_EDITED_MSG_ID),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(mmi_uc_discard_msg_before_enter_write_msg, KEY_EVENT_UP);
- }
- else
- {
- mmi_uc_reset_msg();
- 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;
- g_uc_p->msg_type.caller_specific_msg_type = MMI_UC_MSG_TYPE_DEFAULT;
- g_uc_p->msg_type.backup_msg_type = MMI_UC_MSG_TYPE_DEFAULT;
- mmi_uc_process_entry_write_msg();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_discard_msg_before_enter_write_msg
- * DESCRIPTION
- * Discard previous edited msg before entering write msg
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_discard_msg_before_enter_write_msg(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 startScrnId = SCR_ID_UC_EDITOR;
- U16 endScrnId = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
- "*---[UnifiedComposerMain.c] mmi_uc_discard_msg_before_enter_write_msg ---*n"));
- mmi_uc_reset_msg();
- /* UC in entered by other apps, ex, bar code reader. And then MT call. Optionmessage centerwrite message */
- MMI_ASSERT(isInCall());
- if (IsScreenPresent(startScrnId))
- {
- GetPreviousScrnIdOf(GetCmMarkerScrnID(), &endScrnId);
- if (endScrnId)
- {
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
- "*---[UnifiedComposerMain.c] End scrn id to be deleteted %d ---*n", endScrnId));
- if (DeleteBetweenScreen(startScrnId, endScrnId))
- {
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
- "*---[UnifiedComposerMain.c] Deleteted scrn id from %d to %d ---*n",
- startScrnId, endScrnId));
- }
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- else
- {
- MMI_ASSERT(0);
- }
- 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;
- g_uc_p->msg_type.caller_specific_msg_type = MMI_UC_MSG_TYPE_DEFAULT;
- g_uc_p->msg_type.backup_msg_type = MMI_UC_MSG_TYPE_DEFAULT;
- mmi_uc_process_entry_write_msg();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_process_entry_write_msg
- * DESCRIPTION
- * Process function of entering unified composer
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_process_entry_write_msg(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 title_id = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_uc_p->main.state == MMI_UC_STATE_FORWARD)
- {
- title_id = STR_UC_FORWARD_ID;
- }
- else if (g_uc_p->main.state == MMI_UC_STATE_SEND)
- {
- title_id = STR_UC_SEND_ID;
- }
- else
- {
- title_id = STR_UC_WRITE_MSG_ID;
- }
- mmi_uc_set_processing_screen(title_id,
- STR_UC_PLEASE_WAIT_ID,
- IMG_GLOBAL_PROGRESS,
- 0);
- mmi_uc_entry_processing_generic();
- /* need EMS library support */
- mmi_uc_get_sms_setting();
- /* send get setting request to MMS */
- mmi_uc_get_mms_setting_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_write_msg_end_key_hdlr
- * DESCRIPTION
- * End key handler for unified composer editor screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_write_msg_end_key_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!isInCall())
- {
- mmi_uc_handle_text_in_current_slide();
- /* mmi_uc_write_msg_delete_history_hdlr would be called in ExecuteRootMainHistoryScreen */
- //mmi_uc_write_msg_delete_history_hdlr(NULL);
- }
- ExecCurrEndKeyDownHandler();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_exit_write_msg
- * DESCRIPTION
- * Exit function from write msg
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_exit_write_msg(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 result = FS_NO_ERROR;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* If press RSK in uc screen to exit editor, msg would be reset in RSK handler mmi_uc_go_back_from_write_msg */
- if (g_uc_p->msg.current_slide)
- {
- result = mmi_uc_handle_text_in_current_slide();
- g_uc_p->main.current_text_file_save_result = result;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_write_msg
- * DESCRIPTION
- * Entry function of unified composer
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_write_msg(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* disallow re-entering SMS application when there is a pending SMS job running in the background */
- if (mmi_frm_sms_check_action_pending())
- {
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_NOT_AVAILABLE),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- DeleteScreenIfPresent(SCR_ID_UC_PROCESSING);
- return;
- }
- EntryNewScreen(SCR_ID_UC_EDITOR, mmi_uc_exit_write_msg, mmi_uc_entry_write_msg, NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_entry_write_msg*n"));
- AlmDisableSPOF();
- guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_EDITOR);
- GetCurrEndKeyDownHandler();
- /* reset */
- g_uc_p->send_info.action = MMI_UC_ACTION_IDLE;
- g_uc_p->send_info.abort = MMI_UC_ABORT_NONE;
- ShowCategory280Screen(STR_UC_WRITE_MSG_ID,
- IMG_UC_ENTRY_SCRN_CAPTION_ID,
- STR_GLOBAL_OPTIONS,
- IMG_GLOBAL_OPTIONS,
- STR_UC_EXIT_ID,
- IMG_GLOBAL_BACK,
- mmi_uc_convert_to_editor_msg_type(g_uc_p->msg_type.curr_msg_type),
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_uc_pre_entry_option, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_pre_entry_option, KEY_SEND, KEY_EVENT_UP);
- RegisterInputMethodScreenCloseFunction(mmi_uc_go_back_from_write_msg);
- SetCategory280RightSoftkeyFunction(mmi_uc_go_back_from_write_msg, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_write_msg_end_key_hdlr, KEY_END, KEY_EVENT_DOWN);
- DeleteScreenIfPresent(SCR_ID_UC_PROCESSING);
- SetDelScrnIDCallbackHandler(SCR_ID_UC_EDITOR, (HistoryDelCBPtr) mmi_uc_write_msg_delete_history_hdlr);
- if (g_uc_p->msg.fail_to_insert_signature)
- {
- if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- DisplayPopup((PU8) GetString(STR_UC_FAIL_TO_INSERT_SIGNATURE_ID),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- }
- g_uc_p->msg.fail_to_insert_signature = MMI_FALSE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_write_msg_delete_history_hdlr
- * DESCRIPTION
- *
- * PARAMETERS
- * in_param [?]
- * RETURNS
- * U8
- *****************************************************************************/
- U8 mmi_uc_write_msg_delete_history_hdlr(void *in_param)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 result = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_uc_p->send_info.action == MMI_UC_ACTION_IDLE && mmi_uc_is_pending_content())
- {
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_write_msg_delete_history_hdlr save in background *n"));
- g_uc_p->send_info.action = MMI_UC_ACTION_SAVE_IN_BACKGROUND;
- /* Save the edited msg. */
- if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_SMS_PREFER)
- {
- mmi_uc_save_sms_req();
- }
- else if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- result = mmi_uc_create_mms_xml_description_file();
- if (result == FS_NO_ERROR)
- {
- mmi_uc_create_mms_req();
- }
- else
- {
- mmi_uc_reset_msg();
- }
- }
- }
- else
- {
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_write_msg_delete_history_hdlr Do Nothing *n"));
- /* Disable following actions in mmi_uc_action_fsm() */
- //g_uc_p->send_info.action = MMI_UC_ACTION_IDLE;
- }
- return FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_exit_option
- * DESCRIPTION
- * Entry function of unified composer exit option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_exit_option(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- U16 numItems = 0;
- U16 nStrItemList[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_UC_EXIT_OPT, mmi_uc_exit_generic, mmi_uc_entry_exit_option, NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_entry_exit_option *n"));
- guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_EXIT_OPT);
- numItems = GetNumOfChild_Ext(MENU_ID_UC_EXIT_OPT);
- GetSequenceStringIds_Ext(MENU_ID_UC_EXIT_OPT, nStrItemList);
- SetParentHandler(MENU_ID_UC_EXIT_OPT);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_GLOBAL_OPTIONS,
- 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_exit_opt_save
- * DESCRIPTION
- * Funtion is called when save item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_exit_opt_save(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_uc_save_msg_before_exit_write_msg, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_save_msg_before_exit_write_msg, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_exit_opt_exit
- * DESCRIPTION
- * Funtion is called when exit item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_exit_opt_exit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_uc_discard_msg_before_exit_write_msg, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_discard_msg_before_exit_write_msg, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_go_back_from_write_msg
- * DESCRIPTION
- * Go back function from write msg
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_go_back_from_write_msg(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_uc_exit_write_msg();
- if (mmi_uc_is_pending_content())
- {
- mmi_uc_entry_exit_option();
- }
- else
- {
- mmi_uc_reset_msg();
- GoBackHistory();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_discard_msg_before_exit_write_msg
- * DESCRIPTION
- * Go back function from write msg
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_discard_msg_before_exit_write_msg(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_uc_reset_msg();
- DeleteScreenIfPresent(SCR_ID_UC_EDITOR);
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_save_msg_before_exit_write_msg
- * DESCRIPTION
- * Go back function from write msg
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_save_msg_before_exit_write_msg(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_uc_p->main.current_text_file_save_result == FS_NO_ERROR)
- {
- mmi_uc_process_save();
- }
- else
- {
- DisplayConfirm(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- 0,
- 0,
- get_string(STR_UC_STORAGE_FULL_MSG_CONTENT_LOSS_ID),
- IMG_GLOBAL_INFO,
- WARNING_TONE);
- SetLeftSoftkeyFunction(mmi_uc_process_save, KEY_EVENT_UP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_pre_entry_option
- * DESCRIPTION
- * Pre-entry function of unified composer option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_pre_entry_option(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_uc_exit_write_msg();
- mmi_uc_update_msg_size();
- if (g_uc_p->main.current_text_file_save_result == FS_NO_ERROR)
- {
- mmi_uc_entry_option();
- }
- else
- {
- if (g_uc_p->main.current_text_file_save_result == FS_DISK_FULL)
- {
- DisplayPopup(
- (PU8)GetString(STR_UC_STORAGE_FULL_DELETE_FILE_ID),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- }
- else
- {
- DisplayPopup(
- (PU8)GetString(GetFileSystemErrorString(g_uc_p->main.current_text_file_save_result)),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_option
- * DESCRIPTION
- * Entry function of unified composer option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_option(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- U16 numItems = 0;
- U16 nStrItemList[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_UC_OPT, mmi_uc_exit_generic, mmi_uc_entry_option, NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_entry_option *n"));
- guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_OPT);
- if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_SMS_PREFER)
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_REMOVE);
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_REPLACE);
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_PREVIEW);
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_SEND_OPT);
- }
- else if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_MMS_PREFER )
- {
- if (g_uc_p->msg.current_slide->image.object ||
- g_uc_p->msg.current_slide->audio.object ||
- g_uc_p->msg.current_slide->video.object ||
- g_uc_p->msg.total_attachment_num)
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_REMOVE);
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_REPLACE);
- }
- else
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_REMOVE);
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_REPLACE);
- }
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_PREVIEW);
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_SEND_OPT);
- }
- else
- {
- MMI_ASSERT(0);
- }
- if (g_uc_p->msg_type.caller_specific_msg_type == MMI_UC_MSG_TYPE_SMS_ONLY)
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT);
- }
- else
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT);
- }
- if (g_uc_p->msg_type.caller_specific_msg_type == MMI_UC_MSG_TYPE_SMS_ONLY ||
- g_uc_p->msg_type.caller_specific_msg_type == MMI_UC_MSG_TYPE_MMS_ONLY ||
- mmi_uc_determine_msg_type_by_content() == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_MSG_TYPE_OPT);
- }
- else
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_MSG_TYPE_OPT);
- }
- numItems = GetNumOfChild_Ext(MENU_ID_UC_OPT);
- GetSequenceStringIds_Ext(MENU_ID_UC_OPT, nStrItemList);
- SetParentHandler(MENU_ID_UC_OPT);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_GLOBAL_OPTIONS,
- 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_done
- * DESCRIPTION
- * Entry function of done
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_done(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U8 *inputBuffer; /* added for inline edit history */
- S32 items_num = 0;
- U16 inputBufferSize; /* added for inline edit history */
- U16 image_list[MMI_UC_DONE_TOTAL_NUM] = {0};
- U16 title_id = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_UC_OPT_DONE, mmi_uc_exit_done, NULL, NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_entry_done *n"));
- if (g_uc_p->main.state == MMI_UC_STATE_FORWARD)
- {
- title_id = STR_UC_FORWARD_ID;
- }
- else if (g_uc_p->main.state == MMI_UC_STATE_SEND)
- {
- title_id = STR_UC_SEND_ID;
- }
- else
- {
- title_id = STR_GLOBAL_OPTIONS;
- }
- if (g_uc_p->msg_type.caller_specific_msg_type == MMI_UC_MSG_TYPE_SMS_ONLY)
- {
- items_num = MMI_UC_DONE_SMS_ONLY_TOTAL_NUM;
- }
- else
- {
- items_num = MMI_UC_DONE_TOTAL_NUM;
- }
- mmi_uc_update_msg_size();
- guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_OPT_DONE);
- InitializeCategory57Screen();
- mmi_uc_done_fill_inline_struct(image_list);
- RegisterHighlightHandler(mmi_uc_done_highlight_hdlr);
- inputBuffer = GetCurrNInputBuffer(SCR_ID_UC_OPT_DONE, &inputBufferSize); /* added for inline edit history */
- if (inputBuffer) /* added for inline edit history */
- {
- SetCategory57Data(wgui_inline_items, MMI_UC_DONE_TOTAL_NUM, inputBuffer); /* sets the data */
- }
- DisableCategory57ScreenDone();
- /* reset */
- g_uc_p->send_info.action = MMI_UC_ACTION_IDLE;
- g_uc_p->send_info.abort = MMI_UC_ABORT_NONE;
- ShowCategory57Screen(
- title_id,
- IMG_UC_ENTRY_SCRN_CAPTION_ID,
- 0,
- 0,
- STR_GLOBAL_DONE,
- 0,
- items_num,
- image_list,
- wgui_inline_items,
- 0,
- guiBuffer);
- SetCategory57RightSoftkeyFunctions(mmi_uc_entry_done_option, mmi_uc_entry_done_option);
- SetDelScrnIDCallbackHandler(SCR_ID_UC_OPT_DONE, (HistoryDelCBPtr) mmi_uc_done_delete_history_hdlr);
- StartTimer(UC_MSG_TYPE_CHECK_TIMER_ID, MMI_UC_MSG_TYPE_CHECK_TIME, mmi_uc_handle_msg_type_check);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_done_delete_history_hdlr
- * DESCRIPTION
- *
- * PARAMETERS
- * in_param [?]
- * RETURNS
- * U8
- *****************************************************************************/
- U8 mmi_uc_done_delete_history_hdlr(void *in_param)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_uc_p->main.state == MMI_UC_STATE_FORWARD ||
- g_uc_p->main.state == MMI_UC_STATE_SEND)
- {
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_done_delete_history_hdlr *n"));
- MMI_ASSERT(IsScreenPresent(SCR_ID_UC_EDITOR) != MMI_TRUE);
- /* Disable following actions in mmi_uc_action_fsm() */
- //g_uc_p->send_info.action = MMI_UC_ACTION_IDLE;
- }
- return FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_done_highlight_hdlr
- * DESCRIPTION
- * Highligth handler for done menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_done_highlight_hdlr(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->done.current_addr_index = 0;
- if (g_uc_p->msg_type.caller_specific_msg_type == MMI_UC_MSG_TYPE_SMS_ONLY)
- {
- switch (index)
- {
- case MMI_UC_DONE_SMS_ONLY_TO:
- {
- g_uc_p->done.current_addr_type = MMI_UC_ADDRESS_GROUP_TYPE_TO;
- if (g_uc_p->msg.to_num == 0)
- {
- if ((g_uc_p->msg.cc_num + g_uc_p->msg.bcc_num ) >= MMI_UC_MAX_ADDRESS_NUM)
- {
- ChangeLeftSoftkey(0, 0);
- }
- else
- {
- ChangeLeftSoftkey(STR_GLOBAL_EDIT, 0);
- SetCategory57LeftSoftkeyFunction(mmi_uc_entry_addr_option);
- }
- }
- else
- {
- ChangeLeftSoftkey(STR_GLOBAL_EDIT, 0);
- SetCategory57LeftSoftkeyFunction(mmi_uc_entry_addr_list);
- }
- }
- break;
- case MMI_UC_DONE_SMS_ONLY_MSG_DETAIL_CAPTION:
- {
- ChangeLeftSoftkey(STR_GLOBAL_VIEW, 0);
- SetCategory57LeftSoftkeyFunction(mmi_uc_entry_msg_detail);
- }
- break;
- default:
- {
- MMI_ASSERT(0);
- }
- break;
- }
- }
- else
- {
- switch (index)
- {
- case MMI_UC_DONE_TO:
- {
- g_uc_p->done.current_addr_type = MMI_UC_ADDRESS_GROUP_TYPE_TO;
- if (g_uc_p->msg.to_num == 0)
- {
- if ((g_uc_p->msg.cc_num + g_uc_p->msg.bcc_num ) >= MMI_UC_MAX_ADDRESS_NUM)
- {
- ChangeLeftSoftkey(0, 0);
- }
- else
- {
- ChangeLeftSoftkey(STR_GLOBAL_EDIT, 0);
- SetCategory57LeftSoftkeyFunction(mmi_uc_entry_addr_option);
- }
- }
- else
- {
- ChangeLeftSoftkey(STR_GLOBAL_EDIT, 0);
- SetCategory57LeftSoftkeyFunction(mmi_uc_entry_addr_list);
- }
- }
- break;
- case MMI_UC_DONE_CC:
- {
- g_uc_p->done.current_addr_type = MMI_UC_ADDRESS_GROUP_TYPE_CC;
- if (g_uc_p->msg_type.caller_specific_msg_type == MMI_UC_MSG_TYPE_SMS_ONLY)
- {
- ASSERT(0);
- }
- else
- {
- if (g_uc_p->msg.cc_num == 0)
- {
- if ((g_uc_p->msg.to_num + g_uc_p->msg.bcc_num ) >= MMI_UC_MAX_ADDRESS_NUM)
- {
- ChangeLeftSoftkey(0, 0);
- }
- else
- {
- ChangeLeftSoftkey(STR_GLOBAL_EDIT, 0);
- SetCategory57LeftSoftkeyFunction(mmi_uc_entry_addr_option);
- }
- }
- else
- {
- ChangeLeftSoftkey(STR_GLOBAL_EDIT, 0);
- SetCategory57LeftSoftkeyFunction(mmi_uc_entry_addr_list);
- }
- }
- }
- break;
- case MMI_UC_DONE_BCC:
- {
- g_uc_p->done.current_addr_type = MMI_UC_ADDRESS_GROUP_TYPE_BCC;
- if (g_uc_p->msg_type.caller_specific_msg_type == MMI_UC_MSG_TYPE_SMS_ONLY)
- {
- ASSERT(0);
- }
- else
- {
- if (g_uc_p->msg.bcc_num == 0)
- {
- if ((g_uc_p->msg.to_num + g_uc_p->msg.cc_num ) >= MMI_UC_MAX_ADDRESS_NUM)
- {
- ChangeLeftSoftkey(0, 0);
- }
- else
- {
- ChangeLeftSoftkey(STR_GLOBAL_EDIT, 0);
- SetCategory57LeftSoftkeyFunction(mmi_uc_entry_addr_option);
- }
- }
- else
- {
- ChangeLeftSoftkey(STR_GLOBAL_EDIT, 0);
- SetCategory57LeftSoftkeyFunction(mmi_uc_entry_addr_list);
- }
- }
- }
- break;
- case MMI_UC_DONE_SUBJECT:
- {
- if (g_uc_p->msg_type.caller_specific_msg_type == MMI_UC_MSG_TYPE_SMS_ONLY)
- {
- ASSERT(0);
- }
- else
- {
- ChangeLeftSoftkey(STR_GLOBAL_EDIT, 0);
- }
- }
- break;
- case MMI_UC_DONE_MSG_DETAIL_CAPTION:
- {
- ChangeLeftSoftkey(STR_GLOBAL_VIEW, 0);
- SetCategory57LeftSoftkeyFunction(mmi_uc_entry_msg_detail);
- }
- break;
- default:
- {
- MMI_ASSERT(0);
- }
- break;
- }
- }
- ChangeRightSoftkey(STR_GLOBAL_DONE, 0);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_done_fill_inline_struct
- * DESCRIPTION
- * Fill inline item of done menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_done_fill_inline_struct(U16* image_list)
- {
- if (g_uc_p->msg_type.caller_specific_msg_type == MMI_UC_MSG_TYPE_SMS_ONLY)
- {
- image_list[MMI_UC_DONE_SMS_ONLY_TO_CAPTION] = IMG_UC_TO_ID;
- image_list[MMI_UC_DONE_SMS_ONLY_TO] = 0;
- image_list[MMI_UC_DONE_SMS_ONLY_MSG_DETAIL_CAPTION] = IMG_UC_MSG_DETAIL_ID;
- }
- else
- {
- image_list[MMI_UC_DONE_TO_CAPTION] = IMG_UC_TO_ID;
- image_list[MMI_UC_DONE_TO] = 0;
- image_list[MMI_UC_DONE_CC_CAPTION] = IMG_UC_CC_ID;
- image_list[MMI_UC_DONE_CC] = 0;
- image_list[MMI_UC_DONE_BCC_CAPTION] = IMG_UC_BCC_ID;
- image_list[MMI_UC_DONE_BCC] = 0;
- image_list[MMI_UC_DONE_SUBJECT_CAPTION] = IMG_UC_SUBJECT_ID;
- image_list[MMI_UC_DONE_SUBJECT] = 0;
- image_list[MMI_UC_DONE_MSG_DETAIL_CAPTION] = IMG_UC_MSG_DETAIL_ID;
- }
- /* To caption */
- SetInlineItemCaption(&wgui_inline_items[MMI_UC_DONE_TO_CAPTION], (U8*) GetString(STR_UC_TO_ID));
- /* To address */
- //SetInlineItemActivation(&wgui_inline_items[MMI_UC_DONE_TO], KEY_LSK, KEY_EVENT_UP);
- memset(g_uc_p->done.to, 0, (MMI_UC_MAX_ADDR_LEN + 1) * ENCODING_LENGTH);
- if (g_uc_p->msg.to_num == 0)
- {
- /* display empty in the field */
- }
- else if (g_uc_p->msg.to_num == 1)
- {
- if (g_uc_p->msg.to_head->type == MMI_UC_ADDRESS_TYPE_PHONE_NUMBER)
- {
- S8 *name = NULL;
- S8 temp[(MMI_UC_MAX_ADDR_LEN + 1) * ENCODING_LENGTH];
- memset(temp, 0, sizeof(temp));
- AnsiiToUnicodeString(temp, (S8*) g_uc_p->msg.to_head->addr);
- name = lookUpNumber(temp);
- if (name != NULL && pfnUnicodeStrlen(name) > 0)
- {
- pfnUnicodeStrncpy((S8*) g_uc_p->done.to, name, MMI_UC_MAX_ADDR_LEN);
- }
- else
- {
- pfnUnicodeStrncpy((S8*) g_uc_p->done.to, temp, MMI_UC_MAX_ADDR_LEN);
- }
- }
- else if (g_uc_p->msg.to_head->type == MMI_UC_ADDRESS_TYPE_EMAIL)
- {
- pfnUnicodeStrncpy((S8*) g_uc_p->done.to,(S8*) g_uc_p->msg.to_head->addr, MMI_UC_MAX_ADDR_LEN);
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- else
- {
- U8 ascii_recipient_number[16];
- memset(ascii_recipient_number, 0, sizeof(ascii_recipient_number));
- sprintf((char*)ascii_recipient_number, "%d ", g_uc_p->msg.to_num);
- AnsiiToUnicodeString((PS8) g_uc_p->done.to, (PS8) ascii_recipient_number);
- pfnUnicodeStrncat((S8*) g_uc_p->done.to,
- (const S8*)GetString(STR_UC_RECIPIENTS_ID),
- MMI_UC_MAX_ADDR_LEN - pfnUnicodeStrlen((PS8) GetString(STR_UC_RECIPIENTS_ID)));
- }
- SetInlineItemDisplayOnly(&wgui_inline_items[MMI_UC_DONE_TO], (U8*) (g_uc_p->done.to));
- if (g_uc_p->msg_type.caller_specific_msg_type != MMI_UC_MSG_TYPE_SMS_ONLY)
- {
- /* Cc caption */
- SetInlineItemCaption(&wgui_inline_items[MMI_UC_DONE_CC_CAPTION], (U8*) GetString(STR_UC_CC_ID));
- /* Cc address */
- //SetInlineItemActivation(&wgui_inline_items[MMI_UC_DONE_CC], KEY_LSK, KEY_EVENT_UP);
- memset(g_uc_p->done.cc, 0, (MMI_UC_MAX_ADDR_LEN + 1) * ENCODING_LENGTH);
- if (g_uc_p->msg.cc_num == 0)
- {
- /* display empty in the field */
- }
- else if (g_uc_p->msg.cc_num == 1)
- {
- if (g_uc_p->msg.cc_head->type == MMI_UC_ADDRESS_TYPE_PHONE_NUMBER)
- {
- S8 *name = NULL;
- S8 temp[(MMI_UC_MAX_ADDR_LEN + 1) * ENCODING_LENGTH];
- memset(temp, 0, sizeof(temp));
- AnsiiToUnicodeString(temp, (S8*) g_uc_p->msg.cc_head->addr);
- name = lookUpNumber(temp);
- if (name != NULL && pfnUnicodeStrlen(name) > 0)
- {
- pfnUnicodeStrncpy((S8*) g_uc_p->done.cc, name, MMI_UC_MAX_ADDR_LEN);
- }
- else
- {
- pfnUnicodeStrncpy((S8*) g_uc_p->done.cc, temp, MMI_UC_MAX_ADDR_LEN);
- }
- }
- else if (g_uc_p->msg.cc_head->type == MMI_UC_ADDRESS_TYPE_EMAIL)
- {
- pfnUnicodeStrncpy((S8*) g_uc_p->done.cc, (S8*)g_uc_p->msg.cc_head->addr, MMI_UC_MAX_ADDR_LEN);
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- else
- {
- U8 ascii_recipient_number[16];
- memset(ascii_recipient_number, 0, sizeof(ascii_recipient_number));
- sprintf((char*)ascii_recipient_number, "%d ", g_uc_p->msg.cc_num);
- AnsiiToUnicodeString((PS8) g_uc_p->done.cc, (PS8) ascii_recipient_number);
- pfnUnicodeStrncat((S8*) g_uc_p->done.cc,
- (const S8*)GetString(STR_UC_RECIPIENTS_ID),
- MMI_UC_MAX_ADDR_LEN - pfnUnicodeStrlen((PS8) GetString(STR_UC_RECIPIENTS_ID)));
- }
- SetInlineItemDisplayOnly(&wgui_inline_items[MMI_UC_DONE_CC], (U8*) (g_uc_p->done.cc));
- /* Bcc caption */
- SetInlineItemCaption(&wgui_inline_items[MMI_UC_DONE_BCC_CAPTION], (U8*) GetString(STR_UC_BCC_ID));
- /* Bcc address */
- //SetInlineItemActivation(&wgui_inline_items[MMI_UC_DONE_BCC], KEY_LSK, KEY_EVENT_UP);
- memset(g_uc_p->done.bcc, 0, (MMI_UC_MAX_ADDR_LEN + 1) * ENCODING_LENGTH);
- if (g_uc_p->msg.bcc_num == 0)
- {
- /* display empty in the field */
- }
- else if (g_uc_p->msg.bcc_num == 1)
- {
- if (g_uc_p->msg.bcc_head->type == MMI_UC_ADDRESS_TYPE_PHONE_NUMBER)
- {
- S8 *name = NULL;
- S8 temp[(MMI_UC_MAX_ADDR_LEN + 1) * ENCODING_LENGTH];
- memset(temp, 0, sizeof(temp));
- AnsiiToUnicodeString(temp, (S8*) g_uc_p->msg.bcc_head->addr);
- name = lookUpNumber(temp);
- if (name != NULL && pfnUnicodeStrlen(name) > 0)
- {
- pfnUnicodeStrncpy((S8*) g_uc_p->done.bcc, name, MMI_UC_MAX_ADDR_LEN);
- }
- else
- {
- pfnUnicodeStrncpy((S8*) g_uc_p->done.bcc, temp, MMI_UC_MAX_ADDR_LEN);
- }
- }
- else if (g_uc_p->msg.bcc_head->type == MMI_UC_ADDRESS_TYPE_EMAIL)
- {
- pfnUnicodeStrncpy((S8*) g_uc_p->done.bcc, (S8*) g_uc_p->msg.bcc_head->addr, MMI_UC_MAX_ADDR_LEN);
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- else
- {
- U8 ascii_recipient_number[16];
- memset(ascii_recipient_number, 0, sizeof(ascii_recipient_number));
- sprintf((char*) ascii_recipient_number, "%d ", g_uc_p->msg.bcc_num);
- AnsiiToUnicodeString((PS8) g_uc_p->done.bcc, (PS8) ascii_recipient_number);
- pfnUnicodeStrncat((S8*) g_uc_p->done.bcc,
- (const S8*)GetString(STR_UC_RECIPIENTS_ID),
- MMI_UC_MAX_ADDR_LEN - pfnUnicodeStrlen((PS8) GetString(STR_UC_RECIPIENTS_ID)));
- }
- SetInlineItemDisplayOnly(&wgui_inline_items[MMI_UC_DONE_BCC], (U8*) (g_uc_p->done.bcc));
- /* Subject caption */
- SetInlineItemCaption(&wgui_inline_items[MMI_UC_DONE_SUBJECT_CAPTION], (U8*) GetString(STR_UC_SUBJECT_ID));
- /* Subject */
- SetInlineItemActivation(&wgui_inline_items[MMI_UC_DONE_SUBJECT], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit(
- &wgui_inline_items[MMI_UC_DONE_SUBJECT],
- STR_UC_SUBJECT_ID,
- IMG_UC_ENTRY_SCRN_CAPTION_ID,
- (PU8) g_uc_p->msg.subject,
- MMI_UC_MAX_SUBJECT_LEN + 1,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
- SetInlineFullScreenEditCustomFunction(
- &wgui_inline_items[MMI_UC_DONE_SUBJECT],
- mmi_uc_inline_generic_custom_function);
- }
- /* Message detail caption */
- if (g_uc_p->msg_type.caller_specific_msg_type == MMI_UC_MSG_TYPE_SMS_ONLY)
- {
- //SetInlineItemActivation(&wgui_inline_items[MMI_UC_DONE_SMS_ONLY_MSG_DETAIL_CAPTION], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemDisplayOnly(&wgui_inline_items[MMI_UC_DONE_SMS_ONLY_MSG_DETAIL_CAPTION], (U8*)GetString(STR_UC_MESSAGE_DETAIL_ID));
- }
- else
- {
- //SetInlineItemActivation(&wgui_inline_items[MMI_UC_DONE_MSG_DETAIL_CAPTION], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemDisplayOnly(&wgui_inline_items[MMI_UC_DONE_MSG_DETAIL_CAPTION], (U8*)GetString(STR_UC_MESSAGE_DETAIL_ID));
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_inline_generic_custom_function
- * DESCRIPTION
- * Set LSK handle for inline full screen edit
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_inline_generic_custom_function(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetInputMethodAndDoneCaptionIcon(IMG_UC_ENTRY_SCRN_CAPTION_ID);
- ChangeLeftSoftkey(STR_GLOBAL_OPTIONS, IMG_GLOBAL_OPTIONS);
- SetLeftSoftkeyFunction(EntryScrForInputMethodAndDone, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_exit_done
- * DESCRIPTION
- * Exit function of done
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_exit_done(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history currHistory;
- U16 inputBufferSize = 0;
- S16 nHistory = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- CloseCategory57Screen();
- currHistory.scrnID = SCR_ID_UC_OPT_DONE;
- currHistory.entryFuncPtr = mmi_uc_entry_done;
- pfnUnicodeStrcpy((S8*) currHistory.inputBuffer, (S8*) & nHistory);
- GetCategory57History(currHistory.guiBuffer);
- inputBufferSize = (U16) GetCategory57DataSize();
- GetCategory57Data((U8*) currHistory.inputBuffer);
- AddNHistory(currHistory, inputBufferSize);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_done_option
- * DESCRIPTION
- * Entry function for done option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_done_option(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- U16 numItems = 0;
- U16 nStrItemList[MAX_SUB_MENUS];
- U16 title_id = STR_GLOBAL_OPTIONS;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_UC_OPT_DONE_OPT, mmi_uc_exit_generic, mmi_uc_entry_done_option, NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_entry_done_option *n"));
- guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_OPT_DONE_OPT);
- if (g_uc_p->main.state == MMI_UC_STATE_FORWARD)
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_DONE_SAVE);
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_DONE_BACK_TO_EDIT_MSG);
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_DONE_EXIT);
- if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_SMS_PREFER)
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_DONE_SEND_OPT);
- }
- else
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_DONE_SEND_OPT);
- }
- if (g_uc_p->msg_type.caller_specific_msg_type == MMI_UC_MSG_TYPE_SMS_ONLY ||
- g_uc_p->msg_type.caller_specific_msg_type == MMI_UC_MSG_TYPE_MMS_ONLY ||
- mmi_uc_determine_msg_type_by_content() == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_DONE_MSG_TYPE);
- }
- else
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_DONE_MSG_TYPE);
- }
- }
- else if (g_uc_p->main.state == MMI_UC_STATE_SEND)
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_DONE_SAVE);
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_DONE_BACK_TO_EDIT_MSG);
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_DONE_EXIT);
- if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_SMS_PREFER)
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_DONE_SEND_OPT);
- }
- else
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_DONE_SEND_OPT);
- }
- if (g_uc_p->msg_type.caller_specific_msg_type == MMI_UC_MSG_TYPE_SMS_ONLY ||
- g_uc_p->msg_type.caller_specific_msg_type == MMI_UC_MSG_TYPE_MMS_ONLY ||
- mmi_uc_determine_msg_type_by_content() == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_DONE_MSG_TYPE);
- }
- else
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_DONE_MSG_TYPE);
- }
- }
- else
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_DONE_SAVE);
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_DONE_BACK_TO_EDIT_MSG);
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_DONE_MSG_TYPE);
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_DONE_SEND_OPT);
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_DONE_EXIT);
- }
- numItems = GetNumOfChild_Ext(MENU_ID_UC_OPT_DONE_OPT);
- GetSequenceStringIds_Ext(MENU_ID_UC_OPT_DONE_OPT, nStrItemList);
- SetParentHandler(MENU_ID_UC_OPT_DONE_OPT);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- title_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_process_back_to_edit
- * DESCRIPTION
- * Process back to editor
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_process_back_to_edit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (IsScreenPresent(SCR_ID_UC_EDITOR))
- {
- GoBackToHistory(SCR_ID_UC_EDITOR);
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_process_exit
- * DESCRIPTION
- * Process Exit msg
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_process_exit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 screen_id;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (GetPreviousScrnIdOf(SCR_ID_UC_OPT_DONE, &screen_id))
- {
- mmi_uc_reset_msg();
- GoBackToHistory(screen_id);
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_process_send
- * DESCRIPTION
- * Process Send msg
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_process_send(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_SMS_PREFER)
- {
- if (g_uc_p->msg.to_num == 0)
- {
- DisplayPopup(
- (PU8) GetString(STR_UC_NO_RECEPIENT_ADDR_ID),
- IMG_GLOBAL_ERROR,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- }
- else
- {
- g_uc_p->send_info.action = MMI_UC_ACTION_SEND;
- g_uc_p->send_info.curr_send_number = 0;
- mmi_uc_send_sms();
- }
- }
- else if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- if (g_uc_p->msg.to_num + g_uc_p->msg.cc_num + g_uc_p->msg.bcc_num == 0)
- {
- DisplayPopup(
- (PU8) GetString(STR_UC_NO_RECEPIENT_ADDR_ID),
- IMG_GLOBAL_ERROR,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- }
- else
- {
- g_uc_p->send_info.action = MMI_UC_ACTION_SEND;
- mmi_uc_create_mms();
- }
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_process_send
- * DESCRIPTION
- * Process Send msg
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_process_send_and_save(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_SMS_PREFER)
- {
- if (g_uc_p->msg.to_num == 0)
- {
- DisplayPopup(
- (PU8) GetString(STR_UC_NO_RECEPIENT_ADDR_ID),
- IMG_GLOBAL_ERROR,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- }
- else
- {
- g_uc_p->send_info.action = MMI_UC_ACTION_SEND_AND_SAVE;
- g_uc_p->send_info.curr_send_number = 0;
- mmi_uc_send_sms();
- }
- }
- else if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- if (g_uc_p->msg.to_num + g_uc_p->msg.cc_num + g_uc_p->msg.bcc_num == 0)
- {
- DisplayPopup(
- (PU8) GetString(STR_UC_NO_RECEPIENT_ADDR_ID),
- IMG_GLOBAL_ERROR,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- }
- else
- {
- g_uc_p->send_info.action = MMI_UC_ACTION_SEND_AND_SAVE;
- mmi_uc_create_mms();
- }
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_process_save
- * DESCRIPTION
- * Process Save msg
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_process_save(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- UmMsgBoxType msg_box = mmi_um_get_current_msg_box_type();
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->send_info.action = MMI_UC_ACTION_SAVE;
- if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_SMS_PREFER)
- {
- if (msg_box == UM_MSG_BOX_TYPE_DRAFT)
- {
- mmi_uc_set_processing_screen(
- STR_GLOBAL_SAVING,
- STR_UC_PLEASE_WAIT_ID,
- IMG_GLOBAL_PROGRESS,
- 0);
- mmi_uc_entry_processing_generic();
- /* save msg from SMS to SMS. Delete original one and then save new one. */
- if (g_uc_p->send_info.existed_msg_type == MMI_UC_MSG_TYPE_SMS_PREFER)
- {
- mmi_frm_sms_delete_sms(
- mmi_uc_delete_sms_callback,
- MOD_MMI,
- MMI_FRM_SMS_DRAFTS,
- g_uc_p->send_info.existed_msg_id );
- }
- /* save msg from MMS to SMS. Save new one and then delete original one. */
- else if (g_uc_p->send_info.existed_msg_type == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- mmi_uc_save_sms_req();
- }
- else
- {
- MMI_ASSERT(0);
- }
- mmi_um_set_highlight_msg(0);
- }
- else if (msg_box == UM_MSG_BOX_TYPE_UNSENT && g_uc_p->msg.to_num > 0)
- {
- mmi_uc_set_processing_screen(
- STR_GLOBAL_SAVING,
- STR_UC_PLEASE_WAIT_ID,
- IMG_GLOBAL_PROGRESS,
- 0);
- mmi_uc_entry_processing_generic();
- /* save msg from SMS to SMS. Delete original one and then save new one. */
- if (g_uc_p->send_info.existed_msg_type == MMI_UC_MSG_TYPE_SMS_PREFER)
- {
- mmi_frm_sms_delete_sms(
- mmi_uc_delete_sms_callback,
- MOD_MMI,
- MMI_FRM_SMS_UNSENT,
- g_uc_p->send_info.existed_msg_id );
- }
- /* save msg from MMS to SMS. Save new one and then delete original one. */
- else if (g_uc_p->send_info.existed_msg_type == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- mmi_uc_save_sms_req();
- }
- else
- {
- MMI_ASSERT(0);
- }
- mmi_um_set_highlight_msg(0);
- }
- else
- {
- mmi_uc_save_sms();
- }
- }
- else if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- /* The original mms msg would be deleted after mms creation if it belongs to draft folder */
- mmi_uc_create_mms();
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_send_sms
- * DESCRIPTION
- * Send SMS msg
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_send_sms(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_uc_entry_sending_sms();
- mmi_uc_send_sms_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_save_sms
- * DESCRIPTION
- * Send SMS msg
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_save_sms(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_uc_set_processing_screen(
- STR_GLOBAL_SAVING,
- STR_UC_PLEASE_WAIT_ID,
- IMG_GLOBAL_PROGRESS,
- 0);
- mmi_uc_entry_processing_generic();
- mmi_uc_save_sms_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_send_sms_req
- * DESCRIPTION
- * Send SMS msg
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_send_sms_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_frm_sms_send_struct *sendData = NULL;
- mmi_uc_addr_struct* addr;
- U8 *handled_buffer = NULL;
- U16 handled_buffer_size = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- sendData = OslMalloc(sizeof(mmi_frm_sms_send_struct));
- memset((S8*) sendData, 0, sizeof(mmi_frm_sms_send_struct));
- if (g_uc_p->send_info.curr_send_number == 0)
- {
- mmi_uc_clear_msg_bearer(MMI_UC_MSG_TYPE_SMS_PREFER);
- if (g_uc_p->msg.current_slide->text.UCS2_count)
- {
- sendData->dcs = SMSAL_UCS2_DCS;
- handled_buffer_size = ( g_uc_p->msg.current_slide->text.char_count + 1) * ENCODING_LENGTH;
- MMI_ASSERT( handled_buffer_size <= MMI_UC_UTF8_TEXT_BUFFER_SIZE);
- handled_buffer = (U8*)applib_mem_screen_alloc((U16)handled_buffer_size);
- memset((S8*) handled_buffer, 0, handled_buffer_size);
- memcpy((S8*) handled_buffer,
- (S8*) g_uc_p->main.text_buffer,
- g_uc_p->msg.current_slide->text.char_count * ENCODING_LENGTH);
- }
- else
- {
- sendData->dcs = SMSAL_DEFAULT_DCS;
- handled_buffer_size = ( g_uc_p->msg.current_slide->text.char_count +
- g_uc_p->msg.current_slide->text.extension_char_count
- + 1) * ENCODING_LENGTH;
- MMI_ASSERT( handled_buffer_size <= MMI_UC_UTF8_TEXT_BUFFER_SIZE);
- handled_buffer = (U8*)applib_mem_screen_alloc(handled_buffer_size);
- memset((S8*) handled_buffer, 0, handled_buffer_size);
- mmi_frm_sms_add_escape_symbol_for_extension_char(
- (U16*) handled_buffer,
- (U16*) g_uc_p->main.text_buffer,
- g_uc_p->msg.current_slide->text.char_count);
- }
- MMI_ASSERT(mmi_frm_sms_fill_in_edit_buffer(handled_buffer,
- (U16)((handled_buffer_size / ENCODING_LENGTH) - 1),
- sendData->dcs,
- MMI_TRUE));
- applib_mem_screen_free(handled_buffer);
- }
- addr = mmi_uc_get_addr(MMI_UC_ADDRESS_GROUP_TYPE_TO, g_uc_p->send_info.curr_send_number);
- strncpy((S8*) sendData->number, (S8*) addr->addr,MAX_DIGITS_SMS - 1);
- sendData->sendrequire |= MMI_FRM_SMS_SAVE_AFTER_FAIL;
- if (g_uc_p->main.state == MMI_UC_STATE_REPLY)
- {
- sendData->sendrequire |= MMI_FRM_SMS_REPLY;
- sendData->replyindex = g_uc_p->send_info.existed_msg_id;
- }
- sendData->sendcheck |= MMI_FRM_SMS_SCR;
- mmi_frm_sms_send_sms(mmi_uc_send_sms_rsp, MOD_MMI, sendData);
- OslMfree(sendData);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_send_sms_rsp
- * DESCRIPTION
- * Send SMS msg response
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_send_sms_rsp(void *number, module_type mod, U16 result)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (result == MMI_FRM_SMS_OK)
- {
- g_uc_p->send_info.curr_send_number++;
- if (g_uc_p->send_info.curr_send_number < g_uc_p->msg.to_num)
- {
- mmi_uc_send_sms_req();
- return;
- }
- }
- g_uc_p->send_info.send_result = result;
- mmi_uc_action_fsm(MMI_UC_ACTION_SEND, result);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_save_sms_req
- * DESCRIPTION
- * save SMS msg
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_save_sms_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_frm_sms_send_struct *sendData = NULL;
- mmi_uc_addr_struct* addr;
- U8 *handled_buffer = NULL;
- U16 handled_buffer_size = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- sendData = OslMalloc(sizeof(mmi_frm_sms_send_struct));
- memset((S8*) sendData, 0, sizeof(mmi_frm_sms_send_struct));
- mmi_uc_clear_msg_bearer(MMI_UC_MSG_TYPE_SMS_PREFER);
- if (g_uc_p->msg.current_slide->text.UCS2_count)
- {
- sendData->dcs = SMSAL_UCS2_DCS;
- handled_buffer_size = ( g_uc_p->msg.current_slide->text.char_count + 1) * ENCODING_LENGTH;
- MMI_ASSERT( handled_buffer_size <= MMI_UC_UTF8_TEXT_BUFFER_SIZE);
- handled_buffer = (U8*)applib_mem_screen_alloc(handled_buffer_size);
- memset((S8*) handled_buffer, 0, handled_buffer_size);
- memcpy((S8*) handled_buffer,
- (S8*) g_uc_p->main.text_buffer,
- g_uc_p->msg.current_slide->text.char_count * ENCODING_LENGTH);
- }
- else
- {
- sendData->dcs = SMSAL_DEFAULT_DCS;
- handled_buffer_size = ( g_uc_p->msg.current_slide->text.char_count +
- g_uc_p->msg.current_slide->text.extension_char_count
- + 1) * ENCODING_LENGTH;
- MMI_ASSERT( handled_buffer_size <= MMI_UC_UTF8_TEXT_BUFFER_SIZE);
- handled_buffer = (U8*)applib_mem_screen_alloc((U16)handled_buffer_size);
- memset((S8*) handled_buffer, 0, handled_buffer_size);
- mmi_frm_sms_add_escape_symbol_for_extension_char(
- (U16*) handled_buffer,
- (U16*) g_uc_p->main.text_buffer,
- g_uc_p->msg.current_slide->text.char_count);
- }
- MMI_ASSERT(mmi_frm_sms_fill_in_edit_buffer(handled_buffer,
- (U16)((handled_buffer_size / ENCODING_LENGTH) - 1),
- sendData->dcs,
- KAL_TRUE));
- applib_mem_screen_free(handled_buffer);
- if (g_uc_p->msg.to_num)
- {
- addr = mmi_uc_get_addr(MMI_UC_ADDRESS_GROUP_TYPE_TO, 0);
- strncpy((S8*) sendData->number, (S8*) addr->addr,MAX_DIGITS_SMS - 1);
- }
- sendData->status = SMSAL_STO_UNSENT;
- mmi_frm_sms_save_sms(mmi_uc_save_sms_rsp, MOD_MMI, sendData);
- OslMfree(sendData);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_save_sms_rsp
- * DESCRIPTION
- * Save SMS msg response
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_save_sms_rsp(void *status, module_type mod, U16 result)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->send_info.save_result = result;
- mmi_uc_action_fsm(MMI_UC_ACTION_SAVE, result);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_delete_sms_callback
- * DESCRIPTION
- * Delete SMS msg response
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_delete_sms_callback(void *dummy, module_type mod, U16 result)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_uc_action_fsm(MMI_UC_ACTION_DELETE, result);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_sending_sms
- * DESCRIPTION
- * Entry function of sending sms
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_sending_sms(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_UC_SENDING, NULL, mmi_uc_entry_sending_sms, NULL);
- ShowCategory8Screen(
- STR_SENDING_SMS,
- 0,
- 0,
- 0,
- STR_GLOBAL_ABORT,
- IMG_SMS_COMMON_NOIMAGE,
- STR_SENDIING_SMS_BODY,
- IMG_NEW_SMS_SEND,
- NULL);
- GetCurrEndKeyDownHandler();
- 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);
- SetKeyHandler(mmi_uc_abort_send_sms_by_end_key, KEY_END, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(mmi_uc_abort_send_sms, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_abort_send_sms
- * DESCRIPTION
- * Abort sending SMS by RSK
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_abort_send_sms(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->send_info.abort = MMI_UC_ABORT_NORMAL;
- mmi_uc_set_processing_screen(
- STR_GLOBAL_ABORTING,
- STR_UC_PLEASE_WAIT_ID,
- IMG_GLOBAL_PROGRESS,
- 0);
- mmi_uc_entry_processing_generic();
- mmi_frm_sms_abort_sending_sms(MMI_FRM_SMS_ABORT_WITH_FINISH_IND);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_abort_send_sms_by_end_key
- * DESCRIPTION
- * Abort sending SMS by endkey
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_abort_send_sms_by_end_key(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (isInCall() == FALSE)
- {
- g_uc_p->send_info.abort = MMI_UC_ABORT_BY_END_KEY;
- mmi_uc_set_processing_screen(
- STR_GLOBAL_ABORTING,
- STR_UC_PLEASE_WAIT_ID,
- IMG_GLOBAL_PROGRESS,
- 0);
- mmi_uc_entry_processing_generic();
- DeleteUptoScrID(IDLE_SCREEN_ID);
- mmi_frm_sms_abort_sending_sms(MMI_FRM_SMS_ABORT_WITHOUT_FINISH_IND);
- 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);
- }
- else
- {
- ExecCurrEndKeyDownHandler();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_action_fsm
- * DESCRIPTION
- * FSM for unified composer action
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_action_fsm (mmi_uc_action_type_enum action, U32 result)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
- "*[UnifiedComposerMain.c] mmi_uc_action_fsm action=%d state=%d cur_action=%d res=%d*n",
- g_uc_p->send_info.action, g_uc_p->main.state, action, result));
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
- "*[UnifiedComposerMain.c] mmi_uc_action_fsm cur_msg_type=%d existed_msg_type=%d*n",
- g_uc_p->msg_type.curr_msg_type, g_uc_p->send_info.existed_msg_type));
- switch (g_uc_p->send_info.action)
- {
- case MMI_UC_ACTION_SEND:
- {
- switch (g_uc_p->main.state)
- {
- case MMI_UC_STATE_WRITE_NEW_MSG:
- case MMI_UC_STATE_FORWARD:
- case MMI_UC_STATE_REPLY:
- case MMI_UC_STATE_REPLY_ALL:
- {
- switch (action)
- {
- /* send , write new */
- case MMI_UC_ACTION_SEND:
- {
- if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_SMS_PREFER)
- {
- switch (result)
- {
- case MMI_FRM_SMS_OK:
- {
- DisplayPopup(
- (PU8) GetString(STR_UC_SENT_ID),
- IMG_SEND_SUCCESS_PIC_MSG,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) SUCCESS_TONE);
- if (g_uc_p->main.state == MMI_UC_STATE_FORWARD)
- {
- mmi_uc_delete_between_screens(SCR_ID_UC_OPT_DONE, SCR_ID_UC_SENDING);
- }
- else
- {
- mmi_uc_delete_between_screens(SCR_ID_UC_EDITOR, SCR_ID_UC_SENDING);
- }
- mmi_uc_reset_msg();
- mmi_uc_clear_msg_bearer(MMI_UC_MSG_TYPE_SMS_PREFER);
- mmi_uc_delete_sms_frm_screen();
- AlmEnableSPOF();
- }
- break;
- case MMI_FRM_SMS_ABORT:
- {
- if (g_uc_p->send_info.abort == MMI_UC_ABORT_NORMAL)
- {
- DisplayPopup(
- (PU8) GetString(STR_UC_ABORTED_ID),
- IMG_GLOBAL_ACTIVATED,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) SUCCESS_TONE);
- if (g_uc_p->main.state == MMI_UC_STATE_FORWARD)
- {
- mmi_uc_delete_between_screens(SCR_ID_UC_OPT_DONE_OPT, SCR_ID_UC_PROCESSING);
- }
- else
- {
- mmi_uc_delete_between_screens(SCR_ID_UC_OPT, SCR_ID_UC_PROCESSING);
- }
- mmi_uc_delete_sms_frm_screen();
- AlmEnableSPOF();
- }
- else if (g_uc_p->send_info.abort == MMI_UC_ABORT_BY_END_KEY)
- {
- mmi_uc_addr_struct* addr = NULL;
- addr = mmi_uc_get_addr(MMI_UC_ADDRESS_GROUP_TYPE_TO, g_uc_p->send_info.curr_send_number);
- mmi_uc_save_sms_after_send(SMSAL_STO_UNSENT, addr->addr);
- AlmEnableSPOF();
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- break;
- case MMI_FRM_SMS_NOTREADY:
- {
- DisplayPopup(
- (PU8) GetString(STR_SMS_MSG_NOT_READY_YET),
- IMG_SEND_FAIL_PIC_MSG,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- DeleteScreenIfPresent(SCR_ID_UC_SENDING);
- AlmEnableSPOF();
- }
- break;
- case MMI_FRM_SMS_NUMINVALID:
- {
- DisplayPopup(
- (PU8) GetString(STR_ID_PHB_NUM_INVALID),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- mmi_uc_delete_between_screens(SCR_ID_UC_OPT, SCR_ID_UC_SENDING);
- mmi_uc_delete_sms_frm_screen();
- AlmEnableSPOF();
- }
- break;
- case MMI_FRM_SMS_RETURN:
- case MMI_FRM_SMS_END:
- break;
- default:
- {
- mmi_uc_addr_struct* addr = NULL;
- /* UC Screens may be deleted by other Apps, ex. USB normal mode.*/
- /* Do not display processing screen in such cases. */
- if (IsScreenPresent(SCR_ID_UC_OPT_DONE))
- {
- mmi_uc_set_processing_screen(STR_GLOBAL_SAVING,
- STR_UC_PLEASE_WAIT_ID,
- IMG_GLOBAL_PROGRESS,
- 0);
- mmi_uc_entry_processing_generic();
- }
- DeleteScreenIfPresent(SCR_ID_UC_SENDING);
- addr = mmi_uc_get_addr(MMI_UC_ADDRESS_GROUP_TYPE_TO, g_uc_p->send_info.curr_send_number);
- mmi_uc_save_sms_after_send(SMSAL_STO_UNSENT, addr->addr);
- }
- break;
- }
- }
- /* send , write new mms*/
- else if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- switch (result)
- {
- case MMA_RESULT_OK:
- {
- /* Avoid user to send abort after sending rsp is received. */
- if (GetExitScrnID() == SCR_ID_UC_SENDING)
- {
- 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);
- }
- else if (g_uc_p->send_info.abort != MMI_UC_ABORT_NONE)
- {
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
- "*[UnifiedComposerMain.c] mmi_uc_action_fsm race condition for send_mms_rsp and cancel_mms_req *n"));
- g_uc_p->send_info.send_result = MMA_RESULT_FAIL_USER_CANCEL;
- mmi_uc_action_fsm(MMI_UC_ACTION_SEND, MMA_RESULT_FAIL_USER_CANCEL);
- return;
- }
- mmi_uc_clear_msg_bearer(MMI_UC_MSG_TYPE_MMS_PREFER);
- }
- break;
- case MMA_RESULT_FAIL_USER_CANCEL:
- {
- if (g_uc_p->send_info.abort == MMI_UC_ABORT_NORMAL)
- {
- mmi_uc_clear_msg_bearer(MMI_UC_MSG_TYPE_MMS_PREFER);
- }
- else if (g_uc_p->send_info.abort == MMI_UC_ABORT_BY_END_KEY)
- {
- mmi_uc_save_mms_req(g_uc_p->send_info.new_msg_id, MMA_FOLDER_OUTBOX);
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- break;
- default:
- {
- if (g_uc_p->send_info.abort != MMI_UC_ABORT_NONE)
- {
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
- "*[UnifiedComposerMain.c] mmi_uc_action_fsm race condition for send_mms_rsp and cancel_mms_req *n"));
- g_uc_p->send_info.send_result = MMA_RESULT_FAIL_USER_CANCEL;
- mmi_uc_action_fsm(MMI_UC_ACTION_SEND, MMA_RESULT_FAIL_USER_CANCEL);
- return;
- }
- /* UC Screens may be deleted by other Apps, ex. USB normal mode.*/
- /* Do not display processing screen in such cases. */
- if (IsScreenPresent(SCR_ID_UC_OPT_DONE))
- {
- mmi_uc_set_processing_screen(STR_GLOBAL_SAVING,
- STR_UC_PLEASE_WAIT_ID,
- IMG_GLOBAL_PROGRESS,
- 0);
- mmi_uc_entry_processing_generic();
- }
- DeleteScreenIfPresent(SCR_ID_UC_SENDING);
- mmi_uc_save_mms_req(g_uc_p->send_info.new_msg_id, MMA_FOLDER_OUTBOX);
- }
- break;
- }
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- break;
- /* send , write new */
- case MMI_UC_ACTION_SAVE:
- {
- if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_SMS_PREFER)
- {
- if (g_uc_p->send_info.send_result == MMI_FRM_SMS_ABORT)
- {
- if (g_uc_p->send_info.abort == MMI_UC_ABORT_BY_END_KEY)
- {
- mmi_uc_reset_msg();
- mmi_uc_clear_msg_bearer(MMI_UC_MSG_TYPE_SMS_PREFER);
- if (GetExitScrnID() == SCR_ID_UC_PROCESSING)
- {
- GoBackHistory();
- }
- else
- {
- DeleteScreenIfPresent(SCR_ID_UC_PROCESSING);
- }
- AlmEnableSPOF();
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- else
- {
- if (result == MMI_FRM_SMS_OK)
- {
- DisplayPopup(
- (PU8) GetString(STR_UC_SEND_FAIL_SAVE_SUCCESS),
- IMG_SEND_FAIL_PIC_MSG,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- }
- else
- {
- DisplayPopup(
- (PU8) GetString(STR_UC_SEND_FAIL_SAVE_FAIL),
- IMG_SEND_FAIL_PIC_MSG,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- }
- if (g_uc_p->main.state == MMI_UC_STATE_FORWARD)
- {
- mmi_uc_delete_between_screens(SCR_ID_UC_OPT_DONE, SCR_ID_UC_PROCESSING);
- }
- else
- {
- mmi_uc_delete_between_screens(SCR_ID_UC_EDITOR, SCR_ID_UC_PROCESSING);
- }
- mmi_uc_delete_sms_frm_screen();
- mmi_uc_reset_msg();
- mmi_uc_clear_msg_bearer(MMI_UC_MSG_TYPE_SMS_PREFER);
- AlmEnableSPOF();
- }
- }
- else if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- if (g_uc_p->send_info.send_result == MMA_RESULT_FAIL_USER_CANCEL)
- {
- if (g_uc_p->send_info.abort == MMI_UC_ABORT_BY_END_KEY)
- {
- mmi_uc_reset_msg();
- if (GetExitScrnID() == SCR_ID_UC_PROCESSING)
- {
- GoBackHistory();
- }
- else
- {
- DeleteScreenIfPresent(SCR_ID_UC_PROCESSING);
- }
- AlmEnableSPOF();
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- else
- {
- mmi_uc_display_mma_send_result_popup(g_uc_p->send_info.send_result);
- if (g_uc_p->main.state == MMI_UC_STATE_FORWARD)
- {
- mmi_uc_delete_between_screens(SCR_ID_UC_OPT_DONE, SCR_ID_UC_PROCESSING);
- }
- else
- {
- mmi_uc_delete_between_screens(SCR_ID_UC_EDITOR, SCR_ID_UC_PROCESSING);
- }
- mmi_uc_reset_msg();
- AlmEnableSPOF();
- }
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- break;
- /* send , write new */
- case MMI_UC_ACTION_DELETE:
- {
- if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_SMS_PREFER)
- {
- MMI_ASSERT(0);
- }
- else if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- /* Deletion may fail in USB normal mode. */
- if (g_uc_p->send_info.send_result == MMA_RESULT_FAIL_USER_CANCEL)
- {
- DisplayPopup(
- (PU8) GetString(STR_UC_ABORTED_ID),
- IMG_GLOBAL_ACTIVATED,
- 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)
- {
- mmi_uc_delete_between_screens(SCR_ID_UC_OPT_DONE_OPT, SCR_ID_UC_PROCESSING);
- }
- else
- {
- mmi_uc_delete_between_screens(SCR_ID_UC_OPT, SCR_ID_UC_PROCESSING);
- }
- AlmEnableSPOF();
- }
- else
- {
- mmi_uc_display_mma_send_result_popup(g_uc_p->send_info.send_result);
- if (g_uc_p->main.state == MMI_UC_STATE_FORWARD)
- {
- mmi_uc_delete_between_screens(SCR_ID_UC_OPT_DONE, SCR_ID_UC_SENDING);
- }
- else
- {
- mmi_uc_delete_between_screens(SCR_ID_UC_EDITOR, SCR_ID_UC_SENDING);
- }
- mmi_uc_reset_msg();
- AlmEnableSPOF();