EmailAppUIInterface.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:476k
源码类别:
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:
- * ---------
- * EmailAppUIInterface.c
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * This file implements UI interface of Email application.
- *
- * 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!
- *
- * 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!
- * 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!!
- *============================================================================
- ****************************************************************************/
- /**
- * Copyright Notice
- * ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
- * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
- * (It is illegal to remove this copyright notice from this software or any
- * portion of it)
- */
- /**************************************************************
- FILENAME : EmailAppUIInterface.c
- PURPOSE : nil
- REMARKS : nil
- AUTHOR : Magesh k
- DATE : 30-01-2004
- **************************************************************/
- #ifndef _MMI_EMAILAPPUIINTERFACE_C
- #define _MMI_EMAILAPPUIINTERFACE_C
- #include "MMI_features.h"
- #ifdef __MMI_EMAIL__
- #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 "EmailAppProt.h"
- #include "EmailAppGProt.h"
- #include "MessagesExDcl.h"
- #include "MessagesResourceData.h"
- #include "KeyBrd.h"
- #include "GlobalDefs.h"
- #include "DebugInitDef.h"
- #include "GlobalConstants.h"
- #include "FrameworkStruct.h"
- #include "EventsGprot.h"
- #include "HistoryGprot.h"
- #include "wgui_ems.h"
- #include "wgui_categories_ems.h"//062706 revise
- #include "wgui_categories.h"
- #include "wgui_status_icons.h"
- #include "CommonScreens.h"
- #include "CustDataRes.h"
- #include "SettingProfile.h"
- #include "ProfileGprots.h"
- #include "PhoneBookGprot.h"
- #include "TimerEvents.h"
- #include "PhoneBookDef.h"
- #include "FileSystemDef.h"
- #include "FileSystemGProt.h"
- #include "Conversions.h"
- #include "app_mine.h"
- #include "MemPoolContainerProt.h"
- #include "wgui_asyncdynamic_menuitems.h"
- #include "Wgui_categories_inputs.h"
- #include "Wgui_categories_defs.h"
- #include "wgui_categories_email.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"
- #ifdef __MMI_TOUCH_SCREEN__
- #include "gui_virtual_keyboard.h"
- #include "EditorPen.h"
- #endif
- #ifdef __USB_IN_NORMAL_MODE__
- #include "USBDeviceGprot.h"
- #endif
- extern void set_leading_zero(U8 u8type);
- extern void Category53ChangeItemDescription(S32 index, U8 *text);
- /***************************************************************/
- const U8 g_email_re_str[] = { 'R', ' ', 'e', ' ', ':', ' ', ' ', ' ', ' ', ' ' };
- const U8 g_email_fw_str[] = { 'F', ' ', 'w', ' ', ':', ' ', ' ', ' ', ' ', ' ' };
- const U8 g_email_subj_left_op[] = { '<', ' ', ' ', ' ' };
- const U8 g_email_subj_right_op[] = { '>', ' ', ' ', ' ' };
- const U8 g_email_3dots[] = { '.', ' ', '.', ' ', '.', ' ', ' ', ' ' };
- const S8 g_email_new_line[] = { 'n', ' ', ' ', ' ' };
- #ifdef __MMI_TOUCH_SCREEN__
- gui_virtual_keyboard_pen_enum g_email_disable_new_line[] = {GUI_VKBD_PEN_NEWLINE, GUI_VKBD_PEN_NONE};
- #endif
- extern InlineItem wgui_inline_items[];
- #define INIT_EMAIL
- /*****************************************************************************
- * FUNCTION
- * mmi_email_init_hilite_hdlr
- * DESCRIPTION
- * Initialize all highlight handlers
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_init_hilite_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Wrirte Email */
- SetHiliteHandler(MENU_ID_EMAIL_COMP_ADDR_ADD, mmi_email_hilite_comp_addr_add);
- SetHiliteHandler(MENU_ID_EMAIL_COMP_ADDR_EDIT, mmi_email_hilite_comp_addr_edit);
- SetHiliteHandler(MENU_ID_EMAIL_COMP_ADDR_DEL, mmi_email_hilite_comp_addr_del);
- SetHiliteHandler(MENU_ID_EMAIL_COMP_ADDR_DEL_ALL, mmi_email_hilite_comp_addr_del_all);
- SetHiliteHandler(MENU_ID_EMAIL_COMP_SUBJ_DONE, mmi_email_hilite_comp_subj_done);
- SetHiliteHandler(MENU_ID_EMAIL_COMP_SUBJ_INPUT_METH, mmi_email_hilite_comp_subj_input_meth);
- SetHiliteHandler(MENU_ID_EMAIL_COMP_ADDR_EDIT_OPT_DONE, mmi_email_hilite_comp_addr_done);
- SetHiliteHandler(MENU_ID_EMAIL_COMP_ADDR_EDIT_OPT_INPUT_METH, mmi_email_hilite_comp_addr_input_meth);
- SetHiliteHandler(MENU_ID_EMAIL_COMP_ATTCH_EDIT, mmi_email_hilite_comp_attach_edit);
- SetHiliteHandler(MENU_ID_EMAIL_COMP_ATTCH_VIEW, mmi_email_hilite_comp_attach_view);
- SetHiliteHandler(MENU_ID_EMAIL_COMP_ATTCH_DEL, mmi_email_hilite_comp_attach_del);
- SetHiliteHandler(MENU_ID_EMAIL_COMP_SEND, mmi_email_hilite_comp_send);
- SetHiliteHandler(MENU_ID_EMAIL_COMP_SAVE_N_SEND, mmi_email_hilite_comp_save_n_send);
- SetHiliteHandler(MENU_ID_EMAIL_COMP_SAVE_TO_DRAFT, mmi_email_hilite_comp_save_to_draft);
- SetHiliteHandler(MENU_ID_EMAIL_COMP_QUIT_NO_SAVE, mmi_email_hilite_comp_quit);
- /* Inbox */
- SetHiliteHandler(MENU_ID_EMAIL_INBOX_ADDR_OPT_SAVE, mmi_email_hilite_read_addr_save_phb);
- SetHiliteHandler(MENU_ID_EMAIL_INBOX_ADDR_OPT_SEND, mmi_email_hilite_read_addr_send);
- SetHiliteHandler(MENU_ID_EMAIL_INBOX_ATTCH_OPT_VIEW, mmi_email_hilite_read_attach_view);
- SetHiliteHandler(MENU_ID_EMAIL_INBOX_ATTCH_OPT_SAVE, mmi_email_hilite_read_attach_save);
- SetHiliteHandler(MENU_ID_EMAIL_INBOX_READ_ATTCH_SAVE_DONE, mmi_email_hilite_read_attach_save_done);
- SetHiliteHandler(MENU_ID_EMAIL_INBOX_READ_ATTCH_SAVE_INPUT_METH, mmi_email_hilite_read_attach_save_input_meth);
- SetHiliteHandler(MENU_ID_EMAIL_INBOX_OPT_REPLY, mmi_email_hilite_read_reply);
- SetHiliteHandler(MENU_ID_EMAIL_INBOX_OPT_REPLY_WITHOUT, mmi_email_hilite_read_reply_without);
- SetHiliteHandler(MENU_ID_EMAIL_INBOX_OPT_REPLY_ALL, mmi_email_hilite_read_reply_all);
- SetHiliteHandler(MENU_ID_EMAIL_INBOX_OPT_REPLY_ALL_WITHOUT, mmi_email_hilite_read_reply_all_without);
- SetHiliteHandler(MENU_ID_EMAIL_INBOX_OPT_FW, mmi_email_hilite_read_forward);
- SetHiliteHandler(MENU_ID_EMAIL_INBOX_OPT_DEL, mmi_email_hilite_fldr_msg_del);
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- SetHiliteHandler(MENU_ID_EMAIL_INBOX_OPT_READ, mmi_email_hilite_inbox_read);
- SetHiliteHandler(MENU_ID_EMAIL_INBOX_OPT_NEXT_PAGE, mmi_email_hilite_fldr_next_page);
- SetHiliteHandler(MENU_ID_EMAIL_INBOX_OPT_PREV_PAGE, mmi_email_hilite_fldr_prev_page);
- SetHiliteHandler(MENU_ID_EMAIL_INBOX_OPT_JUMP_PAGE, mmi_email_hilite_fldr_jump_to_page);
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- /* Sent */
- SetHiliteHandler(MENU_ID_EMAIL_SENT_OPT_FW, mmi_email_hilite_sent_forward);
- SetHiliteHandler(MENU_ID_EMAIL_SENT_OPT_DEL, mmi_email_hilite_fldr_msg_del);
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- SetHiliteHandler(MENU_ID_EMAIL_SENT_OPT_NEXT_PAGE, mmi_email_hilite_fldr_next_page);
- SetHiliteHandler(MENU_ID_EMAIL_SENT_OPT_PREV_PAGE, mmi_email_hilite_fldr_prev_page);
- SetHiliteHandler(MENU_ID_EMAIL_SENT_OPT_JUMP_PAGE, mmi_email_hilite_fldr_jump_to_page);
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- /* Unsent */
- SetHiliteHandler(MENU_ID_EMAIL_UNSENT_OPT_SEND, mmi_email_hilite_unsent_send);
- SetHiliteHandler(MENU_ID_EMAIL_UNSENT_OPT_SAVE_N_SEND, mmi_email_hilite_unsent_save_n_send);
- SetHiliteHandler(MENU_ID_EMAIL_UNSENT_OPT_EDIT, mmi_email_hilite_unsent_edit);
- SetHiliteHandler(MENU_ID_EMAIL_UNSENT_OPT_MOVE, mmi_email_hilite_unsent_move);
- SetHiliteHandler(MENU_ID_EMAIL_UNSENT_OPT_DEL, mmi_email_hilite_fldr_msg_del);
- /* Draft */
- SetHiliteHandler(MENU_ID_EMAIL_DRAFT_OPT_EDIT, mmi_email_hilite_draft_edit);
- SetHiliteHandler(MENU_ID_EMAIL_DRAFT_OPT_DEL, mmi_email_hilite_fldr_msg_del);
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- SetHiliteHandler(MENU_ID_EMAIL_DRAFT_OPT_NEXT_PAGE, mmi_email_hilite_fldr_next_page);
- SetHiliteHandler(MENU_ID_EMAIL_DRAFT_OPT_PREV_PAGE, mmi_email_hilite_fldr_prev_page);
- SetHiliteHandler(MENU_ID_EMAIL_DRAFT_OPT_JUMP_PAGE, mmi_email_hilite_fldr_jump_to_page);
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- /* Profile */
- SetHiliteHandler(MENU_ID_EMAIL_PROF_ACTIVATE, mmi_email_hilite_prof_activate);
- SetHiliteHandler(MENU_ID_EMAIL_PROF_EDIT, mmi_email_hilite_prof_edit);
- SetHiliteHandler(MENU_ID_EMAIL_PROF_EDIT_OPT_SETTING, mmi_email_hilite_prof_setting);
- SetHiliteHandler(MENU_ID_EMAIL_PROF_EDIT_OPT_SMTP, mmi_email_hilite_prof_smtp);
- SetHiliteHandler(MENU_ID_EMAIL_PROF_EDIT_OPT_POP3_IMAP4, mmi_email_hilite_prof_pop3_impa4);
- SetHiliteHandler(MENU_ID_EMAIL_PROF_EDIT_OPT_SIG, mmi_email_hilite_prof_sig);
- #ifdef __MMI_GPRS_FEATURES__
- SetHiliteHandler(MENU_ID_EMAIL_PROF_DATA_ACCT_OPT_GPRS, mmi_email_hilite_prof_gprs);
- SetHiliteHandler(MENU_ID_EMAIL_PROF_DATA_ACCT_OPT_GSM, mmi_email_hilite_prof_csd);
- #endif /* __MMI_GPRS_FEATURES__ */
- SetHiliteHandler(MENU_ID_EMAIL_PROF_EDITOR_OPT_DONE, mmi_email_hilite_prof_done);
- SetHiliteHandler(MENU_ID_EMAIL_PROF_EDITOR_OPT_INPUT_METH, mmi_email_hilite_prof_input_meth);
- /* Signature */
- SetHiliteHandler(MENU_ID_EMAIL_SIG_ATTCH_OPT_VIEW, mmi_email_hilite_prof_sig_view);
- SetHiliteHandler(MENU_ID_EMAIL_SIG_ATTCH_OPT_SEL, mmi_email_hilite_prof_sig_select);
- SetHiliteHandler(MENU_ID_EMAIL_SIG_ATTCH_OPT_DEL, mmi_email_hilite_prof_sig_del);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_highlight_main_menu
- * DESCRIPTION
- * Highlight handler of Email menu in Mesaage screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_highlight_main_menu(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
- SetLeftSoftkeyFunction(mmi_email_main_pre_entry, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_main_pre_entry, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_snr
- * DESCRIPTION
- * Highlight handler of Send And Receive option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_snr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->main_info.curr_menu = MMI_EMAIL_SNR;
- SetLeftSoftkeyFunction(mmi_email_main_exec_lsk, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_comp
- * DESCRIPTION
- * Highlight handler of Write Email option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_comp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->main_info.curr_menu = MMI_EMAIL_COMP;
- SetLeftSoftkeyFunction(mmi_email_main_exec_lsk, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_main_exec_lsk, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_inbox
- * DESCRIPTION
- * Highlight handler of Inbox option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_inbox(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->main_info.curr_menu = MMI_EMAIL_INBOX;
- SetLeftSoftkeyFunction(mmi_email_main_exec_lsk, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_sent
- * DESCRIPTION
- * Highlight handler of Sent option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_sent(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->main_info.curr_menu = MMI_EMAIL_SENT;
- SetLeftSoftkeyFunction(mmi_email_main_exec_lsk, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_unsent
- * DESCRIPTION
- * Highlight handler of Unsent option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_unsent(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->main_info.curr_menu = MMI_EMAIL_UNSENT;
- SetLeftSoftkeyFunction(mmi_email_main_exec_lsk, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_draft
- * DESCRIPTION
- * Highlight handler of Draft option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_draft(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->main_info.curr_menu = MMI_EMAIL_DRAFT;
- SetLeftSoftkeyFunction(mmi_email_main_exec_lsk, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_del_all
- * DESCRIPTION
- * Highlight handler of Delete All option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_del_all(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->main_info.curr_menu = MMI_EMAIL_DEL_ALL;
- SetLeftSoftkeyFunction(mmi_email_main_exec_lsk, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_prof
- * DESCRIPTION
- * Highlight handler of Profile option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_prof(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->main_info.curr_menu = MMI_EMAIL_PROF;
- SetLeftSoftkeyFunction(mmi_email_ps_list_acct_profile_req, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_ps_list_acct_profile_req, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_refresh
- * DESCRIPTION
- * Highlight handler of Refresh option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_refresh(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->main_info.curr_menu = MMI_EMAIL_REFRESH;
- SetLeftSoftkeyFunction(mmi_email_main_exec_lsk, KEY_EVENT_UP);
- }
- #define MAIN_MENU_EMAIL
- /*****************************************************************************
- * FUNCTION
- * mmi_email_main_pre_entry
- * DESCRIPTION
- * Pre-entry function of Email application.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_main_pre_entry(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((email_p->main_info.ready_state & EMAIL_READY) == EMAIL_READY)
- {
- #if !defined(__MMI_SLIM_EMAIL_NO_AUTO_CHECK__)
- if (email_p->snr_info.is_auto_chk)
- {
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_AUTO_CHECK_BUSY_ID),
- IMG_GLOBAL_WARNING,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- }
- else
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_AUTO_CHECK__) */
- {
- /* set curr folder and folder info req state */
- email_p->main_info.curr_menu = MMI_EMAIL_NONE;
- email_p->main_info.main_indx = 0;
- /* if profile is not ready, then don't allow user to connet network */
- mmi_email_fldr_reset_cntx(EMAIL_RESET_ALL_FLDR);
- if (mmi_email_prof_is_activated())
- {
- email_p->fldr_info.fldr_update_state = EMAIL_LIST_FLDR_REQUIRED;
- /* check for imap4/pop3 */
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- if (email_p->prof_info.act_prof.in_prot == EMAIL_PROT_IMAP4)
- {
- mmi_email_display_confirm(
- STR_EMAIL_COMMON_CONNECT_NETWORK_ID,
- mmi_email_main_imap4_confirm_yes,
- mmi_email_main_no_list_fldr);
- }
- else
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- mmi_email_main_start();
- }
- else
- {
- /* regarded as enter email without list folder req */
- mmi_email_main_no_list_fldr();
- }
- }
- }
- else /* email application not ready */
- {
- #ifdef __USB_IN_NORMAL_MODE__
- if (mmi_usb_is_in_mass_storage_mode())
- {
- mmi_usb_app_unavailable_popup(0); /* pass 0 will show default string */
- }
- else
- #endif /* __USB_IN_NORMAL_MODE__ */
- {
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_NOT_READY_ID),
- IMG_GLOBAL_WARNING,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- }
- }
- }
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- /*****************************************************************************
- * FUNCTION
- * mmi_email_main_imap4_confirm_yes
- * DESCRIPTION
- * Handler when the user selects "Yes" in IMAP4 confirmaion screen.
- * Enter Email main menu with list folder request.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_main_imap4_confirm_yes(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->fldr_info.fldr_update_state = EMAIL_LIST_FLDR_REQUIRED;
- mmi_email_main_start();
- }
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- /*****************************************************************************
- * FUNCTION
- * mmi_email_main_no_list_fldr
- * DESCRIPTION
- * Handler when the user selects "No" in IMAP4 confirmaion screen.
- * Enter Email main menu directly.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_main_no_list_fldr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->fldr_info.fldr_update_state = EMAIL_LIST_FLDR_NOT_REQUIRED;
- mmi_email_main_start();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_main_start
- * DESCRIPTION
- * Send start request
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_main_start(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->fldr_info.list_fldr_cause = EMAIL_LIST_FLDR_NORMAL;
- mmi_email_ps_start_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_main_back_from_history
- * DESCRIPTION
- * Go back to Email main menu.
- * If folder information changed, send list folder request first,
- * otherwise, enter Email main menu.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_main_back_from_history(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* update email main menu only when it is not in small screen redrawing process */
- if ((email_p->fldr_info.fldr_update_state == EMAIL_LIST_FLDR_REQUIRED) && (is_redrawing_old_screens() == 0))
- {
- email_p->fldr_info.list_fldr_cause = EMAIL_LIST_FLDR_BACK_MAIN;
- mmi_email_ps_list_folders_req();
- }
- else
- {
- mmi_email_entry_main();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_main
- * DESCRIPTION
- * Entry function of Email main menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_main(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 numItems = EMAIL_MAIN_MENU_TOTAL;
- U16 itemIcons[EMAIL_MAIN_MENU_TOTAL];
- U8 *nStrItemList[EMAIL_MAIN_MENU_TOTAL];
- U8 *popUpList[EMAIL_MAIN_MENU_TOTAL];
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* to free container buffer when back from folder list to main menu */
- mmi_email_util_free_container_pool();
- EntryNewScreen(SCR_ID_EMAIL_MAIN, mmi_email_exit_main_menu, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_MAIN);
- mmi_email_main_get_menu_detail(nStrItemList, itemIcons, popUpList);
- RegisterHighlightHandler(mmi_email_hilite_main_menu_item);
- /* hide refresh item */
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- if (email_p->prof_info.act_prof.in_prot == EMAIL_PROT_POP3)
- {
- numItems--;
- }
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- ShowCategory53Screen(
- STR_EMAIL_MAIN_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- (U8 **) nStrItemList,
- (U16*) itemIcons,
- (U8 **) popUpList,
- 0,
- (S32) email_p->main_info.main_indx,
- guiBuffer);
- SetRightSoftkeyFunction(mmi_email_main_quit_email, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_main_quit_email, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetDelScrnIDCallbackHandler(SCR_ID_EMAIL_MAIN, (HistoryDelCBPtr) mmi_email_main_del_callback);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_exit_main_menu
- * DESCRIPTION
- * Exit function of Email main menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_exit_main_menu(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_util_add_history(SCR_ID_EMAIL_MAIN, mmi_email_main_back_from_history);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_main_del_callback
- * DESCRIPTION
- * Callback function when main menu is deleted.
- * PARAMETERS
- * param [IN] Parameter from framework
- * RETURNS
- * void
- *****************************************************************************/
- U8 mmi_email_main_del_callback(void *param)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (param != (void*)MMI_TRUE)
- {
- /* do not send stop request if deinit request is sent */
- if ((email_p->main_info.ready_state & EMAIL_PS_INIT_DONE) == EMAIL_PS_INIT_DONE &&
- email_p->main_info.stop_cause == EMAIL_MODULE_ACTIVE_NOW)
- {
- email_p->main_info.stop_cause = EMAIL_STOP_BACK_FROM_OTHER;
- mmi_email_comp_reset_member(); /* reset email compose buffer in case the attachment is not valid anymore */
- mmi_email_ps_stop_req();
- }
- }
- return FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_main_exec_lsk
- * DESCRIPTION
- * Execute selected item in Email menu menu.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_main_exec_lsk(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* if not profile is not configured, then user can't go enter any menu except profie */
- if (mmi_email_prof_is_activated() == FALSE)
- {
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_ERROR_CODE_ACCT_NOT_CONFIG_ID),
- IMG_GLOBAL_WARNING,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- return;
- }
- /* to reset highlight index of folder */
- email_p->fldr_info.curr_mail_indx = 0;
- /* execute curr folder lask handler */
- switch (email_p->main_info.curr_menu)
- {
- case MMI_EMAIL_SNR:
- mmi_email_ps_snr_req();
- break;
- case MMI_EMAIL_COMP:
- mmi_email_comp_pre_entry();
- break;
- case MMI_EMAIL_INBOX:
- mmi_email_inbox_pre_entry();
- break;
- case MMI_EMAIL_SENT:
- case MMI_EMAIL_UNSENT:
- case MMI_EMAIL_DRAFT:
- mmi_email_fldr_pre_entry();
- break;
- case MMI_EMAIL_DEL_ALL:
- email_p->fldr_info.list_fldr_cause = EMAIL_LIST_FLDR_DEL_ALL;
- mmi_email_ps_list_folders_req();
- break;
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- case MMI_EMAIL_REFRESH:
- email_p->fldr_info.list_fldr_cause = EMAIL_LIST_FLDR_REFRESH;
- mmi_email_ps_list_folders_req();
- break;
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_main_get_menu_detail
- * DESCRIPTION
- * Get detailed information to display Email main menu.
- * PARAMETERS
- * strList [IN]
- * iconList [?]
- * hintList [IN]
- * popUpList(?) [IN/OUT] Hint list of menu items
- * itemIcons(?) [IN/OUT] Icon list of menu items
- * nStrItemList(?) [IN/OUT] String list of menu items
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_main_get_menu_detail(U8 **strList, U16 *iconList, U8 **hintList)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* initialization */
- for (i = 0; i < EMAIL_MAIN_MENU_TOTAL; i++)
- {
- strList[i] = (U8*) GetString((U16) (STR_EMAIL_SEND_AND_RECEIVE_ID + i));
- iconList[i] = IMG_EMAIL_SEND_AND_RECEIVE_ID + i;
- hintList[i] = NULL;
- }
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- if (email_p->prof_info.act_prof.in_prot == EMAIL_PROT_IMAP4)
- {
- /* sent folder */
- if (pfnUnicodeStrlen((S8*) email_p->prof_info.act_prof.sent_name))
- {
- strList[EMAIL_SENT_ENUM] = (U8*) email_p->prof_info.act_prof.sent_name;
- }
- /* draft folder */
- if (pfnUnicodeStrlen((S8*) email_p->prof_info.act_prof.draft_name))
- {
- strList[EMAIL_DRAFT_ENUM] = (U8*) email_p->prof_info.act_prof.draft_name;
- }
- }
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- hintList[EMAIL_INBOX_ENUM] = mmi_email_util_get_fldr_hint_value(EMAIL_DEL_ALL_INBOX_ENUM, MMI_EMAIL_INBOX);
- hintList[EMAIL_SENT_ENUM] = mmi_email_util_get_fldr_hint_value(EMAIL_DEL_ALL_SENT_ENUM, MMI_EMAIL_SENT);
- hintList[EMAIL_UNSENT_ENUM] = mmi_email_util_get_fldr_hint_value(EMAIL_DEL_ALL_UNSENT_ENUM, MMI_EMAIL_UNSENT);
- hintList[EMAIL_DRAFT_ENUM] = mmi_email_util_get_fldr_hint_value(EMAIL_DEL_ALL_DRAFT_ENUM, MMI_EMAIL_DRAFT);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_main_update_hint
- * DESCRIPTION
- * Update hint value of a folder.
- * PARAMETERS
- * fldr_name [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_main_update_hint(S8 fldr_name)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (GetExitScrnID() == SCR_ID_EMAIL_MAIN)
- {
- S32 index = 0;
- switch (fldr_name)
- {
- case MMI_EMAIL_INBOX:
- index = EMAIL_INBOX_ENUM;
- break;
- case MMI_EMAIL_UNSENT:
- index = EMAIL_UNSENT_ENUM;
- break;
- case MMI_EMAIL_SENT:
- index = EMAIL_SENT_ENUM;
- break;
- case MMI_EMAIL_DRAFT:
- index = EMAIL_DRAFT_ENUM;
- break;
- }
- mmi_email_util_get_fldr_hint_value((U16) index, fldr_name);
- Category53ChangeItemDescription(index, hintData[index]);
- RedrawCategoryFunction();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_main_menu_item
- * DESCRIPTION
- * Highlight handler of main menu items
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_main_menu_item(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->main_info.main_indx = (U8) index;
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- switch (index)
- {
- case EMAIL_SEND_AND_RECEIVE_ENUM:
- mmi_email_hilite_snr();
- break;
- case EMAIL_WRITE_EMAIL_ENUM:
- mmi_email_hilite_comp();
- break;
- case EMAIL_INBOX_ENUM:
- mmi_email_hilite_inbox();
- break;
- case EMAIL_SENT_ENUM:
- mmi_email_hilite_sent();
- break;
- case EMAIL_UNSENT_ENUM:
- mmi_email_hilite_unsent();
- break;
- case EMAIL_DRAFT_ENUM:
- mmi_email_hilite_draft();
- break;
- case EMAIL_DELETE_ALL_ENUM:
- mmi_email_hilite_del_all();
- break;
- case EMAIL_EMAIL_PROFILE_ENUM:
- mmi_email_hilite_prof();
- break;
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- case EMAIL_REFRESH_ENUM:
- mmi_email_hilite_refresh();
- break;
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_main_goto_idle
- * DESCRIPTION
- * Stop email application and go to idle screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_main_goto_idle(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_pre_entry_progressing(
- STR_EMAIL_MAIN_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- 0,
- 0,
- 0,
- 0,
- (U8*) GetString(STR_EMAIL_COMMON_QUITING_ID),
- (U8*) NULL,
- IMG_EMAIL_CONNECTING_ID,
- NULL,
- NULL,
- NULL,
- 0);
- email_p->main_info.stop_cause = EMAIL_STOP_GOTO_IDLE;
- mmi_email_ps_stop_req();
- #if !defined(__MMI_SLIM_EMAIL_NO_AUTO_CHECK__)
- email_p->snr_info.auto_chk_scr = 0;
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_main_quit_email
- * DESCRIPTION
- * Quit email application.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_main_quit_email(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->main_info.stop_cause = EMAIL_STOP_BACK_HIST;
- mmi_email_pre_entry_progressing(
- STR_EMAIL_MAIN_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- 0,
- 0,
- 0,
- 0,
- (U8*) GetString(STR_EMAIL_COMMON_QUITING_ID),
- (U8*) NULL,
- IMG_EMAIL_CONNECTING_ID,
- NULL,
- NULL,
- NULL,
- 0);
- mmi_email_ps_stop_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_main_quit_to_app
- * DESCRIPTION
- * Quit email application and go back to previous application.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_main_quit_to_app(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->main_info.stop_cause = EMAIL_STOP_BACK_FROM_OTHER;
- mmi_email_ps_stop_req();
- }
- #define COMMON_SCR_UTIL_EMAIL
- /*****************************************************************************
- * FUNCTION
- * mmi_email_pre_entry_progressing
- * DESCRIPTION
- * Pre-entry function for progressing screen
- * PARAMETERS
- * strCaption [IN]
- * imgCaption [IN]
- * strLsk [IN]
- * imgLsk [IN]
- * strRsk [IN]
- * imgRsk [IN]
- * strBody1 [?]
- * strBody2 [?]
- * imgBody [IN]
- * lskFuncPtr [IN]
- * rskFuncPtr [IN]
- * endFuncPtr [IN]
- * leftAlign [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_pre_entry_progressing(
- U16 strCaption,
- U16 imgCaption,
- U16 strLsk,
- U16 imgLsk,
- U16 strRsk,
- U16 imgRsk,
- U8 *strBody1,
- U8 *strBody2,
- U16 imgBody,
- FuncPtr lskFuncPtr,
- FuncPtr rskFuncPtr,
- FuncPtr endFuncPtr,
- S8 leftAlign)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->misc_info.progress_info.strCaption = strCaption;
- email_p->misc_info.progress_info.imgCaption = imgCaption;
- email_p->misc_info.progress_info.strLsk = strLsk;
- email_p->misc_info.progress_info.imgLsk = imgLsk;
- email_p->misc_info.progress_info.strRsk = strRsk;
- email_p->misc_info.progress_info.imgRsk = imgRsk;
- email_p->misc_info.progress_info.strBody1 = strBody1;
- email_p->misc_info.progress_info.strBody2 = strBody2;
- email_p->misc_info.progress_info.imgBody = imgBody;
- email_p->misc_info.progress_info.lskFuncPtr = lskFuncPtr;
- email_p->misc_info.progress_info.rskFuncPtr = rskFuncPtr;
- email_p->misc_info.progress_info.endFuncPtr = endFuncPtr;
- email_p->misc_info.progress_info.leftAlign = leftAlign;
- if (mmi_email_util_is_call_interrupt_allow())
- {
- mmi_email_entry_progressing();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_progressing
- * DESCRIPTION
- * Common entry function for all progressing screens.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_progressing(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_PROGRESS, mmi_email_exit_progressing, NULL, NULL);
- mmi_email_util_clear_end_key_hdlr();
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_PROGRESS);
- if (email_p->misc_info.progress_info.leftAlign)
- {
- Setcategory154LeftAlign();
- }
- ShowCategory154Screen(
- email_p->misc_info.progress_info.strCaption,
- email_p->misc_info.progress_info.imgCaption,
- email_p->misc_info.progress_info.strLsk,
- email_p->misc_info.progress_info.imgLsk,
- email_p->misc_info.progress_info.strRsk,
- email_p->misc_info.progress_info.imgRsk,
- (U8*) email_p->misc_info.progress_info.strBody1,
- (U8*) email_p->misc_info.progress_info.strBody2,
- email_p->misc_info.progress_info.imgBody,
- guiBuffer);
- SetLeftSoftkeyFunction(email_p->misc_info.progress_info.lskFuncPtr, KEY_EVENT_UP);
- SetRightSoftkeyFunction(email_p->misc_info.progress_info.rskFuncPtr, KEY_EVENT_UP);
- SetKeyHandler(email_p->misc_info.progress_info.endFuncPtr, KEY_END, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_exit_progressing
- * DESCRIPTION
- * Common exit function for all progressing screens.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_exit_progressing(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!IsScreenPresent(SCR_ID_EMAIL_PROGRESS))
- {
- mmi_email_util_add_history(SCR_ID_EMAIL_PROGRESS, mmi_email_entry_progressing);
- }
- }
- #define SEND_N_RECV_EMAIL
- #if !defined(__MMI_SLIM_EMAIL_NO_AUTO_CHECK__)
- /*****************************************************************************
- * FUNCTION
- * mmi_email_auto_chk_update_scr
- * DESCRIPTION
- * Update screen when auto-check process finished.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_auto_chk_update_scr(void) // #ifdef __MMI_SLIM_EMAIL_NO_AUTO_CHECK__
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearKeyEvents();
- if (mmi_email_util_is_key_locked())
- {
- EntryIdleScreen();
- }
- else
- {
- mmi_email_pre_entry_new_mail_ind();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_util_is_new_mail
- * DESCRIPTION
- * Get the status of new mail indication
- * PARAMETERS
- * void
- * RETURNS
- * TRUE if there is any new mail indication to be displayed in IDLE;
- * otherwise, FALSE.
- *****************************************************************************/
- U8 mmi_email_util_is_new_mail(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return email_p->snr_info.new_mail_ind;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_auto_chk_result
- * DESCRIPTION
- * Update screen when auto-check process finished.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_auto_chk_result(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_pre_entry_new_mail_ind();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_pre_entry_new_mail_ind
- * DESCRIPTION
- * Pre-Entry function of new mail indication screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_pre_entry_new_mail_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 ansiiTempBuff[10];
- U8 ucs2TempBuff[10 * ENCODING_LENGTH];
- S32 len;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Sent buffer */
- sprintf((S8*) ansiiTempBuff, ":%u", email_p->snr_info.num_sent);
- len = strlen((S8*) ansiiTempBuff);
- AnsiiNToUnicodeString((S8*) ucs2TempBuff, (S8*) ansiiTempBuff, len);
- memset(&ucs2TempBuff[len * ENCODING_LENGTH], 0, ENCODING_LENGTH);
- pfnUnicodeStrcpy((S8*) email_p->snr_info.sent_buff, (S8*) GetString(STR_EMAIL_COMMON_SENT_ID));
- pfnUnicodeStrcat((S8*) email_p->snr_info.sent_buff, (S8*) ucs2TempBuff);
- pfnUnicodeStrcat((S8*) email_p->snr_info.sent_buff, (S8*) GetString(STR_EMAIL_MAILS_ID));
- /* Received buffer */
- sprintf((S8*) ansiiTempBuff, ":%u ", email_p->snr_info.num_recv);
- len = strlen((S8*) ansiiTempBuff);
- AnsiiNToUnicodeString((S8*) ucs2TempBuff, (S8*) ansiiTempBuff, len);
- memset(&ucs2TempBuff[len * ENCODING_LENGTH], 0, ENCODING_LENGTH);
- pfnUnicodeStrcpy((S8*) email_p->snr_info.recv_buff, (S8*) GetString(STR_EMAIL_RECEIVED_ID));
- pfnUnicodeStrcat((S8*) email_p->snr_info.recv_buff, (S8*) ucs2TempBuff);
- pfnUnicodeStrcat((S8*) email_p->snr_info.recv_buff, (S8*) GetString(STR_EMAIL_MAILS_ID));
- mmi_email_entry_new_mail_ind();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_new_mail_ind
- * DESCRIPTION
- * Display New Email indication screen in IDLE screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_new_mail_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_NEW_MAIL_IND, NULL, mmi_email_entry_new_mail_ind, NULL);
- ShowCategory154Screen(
- STR_EMAIL_NEW_EMAILS_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_EMAIL_READ_ID,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- (U8*) email_p->snr_info.sent_buff,
- (U8*) email_p->snr_info.recv_buff,
- IMG_EMAIL_REPORT_ID,
- NULL);
- SetLeftSoftkeyFunction(mmi_email_list_inbox_from_idle, KEY_EVENT_UP);
- SetRightSoftkeyFunction(mmi_email_go_back_to_idle, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_go_back_to_idle, KEY_END, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_list_inbox_from_idle
- * DESCRIPTION
- * Entry Inbox from IDLE screen (auto-check)
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_list_inbox_from_idle(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((email_p->main_info.ready_state & EMAIL_READY) == EMAIL_READY)
- {
- email_p->main_info.entry_src = EMAIL_FROM_IDLE;
- email_p->main_info.curr_menu = MMI_EMAIL_INBOX;
- mmi_email_ps_start_req();
- }
- else /* email application not ready */
- {
- #ifdef __USB_IN_NORMAL_MODE__
- if (mmi_usb_is_in_mass_storage_mode())
- {
- mmi_usb_app_unavailable_popup(0); /* pass 0 will show default string */
- }
- else
- #endif /* __USB_IN_NORMAL_MODE__ */
- {
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_NOT_READY_ID),
- IMG_GLOBAL_WARNING,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_go_back_to_idle
- * DESCRIPTION
- * Go back to idle screen in auto-check indication.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_go_back_to_idle(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->snr_info.new_mail_ind = FALSE;
- DisplayIdleScreen();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_snr_key_lock_result
- * DESCRIPTION
- * Display result screen when keypad is locked
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_snr_key_lock_result(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_snr_prepare_result_data();
- ShowCategory154Screen(
- 0,
- 0,
- 0,
- 0,
- KEYPAD_LOCKED_RSK_TEXT,
- 0,
- (U8*) email_p->snr_info.sent_buff,
- (U8*) email_p->snr_info.recv_buff,
- IMG_EMAIL_REPORT_ID,
- NULL);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_auto_chk_go_back
- * DESCRIPTION
- * Back key handler of send and receive result if it's not in Email application
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_auto_chk_go_back(void) // #ifdef __MMI_SLIM_EMAIL_NO_AUTO_CHECK__
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (email_p->snr_info.auto_chk_scr)
- {
- GoBackToHistory(email_p->snr_info.auto_chk_scr);
- }
- else
- {
- DeleteScreenIfPresent(SCR_ID_EMAIL_PROGRESS);
- GoBackHistory();
- }
- email_p->snr_info.auto_chk_scr = 0;
- }
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_AUTO_CHECK__) */
- /*****************************************************************************
- * FUNCTION
- * mmi_email_snr_back_to_main
- * DESCRIPTION
- * Back key handler of send and receive result if it's in Email application
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_snr_back_to_main(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* do not delete other application's screen */
- // GoBackToHistory(SCR_ID_EMAIL_MAIN);
- DeleteScreenIfPresent(SCR_ID_EMAIL_PROGRESS);
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_snr_detail
- * DESCRIPTION
- * Entry detailed result screen of send and receive
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_snr_detail(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 snr_icons[EMAIL_REPORT_TOTAL_ITEM] =
- {
- IMG_EMAIL_SENT_CAPTION_REPORT_ID, 0,
- IMG_EMAIL_RECEIVED_CAPTION_REPORT_ID, 0
- };
- U8 *guiBuffer;
- U8 *inputBuffer;
- U16 inputBufferSize;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_SNR_DETAIL, mmi_email_exit_snr_detail, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_SNR_DETAIL);
- inputBuffer = GetCurrNInputBuffer(SCR_ID_EMAIL_SNR_DETAIL, &inputBufferSize);
- InitializeCategory57Screen();
- mmi_email_snr_fill_inline_struct();
- if (inputBuffer != NULL)
- {
- SetCategory57Data(wgui_inline_items, EMAIL_REPORT_TOTAL_ITEM, inputBuffer);
- }
- ShowCategory57Screen(
- STR_EMAIL_COMMON_DETAIL_RESULT_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- 0,
- 0,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- EMAIL_REPORT_TOTAL_ITEM,
- (U16*) snr_icons,
- wgui_inline_items,
- 0,
- guiBuffer);
- SetCategory57RightSoftkeyFunctions(NULL, mmi_email_snr_back_from_result);
- SetKeyHandler(mmi_email_main_goto_idle, KEY_END, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_exit_snr_detail
- * DESCRIPTION
- * Exit detailed result screen of send and receive
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_exit_snr_detail(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!IsScreenPresent(SCR_ID_EMAIL_PROGRESS))
- {
- mmi_email_util_add_n_history(SCR_ID_EMAIL_SNR_DETAIL, mmi_email_entry_snr_detail);
- }
- else
- {
- HistoryReplace(SCR_ID_EMAIL_PROGRESS, SCR_ID_EMAIL_SNR_DETAIL, mmi_email_entry_snr_detail);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_snr_prepare_result_data
- * DESCRIPTION
- * Fill string buffer for result screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_snr_prepare_result_data(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 len;
- U8 *ansiiTempBuff = OslMalloc(EMAIL_MAX_SNR_RESULT_LEN * ENCODING_LENGTH);
- U8 *ucs2TempBuff = OslMalloc(EMAIL_MAX_SNR_RESULT_LEN * ENCODING_LENGTH);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* sent string */
- sprintf((S8*) ansiiTempBuff, ": %u ", email_p->snr_info.num_sent);
- len = strlen((S8*) ansiiTempBuff);
- AnsiiNToUnicodeString((S8*) ucs2TempBuff, (S8*) ansiiTempBuff, len);
- ucs2TempBuff[len * ENCODING_LENGTH] = ' ';
- ucs2TempBuff[len * ENCODING_LENGTH + 1] = ' ';
- pfnUnicodeStrcpy((S8*) email_p->snr_info.sent_buff, (S8*) GetString(STR_EMAIL_COMMON_SENT_ID));
- pfnUnicodeStrcat((S8*) email_p->snr_info.sent_buff, (S8*) ucs2TempBuff);
- pfnUnicodeStrcat((S8*) email_p->snr_info.sent_buff, (S8*) GetString(STR_EMAIL_MAILS_ID));
- /* received string */
- sprintf((S8*) ansiiTempBuff, ": %u ", email_p->snr_info.num_recv);
- len = strlen((S8*) ansiiTempBuff);
- AnsiiNToUnicodeString((S8*) ucs2TempBuff, (S8*) ansiiTempBuff, len);
- ucs2TempBuff[len * ENCODING_LENGTH] = ' ';
- ucs2TempBuff[len * ENCODING_LENGTH + 1] = ' ';
- pfnUnicodeStrcpy((S8*) email_p->snr_info.recv_buff, (S8*) GetString(STR_EMAIL_RECEIVED_ID));
- pfnUnicodeStrcat((S8*) email_p->snr_info.recv_buff, (S8*) ucs2TempBuff);
- pfnUnicodeStrcat((S8*) email_p->snr_info.recv_buff, (S8*) GetString(STR_EMAIL_MAILS_ID));
- OslMfree(ansiiTempBuff);
- OslMfree(ucs2TempBuff);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_snr_display_result
- * DESCRIPTION
- * Display result screen of according to the error state of Send and Receive
- * PARAMETERS
- * entryFuncPtrGoBackTo [IN] Function for "Back" key
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_snr_display_result(FuncPtr entryFuncPtrGoBackTo)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- FuncPtr fPtr = NULL;
- U16 StrRsk = 0;
- U16 ImgRsk = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (email_p->snr_info.sent_err_str || email_p->snr_info.recv_err_str)
- {
- fPtr = mmi_email_entry_snr_detail;
- StrRsk = STR_EMAIL_COMMON_DETAILS_ID;
- ImgRsk = IMG_GLOBAL_BACK;
- }
- mmi_email_pre_entry_progressing(
- STR_EMAIL_SEND_AND_RECEIVE_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- StrRsk,
- ImgRsk,
- (U8*) email_p->snr_info.sent_buff,
- (U8*) email_p->snr_info.recv_buff,
- IMG_EMAIL_REPORT_ID,
- entryFuncPtrGoBackTo,
- fPtr,
- mmi_email_main_goto_idle,
- 1);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_snr_fill_inline_struct
- * DESCRIPTION
- * Fill inline structure for Detailed screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_snr_fill_inline_struct(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 len;
- U8 *ansiiTempBuff = OslMalloc(EMAIL_MAX_SNR_RESULT_LEN * ENCODING_LENGTH);
- U8 *ucs2TempBuff = OslMalloc(EMAIL_MAX_SNR_RESULT_LEN * ENCODING_LENGTH);
- S8 ucs2ComaBuff[] = { ',', ' ', ' ', ' ', ' ', ' ' };
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* sent string */
- sprintf((S8*) ansiiTempBuff, "%u/%u ", email_p->snr_info.num_sent, email_p->snr_info.num_to_be_sent);
- len = strlen((S8*) ansiiTempBuff);
- AnsiiNToUnicodeString((S8*) ucs2TempBuff, (S8*) ansiiTempBuff, len);
- ucs2TempBuff[len * ENCODING_LENGTH] = ' ';
- ucs2TempBuff[len * ENCODING_LENGTH + 1] = ' ';
- pfnUnicodeStrcpy((S8*) email_p->snr_info.sent_buff, (S8*) ucs2TempBuff);
- pfnUnicodeStrcat((S8*) email_p->snr_info.sent_buff, (S8*) GetString(STR_EMAIL_MAILS_ID));
- if (email_p->snr_info.sent_err_str)
- {
- pfnUnicodeStrcat((S8*) email_p->snr_info.sent_buff, (S8*) ucs2ComaBuff);
- pfnUnicodeStrcat((S8*) email_p->snr_info.sent_buff, (S8*) GetString(email_p->snr_info.sent_err_str));
- }
- /* received string */
- sprintf((S8*) ansiiTempBuff, "%u/%u ", email_p->snr_info.num_recv, email_p->snr_info.num_to_be_recv);
- len = strlen((S8*) ansiiTempBuff);
- AnsiiNToUnicodeString((S8*) ucs2TempBuff, (S8*) ansiiTempBuff, len);
- ucs2TempBuff[len * ENCODING_LENGTH] = ' ';
- ucs2TempBuff[len * ENCODING_LENGTH + 1] = ' ';
- pfnUnicodeStrcpy((S8*) email_p->snr_info.recv_buff, (S8*) ucs2TempBuff);
- pfnUnicodeStrcat((S8*) email_p->snr_info.recv_buff, (S8*) GetString(STR_EMAIL_MAILS_ID));
- if (email_p->snr_info.recv_err_str)
- {
- pfnUnicodeStrcat((S8*) email_p->snr_info.recv_buff, (S8*) ucs2ComaBuff);
- pfnUnicodeStrcat((S8*) email_p->snr_info.recv_buff, (S8*) GetString(email_p->snr_info.recv_err_str));
- }
- /* sent caption */
- SetInlineItemActivation(&wgui_inline_items[0], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemCaption(&wgui_inline_items[0], (U8*) GetString(STR_EMAIL_COMMON_SENT_ID));
- /* sent result */
- SetInlineItemActivation(&wgui_inline_items[1], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemDisplayOnly(&wgui_inline_items[1], (U8*) email_p->snr_info.sent_buff);
- /* received caption */
- SetInlineItemActivation(&wgui_inline_items[2], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemCaption(&wgui_inline_items[2], (U8*) GetString(STR_EMAIL_RECEIVED_ID));
- /* received result */
- SetInlineItemActivation(&wgui_inline_items[3], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemDisplayOnly((&wgui_inline_items[3]), (U8*) email_p->snr_info.recv_buff);
- OslMfree(ansiiTempBuff);
- OslMfree(ucs2TempBuff);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_snr_back_from_result
- * DESCRIPTION
- * Back from Detail Result screen to Email main menu.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_snr_back_from_result(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if 0
- /* under construction !*/
- #endif
- DeleteScreenIfPresent(SCR_ID_EMAIL_PROGRESS);
- GoBackHistory();
- }
- #define WRITE_EMAIL
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_comp_addr_add
- * DESCRIPTION
- * Highlight handler of Write Email->To/CC->Add option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_comp_addr_add(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_comp_addr_pre_add, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_comp_addr_pre_add, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_comp_addr_edit
- * DESCRIPTION
- * Highlight handler of Write Email->To/CC->Edit option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_comp_addr_edit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_comp_addr_pre_edit, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_comp_addr_pre_edit, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_comp_addr_del
- * DESCRIPTION
- * Highlight handler of Write Email->To/CC->Delete option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_comp_addr_del(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_comp_addr_del, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_comp_addr_del_all
- * DESCRIPTION
- * Highlight handler of Write Email->To/CC->Delete All option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_comp_addr_del_all(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_comp_addr_del_all, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_comp_subj_done
- * DESCRIPTION
- * Highlight handler of Done option in full screen editor of Write Email->Subject
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_comp_subj_done(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_comp_subj_cont_done, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_comp_subj_input_meth
- * DESCRIPTION
- * Highlight handler of Input Method option in full screen editor of Write Email->Subject
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_comp_subj_input_meth(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(EntryInputMethodScreen, KEY_EVENT_UP);
- SetKeyHandler(EntryInputMethodScreen, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- RegisterInputMethodScreenCloseFunction(mmi_email_util_go_back_2_hist);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_comp_addr_done
- * DESCRIPTION
- * Highlight handler of Done option in full screen editor of
- * Write Email->To/CC-> Option -> Done
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_comp_addr_done(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_comp_addr_input_done, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_comp_addr_input_meth
- * DESCRIPTION
- * Highlight handler of Input Method option in full screen editor of Write Email->To/CC
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_comp_addr_input_meth(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(EntryInputMethodScreen, KEY_EVENT_UP);
- SetKeyHandler(EntryInputMethodScreen, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- RegisterInputMethodScreenCloseFunction(mmi_email_util_go_back_2_hist);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_comp_attach_edit
- * DESCRIPTION
- * Highlight handler of Write Email->Attachment->Edit option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_comp_attach_edit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_comp_add_attach, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_comp_add_attach, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_comp_attach_view
- * DESCRIPTION
- * Highlight handler of Write Email->Attachment->View option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_comp_attach_view(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_comp_pre_entry_view_attach, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_comp_pre_entry_view_attach, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_comp_attach_del
- * DESCRIPTION
- * Highlight handler of Write Email->Attachment->Delete option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_comp_attach_del(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_comp_attch_del, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_comp_send
- * DESCRIPTION
- * Highlight handler of Write Email->Send option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_comp_send(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_ps_send_only_req, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_comp_save_n_send
- * DESCRIPTION
- * Highlight handler of Write Email->Save and Send option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_comp_save_n_send(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_ps_save_and_send_req, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_comp_save_to_draft
- * DESCRIPTION
- * Highlight handler of Write Email->Save To Draft option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_comp_save_to_draft(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_ps_save_to_draft_req, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_comp_quit
- * DESCRIPTION
- * Highlight handler of Write Email->Quit option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_comp_quit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_comp_opt_quit, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_pre_entry
- * DESCRIPTION
- * Pre-Entry function of Write Email screen.
- * Reset attachment and add siganture if the mail is not composed yet.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_pre_entry(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->comp_info.done_flag = FALSE;
- /* if previous-written mail is not sent/saved */
- if (!mmi_email_comp_get_done_status())
- {
- /* default attach info */
- mmi_email_comp_reset_member();
- /* put signature in the third attachment */
- if (mmi_email_comp_add_sig() == FALSE)
- {
- return;
- }
- /* entry Write Email screen after signature copy complete */
- }
- mmi_email_entry_comp();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_add_sig
- * DESCRIPTION
- * Add signature attachment into Write Email screen.
- * PARAMETERS
- * void
- * RETURNS
- * TRUE if the called can entrr Write Email screen directly; otherwise, FALSE.
- *****************************************************************************/
- BOOL mmi_email_comp_add_sig(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (email_p->prof_info.act_prof.sig_status) /* if signaure is on, insert into Write Email screen */
- {
- /* signature text */
- if (pfnUnicodeStrlen((S8*) email_p->prof_info.act_prof.sig_buff))
- {
- /* copy text data with new line char */
- pfnUnicodeStrcpy((S8*) email_p->comp_info.cont_buff, (S8*) g_email_new_line);
- pfnUnicodeStrcat((S8*) email_p->comp_info.cont_buff, (S8*) email_p->prof_info.act_prof.sig_buff);
- }
- /* image */
- if (pfnUnicodeStrlen((S8*) email_p->prof_info.act_prof.sig_img))
- {
- S8 *fileExt;
- S8 *tmp_file = OslMalloc((FMGR_MAX_PATH_LEN + 1) * ENCODING_LENGTH);
- /* insert image to the last slot of attachments */
- S32 i = (MMI_EMAIL_MAX_NUM_ATTACH - 1);
- /* file extension */
- fileExt = mmi_email_get_file_ext((S8*) email_p->prof_info.act_prof.sig_img);
- /* destination file name */
- mmi_email_util_get_attch_name((U8) (i + 1), (S8*) email_p->comp_info.attch_list[i].file_path);
- pfnUnicodeStrcat((S8*) email_p->comp_info.attch_list[i].file_path, (S8*) fileExt);
- /* source file name */
- mmi_email_util_get_sig_name((U8) (email_p->prof_info.act_prof.act_indx + 1), (S8*) tmp_file);
- pfnUnicodeStrcat((S8*) tmp_file, (S8*) fileExt);
- pfnUnicodeStrcpy((S8*) email_p->comm_buff, (S8*) tmp_file);
- email_p->misc_info.file_copy_state = EMAIL_FILE_ADD_SIG;
- mmi_email_pre_entry_progressing(
- STR_EMAIL_MAIN_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- 0,
- 0,
- 0,
- 0,
- (U8*) GetString(STR_EMAIL_COMMON_LOADING_ID),
- (U8*) NULL,
- IMG_GLOBAL_PROGRESS,
- NULL,
- NULL,
- NULL,
- 0);
- DeleteScreenIfPresent(SCR_ID_EMAIL_PROGRESS);
- FS_Delete((U16*) email_p->comp_info.attch_list[i].file_path);
- mmi_fmgr_send_copy_req(
- FMGR_ACTION_COPY,
- (U8*) email_p->comm_buff,
- (U8*) email_p->comp_info.attch_list[i].file_path,
- mmi_email_comp_attach_copy_callback);
- OslMfree(tmp_file);
- return FALSE;
- }
- }
- return TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_reset_member
- * DESCRIPTION
- * Reset variables of Write Email screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_reset_member(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(&email_p->comp_info, 0, sizeof(mmi_email_comp_info_struct));
- email_p->misc_info.curr_hilite_attch = 0;
- /* set <Empty> string for all attachments */
- for (i = 0; i < MMI_EMAIL_MAX_NUM_ATTACH; i++)
- {
- pfnUnicodeStrcpy((S8*) email_p->comp_info.attch_list[i].file_name, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
- }
- reset_inscreen_multi_line_input_box_changed();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_comp
- * DESCRIPTION
- * Entry function of Write Email screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_comp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U8 *inputBuffer;
- U16 inputBufferSize;
- U16 comp_icons[EMAIL_COMP_TOTAL] =
- {
- IMG_EMAIL_TO_ID,
- IMG_EMAIL_CC_ID,
- IMG_EMAIL_SUBJECT_ID,
- IMG_EMAIL_ATTACHMENT_ID,
- IMG_EMAIL_PRIORITY_ID,
- 0
- };
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_COMP, mmi_email_exit_comp, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_COMP);
- inputBuffer = GetCurrNInputBuffer(SCR_ID_EMAIL_COMP, &inputBufferSize);
- InitializeCategory57Screen();
- mmi_email_comp_fill_inline_struct();
- RegisterHighlightHandler(mmi_email_hilite_comp_inline_item);
- if (inputBuffer != NULL)
- {
- SetCategory57Data(wgui_inline_items, EMAIL_COMP_TOTAL, inputBuffer);
- }
- SetHighlightedAttachment(&wgui_inline_items[EMAIL_COMP_ATTCH], email_p->misc_info.curr_hilite_attch);
- /* fill attachment images */
- mmi_email_comp_fill_attach();
- if (email_p->comp_info.attch_exceed)
- {
- email_p->comp_info.curr_inline_item = EMAIL_COMP_ATTCH;
- }
- else if (email_p->comp_info.cont_exceed)
- {
- email_p->comp_info.curr_inline_item = EMAIL_COMP_CONT;
- }
- ShowCategory57Screen(
- STR_EMAIL_TO_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_EDIT,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- EMAIL_COMP_TOTAL,
- (U16*) comp_icons,
- wgui_inline_items,
- email_p->comp_info.curr_inline_item,
- guiBuffer);
- SetCategory57RightSoftkeyFunctions(mmi_email_entry_comp_opt, mmi_email_comp_back_to_hist);
- /* display "message too long!" only if "content" is truncated, due to memory limitation */
- if (email_p->comp_info.attch_exceed)
- {
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_ATTACH_TOO_LARGE),
- IMG_GLOBAL_EMPTY,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) EMPTY_LIST_TONE);
- }
- else if (email_p->comp_info.cont_exceed)
- {
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_CONTENT_MESSAGE_TOO_ID),
- IMG_GLOBAL_EMPTY,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) EMPTY_LIST_TONE);
- }
- email_p->comp_info.attch_exceed = FALSE;
- email_p->comp_info.cont_exceed = FALSE;
- /* forward an attachment from file manager and plug-out memory card will directly go to file manager main screen
- without sending stop_req to email, which will cause email serious problem.
- therefore, if SCR_ID_EMAIL_COMP is deleted from history, email should send stop_req */
- if (email_p->main_info.entry_src == EMAIL_FROM_APP)
- {
- SetDelScrnIDCallbackHandler(SCR_ID_EMAIL_COMP, (HistoryDelCBPtr) mmi_email_main_del_callback);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_exit_comp
- * DESCRIPTION
- * Exit function of Write Email screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_exit_comp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_util_add_n_history(SCR_ID_EMAIL_COMP, mmi_email_entry_comp);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_back_to_hist
- * DESCRIPTION
- * Go back from Write Email screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_back_to_hist(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (email_p->main_info.entry_src != EMAIL_FROM_APP)
- {
- GoBackHistory();
- }
- else
- {
- mmi_email_main_quit_email();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_fill_inline_struct
- * DESCRIPTION
- * Fill inline struct for Write Email
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_fill_inline_struct(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Priority */
- email_p->misc_info.priority_list[0] = (U8*) GetString(STR_EMAIL_PRIORITY_MEDIUM_ID);
- email_p->misc_info.priority_list[1] = (U8*) GetString(STR_EMAIL_PRIORITY_LOW_ID);
- email_p->misc_info.priority_list[2] = (U8*) GetString(STR_EMAIL_PRIORITY_HIGH_ID);
- /* TO */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_COMP_TO], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemImageText(
- &(wgui_inline_items[EMAIL_COMP_TO]),
- (U8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_TO],
- (PU8) GetImage(IMG_EMAIL_TO_ID),
- (PU8) GetImage(IMG_EMAIL_LEFT_BRACKET_ID),
- (PU8) GetImage(IMG_EMAIL_RIGHT_BRACKET_ID),
- sizeof(email_p->inbox_info.read_info.addr_disp_buff[EMAIL_ADDR_TO]),
- STR_EMAIL_TO_ID,
- 0,
- INPUT_TYPE_USE_ENCODING_BASED_LENGTH | INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
- SetInlineFullScreenEditCustomFunctionImageText(&(wgui_inline_items[EMAIL_COMP_TO]), mmi_email_comp_pre_entry_addr);
- ShowAsControl(&(wgui_inline_items[EMAIL_COMP_TO]));
- /* CC */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_COMP_CC], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemImageText(
- &(wgui_inline_items[EMAIL_COMP_CC]),
- (U8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_CC],
- (PU8) GetImage(IMG_EMAIL_CC_ID),
- (PU8) GetImage(IMG_EMAIL_LEFT_BRACKET_ID),
- (PU8) GetImage(IMG_EMAIL_RIGHT_BRACKET_ID),
- sizeof(email_p->comp_info.addr_disp_buff[EMAIL_ADDR_CC]),
- STR_EMAIL_CC_ID,
- 0,
- INPUT_TYPE_USE_ENCODING_BASED_LENGTH | INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
- SetInlineFullScreenEditCustomFunctionImageText(&(wgui_inline_items[EMAIL_COMP_CC]), mmi_email_comp_pre_entry_addr);
- ShowAsControl(&(wgui_inline_items[EMAIL_COMP_CC]));
- /* SUBJECT */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_COMP_SUBJ], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemImageText(
- &(wgui_inline_items[EMAIL_COMP_SUBJ]),
- (U8*) email_p->comp_info.subj_buff,
- (PU8) GetImage(IMG_EMAIL_SUBJECT_ID),
- (PU8) GetImage(IMG_EMAIL_LEFT_BRACKET_ID),
- (PU8) GetImage(IMG_EMAIL_RIGHT_BRACKET_ID),
- (EMAIL_COMP_SUBJ_LEN + 1),
- STR_EMAIL_SUBJECT_ID,
- 0,
- INPUT_TYPE_USE_ENCODING_BASED_LENGTH | INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
- SetInlineFullScreenEditCustomFunctionImageText(&(wgui_inline_items[EMAIL_COMP_SUBJ]), mmi_email_entry_comp_subj);
- ShowAsControl(&(wgui_inline_items[EMAIL_COMP_SUBJ]));
- /* ATTACHMENT */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_COMP_ATTCH], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemImageAttachment(
- &wgui_inline_items[EMAIL_COMP_ATTCH],
- (PU8) GetImage(IMG_EMAIL_ATTACHMENT_ID),
- (PU8) GetImage(IMG_EMAIL_LEFT_BRACKET_ID),
- (PU8) GetImage(IMG_EMAIL_RIGHT_BRACKET_ID),
- STR_EMAIL_ATTACHMENT_ID,
- 0,
- email_p->misc_info.curr_hilite_attch);
- RegisterAttachmentHighlightedFunction(&wgui_inline_items[EMAIL_COMP_ATTCH], mmi_email_hilite_comp_attch);
- RegisterAttachmentLskFunction(&wgui_inline_items[EMAIL_COMP_ATTCH], mmi_email_comp_attach_lsk_func);
- RegisterAttachmentRskFunction(&wgui_inline_items[EMAIL_COMP_ATTCH], mmi_email_comp_attach_rsk_func);
- /* PRIORITY */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_COMP_PRIOTRIY], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemActivation(&wgui_inline_items[EMAIL_COMP_PRIOTRIY], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemSelect(
- &wgui_inline_items[EMAIL_COMP_PRIOTRIY],
- EMAIL_MAX_PRIORITY_ITEM,
- email_p->misc_info.priority_list,
- &email_p->comp_info.priority_indx);
- ShowAsControl(&(wgui_inline_items[EMAIL_COMP_PRIOTRIY]));
- /* CONTENT */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_COMP_CONT], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineMultiLineRdOnly(
- &wgui_inline_items[EMAIL_COMP_CONT],
- (U8*) email_p->comp_info.cont_buff,
- pfnUnicodeStrlen((S8*) email_p->comp_info.cont_buff),
- INPUT_TYPE_USE_ENCODING_BASED_LENGTH | INPUT_TYPE_ALPHANUMERIC_SENTENCECASE,
- 7);
- DisableInlineItemHighlight(&wgui_inline_items[EMAIL_COMP_CONT]);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_change_rsk
- * DESCRIPTION
- * Change right soft key according to current state of inline edior screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_change_rsk(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (mmi_email_comp_get_done_status())
- {
- ChangeRightSoftkey(STR_GLOBAL_DONE, 0);
- SetRightSoftkeyFunction(mmi_email_entry_comp_opt, KEY_EVENT_UP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_get_done_status
- * DESCRIPTION
- * Pre-Entry function of Write Email screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- BOOL mmi_email_comp_get_done_status(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (email_p->comp_info.done_flag == FALSE)
- {
- if (email_p->comp_info.addr_list[EMAIL_ADDR_TO].num_addr ||
- email_p->comp_info.addr_list[EMAIL_ADDR_CC].num_addr ||
- email_p->comp_info.total_attch ||
- pfnUnicodeStrlen((S8*) email_p->comp_info.subj_buff) ||
- (email_p->comp_info.priority_indx != 0) || pfnUnicodeStrlen((S8*) email_p->comp_info.cont_buff))
- {
- email_p->comp_info.done_flag = TRUE;
- }
- }
- return email_p->comp_info.done_flag;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_fill_attach
- * DESCRIPTION
- * Fill image of attachments to Write Email screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_fill_attach(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- U16 img_id;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < MMI_EMAIL_MAX_NUM_ATTACH; i++)
- {
- if (email_p->comp_info.attch_list[i].attch_present)
- {
- img_id = mmi_email_util_get_attch_icon((S8*) email_p->comp_info.attch_list[i].file_path);
- }
- else
- {
- img_id = IMG_EMAIL_BALNK_ID;
- }
- email_p->comp_info.attch_icon[i].image1 = (PU8) GetImage(img_id);
- }
- /* update to UI */
- AddEmailImageAttachmentUI(&wgui_inline_items[3], (wgui_inline_images_detail*) email_p->comp_info.attch_icon);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_attach_lsk_func
- * DESCRIPTION
- * Left soft key function of attachment component in Write Email screen.
- * PARAMETERS
- * image [IN] Currently no use
- * str [IN] Currently no use
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_attach_lsk_func(PU8 image, UI_string_type str)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_entry_comp_attch();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_attach_rsk_func
- * DESCRIPTION
- * Right soft key function of attachment component in Write Email screen.
- * PARAMETERS
- * image [IN] Currently no use
- * str [IN] Currently no use
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_attach_rsk_func(PU8 image, UI_string_type str)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_comp_inline_item
- * DESCRIPTION
- * Highlight handler of Write Email screen
- * PARAMETERS
- * index [IN] Index of highlighted item
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_comp_inline_item(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->comp_info.curr_inline_item = (U8) index;
- email_p->comp_info.curr_addr_type = EMAIL_ADDR_NONE;
- switch (email_p->comp_info.curr_inline_item)
- {
- case EMAIL_COMP_TO:
- email_p->comp_info.curr_addr_type = EMAIL_ADDR_TO;
- mmi_email_util_change_title(STR_EMAIL_TO_ID);
- break;
- case EMAIL_COMP_CC:
- email_p->comp_info.curr_addr_type = EMAIL_ADDR_CC;
- mmi_email_util_change_title(STR_EMAIL_CC_ID);
- break;
- case EMAIL_COMP_SUBJ:
- mmi_email_util_change_title(STR_EMAIL_SUBJECT_ID);
- pfnUnicodeStrcpy((S8*) email_p->misc_info.subj_inline_buff, (S8*) email_p->comp_info.subj_buff);
- break;
- case EMAIL_COMP_CONT:
- mmi_email_util_change_title(STR_EMAIL_CONTENT_ID);
- ChangeLeftSoftkey(STR_GLOBAL_EDIT, IMG_GLOBAL_OK);
- pfnUnicodeStrcpy((S8*) email_p->misc_info.cont_inline_buff, (S8*) email_p->comp_info.cont_buff);
- SetLeftSoftkeyFunction(mmi_email_entry_comp_cont, KEY_EVENT_UP);
- break;
- case EMAIL_COMP_ATTCH:
- mmi_email_util_change_title(STR_EMAIL_ATTACHMENT_ID);
- break;
- default: /* case EMAIL_COMP_PRIOTRIY: */
- mmi_email_util_change_title(STR_EMAIL_PRIORITY_ID);
- break;
- }
- mmi_email_comp_change_rsk();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_comp_subj_opt
- * DESCRIPTION
- * Entry function of subject option for full screen editor.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_comp_subj_opt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 numItems;
- U16 nStrItemList[2]; /* only done and input method */
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_COMP_SUBJ_INPUT_OPT, NULL, mmi_email_entry_comp_subj_opt, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_COMP_SUBJ_INPUT_OPT);
- SetParentHandler(MENU_ID_EMAIL_COMP_SUBJ_OPT);
- numItems = GetNumOfChild(MENU_ID_EMAIL_COMP_SUBJ_OPT);
- GetSequenceStringIds(MENU_ID_EMAIL_COMP_SUBJ_OPT, nStrItemList);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_GLOBAL_OPTIONS,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- 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_email_comp_add_attach
- * DESCRIPTION
- * Enter file manager to select an file to attach
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_add_attach(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- FMGR_FILTER filter;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- FMGR_FILTER_INIT(&filter);
- FMGR_FILTER_SET_ALL(&filter);
- mmi_fmgr_select_path_and_enter(
- APP_EMAIL,
- FMGR_SELECT_FILE | FMGR_SELECT_REPEAT,
- filter,
- (S8*) L"root",
- mmi_email_comp_add_attach_callback);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_add_attach_callback
- * DESCRIPTION
- * Callback function when finish selecting an file for attachment
- * PARAMETERS
- * filePath [IN] Path and name of selected file
- * is_short [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_add_attach_callback(void *filePath, int is_short)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 dirLen;
- S8 *fileName = (S8*) filePath;
- S32 origLen;
- S32 fileLen;
- S32 f_result;
- S8 *fileExt;
- S8 i = email_p->misc_info.curr_hilite_attch;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (filePath == NULL)
- {
- GoBackToHistory(SCR_ID_EMAIL_COMP_ATTCH);