EmailAppUIInterface.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:476k
源码类别:
MTK
开发平台:
C/C++
- ShowCategory57Screen(
- STR_EMAIL_SMTP_SETTING_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_EDIT,
- IMG_GLOBAL_BACK,
- STR_GLOBAL_DONE,
- IMG_GLOBAL_BACK,
- EMAIL_SMTP_TOTAL_ITEM,
- (U16*) smtp_icons,
- wgui_inline_items,
- email_p->prof_info.prof_misc.curr_hilite_indx,
- guiBuffer);
- SetCategory57RightSoftkeyFunctions(mmi_email_prof_save_confirm, GoBackHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_exit_prof_smtp
- * DESCRIPTION
- * Exit function of SMTP setting screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_exit_prof_smtp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- set_leading_zero(TRUE);
- mmi_email_util_add_n_history(SCR_ID_EMAIL_PROF_SMTP, mmi_email_entry_prof_smtp);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_prof_save_smtp
- * DESCRIPTION
- * Function to save SMTP setting
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_prof_save_smtp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 OutgoingPortnumber;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- CloseCategory57Screen();
- OutgoingPortnumber = gui_atoi((UI_string_type) email_p->prof_info.editing_prof.smtp_info.out_port);
- if (pfnUnicodeStrlen((S8*) email_p->prof_info.editing_prof.smtp_info.out_port) == 0)
- {
- OutgoingPortnumber = EMAIL_DEFAULT_SMTP_PORT;
- gui_itoa(OutgoingPortnumber, (UI_string_type) email_p->prof_info.editing_prof.smtp_info.out_port, 10);
- }
- if ((OutgoingPortnumber > EMAIL_MAX_PORT) || (OutgoingPortnumber < EMAIL_MIN_PORT))
- {
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_PORT_NUMBER_OUTOF_RANGE),
- IMG_GLOBAL_ERROR,
- 0,
- UI_POPUP_NOTIFYDURATION_TIME,
- ERROR_TONE);
- }
- else if ((pfnUnicodeStrlen((S8*) email_p->prof_info.editing_prof.smtp_info.email_addr)) == 0)
- {
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_EMAIL_ADDRESS_EMPTY),
- IMG_GLOBAL_ERROR,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- ERROR_TONE);
- email_p->prof_info.prof_misc.curr_hilite_indx = (EMAIL_SMTP_ADDR);
- }
- else if (!mmi_email_util_chk_addr((U8*) email_p->prof_info.editing_prof.smtp_info.email_addr))
- {
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_ERROR_CODE_INVALID_EMAIL_ADDR_ID),
- IMG_GLOBAL_ERROR,
- 0,
- UI_POPUP_NOTIFYDURATION_TIME,
- ERROR_TONE);
- email_p->prof_info.prof_misc.curr_hilite_indx = (EMAIL_SMTP_ADDR);
- }
- else if (!mmi_email_util_is_username_vaild((S8*) email_p->prof_info.editing_prof.smtp_info.user_name))
- {
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_WRONG_USERNAME),
- IMG_GLOBAL_ERROR,
- 0,
- UI_POPUP_NOTIFYDURATION_TIME,
- ERROR_TONE);
- email_p->prof_info.prof_misc.curr_hilite_indx = (EMAIL_SMTP_USERNAME);
- }
- else
- {
- mmi_email_pre_entry_progressing(
- STR_EMAIL_MAIN_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- 0,
- 0,
- 0,
- 0,
- (U8*) GetString(STR_GLOBAL_SAVING),
- NULL,
- IMG_EMAIL_SENDING_ID,
- NULL,
- NULL,
- NULL,
- 0);
- mmi_email_ps_set_acct_profile_req();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_prof_fill_smtp_inline_struct
- * DESCRIPTION
- * Fill inline sturcture of SMTP setting.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_prof_fill_smtp_inline_struct(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* caption of outgoing server */
- SetInlineItemActivation(&wgui_inline_items[0], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(&wgui_inline_items[0], (U8*) GetString(STR_EMAIL_OUTGOING_SERVER_ID));
- /* outgoing server */
- SetInlineItemActivation(&wgui_inline_items[1], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit(
- &wgui_inline_items[1],
- STR_EMAIL_OUTGOING_SERVER_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- (U8*) email_p->prof_info.editing_prof.smtp_info.out_server,
- MMI_EMAIL_MAX_SERVER_NAME + 1,
- INPUT_TYPE_USE_ONLY_ENGLISH_MODES | INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
- SetInlineFullScreenEditCustomFunction(&wgui_inline_items[1], mmi_email_hilite_prof_full_edit);
- set_leading_zero(FALSE);
- /* caption of outgoing port */
- SetInlineItemActivation(&wgui_inline_items[2], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(&wgui_inline_items[2], (U8*) GetString(STR_EMAIL_OUTGOING_PORT_ID));
- /* outgoing port */
- SetInlineItemActivation(&wgui_inline_items[3], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemTextEdit(
- &wgui_inline_items[3],
- (U8*) email_p->prof_info.editing_prof.smtp_info.out_port,
- EMAIL_MAX_PROF_PORT_LEN + 1,
- INPUT_TYPE_NUMERIC);
- RightJustifyInlineItem(&wgui_inline_items[3]);
- EnableInlineItemBoundary(&wgui_inline_items[3]);
- DisableInlineItemHighlight(&wgui_inline_items[3]);
- /* caption of display name */
- SetInlineItemActivation(&wgui_inline_items[4], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(&wgui_inline_items[4], (U8*) GetString(STR_EMAIL_DISPLAY_NAME_ID));
- /* dispaly name */
- SetInlineItemActivation(&wgui_inline_items[5], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit(
- &wgui_inline_items[5],
- STR_EMAIL_DISPLAY_NAME_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- (U8*) email_p->prof_info.editing_prof.smtp_info.disp_name,
- EMAIL_PROF_DISP_NAME_LEN + 1,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
- SetInlineFullScreenEditCustomFunction(&wgui_inline_items[5], mmi_email_hilite_prof_full_edit);
- /* caption of email address */
- SetInlineItemActivation(&wgui_inline_items[6], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(&wgui_inline_items[6], (U8*) GetString(STR_EMAIL_EMAIL_ADDRESS_ID));
- /* email address */
- SetInlineItemActivation(&wgui_inline_items[7], KEY_LSK, KEY_EVENT_UP);
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif
- SetInlineItemFullScreenEdit_ext(
- &wgui_inline_items[7],
- STR_EMAIL_EMAIL_ADDRESS_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- (U8*)email_p->prof_info.editing_prof.smtp_info.email_addr,
- MMI_EMAIL_MAX_LEN_EMAIL_ADDRESS + 1,
- INPUT_TYPE_USE_ONLY_ENGLISH_MODES |INPUT_TYPE_ALPHANUMERIC_SENTENCECASE,
- INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
- SetInlineFullScreenEditCustomFunction(&wgui_inline_items[7], mmi_email_hilite_prof_full_edit_ext);
- /* caption of username */
- SetInlineItemActivation(&wgui_inline_items[8], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(&wgui_inline_items[8], (U8*) GetString(STR_EMAIL_USER_NAME_ID));
- /* username */
- SetInlineItemActivation(&wgui_inline_items[9], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit(
- &wgui_inline_items[9],
- STR_EMAIL_USER_NAME_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- (U8*) email_p->prof_info.editing_prof.smtp_info.user_name,
- MMI_EMAIL_USR_MAX_LEN + 1,
- INPUT_TYPE_USE_ONLY_ENGLISH_MODES | INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
- SetInlineFullScreenEditCustomFunction(&wgui_inline_items[9], mmi_email_hilite_prof_full_edit);
- /* caption of password */
- SetInlineItemActivation(&wgui_inline_items[10], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(&wgui_inline_items[10], (U8*) GetString(STR_EMAIL_PASSWORD_ID));
- /* password */
- SetInlineItemActivation(&wgui_inline_items[11], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit(
- &wgui_inline_items[11],
- STR_EMAIL_PASSWORD_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- (U8*) email_p->prof_info.editing_prof.smtp_info.passwd,
- MMI_EMAIL_PASS_MAX_LEN + 1,
- INPUT_TYPE_USE_ONLY_ENGLISH_MODES | INPUT_TYPE_ALPHANUMERIC_PASSWORD);
- SetInlineFullScreenEditCustomFunction(&wgui_inline_items[11], mmi_email_hilite_prof_full_edit);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_prof_full_edit
- * DESCRIPTION
- * Highlight handler of all common full screen eidtor.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_prof_full_edit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OPTIONS, 0);
- SetLeftSoftkeyFunction(mmi_email_entry_comm_full_edit_opt, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_prof_full_edit_ext
- * DESCRIPTION
- * Highlight handler of full screen eidtor without newline symbol.
- * PARAMETERS
- * None.
- * RETURNS
- * None.
- * GLOBALS AFFECTED
- * None.
- *****************************************************************************/
- void mmi_email_hilite_prof_full_edit_ext(void)
- {
- ChangeLeftSoftkey (STR_GLOBAL_OPTIONS, 0);
- SetLeftSoftkeyFunction(mmi_email_entry_comm_full_edit_opt, KEY_EVENT_UP);
- #ifdef __MMI_TOUCH_SCREEN__
- mmi_pen_editor_set_vk_keys(MMI_FALSE, NULL, g_email_disable_new_line);
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_prof_done
- * DESCRIPTION
- * Highlight handler of all common full screen eidtor -> Done option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_prof_done(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(ConfirmInlineFullScreenEdit, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_prof_input_meth
- * DESCRIPTION
- * Highlight handler of all common full screen eidtor -> Input Method option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_prof_input_meth(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- RegisterInputMethodScreenCloseFunction(mmi_email_util_go_back_2_hist);
- SetLeftSoftkeyFunction(EntryInputMethodScreen, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_prof_pop3_imap4
- * DESCRIPTION
- * Entry POP3/IMAP4 setting screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_prof_pop3_imap4(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 pop3_imap4_icons[EMAIL_POP3_TOTAL_ITEM];
- U8 *guiBuffer;
- U8 *inputBuffer;
- U16 inputBufferSize;
- S32 num_of_items = EMAIL_POP3_TOTAL_ITEM;
- S32 i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_PROF_POP3_IMAP4, mmi_email_exit_prof_pop3_imap4, NULL, NULL);
- InitializeCategory57Screen();
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_PROF_POP3_IMAP4);
- inputBuffer = GetCurrNInputBuffer(SCR_ID_EMAIL_PROF_POP3_IMAP4, &inputBufferSize);
- mmi_email_prof_fill_pop3_imap4_inline_struct();
- for (i = 0; i <= EMAIL_POP3_PASSWD; i++)
- {
- if (i % 2)
- {
- pop3_imap4_icons[i] = 0;
- }
- else
- {
- pop3_imap4_icons[i] = IMG_EMAIL_INCOMING_SERVER_ID + (i / 2);
- }
- }
- #ifdef __MMI_EMAIL_COPY_ON_SERVER__
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- /* remove sent/draft folder name items */
- if (email_p->prof_info.editing_prof.setting_info.in_prot == MMI_EMAIL_PROTOCOL_POP3)
- {
- num_of_items -= 4;
- pop3_imap4_icons[EMAIL_POP3_PASSWD + 1] = IMG_EMAIL_SERVER_COPY_ID;
- pop3_imap4_icons[EMAIL_POP3_PASSWD + 2] = 0;
- }
- else /* MMI_EMAIL_PROTOCOL_IMAP4 */
- {
- num_of_items -= 2;
- pop3_imap4_icons[EMAIL_POP3_PASSWD + 1] = IMG_EMAIL_DRAFT_FOLDER_ID;
- pop3_imap4_icons[EMAIL_POP3_PASSWD + 2] = 0;
- pop3_imap4_icons[EMAIL_POP3_PASSWD + 3] = IMG_EMAIL_SENT_FOLDER_ID;
- pop3_imap4_icons[EMAIL_POP3_PASSWD + 4] = 0;
- }
- #else /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- pop3_imap4_icons[EMAIL_POP3_PASSWD + 1] = IMG_EMAIL_SERVER_COPY_ID;
- pop3_imap4_icons[EMAIL_POP3_PASSWD + 2] = 0;
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- #else /* __MMI_EMAIL_COPY_ON_SERVER__ */
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- if (email_p->prof_info.editing_prof.setting_info.in_prot == MMI_EMAIL_PROTOCOL_POP3)
- {
- num_of_items -= 4;
- }
- else /* MMI_EMAIL_PROTOCOL_IMAP4 */
- {
- pop3_imap4_icons[EMAIL_POP3_PASSWD + 1] = IMG_EMAIL_DRAFT_FOLDER_ID;
- pop3_imap4_icons[EMAIL_POP3_PASSWD + 2] = 0;
- pop3_imap4_icons[EMAIL_POP3_PASSWD + 3] = IMG_EMAIL_SENT_FOLDER_ID;
- pop3_imap4_icons[EMAIL_POP3_PASSWD + 4] = 0;
- }
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- #endif /* __MMI_EMAIL_COPY_ON_SERVER__ */
- if (inputBuffer != NULL)
- {
- SetCategory57Data(wgui_inline_items, num_of_items, inputBuffer);
- }
- ShowCategory57Screen(
- STR_EMAIL_POP3_IMAP4_SETTING_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_EDIT,
- IMG_GLOBAL_BACK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- num_of_items,
- (U16*) pop3_imap4_icons,
- wgui_inline_items,
- 0,
- guiBuffer);
- SetCategory57RightSoftkeyFunctions(mmi_email_prof_save_confirm, GoBackHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_exit_prof_pop3_imap4
- * DESCRIPTION
- * Exit function of POP3/IMAP4 setting screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_exit_prof_pop3_imap4(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- set_leading_zero(TRUE);
- mmi_email_util_add_n_history(SCR_ID_EMAIL_PROF_POP3_IMAP4, mmi_email_entry_prof_pop3_imap4);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_prof_save_pop3_imap4
- * DESCRIPTION
- * Function to save POP3/IMAP4 setting
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_prof_save_pop3_imap4(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 IncomingPortNumber;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- CloseCategory57Screen();
- IncomingPortNumber = gui_atoi((UI_string_type) email_p->prof_info.editing_prof.pop_imap_info.in_port);
- if (pfnUnicodeStrlen((S8*) email_p->prof_info.editing_prof.pop_imap_info.in_port) == 0)
- {
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- if (email_p->prof_info.editing_prof.setting_info.in_prot == EMAIL_PROT_POP3)
- {
- IncomingPortNumber = EMAIL_DEFAULT_POP3_PORT;
- }
- else
- {
- IncomingPortNumber = EMAIL_DEFAULT_IMAP4_PORT;
- }
- #else /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- IncomingPortNumber = EMAIL_DEFAULT_POP3_PORT;
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- gui_itoa(IncomingPortNumber, (UI_string_type) email_p->prof_info.editing_prof.pop_imap_info.in_port, 10);
- }
- if (IncomingPortNumber > EMAIL_MAX_PORT || IncomingPortNumber < EMAIL_MIN_PORT)
- {
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_PORT_NUMBER_OUTOF_RANGE),
- IMG_GLOBAL_ERROR,
- 0,
- UI_POPUP_NOTIFYDURATION_TIME,
- ERROR_TONE);
- }
- else if (!mmi_email_util_is_username_vaild((S8*) email_p->prof_info.editing_prof.pop_imap_info.user_name))
- {
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_WRONG_USERNAME),
- IMG_GLOBAL_ERROR,
- 0,
- UI_POPUP_NOTIFYDURATION_TIME,
- ERROR_TONE);
- email_p->prof_info.prof_misc.curr_hilite_indx = (EMAIL_POP3_USERNAME);
- }
- else
- {
- mmi_email_pre_entry_progressing(
- STR_EMAIL_MAIN_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- 0,
- 0,
- 0,
- 0,
- (U8*) GetString(STR_GLOBAL_SAVING),
- NULL,
- IMG_EMAIL_SENDING_ID,
- NULL,
- NULL,
- NULL,
- 0);
- mmi_email_ps_set_acct_profile_req();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_prof_fill_pop3_imap4_inline_struct
- * DESCRIPTION
- * Fill inline structure for POP/IMAP4 screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_prof_fill_pop3_imap4_inline_struct(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_EMAIL_COPY_ON_SERVER__
- /* On/Off inline selection */
- email_p->prof_info.prof_misc.copy_on_server[0] = (U8*) GetString(STR_GLOBAL_OFF);
- email_p->prof_info.prof_misc.copy_on_server[1] = (U8*) GetString(STR_GLOBAL_ON);
- #endif /* __MMI_EMAIL_COPY_ON_SERVER__ */
- /* caption of incoming server */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_POP3_IN_SERVER_CAP], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(&wgui_inline_items[EMAIL_POP3_IN_SERVER_CAP], (U8*) GetString(STR_EMAIL_INCOMING_SERVER_ID));
- /* incoming server */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_POP3_IN_SERVER], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit(
- &wgui_inline_items[EMAIL_POP3_IN_SERVER],
- STR_EMAIL_INCOMING_SERVER_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- (U8*) email_p->prof_info.editing_prof.pop_imap_info.in_server,
- MMI_EMAIL_MAX_SERVER_NAME + 1,
- INPUT_TYPE_USE_ONLY_ENGLISH_MODES | INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
- SetInlineFullScreenEditCustomFunction(&wgui_inline_items[EMAIL_POP3_IN_SERVER], mmi_email_hilite_prof_full_edit);
- set_leading_zero(FALSE);
- /* caption of incoming port */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_POP3_IN_PORT_CAP], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(&wgui_inline_items[EMAIL_POP3_IN_PORT_CAP], (U8*) GetString(STR_EMAIL_INCOMING_PORT_ID));
- /* incoming port */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_POP3_IN_PORT], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemTextEdit(
- &wgui_inline_items[EMAIL_POP3_IN_PORT],
- (U8*) email_p->prof_info.editing_prof.pop_imap_info.in_port,
- EMAIL_MAX_PROF_PORT_LEN + 1,
- INPUT_TYPE_NUMERIC);
- RightJustifyInlineItem(&wgui_inline_items[EMAIL_POP3_IN_PORT]);
- EnableInlineItemBoundary(&wgui_inline_items[EMAIL_POP3_IN_PORT]);
- DisableInlineItemHighlight(&wgui_inline_items[EMAIL_POP3_IN_PORT]);
- /* caption of username */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_POP3_USERNAME_CAP], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(&wgui_inline_items[EMAIL_POP3_USERNAME_CAP], (U8*) GetString(STR_EMAIL_USER_NAME_ID));
- /* username */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_POP3_USERNAME], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit(
- &wgui_inline_items[EMAIL_POP3_USERNAME],
- STR_EMAIL_USER_NAME_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- (U8*) email_p->prof_info.editing_prof.pop_imap_info.user_name,
- MMI_EMAIL_USR_MAX_LEN + 1,
- INPUT_TYPE_USE_ONLY_ENGLISH_MODES | INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
- SetInlineFullScreenEditCustomFunction(&wgui_inline_items[EMAIL_POP3_USERNAME], mmi_email_hilite_prof_full_edit);
- /* caption of password */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_POP3_PASSWD_CAP], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(&wgui_inline_items[EMAIL_POP3_PASSWD_CAP], (U8*) GetString(STR_EMAIL_PASSWORD_ID));
- /* password */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_POP3_PASSWD], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit(
- &wgui_inline_items[EMAIL_POP3_PASSWD],
- STR_EMAIL_PASSWORD_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- (U8*) email_p->prof_info.editing_prof.pop_imap_info.passwd,
- MMI_EMAIL_PASS_MAX_LEN + 1,
- INPUT_TYPE_USE_ONLY_ENGLISH_MODES | INPUT_TYPE_ALPHANUMERIC_PASSWORD);
- SetInlineFullScreenEditCustomFunction(&wgui_inline_items[EMAIL_POP3_PASSWD], mmi_email_hilite_prof_full_edit);
- #ifdef __MMI_EMAIL_COPY_ON_SERVER__
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- if (email_p->prof_info.editing_prof.setting_info.in_prot == MMI_EMAIL_PROTOCOL_POP3)
- #endif
- {
- /* caption of copy on server */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_POP3_PASSWD + 1], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(&wgui_inline_items[EMAIL_POP3_PASSWD + 1], (U8*) GetString(STR_EMAIL_SERVER_COPY_ID));
- /* copy on server */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_POP3_PASSWD + 2], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemSelect(
- &wgui_inline_items[EMAIL_POP3_PASSWD + 2],
- EMAIL_PROF_SERVER_COPY_STATUS_ITEM,
- email_p->prof_info.prof_misc.copy_on_server,
- &email_p->prof_info.editing_prof.pop_imap_info.copy_on_server);
- }
- #endif /* __MMI_EMAIL_COPY_ON_SERVER__ */
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- if (email_p->prof_info.editing_prof.setting_info.in_prot == MMI_EMAIL_PROTOCOL_IMAP4)
- {
- /* caption of sent folder */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_POP3_PASSWD + 1], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(
- &wgui_inline_items[EMAIL_POP3_PASSWD + 1],
- (U8*) GetString(STR_EMAIL_SENT_FOLDER_NAME));
- /* sent folder */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_POP3_PASSWD + 2], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit(
- &wgui_inline_items[EMAIL_POP3_PASSWD + 2],
- STR_EMAIL_SENT_FOLDER_NAME,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- (U8*) email_p->prof_info.editing_prof.pop_imap_info.sent_name,
- (EMAIL_MAX_FLDR_NAME_LEN + 1),
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
- SetInlineFullScreenEditCustomFunction(
- &wgui_inline_items[EMAIL_POP3_PASSWD + 2],
- mmi_email_hilite_prof_full_edit);
- /* caption of draft folder */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_POP3_PASSWD + 3], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(
- &wgui_inline_items[EMAIL_POP3_PASSWD + 3],
- (U8*) GetString(STR_EMAIL_DRAFT_FOLDER_NAME));
- /* draft folder */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_POP3_PASSWD + 4], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit(
- &wgui_inline_items[EMAIL_POP3_PASSWD + 4],
- STR_EMAIL_DRAFT_FOLDER_NAME,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- (U8*) email_p->prof_info.editing_prof.pop_imap_info.draft_name,
- (EMAIL_MAX_FLDR_NAME_LEN + 1),
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
- SetInlineFullScreenEditCustomFunction(
- &wgui_inline_items[EMAIL_POP3_PASSWD + 4],
- mmi_email_hilite_prof_full_edit);
- }
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_prof_is_activated
- * DESCRIPTION
- * Determine is there any activated profile
- * PARAMETERS
- * void
- * RETURNS
- * TURE if one of the profiles is activated; otherwise, FALSE.
- *****************************************************************************/
- U8 mmi_email_prof_is_activated(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (email_p->prof_info.act_prof.act_indx < MMI_EMAIL_MAX_ACCTS)
- {
- return TRUE;
- }
- else
- {
- return FALSE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_prof_update_hint
- * DESCRIPTION
- * Update hint value in main menu when profile changed.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_prof_update_hint(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_fldr_reset_cntx(EAMIL_RESET_EXCEPT_UNSENT);
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- if (email_p->prof_info.act_prof.in_prot == EMAIL_PROT_POP3 || email_p->main_info.curr_menu == MMI_EMAIL_UNSENT)
- {
- email_p->fldr_info.fldr_update_state = EMAIL_LIST_FLDR_REQUIRED;
- }
- else
- {
- email_p->fldr_info.fldr_update_state = EMAIL_LIST_FLDR_NOT_DONE;
- email_p->fldr_info.curr_page = 1;
- /* reset unread email */
- email_p->main_info.unread_mails = 0;
- mmi_email_util_update_status_icon();
- }
- #else /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- email_p->fldr_info.fldr_update_state = EMAIL_LIST_FLDR_REQUIRED;
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- }
- #define SIG_EMAIL
- /*****************************************************************************
- * FUNCTION
- * mmi_email_prof_pre_entry_sig
- * DESCRIPTION
- * Pre-Entry function of Signature setting screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_prof_pre_entry_sig(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (pfnUnicodeStrlen((S8*) email_p->prof_info.editing_prof.sig_info.img_name))
- {
- S8 *fileExt = mmi_email_get_file_ext((S8*) email_p->prof_info.editing_prof.sig_info.img_name);
- email_p->prof_info.prof_misc.sig_img_indx = 1;
- pfnUnicodeStrcpy(
- (S8*) email_p->prof_info.editing_prof.sig_info.file_name,
- (S8*) email_p->prof_info.editing_prof.sig_info.img_name);
- mmi_email_util_get_sig_name(
- (U8) (email_p->prof_info.prof_misc.curr_sel_prof + 1),
- (S8*) email_p->prof_info.editing_prof.sig_info.file_path);
- pfnUnicodeStrcat((S8*) email_p->prof_info.editing_prof.sig_info.file_path, (S8*) fileExt);
- }
- else
- {
- memset(
- email_p->prof_info.editing_prof.sig_info.file_name,
- 0,
- sizeof(email_p->prof_info.editing_prof.sig_info.file_name));
- memset(
- email_p->prof_info.editing_prof.sig_info.file_path,
- 0,
- sizeof(email_p->prof_info.editing_prof.sig_info.file_path));
- email_p->prof_info.prof_misc.sig_img_indx = 0;
- }
- email_p->prof_info.prof_misc.is_sig_changed = FALSE;
- mmi_email_entry_prof_sig();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_prof_sig
- * DESCRIPTION
- * Entry function of Signature setting screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_prof_sig(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 sig_icons[EMAIL_SIG_TOTAL_ITEM] =
- {
- IMG_STATUS, 0,
- IMG_EMAIL_SIGNATURE_IMAGE_ID, 0,
- IMG_EMAIL_SIGNATURE_TEXT_ID, 0
- };
- U8 *guiBuffer;
- U8 *inputBuffer;
- U16 inputBufferSize;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_PROF_SIG, mmi_email_exit_prof_sig, NULL, NULL);
- InitializeCategory57Screen();
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_PROF_SIG);
- inputBuffer = GetCurrNInputBuffer(SCR_ID_EMAIL_PROF_SIG, &inputBufferSize);
- /* temporary solution suggested by Terry */
- /* SetCategory57RightSoftkeyFunctions (mmi_email_prof_save_confirm, GoBackHistory); */
- mmi_email_prof_fill_sig_inline_struct();
- /* RegisterHighlightHandler (mmi_email_hilite_prof_sig_inline_item); */
- if (inputBuffer != NULL)
- {
- SetCategory57Data(wgui_inline_items, EMAIL_SIG_TOTAL_ITEM, inputBuffer);
- if (email_p->prof_info.prof_misc.is_sig_changed && GetInlineDoneFlag(guiBuffer) == 0)
- {
- SetInlineDoneFlag(guiBuffer);
- }
- }
- ShowCategory57Screen(
- STR_EMAIL_SIGNATURE_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_EDIT,
- IMG_GLOBAL_BACK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- EMAIL_SIG_TOTAL_ITEM,
- (U16*) sig_icons,
- wgui_inline_items,
- 0,
- guiBuffer);
- SetCategory57RightSoftkeyFunctions(mmi_email_prof_save_confirm, GoBackHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_exit_prof_sig
- * DESCRIPTION
- * Pre-Entry function of Signature setting screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_exit_prof_sig(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_util_add_n_history(SCR_ID_EMAIL_PROF_SIG, mmi_email_entry_prof_sig);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_prof_fill_sig_inline_struct
- * DESCRIPTION
- * Fill inline structure for Profile->Signature screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_prof_fill_sig_inline_struct(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* On/Off inline selection */
- email_p->prof_info.prof_misc.sig_status_list[0] = (U8*) GetString(STR_GLOBAL_OFF);
- email_p->prof_info.prof_misc.sig_status_list[1] = (U8*) GetString(STR_GLOBAL_ON);
- /* image inline selection */
- email_p->prof_info.prof_misc.sig_img_list[0] = (U8*) GetString(STR_GLOBAL_NONE);
- if (pfnUnicodeStrlen((S8*) email_p->prof_info.editing_prof.sig_info.file_name))
- {
- email_p->prof_info.prof_misc.sig_img_list[1] = (U8*) email_p->prof_info.editing_prof.sig_info.file_name;
- }
- else
- {
- email_p->prof_info.prof_misc.sig_img_list[1] = (U8*) GetString(STR_EMAIL_SELECT_FROM_FILE_ID);
- }
- /* Status caption */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_SIG_STATUS_CAP], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(&wgui_inline_items[EMAIL_SIG_STATUS_CAP], (PU8) GetString(STR_EMAIL_SIGNATURE_ON_OFF_ID));
- /* Status */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_SIG_STATUS], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemSelect(
- &wgui_inline_items[EMAIL_SIG_STATUS],
- EMAIL_PROF_SIG_STATUS_ITEM,
- email_p->prof_info.prof_misc.sig_status_list,
- &email_p->prof_info.editing_prof.sig_info.sig_status);
- /* Image caption */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_SIG_IMAGE_CAP], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(&wgui_inline_items[EMAIL_SIG_IMAGE_CAP], (PU8) GetString(STR_EMAIL_SIGNATURE_IMAGE_ID));
- /* Image */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_SIG_IMAGE], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemSelect(
- &wgui_inline_items[EMAIL_SIG_IMAGE],
- EMAIL_PROF_SIG_IMG_ITEM,
- email_p->prof_info.prof_misc.sig_img_list,
- &email_p->prof_info.prof_misc.sig_img_indx);
- RegisterInlineSelectHighlightHandler(&wgui_inline_items[EMAIL_SIG_IMAGE], mmi_email_hilite_prof_sig_inline_sel);
- /* Text caption */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_SIG_TEXT_CAP], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(&wgui_inline_items[EMAIL_SIG_TEXT_CAP], (PU8) GetString(STR_EMAIL_SIGNATURE_TEXT_ID));
- /* Text */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_SIG_TEXT], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit(
- &wgui_inline_items[EMAIL_SIG_TEXT],
- STR_EMAIL_SIGNATURE_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- (PU8) email_p->prof_info.editing_prof.sig_info.sig_buff,
- (EMAIL_MAX_SIG_LEN + 1),
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
- SetInlineFullScreenEditCustomFunction(&wgui_inline_items[EMAIL_SIG_TEXT], mmi_email_hilite_prof_full_edit);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_prof_sig_inline_sel
- * DESCRIPTION
- * Highlight handler of selection sig image
- * PARAMETERS
- * index [IN] Index of inline seletion item
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_prof_sig_inline_sel(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(0, 0);
- if (index != 0)
- {
- ChangeLeftSoftkey(STR_GLOBAL_OPTIONS, 0);
- SetCategory57LeftSoftkeyFunction(mmi_email_entry_prof_sig_sel_file);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_prof_sig_sel_attach_callback
- * DESCRIPTION
- * Callback function for selected image of signature from File Manager
- * PARAMETERS
- * filePath [IN] File path+name from File Manager
- * is_short [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_prof_sig_sel_attach_callback(void *filePath, int is_short)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (filePath == NULL)
- {
- GoBackToHistory(SCR_ID_EMAIL_PROF_SIG_SEL_FILE);
- }
- else
- {
- S32 fileLen;
- S32 dirLen;
- S8 *fileName;
- S32 f_result;
- if ((f_result = mmi_email_util_get_file_size(filePath, &fileLen)) == FS_NO_ERROR)
- {
- // if (fileLen > MMI_EMAIL_MAX_ATTACH_SIZE)
- if (fileLen > MMI_EMAIL_TOTAL_MAX_ATTACH_SIZE)
- {
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_SIZE_TOO_LARGE),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- DeleteUptoScrID(SCR_ID_EMAIL_PROF_SIG_SEL_FILE);
- return;
- }
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(GetFileSystemErrorString(f_result)),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- DeleteUptoScrID(SCR_ID_EMAIL_PROF_SIG_SEL_FILE);
- return;
- }
- /* extract file name and path */
- dirLen = (S32) mmi_fmgr_get_last_dir_index((S8*) filePath);
- fileName = (S8*) filePath;
- fileName += dirLen;
- pfnUnicodeStrcpy((S8*) email_p->prof_info.editing_prof.sig_info.file_name, (S8*) fileName);
- pfnUnicodeStrcpy((S8*) email_p->prof_info.editing_prof.sig_info.file_path, (S8*) filePath);
- /* change RSK of signature secreen to Done */
- email_p->prof_info.prof_misc.is_sig_changed = TRUE;
- GoBackToHistory(SCR_ID_EMAIL_PROF_SIG_SEL_FILE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_prof_sig_sel_attach
- * DESCRIPTION
- * Enter file manager to select an image file for signature
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_prof_sig_sel_attach(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- FMGR_FILTER filter;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- FMGR_FILTER_INIT(&filter);
- FMGR_FILTER_SET(&filter, FMGR_TYPE_BMP);
- FMGR_FILTER_SET(&filter, FMGR_TYPE_JPG);
- FMGR_FILTER_SET(&filter, FMGR_TYPE_PNG);
- FMGR_FILTER_SET(&filter, FMGR_TYPE_GIF);
- FMGR_FILTER_SET(&filter, FMGR_TYPE_WBMP);
- FMGR_FILTER_SET(&filter, FMGR_TYPE_FOLDER);
- /* use APP_SETTINGS because of DRM -- signautre shall not be DRM file */
- mmi_fmgr_select_path_and_enter(
- APP_EMAIL,
- FMGR_SELECT_FILE | FMGR_SELECT_REPEAT,
- filter,
- (S8*) L"root",
- mmi_email_prof_sig_sel_attach_callback);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_prof_sig_view
- * DESCRIPTION
- * highlight handler for Signature -> View option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_prof_sig_view(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_entry_prof_sig_view_attach, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_entry_prof_sig_view_attach, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_prof_sig_select
- * DESCRIPTION
- * highlight handler for Signature -> Select option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_prof_sig_select(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_prof_sig_sel_attach, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_prof_sig_sel_attach, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_prof_sig_del
- * DESCRIPTION
- * highlight handler for Signature -> Delete option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_prof_sig_del(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_prof_sig_del_attach, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_prof_sig_del_attach, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_prof_sig_inline_item
- * DESCRIPTION
- * Highlight handler for inline items in Signature screen
- * PARAMETERS
- * index [IN]
- * nidex(?) [IN] Index of inline item
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_prof_sig_inline_item(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (index != 2)
- {
- /* if current highlighted item is Image, and the value is not "none" */
- if ((index == 1) && (email_p->prof_info.prof_misc.sig_img_indx != 0))
- {
- mmi_email_hilite_prof_sig_inline_sel(email_p->prof_info.prof_misc.sig_img_indx);
- }
- SetCategory57RightSoftkeyFunctions(mmi_email_prof_save_confirm, GoBackHistory);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_prof_save_sig
- * DESCRIPTION
- * Save fuction for Sinature
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_prof_save_sig(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 is_attach;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- is_attach = ((email_p->prof_info.prof_misc.sig_img_indx > 0) &&
- (pfnUnicodeStrlen((S8*) email_p->prof_info.editing_prof.sig_info.file_name)));
- if (email_p->prof_info.editing_prof.sig_info.sig_status)
- {
- /* both text and image are empty */
- if (!pfnUnicodeStrlen((S8*) email_p->prof_info.editing_prof.sig_info.sig_buff) && !is_attach)
- {
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_SIG_EMPTY_WARNING),
- IMG_GLOBAL_WARNING,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- return;
- }
- }
- mmi_email_pre_entry_progressing(
- STR_EMAIL_MAIN_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- 0,
- 0,
- 0,
- 0,
- (U8*) GetString(STR_GLOBAL_SAVING),
- NULL,
- IMG_EMAIL_SENDING_ID,
- NULL,
- NULL,
- NULL,
- 0);
- if (is_attach)
- {
- S8 *dest_path = OslMalloc((FMGR_MAX_PATH_LEN + 1) * ENCODING_LENGTH);
- S8 *fileExt;
- /* send request to copy file */
- pfnUnicodeStrcpy(
- (S8*) email_p->prof_info.editing_prof.sig_info.img_name,
- (S8*) email_p->prof_info.editing_prof.sig_info.file_name);
- fileExt = mmi_email_get_file_ext((S8*) email_p->prof_info.editing_prof.sig_info.img_name);
- mmi_email_util_get_sig_name((U8) (email_p->prof_info.prof_misc.curr_sel_prof + 1), (S8*) dest_path);
- pfnUnicodeStrcat((S8*) dest_path, (S8*) fileExt);
- pfnUnicodeStrcpy((S8*) email_p->comm_buff, (S8*) dest_path);
- OslMfree(dest_path);
- if (pfnUnicodeStrcmp((S8*) email_p->prof_info.editing_prof.sig_info.file_path, (S8*) email_p->comm_buff) != 0)
- {
- FS_Delete((U16*) email_p->comm_buff);
- mmi_fmgr_send_copy_req(
- FMGR_ACTION_COPY,
- (U8*) email_p->prof_info.editing_prof.sig_info.file_path,
- (U8*) email_p->comm_buff,
- mmi_email_prof_sig_save_file_callback);
- return;
- }
- }
- else
- {
- email_p->prof_info.editing_prof.sig_info.img_name[0] = 0;
- email_p->prof_info.editing_prof.sig_info.img_name[1] = 0;
- }
- mmi_email_ps_set_acct_profile_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_prof_sig_save_file_callback
- * DESCRIPTION
- * Callback function for saving image file of signature.
- * PARAMETERS
- * info [IN] Variable stores the result of copy
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_prof_sig_save_file_callback(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_fmt_copy_rsp_strcut *msgPtr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgPtr = (mmi_fmt_copy_rsp_strcut*) info;
- if (msgPtr->result >= 0)
- {
- mmi_email_ps_set_acct_profile_req();
- }
- else
- {
- DisplayPopup((PU8) GetString(GetFileSystemErrorString(msgPtr->result)), IMG_GLOBAL_ERROR, 0, 1000, ERROR_TONE);
- DeleteScreenIfPresent(SCR_ID_EMAIL_PROGRESS);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_prof_sig_sel_file
- * DESCRIPTION
- * Entry Signature -> Select From File screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_prof_sig_sel_file(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 numItems;
- U16 nStrItemList[3]; /* only 3 options */
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_PROF_SIG_SEL_FILE, NULL, mmi_email_entry_prof_sig_sel_file, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_PROF_SIG_SEL_FILE);
- SetParentHandler(MENU_ID_EMAIL_SIG_ATTCH_OPT);
- numItems = GetNumOfChild(MENU_ID_EMAIL_SIG_ATTCH_OPT);
- GetSequenceStringIds(MENU_ID_EMAIL_SIG_ATTCH_OPT, nStrItemList);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- if (pfnUnicodeStrlen((S8*) email_p->prof_info.editing_prof.sig_info.file_name) == 0) /* empty */
- {
- numItems = 1;
- }
- ShowCategory52Screen(
- STR_EMAIL_SIG_ATTACH_OPTION_IMAGES_ID,
- 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);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_prof_sig_view_attach
- * DESCRIPTION
- * Entry Signature -> Select From File -> View
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_prof_sig_view_attach(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 f_result;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (pfnUnicodeStrlen((S8*) email_p->prof_info.editing_prof.sig_info.file_path))
- {
- if ((f_result = mmi_email_util_check_file_exist((S8*) email_p->prof_info.editing_prof.sig_info.file_path)) != FS_NO_ERROR)
- {
- email_p->prof_info.prof_misc.is_sig_changed = TRUE;
- memset(
- email_p->prof_info.editing_prof.sig_info.file_name,
- 0,
- sizeof(email_p->prof_info.editing_prof.sig_info.file_name));
- memset(
- email_p->prof_info.editing_prof.sig_info.file_path,
- 0,
- sizeof(email_p->prof_info.editing_prof.sig_info.file_path));
- DisplayPopup(
- (U8*) GetString(GetFileSystemErrorString(f_result)),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- return;
- }
- EntryNewScreen(SCR_ID_EMAIL_COMP_VIEW_IMAGE, NULL, mmi_email_entry_prof_sig_view_attach, NULL);
- ShowCategory222Screen(
- STR_GLOBAL_VIEW,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- 0,
- 0,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- GDI_COLOR_WHITE,
- NULL,
- (S8*) email_p->prof_info.editing_prof.sig_info.file_path,
- FALSE,
- NULL);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_EMPTY),
- IMG_GLOBAL_EMPTY,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) EMPTY_LIST_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_prof_sig_del_attach
- * DESCRIPTION
- * Entry Signature -> Select From File -> Delete
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_prof_sig_del_attach(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (pfnUnicodeStrlen((S8*) email_p->prof_info.editing_prof.sig_info.file_path))
- {
- /* change RSK of signature secreen to Done */
- email_p->prof_info.prof_misc.is_sig_changed = TRUE;
- memset(email_p->prof_info.editing_prof.sig_info.file_path, 0, ENCODING_LENGTH);
- memset(email_p->prof_info.editing_prof.sig_info.file_name, 0, ENCODING_LENGTH);
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DELETE),
- IMG_GLOBAL_DELETED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_EMPTY),
- IMG_GLOBAL_EMPTY,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) EMPTY_LIST_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_prof_save_confirm
- * DESCRIPTION
- * Display confirmation screen for Profile
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_prof_save_confirm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- FuncPtr func;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (email_p->prof_info.prof_misc.curr_scr)
- {
- case SCR_ID_EMAIL_PROF_SETTING:
- func = mmi_email_prof_save_setting;
- break;
- case SCR_ID_EMAIL_PROF_SMTP:
- func = mmi_email_prof_save_smtp;
- break;
- case SCR_ID_EMAIL_PROF_POP3_IMAP4:
- func = mmi_email_prof_save_pop3_imap4;
- break;
- default: /* case SCR_ID_EMAIL_PROF_SIG: */
- func = mmi_email_prof_save_sig;
- break;
- }
- mmi_email_display_confirm(STR_GLOBAL_SAVE, func, mmi_email_prof_go_back_to_edit_menu);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_prof_go_back_to_edit_menu
- * DESCRIPTION
- * Delete all screen after Profile -> Edit screen and go back to Edit screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_prof_go_back_to_edit_menu(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DeleteUptoScrID(SCR_ID_EMAIL_PROF_OPT_EDIT);
- GoBackHistory();
- }
- #define UTILITY_EMAIL
- /*****************************************************************************
- * FUNCTION
- * mmi_email_display_confirm
- * DESCRIPTION
- * Display common confirmation screen.
- * PARAMETERS
- * strId [IN] Confirmation string.
- * lskFuncs [IN] Left soft key function.
- * rskFuns [IN] Right soft key function.
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_display_confirm(U16 strId, FuncPtr lskFuncs, FuncPtr rskFuns)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(GLOBAL_SCR_DUMMY, NULL, NULL, NULL);
- ShowCategory164Screen(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- strId,
- IMG_GLOBAL_QUESTION,
- NULL);
- SetLeftSoftkeyFunction(lskFuncs, KEY_EVENT_UP);
- SetRightSoftkeyFunction(rskFuns, KEY_EVENT_UP);
- playRequestedTone(WARNING_TONE);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_util_set_insert_history_flag
- * DESCRIPTION
- * Set the state of inserting history.
- * PARAMETERS
- * insert_hist [IN] State of inserting history
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_util_set_insert_history_flag(BOOL insert_hist)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* insert current screen into history */
- email_p->misc_info.insert_hist = insert_hist;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_util_get_hint_value_all_fldr
- * DESCRIPTION
- * Retrieve hint value of total mails of folders in Delete All function.
- * PARAMETERS
- * index [IN] Index of highlight item.
- * RETURNS
- * Pointer to the result string.
- *****************************************************************************/
- U8 *mmi_email_util_get_hint_value_all_fldr(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 hintStr[5 * ENCODING_LENGTH];
- U32 allFolderCount = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- allFolderCount = email_p->fldr_info.fldr_data[MMI_EMAIL_INBOX].total_mails +
- email_p->fldr_info.fldr_data[MMI_EMAIL_SENT].total_mails +
- email_p->fldr_info.fldr_data[MMI_EMAIL_UNSENT].total_mails +
- email_p->fldr_info.fldr_data[MMI_EMAIL_DRAFT].total_mails;
- sprintf(hintStr, "%u ", allFolderCount);
- AnsiiToUnicodeString((S8*) hintData[index], hintStr);
- pfnUnicodeStrcat((S8*) hintData[index], (S8*) GetString(STR_EMAIL_MAILS_ID));
- return (U8*) hintData[index];
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_util_get_fldr_hint_value
- * DESCRIPTION
- * Retrieve hint data of a selected mail.
- * PARAMETERS
- * index [IN] Highlight index of a mail.
- * curr_fldr [IN] Index of selected folder.
- * RETURNS
- * Pointer to the result string.
- *****************************************************************************/
- U8 *mmi_email_util_get_fldr_hint_value(U16 index, U8 curr_fldr)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 hintStr[5 * ENCODING_LENGTH];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- sprintf(hintStr, "%d ", email_p->fldr_info.fldr_data[curr_fldr].total_mails);
- AnsiiToUnicodeString((S8*) hintData[index], hintStr);
- pfnUnicodeStrcat((S8*) hintData[index], (S8*) GetString(STR_EMAIL_MAILS_ID));
- return (U8*) hintData[index];
- }
- #define FOLDER_EMAIL
- /*****************************************************************************
- * FUNCTION
- * mmi_email_fldr_exec_entry
- * DESCRIPTION
- * Execute entry function of current selected folder.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_fldr_exec_entry(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (email_p->main_info.curr_menu)
- {
- case MMI_EMAIL_INBOX:
- mmi_email_entry_inbox();
- break;
- case MMI_EMAIL_UNSENT:
- mmi_email_entry_unsent();
- break;
- case MMI_EMAIL_SENT:
- mmi_email_entry_sent();
- break;
- case MMI_EMAIL_DRAFT:
- mmi_email_entry_draft();
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_fldr_get_async_items
- * DESCRIPTION
- * Fill dynamic list items of each folder
- * PARAMETERS
- * start_indx [IN] Start index of item to be retrieved.
- * menuData [IN/OUT] UI structure to store the list data.
- * num_item [IN] Number of items revrieved.
- * RETURNS
- * void
- *****************************************************************************/
- S32 mmi_email_fldr_get_async_items(S32 start_indx, gui_iconlist_menu_item *menuData, S32 num_item)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- mmi_mem_pool_ret_enum ret_result;
- mmi_email_mail_info_struct *listMsgsStruct[EMAIL_TOTAL_MSG_BUFF];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->mem_pool_info.start_indx = start_indx;
- email_p->mem_pool_info.end_indx = (start_indx + num_item) - 1;
- ret_result = mmi_mem_get_values(
- &email_p->mem_pool_info.mem_container,
- (S16) email_p->mem_pool_info.start_indx,
- (S16) email_p->mem_pool_info.end_indx,
- (void **)listMsgsStruct,
- &email_p->mem_pool_info.not_avail_pool);
- if (ret_result != MEM_CT_SUCCESS)
- {
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- if (email_p->prof_info.act_prof.in_prot == EMAIL_PROT_POP3 || email_p->main_info.curr_menu == MMI_EMAIL_UNSENT)
- #endif
- email_p->fldr_info.curr_page = email_p->mem_pool_info.not_avail_pool + 1;
- if (email_p->fldr_info.is_list_displayed)
- {
- mmi_email_fldr_pre_folder_select_req();
- }
- return 0;
- }
- /* fill data */
- for (i = 0; i < num_item; ++i)
- {
- U16 status_img;
- mmi_email_mail_info_struct *temp = listMsgsStruct[i];
- /* subject */
- if (!pfnUnicodeStrlen((S8*) temp->subject))
- {
- pfnUnicodeStrncpy(
- (S8*) menuData[i].item_list[0],
- (S8*) GetString(STR_EMAIL_COMMON_NO_SUBJECT_ID),
- EMAIL_MAX_SUBJ_DISPLAY_STR_LEN);
- }
- else
- {
- pfnUnicodeStrncpy((S8*) menuData[i].item_list[0], (S8*) temp->subject, EMAIL_MAX_SUBJ_DISPLAY_STR_LEN);
- }
- /* status icon */
- status_img = mmi_email_fldr_get_status_icon(temp->priority, temp->attch_num);
- menuData[i].image_list[0] = (PU8) GetImage(status_img);
- }
- return num_item;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_fldr_prepare_forward
- * DESCRIPTION
- * Prepare data to forward a mail
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_fldr_prepare_forward(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 subLenToBeForwarded;
- U32 prefixFwWithColonStrLen;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* reset inline compose members */
- mmi_email_comp_reset_member();
- /* subject with "Fw: <previous >" */
- subLenToBeForwarded = pfnUnicodeStrlen((S8*) email_p->inbox_info.read_info.subj_buff);
- prefixFwWithColonStrLen = pfnUnicodeStrlen((S8*) g_email_fw_str);
- if ((subLenToBeForwarded + prefixFwWithColonStrLen) > EMAIL_COMP_SUBJ_LEN)
- {
- subLenToBeForwarded = EMAIL_COMP_SUBJ_LEN - prefixFwWithColonStrLen;
- }
- pfnUnicodeStrcpy((S8*) email_p->comp_info.subj_buff, (S8*) g_email_fw_str);
- pfnUnicodeStrncat(
- (S8*) email_p->comp_info.subj_buff,
- (S8*) email_p->inbox_info.read_info.subj_buff,
- subLenToBeForwarded);
- /* content */
- pfnUnicodeStrcpy((S8*) email_p->comp_info.cont_buff, (S8*) email_p->inbox_info.read_info.cont_buff);
- /* priority, encoding type */
- email_p->comp_info.priority_indx = email_p->inbox_info.read_info.priority_indx;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_fldr_prepare_edit
- * DESCRIPTION
- * Prepare data to edit a mail
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_fldr_prepare_edit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_comp_reset_member();
- memcpy(
- &email_p->comp_info.addr_list[EMAIL_ADDR_TO],
- &email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_TO],
- sizeof(mmi_email_to_cc_struct));
- memcpy(
- &email_p->comp_info.addr_list[EMAIL_ADDR_CC],
- &email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_CC],
- sizeof(mmi_email_to_cc_struct));
- memcpy(&email_p->comp_info, &email_p->inbox_info.read_info, sizeof(mmi_email_comp_info_struct));
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_fldr_get_status_icon
- * DESCRIPTION
- * Get status icon enum of Sent/Unsent/Draft folder.
- * PARAMETERS
- * priority [IN]
- * totalAttachments [IN]
- * RETURNS
- * void
- *****************************************************************************/
- U16 mmi_email_fldr_get_status_icon(U8 priority, U8 totalAttachments)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((priority > MMI_EMAIL_NORMAL_PRIORITY) && (totalAttachments != 0))
- {
- return IMG_EMAIL_SENT_LOW_ATTACH_ID;
- }
- else if ((priority == MMI_EMAIL_NORMAL_PRIORITY) && (totalAttachments != 0))
- {
- return IMG_EMAIL_SENT_NORMAL_ATTACH_ID;
- }
- else if ((priority < MMI_EMAIL_NORMAL_PRIORITY) && (totalAttachments != 0))
- {
- return IMG_EMAIL_SENT_HIGH_ATTACH_ID;
- }
- else if ((priority > MMI_EMAIL_NORMAL_PRIORITY) && (!totalAttachments))
- {
- return IMG_EMAIL_SENT_LOW_ID;
- }
- else if ((priority == MMI_EMAIL_NORMAL_PRIORITY) && (!totalAttachments))
- {
- return IMG_EMAIL_SENT_NORMAL_ID;
- }
- else /* if ( (priority<MMI_EMAIL_NORMAL_PRIORITY) && (!totalAttachments) ) */
- {
- return IMG_EMAIL_SENT_HIGH_ID;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_fldr_is_list_ready
- * DESCRIPTION
- * Function to check if list of items is ready to be displayed.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- BOOL mmi_email_fldr_is_list_ready(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_mem_pool_ret_enum ret_result;
- mmi_email_mail_info_struct *listMsgsStruct[EMAIL_TOTAL_MSG_BUFF];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ret_result = mmi_mem_get_values(
- &email_p->mem_pool_info.mem_container,
- (S16) email_p->mem_pool_info.start_indx,
- (S16) email_p->mem_pool_info.end_indx,
- (void **)listMsgsStruct,
- &email_p->mem_pool_info.not_avail_pool);
- if (ret_result != MEM_CT_SUCCESS)
- {
- email_p->fldr_info.curr_page = email_p->mem_pool_info.not_avail_pool + 1;
- return FALSE;
- }
- return TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_fldr_pre_entry
- * DESCRIPTION
- * Pre-Entry function of folders.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_fldr_pre_entry(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->fldr_info.is_list_updated = TRUE;
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- if (email_p->main_info.entry_src == EMAIL_FROM_IDLE || email_p->prof_info.act_prof.in_prot == EMAIL_PROT_IMAP4)
- #else
- if (email_p->main_info.entry_src == EMAIL_FROM_IDLE)
- #endif
- {
- email_p->fldr_info.is_list_updated = FALSE;
- }
- else
- {
- if (!email_p->fldr_info.fldr_data[email_p->main_info.curr_menu].total_mails)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_EMPTY),
- IMG_GLOBAL_EMPTY,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) EMPTY_LIST_TONE);
- return;
- }
- }
- email_p->fldr_info.fldr_list.num_msgs = 0;
- email_p->fldr_info.curr_page = 1;
- mmi_email_fldr_reset_list_info();
- mmi_email_fldr_exec_entry();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_fldr_back_from_history
- * DESCRIPTION
- * Function to be added to history when back to folders.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_fldr_back_from_history(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->fldr_info.is_list_updated = TRUE;
- if (email_p->fldr_info.need_fldr_sel == TRUE)
- {
- email_p->fldr_info.is_list_updated = FALSE;
- mmi_email_fldr_reset_list_info();
- }
- mmi_email_fldr_exec_entry();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_fldr_pre_folder_select_req
- * DESCRIPTION
- * Function before sending folder select request to protocol
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_fldr_pre_folder_select_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (email_p->fldr_info.curr_page < 1)
- {
- email_p->fldr_info.curr_page = 1;
- }
- // if (email_p->main_info.curr_menu==MMI_EMAIL_INBOX)
- // email_p->main_info.unread_mails = 0;
- mmi_email_ps_folder_select_req();
- }
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_fldr_next_page
- * DESCRIPTION
- * Highlight handler of Each Folder -> Option -> Next page
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_fldr_next_page(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_fldr_next_page_req, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_fldr_prev_page
- * DESCRIPTION
- * Highlight handler of Each folder -> Option -> Previous page
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_fldr_prev_page(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_fldr_prev_page_req, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_fldr_jump_to_page
- * DESCRIPTION
- * Highlight handler of Inbox -> Option -> Jump to page
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_fldr_jump_to_page(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_fldr_pre_entry_jump_page, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_fldr_pre_entry_jump_page, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_fldr_pre_entry_jump_page
- * DESCRIPTION
- * Pre-entry fuction of Jump to Page screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_fldr_pre_entry_jump_page(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* reset input buffer */
- email_p->fldr_info.jump_page_buff[0] = 0;
- mmi_email_entry_jump_page();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_fldr_exec_jump_page
- * DESCRIPTION
- * Execute next/prev/jump to operation according to "to-go" page.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_fldr_exec_jump_page(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->fldr_info.curr_mail_indx = 0;
- email_p->fldr_info.fldr_list.num_msgs = 0;
- mmi_email_fldr_reset_list_info();
- mmi_email_fldr_pre_folder_select_req();
- if (email_p->main_info.curr_menu == MMI_EMAIL_INBOX)
- {
- DeleteNScrId(SCR_ID_EMAIL_INBOX);
- }
- else if (email_p->main_info.curr_menu == MMI_EMAIL_SENT)
- {
- DeleteNScrId(SCR_ID_EMAIL_SENT);
- }
- else if (email_p->main_info.curr_menu == MMI_EMAIL_DRAFT)
- {
- DeleteNScrId(SCR_ID_EMAIL_DRAFT);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_jump_page
- * DESCRIPTION
- * Entry Jump To Page screen in each folder
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_jump_page(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U8 *inputBuffer;
- U16 inputBufferSize;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_FLDR_JUMP, mmi_email_exit_jump_page, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_FLDR_JUMP);
- inputBuffer = GetCurrNInputBuffer(SCR_ID_EMAIL_FLDR_JUMP, &inputBufferSize);
- InitializeCategory57Screen();
- mmi_email_fldr_fill_jump_inline_struct();
- if (inputBuffer != NULL)
- {
- SetCategory57Data(wgui_inline_items, EMAIL_JUMP_PAGE_TOTAL_ITEM, inputBuffer);
- }
- DisableCategory57ScreenDone();
- ShowCategory57Screen(
- STR_EMAIL_IMAP4_JUMP_TO_PAGE_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- EMAIL_JUMP_PAGE_TOTAL_ITEM,
- NULL,
- wgui_inline_items,
- 0,
- guiBuffer);
- SetCategory57RightSoftkeyFunctions(mmi_email_fldr_jump_page_req, GoBackHistory);
- SetLeftSoftkeyFunction(mmi_email_fldr_jump_page_req, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_exit_jump_page
- * DESCRIPTION
- * Exit function of Jump To Page screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_exit_jump_page(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_util_add_n_history(SCR_ID_EMAIL_FLDR_JUMP, mmi_email_entry_jump_page);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_fldr_fill_jump_inline_struct
- * DESCRIPTION
- * Fill inline data structure for Jump to Page screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_fldr_fill_jump_inline_struct(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 *asciiPageNumberInfoBuff = OslMalloc(EMAIL_MAX_FLDR_CAP_LEN);
- S8 *ucs2PageNumberInfoBuff = OslMalloc(EMAIL_MAX_FLDR_CAP_LEN * ENCODING_LENGTH);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Caption */
- SetInlineItemActivation(&wgui_inline_items[0], KEY_LSK, KEY_EVENT_UP);
- sprintf((S8*) asciiPageNumberInfoBuff, " [%u/%u]", email_p->fldr_info.curr_page, email_p->fldr_info.total_page);
- AnsiiToUnicodeString((S8*) ucs2PageNumberInfoBuff, (S8*) asciiPageNumberInfoBuff);
- pfnUnicodeStrcpy((S8*) email_p->comm_buff, (S8*) GetString(STR_EMAIL_IMAP4_PAGE_NUMBER_ID));
- pfnUnicodeStrcat((S8*) email_p->comm_buff, (S8*) ucs2PageNumberInfoBuff);
- SetInlineItemCaption(&wgui_inline_items[0], (U8*) email_p->comm_buff);
- SetInlineItemFullWidth(&wgui_inline_items[0]);
- LeftJustifyInlineItem(&wgui_inline_items[0]);
- /* Page number */
- SetInlineItemActivation(&wgui_inline_items[1], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- sprintf((S8*) asciiPageNumberInfoBuff, "%u", email_p->fldr_info.curr_page);
- AnsiiToUnicodeString((S8*) email_p->fldr_info.jump_page_buff, (S8*) asciiPageNumberInfoBuff);
- SetInlineItemTextEdit(
- &wgui_inline_items[1],
- (U8*) email_p->fldr_info.jump_page_buff,
- EMAIL_MAX_JUMP_PAGE_INPUT_LEN + 1,
- INPUT_TYPE_NUMERIC);
- RightJustifyInlineItem(&wgui_inline_items[1]);
- EnableInlineItemBoundary(&wgui_inline_items[1]);
- SetInlineItemFullWidth(&wgui_inline_items[1]);
- DisableInlineItemHighlight(&wgui_inline_items[1]);
- OslMfree(asciiPageNumberInfoBuff);
- OslMfree(ucs2PageNumberInfoBuff);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_fldr_jump_page_req
- * DESCRIPTION
- * Retrieve data from Jump Page inline editor screen and go to corresponding page
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_fldr_jump_page_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- CloseCategory57Screen();
- if (pfnUnicodeStrlen((S8*) email_p->fldr_info.jump_page_buff))
- {
- U16 len;
- U16 pageNumberT;
- S8 ansiiPageNumber[EMAIL_MAX_JUMP_PAGE_INPUT_LEN + 1];
- len = UnicodeNToAnsii(
- (S8*) ansiiPageNumber,
- (S8*) email_p->fldr_info.jump_page_buff,
- (pfnUnicodeStrlen((S8*) email_p->fldr_info.jump_page_buff) * ENCODING_LENGTH));
- ansiiPageNumber[len] = ' ';
- pageNumberT = atoi(ansiiPageNumber);
- if (pageNumberT > email_p->fldr_info.total_page || pageNumberT < 1)
- {
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_IMAP4_INVALID_PAGE_NUMBER_ID),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- }
- else
- {
- email_p->fldr_info.curr_page = pageNumberT;
- mmi_email_fldr_exec_jump_page();
- }
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_EMPTY),
- IMG_GLOBAL_EMPTY,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) EMPTY_LIST_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_fldr_next_page_req
- * DESCRIPTION
- * Get next page index of current page and go to the page
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_fldr_next_page_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->fldr_info.curr_page++;
- if ((email_p->fldr_info.curr_page > email_p->fldr_info.total_page) || (email_p->fldr_info.curr_page < 1))
- {
- email_p->fldr_info.curr_page = 1;
- }
- mmi_email_fldr_exec_jump_page();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_fldr_prev_page_req
- * DESCRIPTION
- * Get previous page index of current page and go to the page
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_fldr_prev_page_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->fldr_info.curr_page--;
- if (email_p->fldr_info.curr_page < 1)
- {
- email_p->fldr_info.curr_page = (S8) email_p->fldr_info.total_page;
- }
- mmi_email_fldr_exec_jump_page();
- }
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- /*****************************************************************************
- * FUNCTION
- * mmi_email_fldr_get_num_mails
- * DESCRIPTION
- * Get number of mails to be displayed in current folder.
- * PARAMETERS
- * void
- * RETURNS
- * Number of malis.
- *****************************************************************************/
- S32 mmi_email_fldr_get_num_mails(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 numItems;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- if (email_p->prof_info.act_prof.in_prot == EMAIL_PROT_IMAP4 && email_p->main_info.curr_menu != MMI_EMAIL_UNSENT)
- {
- numItems =
- (!email_p->fldr_info.fldr_list.num_msgs) ? email_p->fldr_info.fldr_data[email_p->main_info.curr_menu].
- total_mails : email_p->fldr_info.fldr_list.num_msgs;
- /* IMAP4 is page-based, can display one page per time -- this might be redudant because */
- numItems = (numItems > MMI_EMAIL_MAX_MSG_PER_PAGE) ? MMI_EMAIL_MAX_MSG_PER_PAGE : numItems;
- }
- else
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- numItems = email_p->fldr_info.fldr_data[email_p->main_info.curr_menu].total_mails;
- if (email_p->fldr_info.is_list_updated == FALSE && numItems == 0)
- {
- numItems = 1;
- }
- return numItems;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_fldr_reset_list_info
- * DESCRIPTION
- * Reset variales before entry a folder.
- * PARAMETERS
- * void
- * RETURNS
- * Number of malis.(?)
- *****************************************************************************/
- void mmi_email_fldr_reset_list_info(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 totalPool;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->fldr_info.is_list_displayed = FALSE;
- mmi_email_util_free_container_pool();
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- if (email_p->prof_info.act_prof.in_prot == EMAIL_PROT_IMAP4 && email_p->main_info.curr_menu != MMI_EMAIL_UNSENT)
- {
- totalPool = 1;
- }
- else
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- totalPool = EMAIL_TOTAL_POOL + 1;
- /* create pool */
- mmi_mem_create_container(
- totalPool,
- MMI_EMAIL_MAX_MSG_PER_PAGE,
- (void*)email_p->fldr_info.fldr_list.mail_list,
- sizeof(mmi_email_mail_info_struct),
- &email_p->mem_pool_info.mem_container);
- email_p->mem_pool_info.start_indx = 0;
- /* retreive start/end index of pool */
- /* for IMAP4 realted folder, because there is only 1 page, the maximal number is 5 (MMI_EMAIL_MAX_MSG_PER_PAGE),
- for POP3 and Unsent folder, the maximal number depends on maximal size of async pool */
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- if (email_p->prof_info.act_prof.in_prot == EMAIL_PROT_IMAP4 && email_p->main_info.curr_menu != MMI_EMAIL_UNSENT)
- {
- if (email_p->fldr_info.fldr_data[email_p->main_info.curr_menu].total_mails < MMI_EMAIL_MAX_MSG_PER_PAGE)
- {
- email_p->mem_pool_info.end_indx =
- email_p->fldr_info.fldr_data[email_p->main_info.curr_menu].total_mails - 1;
- }
- else
- {
- email_p->mem_pool_info.end_indx = MMI_EMAIL_MAX_MSG_PER_PAGE - 1;
- }
- }
- else
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- {
- if (email_p->fldr_info.fldr_data[email_p->main_info.curr_menu].total_mails < MAX_ASYNCDYNAMIC_ITEMS_BUFF)
- {
- email_p->mem_pool_info.end_indx =
- email_p->fldr_info.fldr_data[email_p->main_info.curr_menu].total_mails - 1;
- }
- else
- {
- email_p->mem_pool_info.end_indx = MAX_ASYNCDYNAMIC_ITEMS_BUFF - 1;
- }
- }
- email_p->mem_pool_info.not_avail_pool = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_fldr_reset_cntx
- * DESCRIPTION
- * Reset folder info.
- * PARAMETERS
- * flag [IN] Flag to indicate reseting all folder or not
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_fldr_reset_cntx(email_reset_fldr_enum flag)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (flag == EMAIL_RESET_ALL_FLDR)
- {
- memset(&email_p->fldr_info.fldr_data, 0, sizeof(email_folder_info_struct) * EMAIL_FLDR_TOTAL);
- }
- else
- {
- memset(&email_p->fldr_info.fldr_data[MMI_EMAIL_INBOX], 0, sizeof(email_folder_info_struct));
- memset(&email_p->fldr_info.fldr_data[MMI_EMAIL_SENT], 0, sizeof(email_folder_info_struct));
- memset(&email_p->fldr_info.fldr_data[MMI_EMAIL_DRAFT], 0, sizeof(email_folder_info_struct));
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_fldr_corrupt_mail
- * DESCRIPTION
- * Entry function when folder message select failed. Might because of mail corrupted
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_fldr_corrupt_mail(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_FLDR_CORRUPT_MAIL, mmi_email_exit_fldr_corrupt_mail, NULL, NULL);
- ShowCategory154Screen(
- STR_EMAIL_MAIN_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_DELETE,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- (U8*) GetString(email_p->inbox_info.read_err_msg),
- NULL,
- IMG_EMAIL_SEND_FAIL_ID,
- NULL);
- /* LSK == Delete, RSK == Back */
- SetLeftSoftkeyFunction(mmi_email_del_single_msg_done, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_exit_fldr_corrupt_mail
- * DESCRIPTION
- * Exit function when folder message select failed.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_exit_fldr_corrupt_mail(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_util_add_history(SCR_ID_EMAIL_FLDR_CORRUPT_MAIL, mmi_email_entry_fldr_corrupt_mail);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_fldr_progress
- * DESCRIPTION
- * Display progessing screen before entry a folder.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_fldr_progress(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (GetExitScrnID() != SCR_ID_EMAIL_FLDR_LIST_PROGRESS)
- {
- /* if (email_p->fldr_info.is_list_displayed) */
- EntryNewScreen(SCR_ID_EMAIL_FLDR_LIST_PROGRESS, mmi_email_exit_fldr_progress, NULL, NULL);
- // else
- // ReplaceNewScreenHandler(SCR_ID_EMAIL_FLDR_LIST_PROGRESS, mmi_email_exit_fldr_progress, NULL);
- ShowCategory154Screen(
- STR_EMAIL_COMMON_LOADING_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- 0,
- 0,
- mmi_email_util_abort_str(),
- mmi_email_util_abort_img(),
- (U8*) GetString(STR_EMAIL_COMMON_LOADING_ID),
- NULL,
- IMG_EMAIL_CONNECTING_ID,
- NULL);
- SetKeyHandler(NULL, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(NULL, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_util_get_abort_func(), KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(mmi_email_util_get_abort_func(), KEY_EVENT_UP);
- SetKeyHandler(mmi_email_util_get_abort_func(), KEY_END, KEY_EVENT_DOWN);
- DeleteScreenIfPresent(SCR_ID_EMAIL_FLDR_LIST_PROGRESS);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_exit_fldr_progress
- * DESCRIPTION
- * Exit function of folder progressing screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_exit_fldr_progress(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* to make sure only 1 progressing screen in history */
- if (!IsScreenPresent(SCR_ID_EMAIL_FLDR_LIST_PROGRESS))
- {
- mmi_email_util_add_history(SCR_ID_EMAIL_FLDR_LIST_PROGRESS, mmi_email_entry_fldr_progress);
- }
- }
- #define FMGR_EMAIL
- /*****************************************************************************
- * FUNCTION
- * mmi_email_fmgr_free_mem_n_back
- * DESCRIPTION
- * Free allocated memory and go back to previous screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_fmgr_free_mem_n_back(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (email_p->other_app_info.fmgr_path)
- {
- OslMfree(email_p->other_app_info.fmgr_path);
- email_p->other_app_info.fmgr_path = NULL;
- }
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_fmgr_send
- * DESCRIPTION
- * Interface for file manager to send a file.
- * PARAMETERS
- * filePath [IN] Complete file path and name of the selected file
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_fmgr_send(S8 *filePath)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 fileLen;
- S32 f_result;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((email_p->main_info.ready_state & EMAIL_READY) == EMAIL_READY)
- {
- if (filePath == NULL)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_EMPTY),
- IMG_GLOBAL_EMPTY,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) EMPTY_LIST_TONE);
- }
- else 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);
- }
- else 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
- {
- /* check file size */
- if ((f_result = mmi_email_util_get_file_size(filePath, &fileLen)) == FS_NO_ERROR)
- {
- // if (fileLen > MMI_EMAIL_MAX_ATTACH_SIZE)
- if (fileLen > MMI_EMAIL_TOTAL_MAX_ATTACH_SIZE)
- {
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_SIZE_TOO_LARGE),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- }
- else
- {
- /* proceed adding attachment */
- if (email_p->other_app_info.fmgr_path == NULL)
- {
- email_p->other_app_info.fmgr_path = OslMalloc((FMGR_MAX_PATH_LEN + 1) * ENCODING_LENGTH);
- }
- pfnUnicodeStrcpy((S8*) email_p->other_app_info.fmgr_path, (S8*) filePath);
- if (mmi_email_comp_get_done_status())
- {
- mmi_email_display_confirm(
- STR_EMAIL_OVERWRITE_WARNING,
- mmi_email_fmgr_exec_send,
- mmi_email_fmgr_free_mem_n_back);
- }
- else
- {
- mmi_email_fmgr_exec_send();
- }
- }
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(GetFileSystemErrorString(f_result)),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- }
- }
- }
- 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_fmgr_exec_send
- * DESCRIPTION
- * Execute sending of a file.
- * Initialize global variable of Write Email screen and send email start request.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_fmgr_exec_send(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 dirLen;
- S8 *fileName;
- S8 *fileExt;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* extract file name and path */
- dirLen = (S32) mmi_fmgr_get_last_dir_index((S8*) email_p->other_app_info.fmgr_path);
- fileName = (S8*) email_p->other_app_info.fmgr_path;
- fileName += dirLen;
- /* set state of Email */
- email_p->main_info.entry_src = EMAIL_FROM_APP;
- /* initialize structure of Write Email screen */
- mmi_email_comp_reset_member();
- /* copy file to file buffer */
- pfnUnicodeStrcpy((S8*) email_p->comp_info.attch_list[0].file_name, (S8*) fileName);
- /* file extension */
- fileExt = mmi_email_get_file_ext((S8*) fileName);
- /* destination file name */
- mmi_email_util_get_attch_name(1, (S8*) email_p->comp_info.attch_list[0].file_path);
- pfnUnicodeStrcat((S8*) email_p->comp_info.attch_list[0].file_path, (S8*) fileExt);
- pfnUnicodeStrcpy((S8*) email_p->comm_buff, (S8*) email_p->other_app_info.fmgr_path);
- email_p->misc_info.file_copy_state = EMAIL_FILE_FROM_APP;
- FS_Delete((U16*) email_p->comp_info.attch_list[0].file_path);
- mmi_fmgr_send_copy_req(
- FMGR_ACTION_COPY,
- (U8*) email_p->comm_buff,
- (U8*) email_p->comp_info.attch_list[0].file_path,
- mmi_email_comp_attach_copy_callback);
- 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);
- OslMfree(email_p->other_app_info.fmgr_path);
- email_p->other_app_info.fmgr_path = NULL;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_fmgr_reset_status_icon
- * DESCRIPTION
- * When file system formats by file manager,
- * it should call the function to reset email status icon.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_fmgr_reset_status_icon(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->main_info.unread_mails = 0;
- email_p->main_info.is_mem_full = FALSE;
- HideStatusIcon(STATUS_ICON_UNREAD_EMAIL_L1);
- UpdateStatusIcons();
- }
- #define PHONEBOOK_EMAIL
- /*****************************************************************************
- * FUNCTION
- * mmi_email_send_from_phb
- * DESCRIPTION
- * Interface for sending from Phonebook module
- * PARAMETERS
- * name [IN] Name of selected person
- * email [IN] Email address of selected person
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_send_from_phb(S8 *name, S8 *email)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((email_p->main_info.ready_state & EMAIL_READY) == EMAIL_READY)
- {
- email_p->other_app_info.phb_name = name;
- email_p->other_app_info.phb_email = email;
- if (!pfnUnicodeStrlen((S8*) email_p->other_app_info.phb_email))
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_EMPTY),
- IMG_GLOBAL_EMPTY,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) EMPTY_LIST_TONE);
- }
- else
- {
- if (mmi_email_comp_get_done_status())
- {
- mmi_email_display_confirm(STR_EMAIL_OVERWRITE_WARNING, mmi_email_send_from_phb_done, GoBackHistory);
- }
- else
- {
- mmi_email_send_from_phb_done();
- }
- }
- }
- 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_send_from_phb_done
- * DESCRIPTION
- * Execute send from phonebook
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_send_from_phb_done(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_comp_reset_member();
- /* copy address to To */
- pfnUnicodeStrcpy(
- (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_mail[0],
- (S8*) email_p->other_app_info.phb_email);
- pfnUnicodeStrncpy(
- (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_name[0],
- (S8*) email_p->other_app_info.phb_name,
- EMAIL_PROF_DISP_NAME_LEN);
- /* copy name if existing */
- if (pfnUnicodeStrlen((S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_name[0]))
- {
- pfnUnicodeStrcpy((S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_TO], (S8*) g_email_subj_left_op);
- pfnUnicodeStrcat(
- (S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_TO],
- (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_name[0]);
- pfnUnicodeStrcat((S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_TO], (S8*) g_email_subj_right_op);
- pfnUnicodeStrcat(
- (S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_TO],
- (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_mail[0]);
- }
- else
- {
- pfnUnicodeStrcpy(
- (S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_TO],
- (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_mail[0]);
- }
- email_p->main_info.entry_src = EMAIL_FROM_APP;
- email_p->main_info.curr_menu = MMI_EMAIL_COMP;
- /* start email module */
- mmi_email_ps_start_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_phb_get_addr_callback
- * DESCRIPTION
- * Callback function for phonebook when finish selecting an Email address
- * PARAMETERS
- * name [IN] Name of selected person
- * email [IN] Email address of selected person
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_phb_get_addr_callback(S8 *name, S8 *email)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (pfnUnicodeStrlen(email) == 0)
- {
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_EMAIL_ADDRESS_EMPTY),
- IMG_GLOBAL_ERROR,
- FALSE,
- UI_POPUP_NOTIFYDURATION_TIME,
- ERROR_TONE);
- }
- else
- {
- pfnUnicodeStrncpy((S8*) email_p->comp_info.phb_name, (S8*) name, EMAIL_PROF_DISP_NAME_LEN);
- pfnUnicodeStrcpy((S8*) email_p->comp_info.phb_addr, (S8*) email);
- pfnUnicodeStrcpy((S8*) email_p->comp_info.addr_input_buff, (S8*) email);
- email_p->comp_info.load_addr_done = TRUE;
- GoBackHistory();
- }
- }
- #endif /* __MMI_EMAIL__ */
- #endif /* _MMI_EMAILAPPUIINTERFACE_C */ // #ifndef _MMI_EMAILAPPUIINTERFACE_C