EmailAppUIInterface.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:476k
源码类别:
MTK
开发平台:
C/C++
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_read_attch_opt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 numItems;
- U16 nStrItemList[2]; /* only view and save */
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_READ_ATTCH_OPT, NULL, mmi_email_entry_read_attch_opt, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_READ_ATTCH_OPT);
- SetParentHandler(MENU_ID_EMAIL_INBOX_ATTCH_OPT);
- numItems = GetNumOfChild(MENU_ID_EMAIL_INBOX_ATTCH_OPT);
- GetSequenceStringIds(MENU_ID_EMAIL_INBOX_ATTCH_OPT, nStrItemList);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_GLOBAL_OPTIONS,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- NULL,
- 0,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_read_attch_view
- * DESCRIPTION
- * View/Play attachment file according to its type.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_read_attch_view(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 *fileExtPtr = mmi_email_get_file_ext((S8*) email_p->inbox_info.read_info.attch_list[email_p->misc_info.curr_hilite_attch].
- file_name);
- S8 *fileExt = OslMalloc((FMGR_MAX_EXT_LEN + 1) * ENCODING_LENGTH);
- U8 fileType;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (fileExtPtr)
- {
- /* neglect "." */
- fileExtPtr = fileExtPtr + 2;
- UnicodeToAnsii(fileExt, fileExtPtr);
- }
- fileType = mmi_fmgr_get_file_group((S8*) email_p->inbox_info.read_info.attch_list[email_p->misc_info.curr_hilite_attch].
- file_path);
- if (fileType == FMGR_GROUP_IMAGE)
- {
- EntryNewScreen(SCR_ID_EMAIL_READ_VIEW_IMG, NULL, mmi_email_entry_read_attch_view, NULL);
- if (mmi_email_uti_strnicmp("ems", fileExt, strlen(fileExt)) == 0)
- {
- ShowCategory144Screen(
- (U8*) GetString(STR_GLOBAL_VIEW),
- GetRootTitleIcon(MAIN_MENU_FILE_MNGR_MENUID),
- 0,
- 0,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- EMS_OBJECT_MY_PICTURE_STATE | CATEGORY144_FMGR_PREVIEW | CATEGORY144_EMAIL_PREVIEW,
- 1,
- NULL,
- (U16*) email_p->inbox_info.read_info.attch_list[email_p->misc_info.curr_hilite_attch].file_path,
- FALSE,
- NULL,
- 0,
- NULL);
- }
- else if (mmi_email_uti_strnicmp("anm", fileExt, strlen(fileExt)) == 0)
- {
- ShowCategory144Screen(
- (U8*) GetString(STR_GLOBAL_VIEW),
- GetRootTitleIcon(MAIN_MENU_FILE_MNGR_MENUID),
- 0,
- 0,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- EMS_OBJECT_MY_ANIMATION_STATE | CATEGORY144_FMGR_PREVIEW | CATEGORY144_EMAIL_PREVIEW,
- 1,
- NULL,
- (U16*) email_p->inbox_info.read_info.attch_list[email_p->misc_info.curr_hilite_attch].file_path,
- FALSE,
- NULL,
- 0,
- NULL);
- }
- else
- {
- ShowCategory222Screen(
- STR_GLOBAL_VIEW,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- 0,
- 0,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- GDI_COLOR_WHITE,
- NULL,
- (S8*) email_p->inbox_info.read_info.attch_list[email_p->misc_info.curr_hilite_attch].file_path,
- FALSE,
- NULL);
- }
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(mmi_email_read_attach_save, KEY_EVENT_UP);
- }
- else if (fileType == FMGR_GROUP_AUDIO)
- {
- mmi_audply_single_play(
- (UI_string_type) email_p->inbox_info.read_info.attch_list[email_p->misc_info.curr_hilite_attch].file_path,
- NULL);
- }
- #ifdef __MMI_VIDEO_PLAYER__
- else if (fileType == FMGR_GROUP_VIDEO)
- {
- mmi_vdoply_entry_player_screen_from_file(
- (S8*) email_p->inbox_info.read_info.attch_list[email_p->misc_info.curr_hilite_attch].file_path,
- FALSE);
- }
- #endif /* __MMI_VIDEO_PLAYER__ */
- else if (email_p->inbox_info.read_info.attch_list[email_p->misc_info.curr_hilite_attch].attch_type == MIME_TYPE_APPLICATION) /* only for imelody */
- {
- mmi_audply_single_play(
- (UI_string_type) email_p->inbox_info.read_info.attch_list[email_p->misc_info.curr_hilite_attch].file_path,
- NULL);
- }
- OslMfree(fileExt);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_read_pre_entry_save_attch
- * DESCRIPTION
- * Retrieve file extention and go to file name screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_read_pre_entry_save_attch(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 *fileExt;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- pfnUnicodeStrcpy(
- (S8*) email_p->filename_buff,
- (S8*) email_p->inbox_info.read_info.attch_list[email_p->misc_info.curr_hilite_attch].file_name);
- fileExt = mmi_email_get_file_ext((S8*) email_p->filename_buff);
- if (fileExt)
- {
- pfnUnicodeStrcpy((S8*) email_p->fileext_buff, fileExt);
- /* clear file extention */
- fileExt[0] = 0;
- fileExt[1] = 0;
- }
- else
- {
- email_p->fileext_buff[0] = 0x0000;
- }
- mmi_email_entry_read_attch_save();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_read_attch_save
- * DESCRIPTION
- * Entry input filename screen for attachment.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_read_attch_save(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_READ_ATTCH_SAVE, NULL, mmi_email_entry_read_attch_save, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_READ_ATTCH_SAVE);
- ShowCategory5Screen(
- STR_EMAIL_FILENAME_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_OPTIONS,
- IMG_GLOBAL_OPTIONS,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE,
- (U8*) email_p->filename_buff,
- FMGR_MAX_INPUT_FILE_LEN,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_email_entry_read_save_attch_opt, KEY_EVENT_UP);
- SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_read_save_attch_opt
- * DESCRIPTION
- * Entry option screen for save attachment
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_read_save_attch_opt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 numItems;
- U16 nStrItemList[2]; /* only done and input method */
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_READ_ATTCH_SAVE_OPT, NULL, mmi_email_entry_read_save_attch_opt, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_READ_ATTCH_SAVE_OPT);
- SetParentHandler(MENU_ID_EMAIL_INBOX_READ_ATTCH_SAVE_OPT);
- numItems = GetNumOfChild(MENU_ID_EMAIL_INBOX_READ_ATTCH_SAVE_OPT);
- GetSequenceStringIds(MENU_ID_EMAIL_INBOX_READ_ATTCH_SAVE_OPT, nStrItemList);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_GLOBAL_OPTIONS,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- NULL,
- 0,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_read_save_attch
- * DESCRIPTION
- * Save attachment from Read Email screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_read_save_attch(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 result;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- result = mmi_email_read_copy_attch((U8) (email_p->misc_info.curr_hilite_attch + 1), (S8*) email_p->filename_buff);
- switch (result)
- {
- case EMAIL_SAVE_ATTACH_NO_ERR:
- mmi_email_pre_entry_progressing(
- STR_EMAIL_MAIN_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- 0,
- 0,
- 0,
- 0,
- (U8*) GetString(STR_GLOBAL_SAVING),
- (U8*) NULL,
- IMG_EMAIL_CONNECTING_ID,
- NULL,
- NULL,
- NULL,
- 0);
- break;
- case EMAIL_SAVE_ATTACH_DUP_NAME:
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_DUPLICATE_FILENAME),
- IMG_GLOBAL_ERROR,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- break;
- case EMAIL_SAVE_ATTACH_EMPTY_NAME:
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_EMPTY_FILENAME),
- IMG_GLOBAL_ERROR,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- break;
- case EMAIL_SAVE_ATTACH_NAME_TOO_LONG:
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_FILENAME_TOO_LONG),
- IMG_GLOBAL_ERROR,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- break;
- default:
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_UNFINISHED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- break;
- }
- DeleteUptoScrID(SCR_ID_EMAIL_READ_ATTCH);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_read_opt
- * DESCRIPTION
- * Entry Option screen of Inbox->Read
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_read_opt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 numItems;
- U16 nStrItemList[MAX_SUB_MENUS];
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_READ_OPT, NULL, mmi_email_entry_read_opt, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_READ_OPT);
- SetParentHandler(MENU_ID_EMAIL_INBOX_READ_OPT);
- numItems = GetNumOfChild(MENU_ID_EMAIL_INBOX_READ_OPT);
- GetSequenceStringIds(MENU_ID_EMAIL_INBOX_READ_OPT, nStrItemList);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_GLOBAL_OPTIONS,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- NULL,
- 0,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_read_fill_reply_data
- * DESCRIPTION
- * Fill common data for Reply
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_read_fill_reply_data(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 subLenToBeReplied;
- U32 prefixReWithColonStrLen;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_comp_reset_member();
- /* copy From to To */
- email_p->comp_info.addr_list[EMAIL_ADDR_TO].num_addr = 1;
- pfnUnicodeStrcpy(
- (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_mail[0],
- (S8*) email_p->inbox_info.from_info.from_addr);
- pfnUnicodeStrcpy(
- (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_name[0],
- (S8*) email_p->inbox_info.from_info.from_name);
- /* Display buffer of From */
- 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]);
- }
- /* fill subject with "RE: <previous >" */
- subLenToBeReplied = pfnUnicodeStrlen((S8*) email_p->inbox_info.read_info.subj_buff);
- prefixReWithColonStrLen = pfnUnicodeStrlen((S8*) g_email_re_str);
- if ((subLenToBeReplied + prefixReWithColonStrLen) > EMAIL_COMP_SUBJ_LEN)
- {
- subLenToBeReplied = EMAIL_COMP_SUBJ_LEN - prefixReWithColonStrLen;
- }
- pfnUnicodeStrcpy((S8*) email_p->comp_info.subj_buff, (S8*) g_email_re_str);
- pfnUnicodeStrncat(
- (S8*) email_p->comp_info.subj_buff,
- (S8*) email_p->inbox_info.read_info.subj_buff,
- subLenToBeReplied);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_read_reply
- * DESCRIPTION
- * Execute Read->Reply option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_read_reply(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_read_fill_reply_data();
- /* content */
- pfnUnicodeStrcpy((S8*) email_p->comp_info.cont_buff, (S8*) email_p->inbox_info.read_info.cont_buff);
- /* attachment */
- mmi_email_util_rename_read_to_comp();
- /* entry Write Email screen */
- mmi_email_entry_comp();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_read_reply_without
- * DESCRIPTION
- * Execute Read->Reply Without Content option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_read_reply_without(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_read_fill_reply_data();
- /* display compose screen */
- if (mmi_email_comp_add_sig() == FALSE)
- {
- return;
- }
- mmi_email_entry_comp();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_read_fill_reply_all_data
- * DESCRIPTION
- * Fill common data for Reply All
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_read_fill_reply_all_data(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- S32 j;
- U32 subLenToBeReplied;
- U32 prefixReWithColonStrLen;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_comp_reset_member();
- /* copy FROM to TO */
- pfnUnicodeStrcpy(
- (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_mail[0],
- (S8*) email_p->inbox_info.from_info.from_addr);
- pfnUnicodeStrcpy(
- (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_name[0],
- (S8*) email_p->inbox_info.from_info.from_name);
- email_p->comp_info.addr_list[EMAIL_ADDR_TO].num_addr = 1;
- /* From TO to TO */
- i = 1;
- for (j = 0; j < email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_TO].num_addr; j++)
- {
- if (pfnUnicodeStrcmp
- ((S8*) email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_TO].to_cc_mail[j],
- (S8*) email_p->prof_info.act_prof.email_addr))
- {
- pfnUnicodeStrcpy(
- (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_mail[i],
- (S8*) email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_TO].to_cc_mail[j]);
- pfnUnicodeStrcpy(
- (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_name[i],
- (S8*) email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_TO].to_cc_name[j]);
- email_p->comp_info.addr_list[EMAIL_ADDR_TO].num_addr++;
- i++;
- }
- if (email_p->comp_info.addr_list[EMAIL_ADDR_TO].num_addr == MMI_EMAIL_MAX_LEN_ADDR_LIST)
- {
- break;
- }
- }
- /* display buffer of TO */
- 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]);
- }
- if (email_p->comp_info.addr_list[EMAIL_ADDR_TO].num_addr > 1)
- {
- pfnUnicodeStrcat((S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_TO], (S8*) g_email_3dots);
- }
- /* copy CC to CC */
- for (i = 0; i < email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_CC].num_addr; i++)
- {
- pfnUnicodeStrcpy(
- (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_CC].to_cc_mail[i],
- (S8*) email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_CC].to_cc_mail[i]);
- pfnUnicodeStrcpy(
- (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_CC].to_cc_name[i],
- (S8*) email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_CC].to_cc_name[i]);
- email_p->comp_info.addr_list[EMAIL_ADDR_CC].num_addr++;
- }
- /* display buffer of CC */
- if (email_p->comp_info.addr_list[EMAIL_ADDR_CC].num_addr != 0)
- {
- if (pfnUnicodeStrlen((S8*) email_p->comp_info.addr_list[EMAIL_ADDR_CC].to_cc_name[0]))
- {
- pfnUnicodeStrcpy((S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_CC], (S8*) g_email_subj_left_op);
- pfnUnicodeStrcat(
- (S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_CC],
- (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_CC].to_cc_name[0]);
- pfnUnicodeStrcat((S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_CC], (S8*) g_email_subj_right_op);
- pfnUnicodeStrcat(
- (S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_CC],
- (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_CC].to_cc_mail[0]);
- }
- else
- {
- pfnUnicodeStrcpy(
- (S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_CC],
- (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_CC].to_cc_mail[0]);
- }
- if (email_p->comp_info.addr_list[EMAIL_ADDR_CC].num_addr > 1)
- {
- pfnUnicodeStrcat((S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_CC], (S8*) g_email_3dots);
- }
- }
- /* subject with "RE: <previous >" */
- subLenToBeReplied = pfnUnicodeStrlen((S8*) email_p->inbox_info.read_info.subj_buff);
- prefixReWithColonStrLen = pfnUnicodeStrlen((S8*) g_email_re_str);
- if ((subLenToBeReplied + prefixReWithColonStrLen) > EMAIL_COMP_SUBJ_LEN)
- {
- subLenToBeReplied = EMAIL_COMP_SUBJ_LEN - prefixReWithColonStrLen;
- }
- pfnUnicodeStrcpy((S8*) email_p->comp_info.subj_buff, (S8*) g_email_re_str);
- pfnUnicodeStrncat(
- (S8*) email_p->comp_info.subj_buff,
- (S8*) email_p->inbox_info.read_info.subj_buff,
- subLenToBeReplied);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_read_reply_all
- * DESCRIPTION
- * Execute Read->Reply All option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_read_reply_all(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_read_fill_reply_all_data();
- /* content */
- pfnUnicodeStrcpy((S8*) email_p->comp_info.cont_buff, (S8*) email_p->inbox_info.read_info.cont_buff);
- /* attachment */
- mmi_email_util_rename_read_to_comp();
- mmi_email_entry_comp();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_read_reply_all_without
- * DESCRIPTION
- * Execute Read->Reply All Without Content option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_read_reply_all_without(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_read_fill_reply_all_data();
- /* display compose screen */
- if (mmi_email_comp_add_sig() == FALSE)
- {
- return;
- }
- mmi_email_entry_comp();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_read_forward
- * DESCRIPTION
- * Execute Read->Forward option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_read_forward(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_fldr_prepare_forward();
- mmi_email_util_rename_read_to_comp();
- /* display compose screen */
- mmi_email_entry_comp();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_read_addr_send
- * DESCRIPTION
- * Execute Read->Address List -> Send option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_read_addr_send(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i = email_p->misc_info.curr_hilite_attch;
- S32 activeInputAddrMode = email_p->comp_info.curr_addr_type;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_comp_reset_member();
- /* copy user SELECETD entry to TO */
- email_p->comp_info.addr_list[EMAIL_ADDR_TO].num_addr = 1;
- if (activeInputAddrMode == EMAIL_ADDR_FROM)
- {
- pfnUnicodeStrcpy(
- (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_mail[0],
- (S8*) email_p->inbox_info.from_info.from_addr);
- pfnUnicodeStrcpy(
- (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_name[0],
- (S8*) email_p->inbox_info.from_info.from_name);
- }
- else
- {
- pfnUnicodeStrcpy(
- (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_mail[0],
- (S8*) email_p->inbox_info.read_info.addr_list[activeInputAddrMode].to_cc_mail[i]);
- pfnUnicodeStrcpy(
- (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_name[0],
- (S8*) email_p->inbox_info.read_info.addr_list[activeInputAddrMode].to_cc_name[i]);
- }
- /* display buffer */
- 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]);
- }
- /* display compose screen */
- if (mmi_email_comp_add_sig() == FALSE)
- {
- return;
- }
- mmi_email_entry_comp();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_read_addr_save
- * DESCRIPTION
- * Execute Read->Address List -> Save to Phonebook option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_read_addr_save(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 *pMailAddr = NULL;
- S8 *pMailName = NULL;
- S32 curr_addr = email_p->comp_info.curr_addr_type;
- S32 i = email_p->misc_info.curr_hilite_attch;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (email_p->comp_info.curr_addr_type == EMAIL_ADDR_FROM)
- {
- if (pfnUnicodeStrlen((S8*) email_p->inbox_info.from_info.from_addr))
- {
- pMailAddr = (S8*) email_p->inbox_info.from_info.from_addr;
- }
- if (pfnUnicodeStrlen((S8*) email_p->inbox_info.from_info.from_name))
- {
- pMailName = (S8*) email_p->inbox_info.from_info.from_name;
- }
- }
- else /* take use of the order of TO and CC */
- {
- if (pfnUnicodeStrlen((S8*) email_p->inbox_info.read_info.addr_list[curr_addr].to_cc_mail[i]))
- {
- pMailAddr = (S8*) email_p->inbox_info.read_info.addr_list[curr_addr].to_cc_mail[i];
- }
- if (pfnUnicodeStrlen((S8*) email_p->inbox_info.read_info.addr_list[curr_addr].to_cc_name[i]))
- {
- pMailName = (S8*) email_p->inbox_info.read_info.addr_list[curr_addr].to_cc_name[i];
- }
- }
- mmi_phb_email_save_entry_to_phb(pMailName, pMailAddr);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_read_attach_save
- * DESCRIPTION
- * Enter file manager to select a folder to save attachment
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_read_attach_save(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- FMGR_FILTER filter;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- FMGR_FILTER_INIT(&filter);
- FMGR_FILTER_SET(&filter, FMGR_TYPE_FOLDER);
- mmi_fmgr_select_path_and_enter(
- APP_EMAIL,
- FMGR_SELECT_FOLDER,
- filter,
- (S8*) L"root",
- mmi_email_read_attch_sel_path_callback);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_read_attch_sel_path_callback
- * DESCRIPTION
- * Enter file manager to select a folder to save attachment
- * PARAMETERS
- * filePath [?]
- * is_short [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_read_attch_sel_path_callback(void *filePath, int is_short)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (filePath == NULL)
- {
- GoBackToHistory(SCR_ID_EMAIL_READ_ATTCH);
- return;
- }
- pfnUnicodeStrcpy((S8*) email_p->comm_buff, (S8*) filePath);
- /* use pass file folder to save attachment */
- mmi_email_read_pre_entry_save_attch();
- /* go to attachment screen because not all attachments have attachment option screen */
- DeleteUptoScrID(SCR_ID_EMAIL_READ_ATTCH);
- }
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_inbox_opt
- * DESCRIPTION
- * Entry function of Inbox -> Option
- * This screen exists only when IMAP4 is supported.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_inbox_opt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 numItems;
- U16 nStrItemList[MAX_SUB_MENUS];
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_INBOX_OPT, NULL, mmi_email_entry_inbox_opt, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_INBOX_OPT);
- SetParentHandler(MENU_ID_EMAIL_INBOX_OPT);
- numItems = GetNumOfChild(MENU_ID_EMAIL_INBOX_OPT);
- GetSequenceStringIds(MENU_ID_EMAIL_INBOX_OPT, nStrItemList);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_GLOBAL_OPTIONS,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- NULL,
- 0,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- #define SENT_EMAIL
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_sent
- * DESCRIPTION
- * Entry function of Sent folder
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_sent(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 numItems;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- numItems = mmi_email_fldr_get_num_mails();
- if (numItems)
- {
- U8 *guiBuffer;
- S32 list_not_ready;
- EntryNewScreen(SCR_ID_EMAIL_SENT, mmi_email_exit_sent, NULL, NULL);
- email_p->fldr_info.need_fldr_sel = FALSE;
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_SENT);
- RegisterHighlightHandler(mmi_email_hilite_sent_item);
- /* to prevent the selected mail being deleted */
- if (email_p->fldr_info.curr_mail_indx >= numItems)
- {
- email_p->fldr_info.curr_mail_indx = numItems - 1;
- }
- ShowCategory263Screen(
- mmi_email_util_folder_select_cap_str(STR_EMAIL_COMMON_SENT_ID),
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_OPTIONS,
- IMG_GLOBAL_OPTIONS,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- mmi_email_fldr_get_async_items,
- NULL,
- email_p->fldr_info.curr_mail_indx,
- IMG_EMAIL_SENT_NORMAL_ID,
- guiBuffer,
- &list_not_ready);
- if (list_not_ready)
- {
- mmi_email_fldr_pre_folder_select_req();
- }
- else
- {
- email_p->fldr_info.is_list_displayed = TRUE;
- SetLeftSoftkeyFunction(mmi_email_entry_sent_opt, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_entry_sent_opt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_EMPTY),
- IMG_GLOBAL_EMPTY,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) EMPTY_LIST_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_exit_sent
- * DESCRIPTION
- * Exit function of Sent folder
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_exit_sent(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_util_add_history(SCR_ID_EMAIL_SENT, mmi_email_fldr_back_from_history);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_sent_item
- * DESCRIPTION
- * Highlight handler of Sent list
- * PARAMETERS
- * index [IN] Index of highlighted item
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_sent_item(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_email_mail_info_struct *listMsgsStruct[EMAIL_TOTAL_MSG_BUFF];
- mmi_email_mail_info_struct *temp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_mem_get_values(
- &email_p->mem_pool_info.mem_container,
- (S16) index,
- (S16) index,
- (void **)listMsgsStruct,
- &email_p->mem_pool_info.not_avail_pool);
- temp = listMsgsStruct[0];
- email_p->fldr_info.curr_mail_indx = index;
- email_p->fldr_info.curr_mail_uid = temp->mail_uid;
- RedrawCategory251InfoBox((U8*) temp->addr_buff, (U8*) temp->dt_buff);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_sent_opt
- * DESCRIPTION
- * Entry function of Sent->Option screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_sent_opt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 numItems;
- U16 parentMenuId;
- U16 nStrItemList[MAX_SUB_MENUS];
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_SENT_OPT, NULL, mmi_email_entry_sent_opt, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_SENT_OPT);
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- if ((email_p->prof_info.act_prof.in_prot == EMAIL_PROT_IMAP4) && (email_p->fldr_info.total_page > 1))
- {
- parentMenuId = MENU_ID_EMAIL_SENT_OPT2; /* sent option for IMAP4 forwrd/delete/next page/previous page/jump to pages */
- }
- else
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- parentMenuId = MENU_ID_EMAIL_SENT_OPT1;
- SetParentHandler(parentMenuId);
- numItems = GetNumOfChild(parentMenuId);
- GetSequenceStringIds(parentMenuId, nStrItemList);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_GLOBAL_OPTIONS,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- NULL,
- 0,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_sent_forward
- * DESCRIPTION
- * Highlight handler of Sent -> Option -> Forward option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_sent_forward(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_ps_folder_msg_select_req, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_ps_folder_msg_select_req, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- #define UNSENT_EMAIL
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_unsent
- * DESCRIPTION
- * Entry function of Unsent folder
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_unsent(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 numItems;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- numItems = mmi_email_fldr_get_num_mails();
- if (numItems)
- {
- U8 *guiBuffer;
- S32 list_not_ready;
- EntryNewScreen(SCR_ID_EMAIL_UNSENT, mmi_email_exit_unsent, NULL, NULL);
- email_p->fldr_info.need_fldr_sel = FALSE;
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_UNSENT);
- RegisterHighlightHandler(mmi_email_hilite_unsent_item);
- /* to prevent the selected mail being deleted */
- if (email_p->fldr_info.curr_mail_indx >= numItems)
- {
- email_p->fldr_info.curr_mail_indx = numItems - 1;
- }
- ShowCategory263Screen(
- mmi_email_util_folder_select_cap_str(STR_EMAIL_COMMON_UNSENT_ID),
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_OPTIONS,
- IMG_GLOBAL_OPTIONS,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- mmi_email_fldr_get_async_items,
- NULL,
- email_p->fldr_info.curr_mail_indx,
- IMG_EMAIL_SENT_NORMAL_ID,
- guiBuffer,
- &list_not_ready);
- if (list_not_ready)
- {
- mmi_email_fldr_pre_folder_select_req();
- }
- else
- {
- email_p->fldr_info.is_list_displayed = TRUE;
- SetLeftSoftkeyFunction(mmi_email_entry_unsent_opt, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_entry_unsent_opt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_EMPTY),
- IMG_GLOBAL_EMPTY,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) EMPTY_LIST_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_exit_unsent
- * DESCRIPTION
- * Exit function of Unsent folder
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_exit_unsent(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_util_add_history(SCR_ID_EMAIL_UNSENT, mmi_email_fldr_back_from_history);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_unsent_item
- * DESCRIPTION
- * Highlight handler of Unsent list
- * PARAMETERS
- * index [IN] Index of highlighted item
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_unsent_item(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_email_mail_info_struct *listMsgsStruct[EMAIL_TOTAL_MSG_BUFF];
- mmi_email_mail_info_struct *temp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_mem_get_values(
- &email_p->mem_pool_info.mem_container,
- (S16) index,
- (S16) index,
- (void **)listMsgsStruct,
- &email_p->mem_pool_info.not_avail_pool);
- temp = listMsgsStruct[0];
- email_p->fldr_info.curr_mail_indx = index;
- email_p->fldr_info.curr_mail_uid = temp->mail_uid;
- RedrawCategory251InfoBox((U8*) temp->addr_buff, (U8*) temp->dt_buff);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_unsent_opt
- * DESCRIPTION
- * Entry function of Unsent-> Option screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_unsent_opt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 numItems;
- U16 nStrItemList[5]; /* only 5 items */
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_UNSENT_OPT, NULL, mmi_email_entry_unsent_opt, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_UNSENT_OPT);
- SetParentHandler(MENU_ID_EMAIL_UNSENT_OPT);
- numItems = GetNumOfChild(MENU_ID_EMAIL_UNSENT_OPT);
- GetSequenceStringIds(MENU_ID_EMAIL_UNSENT_OPT, nStrItemList);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_GLOBAL_OPTIONS,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- NULL,
- 0,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_unsent_send
- * DESCRIPTION
- * Highlight handler of of Unsent-> Send option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_unsent_send(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_unsent_send, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_unsent_save_n_send
- * DESCRIPTION
- * Highlight handler of of Unsent-> Save and Send option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_unsent_save_n_send(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_unsent_save_n_send, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_unsent_edit
- * DESCRIPTION
- * Highlight handler of of Unsent-> Edit
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_unsent_edit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_ps_folder_msg_select_req, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_ps_folder_msg_select_req, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_unsent_move
- * DESCRIPTION
- * Highlight handler of of Unsent-> Move to Deaft
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_unsent_move(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_ps_move_to_draft_req, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_unsent_send
- * DESCRIPTION
- * Handler of Unsent->Option->Send
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_unsent_send(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_ps_send_from_mailbox_req(FALSE);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_unsent_save_n_send
- * DESCRIPTION
- * Handler of Unsent->Option->Save and Send
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_unsent_save_n_send(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_ps_send_from_mailbox_req(TRUE);
- }
- #define DRAFT_EMAIL
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_draft
- * DESCRIPTION
- * Entry function of Draft folder
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_draft(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 numItems;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- numItems = mmi_email_fldr_get_num_mails();
- if (numItems)
- {
- U8 *guiBuffer;
- S32 list_not_ready;
- EntryNewScreen(SCR_ID_EMAIL_DRAFT, mmi_email_exit_draft, NULL, NULL);
- email_p->fldr_info.need_fldr_sel = FALSE;
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_DRAFT);
- RegisterHighlightHandler(mmi_email_hilite_draft_item);
- /* to prevent the selected mail being deleted */
- if (email_p->fldr_info.curr_mail_indx >= numItems)
- {
- email_p->fldr_info.curr_mail_indx = numItems - 1;
- }
- ShowCategory262Screen(
- mmi_email_util_folder_select_cap_str(STR_EMAIL_DRAFT_ID),
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_OPTIONS,
- IMG_GLOBAL_OPTIONS,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- mmi_email_fldr_get_async_items,
- mmi_email_draft_get_async_hints,
- email_p->fldr_info.curr_mail_indx,
- IMG_EMAIL_SENT_NORMAL_ID,
- guiBuffer,
- &list_not_ready);
- if (list_not_ready)
- {
- mmi_email_fldr_pre_folder_select_req();
- }
- else
- {
- email_p->fldr_info.is_list_displayed = TRUE;
- SetLeftSoftkeyFunction(mmi_email_entry_draft_opt, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_entry_draft_opt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_EMPTY),
- IMG_GLOBAL_EMPTY,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) EMPTY_LIST_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_exit_draft
- * DESCRIPTION
- * Exit function of Draft folder
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_exit_draft(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_util_add_history(SCR_ID_EMAIL_DRAFT, mmi_email_fldr_back_from_history);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_draft_item
- * DESCRIPTION
- * Highlight handler of Draft list
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_draft_item(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->fldr_info.curr_mail_indx = index;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_draft_get_async_hints
- * DESCRIPTION
- * Get hint data of Draft folder
- * PARAMETERS
- * start_indx [IN] Start index of item to be retrieved.
- * hintArray [IN] Array to store hint data
- * RETURNS
- * void
- *****************************************************************************/
- S32 mmi_email_draft_get_async_hints(S32 start_indx, UI_string_type *hintArray)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 pNotAvailPool;
- mmi_email_mail_info_struct *temp;
- mmi_email_mail_info_struct *listMsgsStruct[EMAIL_TOTAL_MSG_BUFF];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_mem_get_values(
- &email_p->mem_pool_info.mem_container,
- (S16) start_indx,
- (S16) start_indx,
- (void **)listMsgsStruct,
- &pNotAvailPool);
- temp = listMsgsStruct[0];
- email_p->fldr_info.curr_mail_uid = temp->mail_uid;
- pfnUnicodeStrcpy((S8*) hintArray[0], (S8*) temp->dt_buff);
- return TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_draft_opt
- * DESCRIPTION
- * Entry function of Draft->Option screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_draft_opt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 numItems;
- U16 parentMenuId;
- U16 nStrItemList[MAX_SUB_MENUS];
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_DRAFT_OPT, NULL, mmi_email_entry_draft_opt, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_DRAFT_OPT);
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- if ((email_p->prof_info.act_prof.in_prot == EMAIL_PROT_IMAP4) && (email_p->fldr_info.total_page > 1))
- {
- parentMenuId = MENU_ID_EMAIL_DRAFT_OPT2; /* (edit, delete, next page, previous page, jump to page) */
- }
- else
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- parentMenuId = MENU_ID_EMAIL_DRAFT_OPT1;
- SetParentHandler(parentMenuId);
- numItems = GetNumOfChild(parentMenuId);
- GetSequenceStringIds(parentMenuId, nStrItemList);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_GLOBAL_OPTIONS,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- NULL,
- 0,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_draft_edit
- * DESCRIPTION
- * Highlight handler of Draft->Option->Edit
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_draft_edit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_ps_folder_msg_select_req, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_ps_folder_msg_select_req, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- #define DELETE_EMAIL
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_del_all
- * DESCRIPTION
- * Entry function of Delete All option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_del_all(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 itemIcons[EMAIL_DELETE_ALL_OPTION_TOTAL];
- U8 *nStrItemList[EMAIL_DELETE_ALL_OPTION_TOTAL];
- U8 *popUpList[EMAIL_DELETE_ALL_OPTION_TOTAL];
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_DELETE_ALL, mmi_email_exit_del_all, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_DELETE_ALL);
- mmi_email_del_all_get_menu_detail(nStrItemList, itemIcons, popUpList);
- RegisterHighlightHandler(mmi_email_hilite_del_all_fldr);
- ShowCategory53Screen(
- STR_GLOBAL_DELETE_ALL,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- EMAIL_DELETE_ALL_OPTION_TOTAL,
- (U8 **) nStrItemList,
- (U16*) /* itemIcons */ gIndexIconsImageList,
- (U8 **) popUpList,
- 0,
- email_p->fldr_info.curr_mail_indx,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_email_del_all_confirm, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_exit_del_all
- * DESCRIPTION
- * Exit function of Delete All option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_exit_del_all(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_util_add_history(SCR_ID_EMAIL_DELETE_ALL, mmi_email_entry_del_all);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_del_all_get_menu_detail
- * DESCRIPTION
- * Get data of menu items in Delete All screen
- * PARAMETERS
- * nStrItemList [IN]
- * itemIcons [?]
- * popUpList [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_del_all_get_menu_detail(U8 **nStrItemList, U16 *itemIcons, U8 **popUpList)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < EMAIL_DELETE_ALL_OPTION_TOTAL; i++)
- {
- itemIcons[i] = IMG_EMAIL_INBOX_ID + i;
- nStrItemList[i] = (U8*) GetString((U16) (STR_EMAIL_INBOX_ID + i));
- }
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- if (email_p->prof_info.act_prof.in_prot == EMAIL_PROT_IMAP4)
- {
- /* sent folder */
- if (pfnUnicodeStrlen((S8*) email_p->prof_info.act_prof.sent_name))
- {
- nStrItemList[EMAIL_DEL_ALL_SENT_ENUM] = (U8*) email_p->prof_info.act_prof.sent_name;
- }
- /* draft folder */
- if (pfnUnicodeStrlen((S8*) email_p->prof_info.act_prof.draft_name))
- {
- nStrItemList[EMAIL_DEL_ALL_DRAFT_ENUM] = (U8*) email_p->prof_info.act_prof.draft_name;
- }
- }
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- popUpList[EMAIL_DEL_ALL_INBOX_ENUM] = mmi_email_util_get_fldr_hint_value(EMAIL_DEL_ALL_INBOX_ENUM, MMI_EMAIL_INBOX);
- popUpList[EMAIL_DEL_ALL_SENT_ENUM] = mmi_email_util_get_fldr_hint_value(EMAIL_DEL_ALL_SENT_ENUM, MMI_EMAIL_SENT);
- popUpList[EMAIL_DEL_ALL_UNSENT_ENUM] = mmi_email_util_get_fldr_hint_value(EMAIL_DEL_ALL_UNSENT_ENUM, MMI_EMAIL_UNSENT);
- popUpList[EMAIL_DEL_ALL_DRAFT_ENUM] = mmi_email_util_get_fldr_hint_value(EMAIL_DEL_ALL_DRAFT_ENUM, MMI_EMAIL_DRAFT);
- popUpList[EMAIL_DEL_ALL_FOLDER_ENUM] = mmi_email_util_get_hint_value_all_fldr(EMAIL_DEL_ALL_FOLDER_ENUM);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_fldr_msg_del
- * DESCRIPTION
- * Hililte function Folder List -> Option -> Delete option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_fldr_msg_del(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_del_single_msg, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_del_single_msg
- * DESCRIPTION
- * Display confirmation screen for Delete otpion in each folder
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_del_single_msg(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_display_confirm(STR_GLOBAL_DELETE, mmi_email_del_single_msg_done, GoBackHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_del_single_msg_done
- * DESCRIPTION
- * Proceed deleting of current selected folder
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_del_single_msg_done(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->del_info.curr_del_fldr = (email_fldr_enum) email_p->main_info.curr_menu;
- mmi_email_ps_folder_msg_del_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_del_all_confirm
- * DESCRIPTION
- * Display confirmation screen for each items in Delete All menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_del_all_confirm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (email_p->del_info.curr_del_fldr == EMAIL_DEL_ALL_FOLDER_ENUM)
- {
- U32 num_mails;
- num_mails = email_p->fldr_info.fldr_data[MMI_EMAIL_INBOX].total_mails +
- email_p->fldr_info.fldr_data[MMI_EMAIL_UNSENT].total_mails +
- email_p->fldr_info.fldr_data[MMI_EMAIL_SENT].total_mails +
- email_p->fldr_info.fldr_data[MMI_EMAIL_DRAFT].total_mails;
- email_p->del_info.curr_del_fldr = EMAIL_FLDR_INBOX;
- email_p->del_info.del_all_fldr = TRUE;
- if (num_mails != 0)
- {
- mmi_email_display_confirm(STR_GLOBAL_DELETE_ALL, mmi_email_del_all_folders, GoBackHistory);
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_EMPTY),
- IMG_GLOBAL_EMPTY,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) EMPTY_LIST_TONE);
- }
- }
- else
- {
- /* the order of folder will not be changed */
- email_p->del_info.del_all_fldr = FALSE;
- if (email_p->fldr_info.fldr_data[email_p->del_info.curr_del_fldr].total_mails != 0)
- {
- mmi_email_display_confirm(STR_GLOBAL_DELETE_ALL, mmi_email_ps_folder_msg_del_req, GoBackHistory);
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_EMPTY),
- IMG_GLOBAL_EMPTY,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) EMPTY_LIST_TONE);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_del_all_fldr
- * DESCRIPTION
- * Highlight handler of items in Delete All menu.
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_del_all_fldr(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->del_info.curr_del_fldr = (email_fldr_enum) index;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_del_all_folders
- * DESCRIPTION
- * Proceed delete all folders
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_del_all_folders(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (email_p->del_info.curr_del_fldr != EMAIL_DEL_ALL_FOLDER_ENUM)
- {
- mmi_email_ps_folder_msg_del_req();
- }
- else
- {
- U16 startSrcnId;
- /* update idle screen icon status */
- email_p->del_info.del_all_fldr = FALSE;
- email_p->main_info.unread_mails = 0;
- email_p->main_info.is_mem_full = FALSE;
- mmi_email_util_update_status_icon();
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- GetNextScrnIdOf(SCR_ID_EMAIL_DELETE_ALL, &startSrcnId);
- DeleteBetweenScreen(startSrcnId, SCR_ID_EMAIL_PROGRESS);
- }
- }
- #define PROFILE_EMAIL
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_prof_setting
- * DESCRIPTION
- * highlight handler for Profile Setting option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_prof_setting(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeyHandler(mmi_email_prof_get_data, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- email_p->prof_info.prof_misc.curr_scr = SCR_ID_EMAIL_PROF_SETTING;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_prof_smtp
- * DESCRIPTION
- * highlight handler for SMTP option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_prof_smtp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeyHandler(mmi_email_prof_get_data, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- email_p->prof_info.prof_misc.curr_scr = SCR_ID_EMAIL_PROF_SMTP;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_prof_pop3_impa4
- * DESCRIPTION
- * highlight handler for POP3/IMAP4 option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_prof_pop3_impa4(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeyHandler(mmi_email_prof_get_data, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- email_p->prof_info.prof_misc.curr_scr = SCR_ID_EMAIL_PROF_POP3_IMAP4;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_prof_sig
- * DESCRIPTION
- * highlight handler for Signature option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_prof_sig(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeyHandler(mmi_email_prof_get_data, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- email_p->prof_info.prof_misc.curr_scr = SCR_ID_EMAIL_PROF_SIG;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_comm_full_edit_opt
- * DESCRIPTION
- * Entry common full screen editor in Profile.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_comm_full_edit_opt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U16 itemList[2];
- U16 nItems;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_PROF_FULL_EDIT_OPT, NULL, mmi_email_entry_comm_full_edit_opt, NULL);
- SetParentHandler(MENU_ID_EMAIL_PROF_EDITOR_OPT);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_PROF_FULL_EDIT_OPT);
- nItems = GetNumOfChild(MENU_ID_EMAIL_PROF_EDITOR_OPT);
- GetSequenceStringIds(MENU_ID_EMAIL_PROF_EDITOR_OPT, itemList);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_GLOBAL_OPTIONS,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nItems,
- itemList,
- (PU16) gIndexIconsImageList,
- 0,
- 0,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_prof
- * DESCRIPTION
- * Entry profile list screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- extern const U16 gIndexIconsImageList[];
- void mmi_email_entry_prof(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- U8 *nStrItemList[MMI_EMAIL_MAX_ACCTS];
- U16 nIconItemList[MMI_EMAIL_MAX_ACCTS];
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_PROF, NULL, mmi_email_entry_prof, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_PROF);
- for (i = 0; i < MMI_EMAIL_MAX_ACCTS; i++)
- {
- nStrItemList[i] = (U8*) email_p->prof_info.prof_misc.acct_names[i];
- nIconItemList[i] = 0;
- }
- if (mmi_email_prof_is_activated())
- {
- nIconItemList[email_p->prof_info.act_prof.act_indx] = IMG_VICON;
- email_p->prof_info.prof_misc.curr_sel_prof = email_p->prof_info.act_prof.act_indx;
- }
- else
- {
- email_p->prof_info.prof_misc.curr_sel_prof = 0;
- }
- RegisterHighlightHandler(mmi_email_hilite_prof_list);
- /*
- * ShowCategory53Screen (STR_EMAIL_PROFILES_ID, GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- * STR_GLOBAL_OPTIONS, IMG_GLOBAL_OPTIONS,
- * STR_GLOBAL_BACK, IMG_GLOBAL_BACK,
- * MMI_EMAIL_MAX_ACCTS, nStrItemList,
- * (U16*)nIconItemList,
- * NULL, 0, (S32)email_p->prof_info.prof_misc.curr_sel_prof, guiBuffer);
- */
- ShowCategory73Screen(
- STR_EMAIL_PROFILES_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_OPTIONS,
- IMG_GLOBAL_OPTIONS,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- MMI_EMAIL_MAX_ACCTS,
- nStrItemList,
- (U16*) nIconItemList,
- (U16*) gIndexIconsImageList,
- (S32) email_p->prof_info.prof_misc.curr_sel_prof,
- guiBuffer,
- ICON_ICON_TEXT);
- SetLeftSoftkeyFunction(mmi_email_entry_prof_opt, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_entry_prof_opt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_prof_list
- * DESCRIPTION
- * Highlight handler of Profile list.
- * PARAMETERS
- * index [IN] Index of highlighted profile.
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_prof_list(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->prof_info.prof_misc.curr_sel_prof = (U8) index;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_prof_opt
- * DESCRIPTION
- * Entry function of Profile->Option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_prof_opt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 numItems;
- U16 nStrItemList[2]; /* only Done and Input Method */
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_PROF_OPT, NULL, mmi_email_entry_prof_opt, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_PROF_OPT);
- SetParentHandler(MENU_ID_EMAIL_PROF_OPT);
- numItems = GetNumOfChild(MENU_ID_EMAIL_PROF_OPT);
- GetSequenceStringIds(MENU_ID_EMAIL_PROF_OPT, nStrItemList);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_EMAIL_PROFILE_OPTIONS_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);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_prof_activate
- * DESCRIPTION
- * Highlight handler of Profile->Acticate option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_prof_activate(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_prof_activate, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_prof_activate
- * DESCRIPTION
- * Handler of Profile->Option->Activate
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_prof_activate(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_ps_activate_acct_req((U8) (email_p->prof_info.prof_misc.curr_sel_prof + 1));
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_prof_get_data
- * DESCRIPTION
- * Send request to get current selected profile data.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_prof_get_data(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_ps_get_acct_profile_req((U8) (email_p->prof_info.prof_misc.curr_sel_prof + 1));
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_prof_edit
- * DESCRIPTION
- * Highlight handler of Profile->Edit option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_prof_edit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_entry_prof_edit, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_entry_prof_edit, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_prof_edit
- * DESCRIPTION
- * Entry function of Profile->Option->Edit
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_prof_edit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 numItems;
- U16 nStrItemList[EMAIL_PROF_TOTAL];
- U8 *guiBuffer;
- U16 emailEmailProfileSettingIcons[EMAIL_PROF_TOTAL] =
- {
- IMG_EMAIL_PROFILE_SETTING_ID,
- IMG_EMAIL_SMTP_SETTING_ID,
- IMG_EMAIL_IMAP_POP3_SETTING_ID,
- IMG_EMAIL_SIGNATURE_SETTING_ID
- };
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_PROF_OPT_EDIT, NULL, mmi_email_entry_prof_edit, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_PROF_OPT_EDIT);
- SetParentHandler(MENU_ID_EMAIL_PROF_EDIT_OPT);
- numItems = GetNumOfChild(MENU_ID_EMAIL_PROF_EDIT_OPT);
- GetSequenceStringIds(MENU_ID_EMAIL_PROF_EDIT_OPT, nStrItemList);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_EMAIL_PROFILE_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- nStrItemList,
- (U16*) emailEmailProfileSettingIcons,
- NULL,
- 0,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(mmi_email_prof_get_data, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_prof_setting
- * DESCRIPTION
- * Entry function of Profile Setting screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_prof_setting(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U8 *inputBuffer;
- U16 inputBufferSize;
- U16 setting_icon[EMAIL_SETTING_TOTAL_ITEM] =
- {
- IMG_EMAIL_PROFILE_NAME_ID, 0,
- IMG_EMAIL_DATA_ACCOUNT_ID, 0,
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- IMG_EMAIL_PROTOCOL_ID, 0,
- #endif
- #if !defined(__MMI_SLIM_EMAIL_NO_AUTO_CHECK__)
- IMG_EMAIL_CHECK_INTERVAL_ID, 0,
- #endif
- IMG_EMAIL_DOWNLOAD_TYPE_ID, 0
- };
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_PROF_SETTING, mmi_email_exit_prof_setting, NULL, NULL);
- InitializeCategory57Screen();
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_PROF_SETTING);
- inputBuffer = GetCurrNInputBuffer(SCR_ID_EMAIL_PROF_SETTING, &inputBufferSize);
- mmi_email_prof_fill_setting_inline_struct();
- if (inputBuffer != NULL)
- {
- SetCategory57Data(wgui_inline_items, EMAIL_SETTING_TOTAL_ITEM, inputBuffer);
- }
- ShowCategory57Screen(
- STR_EMAIL_PROFILE_SETTING_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_EDIT,
- IMG_GLOBAL_BACK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- EMAIL_SETTING_TOTAL_ITEM,
- (U16*) setting_icon,
- wgui_inline_items,
- 0,
- guiBuffer);
- SetCategory57RightSoftkeyFunctions(mmi_email_prof_save_confirm, GoBackHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_exit_prof_setting
- * DESCRIPTION
- * Exit function of Profile Setting screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_exit_prof_setting(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_util_add_n_history(SCR_ID_EMAIL_PROF_SETTING, mmi_email_entry_prof_setting);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_prof_save_setting
- * DESCRIPTION
- * Save Profile Setting data
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_prof_save_setting(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 count;
- S32 DownloadMaxSize;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Profile name shall not be empty */
- if (pfnUnicodeStrlen((S8*) email_p->prof_info.editing_prof.setting_info.prof_name) == 0)
- {
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_PROFILE_NAME_EMPTY),
- IMG_GLOBAL_EMPTY,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- ERROR_TONE);
- return;
- }
- /* check if profile name duplicated */
- for (count = 0; count < MMI_EMAIL_MAX_ACCTS; count++)
- {
- if (email_p->prof_info.prof_misc.curr_sel_prof == count)
- {
- continue;
- }
- if (pfnUnicodeStrcmp
- ((S8*) email_p->prof_info.editing_prof.setting_info.prof_name,
- (S8*) email_p->prof_info.prof_misc.acct_names[count]) == 0)
- {
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_PROFILE_NAME_DUPLICATED),
- IMG_GLOBAL_ERROR,
- 0,
- UI_POPUP_NOTIFYDURATION_TIME,
- ERROR_TONE);
- return;
- }
- }
- CloseCategory57Screen();
- DownloadMaxSize = gui_atoi((UI_string_type) email_p->prof_info.editing_prof.setting_info.dwnl_size);
- /* Download size exceeds boundary */
- if (DownloadMaxSize < MMI_EMAIL_MIN_MSG_SIZE || DownloadMaxSize > MMI_EMAIL_MAX_MSG_SIZE)
- {
- S8 *asciiMaxString = OslMalloc(EMAIL_MAX_DWNL_LEN);
- S8 *ucs2MaxString = OslMalloc(EMAIL_MAX_DWNL_LEN * ENCODING_LENGTH);
- if (DownloadMaxSize < MMI_EMAIL_MIN_MSG_SIZE)
- {
- sprintf((S8*) asciiMaxString, "n < %u", (U32) MMI_EMAIL_MIN_MSG_SIZE);
- }
- else
- {
- sprintf((S8*) asciiMaxString, "n > %u", (U32) MMI_EMAIL_MAX_MSG_SIZE);
- }
- pfnUnicodeStrcpy((S8*) email_p->comm_buff, (S8*) GetString(STR_EMAIL_MAX_SIZE));
- AnsiiToUnicodeString((S8*) ucs2MaxString, (S8*) asciiMaxString);
- pfnUnicodeStrcat((S8*) email_p->comm_buff, (S8*) ucs2MaxString);
- DisplayPopup((U8*) email_p->comm_buff, IMG_GLOBAL_EMPTY, 1, UI_POPUP_NOTIFYDURATION_TIME, ERROR_TONE);
- OslMfree(asciiMaxString);
- OslMfree(ucs2MaxString);
- }
- 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_setting_inline_struct
- * DESCRIPTION
- * Fill inline structure data for Profile Setting screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_prof_fill_setting_inline_struct(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 max_dwnl_len;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- /* protocol list */
- email_p->prof_info.prof_misc.prot_list[0] = (U8*) GetString(STR_EMAIL_POP3_ID);
- email_p->prof_info.prof_misc.prot_list[1] = (U8*) GetString(STR_EMAIL_IMAP4_ID);
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- #if !defined(__MMI_SLIM_EMAIL_NO_AUTO_CHECK__)
- /* check interval list */
- email_p->prof_info.prof_misc.chk_interval[0] = (U8*) GetString(STR_GLOBAL_OFF);
- email_p->prof_info.prof_misc.chk_interval[1] = (U8*) GetString(STR_EMAIL_5_MIN_ID);
- email_p->prof_info.prof_misc.chk_interval[2] = (U8*) GetString(STR_EMAIL_30_MIN_ID);
- email_p->prof_info.prof_misc.chk_interval[3] = (U8*) GetString(STR_EMAIL_1_HOUR_ID);
- email_p->prof_info.prof_misc.chk_interval[4] = (U8*) GetString(STR_EMAIL_2_HOURS_ID);
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_AUTO_CHECK__) */
- /* Profile Name caption */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_SETTING_NAME_CAP], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(&wgui_inline_items[EMAIL_SETTING_NAME_CAP], (U8*) GetString(STR_EMAIL_PROFILE_NAME_ID));
- /* Profile Name */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_SETTING_NAME], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit(
- &wgui_inline_items[EMAIL_SETTING_NAME],
- STR_EMAIL_PROFILE_NAME_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- (U8*) email_p->prof_info.editing_prof.setting_info.prof_name,
- (EMAIL_MAX_ACCT_NAME + 1),
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
- SetInlineFullScreenEditCustomFunction(&wgui_inline_items[EMAIL_SETTING_NAME], mmi_email_hilite_prof_full_edit);
- /* Data Account Caption */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_SETTING_DATA_ACCT_CAP], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(&wgui_inline_items[EMAIL_SETTING_DATA_ACCT_CAP], (U8*) GetString(STR_EMAIL_DATA_ACCOUNT_ID));
- /* Data Account */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_SETTING_DATA_ACCT], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemImageText(
- &wgui_inline_items[EMAIL_SETTING_DATA_ACCT],
- (U8*) email_p->prof_info.prof_misc.data_acct_name,
- (PU8) NULL,
- NULL,
- NULL,
- MAX_DATA_ACCOUNT_NAME_LEN,
- 0,
- 0,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
- SetInlineFullScreenEditCustomFunctionImageText(
- &wgui_inline_items[EMAIL_SETTING_DATA_ACCT],
- mmi_email_prof_list_data_acct);
- ShowAsControl(&wgui_inline_items[EMAIL_SETTING_DATA_ACCT]);
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- /* Protocol Caption */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_SETTING_PROTOCOL_CAP], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(&wgui_inline_items[EMAIL_SETTING_PROTOCOL_CAP], (U8*) GetString(STR_EMAIL_PROTOCOL_ID));
- /* Protocol */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_SETTING_PROTOCOL], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemSelect(
- &wgui_inline_items[EMAIL_SETTING_PROTOCOL],
- EMAIL_MAX_PROT_ITEM,
- email_p->prof_info.prof_misc.prot_list,
- &email_p->prof_info.editing_prof.setting_info.in_prot);
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- #if !defined(__MMI_SLIM_EMAIL_NO_AUTO_CHECK__)
- /* Check interval caption */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_SETTING_CHK_INT_CAP], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(&wgui_inline_items[EMAIL_SETTING_CHK_INT_CAP], (U8*) GetString(STR_EMAIL_CHECK_INTERVAL_ID));
- /* Check interval */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_SETTING_CHK_INT], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemSelect(
- &wgui_inline_items[EMAIL_SETTING_CHK_INT],
- EMAIL_MAX_CHK_INTERVAL_ITEM,
- email_p->prof_info.prof_misc.chk_interval,
- &email_p->prof_info.editing_prof.setting_info.chk_interval);
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_AUTO_CHECK__) */
- /* Maximum size of download caption */
- SetInlineItemActivation(&wgui_inline_items[EMAIL_SETTING_DWNL_TYPE_CAP], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(&wgui_inline_items[EMAIL_SETTING_DWNL_TYPE_CAP], (U8*) GetString(STR_EMAIL_MAX_SIZE));
- /* Max size */
- max_dwnl_len = mmi_email_util_get_num_len(MMI_EMAIL_MAX_MSG_SIZE) + 1;
- SetInlineItemActivation(&wgui_inline_items[EMAIL_SETTING_DWNL_TYPE], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemTextEdit(
- &wgui_inline_items[EMAIL_SETTING_DWNL_TYPE],
- (U8*) email_p->prof_info.editing_prof.setting_info.dwnl_size,
- max_dwnl_len,
- INPUT_TYPE_NUMERIC);
- DisableInlineItemHighlight(&wgui_inline_items[EMAIL_SETTING_DWNL_TYPE]);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_prof_list_data_acct
- * DESCRIPTION
- * Enter Data Account option.
- * If GPRS is enabled, go to CSD/GPRS screen; otherwse, go to CSD account list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_prof_list_data_acct(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if 0
- /* under construction !*/
- #ifdef __MMI_GPRS_FEATURES__
- /* under construction !*/
- #else
- /* under construction !*/
- #endif
- #endif /* 0 */
- mmi_dtcnt_select_account(mmi_email_prof_data_acct_callback, MENU_ID_EMAIL_MAIN, DATA_ACCOUNT_BEARER_ALL);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_prof_data_acct_callback
- * DESCRIPTION
- * Callback function for Data Account
- * PARAMETERS
- * index [IN] Index of seleted account
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_prof_data_acct_callback(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->prof_info.prof_misc.curr_data_acct = (S32) index;
- mmi_email_prof_save_data_acct();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_prof_csd_data_acct
- * DESCRIPTION
- * Display CSD accont list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_prof_csd_data_acct(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->prof_info.prof_misc.data_acct_type = EMAIL_DATA_ACCT_GSM;
- #if 0
- /* under construction !*/
- #endif
- }
- #ifdef __MMI_GPRS_FEATURES__
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_prof_data_acct
- * DESCRIPTION
- * Enter Profile -> Setting -> CSD/GPRS screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_prof_data_acct(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 numItems;
- U16 nStrItemList[2]; /* only CSD/GPRS */
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_PROF_DATA_ACCT, NULL, mmi_email_entry_prof_data_acct, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_PROF_DATA_ACCT);
- SetParentHandler(MENU_ID_EMAIL_PROF_DATA_ACCT_OPT);
- numItems = GetNumOfChild(MENU_ID_EMAIL_PROF_DATA_ACCT_OPT);
- GetSequenceStringIds(MENU_ID_EMAIL_PROF_DATA_ACCT_OPT, nStrItemList);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_EMAIL_DATA_ACCOUNT_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_hilite_prof_csd
- * DESCRIPTION
- * Highlight handler of Profile->Edit->Setting->Data Account-> CSD option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_prof_csd(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_entry_prof_csd_data_acct, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_entry_prof_csd_data_acct, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_prof_gprs
- * DESCRIPTION
- * Highlight handler of Profile->Edit->Setting->Data Account-> GPRS option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_prof_gprs(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_entry_prof_gprs_data_acct, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_entry_prof_gprs_data_acct, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_prof_gprs_data_acct
- * DESCRIPTION
- * Display GPRS accont list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_prof_gprs_data_acct(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->prof_info.prof_misc.data_acct_type = EMAIL_DATA_ACCT_GPRS;
- #if 0
- /* under construction !*/
- #endif
- }
- #endif /* __MMI_GPRS_FEATURES__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_prof_data_acct
- * DESCRIPTION
- * Highlight handler of data account list
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_prof_data_acct(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->prof_info.prof_misc.curr_data_acct = index;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_prof_save_data_acct
- * DESCRIPTION
- * Save setting of data account and update the account name of buffer in inline editor
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_prof_save_data_acct(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #ifdef __MMI_GPRS_FEATURES__
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* __MMI_GPRS_FEATURES__ */
- #endif /* 0 */
- mmi_dtcnt_get_account_name(
- email_p->prof_info.prof_misc.curr_data_acct,
- (S8*) email_p->prof_info.prof_misc.data_acct_name,
- MAX_DATA_ACCOUNT_NAME_LEN);
- email_p->prof_info.editing_prof.setting_info.data_acct = email_p->prof_info.prof_misc.curr_data_acct;
- DeleteUptoScrID(SCR_ID_EMAIL_PROF_SETTING);
- GoBackHistory();
- SetInlineListMenuChanged();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_prof_smtp
- * DESCRIPTION
- * Entry SMTP setting screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_prof_smtp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 smtp_icons[EMAIL_SMTP_TOTAL_ITEM] =
- {
- IMG_EMAIL_OUTGOING_SERVER_ID, 0,
- IMG_EMAIL_OUTGOING_PORT_ID, 0,
- IMG_EMAIL_DISPLAY_NAME_ID, 0,
- IMG_EMAIL_EMAIL_ADDRESS_ID, 0,
- IMG_EMAIL_USER_NAME_ID, 0,
- IMG_EMAIL_PASSWORD_ID, 0,
- };
- U8 *guiBuffer;
- U8 *inputBuffer;
- U16 inputBufferSize;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_PROF_SMTP, mmi_email_exit_prof_smtp, NULL, NULL);
- InitializeCategory57Screen();
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_PROF_SMTP);
- inputBuffer = GetCurrNInputBuffer(SCR_ID_EMAIL_PROF_SMTP, &inputBufferSize);
- mmi_email_prof_fill_smtp_inline_struct();
- if (inputBuffer != NULL)
- {
- SetCategory57Data(wgui_inline_items, EMAIL_SMTP_TOTAL_ITEM, inputBuffer);
- }