EmailAppUIInterface.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:476k
源码类别:
MTK
开发平台:
C/C++
- }
- else
- {
- if ((f_result = mmi_email_util_get_file_size((S8*) filePath, &fileLen)) == FS_NO_ERROR)
- {
- if (email_p->comp_info.attch_list[i].attch_present == TRUE)
- {
- /* calculate original file size */
- mmi_email_util_get_file_size((S8*) email_p->comp_info.attch_list[i].file_path, &origLen);
- }
- else
- {
- origLen = 0;
- }
- /* ensure previous total attachment size + current attachment size no greater than 90K */
- // if (fileLen > MMI_EMAIL_MAX_ATTACH_SIZE)
- if (email_p->comp_info.total_attch_size - origLen + fileLen > MMI_EMAIL_TOTAL_MAX_ATTACH_SIZE)
- {
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_SIZE_TOO_LARGE),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- DeleteUptoScrID(SCR_ID_EMAIL_COMP_ATTCH);
- return;
- }
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(GetFileSystemErrorString(f_result)),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- DeleteUptoScrID(SCR_ID_EMAIL_COMP_ATTCH);
- return;
- }
- /* construct file name and path for file buffer */
- dirLen = (S32) mmi_fmgr_get_last_dir_index((S8*) filePath);
- fileName += dirLen;
- /* file extension */
- fileExt = mmi_email_get_file_ext((S8*) filePath);
- /* destination file name */
- mmi_email_util_get_attch_name((U8) (i + 1), (S8*) email_p->comp_info.attch_list[i].file_path);
- pfnUnicodeStrcat((S8*) email_p->comp_info.attch_list[i].file_path, (S8*) fileExt);
- pfnUnicodeStrcpy((S8*) email_p->comp_info.attch_list[i].file_name, (S8*) fileName);
- /* copy source file path+name */
- pfnUnicodeStrcpy((S8*) email_p->comm_buff, (S8*) filePath);
- email_p->misc_info.file_copy_state = EMAIL_FILE_ADD_ATTCH;
- 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_GLOBAL_SAVE,
- NULL,
- NULL,
- NULL,
- 0);
- DeleteUptoScrID(SCR_ID_EMAIL_COMP_ATTCH);
- email_p->comp_info.total_attch_size -= origLen;
- PRINT_INFORMATION(("n[mmi_email_comp_add_attach_callback] File Size: %d, Updated Total Size: %dn", origLen, email_p->comp_info.total_attch_size));
- FS_Delete((U16*) email_p->comp_info.attch_list[i].file_path);
- mmi_fmgr_send_copy_req(
- FMGR_ACTION_COPY,
- (U8*) email_p->comm_buff,
- (U8*) email_p->comp_info.attch_list[i].file_path,
- mmi_email_comp_attach_copy_callback);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_attach_copy_callback
- * DESCRIPTION
- * Callback function for add attachment in Write Email screen.
- * PARAMETERS
- * info [IN] Variable stores the result of copy
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_attach_copy_callback(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- S32 fileLen;
- mmi_fmt_copy_rsp_strcut *msgPtr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgPtr = (mmi_fmt_copy_rsp_strcut*) info;
- if (mmi_email_util_is_call_interrupt_allow() && GetExitScrnID() != SCR_ID_EMAIL_PROGRESS)
- {
- /* delete progressing screen */
- DeleteScreenIfPresent(SCR_ID_EMAIL_PROGRESS);
- return;
- }
- if (msgPtr->result >= 0)
- {
- if (email_p->misc_info.file_copy_state == EMAIL_FILE_ADD_ATTCH)
- {
- /* add attach into email app */
- i = email_p->misc_info.curr_hilite_attch;
- if (!email_p->comp_info.attch_list[i].attch_present)
- {
- email_p->comp_info.total_attch++;
- }
- /* calculate added file size */
- mmi_email_util_get_file_size((S8*) email_p->comp_info.attch_list[i].file_path, &fileLen);
- /* update total attachment size */
- email_p->comp_info.total_attch_size += fileLen;
- PRINT_INFORMATION(("n[mmi_email_comp_attach_copy_callback] File Size: %d, Updated Total Size: %dn", fileLen, email_p->comp_info.total_attch_size));
- email_p->comp_info.attch_list[i].attch_present = TRUE;
- mmi_email_util_get_mine_type(
- (S8*) email_p->comp_info.attch_list[i].file_name,
- &email_p->comp_info.attch_list[i].attch_type,
- &email_p->comp_info.attch_list[i].attch_subtype);
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 0,
- UI_POPUP_NOTIFYDURATION_TIME,
- SUCCESS_TONE);
- DeleteUptoScrID(SCR_ID_EMAIL_COMP_ATTCH);
- }
- else if (email_p->misc_info.file_copy_state == EMAIL_FILE_ADD_SIG)
- {
- i = (MMI_EMAIL_MAX_NUM_ATTACH - 1);
- /* get mine type */
- pfnUnicodeStrcpy(
- (S8*) email_p->comp_info.attch_list[i].file_name,
- (S8*) email_p->prof_info.act_prof.sig_img);
- mmi_email_util_get_mine_type(
- (S8*) email_p->comp_info.attch_list[i].file_name,
- &email_p->comp_info.attch_list[i].attch_type,
- &email_p->comp_info.attch_list[i].attch_subtype);
- /* attach present in this index */
- email_p->comp_info.attch_list[i].attch_present = TRUE;
- email_p->comp_info.total_attch++;
- /* calculate added file size */
- mmi_email_util_get_file_size((S8*) email_p->comp_info.attch_list[i].file_path, &fileLen);
- /* update total attachment size */
- email_p->comp_info.total_attch_size += fileLen;
- PRINT_INFORMATION(("n[mmi_email_comp_attach_copy_callback] File Size: %d, Updated Total Size: %dn", fileLen, email_p->comp_info.total_attch_size));
- mmi_email_entry_comp();
- DeleteScreenIfPresent(SCR_ID_EMAIL_PROGRESS);
- }
- else /* if (email_p->misc_info.file_copy_state == EMAIL_FILE_FROM_APP) */
- { /* if it's from other application like file manager */
- i = 0;
- email_p->comp_info.total_attch = 1;
- /* calculate added file size */
- mmi_email_util_get_file_size((S8*) email_p->comp_info.attch_list[i].file_path, &fileLen);
- /* update total attachment size */
- email_p->comp_info.total_attch_size = fileLen;
- PRINT_INFORMATION(("n[mmi_email_comp_attach_copy_callback] File Size: %d, Updated Total Size: %dn", fileLen, email_p->comp_info.total_attch_size));
- email_p->comp_info.attch_list[i].attch_present = TRUE;
- mmi_email_util_get_mine_type(
- (S8*) email_p->comp_info.attch_list[i].file_name,
- &email_p->comp_info.attch_list[i].attch_type,
- &email_p->comp_info.attch_list[i].attch_subtype);
- /* start email module */
- email_p->main_info.curr_menu = MMI_EMAIL_COMP;
- mmi_email_ps_start_req();
- }
- }
- else
- {
- if (email_p->misc_info.file_copy_state == EMAIL_FILE_FROM_APP)
- {
- i = 0;
- DisplayPopup(
- (PU8) GetString(GetFileSystemErrorString(msgPtr->result)),
- IMG_GLOBAL_ERROR,
- 0,
- 1000,
- ERROR_TONE);
- DeleteScreenIfPresent(SCR_ID_EMAIL_PROGRESS);
- }
- else if (email_p->misc_info.file_copy_state == EMAIL_FILE_ADD_ATTCH)
- {
- i = email_p->misc_info.curr_hilite_attch;
- DisplayPopup(
- (PU8) GetString(GetFileSystemErrorString(msgPtr->result)),
- IMG_GLOBAL_ERROR,
- 0,
- 1000,
- ERROR_TONE);
- DeleteUptoScrID(SCR_ID_EMAIL_COMP_ATTCH);
- }
- else /* if (email_p->misc_info.file_copy_state == EMAIL_FILE_ADD_SIG) */
- {
- i = (MMI_EMAIL_MAX_NUM_ATTACH - 1);
- mmi_email_entry_comp();
- DeleteScreenIfPresent(SCR_ID_EMAIL_PROGRESS);
- DisplayPopup(
- (PU8) GetString(GetFileSystemErrorString(msgPtr->result)),
- IMG_GLOBAL_ERROR,
- 0,
- 1000,
- ERROR_TONE);
- }
- if (email_p->comp_info.attch_list[i].attch_present && email_p->comp_info.total_attch)
- {
- email_p->comp_info.total_attch--;
- }
- /* wgui_inline_item will be reset when entering email compose screen */
- // ClearAttachmentImage(&wgui_inline_items[3], i);
- memset(&email_p->comp_info.attch_list[i], 0, sizeof(mmi_email_attch_info_struct));
- pfnUnicodeStrcpy((S8*) email_p->comp_info.attch_list[i].file_name, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
- email_p->comp_info.attch_icon[i].image1 = NULL;
- }
- /* reset state */
- email_p->misc_info.file_copy_state = EMAIL_FILE_ADD_ATTCH;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_pre_entry_addr
- * DESCRIPTION
- * Pre-Entry function of Write Email -> To/CC.
- * If no address in the list, display option screen; otherwise, display address list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_pre_entry_addr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->misc_info.curr_hilite_attch = 0;
- if (email_p->comp_info.addr_list[email_p->comp_info.curr_addr_type].num_addr == 0)
- {
- mmi_email_entry_comp_addr_opt();
- }
- else
- {
- mmi_email_entry_comp_addr();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_get_addr_opt_menu
- * DESCRIPTION
- * Get menu id of To/CC option according to # of address.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- U16 mmi_email_comp_get_addr_opt_menu(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (email_p->comp_info.addr_list[email_p->comp_info.curr_addr_type].num_addr)
- {
- case 0:
- return MENU_ID_EMAIL_COMP_ADDR_OPT1;
- case 1:
- return MENU_ID_EMAIL_COMP_ADDR_OPT2;
- case 2:
- return MENU_ID_EMAIL_COMP_ADDR_OPT3;
- default:
- return MENU_ID_EMAIL_COMP_ADDR_OPT4;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_comp_addr
- * DESCRIPTION
- * Entry function of To/CC list in Write Email
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_comp_addr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- BOOL emptyList = FALSE;
- U16 numItems;
- U16 capStrId;
- U16 lskStrId = STR_GLOBAL_OPTIONS;
- U8 *nStrMainItemList[MMI_EMAIL_MAX_LEN_ADDR_LIST];
- U8 *nStrPopupItemList[MMI_EMAIL_MAX_LEN_ADDR_LIST];
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_COMP_ADDR, mmi_email_exit_comp_addr, NULL, NULL);
- capStrId = (email_p->comp_info.curr_addr_type == EMAIL_ADDR_TO) ? STR_EMAIL_TO_ID : STR_EMAIL_CC_ID;
- numItems = mmi_email_comp_get_addr_info(nStrMainItemList, nStrPopupItemList);
- if (numItems == 0)
- {
- emptyList = TRUE;
- numItems = 1;
- lskStrId = STR_GLOBAL_ADD;
- nStrMainItemList[0] = (U8*) GetString(STR_GLOBAL_EMPTY_LIST);
- nStrPopupItemList[0] = NULL;
- }
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_COMP_ADDR);
- ShowCategory53Screen(
- capStrId,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- lskStrId,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- nStrMainItemList,
- (U16*) gIndexIconsImageList,
- nStrPopupItemList,
- 0,
- email_p->misc_info.curr_hilite_attch,
- guiBuffer);
- if (emptyList)
- {
- SetLeftSoftkeyFunction(mmi_email_comp_addr_pre_add, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_comp_addr_pre_add, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- else
- {
- SetLeftSoftkeyFunction(mmi_email_entry_comp_addr_opt, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_entry_comp_addr_opt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_exit_comp_addr
- * DESCRIPTION
- * Exit function of To/CC list in Write Email
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_exit_comp_addr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_util_add_history(SCR_ID_EMAIL_COMP_ADDR, mmi_email_entry_comp_addr);
- email_p->misc_info.curr_hilite_attch = GetHighlightedItem();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_get_addr_info
- * DESCRIPTION
- * Retrieve information for To/CC address
- * PARAMETERS
- * nStrMainItemList [IN/OUT] String pointer to store address list
- * nStrPopupItemList [IN/OUT] String pointer to display name list
- * RETURNS
- * void
- *****************************************************************************/
- U16 mmi_email_comp_get_addr_info(U8 **nStrMainItemList, U8 **nStrPopupItemList)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- U8 index = email_p->comp_info.curr_addr_type;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < email_p->comp_info.addr_list[index].num_addr; i++)
- {
- nStrMainItemList[i] = (U8*) email_p->comp_info.addr_list[index].to_cc_mail[i];
- if (!pfnUnicodeStrlen((S8*) email_p->comp_info.addr_list[index].to_cc_name[i]))
- {
- nStrPopupItemList[i] = NULL;
- }
- else
- {
- nStrPopupItemList[i] = (U8*) email_p->comp_info.addr_list[index].to_cc_name[i];
- }
- }
- return email_p->comp_info.addr_list[index].num_addr;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_comp_addr_opt
- * DESCRIPTION
- * Display option screen of Write Email -> To/CC
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_comp_addr_opt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 numItems;
- U16 parentMenuId;
- U16 nStrItemList[MAX_SUB_MENUS];
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_COMP_ADDR_OPT, NULL, mmi_email_entry_comp_addr_opt, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_COMP_ADDR_OPT);
- parentMenuId = mmi_email_comp_get_addr_opt_menu();
- 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_comp_addr_pre_add
- * DESCRIPTION
- * Prepare data for add new address
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_addr_pre_add(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(email_p->comp_info.addr_input_buff, 0, ENCODING_LENGTH);
- memset(email_p->comp_info.phb_addr, 0, ENCODING_LENGTH);
- memset(email_p->comp_info.phb_name, 0, ENCODING_LENGTH);
- /* add new entry */
- email_p->comp_info.new_addr = TRUE;
- mmi_email_entry_comp_addr_input();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_addr_pre_edit
- * DESCRIPTION
- * Prepare data for edit current selected address
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_addr_pre_edit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i = email_p->comp_info.curr_addr_type;
- S32 j = email_p->misc_info.curr_hilite_attch;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- pfnUnicodeStrcpy((S8*) email_p->comp_info.addr_input_buff, (S8*) email_p->comp_info.addr_list[i].to_cc_mail[j]);
- pfnUnicodeStrcpy((S8*) email_p->comp_info.phb_name, (S8*) email_p->comp_info.addr_list[i].to_cc_name[j]);
- pfnUnicodeStrcpy((S8*) email_p->comp_info.phb_addr, (S8*) email_p->comp_info.addr_list[i].to_cc_mail[j]);
- /* edit an existing entry */
- email_p->comp_info.new_addr = FALSE;
- mmi_email_entry_comp_addr_input();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_comp_addr_input
- * DESCRIPTION
- * Display full screen editor for Write Email -> To/CC -> Edit/Add
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_comp_addr_input(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_COMP_ADDR_INPUT, NULL, mmi_email_entry_comp_addr_input, NULL);
- if (pfnUnicodeStrlen((S8*) email_p->comp_info.phb_addr) && email_p->comp_info.load_addr_done)
- {
- guiBuffer = NULL;
- email_p->comp_info.load_addr_done = FALSE;
- }
- else
- {
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_COMP_ADDR_INPUT);
- }
- RegisterInputBoxEmptyFunction(mmi_email_comp_addr_empty_lsk_hdlr);
- RegisterInputBoxNotEmptyFunction(mmi_email_comp_addr_no_empty_lsk_hdlr);
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif
- ShowCategory5Screen_ext(
- STR_EMAIL_INPUT_ADDRESS_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_OPTIONS,
- IMG_GLOBAL_OPTIONS,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- INPUT_TYPE_USE_ONLY_ENGLISH_MODES | INPUT_TYPE_ALPHANUMERIC_SENTENCECASE,
- (U8*)email_p->comp_info.addr_input_buff,
- MMI_EMAIL_MAX_LEN_EMAIL_ADDRESS + 1,
- guiBuffer,
- INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL,
- NULL,
- NULL);
- #ifdef __MMI_TOUCH_SCREEN__
- mmi_pen_editor_set_vk_keys(MMI_FALSE, NULL, g_email_disable_new_line);
- #endif
- SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_addr_empty_lsk_hdlr
- * DESCRIPTION
- * Register LSK handler for Address input screen when the editor is empty.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_addr_empty_lsk_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_SMS_COMMON_SEARCH, IMG_GLOBAL_OPTIONS);
- SetLeftSoftkeyFunction(mmi_phb_email_enter_list, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_addr_no_empty_lsk_hdlr
- * DESCRIPTION
- * Register LSK handler for Address input screen when the editor is not empty.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_addr_no_empty_lsk_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OPTIONS, IMG_GLOBAL_OPTIONS);
- SetLeftSoftkeyFunction(mmi_email_entry_comp_addr_input_opt, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_comp_addr_input_opt
- * DESCRIPTION
- * Entry Write Email -> To/CC -> Edit -> Option screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_comp_addr_input_opt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 numItems;
- U16 nStrItemList[2]; /* only Done and Input Method */
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_COMP_ADDR_INPUT_OPT, NULL, mmi_email_entry_comp_addr_input_opt, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_COMP_ADDR_INPUT_OPT);
- SetParentHandler(MENU_ID_EMAIL_COMP_ADDR_EDIT_OPT);
- numItems = GetNumOfChild(MENU_ID_EMAIL_COMP_ADDR_EDIT_OPT);
- GetSequenceStringIds(MENU_ID_EMAIL_COMP_ADDR_EDIT_OPT, nStrItemList);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_GLOBAL_OPTIONS,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- NULL,
- 0,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_addr_input_done
- * DESCRIPTION
- * Handler when finished editing email address.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_addr_input_done(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (pfnUnicodeStrlen((S8*) email_p->comp_info.addr_input_buff) &&
- mmi_email_util_chk_addr((U8*) email_p->comp_info.addr_input_buff))
- {
- U8 index;
- S32 i = email_p->comp_info.curr_addr_type;
- if ((email_p->comp_info.addr_list[i].num_addr == 0) && (IsScreenPresent(SCR_ID_EMAIL_COMP_ADDR_OPT)))
- {
- ReplaceNewScreenHandler(SCR_ID_EMAIL_COMP_ADDR_INPUT_OPT, NULL, NULL);
- DeleteNScrId(SCR_ID_EMAIL_COMP_ADDR_OPT);
- mmi_email_exit_comp_addr(); /* add "TO" list screen into history */
- }
- /* get current editing cursor of address list */
- index =
- (email_p->comp_info.new_addr) ? email_p->comp_info.addr_list[i].num_addr : email_p->misc_info.
- curr_hilite_attch;
- pfnUnicodeStrcpy(
- (S8*) email_p->comp_info.addr_list[i].to_cc_mail[index],
- (S8*) email_p->comp_info.addr_input_buff);
- if (!pfnUnicodeStrcmp((S8*) email_p->comp_info.phb_addr, (S8*) email_p->comp_info.addr_input_buff))
- {
- pfnUnicodeStrcpy(
- (S8*) email_p->comp_info.addr_list[i].to_cc_name[index],
- (S8*) email_p->comp_info.phb_name);
- }
- else
- {
- memset(
- email_p->comp_info.addr_list[i].to_cc_name[index],
- 0,
- sizeof(email_p->comp_info.addr_list[i].to_cc_name[index]));
- }
- /* add new address */
- if (email_p->comp_info.new_addr)
- {
- email_p->comp_info.addr_list[i].num_addr++;
- }
- /* update inline buffer */
- mmi_email_comp_update_addr_buff();
- email_p->comp_info.done_flag = TRUE;
- GoBackToHistory(SCR_ID_EMAIL_COMP_ADDR);
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_ERROR_CODE_INVALID_EMAIL_ADDR_ID),
- IMG_GLOBAL_EMPTY,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) EMPTY_LIST_TONE);
- DeleteNScrId(SCR_ID_EMAIL_COMP_ADDR_INPUT_OPT);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_addr_del
- * DESCRIPTION
- * Display confirmation screen for deleting address
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_addr_del(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_display_confirm(STR_GLOBAL_DELETE, mmi_email_comp_addr_del_yes, mmi_email_comp_addr_del_no);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_addr_del_no
- * DESCRIPTION
- * Canceling deleting address
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_addr_del_no(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_comp_addr_hist_del();
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_addr_del_yes
- * DESCRIPTION
- * Proceed deleting address
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_addr_del_yes(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 index;
- S32 i = email_p->comp_info.curr_addr_type;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (index = email_p->misc_info.curr_hilite_attch; index < email_p->comp_info.addr_list[i].num_addr - 1; index++)
- {
- pfnUnicodeStrcpy(
- (S8*) email_p->comp_info.addr_list[i].to_cc_mail[index],
- (S8*) email_p->comp_info.addr_list[i].to_cc_mail[index + 1]);
- pfnUnicodeStrcpy(
- (S8*) email_p->comp_info.addr_list[i].to_cc_name[index],
- (S8*) email_p->comp_info.addr_list[i].to_cc_name[index + 1]);
- }
- /* reset null last entry */
- memset(
- email_p->comp_info.addr_list[i].to_cc_mail[index],
- 0,
- sizeof(email_p->comp_info.addr_list[i].to_cc_mail[index]));
- memset(
- email_p->comp_info.addr_list[i].to_cc_name[index],
- 0,
- sizeof(email_p->comp_info.addr_list[i].to_cc_name[index]));
- email_p->comp_info.addr_list[i].num_addr--;
- mmi_email_comp_update_addr_buff();
- email_p->comp_info.done_flag = TRUE;
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- mmi_email_comp_addr_hist_del();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_addr_hist_del
- * DESCRIPTION
- * Common function to delete history node when cancel deleting address.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_addr_hist_del(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (IsScreenPresent(SCR_ID_EMAIL_COMP_ADDR_OPT))
- {
- DeleteNScrId(SCR_ID_EMAIL_COMP_ADDR_OPT);
- }
- else if (IsScreenPresent(SCR_ID_EMAIL_COMP_ADDR_INPUT))
- {
- DeleteNScrId(SCR_ID_EMAIL_COMP_ADDR_INPUT);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_addr_del_all
- * DESCRIPTION
- * Display confirmation screen for deleting all addresses
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_addr_del_all(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_display_confirm(STR_GLOBAL_DELETE_ALL, mmi_email_comp_addr_del_all_yes, mmi_email_comp_addr_del_all_no);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_addr_del_all_no
- * DESCRIPTION
- * Cancel deleting all addresses
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_addr_del_all_no(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_comp_addr_hist_del();
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_addr_del_all_yes
- * DESCRIPTION
- * Proceed deleting all addresses
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_addr_del_all_yes(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i = email_p->comp_info.curr_addr_type;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(&email_p->comp_info.addr_list[i], 0, sizeof(mmi_email_to_cc_struct));
- memset(email_p->comp_info.addr_disp_buff[i], 0, sizeof(email_p->comp_info.addr_disp_buff[i]));
- email_p->comp_info.done_flag = TRUE;
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- mmi_email_comp_addr_hist_del();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_update_addr_buff
- * DESCRIPTION
- * Update address displayed buffer in inline editor screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_update_addr_buff(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i = email_p->comp_info.curr_addr_type;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (email_p->comp_info.addr_list[i].num_addr != 0)
- {
- if (pfnUnicodeStrlen((S8*) email_p->comp_info.addr_list[i].to_cc_name[0]))
- {
- pfnUnicodeStrcpy((S8*) email_p->comp_info.addr_disp_buff[i], (S8*) g_email_subj_left_op);
- pfnUnicodeStrcat(
- (S8*) email_p->comp_info.addr_disp_buff[i],
- (S8*) email_p->comp_info.addr_list[i].to_cc_name[0]);
- pfnUnicodeStrcat((S8*) email_p->comp_info.addr_disp_buff[i], (S8*) g_email_subj_right_op);
- pfnUnicodeStrcat(
- (S8*) email_p->comp_info.addr_disp_buff[i],
- (S8*) email_p->comp_info.addr_list[i].to_cc_mail[0]);
- }
- else
- {
- pfnUnicodeStrcpy(
- (S8*) email_p->comp_info.addr_disp_buff[i],
- (S8*) email_p->comp_info.addr_list[i].to_cc_mail[0]);
- }
- if (email_p->comp_info.addr_list[i].num_addr > 1)
- {
- pfnUnicodeStrcat((S8*) email_p->comp_info.addr_disp_buff[i], (S8*) g_email_3dots);
- }
- }
- else
- {
- email_p->comp_info.addr_disp_buff[i][0] = 0x0000;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_comp_attch
- * DESCRIPTION
- * Display list of attachment
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_comp_attch(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- U8 *nStrAttachmentItemList[MMI_EMAIL_MAX_NUM_ATTACH];
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_COMP_ATTCH, NULL, mmi_email_entry_comp_attch, NULL);
- for (i = 0; i < MMI_EMAIL_MAX_NUM_ATTACH; i++)
- {
- nStrAttachmentItemList[i] = (U8*) email_p->comp_info.attch_list[i].file_name;
- }
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_COMP_ATTCH);
- RegisterHighlightHandler(mmi_email_hilite_comp_attch);
- ShowCategory53Screen(
- STR_EMAIL_ATTACHMENT_LIST_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_OPTIONS,
- IMG_GLOBAL_OPTIONS,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- MMI_EMAIL_MAX_NUM_ATTACH,
- nStrAttachmentItemList,
- (U16*) gIndexIconsImageList,
- NULL,
- 0,
- email_p->misc_info.curr_hilite_attch,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_email_entry_comp_attch_opt, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_entry_comp_attch_opt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_comp_attch
- * DESCRIPTION
- * Highlight handler of attachment list in Write Email-> Attachment screen.
- * PARAMETERS
- * index [IN] Index of current highlighting item
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_comp_attch(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->misc_info.curr_hilite_attch = index;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_comp_attch_opt
- * DESCRIPTION
- * Entry function for Write Email -> Attachment -> Option screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_comp_attch_opt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 numItems;
- U16 nStrItemList[3]; /* only Edit/View/Delete */
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_COMP_ATTCH_OPT, NULL, mmi_email_entry_comp_attch_opt, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_COMP_ATTCH_OPT);
- SetParentHandler(MENU_ID_EMAIL_COMP_ATTCH_OPT);
- numItems = GetNumOfChild(MENU_ID_EMAIL_COMP_ATTCH_OPT);
- GetSequenceStringIds(MENU_ID_EMAIL_COMP_ATTCH_OPT, nStrItemList);
- if (email_p->comp_info.attch_list[email_p->misc_info.curr_hilite_attch].attch_present == FALSE)
- {
- numItems = 1;
- }
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_EMAIL_ATTACH_OPTION_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_comp_pre_entry_view_attach
- * DESCRIPTION
- * Pre-Entry function of view attachment.
- * Execute entry function according to type of attachment.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_pre_entry_view_attach(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i = email_p->misc_info.curr_hilite_attch;
- U8 fileType;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* add one more check for file type */
- fileType = mmi_fmgr_get_file_group((S8*) email_p->comp_info.attch_list[i].file_path);
- if (fileType == FMGR_GROUP_IMAGE)
- {
- mmi_email_entry_comp_view_image();
- }
- else if (fileType == FMGR_GROUP_AUDIO)
- {
- mmi_audply_single_play((UI_string_type) email_p->comp_info.attch_list[i].file_path, NULL);
- }
- #ifdef __MMI_VIDEO_PLAYER__
- else if (fileType == FMGR_GROUP_VIDEO)
- {
- mmi_vdoply_entry_player_screen_from_file((S8*) email_p->comp_info.attch_list[i].file_path, FALSE);
- }
- #endif /* __MMI_VIDEO_PLAYER__ */
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_NOT_SUPPORT_ID),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_comp_view_image
- * DESCRIPTION
- * View image attachment.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_comp_view_image(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 *fileExtPtr = mmi_email_get_file_ext((S8*) email_p->comp_info.attch_list[email_p->misc_info.curr_hilite_attch].file_name);
- S8 *fileExt = OslMalloc((FMGR_MAX_EXT_LEN + 1) * ENCODING_LENGTH);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (fileExtPtr)
- {
- /* neglect "." */
- fileExtPtr = fileExtPtr + 2;
- UnicodeToAnsii(fileExt, fileExtPtr);
- }
- EntryNewScreen(SCR_ID_EMAIL_COMP_VIEW_IMAGE, NULL, mmi_email_entry_comp_view_image, 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->comp_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->comp_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->comp_info.attch_list[email_p->misc_info.curr_hilite_attch].file_path,
- FALSE,
- NULL);
- }
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- OslMfree(fileExt);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_attch_del
- * DESCRIPTION
- * Display confirmation screen for Write Email->Attachment->Delete option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_attch_del(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_display_confirm(STR_GLOBAL_DELETE, mmi_email_comp_attch_del_done, GoBackHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_attch_del_done
- * DESCRIPTION
- * Execute Write Email->Attachment->Delete option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_attch_del_done(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i = email_p->misc_info.curr_hilite_attch;
- S32 fileLen;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* wgui_inline_item will be reset when entering email compose screen */
- // ClearAttachmentImage(&wgui_inline_items[3], i);
- /* calculate deleted file size */
- mmi_email_util_get_file_size((S8*) email_p->comp_info.attch_list[i].file_path, &fileLen);
- memset(&email_p->comp_info.attch_list[i], 0, sizeof(mmi_email_attch_info_struct));
- pfnUnicodeStrcpy((S8*) email_p->comp_info.attch_list[i].file_name, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
- email_p->comp_info.attch_icon[i].image1 = NULL;
- email_p->comp_info.total_attch--;
- /* update total attachment size */
- email_p->comp_info.total_attch_size -= fileLen;
- PRINT_INFORMATION(("n[mmi_email_comp_attch_del_done] File Size: %d, Updated Total Size: %dn", fileLen, email_p->comp_info.total_attch_size));
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- if (IsScreenPresent(SCR_ID_EMAIL_COMP_ATTCH_OPT))
- {
- DeleteNScrId(SCR_ID_EMAIL_COMP_ATTCH_OPT);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_comp_opt
- * DESCRIPTION
- * Entry function of option screen of Write Email
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_comp_opt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 numItems;
- U16 nStrItemList[4]; /* only 4 items */
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_COMP_OPT, NULL, mmi_email_entry_comp_opt, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_COMP_OPT);
- SetParentHandler(MENU_ID_EMAIL_COMP_OPT);
- numItems = GetNumOfChild(MENU_ID_EMAIL_COMP_OPT);
- GetSequenceStringIds(MENU_ID_EMAIL_COMP_OPT, nStrItemList);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_EMAIL_EMAIL_OPTION_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_comp_opt_quit
- * DESCRIPTION
- * Execute Quit Without Saving option, display confirmation screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_opt_quit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_display_confirm(STR_EMAIL_COMMON_QUIT_WITHOUT_SAVING_ID, mmi_email_comp_opt_quit_yes, GoBackHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_opt_quit_yes
- * DESCRIPTION
- * Reset screen variables in Write Email screen and go back to Email main menu.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_opt_quit_yes(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_comp_reset_member();
- if (email_p->main_info.entry_src == EMAIL_FROM_APP)
- {
- mmi_email_main_quit_email();
- DeleteScreenIfPresent(SCR_ID_EMAIL_COMP);
- DeleteScreenIfPresent(SCR_ID_EMAIL_COMP_OPT);
- }
- else
- {
- DeleteBetweenScreen(mmi_email_fldr_get_start_scr(), GetCurrScrnId());
- GoBackHistory();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_comp_cont
- * DESCRIPTION
- * Entry Write Email-> Content screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_comp_cont(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_COMP_CONT_INPUT, NULL, mmi_email_entry_comp_cont, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_COMP_CONT_INPUT);
- ShowCategory5Screen(
- STR_EMAIL_CONTENT_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->misc_info.cont_inline_buff,
- (EMAIL_MAX_CONT_LEN + 1),
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_email_entry_comp_subj_opt, KEY_EVENT_UP);
- SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_comp_subj
- * DESCRIPTION
- * Entry Write Email-> Subject screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_comp_subj(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_COMP_SUBJ_INPUT, NULL, mmi_email_entry_comp_subj, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_COMP_SUBJ_INPUT);
- ShowCategory5Screen(
- STR_EMAIL_SUBJECT_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->misc_info.subj_inline_buff,
- EMAIL_COMP_SUBJ_LEN + 1,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_email_entry_comp_subj_opt, KEY_EVENT_UP);
- SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_comp_subj_cont_done
- * DESCRIPTION
- * Handler for Write Email -> Subject/Content -> Done
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_comp_subj_cont_done(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* editing subject */
- if (email_p->comp_info.curr_inline_item == EMAIL_COMP_SUBJ)
- {
- pfnUnicodeStrcpy((S8*) email_p->comp_info.subj_buff, (S8*) email_p->misc_info.subj_inline_buff);
- }
- else
- { /* editing content */
- pfnUnicodeStrcpy((S8*) email_p->comp_info.cont_buff, (S8*) email_p->misc_info.cont_inline_buff);
- set_inscreen_multi_line_input_box_changed();
- }
- email_p->comp_info.done_flag = TRUE;
- GoBackToHistory(SCR_ID_EMAIL_COMP);
- }
- #define INBOX_EMAIL
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_inbox_read
- * DESCRIPTION
- * Highlight handler of Inbox -> Option -> Read
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_inbox_read(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);
- }
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_read_addr_save_phb
- * DESCRIPTION
- * Handler for Read Email -> Address -> Save to Phonebook
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_read_addr_save_phb(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_read_addr_save, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_read_addr_save, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_read_addr_send
- * DESCRIPTION
- * Handler for Read Email -> Address -> Send
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_read_addr_send(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_read_addr_send, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_read_addr_send, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_read_attach_view
- * DESCRIPTION
- * Handler for Read Email -> Attachment -> View
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_read_attach_view(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_entry_read_attch_view, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_entry_read_attch_view, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_read_attach_save
- * DESCRIPTION
- * Handler for Read Email -> Attachment -> Save
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_read_attach_save(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_read_attach_save, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_read_attach_save, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_read_attach_save_done
- * DESCRIPTION
- * Handler for Read Email -> Attachment -> Save -> Done
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_read_attach_save_done(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_read_save_attch, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_read_attach_save_input_meth
- * DESCRIPTION
- * Handler for Read Email -> Attachment -> Save -> Input Method
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_read_attach_save_input_meth(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(EntryInputMethodScreen, KEY_EVENT_UP);
- SetKeyHandler(EntryInputMethodScreen, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- RegisterInputMethodScreenCloseFunction(mmi_email_util_go_back_2_hist);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_read_reply
- * DESCRIPTION
- * Handler for Read Email -> Reply
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_read_reply(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_read_reply, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_read_reply, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_read_reply_without
- * DESCRIPTION
- * Handler for Read Email -> Reply Without Content
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_read_reply_without(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_read_reply_without, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_read_reply_without, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_read_reply_all
- * DESCRIPTION
- * Handler for Read Email -> Reply All
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_read_reply_all(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_read_reply_all, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_read_reply_all, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_read_reply_all_without
- * DESCRIPTION
- * Handler for Read Email -> Reply All Without Content
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_read_reply_all_without(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_read_reply_all_without, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_read_reply_all_without, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_read_forward
- * DESCRIPTION
- * Handler for Read Email -> Forward
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_read_forward(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_email_read_forward, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_read_forward, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_inbox_pre_entry
- * DESCRIPTION
- * Pre-Entry function of Inbox.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_inbox_pre_entry(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if !defined(__MMI_SLIM_EMAIL_NO_AUTO_CHECK__)
- email_p->snr_info.new_mail_ind = FALSE;
- #endif
- mmi_email_fldr_pre_entry();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_inbox
- * DESCRIPTION
- * Entry function of Inbox.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_inbox(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 numItems;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- numItems = mmi_email_fldr_get_num_mails();
- if (numItems)
- {
- U16 lskStrId;
- U8 *guiBuffer;
- S32 list_not_ready;
- EntryNewScreen(SCR_ID_EMAIL_INBOX, mmi_email_exit_inbox, NULL, NULL);
- email_p->fldr_info.need_fldr_sel = FALSE;
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_INBOX);
- RegisterHighlightHandler(mmi_email_hilite_inbox_item);
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- /* set LSK string according to current state */
- if ((email_p->prof_info.act_prof.in_prot == EMAIL_PROT_IMAP4) && (email_p->fldr_info.total_page > 1))
- {
- lskStrId = STR_GLOBAL_OPTIONS;
- }
- else
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- lskStrId = STR_EMAIL_READ_ID;
- /* 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;
- }
- ShowCategory261Screen(
- mmi_email_util_folder_select_cap_str(STR_EMAIL_INBOX_ID),
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- lskStrId,
- IMG_GLOBAL_OPTIONS,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- mmi_email_inbox_get_async_items,
- NULL,
- email_p->fldr_info.curr_mail_indx,
- IMG_EMAIL_READ_NORMAL_ID,
- IMG_EMAIL_ATTACH_IMAGE_ID,
- guiBuffer,
- 2 /* no_of_string */ ,
- 4 /* no_of_icons */ ,
- &list_not_ready);
- /* if data in dynamic list is not ready */
- if (list_not_ready)
- {
- mmi_email_fldr_pre_folder_select_req();
- }
- else
- {
- /* to indicate folder list is really displayed */
- email_p->fldr_info.is_list_displayed = TRUE;
- SetLeftSoftkeyFunction(mmi_email_inbox_lsk_hdlr, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_inbox_lsk_hdlr, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(mmi_email_inbox_rsk_hdlr, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_inbox_rsk_hdlr, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- #if !defined(__MMI_SLIM_EMAIL_NO_AUTO_CHECK__)
- /* delete auto check indication screen for auto-check case */
- DeleteScreenIfPresent(SCR_ID_EMAIL_NEW_MAIL_IND);
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_AUTO_CHECK__) */
- }
- }
- else /* because the is_list_displayed flag is FALSE, the folder screen is not in history */
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_EMPTY),
- IMG_GLOBAL_EMPTY,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) EMPTY_LIST_TONE);
- if (email_p->main_info.entry_src == EMAIL_FROM_IDLE)
- {
- mmi_email_ps_stop_req();
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_exit_inbox
- * DESCRIPTION
- * Exit function of Inbox.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_exit_inbox(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_util_add_history(SCR_ID_EMAIL_INBOX, mmi_email_fldr_back_from_history);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_inbox_lsk_hdlr
- * DESCRIPTION
- * Left softkey handler of Inbox.
- * If current protocol is IMAP4, will entry option screen first.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_inbox_lsk_hdlr(void)
- {
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* if protocol == IMAP4 and total page > 1, will go to option screen of Inbox; otherwise will read the mail */
- if ((email_p->prof_info.act_prof.in_prot == EMAIL_PROT_IMAP4) && (email_p->fldr_info.total_page > 1))
- {
- mmi_email_entry_inbox_opt();
- }
- else
- #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */
- mmi_email_ps_folder_msg_select_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_inbox_rsk_hdlr
- * DESCRIPTION
- * Right softkey handler of Inbox.
- * If Inbox is entry from IDLE screen, shall send quit email request.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_inbox_rsk_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (email_p->main_info.entry_src != EMAIL_FROM_IDLE) // #ifdef __MMI_SLIM_EMAIL_NO_AUTO_CHECK__
- {
- GoBackHistory();
- }
- else
- {
- mmi_email_main_quit_email();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_inbox_item
- * DESCRIPTION
- * Highlight handler of Inbox list
- * PARAMETERS
- * index [IN] Index of highlighted item
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_inbox_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;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_inbox_update_mail_state
- * DESCRIPTION
- * Update read/unread state of a mail.
- * PARAMETERS
- * index [IN] Mail id of the mail
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_inbox_update_mail_state(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;
- if (!temp->is_read)
- {
- temp->is_read = TRUE;
- /* update idle screen icon status after read one email */
- if (email_p->main_info.unread_mails != 0)
- {
- email_p->main_info.unread_mails--;
- mmi_email_util_update_status_icon();
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_inbox_get_status_icon
- * DESCRIPTION
- * Get status icon of a mail in Inbox list
- * PARAMETERS
- * priority [IN] Priority of the mail.
- * is_read [IN]
- * readFlg(?) [IN] The read/unread state of the mail
- * RETURNS
- * image id of the status icon
- *****************************************************************************/
- U16 mmi_email_inbox_get_status_icon(U8 priority, BOOL is_read)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (is_read)
- {
- if (priority > MMI_EMAIL_NORMAL_PRIORITY)
- {
- return IMG_EMAIL_READ_LOW_ID;
- }
- else if (priority < MMI_EMAIL_NORMAL_PRIORITY)
- {
- return IMG_EMAIL_READ_HIGH_ID;
- }
- else /* (priority==MMI_EMAIL_NORMAL_PRIORITY) */
- {
- return IMG_EMAIL_READ_NORMAL_ID;
- }
- }
- else
- {
- if (priority > MMI_EMAIL_NORMAL_PRIORITY)
- {
- return IMG_EMAIL_UNREAD_LOW_ID;
- }
- else if (priority < MMI_EMAIL_NORMAL_PRIORITY)
- {
- return IMG_EMAIL_UNREAD_HIGH_ID;
- }
- else /* (priority==MMI_EMAIL_NORMAL_PRIORITY) */
- {
- return IMG_EMAIL_UNREAD_NORMAL_ID;
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_inbox_get_attch_icon
- * DESCRIPTION
- * Get status icon of a mail in Inbox list
- * PARAMETERS
- * attachNum [IN] Number of attachments
- * attch_type [IN] Mine type of attacments
- * attachImageList [OUT] Image list of attachments
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_inbox_get_attch_icon(U8 attachNum, U8 *attch_type, U16 *attachImageList)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < attachNum; i++)
- {
- if (attch_type[i] == MIME_TYPE_IMAGE)
- {
- attachImageList[i] = IMG_EMAIL_ATTACH_IMAGE_ID;
- }
- else if (attch_type[i] == MIME_TYPE_AUDIO)
- {
- attachImageList[i] = IMG_EMAIL_ATTACH_AUDIO_ID;
- }
- else if (attch_type[i] == MIME_TYPE_VIDEO)
- {
- attachImageList[i] = IMG_EMAIL_ATTACH_VIDEO_ID;
- }
- else
- {
- attachImageList[i] = IMG_EMAIL_ATTACH_UNKNOWN_ID;
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_inbox_get_async_items
- * DESCRIPTION
- * Fill dynamic list items of inbox
- * PARAMETERS
- * start_indx [IN] Start index of item to be retrieved.
- * menuData [IN/OUT] UI structure to store the list data.
- * num_item [IN] Number of items revrieved.
- * RETURNS
- * number of items can be retrieved.
- *****************************************************************************/
- S32 mmi_email_inbox_get_async_items(S32 start_indx, gui_iconlist_menu_item *menuData, S32 num_item)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i, j;
- mmi_mem_pool_ret_enum ret_result;
- mmi_email_mail_info_struct *listMsgsStruct[EMAIL_TOTAL_MSG_BUFF];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->mem_pool_info.start_indx = start_indx;
- email_p->mem_pool_info.end_indx = (start_indx + num_item) - 1;
- ret_result = mmi_mem_get_values(
- &email_p->mem_pool_info.mem_container,
- (S16) email_p->mem_pool_info.start_indx,
- (S16) email_p->mem_pool_info.end_indx,
- (void **)listMsgsStruct,
- &email_p->mem_pool_info.not_avail_pool);
- if (ret_result != MEM_CT_SUCCESS)
- {
- #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
- if (email_p->prof_info.act_prof.in_prot == EMAIL_PROT_POP3 || email_p->main_info.curr_menu == MMI_EMAIL_UNSENT)
- #endif
- email_p->fldr_info.curr_page = email_p->mem_pool_info.not_avail_pool + 1;
- if (email_p->fldr_info.is_list_displayed)
- {
- mmi_email_fldr_pre_folder_select_req();
- }
- return 0; /* no items available */
- }
- /* fill data */
- for (j = 0; j < num_item; j++)
- {
- U16 status_img;
- U16 attch_img[MMI_EMAIL_MAX_NUM_ATTACH];
- mmi_email_mail_info_struct *temp = listMsgsStruct[j];
- if (!pfnUnicodeStrlen((S8*) temp->subject))
- {
- pfnUnicodeStrncpy(
- (S8*) menuData[j].item_list[0],
- (S8*) GetString(STR_EMAIL_COMMON_NO_SUBJECT_ID),
- EMAIL_MAX_SUBJ_DISPLAY_STR_LEN);
- }
- else
- {
- pfnUnicodeStrncpy((S8*) menuData[j].item_list[0], (S8*) temp->subject, EMAIL_MAX_SUBJ_DISPLAY_STR_LEN);
- }
- pfnUnicodeStrcpy((S8*) menuData[j].item_list[1], (S8*) temp->dt_buff);
- /* fill status icon */
- status_img = mmi_email_inbox_get_status_icon(temp->priority, temp->is_read);
- menuData[j].image_list[0] = (PU8) GetImage(status_img);
- mmi_email_inbox_get_attch_icon(temp->attch_num, temp->attch_type, attch_img);
- for (i = 0; i < temp->attch_num; i++)
- {
- menuData[j].image_list[i + 1] = (PU8) GetImage(attch_img[i]);
- }
- /* fill null pointer to prevent abnormal cases */
- for (; i < MMI_EMAIL_MAX_NUM_ATTACH; i++)
- {
- menuData[j].image_list[i + 1] = NULL;
- }
- }
- return num_item;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_read
- * DESCRIPTION
- * Entry Read Email screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_read(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 emailEmailReadEditorIcons[EMAIL_READ_TOTAL] =
- {
- IMG_EMAIL_READ_FROM_ID, IMG_EMAIL_READ_TO_ID,
- IMG_EMAIL_READ_CC_ID, IMG_EMAIL_READ_SUBJECT_ID,
- IMG_EMAIL_READ_ATTACHMENT_ID, 0
- };
- U8 *guiBuffer;
- U8 *inputBuffer;
- U16 inputBufferSize;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_READ, mmi_email_exit_read, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_READ);
- inputBuffer = GetCurrNInputBuffer(SCR_ID_EMAIL_READ, &inputBufferSize);
- InitializeCategory57Screen();
- mmi_email_read_fill_inline_struct();
- RegisterHighlightHandler(mmi_email_hilite_read_item);
- if (inputBuffer != NULL)
- {
- SetCategory57Data(wgui_inline_items, EMAIL_READ_TOTAL, inputBuffer);
- }
- /* sync current highlight item as normal email */
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* 0 */
- ShowCategory57Screen(
- STR_EMAIL_FROM_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_OPTIONS,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- EMAIL_READ_TOTAL,
- (U16*) emailEmailReadEditorIcons,
- wgui_inline_items,
- (S32) email_p->inbox_info.read_info.curr_inline_item,
- guiBuffer);
- SetCategory57RightSoftkeyFunctions(mmi_email_entry_read_opt, GoBackHistory);
- if (email_p->inbox_info.read_info.cont_exceed)
- {
- email_p->inbox_info.read_info.cont_exceed = FALSE;
- DisplayPopup(
- (U8*) GetString(STR_EMAIL_CONTENT_MESSAGE_TOO_ID),
- IMG_GLOBAL_EMPTY,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) EMPTY_LIST_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_exit_read
- * DESCRIPTION
- * Exit Read Email screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_exit_read(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_email_util_add_n_history(SCR_ID_EMAIL_READ, mmi_email_entry_read);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_read_fill_inline_struct
- * DESCRIPTION
- * Fill inline structure for Read Email screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_read_fill_inline_struct(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PU8 rightArrowImage;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* "FROM" */
- SetInlineItemActivation(&wgui_inline_items[0], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemImageText(
- &(wgui_inline_items[0]),
- (U8*) email_p->inbox_info.read_info.from_addr,
- (PU8) GetImage(IMG_EMAIL_READ_FROM_ID),
- NULL,
- (PU8) GetImage(RIGHT_RED_ARROW),
- sizeof(email_p->inbox_info.read_info.from_addr),
- STR_EMAIL_FROM_ID,
- 0,
- INPUT_TYPE_USE_ENCODING_BASED_LENGTH | INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
- SetInlineFullScreenEditCustomFunctionImageText(&(wgui_inline_items[0]), mmi_email_entry_read_opt);
- #ifdef __MMI_TOUCH_SCREEN__
- SetInlineImageTextPenHandler(&(wgui_inline_items[0]), NULL, mmi_email_read_goto_addr);
- #endif
- ShowAsControl(&(wgui_inline_items[0]));
- /* "TO" */
- rightArrowImage = NULL;
- SetInlineItemActivation(&wgui_inline_items[1], KEY_LSK, KEY_EVENT_UP);
- if (pfnUnicodeStrlen((S8*) email_p->inbox_info.read_info.addr_disp_buff[EMAIL_ADDR_TO]))
- {
- rightArrowImage = (PU8) GetImage(RIGHT_RED_ARROW);
- }
- SetInlineItemImageText(
- &(wgui_inline_items[1]),
- (U8*) email_p->inbox_info.read_info.addr_disp_buff[EMAIL_ADDR_TO],
- (PU8) GetImage(IMG_EMAIL_READ_TO_ID),
- NULL,
- rightArrowImage,
- sizeof(email_p->inbox_info.read_info.addr_disp_buff[EMAIL_ADDR_TO]),
- STR_EMAIL_TO_ID,
- 0,
- INPUT_TYPE_USE_ENCODING_BASED_LENGTH | INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
- SetInlineFullScreenEditCustomFunctionImageText(&(wgui_inline_items[1]), mmi_email_entry_read_opt);
- #ifdef __MMI_TOUCH_SCREEN__
- SetInlineImageTextPenHandler(&(wgui_inline_items[1]), NULL, mmi_email_read_goto_addr);
- #endif
- ShowAsControl(&(wgui_inline_items[1]));
- /* "CC" */
- rightArrowImage = NULL;
- if (pfnUnicodeStrlen((S8*) email_p->inbox_info.read_info.addr_disp_buff[EMAIL_ADDR_CC]))
- {
- rightArrowImage = (PU8) GetImage(RIGHT_RED_ARROW);
- }
- SetInlineItemActivation(&wgui_inline_items[2], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemImageText(
- &(wgui_inline_items[2]),
- (U8*) email_p->inbox_info.read_info.addr_disp_buff[EMAIL_ADDR_CC],
- (PU8) GetImage(IMG_EMAIL_READ_CC_ID),
- NULL,
- rightArrowImage,
- sizeof(email_p->inbox_info.read_info.addr_disp_buff[EMAIL_ADDR_CC]),
- STR_EMAIL_CC_ID,
- 0,
- INPUT_TYPE_USE_ENCODING_BASED_LENGTH | INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
- SetInlineFullScreenEditCustomFunctionImageText(&(wgui_inline_items[2]), mmi_email_entry_read_opt);
- #ifdef __MMI_TOUCH_SCREEN__
- SetInlineImageTextPenHandler(&(wgui_inline_items[2]), NULL, mmi_email_read_goto_addr);
- #endif
- ShowAsControl(&(wgui_inline_items[2]));
- /* "SUBJECT" */
- SetInlineItemActivation(&wgui_inline_items[3], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemImageText(
- &(wgui_inline_items[3]),
- (U8*) email_p->inbox_info.read_info.subj_buff,
- (PU8) GetImage(IMG_EMAIL_READ_SUBJECT_ID),
- NULL,
- NULL,
- sizeof(email_p->inbox_info.read_info.subj_buff),
- STR_EMAIL_SUBJECT_ID,
- 0,
- INPUT_TYPE_USE_ENCODING_BASED_LENGTH | INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
- SetInlineFullScreenEditCustomFunctionImageText(&(wgui_inline_items[3]), mmi_email_entry_read_opt);
- ShowAsControl(&(wgui_inline_items[3]));
- /* "ATTACHMENT" */
- SetInlineItemActivation(&wgui_inline_items[4], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemImageAttachment(
- &wgui_inline_items[4],
- (PU8) GetImage(IMG_EMAIL_READ_ATTACHMENT_ID),
- NULL,
- NULL,
- STR_EMAIL_ATTACHMENT_ID,
- 0,
- email_p->misc_info.curr_hilite_attch);
- RegisterAttachmentHighlightedFunction(&wgui_inline_items[4], mmi_email_hilite_read_attch);
- RegisterAttachmentLskFunction(&wgui_inline_items[4], mmi_email_read_attch_lsk);
- RegisterAttachmentRskFunction(&wgui_inline_items[4], mmi_email_read_attch_rsk);
- mmi_email_read_fill_attch_icon();
- /* "CONTENT" */
- SetInlineItemActivation(&wgui_inline_items[5], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineMultiLineRdOnly(
- &wgui_inline_items[5],
- (U8*) email_p->inbox_info.read_info.cont_buff,
- pfnUnicodeStrlen((S8*) email_p->inbox_info.read_info.cont_buff),
- INPUT_TYPE_USE_ENCODING_BASED_LENGTH | INPUT_TYPE_ALPHANUMERIC_SENTENCECASE,
- 7);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_read_fill_attch_icon
- * DESCRIPTION
- * Fill attachment icons according to their types.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_read_fill_attch_icon(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- U16 img_id;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearAllAttachmentImages(&wgui_inline_items[4], MMI_EMAIL_MAX_NUM_ATTACH);
- for (i = 0; i < MMI_EMAIL_MAX_NUM_ATTACH; i++)
- {
- if (!email_p->inbox_info.read_info.attch_list[i].attch_present)
- {
- continue;
- }
- img_id = mmi_email_util_get_attch_icon((S8*) email_p->inbox_info.read_info.attch_list[i].file_path);
- email_p->inbox_info.read_info.attch_icon[i].image1 = (PU8) GetImage(img_id);
- }
- AddEmailImageAttachmentUI(
- &wgui_inline_items[4],
- (wgui_inline_images_detail*) email_p->inbox_info.read_info.attch_icon);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_read_attch_lsk
- * DESCRIPTION
- * LSK handler of Inbox->Read->Attachment
- * PARAMETERS
- * image [IN] Currently no use.
- * str [IN] Currently no use.
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_read_attch_lsk(PU8 image, UI_string_type str)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (email_p->inbox_info.read_info.total_attch != 0)
- {
- mmi_email_entry_read_attch();
- }
- else
- {
- mmi_email_entry_read_opt();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_read_attch_rsk
- * DESCRIPTION
- * RSK handler of Inbox->Read->Attachment
- * PARAMETERS
- * image [IN] Currently no use.
- * str [IN] Currently no use.
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_read_attch_rsk(PU8 image, UI_string_type str)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_read_item
- * DESCRIPTION
- * Highlight handler of inline items in Read email screen
- * PARAMETERS
- * index [IN] Index of highlight item
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_read_item(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->comp_info.curr_addr_type = EMAIL_ADDR_NONE;
- email_p->inbox_info.read_info.curr_inline_item = (U8) index;
- switch (index)
- {
- case EMAIL_READ_FROM:
- email_p->comp_info.curr_addr_type = EMAIL_ADDR_FROM;
- mmi_email_util_change_title(STR_EMAIL_FROM_ID);
- ChangeLeftSoftkey(STR_GLOBAL_OPTIONS, IMG_GLOBAL_OK);
- SetKeyHandler(mmi_email_read_goto_addr, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(mmi_email_entry_read_opt, KEY_EVENT_UP);
- break;
- case EMAIL_READ_TO:
- email_p->comp_info.curr_addr_type = EMAIL_ADDR_TO;
- mmi_email_util_change_title(STR_EMAIL_TO_ID);
- ChangeLeftSoftkey(STR_GLOBAL_OPTIONS, IMG_GLOBAL_OK);
- SetKeyHandler(mmi_email_read_goto_addr, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(mmi_email_entry_read_opt, KEY_EVENT_UP);
- break;
- case EMAIL_READ_CC:
- email_p->comp_info.curr_addr_type = EMAIL_ADDR_CC;
- mmi_email_util_change_title(STR_EMAIL_CC_ID);
- ChangeLeftSoftkey(STR_GLOBAL_OPTIONS, IMG_GLOBAL_OK);
- SetKeyHandler(mmi_email_read_goto_addr, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(mmi_email_entry_read_opt, KEY_EVENT_UP);
- break;
- case EMAIL_READ_SUBJ:
- mmi_email_util_change_title(STR_EMAIL_SUBJECT_ID);
- ChangeLeftSoftkey(STR_GLOBAL_OPTIONS, IMG_GLOBAL_OK);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(mmi_email_entry_read_opt, KEY_EVENT_UP);
- break;
- case EMAIL_READ_ATTCH:
- mmi_email_util_change_title(STR_EMAIL_ATTACHMENT_ID);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- if (email_p->inbox_info.read_info.total_attch != 0)
- {
- ChangeLeftSoftkey(STR_GLOBAL_VIEW, IMG_GLOBAL_OK);
- }
- else
- {
- ChangeLeftSoftkey(STR_GLOBAL_OPTIONS, IMG_GLOBAL_OK);
- }
- break;
- case EMAIL_READ_CONT:
- mmi_email_util_change_title(STR_EMAIL_CONTENT_ID);
- ChangeLeftSoftkey(STR_GLOBAL_OPTIONS, IMG_GLOBAL_OK);
- SetLeftSoftkeyFunction(mmi_email_entry_read_opt, KEY_EVENT_UP);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_read_goto_addr
- * DESCRIPTION
- * Right arrow key handler for Read-> Address list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_read_goto_addr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 isEmpty = FALSE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (email_p->comp_info.curr_addr_type)
- {
- case EMAIL_ADDR_FROM:
- if (pfnUnicodeStrlen((S8*) email_p->inbox_info.from_info.from_addr) == 0)
- {
- isEmpty = TRUE;
- }
- break;
- case EMAIL_ADDR_TO:
- if (email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_TO].num_addr == 0)
- {
- isEmpty = TRUE;
- }
- break;
- case EMAIL_ADDR_CC:
- if (email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_CC].num_addr == 0)
- {
- isEmpty = TRUE;
- }
- break;
- }
- if (isEmpty)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_EMPTY),
- IMG_GLOBAL_EMPTY,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) EMPTY_LIST_TONE);
- }
- else
- {
- mmi_email_entry_read_addr();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_read_addr
- * DESCRIPTION
- * Entry address list of Read email screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_read_addr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 numItems;
- U8 *nStrMainItemList[MMI_EMAIL_MAX_LEN_ADDR_LIST];
- U8 *nStrPopupItemList[MMI_EMAIL_MAX_LEN_ADDR_LIST];
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_READ_ADDR, mmi_email_exit_read_addr, mmi_email_entry_read_addr, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_READ_ADDR);
- numItems = mmi_email_read_get_addr_list(nStrMainItemList, nStrPopupItemList);
- ShowCategory53Screen(
- STR_EMAIL_ADDRESS_LIST_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_OPTIONS,
- IMG_GLOBAL_OPTIONS,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- nStrMainItemList,
- (U16*) gIndexIconsImageList,
- nStrPopupItemList,
- 0,
- email_p->misc_info.curr_hilite_attch,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_email_entry_read_addr_opt, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_entry_read_addr_opt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_exit_read_addr
- * DESCRIPTION
- * Exit function of address list in Read email screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_exit_read_addr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->misc_info.curr_hilite_attch = GetHighlightedItem();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_read_get_addr_list
- * DESCRIPTION
- * Get address list of Read Email screen
- * PARAMETERS
- * nStrMainItemList [IN]
- * nStrPopupItemList [IN]
- * RETURNS
- * void
- *****************************************************************************/
- U16 mmi_email_read_get_addr_list(U8 **nStrMainItemList, U8 **nStrPopupItemList)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (email_p->comp_info.curr_addr_type)
- {
- case EMAIL_ADDR_FROM:
- nStrMainItemList[0] = (U8*) email_p->inbox_info.from_info.from_addr;
- if (pfnUnicodeStrlen((S8*) email_p->inbox_info.from_info.from_name))
- {
- nStrPopupItemList[0] = (U8*) email_p->inbox_info.from_info.from_name;
- }
- else
- {
- nStrPopupItemList[0] = NULL;
- }
- return 1;
- case EMAIL_ADDR_TO:
- for (index = 0; index < email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_TO].num_addr; index++)
- {
- nStrMainItemList[index] =
- (U8*) email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_TO].to_cc_mail[index];
- if (pfnUnicodeStrlen((S8*) email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_TO].to_cc_name[index]))
- {
- nStrPopupItemList[index] =
- (U8*) email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_TO].to_cc_name[index];
- }
- else
- {
- nStrPopupItemList[index] = NULL;
- }
- }
- return email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_TO].num_addr;
- default: /* case EMAIL_ADDR_CC: */
- for (index = 0; index < email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_CC].num_addr; index++)
- {
- nStrMainItemList[index] =
- (U8*) email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_CC].to_cc_mail[index];
- if (pfnUnicodeStrlen((S8*) email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_CC].to_cc_name[index]))
- {
- nStrPopupItemList[index] =
- (U8*) email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_CC].to_cc_name[index];
- }
- else
- {
- nStrPopupItemList[index] = NULL;
- }
- }
- return email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_CC].num_addr;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_read_addr_opt
- * DESCRIPTION
- * Entry option screen for Read->Address List
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_read_addr_opt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 numItems;
- U16 nStrItemList[2]; /* only save to phb ann send */
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_READ_ADDR_OPT, NULL, mmi_email_entry_read_addr_opt, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_READ_ADDR_OPT);
- SetParentHandler(MENU_ID_EMAIL_INBOX_ADDR_OPT);
- numItems = GetNumOfChild(MENU_ID_EMAIL_INBOX_ADDR_OPT);
- GetSequenceStringIds(MENU_ID_EMAIL_INBOX_ADDR_OPT, nStrItemList);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_EMAIL_ADDRESS_LIST_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_entry_read_attch
- * DESCRIPTION
- * Entry attachment list in Read Email screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_entry_read_attch(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 index;
- U8 *nStrItemList[MMI_EMAIL_MAX_NUM_ATTACH];
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_EMAIL_READ_ATTCH, mmi_email_exit_read_attch, mmi_email_entry_read_attch, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_READ_ATTCH);
- for (index = 0; index < email_p->inbox_info.read_info.total_attch; index++)
- {
- nStrItemList[index] = (U8*) email_p->inbox_info.read_info.attch_list[index].file_name;
- }
- RegisterHighlightHandler(mmi_email_hilite_read_attch_item);
- ShowCategory53Screen(
- STR_EMAIL_ATTACHMENT_ID,
- GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
- STR_GLOBAL_OPTIONS,
- IMG_GLOBAL_OPTIONS,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- (U16) email_p->inbox_info.read_info.total_attch,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- NULL,
- 0,
- email_p->misc_info.curr_hilite_attch,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_exit_read_attch
- * DESCRIPTION
- * Exit function for attachment list in Read Email screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_exit_read_attch(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* store current highlighted index for the usage of Read Email screen */
- email_p->misc_info.curr_hilite_attch = GetHighlightedItem();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_read_attch
- * DESCRIPTION
- * Callback function of RegisterAttachmentHighlightedFunction
- * to set current highlight attachment index
- * PARAMETERS
- * index [IN] Index of current highlighted item
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_read_attch(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->misc_info.curr_hilite_attch = (U8) index;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_hilite_read_attch_item
- * DESCRIPTION
- * Highlight handler of attachment in Read email screen
- * PARAMETERS
- * index [IN] Index of current highlighted item
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_email_hilite_read_attch_item(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 fileType;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- email_p->misc_info.curr_hilite_attch = (U8) index;
- fileType = mmi_fmgr_get_file_group((S8*) email_p->inbox_info.read_info.attch_list[index].file_path);
- if ((fileType == FMGR_GROUP_IMAGE) || (fileType == FMGR_GROUP_AUDIO) || (fileType == FMGR_GROUP_VIDEO))
- {
- ChangeLeftSoftkey(STR_GLOBAL_OPTIONS, IMG_GLOBAL_OPTIONS);
- SetLeftSoftkeyFunction(mmi_email_entry_read_attch_opt, KEY_EVENT_UP);
- SetKeyHandler(mmi_email_entry_read_attch_opt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- else
- {
- /* unknown attachment types */
- ChangeLeftSoftkey(STR_GLOBAL_SAVE, IMG_GLOBAL_OK);
- SetLeftSoftkeyFunction(mmi_email_read_attach_save, KEY_EVENT_UP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_email_entry_read_attch_opt
- * DESCRIPTION
- * Entry option screen in Inbox->Read->Attachment
- * PARAMETERS
- * void