UnifiedComposerMain.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:491k
源码类别:
MTK
开发平台:
C/C++
- mmi_uc_set_processing_screen(
- STR_GLOBAL_ABORTING,
- STR_UC_PLEASE_WAIT_ID,
- IMG_GLOBAL_PROGRESS,
- 0);
- mmi_uc_entry_processing_generic();
- mmi_uc_abort_send_mms_req(g_uc_p->send_info.new_msg_id);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_abort_send_mms_by_end_key
- * DESCRIPTION
- * Abort sending MMS by endkey
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_abort_send_mms_by_end_key(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Abort MMS sending if not in-call or in csd call for MMS over csd case. */
- if (isInCall() == FALSE || IsWapCallPresent())
- {
- g_uc_p->send_info.abort = MMI_UC_ABORT_BY_END_KEY;
- mmi_uc_set_processing_screen(
- STR_GLOBAL_ABORTING,
- STR_UC_PLEASE_WAIT_ID,
- IMG_GLOBAL_PROGRESS,
- 0);
- mmi_uc_entry_processing_generic();
- DeleteUptoScrID(IDLE_SCREEN_ID);
- mmi_uc_abort_send_mms_req(g_uc_p->send_info.new_msg_id);
- ClearInputEventHandler(MMI_DEVICE_ALL);
- ClearKeyHandler(KEY_END, KEY_EVENT_UP);
- ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_END, KEY_LONG_PRESS);
- ClearKeyHandler(KEY_END, KEY_REPEAT);
- }
- else
- {
- ExecCurrEndKeyDownHandler();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_done_opt_send
- * DESCRIPTION
- * Funtion is called when send menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_done_opt_send(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_uc_process_send, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_process_send, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_done_opt_send_and_save
- * DESCRIPTION
- * Funtion is called when send and save menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_done_opt_send_and_save(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_uc_process_send_and_save, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_process_send_and_save, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_done_opt_save
- * DESCRIPTION
- * Funtion is called when save menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_done_opt_save(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_uc_process_save, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_process_save, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_done_opt_back_to_edit
- * DESCRIPTION
- * Funtion is called when back to edit menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_done_opt_back_to_edit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_uc_process_back_to_edit, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_process_back_to_edit, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_done_opt_send_opt
- * DESCRIPTION
- * Funtion is called when send option menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_done_opt_send_opt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_uc_entry_send_opt, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_send_opt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_done_opt_exit
- * DESCRIPTION
- * Funtion is called when exit menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_done_opt_exit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetLeftSoftkeyFunction(mmi_uc_process_exit, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_process_exit, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_addr_list
- * DESCRIPTION
- * Entry function for address list screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_addr_list(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- S32 hiliteitem = 0;
- S32 numitem = 0;
- U16 title_id = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
- "*[UnifiedComposerMain.c] mmi_uc_entry_addr_list type=%d *n",
- g_uc_p->done.current_addr_type));
- switch(g_uc_p->done.current_addr_type)
- {
- case MMI_UC_ADDRESS_GROUP_TYPE_TO:
- {
- numitem = g_uc_p->msg.to_num;
- title_id = STR_UC_TO_ID;
- }
- break;
- case MMI_UC_ADDRESS_GROUP_TYPE_CC:
- {
- numitem = g_uc_p->msg.cc_num;
- title_id = STR_UC_CC_ID;
- }
- break;
- case MMI_UC_ADDRESS_GROUP_TYPE_BCC:
- {
- numitem = g_uc_p->msg.bcc_num;
- title_id = STR_UC_BCC_ID;
- }
- break;
- default:
- {
- MMI_ASSERT(0);
- }
- }
- MMI_ASSERT(numitem);
- EntryNewScreen(SCR_ID_UC_OPT_DONE_ADDR_LIST, mmi_uc_exit_generic, mmi_uc_entry_addr_list, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_OPT_DONE_ADDR_LIST);
- RegisterHighlightHandler(mmi_uc_set_addr_index);
- if (guiBuffer != NULL)
- {
- hiliteitem = (g_uc_p->done.current_addr_index <= numitem) ? g_uc_p->done.current_addr_index : 0;
- /* change gui buffer content */
- change_cat184_list_menu_history_highlighted_item(hiliteitem, guiBuffer);
- }
- else if (g_uc_p->done.current_addr_index > 0)
- {
- hiliteitem = (g_uc_p->done.current_addr_index <= numitem) ? g_uc_p->done.current_addr_index : 0;
- }
- ShowCategory184Screen(
- title_id,
- IMG_UC_ENTRY_SCRN_CAPTION_ID,
- STR_GLOBAL_OPTIONS,
- IMG_GLOBAL_OPTIONS,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numitem,
- mmi_uc_addr_list_get_item,
- NULL,
- hiliteitem,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_uc_entry_addr_option, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_addr_option, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_set_addr_index
- * DESCRIPTION
- * Set current highlighted address index
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_set_addr_index(S32 nIndex)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->done.current_addr_index = nIndex;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_addr_list_get_item
- * DESCRIPTION
- * Get address list item
- * PARAMETERS
- * item_index [IN]
- * str_buff [IN]
- * img_buff_p [?]
- * str_img_mask [IN]
- * a(?) [IN] Item index
- * d(?) [IN/OUT] String image mask
- * c(?) [IN/OUT] Image buffer
- * b(?) [IN/OUT] String buffer
- * RETURNS
- * TRUE
- *****************************************************************************/
- pBOOL mmi_uc_addr_list_get_item(S32 item_index, UI_string_type str_buff, PU8 *img_buff_p, U8 str_img_mask)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 temp[(MMI_UC_MAX_ADDR_LEN + 1) * ENCODING_LENGTH];
- S8 *name = NULL;
- U8 i = 0;
- mmi_uc_addr_struct* addr = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(temp, 0, sizeof(temp));
- switch(g_uc_p->done.current_addr_type)
- {
- case MMI_UC_ADDRESS_GROUP_TYPE_TO:
- {
- addr = g_uc_p->msg.to_head;
- MMI_ASSERT(item_index < g_uc_p->msg.to_num);
- }
- break;
- case MMI_UC_ADDRESS_GROUP_TYPE_CC:
- {
- addr = g_uc_p->msg.cc_head;
- MMI_ASSERT(item_index < g_uc_p->msg.cc_num);
- }
- break;
- case MMI_UC_ADDRESS_GROUP_TYPE_BCC:
- {
- addr = g_uc_p->msg.bcc_head;
- MMI_ASSERT(item_index < g_uc_p->msg.bcc_num);
- }
- break;
- default:
- {
- MMI_ASSERT(0);
- }
- }
- for (i = 0; i < item_index; i++)
- {
- addr = addr->next;
- MMI_ASSERT(addr);
- }
- if (addr->type == MMI_UC_ADDRESS_TYPE_PHONE_NUMBER)
- {
- AnsiiToUnicodeString(temp, (S8*) addr->addr);
- name = lookUpNumber(temp);
- if (name != NULL && pfnUnicodeStrlen(name) > 0)
- {
- pfnUnicodeStrncpy((S8*) str_buff, name, MAX_SUBMENU_CHARACTERS);
- }
- else
- {
- pfnUnicodeStrncpy((S8*) str_buff, temp, MAX_SUBMENU_CHARACTERS);
- }
- }
- else
- {
- pfnUnicodeStrncpy((S8*) str_buff, (S8*) addr->addr, MAX_SUBMENU_CHARACTERS);
- }
- *img_buff_p = (PU8) GetImage((U16) (gIndexIconsImageList[item_index]));
- return TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_addr_option
- * DESCRIPTION
- * Entry function for address option menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_addr_option(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- U16 numItems = 0;
- U16 nStrItemList[MAX_SUB_MENUS];
- U16 title_id = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_UC_OPT_DONE_ADDR_OPT, mmi_uc_exit_generic, mmi_uc_entry_addr_option, NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_entry_addr_option *n"));
- guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_OPT_DONE_ADDR_OPT);
- if (IsScreenPresent(SCR_ID_UC_OPT_DONE_ADDR_LIST))
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_ADDR_DONE);
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_ADDR_EDIT);
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_ADDR_DELETE);
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_ADDR_DELETE_ALL);
- }
- else
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_ADDR_DONE);
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_ADDR_EDIT);
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_ADDR_DELETE);
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_ADDR_DELETE_ALL);
- }
- if ((g_uc_p->msg.to_num + g_uc_p->msg.cc_num + g_uc_p->msg.bcc_num ) < MMI_UC_MAX_ADDRESS_NUM)
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_ADDR_ADD_NUMBER);
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_ADDR_ADD_NUMBER_GROUP);
- if (g_uc_p->msg_type.caller_specific_msg_type != MMI_UC_MSG_TYPE_SMS_ONLY)
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_ADDR_ADD_EMAIL);
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_ADDR_ADD_EMAIL_GROUP);
- }
- else
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_ADDR_ADD_EMAIL);
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_ADDR_ADD_EMAIL_GROUP);
- }
- }
- else
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_ADDR_ADD_NUMBER);
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_ADDR_ADD_NUMBER_GROUP);
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_ADDR_ADD_EMAIL);
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_ADDR_ADD_EMAIL_GROUP);
- }
- switch(g_uc_p->done.current_addr_type)
- {
- case MMI_UC_ADDRESS_GROUP_TYPE_TO:
- {
- title_id = STR_UC_TO_OPTION_ID;
- }
- break;
- case MMI_UC_ADDRESS_GROUP_TYPE_CC:
- {
- title_id = STR_UC_CC_OPTION_ID;
- }
- break;
- case MMI_UC_ADDRESS_GROUP_TYPE_BCC:
- {
- title_id = STR_UC_BCC_OPTION_ID;
- }
- break;
- default:
- {
- MMI_ASSERT(0);
- }
- }
- numItems = GetNumOfChild_Ext(MENU_ID_UC_OPT_ADDR);
- GetSequenceStringIds_Ext(MENU_ID_UC_OPT_ADDR, nStrItemList);
- SetParentHandler(MENU_ID_UC_OPT_ADDR);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- title_id,
- IMG_UC_ENTRY_SCRN_CAPTION_ID,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- NULL,
- 0,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_addr_opt_done
- * DESCRIPTION
- * Funtion is called when addr done menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_addr_opt_done(void)
- {
- SetLeftSoftkeyFunction(mmi_uc_go_back_to_done, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_go_back_to_done, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_addr_opt_add_number
- * DESCRIPTION
- * Funtion is called when addr add number menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_addr_opt_add_number(void)
- {
- /* use g_uc_p->done.to buffer to store phone number */
- memset(g_uc_p->done.to, 0, (MMI_UC_MAX_ADDR_LEN + 1) * ENCODING_LENGTH);
- g_uc_p->done.state = MMI_UC_DONE_STATE_ADD_NUMBER;
- SetLeftSoftkeyFunction(mmi_uc_entry_add_number, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_add_number, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_addr_opt_add_email
- * DESCRIPTION
- * Funtion is called when addr add email menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_addr_opt_add_email(void)
- {
- /* use g_uc_p->done.to buffer to store email */
- memset(g_uc_p->done.to, 0, (MMI_UC_MAX_ADDR_LEN + 1) * ENCODING_LENGTH);
- g_uc_p->done.state = MMI_UC_DONE_STATE_ADD_EMAIL;
- SetLeftSoftkeyFunction(mmi_uc_entry_add_email, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_add_email, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_addr_opt_edit
- * DESCRIPTION
- * Funtion is called when addr edit menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_addr_opt_edit(void)
- {
- /* use g_uc_p->done.to buffer to store edited address */
- memset(g_uc_p->done.to, 0, (MMI_UC_MAX_ADDR_LEN + 1) * ENCODING_LENGTH);
- SetLeftSoftkeyFunction(mmi_uc_pre_entry_edit_addr, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_pre_entry_edit_addr, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_addr_opt_delete
- * DESCRIPTION
- * Funtion is called when addr delete menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_addr_opt_delete(void)
- {
- SetLeftSoftkeyFunction(mmi_uc_entry_delete_addr, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_delete_addr, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_addr_opt_delete_all
- * DESCRIPTION
- * Funtion is called when addr delete all menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_addr_opt_delete_all(void)
- {
- SetLeftSoftkeyFunction(mmi_uc_entry_delete_all_addr, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_delete_all_addr, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_addr_opt_add_number_group
- * DESCRIPTION
- * Funtion is called when add number by group menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_addr_opt_add_number_group(void)
- {
- g_uc_p->done.state = MMI_UC_DONE_STATE_ADD_NUMBER_GROUP;
- SetLeftSoftkeyFunction(mmi_uc_entry_add_addr_group, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_add_addr_group, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_addr_opt_add_email_group
- * DESCRIPTION
- * Funtion is called when add email address by group menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_addr_opt_add_email_group(void)
- {
- g_uc_p->done.state = MMI_UC_DONE_STATE_ADD_EMAIL_GROUP;
- SetLeftSoftkeyFunction(mmi_uc_entry_add_addr_group, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_add_addr_group, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_go_back_to_done
- * DESCRIPTION
- * Entry done screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_go_back_to_done(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_ASSERT(IsScreenPresent(SCR_ID_UC_OPT_DONE));
- GoBackToHistory(SCR_ID_UC_OPT_DONE);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_add_number
- * DESCRIPTION
- * Entry msg number screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_add_number(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_UC_OPT_DONE_ADDR_OPT_ADD_NUMBER, NULL, mmi_uc_entry_add_number, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_OPT_DONE_ADDR_OPT_ADD_NUMBER);
- RegisterInputBoxEmptyFunction(mmi_uc_add_number_empty);
- RegisterInputBoxNotEmptyFunction(mmi_uc_add_number_not_empty);
- ShowCategory5Screen(
- STR_UC_ADD_NUMBER_ID,
- IMG_UC_ENTRY_SCRN_CAPTION_ID,
- STR_GLOBAL_OK,
- 0,
- STR_GLOBAL_BACK,
- 0,
- INPUT_TYPE_PHONE_NUMBER,
- (U8*) g_uc_p->done.to, /* use g_uc_p->done.to buffer to store phone number */
- MAX_DIGITS_SMS,
- guiBuffer);
- SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_add_number_empty
- * DESCRIPTION
- * LSK handle when number input is empty
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_add_number_empty(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_SEARCH, 0);
- SetLeftSoftkeyFunction(mmi_uc_search_phb_number, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_add_number_not_empty
- * DESCRIPTION
- * LSK handle when number input is not empty
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_add_number_not_empty(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- SetLeftSoftkeyFunction(mmi_uc_addr_add_number_done, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_search_phb_number
- * DESCRIPTION
- * Entry phonebook entry list to select phone number
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_search_phb_number(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_phb_list_pre_entry_for_number_and_email(MMI_PHB_ENTRY_FIELD_ALL_NUMBER, mmi_uc_get_address_from_phb);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_get_address_from_phb
- * DESCRIPTION
- * Get phonebook number
- * PARAMETERS
- * name [IN] Name
- * number [IN] Number
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_get_address_from_phb(S8* name, S8* number)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_uc_p->done.state == MMI_UC_DONE_STATE_ADD_NUMBER ||
- g_uc_p->done.state == MMI_UC_DONE_STATE_EDIT_NUMBER)
- {
- if (pfnUnicodeStrlen((PS8) number) > (MAX_DIGITS_SMS - 1))
- {
- DisplayPopup(
- (PU8) GetString(STR_UC_ADDR_LENGTH_EXCEED_ID),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- return;
- }
- }
- else if (g_uc_p->done.state == MMI_UC_DONE_STATE_ADD_EMAIL ||
- g_uc_p->done.state == MMI_UC_DONE_STATE_EDIT_EMAIL)
- {
- if (pfnUnicodeStrlen((PS8) number) > (MMI_UC_MAX_ADDR_LEN ))
- {
- DisplayPopup(
- (PU8) GetString(STR_UC_ADDR_LENGTH_EXCEED_ID),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- return;
- }
- }
- memset(g_uc_p->done.to, 0, (MMI_UC_MAX_ADDR_LEN + 1) * ENCODING_LENGTH);
- if (number)
- {
- pfnUnicodeStrncpy((S8*) g_uc_p->done.to, (PS8) number, MMI_UC_MAX_ADDR_LEN);
- }
- if (g_uc_p->done.state == MMI_UC_DONE_STATE_ADD_NUMBER)
- {
- HistoryReplace(SCR_ID_UC_OPT_DONE_ADDR_OPT_ADD_NUMBER,
- SCR_ID_UC_OPT_DONE_ADDR_OPT_ADD_NUMBER,
- mmi_uc_entry_add_number);
- GoBackToHistory(SCR_ID_UC_OPT_DONE_ADDR_OPT_ADD_NUMBER);
- }
- else if (g_uc_p->done.state == MMI_UC_DONE_STATE_ADD_EMAIL)
- {
- HistoryReplace(SCR_ID_UC_OPT_DONE_ADDR_OPT_ADD_EMAIL,
- SCR_ID_UC_OPT_DONE_ADDR_OPT_ADD_EMAIL,
- mmi_uc_entry_add_email);
- GoBackToHistory(SCR_ID_UC_OPT_DONE_ADDR_OPT_ADD_EMAIL);
- }
- else if (g_uc_p->done.state == MMI_UC_DONE_STATE_EDIT_NUMBER ||
- g_uc_p->done.state == MMI_UC_DONE_STATE_EDIT_EMAIL)
- {
- HistoryReplace(SCR_ID_UC_OPT_DONE_ADDR_OPT_EDIT,
- SCR_ID_UC_OPT_DONE_ADDR_OPT_EDIT,
- mmi_uc_entry_edit_addr);
- GoBackToHistory(SCR_ID_UC_OPT_DONE_ADDR_OPT_EDIT);
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_addr_add_number_done
- * DESCRIPTION
- * Get phonebook number
- * PARAMETERS
- * name [IN] Name
- * number [IN] Number
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_addr_add_number_done(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- BOOL result = MMI_FALSE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_uc_p->done.state == MMI_UC_DONE_STATE_ADD_NUMBER)
- {
- if (mmi_uc_check_duplicate_address(g_uc_p->done.to,
- MMI_UC_ADDRESS_TYPE_PHONE_NUMBER,
- g_uc_p->done.current_addr_type) != NULL)
- {
- DisplayPopup(
- (PU8) GetString(STR_UC_DUPLICATE_ADDRESS_ID),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- DeleteUptoScrID(SCR_ID_UC_OPT_DONE_ADDR_LIST);
- return;
- }
- if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- /* Check if the msg size exceeds the MMS limitation */
- U32 addr_size = wap_mma_uc_calc_header_attribute_size(MMA_HEADER_ADDRESS, (const kal_wchar *)g_uc_p->done.to);
- if (mmi_uc_check_if_exceed_MMS_size_limitation(addr_size + g_uc_p->msg.msg_size))
- {
- mmi_uc_display_popup(MMI_UC_SIZE_EXCEEDS);
- return;
- }
- }
- result = mmi_uc_add_address(g_uc_p->done.to,
- MMI_UC_ADDRESS_TYPE_PHONE_NUMBER,
- g_uc_p->done.current_addr_type);
- MMI_ASSERT(result);
- /* update the highlighted address to the new one */
- if (g_uc_p->done.current_addr_type == MMI_UC_ADDRESS_GROUP_TYPE_TO)
- {
- g_uc_p->done.current_addr_index = g_uc_p->msg.to_num - 1;
- }
- else if (g_uc_p->done.current_addr_type == MMI_UC_ADDRESS_GROUP_TYPE_CC)
- {
- g_uc_p->done.current_addr_index = g_uc_p->msg.cc_num - 1;
- }
- else if (g_uc_p->done.current_addr_type == MMI_UC_ADDRESS_GROUP_TYPE_BCC)
- {
- g_uc_p->done.current_addr_index = g_uc_p->msg.bcc_num - 1;
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- else if (g_uc_p->done.state == MMI_UC_DONE_STATE_EDIT_NUMBER)
- {
- mmi_uc_addr_struct* addr = mmi_uc_get_highlighted_addr();
- U8 ascii_addr[MMI_UC_MAX_ADDR_LEN + 1];
- U8 len = 0;
- if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- /* Check if the msg size exceeds the MMS limitation */
- U8 ori_addr_len = strlen((char*)addr->addr);
- U8* ori_ucs2_addr = OslMalloc((ori_addr_len + 1) * ENCODING_LENGTH);
- U32 addr_size = wap_mma_uc_calc_header_attribute_size(MMA_HEADER_ADDRESS, (const kal_wchar *)g_uc_p->done.to);
- U32 ori_addr_size = 0;
- memset(ori_ucs2_addr, 0, (ori_addr_len + 1) * ENCODING_LENGTH);
- AnsiiToUnicodeString((S8*)ori_ucs2_addr, (S8*)addr->addr);
- ori_addr_size = wap_mma_uc_calc_header_attribute_size(MMA_HEADER_ADDRESS, (const kal_wchar *)ori_ucs2_addr);
- OslMfree(ori_ucs2_addr);
- if (mmi_uc_check_if_exceed_MMS_size_limitation(addr_size + g_uc_p->msg.msg_size - ori_addr_size))
- {
- mmi_uc_display_popup(MMI_UC_SIZE_EXCEEDS);
- return;
- }
- }
- memset(ascii_addr, 0, sizeof(ascii_addr));
- UnicodeNToAnsii((S8*) ascii_addr, (S8*) g_uc_p->done.to, MMI_UC_MAX_ADDR_LEN * ENCODING_LENGTH);
- len = strlen((char*)ascii_addr);
- MMI_ASSERT(len <= MMI_UC_MAX_ADDR_LEN);
- kal_adm_free(g_uc_p->main.mem_pool_id , addr->addr);
- addr->addr = kal_adm_alloc(g_uc_p->main.mem_pool_id, len + 1);
- MMI_ASSERT(addr->addr);
- memset(addr->addr, 0, len + 1);
- memcpy(addr->addr, ascii_addr, len);
- }
- else
- {
- MMI_ASSERT(0);
- }
- if (!IsScreenPresent(SCR_ID_UC_OPT_DONE_ADDR_LIST))
- {
- result = HistoryReplace(SCR_ID_UC_OPT_DONE_ADDR_OPT, SCR_ID_UC_OPT_DONE_ADDR_LIST, mmi_uc_entry_addr_list);
- MMI_ASSERT(result);
- }
- if (mmi_uc_change_msg_type_if_needed())
- {
- mmi_uc_insert_signature_check();
- }
- mmi_uc_update_msg_size();
- GoBackToHistory(SCR_ID_UC_OPT_DONE_ADDR_LIST);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_add_email
- * DESCRIPTION
- * Entry msg email screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_add_email(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_UC_OPT_DONE_ADDR_OPT_ADD_EMAIL, NULL, mmi_uc_entry_add_email, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_OPT_DONE_ADDR_OPT_ADD_EMAIL);
- RegisterInputBoxEmptyFunction(mmi_uc_add_email_empty);
- RegisterInputBoxNotEmptyFunction(mmi_uc_add_email_not_empty);
- ShowCategory5Screen(
- STR_UC_ADD_EMAIL_ID,
- IMG_UC_ENTRY_SCRN_CAPTION_ID,
- STR_GLOBAL_OK,
- 0,
- STR_GLOBAL_BACK,
- 0,
- INPUT_TYPE_USE_ONLY_ENGLISH_MODES | INPUT_TYPE_ALPHANUMERIC_SENTENCECASE,
- (U8*) g_uc_p->done.to, /* use g_uc_p->done.to buffer to store email address */
- MMI_UC_MAX_ADDR_LEN + 1,
- guiBuffer);
- SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_add_email_empty
- * DESCRIPTION
- * LSK handle when email input is empty
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_add_email_empty(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_SEARCH, 0);
- SetLeftSoftkeyFunction(mmi_uc_search_phb_email, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_add_email_not_empty
- * DESCRIPTION
- * LSK handle when email input is not empty
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_add_email_not_empty(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- SetLeftSoftkeyFunction(mmi_uc_addr_add_email_done, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_search_phb_email
- * DESCRIPTION
- * Entry phonebook entry list to select email
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_search_phb_email(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_phb_list_pre_entry_for_number_and_email(MMI_PHB_ENTRY_FIELD_EMAIL, mmi_uc_get_address_from_phb);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_addr_add_email_done
- * DESCRIPTION
- * Get phonebook number
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_addr_add_email_done(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- BOOL result = MMI_FALSE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!mmi_uc_is_email_addr_valid(g_uc_p->done.to))
- {
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_INVALID),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- return;
- }
- if (g_uc_p->done.state == MMI_UC_DONE_STATE_ADD_EMAIL)
- {
- if (mmi_uc_check_duplicate_address(g_uc_p->done.to,
- MMI_UC_ADDRESS_TYPE_EMAIL,
- g_uc_p->done.current_addr_type) != NULL)
- {
- DisplayPopup(
- (PU8) GetString(STR_UC_DUPLICATE_ADDRESS_ID),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- DeleteUptoScrID(SCR_ID_UC_OPT_DONE_ADDR_LIST);
- return;
- }
- if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- /* Check if the msg size exceeds the MMS limitation */
- U32 addr_size = wap_mma_uc_calc_header_attribute_size(MMA_HEADER_ADDRESS, (const kal_wchar *)g_uc_p->done.to);
- if (mmi_uc_check_if_exceed_MMS_size_limitation(addr_size + g_uc_p->msg.msg_size))
- {
- mmi_uc_display_popup(MMI_UC_SIZE_EXCEEDS);
- return;
- }
- }
- result = mmi_uc_add_address(g_uc_p->done.to,
- MMI_UC_ADDRESS_TYPE_EMAIL,
- g_uc_p->done.current_addr_type);
- MMI_ASSERT(result);
- /* update the highlighted address to the new one */
- if (g_uc_p->done.current_addr_type == MMI_UC_ADDRESS_GROUP_TYPE_TO)
- {
- g_uc_p->done.current_addr_index = g_uc_p->msg.to_num - 1;
- }
- else if (g_uc_p->done.current_addr_type == MMI_UC_ADDRESS_GROUP_TYPE_CC)
- {
- g_uc_p->done.current_addr_index = g_uc_p->msg.cc_num - 1;
- }
- else if (g_uc_p->done.current_addr_type == MMI_UC_ADDRESS_GROUP_TYPE_BCC)
- {
- g_uc_p->done.current_addr_index = g_uc_p->msg.bcc_num - 1;
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- else if (g_uc_p->done.state == MMI_UC_DONE_STATE_EDIT_EMAIL)
- {
- mmi_uc_addr_struct* addr = mmi_uc_get_highlighted_addr();
- U8 len = 0;
- if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- /* Check if the msg size exceeds the MMS limitation */
- U32 addr_size = wap_mma_uc_calc_header_attribute_size(MMA_HEADER_ADDRESS, (const kal_wchar *)g_uc_p->done.to);
- U32 ori_addr_size = wap_mma_uc_calc_header_attribute_size(MMA_HEADER_ADDRESS, (const kal_wchar *)addr->addr);
- if (mmi_uc_check_if_exceed_MMS_size_limitation((addr_size + g_uc_p->msg.msg_size - ori_addr_size)))
- {
- mmi_uc_display_popup(MMI_UC_SIZE_EXCEEDS);
- return;
- }
- }
- len = pfnUnicodeStrlen((char*)g_uc_p->done.to);
- MMI_ASSERT(len <= MMI_UC_MAX_ADDR_LEN);
- kal_adm_free(g_uc_p->main.mem_pool_id , addr->addr);
- addr->addr = kal_adm_alloc(g_uc_p->main.mem_pool_id, (len + 1) * ENCODING_LENGTH);
- MMI_ASSERT(addr->addr);
- memset(addr->addr, 0, (len + 1) * ENCODING_LENGTH);
- memcpy(addr->addr, g_uc_p->done.to, (len * ENCODING_LENGTH));
- }
- else
- {
- MMI_ASSERT(0);
- }
- if (!IsScreenPresent(SCR_ID_UC_OPT_DONE_ADDR_LIST))
- {
- result = HistoryReplace(SCR_ID_UC_OPT_DONE_ADDR_OPT, SCR_ID_UC_OPT_DONE_ADDR_LIST, mmi_uc_entry_addr_list);
- MMI_ASSERT(result);
- }
- if (mmi_uc_change_msg_type_if_needed())
- {
- mmi_uc_insert_signature_check();
- }
- mmi_uc_update_msg_size();
- GoBackToHistory(SCR_ID_UC_OPT_DONE_ADDR_LIST);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_get_group_addr_callback
- * DESCRIPTION
- * Add address group from phonebook callback
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_get_group_addr_callback (U16 cnt, U16 *PhbIndex)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 index = 0;
- BOOL result = MMI_TRUE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (cnt == 0)
- {
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_EMPTY),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- return;
- }
- if (g_uc_p->done.state == MMI_UC_DONE_STATE_ADD_NUMBER_GROUP)
- {
- U8 PhbNum[MAX_DIGITS + 2];
- for (; index < cnt; index++)
- {
- U8 type = 0;
- if ((g_uc_p->msg.to_num + g_uc_p->msg.cc_num + g_uc_p->msg.bcc_num ) >= MMI_UC_MAX_ADDRESS_NUM)
- {
- DisplayPopup(
- (PU8) GetString(STR_UC_ADDRESS_NUMBER_EXCEED_ID),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- if (IsScreenPresent(SCR_ID_UC_OPT_DONE_ADDR_LIST))
- {
- DeleteUptoScrID(SCR_ID_UC_OPT_DONE_ADDR_LIST);
- }
- else if (IsScreenPresent(SCR_ID_UC_OPT_DONE_ADDR_OPT))
- {
- DeleteUptoScrID(SCR_ID_UC_OPT_DONE_ADDR_OPT);
- }
- else
- {
- MMI_ASSERT(0);
- }
- return;
- }
- memset(PhbNum, 0, MAX_DIGITS + 2);
- mmi_phb_convert_to_digit((U8*) PhbNum, (U8*) PhoneBook[PhbIndex[index]].tel.number, MAX_DIGITS + 2);
- memset(g_uc_p->done.to, 0, (MMI_UC_MAX_ADDR_LEN + 1) * ENCODING_LENGTH);
- if (PhoneBook[PhbIndex[index]].tel.type == CSMCC_INTERNATIONAL_ADDR)
- {
- type = 1;
- AnsiiToUnicodeString((S8*) g_uc_p->done.to, "+");
- }
- AnsiiNToUnicodeString(
- (S8*) &g_uc_p->done.to[type * ENCODING_LENGTH],
- (S8*) PhbNum,
- PhoneBook[PhbIndex[index]].tel.length);
- if ( pfnUnicodeStrlen((S8*)g_uc_p->done.to) > (MAX_DIGITS_SMS - 1))
- {
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_get_group_addr_callback number length too long *n"));
- continue;
- }
- if (mmi_uc_check_duplicate_address(g_uc_p->done.to,
- MMI_UC_ADDRESS_TYPE_PHONE_NUMBER,
- g_uc_p->done.current_addr_type) != NULL)
- {
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_get_group_addr_callback duplicate addr *n"));
- continue;
- }
- if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- /* Check if the msg size exceeds the MMS limitation */
- U32 addr_size = wap_mma_uc_calc_header_attribute_size(MMA_HEADER_ADDRESS, (const kal_wchar *)g_uc_p->done.to);
- if (mmi_uc_check_if_exceed_MMS_size_limitation(addr_size + g_uc_p->msg.msg_size))
- {
- mmi_uc_display_popup(MMI_UC_SIZE_EXCEEDS);
- if (IsScreenPresent(SCR_ID_UC_OPT_DONE_ADDR_LIST))
- {
- DeleteUptoScrID(SCR_ID_UC_OPT_DONE_ADDR_LIST);
- }
- else if (IsScreenPresent(SCR_ID_UC_OPT_DONE_ADDR_OPT))
- {
- DeleteUptoScrID(SCR_ID_UC_OPT_DONE_ADDR_OPT);
- }
- else
- {
- MMI_ASSERT(0);
- }
- return;
- }
- }
- result = mmi_uc_add_address(g_uc_p->done.to,
- MMI_UC_ADDRESS_TYPE_PHONE_NUMBER,
- g_uc_p->done.current_addr_type);
- MMI_ASSERT(result);
- /* update the highlighted address to the new one */
- if (g_uc_p->done.current_addr_type == MMI_UC_ADDRESS_GROUP_TYPE_TO)
- {
- g_uc_p->done.current_addr_index = g_uc_p->msg.to_num - 1;
- }
- else if (g_uc_p->done.current_addr_type == MMI_UC_ADDRESS_GROUP_TYPE_CC)
- {
- g_uc_p->done.current_addr_index = g_uc_p->msg.cc_num - 1;
- }
- else if (g_uc_p->done.current_addr_type == MMI_UC_ADDRESS_GROUP_TYPE_BCC)
- {
- g_uc_p->done.current_addr_index = g_uc_p->msg.bcc_num - 1;
- }
- else
- {
- MMI_ASSERT(0);
- }
- if (!IsScreenPresent(SCR_ID_UC_OPT_DONE_ADDR_LIST))
- {
- result = HistoryReplace(SCR_ID_UC_OPT_DONE_ADDR_OPT, SCR_ID_UC_OPT_DONE_ADDR_LIST, mmi_uc_entry_addr_list);
- MMI_ASSERT(result);
- }
- if (mmi_uc_change_msg_type_if_needed())
- {
- mmi_uc_insert_signature_check();
- }
- mmi_uc_update_msg_size();
- }
- }
- else if (g_uc_p->done.state == MMI_UC_DONE_STATE_ADD_EMAIL_GROUP)
- {
- U8* email_addr;
- U8 addr_length;
- for (; index < cnt; index++)
- {
- if ((g_uc_p->msg.to_num + g_uc_p->msg.cc_num + g_uc_p->msg.bcc_num ) >= MMI_UC_MAX_ADDRESS_NUM)
- {
- DisplayPopup(
- (PU8) GetString(STR_UC_ADDRESS_NUMBER_EXCEED_ID),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MMI_UC_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- if (IsScreenPresent(SCR_ID_UC_OPT_DONE_ADDR_LIST))
- {
- DeleteUptoScrID(SCR_ID_UC_OPT_DONE_ADDR_LIST);
- }
- else if (IsScreenPresent(SCR_ID_UC_OPT_DONE_ADDR_OPT))
- {
- DeleteUptoScrID(SCR_ID_UC_OPT_DONE_ADDR_OPT);
- }
- else
- {
- MMI_ASSERT(0);
- }
- return;
- }
- email_addr = mmi_phb_get_email_p(PhbIndex[index], &addr_length);
- if ( addr_length > MMI_UC_MAX_ADDR_LEN)
- {
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_get_group_addr_callback email addr length too long *n"));
- continue;
- }
- memset(g_uc_p->done.to, 0, (MMI_UC_MAX_ADDR_LEN + 1) * ENCODING_LENGTH);
- AnsiiNToUnicodeString((S8*) g_uc_p->done.to, (S8*) email_addr, addr_length);
- if (!mmi_uc_is_email_addr_valid(g_uc_p->done.to))
- {
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_get_group_addr_callback invalid email addr *n"));
- continue;
- }
- if (mmi_uc_check_duplicate_address(g_uc_p->done.to,
- MMI_UC_ADDRESS_TYPE_EMAIL,
- g_uc_p->done.current_addr_type) != NULL)
- {
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_get_group_addr_callback duplicate addr *n"));
- continue;
- }
- if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- /* Check if the msg size exceeds the MMS limitation */
- U32 addr_size = wap_mma_uc_calc_header_attribute_size(MMA_HEADER_ADDRESS, (const kal_wchar *)g_uc_p->done.to);
- if (mmi_uc_check_if_exceed_MMS_size_limitation(addr_size + g_uc_p->msg.msg_size))
- {
- mmi_uc_display_popup(MMI_UC_SIZE_EXCEEDS);
- if (IsScreenPresent(SCR_ID_UC_OPT_DONE_ADDR_LIST))
- {
- DeleteUptoScrID(SCR_ID_UC_OPT_DONE_ADDR_LIST);
- }
- else if (IsScreenPresent(SCR_ID_UC_OPT_DONE_ADDR_OPT))
- {
- DeleteUptoScrID(SCR_ID_UC_OPT_DONE_ADDR_OPT);
- }
- else
- {
- MMI_ASSERT(0);
- }
- return;
- }
- }
- result = mmi_uc_add_address(g_uc_p->done.to,
- MMI_UC_ADDRESS_TYPE_EMAIL,
- g_uc_p->done.current_addr_type);
- MMI_ASSERT(result);
- /* update the highlighted address to the new one */
- if (g_uc_p->done.current_addr_type == MMI_UC_ADDRESS_GROUP_TYPE_TO)
- {
- g_uc_p->done.current_addr_index = g_uc_p->msg.to_num - 1;
- }
- else if (g_uc_p->done.current_addr_type == MMI_UC_ADDRESS_GROUP_TYPE_CC)
- {
- g_uc_p->done.current_addr_index = g_uc_p->msg.cc_num - 1;
- }
- else if (g_uc_p->done.current_addr_type == MMI_UC_ADDRESS_GROUP_TYPE_BCC)
- {
- g_uc_p->done.current_addr_index = g_uc_p->msg.bcc_num - 1;
- }
- else
- {
- MMI_ASSERT(0);
- }
- if (!IsScreenPresent(SCR_ID_UC_OPT_DONE_ADDR_LIST))
- {
- result = HistoryReplace(SCR_ID_UC_OPT_DONE_ADDR_OPT, SCR_ID_UC_OPT_DONE_ADDR_LIST, mmi_uc_entry_addr_list);
- MMI_ASSERT(result);
- }
- if (mmi_uc_change_msg_type_if_needed())
- {
- mmi_uc_insert_signature_check();
- }
- mmi_uc_update_msg_size();
- }
- }
- else
- {
- MMI_ASSERT(0);
- }
- GoBackToHistory(SCR_ID_UC_OPT_DONE_ADDR_LIST);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_pre_entry_edit_addr
- * DESCRIPTION
- * Entry function for add address group
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_add_addr_group(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_uc_p->done.state == MMI_UC_DONE_STATE_ADD_NUMBER_GROUP)
- {
- mmi_phb_get_address_from_caller_group(MMI_PHB_ENTRY_FIELD_NUMBER, mmi_uc_get_group_addr_callback);
- }
- else if (g_uc_p->done.state == MMI_UC_DONE_STATE_ADD_EMAIL_GROUP)
- {
- mmi_phb_get_address_from_caller_group(MMI_PHB_ENTRY_FIELD_EMAIL, mmi_uc_get_group_addr_callback);
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_pre_entry_edit_addr
- * DESCRIPTION
- * Pre-Entry function for edit address
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_pre_entry_edit_addr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_uc_addr_struct* addr = mmi_uc_get_highlighted_addr();
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (addr->type == MMI_UC_ADDRESS_TYPE_PHONE_NUMBER)
- {
- g_uc_p->done.state = MMI_UC_DONE_STATE_EDIT_NUMBER;
- AnsiiNToUnicodeString((S8*) g_uc_p->done.to, (S8*) addr->addr, MMI_UC_MAX_ADDR_LEN);
- }
- else if (addr->type == MMI_UC_ADDRESS_TYPE_EMAIL)
- {
- g_uc_p->done.state = MMI_UC_DONE_STATE_EDIT_EMAIL;
- pfnUnicodeStrncpy((S8*)g_uc_p->done.to, (S8*) addr->addr, MMI_UC_MAX_ADDR_LEN);
- }
- else
- {
- MMI_ASSERT(0);
- }
- mmi_uc_entry_edit_addr();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_edit_addr
- * DESCRIPTION
- * Entry function for edit address
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_edit_addr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8* guiBuffer = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_UC_OPT_DONE_ADDR_OPT_EDIT, NULL, mmi_uc_entry_edit_addr, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_OPT_DONE_ADDR_OPT_EDIT);
- if (g_uc_p->done.state == MMI_UC_DONE_STATE_EDIT_NUMBER)
- {
- RegisterInputBoxEmptyFunction(mmi_uc_add_number_empty);
- RegisterInputBoxNotEmptyFunction(mmi_uc_add_number_not_empty);
- ShowCategory5Screen(
- STR_GLOBAL_EDIT,
- IMG_UC_ENTRY_SCRN_CAPTION_ID,
- STR_GLOBAL_OK,
- 0,
- STR_GLOBAL_BACK,
- 0,
- INPUT_TYPE_PHONE_NUMBER,
- (U8*) g_uc_p->done.to, /* use g_uc_p->done.to buffer to store phone number */
- MAX_DIGITS_SMS,
- guiBuffer);
- }
- else if (g_uc_p->done.state == MMI_UC_DONE_STATE_EDIT_EMAIL)
- {
- RegisterInputBoxEmptyFunction(mmi_uc_add_email_empty);
- RegisterInputBoxNotEmptyFunction(mmi_uc_add_email_not_empty);
- ShowCategory5Screen(
- STR_GLOBAL_EDIT,
- IMG_UC_ENTRY_SCRN_CAPTION_ID,
- STR_GLOBAL_OK,
- 0,
- STR_GLOBAL_BACK,
- 0,
- INPUT_TYPE_USE_ONLY_ENGLISH_MODES | INPUT_TYPE_ALPHANUMERIC_SENTENCECASE,
- (U8*) g_uc_p->done.to, /* use g_uc_p->done.to buffer to store email address */
- MMI_UC_MAX_ADDR_LEN + 1,
- guiBuffer);
- }
- else
- {
- MMI_ASSERT(0);
- }
- SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_delete_addr
- * DESCRIPTION
- * Entry function for delete address
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_delete_addr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_GLOBAL_DELETE),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(mmi_uc_process_delete_addr, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_process_delete_addr
- * DESCRIPTION
- * Delete current highlighted address
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_process_delete_addr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_uc_addr_struct* addr = mmi_uc_get_highlighted_addr();
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DeleteScreenIfPresent(SCR_ID_UC_OPT_DONE_ADDR_OPT);
- switch (g_uc_p->done.current_addr_type)
- {
- case MMI_UC_ADDRESS_GROUP_TYPE_TO:
- {
- if (g_uc_p->msg.to_num == 1)
- {
- DeleteScreenIfPresent(SCR_ID_UC_OPT_DONE_ADDR_LIST);
- }
- }
- break;
- case MMI_UC_ADDRESS_GROUP_TYPE_CC:
- {
- if (g_uc_p->msg.cc_num == 1)
- {
- DeleteScreenIfPresent(SCR_ID_UC_OPT_DONE_ADDR_LIST);
- }
- }
- break;
- case MMI_UC_ADDRESS_GROUP_TYPE_BCC:
- {
- if (g_uc_p->msg.bcc_num == 1)
- {
- DeleteScreenIfPresent(SCR_ID_UC_OPT_DONE_ADDR_LIST);
- }
- }
- break;
- default:
- {
- MMI_ASSERT(0);
- }
- break;
- }
- mmi_uc_delete_addr(addr);
- if (mmi_uc_change_msg_type_if_needed())
- {
- mmi_uc_insert_signature_check();
- }
- mmi_uc_update_msg_size();
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_delete_all_addr
- * DESCRIPTION
- * Entry function for delete all address of some group
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_delete_all_addr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_GLOBAL_DELETE_ALL),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(mmi_uc_process_delete_all_addr, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_process_delete_all_addr
- * DESCRIPTION
- * Delete current highlighted group addresses
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_process_delete_all_addr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DeleteScreenIfPresent(SCR_ID_UC_OPT_DONE_ADDR_OPT);
- DeleteScreenIfPresent(SCR_ID_UC_OPT_DONE_ADDR_LIST);
- mmi_uc_delete_all_addr(g_uc_p->done.current_addr_type);
- if (mmi_uc_change_msg_type_if_needed())
- {
- mmi_uc_insert_signature_check();
- }
- mmi_uc_update_msg_size();
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_msg_detail
- * DESCRIPTION
- * Entry function for message detail screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_msg_detail(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer, *info;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_MSG_DETAIL);
- info = (PU8) subMenuData;
- info[0] = 0;
- info[1] = 0;
- EntryNewScreen(SCR_ID_UC_MSG_DETAIL, mmi_uc_exit_generic, mmi_uc_entry_msg_detail, NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_entry_msg_detail *n"));
- mmi_uc_msg_detail_fill_info(info);
- ShowCategory74Screen(
- STR_UC_MESSAGE_DETAIL_ID,
- IMG_UC_ENTRY_SCRN_CAPTION_ID,
- 0,
- 0,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- (PU8) subMenuData,
- MAX_SUB_MENUS * MAX_SUB_MENU_SIZE,
- guiBuffer);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_msg_detail_fill_info
- * DESCRIPTION
- * Fill msg detail info
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_msg_detail_fill_info(U8* information)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8* info = information;
- U32 temp_string_len = 30;
- U8 temp_string[30];
- U8 temp_ucs2_string[30 * ENCODING_LENGTH];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* temp_string_len should be the same as length of temp_string[] and temp_ucs2_string[] */
- MMI_ASSERT(temp_string_len == 30);
- if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_SMS_PREFER)
- {
- U32 page;
- U32 total_msg;
- U32 recipient;
- page = mmi_uc_get_sms_segment_number();
- recipient = g_uc_p->msg.to_num;
- total_msg = page * recipient;
- /* Msg type caption */
- pfnUnicodeStrcpy((PS8) info, (PS8) GetString(STR_GLOBAL_1));
- pfnUnicodeStrcat((PS8) info, (PS8) L". ");
- pfnUnicodeStrcat((PS8) info, (PS8) GetString(STR_UC_MESSAGE_TYPE_ID));
- pfnUnicodeStrcat((PS8) info, (PS8) L":n");
- /* Msg type */
- pfnUnicodeStrcat((PS8) info, (PS8) L" ");
- pfnUnicodeStrcat((PS8) info, (PS8) GetString(STR_UC_TEXT_MESSAGE_ID));
- pfnUnicodeStrcat((PS8) info, (PS8) L"nn");
- /* Msg page caption */
- pfnUnicodeStrcat((PS8) info, (PS8) GetString(STR_GLOBAL_2));
- pfnUnicodeStrcat((PS8) info, (PS8) L". ");
- pfnUnicodeStrcat((PS8) info, (PS8) GetString(STR_UC_PAGES_ID));
- pfnUnicodeStrcat((PS8) info, (PS8) L":n");
- /* Msg page */
- memset(temp_string, 0, temp_string_len);
- memset(temp_ucs2_string, 0, temp_string_len * ENCODING_LENGTH);
- sprintf((char*)temp_string, "%d", page);
- AnsiiNToUnicodeString((S8*)temp_ucs2_string, (S8*)temp_string, temp_string_len);
- pfnUnicodeStrcat((PS8) info, (PS8) L" ");
- pfnUnicodeStrcat((PS8) info, (PS8) temp_ucs2_string);
- pfnUnicodeStrcat((PS8) info, (PS8) L"nn");
- /* Recipient caption */
- pfnUnicodeStrcat((PS8) info, (PS8) GetString(STR_GLOBAL_3));
- pfnUnicodeStrcat((PS8) info, (PS8) L". ");
- pfnUnicodeStrcat((PS8) info, (PS8) GetString(STR_UC_MSG_DETAIL_RECIPIENTS_ID));
- pfnUnicodeStrcat((PS8) info, (PS8) L":n");
- /* Recipient */
- memset(temp_string, 0, temp_string_len);
- memset(temp_ucs2_string, 0, temp_string_len * ENCODING_LENGTH);
- sprintf((char*)temp_string, "%d", recipient);
- AnsiiNToUnicodeString((S8*)temp_ucs2_string, (S8*)temp_string, temp_string_len);
- pfnUnicodeStrcat((PS8) info, (PS8) L" ");
- pfnUnicodeStrcat((PS8) info, (PS8) temp_ucs2_string);
- pfnUnicodeStrcat((PS8) info, (PS8) L"nn");
- /* Total msg caption */
- pfnUnicodeStrcat((PS8) info, (PS8) GetString(STR_GLOBAL_4));
- pfnUnicodeStrcat((PS8) info, (PS8) L". ");
- pfnUnicodeStrcat((PS8) info, (PS8) GetString(STR_UC_TOTAL_MESSAGES_ID));
- pfnUnicodeStrcat((PS8) info, (PS8) L":n");
- /* Total msg */
- memset(temp_string, 0, temp_string_len);
- memset(temp_ucs2_string, 0, temp_string_len * ENCODING_LENGTH);
- sprintf((char*)temp_string, "%d", total_msg);
- AnsiiNToUnicodeString((S8*)temp_ucs2_string, (S8*)temp_string, temp_string_len);
- pfnUnicodeStrcat((PS8) info, (PS8) L" ");
- pfnUnicodeStrcat((PS8) info, (PS8) temp_ucs2_string);
- }
- else if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_MMS_PREFER)
- {
- FLOAT size = 0;
- U32 att_num = 1;
- U32 recipient;
- mmi_uc_attachment_info_struct* attach = g_uc_p->msg.attachment_head;
- recipient = g_uc_p->msg.to_num + g_uc_p->msg.cc_num + g_uc_p->msg.bcc_num ;
- size = (FLOAT)g_uc_p->msg.msg_size / (FLOAT) 1024.0;
- /* Msg type caption */
- pfnUnicodeStrcpy((PS8) info, (PS8) GetString(STR_GLOBAL_1));
- pfnUnicodeStrcat((PS8) info, (PS8) L". ");
- pfnUnicodeStrcat((PS8) info, (PS8) GetString(STR_UC_MESSAGE_TYPE_ID));
- pfnUnicodeStrcat((PS8) info, (PS8) L":n");
- /* Msg type */
- pfnUnicodeStrcat((PS8) info, (PS8) L" ");
- pfnUnicodeStrcat((PS8) info, (PS8) GetString(STR_UC_MULTIMEDIA_MESSAGE_ID));
- pfnUnicodeStrcat((PS8) info, (PS8) L"nn");
- /* Msg size caption */
- pfnUnicodeStrcat((PS8) info, (PS8) GetString(STR_GLOBAL_2));
- pfnUnicodeStrcat((PS8) info, (PS8) L". ");
- pfnUnicodeStrcat((PS8) info, (PS8) GetString(STR_UC_SIZE_ID));
- pfnUnicodeStrcat((PS8) info, (PS8) L":n");
- /* Msg size */
- memset(temp_string, 0, temp_string_len);
- memset(temp_ucs2_string, 0, temp_string_len * ENCODING_LENGTH);
- sprintf((char*)temp_string, "%.1f Kb", size);
- AnsiiNToUnicodeString((S8*)temp_ucs2_string, (S8*)temp_string, temp_string_len);
- pfnUnicodeStrcat((PS8) info, (PS8) L" ");
- pfnUnicodeStrcat((PS8) info, (PS8) temp_ucs2_string);
- pfnUnicodeStrcat((PS8) info, (PS8) L"nn");
- /* Recipient caption */
- pfnUnicodeStrcat((PS8) info, (PS8) GetString(STR_GLOBAL_3));
- pfnUnicodeStrcat((PS8) info, (PS8) L". ");
- pfnUnicodeStrcat((PS8) info, (PS8) GetString(STR_UC_MSG_DETAIL_RECIPIENTS_ID));
- pfnUnicodeStrcat((PS8) info, (PS8) L":n");
- /* Recipient */
- memset(temp_string, 0, temp_string_len);
- memset(temp_ucs2_string, 0, temp_string_len * ENCODING_LENGTH);
- sprintf((char*)temp_string, "%d", recipient);
- AnsiiNToUnicodeString((S8*)temp_ucs2_string, (S8*)temp_string, temp_string_len);
- pfnUnicodeStrcat((PS8) info, (PS8) L" ");
- pfnUnicodeStrcat((PS8) info, (PS8) temp_ucs2_string);
- pfnUnicodeStrcat((PS8) info, (PS8) L"nn");
- /* Attachment caption */
- pfnUnicodeStrcat((PS8) info, (PS8) GetString(STR_GLOBAL_4));
- pfnUnicodeStrcat((PS8) info, (PS8) L". ");
- pfnUnicodeStrcat((PS8) info, (PS8) GetString(STR_UC_ATTACHMENT_ID));
- pfnUnicodeStrcat((PS8) info, (PS8) L":n");
- /* Attachments */
- if (g_uc_p->msg.total_attachment_num == 0)
- {
- pfnUnicodeStrcat((PS8) info, (PS8) L"n");
- }
- else
- {
- for (; att_num <= g_uc_p->msg.total_attachment_num ; att_num++)
- {
- U32 attach_size = attach->object->size / 1024;
- MMI_ASSERT(att_num <= MMI_UC_MAX_ATTACHMENT_NUM);
- MMI_ASSERT(att_num);
- memset(temp_string, 0, temp_string_len);
- memset(temp_ucs2_string, 0, temp_string_len * ENCODING_LENGTH);
- if (attach->object->size % 1024)
- {
- attach_size++;
- }
- sprintf((char*)temp_string, " (%d Kb)", attach_size);
- AnsiiNToUnicodeString((S8*)temp_ucs2_string, (S8*)temp_string, temp_string_len - 1);
- pfnUnicodeStrcat((PS8) info, (PS8) L" ");
- pfnUnicodeStrcat((PS8) info, (PS8) attach->object->file_name);
- pfnUnicodeStrcat((PS8) info, (PS8) temp_ucs2_string);
- pfnUnicodeStrcat((PS8) info, (PS8) L"n");
- attach = attach->next;
- }
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_insert
- * DESCRIPTION
- * Entry function for insert type list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_insert(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- U16 numItems = 0;
- U16 nStrItemList[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_UC_OPT_INSERT, mmi_uc_exit_generic, mmi_uc_entry_insert, NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_entry_insert *n"));
- guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_OPT_INSERT);
- if (g_uc_p->msg_type.caller_specific_msg_type == MMI_UC_MSG_TYPE_SMS_ONLY)
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_INSERT_IMAGE);
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_INSERT_AUDIO);
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_INSERT_VIDEO);
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_INSERT_ATTACHMENT);
- }
- else
- {
- if (g_uc_p->msg.total_slide_num == MMI_UC_MAX_MMS_SLIDE_NUM)
- {
- if (g_uc_p->msg.current_slide->image.object != NULL ||
- g_uc_p->msg.current_slide->video.object != NULL)
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_INSERT_IMAGE);
- }
- else
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_INSERT_IMAGE);
- }
- if (g_uc_p->msg.current_slide->audio.object != NULL ||
- g_uc_p->msg.current_slide->video.object != NULL)
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_INSERT_AUDIO);
- }
- else
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_INSERT_AUDIO);
- }
- if (g_uc_p->msg.current_slide->video.object != NULL ||
- g_uc_p->msg.current_slide->image.object != NULL ||
- g_uc_p->msg.current_slide->audio.object != NULL)
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_INSERT_VIDEO);
- }
- else
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_INSERT_VIDEO);
- }
- }
- else
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_INSERT_IMAGE);
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_INSERT_AUDIO);
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_INSERT_VIDEO);
- }
- if (g_uc_p->msg.total_attachment_num == MMI_UC_MAX_ATTACHMENT_NUM)
- {
- mmi_frm_hide_menu_item(MENU_ID_UC_OPT_INSERT_ATTACHMENT);
- }
- else
- {
- mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_INSERT_ATTACHMENT);
- }
- }
- numItems = GetNumOfChild_Ext(MENU_ID_UC_OPT_INSERT);
- GetSequenceStringIds_Ext(MENU_ID_UC_OPT_INSERT, nStrItemList);
- SetParentHandler(MENU_ID_UC_OPT_INSERT);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_UC_INSERT_ID,
- IMG_UC_ENTRY_SCRN_CAPTION_ID,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- NULL,
- 0,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_insert_image
- * DESCRIPTION
- * Funtion is called when insert image menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_insert_image(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->main.highlighted_object_type = MMI_UC_OBJECT_TYPE_IMAGE;
- SetLeftSoftkeyFunction(mmi_uc_select_fmgr_object, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_select_fmgr_object, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_insert_audio
- * DESCRIPTION
- * Funtion is called when insert audio menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_insert_audio(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->main.highlighted_object_type = MMI_UC_OBJECT_TYPE_AUDIO;
- SetLeftSoftkeyFunction(mmi_uc_select_fmgr_object, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_select_fmgr_object, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_insert_video
- * DESCRIPTION
- * Funtion is called when insert video menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_insert_video(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->main.highlighted_object_type = MMI_UC_OBJECT_TYPE_VIDEO;
- SetLeftSoftkeyFunction(mmi_uc_select_fmgr_object, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_select_fmgr_object, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_insert_attachment
- * DESCRIPTION
- * Funtion is called when insert attachment menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_insert_attachment(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->main.highlighted_object_type = MMI_UC_OBJECT_TYPE_ATTACHMENT;
- SetLeftSoftkeyFunction(mmi_uc_select_fmgr_object, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_select_fmgr_object, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_insert_bookmark
- * DESCRIPTION
- * Funtion is called when insert bookmark menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_insert_bookmark(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->main.highlighted_object_type = MMI_UC_OBJECT_TYPE_TEXT;
- SetLeftSoftkeyFunction(mmi_uc_entry_insert_bookmark, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_insert_bookmark, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_insert_text_template
- * DESCRIPTION
- * Funtion is called when insert attachment menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_insert_text_template(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->main.highlighted_object_type = MMI_UC_OBJECT_TYPE_TEXT;
- SetLeftSoftkeyFunction(mmi_msg_entry_template_list, KEY_EVENT_UP);
- SetKeyHandler(mmi_msg_entry_template_list, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_insert_phb_number
- * DESCRIPTION
- * Funtion is called when insert phb number menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_insert_phb_number(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->main.highlighted_object_type = MMI_UC_OBJECT_TYPE_TEXT;
- SetLeftSoftkeyFunction(mmi_uc_entry_insert_phb_number, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_insert_phb_number, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_highlight_insert_phb_name
- * DESCRIPTION
- * Funtion is called when insert phb name menu item selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_highlight_insert_phb_name(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_uc_p->main.highlighted_object_type = MMI_UC_OBJECT_TYPE_TEXT;
- SetLeftSoftkeyFunction(mmi_uc_entry_insert_phb_name, KEY_EVENT_UP);
- SetKeyHandler(mmi_uc_entry_insert_phb_name, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_select_fmgr_object
- * DESCRIPTION
- * Function for users to select inserted object according to selected type
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_select_fmgr_object(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- FMGR_FILTER filter;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- FMGR_FILTER_INIT(&filter);
- switch (g_uc_p->main.highlighted_object_type)
- {
- case MMI_UC_OBJECT_TYPE_IMAGE:
- {
- if (g_uc_p->mms_info.creation_mode == MMA_CREATION_MODE_RESTRICTED)
- {
- mmi_uc_set_file_mgr_filter(&filter, MMA_OPEN_RESTRICTED_IMAGE_TYPES);
- }
- else
- {
- mmi_uc_set_file_mgr_filter(&filter, MMA_OPEN_IMAGE_TYPES);
- }
- }
- break;
- case MMI_UC_OBJECT_TYPE_AUDIO:
- {
- if (g_uc_p->mms_info.creation_mode == MMA_CREATION_MODE_RESTRICTED)
- {
- mmi_uc_set_file_mgr_filter(&filter, MMA_OPEN_RESTRICTED_AUDIO_TYPES);
- }
- else
- {
- mmi_uc_set_file_mgr_filter(&filter, MMA_OPEN_AUDIO_TYPES);
- }
- }
- break;
- case MMI_UC_OBJECT_TYPE_VIDEO:
- {
- if (g_uc_p->mms_info.creation_mode == MMA_CREATION_MODE_RESTRICTED)
- {
- mmi_uc_set_file_mgr_filter(&filter, MMA_OPEN_RESTRICTED_VIDEO_TYPES);
- }
- else
- {
- mmi_uc_set_file_mgr_filter(&filter, MMA_OPEN_VIDEO_TYPES);
- }
- }
- break;
- case MMI_UC_OBJECT_TYPE_ATTACHMENT:
- {
- if (g_uc_p->mms_info.creation_mode == MMA_CREATION_MODE_RESTRICTED)
- {
- mmi_uc_set_file_mgr_filter(&filter, MMA_OPEN_RESTRICTED_ATTACHMENT_TYPES);
- }
- else
- {
- mmi_uc_set_file_mgr_filter(&filter, MMA_OPEN_ATTACHMENT_TYPES);
- }
- }
- break;
- default:
- {
- MMI_ASSERT(0);
- }
- break;
- }
- FMGR_FILTER_SET(&filter, FMGR_TYPE_FOLDER);
- FMGR_FILTER_SET(&filter, FMGR_TYPE_FOLDER_DOT);
- if (GetExitScrnID() == SCR_ID_UC_OPT_INSERT)
- {
- mmi_fmgr_select_path_and_enter(
- APP_MESSAGES,
- FMGR_SELECT_FILE | FMGR_SELECT_REPEAT,
- filter,
- (S8*) L"root",
- (PsExtFuncPtr) mmi_uc_select_object_from_fm_to_insert);
- }
- else if (GetExitScrnID() == SCR_ID_UC_OPT_REPLACE ||
- GetExitScrnID() == SCR_ID_UC_OPT_ATTACHMENT_LIST)
- {
- mmi_fmgr_select_path_and_enter(
- APP_MESSAGES,
- FMGR_SELECT_FILE | FMGR_SELECT_REPEAT,
- filter,
- (S8*) L"root",
- (PsExtFuncPtr) mmi_uc_select_object_from_fm_to_replace);
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_select_object_from_fm_to_insert
- * DESCRIPTION
- * Select object from file manager
- * PARAMETERS
- * filePath [IN]
- * is_short [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_select_object_from_fm_to_insert(PU16 filePath, S32 is_short)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 mmi_uc_image_path[MMI_UC_MAX_TEMP_FILE_LEN];
- mmi_uc_result result;
- U32 new_slide_size = 0;
- mma_insert_check_struct check_result;
- mmi_uc_slide_struct* slide = g_uc_p->msg.current_slide;
- mmi_uc_object_struct* object = NULL;
- mmi_uc_attachment_info_struct* att;
- mma_insert_type_enum mms_type = mmi_uc_convert_to_mms_insert_type(g_uc_p->main.highlighted_object_type);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(&check_result, 0, sizeof(mma_insert_check_struct));
- memset(mmi_uc_image_path, 0, MMI_UC_MAX_TEMP_FILE_LEN);
- if (filePath == NULL)
- {
- GoBackToHistory(SCR_ID_UC_OPT_INSERT);
- return;
- }
- mmi_uc_set_processing_screen(STR_UC_INSERT_ID, STR_UC_PLEASE_WAIT_ID, IMG_GLOBAL_PROGRESS, 0);
- mmi_uc_entry_processing_generic();
- switch (g_uc_p->main.highlighted_object_type)
- {
- case MMI_UC_OBJECT_TYPE_IMAGE:
- {
- if (g_uc_p->msg.current_slide->image.object != NULL ||
- g_uc_p->msg.current_slide->video.object != NULL)
- {
- new_slide_size = wap_mma_uc_calc_object_smil_size(MMA_INSERT_EMPTY_SLIDE, NULL);
- }
- }
- break;
- case MMI_UC_OBJECT_TYPE_AUDIO:
- {
- if (g_uc_p->msg.current_slide->audio.object != NULL ||
- g_uc_p->msg.current_slide->video.object != NULL)
- {
- new_slide_size = wap_mma_uc_calc_object_smil_size(MMA_INSERT_EMPTY_SLIDE, NULL);
- }
- }
- break;
- case MMI_UC_OBJECT_TYPE_VIDEO:
- {
- if (g_uc_p->msg.current_slide->video.object != NULL ||
- g_uc_p->msg.current_slide->image.object != NULL ||
- g_uc_p->msg.current_slide->audio.object != NULL)
- {
- new_slide_size = wap_mma_uc_calc_object_smil_size(MMA_INSERT_EMPTY_SLIDE, NULL);
- }
- }
- break;
- default:
- {
- ;
- }
- break;
- }
- if (g_uc_p->main.highlighted_object_type == MMI_UC_OBJECT_TYPE_IMAGE &&
- g_uc_p->mms_info.image_resize.enable)
- {
- S32 resize_result;
- MMI_UC_MAKE_IMAGE_FILE_PATH(mmi_uc_image_path, ++g_uc_p->main.image_no);
- resize_result = mmi_uc_resize_image(
- (U8*) filePath,
- mmi_uc_image_path,
- g_uc_p->mms_info.image_resize.width,
- g_uc_p->mms_info.image_resize.height);
- /* Error ! */
- if (resize_result < 0)
- {
- /* Check if it is DRM file */
- wap_mma_uc_insert_object_check(filePath,
- mms_type,
- g_uc_p->msg.msg_size,
- g_uc_p->mms_info.max_mms_size,
- &check_result);
- if (check_result.result == MMI_TRUE && check_result.drm_type == MMA_DRM_SD_NO_RIGHT)
- {
- /* allows inserted but display default image for thumbnail. */
- }
- else
- {
- mmi_uc_display_resize_result_popup(resize_result);
- DeleteScreenIfPresent(SCR_ID_UC_PROCESSING);
- return;
- }
- memset(&check_result, 0, sizeof(mma_insert_check_struct));
- }
- /* resized */
- else if (resize_result)
- {
- filePath = (PU16)mmi_uc_image_path;
- }
- /* resize_result == 0 means no need to resize */
- }
- object = mmi_uc_check_duplicate_object(filePath);
- if (g_uc_p->main.highlighted_object_type != MMI_UC_OBJECT_TYPE_ATTACHMENT &&
- object &&
- object->type != MMI_UC_OBJECT_TYPE_ATTACHMENT)
- {
- U32 obj_smil_size = wap_mma_uc_calc_object_smil_size(mms_type, filePath);
- if (!mmi_uc_check_if_exceed_MMS_size_limitation(obj_smil_size + new_slide_size + g_uc_p->msg.msg_size))
- {
- if (new_slide_size > 0)
- {
- slide = mmi_uc_insert_slide(g_uc_p->msg.current_slide);
- g_uc_p->msg.current_slide = slide;
- g_uc_p->msg.current_slide_num = slide->slide_num;
- }
- mmi_uc_insert_object_to_slide(object, slide, g_uc_p->main.highlighted_object_type);
- }
- else
- {
- mmi_uc_display_popup(MMI_UC_SIZE_EXCEEDS);
- return;
- }
- }
- else
- {
- wap_mma_uc_insert_object_check(filePath,
- mms_type,
- (g_uc_p->msg.msg_size + new_slide_size),
- g_uc_p->mms_info.max_mms_size,
- &check_result);
- if (!(check_result.result))
- {
- result = mmi_uc_convert_mms_check_result(&check_result);
- mmi_uc_display_popup(result);
- DeleteScreenIfPresent(SCR_ID_UC_PROCESSING);
- if (pfnUnicodeStrlen((S8*)mmi_uc_image_path))
- {
- FS_Delete((WCHAR*)mmi_uc_image_path);
- }
- return;
- }
- if (new_slide_size > 0)
- {
- slide = mmi_uc_insert_slide(g_uc_p->msg.current_slide);
- g_uc_p->msg.current_slide = slide;
- g_uc_p->msg.current_slide_num = slide->slide_num;
- }
- object = mmi_uc_insert_object((S8*) filePath, g_uc_p->main.highlighted_object_type);
- object->drm_type = check_result.drm_type;
- if (g_uc_p->main.highlighted_object_type == MMI_UC_OBJECT_TYPE_ATTACHMENT)
- {
- att = mmi_uc_insert_attachment();
- mmi_uc_insert_object_to_attachment(object, att);
- }
- else
- {
- mmi_uc_insert_object_to_slide(object, slide, g_uc_p->main.highlighted_object_type);
- }
- }
- fmgr_reset_app_select();
- /* Determine layout */
- if (g_uc_p->main.highlighted_object_type == MMI_UC_OBJECT_TYPE_IMAGE ||
- g_uc_p->main.highlighted_object_type == MMI_UC_OBJECT_TYPE_VIDEO)
- {
- if (g_uc_p->msg.layout == MMI_UC_LAYOUT_DEFAULT)
- {
- if (g_uc_p->msg.current_slide->text.char_count)
- {
- g_uc_p->msg.layout = MMI_UC_LAYOUT_THUMBNAIL_AT_BOTTOM;
- }
- else
- {
- g_uc_p->msg.layout = MMI_UC_LAYOUT_THUMBNAIL_AT_TOP;
- }
- }
- }
- if (mmi_uc_change_msg_type_if_needed())
- {
- mmi_uc_insert_signature_check();
- }
- mmi_uc_update_msg_size();
- if (new_slide_size)
- {
- mmi_uc_switch_slide(g_uc_p->msg.current_slide);
- }
- else
- {
- mmi_uc_editor_initialize();
- mmi_uc_set_editor_info(g_uc_p->msg.current_slide);
- }
- if (GetExitScrnID() == SCR_ID_UC_PROCESSING)
- {
- GoBackToHistory(SCR_ID_UC_EDITOR);
- }
- else
- {
- DeleteBetweenScreen(SCR_ID_UC_PROCESSING, SCR_ID_UC_OPT);
- }
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_insert_text_template
- * DESCRIPTION
- * Insert template
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_insert_text_template(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 *templ;
- historyNode *History;
- U16 templateCharNum = 0;
- U8 result = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_insert_text_template *n"));
- templ = g_msg_cntx.templates[g_msg_cntx.currHiliteIndex];
- if (templ)
- {
- templateCharNum = pfnUnicodeStrlen((PS8) templ);
- if (GetHistoryScrID(SCR_ID_UC_EDITOR, &History) == ST_SUCCESS)
- {
- result = wgui_uce_insert_text_template ((U8*) templ, templateCharNum, History->guiBuffer);
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- GoBackToHistory(SCR_ID_UC_EDITOR);
- if (result == 0 && templateCharNum != 0)
- {
- mmi_uc_display_popup(MMI_UC_NO_SPACE);
- }
- DeInitTemplates();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_entry_insert_bookmark
- * DESCRIPTION
- * Entry bookmark list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_entry_insert_bookmark(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetProtocolEventHandler(mmi_uc_handle_select_bookmark_rsp, MSG_ID_WAP_SELECT_BOOKMARK_RSP);
- wap_entry_select_bookmark();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_uc_handle_select_bookmark_rsp
- * DESCRIPTION
- *
- * PARAMETERS
- * inMsg [?]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_uc_handle_select_bookmark_rsp(void *inMsg)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wap_select_bookmark_rsp_struct *msg_rsp = (wap_select_bookmark_rsp_struct*) (inMsg);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_handle_select_bookmark_rsp *n"));
- if (msg_rsp->result == 1)
- {
- historyNode *History;
- U16 chars_num = strlen((S8*)msg_rsp->url);
- U8 result = 0;
- if (chars_num > 0)
- {
- U8* ucs2_buffer = OslMalloc((chars_num + 1) * ENCODING_LENGTH);
- memset(ucs2_buffer, 0x00, (chars_num + 1) * ENCODING_LENGTH);
- AnsiiNToUnicodeString((S8*) ucs2_buffer, (S8*) msg_rsp->url, chars_num);
- if (GetHistoryScrID(SCR_ID_UC_EDITOR, &History) == ST_SUCCESS)
- {
- result = wgui_uce_insert_text_template ((U8*) ucs2_buffer, chars_num, History->guiBuffer);
- }
- else
- {
- MMI_ASSERT(0);
- }
- OslMfree(ucs2_buffer);
- if (MMI_TRUE == mmi_msg_check_interrupt())
- {
- if (IsScreenPresent(SCR_ID_UC_EDITOR))
- {
- DeleteUptoScrID(SCR_ID_UC_EDITOR);
- }
- else
- {
- MMI_ASSERT(0);
- }
- }
- else
- {