VoIPSetting.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:180k
源码类别:
MTK
开发平台:
C/C++
- (VOIP_URI_LEN * ENCODING_LENGTH));
- /* Register Port */
- g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].reg_server_info.port = gui_atoi((UI_string_type) g_voip_cntx_p->prof_setting_info.disp_prof.portNumber);
- /* Username */
- memset(g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].reg_server_info.username, 0, VOIP_USERNAME_LEN);
- UnicodeNToAnsii(
- (S8*) g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].reg_server_info.username,
- (S8*) g_voip_cntx_p->prof_setting_info.disp_prof.username,
- (VOIP_USERNAME_LEN * ENCODING_LENGTH));
- /* Password */
- memset(g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].reg_server_info.password, 0, VOIP_PASSWORD_LEN);
- UnicodeNToAnsii(
- (S8*) g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].reg_server_info.password,
- (S8*) g_voip_cntx_p->prof_setting_info.disp_prof.password,
- (VOIP_PASSWORD_LEN * ENCODING_LENGTH));
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_update_prof_nat_disp_to_cache
- * DESCRIPTION
- * Copy g_voip_cntx_p->prof_setting_info.disp_prof to
- * g_voip_cntx_p->prof_setting_info.saved_prof[index] for NAT Setting.
- * PARAMETERS
- * profIndex [IN] Index of intended to update profile
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_update_prof_nat_disp_to_cache(S32 profIndex)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Status */
- g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.natStatus =
- g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex;
- /* Firewall IP */
- g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.natFirewall[0] = gui_atoi((UI_string_type) g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[0]);
- g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.natFirewall[1] = gui_atoi((UI_string_type) g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[1]);
- g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.natFirewall[2] = gui_atoi((UI_string_type) g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[2]);
- g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.natFirewall[3] = gui_atoi((UI_string_type) g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[3]);
- /* STUN Server */
- memset(g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.stunServer, 0, VOIP_URI_LEN);
- UnicodeNToAnsii(
- (S8*) g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.stunServer,
- (S8*) g_voip_cntx_p->prof_setting_info.disp_prof.serverName,
- (VOIP_URI_LEN * ENCODING_LENGTH));
- /* STUN Port */
- g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.stunPort = gui_atoi((UI_string_type) g_voip_cntx_p->prof_setting_info.disp_prof.portNumber);
- /* Refresh Interval */
- g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.refInterval =
- g_voip_cntx_p->prof_setting_info.disp_prof.intervalIndex;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_setup_prof_common_inlineitems
- * DESCRIPTION
- * Setup inline items for Common Setting.
- * PARAMETERS
- * void
- * RETURNS
- * Number of inline items used in Common Setting.
- *****************************************************************************/
- S32 mmi_voip_setup_prof_common_inlineitems(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Profile Name caption */
- SetInlineItemCaption(
- wgui_inline_items + MMI_VOIP_PROF_COMMON_PROFNAME_CAP,
- (U8*) GetString(STR_ID_VOIP_PROF_COMMON_PROFNAME));
- /* Profile Name */
- SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_COMMON_PROFNAME, KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit_ext(
- wgui_inline_items + MMI_VOIP_PROF_COMMON_PROFNAME,
- STR_ID_VOIP_PROF_COMMON_PROFNAME,
- GetRootTitleIcon(MENU_ID_VOIP_MAIN),
- (U8*) g_voip_cntx_p->prof_setting_info.disp_prof.profileName,
- MMI_VOIP_MAX_PROFILE_NAME_LEN,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE,
- INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
- SetInlineFullScreenEditCustomFunction(
- wgui_inline_items + MMI_VOIP_PROF_COMMON_PROFNAME,
- mmi_voip_highlight_full_screen_editor);
- /* Data Account caption */
- SetInlineItemCaption(
- wgui_inline_items + MMI_VOIP_PROF_COMMON_DATAACCT_CAP,
- (U8*) GetString(STR_ID_VOIP_PROF_COMMON_DATAACCOUNT));
- /* Data Account */
- SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_COMMON_DATAACCT, KEY_LSK, KEY_EVENT_UP);
- memset(g_voip_cntx_p->prof_setting_info.disp_prof.dataacctName, 0, ((MAX_DATA_ACCOUNT_NAME_LEN + 1) * sizeof(U16)));
- mmi_dtcnt_get_account_name(
- g_voip_cntx_p->prof_setting_info.disp_prof.dataacctIndex,
- (S8*) g_voip_cntx_p->prof_setting_info.disp_prof.dataacctName,
- MAX_DATA_ACCOUNT_NAME_LEN);
- SetInlineItemImageText(
- wgui_inline_items + MMI_VOIP_PROF_COMMON_DATAACCT,
- (U8*) g_voip_cntx_p->prof_setting_info.disp_prof.dataacctName,
- 0,
- 0,
- 0,
- MAX_DATA_ACCOUNT_NAME_LEN,
- 0,
- 0,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ENCODING_BASED_LENGTH);
- SetInlineFullScreenEditCustomFunctionImageText(
- wgui_inline_items + MMI_VOIP_PROF_COMMON_DATAACCT,
- mmi_voip_entry_prof_data_acct);
- ShowAsControl(wgui_inline_items + MMI_VOIP_PROF_COMMON_DATAACCT);
- /* Auto Login caption */
- SetInlineItemCaption(
- wgui_inline_items + MMI_VOIP_PROF_COMMON_AUTOLOGIN_CAP,
- (U8*) GetString(STR_ID_VOIP_PROF_COMMON_AUTOLOGIN));
- /* Auto Login */
- SetInlineItemActivation(
- wgui_inline_items + MMI_VOIP_PROF_COMMON_AUTOLOGIN,
- INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
- 0);
- g_voip_cntx_p->prof_setting_info.disp_prof.twoList[0] = (U8*) GetString(STR_GLOBAL_OFF);
- g_voip_cntx_p->prof_setting_info.disp_prof.twoList[1] = (U8*) GetString(STR_GLOBAL_ON);
- SetInlineItemSelect(
- wgui_inline_items + MMI_VOIP_PROF_COMMON_AUTOLOGIN,
- 2,
- g_voip_cntx_p->prof_setting_info.disp_prof.twoList,
- &g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex);
- /* Voice Mail Server caption */
- SetInlineItemCaption(
- wgui_inline_items + MMI_VOIP_PROF_COMMON_VMSERVER_CAP,
- (U8*) GetString(STR_ID_VOIP_PROF_COMMON_VMSERVER));
- /* Voice Mail Server */
- SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_COMMON_VMSERVER, KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit_ext(
- wgui_inline_items + MMI_VOIP_PROF_COMMON_VMSERVER,
- STR_ID_VOIP_PROF_COMMON_VMSERVER,
- GetRootTitleIcon(MENU_ID_VOIP_MAIN),
- g_voip_cntx_p->prof_setting_info.disp_prof.serverName,
- VOIP_URI_LEN,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
- INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
- SetInlineFullScreenEditCustomFunction(
- wgui_inline_items + MMI_VOIP_PROF_COMMON_VMSERVER,
- mmi_voip_highlight_full_screen_editor);
- return MMI_VOIP_PROF_COMMON_INLINE_TOTAL;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_setup_prof_acct_inlineitems
- * DESCRIPTION
- * Setup inline items for Account Setting.
- * PARAMETERS
- * void
- * RETURNS
- * Number of inline items used in Account Setting.
- *****************************************************************************/
- S32 mmi_voip_setup_prof_acct_inlineitems(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* SIP Server caption */
- SetInlineItemCaption(
- wgui_inline_items + MMI_VOIP_PROF_ACCT_SIPSERVER_CAP,
- (U8*) GetString(STR_ID_VOIP_PROF_ACCOUNT_SIPSERVER));
- /* SIP Server */
- SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_ACCT_SIPSERVER, KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit_ext(
- wgui_inline_items + MMI_VOIP_PROF_ACCT_SIPSERVER,
- STR_ID_VOIP_PROF_ACCOUNT_SIPSERVER,
- GetRootTitleIcon(MENU_ID_VOIP_MAIN),
- g_voip_cntx_p->prof_setting_info.disp_prof.serverName,
- VOIP_URI_LEN,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
- INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
- SetInlineFullScreenEditCustomFunction(
- wgui_inline_items + MMI_VOIP_PROF_ACCT_SIPSERVER,
- mmi_voip_highlight_full_screen_editor);
- /* SIP Port caption */
- SetInlineItemCaption(
- wgui_inline_items + MMI_VOIP_PROF_ACCT_SIPPORT_CAP,
- (U8*) GetString(STR_ID_VOIP_PROF_ACCOUNT_SIPPORT));
- /* SIP Port */
- SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_ACCT_SIPPORT, INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemTextEdit(
- wgui_inline_items + MMI_VOIP_PROF_ACCT_SIPPORT,
- g_voip_cntx_p->prof_setting_info.disp_prof.portNumber,
- MMI_VOIP_MAX_PORT_LEN,
- INPUT_TYPE_NUMERIC);
- RightJustifyInlineItem(wgui_inline_items + MMI_VOIP_PROF_ACCT_SIPPORT);
- EnableInlineItemBoundary(wgui_inline_items + MMI_VOIP_PROF_ACCT_SIPPORT);
- DisableInlineItemHighlight(wgui_inline_items + MMI_VOIP_PROF_ACCT_SIPPORT);
- /* EnableInlineItemDefaultText(); */
- SetInlineItemTextEditDefaultItemNameIfEmpty(
- wgui_inline_items + MMI_VOIP_PROF_ACCT_SIPPORT,
- STR_ID_VOIP_PROF_DEFAULT);
- /* Display Name caption */
- SetInlineItemCaption(
- wgui_inline_items + MMI_VOIP_PROF_ACCT_DISPNAME_CAP,
- (U8*) GetString(STR_ID_VOIP_PROF_ACCOUNT_DISPNAME));
- /* Display Name */
- SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_ACCT_DISPNAME, KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit_ext(
- wgui_inline_items + MMI_VOIP_PROF_ACCT_DISPNAME,
- STR_ID_VOIP_PROF_ACCOUNT_DISPNAME,
- GetRootTitleIcon(MENU_ID_VOIP_MAIN),
- (U8*) g_voip_cntx_p->prof_setting_info.disp_prof.displayName,
- VOIP_DISP_NAME_LEN,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE,
- INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
- SetInlineFullScreenEditCustomFunction(
- wgui_inline_items + MMI_VOIP_PROF_ACCT_DISPNAME,
- mmi_voip_highlight_full_screen_editor);
- /* Username caption */
- SetInlineItemCaption(
- wgui_inline_items + MMI_VOIP_PROF_ACCT_USERNAME_CAP,
- (U8*) GetString(STR_ID_VOIP_PROF_USERNAME));
- /* Username */
- SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_ACCT_USERNAME, KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit_ext(
- wgui_inline_items + MMI_VOIP_PROF_ACCT_USERNAME,
- STR_ID_VOIP_PROF_USERNAME,
- GetRootTitleIcon(MENU_ID_VOIP_MAIN),
- g_voip_cntx_p->prof_setting_info.disp_prof.username,
- VOIP_USERNAME_LEN,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
- INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
- SetInlineFullScreenEditCustomFunction(
- wgui_inline_items + MMI_VOIP_PROF_ACCT_USERNAME,
- mmi_voip_highlight_full_screen_editor);
- /* Password caption */
- SetInlineItemCaption(
- wgui_inline_items + MMI_VOIP_PROF_ACCT_PASSWORD_CAP,
- (U8*) GetString(STR_ID_VOIP_PROF_PASSWORD));
- /* Password */
- SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_ACCT_PASSWORD, KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit_ext(
- wgui_inline_items + MMI_VOIP_PROF_ACCT_PASSWORD,
- STR_ID_VOIP_PROF_PASSWORD,
- GetRootTitleIcon(MENU_ID_VOIP_MAIN),
- g_voip_cntx_p->prof_setting_info.disp_prof.password,
- VOIP_PASSWORD_LEN,
- INPUT_TYPE_ALPHANUMERIC_PASSWORD | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
- INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
- SetInlineFullScreenEditCustomFunction(
- wgui_inline_items + MMI_VOIP_PROF_ACCT_PASSWORD,
- mmi_voip_highlight_full_screen_editor);
- /* Authorization Name caption */
- SetInlineItemCaption(
- wgui_inline_items + MMI_VOIP_PROF_ACCT_AUTHNAME_CAP,
- (U8*) GetString(STR_ID_VOIP_PROF_ACCOUNT_AUTHNAME));
- /* Authorization Name */
- SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_ACCT_AUTHNAME, KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit_ext(
- wgui_inline_items + MMI_VOIP_PROF_ACCT_AUTHNAME,
- STR_ID_VOIP_PROF_ACCOUNT_AUTHNAME,
- GetRootTitleIcon(MENU_ID_VOIP_MAIN),
- g_voip_cntx_p->prof_setting_info.disp_prof.authName,
- VOIP_USERNAME_LEN,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
- INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
- SetInlineFullScreenEditCustomFunction(
- wgui_inline_items + MMI_VOIP_PROF_ACCT_AUTHNAME,
- mmi_voip_highlight_full_screen_editor);
- return MMI_VOIP_PROF_ACCT_INLINE_TOTAL;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_setup_prof_outbound_inlineitems
- * DESCRIPTION
- * Setup inline items for Outbound Server.
- * PARAMETERS
- * void
- * RETURNS
- * Number of inline items used in Outbound Server.
- *****************************************************************************/
- S32 mmi_voip_setup_prof_outbound_inlineitems(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Status caption */
- SetInlineItemCaption(
- wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_STATUS_CAP,
- (U8*) GetString(STR_ID_VOIP_PROF_STATUS));
- /* Status */
- SetInlineItemActivation(
- wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_STATUS,
- INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
- 0);
- g_voip_cntx_p->prof_setting_info.disp_prof.threeList[0] = (U8*) GetString(STR_ID_VOIP_PROF_OUTBOUND_NEVER);
- g_voip_cntx_p->prof_setting_info.disp_prof.threeList[1] = (U8*) GetString(STR_ID_VOIP_PROF_AUTO);
- g_voip_cntx_p->prof_setting_info.disp_prof.threeList[2] = (U8*) GetString(STR_ID_VOIP_PROF_OUTBOUND_ALWAYS);
- SetInlineItemSelect(
- wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_STATUS,
- 3,
- g_voip_cntx_p->prof_setting_info.disp_prof.threeList,
- &g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex);
- /* Outbound Server caption */
- SetInlineItemCaption(
- wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_SERVER_CAP,
- (U8*) GetString(STR_ID_VOIP_PROF_OUTBOUND_SERVER));
- /* Outbound Server */
- SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_SERVER, KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit_ext(
- wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_SERVER,
- STR_ID_VOIP_PROF_OUTBOUND_SERVER,
- GetRootTitleIcon(MENU_ID_VOIP_MAIN),
- g_voip_cntx_p->prof_setting_info.disp_prof.serverName,
- VOIP_URI_LEN,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
- INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
- SetInlineFullScreenEditCustomFunction(
- wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_SERVER,
- mmi_voip_highlight_full_screen_editor);
- /* Outbound Port caption */
- SetInlineItemCaption(
- wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_PORT_CAP,
- (U8*) GetString(STR_ID_VOIP_PROF_OUTBOUND_PORT));
- /* Outbound Port */
- SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_PORT, INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemTextEdit(
- wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_PORT,
- g_voip_cntx_p->prof_setting_info.disp_prof.portNumber,
- MMI_VOIP_MAX_PORT_LEN,
- INPUT_TYPE_NUMERIC);
- RightJustifyInlineItem(wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_PORT);
- EnableInlineItemBoundary(wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_PORT);
- DisableInlineItemHighlight(wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_PORT);
- /* EnableInlineItemDefaultText(); */
- SetInlineItemTextEditDefaultItemNameIfEmpty(
- wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_PORT,
- STR_ID_VOIP_PROF_DEFAULT);
- /* Username caption */
- SetInlineItemCaption(
- wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_USERNAME_CAP,
- (U8*) GetString(STR_ID_VOIP_PROF_ACCOUNT_AUTHNAME));
- /* Username */
- SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_USERNAME, KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit_ext(
- wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_USERNAME,
- STR_ID_VOIP_PROF_ACCOUNT_AUTHNAME,
- GetRootTitleIcon(MENU_ID_VOIP_MAIN),
- g_voip_cntx_p->prof_setting_info.disp_prof.username,
- VOIP_USERNAME_LEN,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
- INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
- SetInlineFullScreenEditCustomFunction(
- wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_USERNAME,
- mmi_voip_highlight_full_screen_editor);
- /* Password caption */
- SetInlineItemCaption(
- wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_PASSWORD_CAP,
- (U8*) GetString(STR_ID_VOIP_PROF_PASSWORD));
- /* Password */
- SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_PASSWORD, KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit_ext(
- wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_PASSWORD,
- STR_ID_VOIP_PROF_PASSWORD,
- GetRootTitleIcon(MENU_ID_VOIP_MAIN),
- g_voip_cntx_p->prof_setting_info.disp_prof.password,
- VOIP_PASSWORD_LEN,
- INPUT_TYPE_ALPHANUMERIC_PASSWORD | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
- INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
- SetInlineFullScreenEditCustomFunction(
- wgui_inline_items + MMI_VOIP_PROF_OUTBOUND_PASSWORD,
- mmi_voip_highlight_full_screen_editor);
- return MMI_VOIP_PROF_OUTBOUND_INLINE_TOTAL;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_setup_prof_register_inlineitems
- * DESCRIPTION
- * Setup inline items for Register Server.
- * PARAMETERS
- * void
- * RETURNS
- * Number of inline items used in Register Server.
- *****************************************************************************/
- S32 mmi_voip_setup_prof_register_inlineitems(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Status caption */
- SetInlineItemCaption(
- wgui_inline_items + MMI_VOIP_PROF_REGISTER_STATUS_CAP,
- (U8*) GetString(STR_ID_VOIP_PROF_STATUS));
- /* Status */
- SetInlineItemActivation(
- wgui_inline_items + MMI_VOIP_PROF_REGISTER_STATUS,
- INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
- 0);
- g_voip_cntx_p->prof_setting_info.disp_prof.twoList[0] = (U8*) GetString(STR_GLOBAL_OFF);
- g_voip_cntx_p->prof_setting_info.disp_prof.twoList[1] = (U8*) GetString(STR_GLOBAL_ON);
- SetInlineItemSelect(
- wgui_inline_items + MMI_VOIP_PROF_REGISTER_STATUS,
- 2,
- g_voip_cntx_p->prof_setting_info.disp_prof.twoList,
- &g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex);
- /* Register Server caption */
- SetInlineItemCaption(
- wgui_inline_items + MMI_VOIP_PROF_REGISTER_SERVER_CAP,
- (U8*) GetString(STR_ID_VOIP_PROF_REGISTER_SERVER));
- /* Register Server */
- SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_REGISTER_SERVER, KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit_ext(
- wgui_inline_items + MMI_VOIP_PROF_REGISTER_SERVER,
- STR_ID_VOIP_PROF_REGISTER_SERVER,
- GetRootTitleIcon(MENU_ID_VOIP_MAIN),
- g_voip_cntx_p->prof_setting_info.disp_prof.serverName,
- VOIP_URI_LEN,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
- INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
- SetInlineFullScreenEditCustomFunction(
- wgui_inline_items + MMI_VOIP_PROF_REGISTER_SERVER,
- mmi_voip_highlight_full_screen_editor);
- /* Register Port caption */
- SetInlineItemCaption(
- wgui_inline_items + MMI_VOIP_PROF_REGISTER_PORT_CAP,
- (U8*) GetString(STR_ID_VOIP_PROF_REGISTER_PORT));
- /* Register Port */
- SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_REGISTER_PORT, INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemTextEdit(
- wgui_inline_items + MMI_VOIP_PROF_REGISTER_PORT,
- g_voip_cntx_p->prof_setting_info.disp_prof.portNumber,
- MMI_VOIP_MAX_PORT_LEN,
- INPUT_TYPE_NUMERIC);
- RightJustifyInlineItem(wgui_inline_items + MMI_VOIP_PROF_REGISTER_PORT);
- EnableInlineItemBoundary(wgui_inline_items + MMI_VOIP_PROF_REGISTER_PORT);
- DisableInlineItemHighlight(wgui_inline_items + MMI_VOIP_PROF_REGISTER_PORT);
- /* EnableInlineItemDefaultText(); */
- SetInlineItemTextEditDefaultItemNameIfEmpty(
- wgui_inline_items + MMI_VOIP_PROF_REGISTER_PORT,
- STR_ID_VOIP_PROF_DEFAULT);
- /* Username caption */
- SetInlineItemCaption(
- wgui_inline_items + MMI_VOIP_PROF_REGISTER_USERNAME_CAP,
- (U8*) GetString(STR_ID_VOIP_PROF_ACCOUNT_AUTHNAME));
- /* Username */
- SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_REGISTER_USERNAME, KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit_ext(
- wgui_inline_items + MMI_VOIP_PROF_REGISTER_USERNAME,
- STR_ID_VOIP_PROF_ACCOUNT_AUTHNAME,
- GetRootTitleIcon(MENU_ID_VOIP_MAIN),
- g_voip_cntx_p->prof_setting_info.disp_prof.username,
- VOIP_USERNAME_LEN,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
- INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
- SetInlineFullScreenEditCustomFunction(
- wgui_inline_items + MMI_VOIP_PROF_REGISTER_USERNAME,
- mmi_voip_highlight_full_screen_editor);
- /* Password caption */
- SetInlineItemCaption(
- wgui_inline_items + MMI_VOIP_PROF_REGISTER_PASSWORD_CAP,
- (U8*) GetString(STR_ID_VOIP_PROF_PASSWORD));
- /* Password */
- SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_REGISTER_PASSWORD, KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit_ext(
- wgui_inline_items + MMI_VOIP_PROF_REGISTER_PASSWORD,
- STR_ID_VOIP_PROF_PASSWORD,
- GetRootTitleIcon(MENU_ID_VOIP_MAIN),
- g_voip_cntx_p->prof_setting_info.disp_prof.password,
- VOIP_PASSWORD_LEN,
- INPUT_TYPE_ALPHANUMERIC_PASSWORD | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
- INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
- SetInlineFullScreenEditCustomFunction(
- wgui_inline_items + MMI_VOIP_PROF_REGISTER_PASSWORD,
- mmi_voip_highlight_full_screen_editor);
- return MMI_VOIP_PROF_REGISTER_INLINE_TOTAL;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_setup_prof_nat_inlineitems
- * DESCRIPTION
- * Setup inline items for NAT Setting.
- * PARAMETERS
- * void
- * RETURNS
- * Number of inline items used in NAT Setting.
- *****************************************************************************/
- S32 mmi_voip_setup_prof_nat_inlineitems(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Status caption */
- SetInlineItemCaption(wgui_inline_items + MMI_VOIP_PROF_NAT_STATUS_CAP, (U8*) GetString(STR_ID_VOIP_PROF_STATUS));
- /* Status */
- SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_NAT_STATUS, INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- g_voip_cntx_p->prof_setting_info.disp_prof.threeList[0] = (U8*) GetString(STR_GLOBAL_OFF);
- g_voip_cntx_p->prof_setting_info.disp_prof.threeList[1] = (U8*) GetString(STR_ID_VOIP_PROF_NAT_STATICNAT);
- g_voip_cntx_p->prof_setting_info.disp_prof.threeList[2] = (U8*) GetString(STR_ID_VOIP_PROF_NAT_STUNSERVER);
- SetInlineItemSelect(
- wgui_inline_items + MMI_VOIP_PROF_NAT_STATUS,
- 3,
- g_voip_cntx_p->prof_setting_info.disp_prof.threeList,
- &g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex);
- /* NAT Firewall IP caption */
- SetInlineItemCaption(
- wgui_inline_items + MMI_VOIP_PROF_NAT_FIREWALL_CAP,
- (U8*) GetString(STR_ID_VOIP_PROF_NAT_FIREWALL));
- /* NAT Firewall IP */
- SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_NAT_FIREWALL, INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemIP4(
- wgui_inline_items + MMI_VOIP_PROF_NAT_FIREWALL,
- g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[0],
- g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[1],
- g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[2],
- g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[3],
- mmi_voip_prof_ip_addr_convert);
- /* STUN Server caption */
- SetInlineItemCaption(
- wgui_inline_items + MMI_VOIP_PROF_NAT_STUNSERVER_CAP,
- (U8*) GetString(STR_ID_VOIP_PROF_NAT_STUNSERVER));
- /* STUN Server */
- SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_NAT_STUNSERVER, KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit_ext(
- wgui_inline_items + MMI_VOIP_PROF_NAT_STUNSERVER,
- STR_ID_VOIP_PROF_NAT_STUNSERVER,
- GetRootTitleIcon(MENU_ID_VOIP_MAIN),
- g_voip_cntx_p->prof_setting_info.disp_prof.serverName,
- VOIP_URI_LEN,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
- INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
- SetInlineFullScreenEditCustomFunction(
- wgui_inline_items + MMI_VOIP_PROF_NAT_STUNSERVER,
- mmi_voip_highlight_full_screen_editor);
- /* STUN Port caption */
- SetInlineItemCaption(
- wgui_inline_items + MMI_VOIP_PROF_NAT_STUNPORT_CAP,
- (U8*) GetString(STR_ID_VOIP_PROF_NAT_STUNPORT));
- /* STUN Port */
- SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_NAT_STUNPORT, INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemTextEdit(
- wgui_inline_items + MMI_VOIP_PROF_NAT_STUNPORT,
- g_voip_cntx_p->prof_setting_info.disp_prof.portNumber,
- MMI_VOIP_MAX_PORT_LEN,
- INPUT_TYPE_NUMERIC);
- RightJustifyInlineItem(wgui_inline_items + MMI_VOIP_PROF_NAT_STUNPORT);
- EnableInlineItemBoundary(wgui_inline_items + MMI_VOIP_PROF_NAT_STUNPORT);
- DisableInlineItemHighlight(wgui_inline_items + MMI_VOIP_PROF_NAT_STUNPORT);
- /* EnableInlineItemDefaultText(); */
- SetInlineItemTextEditDefaultItemNameIfEmpty(
- wgui_inline_items + MMI_VOIP_PROF_NAT_STUNPORT,
- STR_ID_VOIP_PROF_DEFAULT);
- /* NAT Refresh Interval caption */
- SetInlineItemCaption(
- wgui_inline_items + MMI_VOIP_PROF_NAT_INTERVAL_CAP,
- (U8*) GetString(STR_ID_VOIP_PROF_NAT_INTERVAL));
- /* NAT Refresh Interval */
- SetInlineItemActivation(wgui_inline_items + MMI_VOIP_PROF_NAT_INTERVAL, INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- g_voip_cntx_p->prof_setting_info.disp_prof.fiveList[0] = (U8*) GetString(STR_ID_VOIP_PROF_AUTO);
- g_voip_cntx_p->prof_setting_info.disp_prof.fiveList[1] = (U8*) GetString(STR_ID_VOIP_PROF_NAT_5MIN);
- g_voip_cntx_p->prof_setting_info.disp_prof.fiveList[2] = (U8*) GetString(STR_ID_VOIP_PROF_NAT_10MIN);
- g_voip_cntx_p->prof_setting_info.disp_prof.fiveList[3] = (U8*) GetString(STR_ID_VOIP_PROF_NAT_30MIN);
- g_voip_cntx_p->prof_setting_info.disp_prof.fiveList[4] = (U8*) GetString(STR_ID_VOIP_PROF_NAT_60MIN);
- SetInlineItemSelect(
- wgui_inline_items + MMI_VOIP_PROF_NAT_INTERVAL,
- 5,
- g_voip_cntx_p->prof_setting_info.disp_prof.fiveList,
- &g_voip_cntx_p->prof_setting_info.disp_prof.intervalIndex);
- return MMI_VOIP_PROF_NAT_INLINE_TOTAL;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_entry_full_screen_editor_option
- * DESCRIPTION
- * Entry function of full screen editorOption
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_entry_full_screen_editor_option(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- U16 numItems = 0;
- U16 nStrItemList[MAX_SUB_MENUS]; /* Done, Input Method */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_VOIP_FULL_EDITOR_OPTION, NULL, mmi_voip_entry_full_screen_editor_option, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_FULL_EDITOR_OPTION);
- SetParentHandler(MENU_ID_VOIP_FULL_EDITOR_OPTION);
- numItems = GetNumOfChild(MENU_ID_VOIP_FULL_EDITOR_OPTION);
- GetSequenceStringIds(MENU_ID_VOIP_FULL_EDITOR_OPTION, nStrItemList);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_GLOBAL_OPTIONS,
- GetRootTitleIcon(MENU_ID_VOIP_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_voip_entry_prof_data_acct
- * DESCRIPTION
- * Entry function of data account
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_entry_prof_data_acct(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_dtcnt_select_account(mmi_voip_prof_data_acct_callback, MENU_ID_VOIP_MAIN, DATA_ACCOUNT_BEARER_PS_ONLY);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_prof_data_acct_callback
- * DESCRIPTION
- * Callback function for data account selection
- * PARAMETERS
- * index [IN] Selected index
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_prof_data_acct_callback(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_voip_cntx_p->prof_setting_info.disp_prof.dataacctIndex = index;
- DeleteUptoScrID(SCR_ID_VOIP_PROF_EDIT_INLINEITEMS);
- GoBackHistory();
- SetInlineListMenuChanged();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_prof_ip_addr_convert
- * DESCRIPTION
- * Convert ip format to ip string.
- * PARAMETERS
- * ipStr [IN/OUT] Ip string in unicode
- * ip1 [IN] First number in the ip format
- * ip2 [IN] Second number in the ip format
- * ip3 [IN] Third number in the ip format
- * ip4 [IN] Fourth number in the ip format
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_prof_ip_addr_convert(U8 *ipStr, U8 *ip1, U8 *ip2, U8 *ip3, U8 *ip4)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 dot[4];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- AnsiiToUnicodeString((S8*) dot, (S8*) ".");
- pfnUnicodeStrcpy((S8*) ipStr, (S8*) ip1);
- pfnUnicodeStrcat((S8*) ipStr, (S8*) dot);
- pfnUnicodeStrcat((S8*) ipStr, (S8*) ip2);
- pfnUnicodeStrcat((S8*) ipStr, (S8*) dot);
- pfnUnicodeStrcat((S8*) ipStr, (S8*) ip3);
- pfnUnicodeStrcat((S8*) ipStr, (S8*) dot);
- pfnUnicodeStrcat((S8*) ipStr, (S8*) ip4);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_prof_validate_activation
- * DESCRIPTION
- * The profile can be activated only if SIP server and username are not empty.
- * PARAMETERS
- * profIndex [IN] Index of profile
- * RETURNS
- * String id of the error.
- *****************************************************************************/
- U16 mmi_voip_prof_validate_activation(S32 profIndex)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 errorstrId = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (voip_custom_get_p2p_call_state() == FALSE)
- {
- if (!strlen((S8*) g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].acct_info.sipServer))
- {
- errorstrId = STR_ID_VOIP_EMPTY_SIP_SERVER;
- }
- if (!strlen((S8*) g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].acct_info.username))
- {
- errorstrId = STR_ID_VOIP_EMPTY_USERNAME;
- }
- }
- else /* p2p is on in the engineering mode */
- {
- if (!strlen((S8*) g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].acct_info.username))
- {
- errorstrId = STR_ID_VOIP_EMPTY_USERNAME;
- }
- }
- return errorstrId;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_prof_validate_inputs
- * DESCRIPTION
- * Check if the input is valid based on the current screen.
- * PARAMETERS
- * void
- * RETURNS
- * String id of the error.
- *****************************************************************************/
- U16 mmi_voip_prof_validate_inputs(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 currScreen = g_voip_cntx_p->prof_setting_info.currScr;
- U16 errorstrId = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (currScreen)
- {
- case SCR_ID_VOIP_PROF_COMMON:
- /* validate profile name */
- if (!pfnUnicodeStrlen((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.profileName))
- {
- errorstrId = STR_ID_VOIP_EMPTY_PROFILE_NAME;
- }
- /* validate voice mail server */
- if (mmi_voip_validate_uri(g_voip_cntx_p->prof_setting_info.disp_prof.serverName) == FALSE)
- {
- errorstrId = STR_ID_VOIP_INVALID_VM_SERVER;
- }
- break;
- case SCR_ID_VOIP_PROF_ACCOUNT:
- if (voip_custom_get_p2p_call_state() == FALSE)
- {
- /* validate sip server */
- if ((g_voip_cntx_p->prof_setting_info.actprofIndex == g_voip_cntx_p->prof_setting_info.currprofIndex) &&
- (!pfnUnicodeStrlen((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.serverName)))
- {
- errorstrId = STR_ID_VOIP_EMPTY_SIP_SERVER;
- }
- /* validate port number */
- if (!pfnUnicodeStrlen((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.portNumber))
- {
- gui_itoa(0, (UI_string_type)g_voip_cntx_p->prof_setting_info.disp_prof.portNumber, 10);
- }
- else
- {
- if (mmi_voip_validate_port(g_voip_cntx_p->prof_setting_info.disp_prof.portNumber) == FALSE)
- {
- errorstrId = STR_ID_VOIP_INVALID_PORT_NUMBER;
- }
- }
- /* validate username */
- if ((g_voip_cntx_p->prof_setting_info.actprofIndex == g_voip_cntx_p->prof_setting_info.currprofIndex) &&
- (!pfnUnicodeStrlen((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.username)))
- {
- errorstrId = STR_ID_VOIP_EMPTY_USERNAME;
- }
- else
- {
- if (mmi_voip_validate_uri(g_voip_cntx_p->prof_setting_info.disp_prof.username) == FALSE)
- {
- errorstrId = STR_ID_VOIP_INVALID_USERNAME;
- }
- }
- }
- else /* p2p is on in the engineering mode */
- {
- /* validate username */
- if ((g_voip_cntx_p->prof_setting_info.actprofIndex == g_voip_cntx_p->prof_setting_info.currprofIndex) &&
- (!pfnUnicodeStrlen((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.username)))
- {
- errorstrId = STR_ID_VOIP_EMPTY_USERNAME;
- }
- else
- {
- if (mmi_voip_validate_uri(g_voip_cntx_p->prof_setting_info.disp_prof.username) == FALSE)
- {
- errorstrId = STR_ID_VOIP_INVALID_USERNAME;
- }
- }
- }
- break;
- case SCR_ID_VOIP_PROF_OUTBOUND:
- /* validate outbound server */
- if (((g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex == 1) ||
- (g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex == 2)) &&
- (!pfnUnicodeStrlen((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.serverName)))
- {
- errorstrId = STR_ID_VOIP_EMPTY_OUTBOUND_SERVER;
- }
- /* validate port number */
- if (!pfnUnicodeStrlen((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.portNumber))
- {
- gui_itoa(0, (UI_string_type)g_voip_cntx_p->prof_setting_info.disp_prof.portNumber, 10);
- }
- else
- {
- if (mmi_voip_validate_port(g_voip_cntx_p->prof_setting_info.disp_prof.portNumber) == FALSE)
- {
- errorstrId = STR_ID_VOIP_INVALID_PORT_NUMBER;
- }
- }
- break;
- case SCR_ID_VOIP_PROF_REGISTER:
- /* validate register server */
- if ((g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex == 1) &&
- (!pfnUnicodeStrlen((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.serverName)))
- {
- errorstrId = STR_ID_VOIP_EMPTY_REGISTER_SERVER;
- }
- /* validate port number */
- if (!pfnUnicodeStrlen((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.portNumber))
- {
- gui_itoa(0, (UI_string_type)g_voip_cntx_p->prof_setting_info.disp_prof.portNumber, 10);
- }
- else
- {
- if (mmi_voip_validate_port(g_voip_cntx_p->prof_setting_info.disp_prof.portNumber) == FALSE)
- {
- errorstrId = STR_ID_VOIP_INVALID_PORT_NUMBER;
- }
- }
- break;
- case SCR_ID_VOIP_PROF_NAT:
- /* validate nat firewall ip */
- if ((g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex == 1) &&
- (mmi_voip_validate_ip
- (g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[0],
- g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[1],
- g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[2],
- g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[3]) == FALSE))
- {
- errorstrId = STR_ID_VOIP_INVALID_IP_ADDRESS;
- }
- /* validate stun server */
- if ((g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex == 2) &&
- (!pfnUnicodeStrlen((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.serverName)))
- {
- errorstrId = STR_ID_VOIP_EMPTY_STUN_SERVER;
- }
- /* validate port number */
- if (!pfnUnicodeStrlen((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.portNumber))
- {
- gui_itoa(0, (UI_string_type) g_voip_cntx_p->prof_setting_info.disp_prof.portNumber, 10);
- }
- else
- {
- if (mmi_voip_validate_port(g_voip_cntx_p->prof_setting_info.disp_prof.portNumber) == FALSE)
- {
- errorstrId = STR_ID_VOIP_INVALID_PORT_NUMBER;
- }
- }
- break;
- default:
- MMI_ASSERT(0);
- }
- return errorstrId;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_entry_prof_confirm
- * DESCRIPTION
- * Confirmation screen before saving the profile.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_entry_prof_confirm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_GLOBAL_SAVE),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetLeftSoftkeyFunction(mmi_voip_entry_prof_save, KEY_EVENT_UP);
- SetRightSoftkeyFunction(mmi_voip_go_back_to_prof_edit, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_entry_prof_save
- * DESCRIPTION
- * Save the profile.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_entry_prof_save(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 errorstrId = 0;
- U16 currScreen = g_voip_cntx_p->prof_setting_info.currScr;
- S32 profIndex = g_voip_cntx_p->prof_setting_info.currprofIndex;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- errorstrId = mmi_voip_prof_validate_inputs();
- if (errorstrId != 0)
- {
- DisplayPopup(
- (U8*)GetString(errorstrId),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- ERROR_TONE);
- return;
- }
- switch (currScreen)
- {
- case SCR_ID_VOIP_PROF_COMMON:
- mmi_voip_update_prof_common_disp_to_cache(profIndex);
- break;
- case SCR_ID_VOIP_PROF_ACCOUNT:
- mmi_voip_update_prof_acct_disp_to_cache(profIndex);
- break;
- case SCR_ID_VOIP_PROF_OUTBOUND:
- mmi_voip_update_prof_outbound_disp_to_cache(profIndex);
- break;
- case SCR_ID_VOIP_PROF_REGISTER:
- mmi_voip_update_prof_register_disp_to_cache(profIndex);
- break;
- case SCR_ID_VOIP_PROF_NAT:
- mmi_voip_update_prof_nat_disp_to_cache(profIndex);
- break;
- default:
- MMI_ASSERT(0);
- }
- if (mmi_voip_save_profile(profIndex))
- {
- DisplayPopup(
- (U8*)GetString(STR_GLOBAL_SAVED),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_ID_VOIP_PROF_EDIT_INLINEITEMS);
- }
- else
- {
- DisplayPopup(
- (U8*)GetString(STR_GLOBAL_NOT_DONE),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- ERROR_TONE);
- DeleteScreenIfPresent(SCR_ID_VOIP_PROF_EDIT_INLINEITEMS);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_go_back_to_prof_edit
- * DESCRIPTION
- * Go back to profile edit screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_go_back_to_prof_edit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DeleteScreenIfPresent(SCR_ID_VOIP_PROF_EDIT_INLINEITEMS);
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_entry_call_setting
- * DESCRIPTION
- * Entry function of VoIPCall Setting
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_entry_call_setting(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- U16 numItems = 0;
- U16 nStrItemList[MAX_SUB_MENUS];
- /* Auto Answer, Auto Reject, Auto Redial, Hide Caller ID, DTMF, Set Codec Order */
- U8 *nHintItemList[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_VOIP_CALL_SETTING, NULL, mmi_voip_entry_call_setting, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_CALL_SETTING);
- SetParentHandler(MENU_ID_VOIP_CALL_SETTING);
- numItems = GetNumOfChild(MENU_ID_VOIP_CALL_SETTING);
- GetSequenceStringIds(MENU_ID_VOIP_CALL_SETTING, nStrItemList);
- ConstructHintsList(MENU_ID_VOIP_CALL_SETTING, nHintItemList);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_ID_VOIP_CALL_SETTING,
- GetRootTitleIcon(MENU_ID_VOIP_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- nHintItemList,
- 0,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_entry_setting_general
- * DESCRIPTION
- * Entry function of VoIPCall SettingOK
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_entry_setting_general(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 currScreen = g_voip_cntx_p->call_setting_info.currScr;
- U8 *guiBuffer = NULL;
- U16 titleId = 0, numItems = 0;
- U16 nStrItemList[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_VOIP_SETTING_GENERAL, NULL, mmi_voip_entry_setting_general, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_SETTING_GENERAL);
- switch (currScreen)
- {
- case SCR_ID_VOIP_SETTING_AUTO_ANSWER:
- mmi_voip_update_setting_answer_cache_to_disp();
- titleId = STR_ID_VOIP_SETTING_AUTO_ANSWER;
- numItems = 3;
- nStrItemList[0] = STR_GLOBAL_OFF;
- nStrItemList[1] = STR_ID_VOIP_SETTING_ANYKEY;
- nStrItemList[2] = STR_ID_VOIP_SETTING_AUTO;
- break;
- case SCR_ID_VOIP_SETTING_AUTO_REJECT:
- mmi_voip_update_setting_reject_cache_to_disp();
- titleId = STR_ID_VOIP_SETTING_AUTO_REJECT;
- numItems = 3;
- nStrItemList[0] = STR_GLOBAL_OFF;
- nStrItemList[1] = STR_ID_VOIP_SETTING_REJECT_UNKNOWN;
- nStrItemList[2] = STR_ID_VOIP_SETTING_REJECT_ALL;
- break;
- case SCR_ID_VOIP_SETTING_AUTO_REDIAL:
- mmi_voip_update_setting_redial_cache_to_disp();
- titleId = STR_ID_VOIP_SETTING_AUTO_REDIAL;
- numItems = 2;
- nStrItemList[0] = STR_GLOBAL_OFF;
- nStrItemList[1] = STR_GLOBAL_ON;
- break;
- case SCR_ID_VOIP_SETTING_HIDE_CALLER_ID:
- mmi_voip_update_setting_hide_cache_to_disp();
- titleId = STR_ID_VOIP_SETTING_HIDE_CALLER_ID;
- numItems = 2;
- nStrItemList[0] = STR_GLOBAL_OFF;
- nStrItemList[1] = STR_GLOBAL_ON;
- break;
- case SCR_ID_VOIP_SETTING_DTMF:
- mmi_voip_update_setting_dtmf_cache_to_disp();
- titleId = STR_ID_VOIP_SETTING_DTMF;
- numItems = 3;
- nStrItemList[0] = STR_ID_VOIP_SETTING_INBAND;
- nStrItemList[1] = STR_ID_VOIP_SETTING_OUTBAND;
- nStrItemList[2] = STR_GLOBAL_OFF;
- break;
- case SCR_ID_VOIP_SETTING_COMFORT_NOISE:
- mmi_voip_update_setting_noise_cache_to_disp();
- titleId = STR_ID_VOIP_SETTING_COMFORT_NOISE;
- numItems = 2;
- nStrItemList[0] = STR_GLOBAL_ON;
- nStrItemList[1] = STR_GLOBAL_OFF;
- break;
- case SCR_ID_VOIP_SETTING_SET_CODEC_ORDER:
- default:
- MMI_ASSERT(0);
- }
- RegisterHighlightHandler(mmi_voip_highlight_setting_general_item);
- ShowCategory11Screen(
- titleId,
- GetRootTitleIcon(MENU_ID_VOIP_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- nStrItemList,
- (U16) g_voip_cntx_p->call_setting_info.currIndex,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_voip_entry_setting_general_confirm, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_highlight_setting_general_item
- * DESCRIPTION
- * Highlight item of selecting a selection in VoIPCall SettingOK
- * PARAMETERS
- * index [IN] Current highlight index.
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_highlight_setting_general_item(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_voip_cntx_p->call_setting_info.currIndex = index;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_update_setting_answer_cache_to_disp
- * DESCRIPTION
- * Copy g_voip_cntx_p->call_setting_info.saved_setting to
- * g_voip_cntx_p->call_setting_info.currIndex for Auto Answer.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_update_setting_answer_cache_to_disp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_voip_cntx_p->call_setting_info.currIndex = g_voip_cntx_p->call_setting_info.saved_setting.autoAnswer;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_update_setting_reject_cache_to_disp
- * DESCRIPTION
- * Copy g_voip_cntx_p->call_setting_info.saved_setting to
- * g_voip_cntx_p->call_setting_info.currIndex for Auto Reject.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_update_setting_reject_cache_to_disp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_voip_cntx_p->call_setting_info.currIndex = g_voip_cntx_p->call_setting_info.saved_setting.autoReject;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_update_setting_redial_cache_to_disp
- * DESCRIPTION
- * Copy g_voip_cntx_p->call_setting_info.saved_setting to
- * g_voip_cntx_p->call_setting_info.currIndex for Auto Redial.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_update_setting_redial_cache_to_disp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_voip_cntx_p->call_setting_info.currIndex = g_voip_cntx_p->call_setting_info.saved_setting.autoRedial;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_update_setting_hide_cache_to_disp
- * DESCRIPTION
- * Copy g_voip_cntx_p->call_setting_info.saved_setting to
- * g_voip_cntx_p->call_setting_info.currIndex for Hide Caller ID.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_update_setting_hide_cache_to_disp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_voip_cntx_p->call_setting_info.currIndex = g_voip_cntx_p->call_setting_info.saved_setting.hidecallerId;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_update_setting_dtmf_cache_to_disp
- * DESCRIPTION
- * Copy g_voip_cntx_p->call_setting_info.saved_setting to
- * g_voip_cntx_p->call_setting_info.currIndex for DTMF.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_update_setting_dtmf_cache_to_disp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_voip_cntx_p->call_setting_info.currIndex = g_voip_cntx_p->call_setting_info.saved_setting.dtmf;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_update_setting_noise_cache_to_disp
- * DESCRIPTION
- * Copy g_voip_cntx_p->call_setting_info.saved_setting to
- * g_voip_cntx_p->call_setting_info.currIndex for Comfort Noise.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_update_setting_noise_cache_to_disp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_voip_cntx_p->call_setting_info.currIndex = g_voip_cntx_p->call_setting_info.saved_setting.comfortNoise;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_update_setting_codec_cache_to_disp
- * DESCRIPTION
- * Copy g_voip_cntx_p->call_setting_info.saved_setting to
- * g_voip_cntx_p->call_setting_info.dispCodec for Set Codec Order.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_update_setting_codec_cache_to_disp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i = 0, j = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < g_voip_cntx_p->call_setting_info.numCodec; i++)
- {
- memset(g_voip_cntx_p->call_setting_info.dispCodec[i], 0, (MMI_VOIP_MAX_CODEC_NAME_LEN * ENCODING_LENGTH));
- if (strlen((S8*) g_voip_cntx_p->call_setting_info.saved_setting.codecOrder[i]))
- {
- AnsiiNToUnicodeString(
- (S8*) g_voip_cntx_p->call_setting_info.dispCodec[i],
- (S8*) g_voip_cntx_p->call_setting_info.saved_setting.codecOrder[i],
- MMI_VOIP_MAX_CODEC_NAME_LEN);
- for (j = 0; j < MMI_VOIP_MAX_CODEC_NUM; j++)
- {
- if (!pfnUnicodeStrcmp((S8*)g_voip_cntx_p->call_setting_info.dispCodec[i], (S8*)GetString(STR_ID_VOIP_SETTING_CODEC2 + j)))
- {
- g_voip_cntx_p->call_setting_info.codecEnum[i] = g_voip_codec_table[j + 1]; /* AMR should not appear in the menu */
- break;
- }
- }
- }
- else
- {
- g_voip_cntx_p->call_setting_info.numCodec = i;
- break;
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_update_setting_answer_disp_to_cache
- * DESCRIPTION
- * Copy g_voip_cntx_p->call_setting_info.currIndex to
- * g_voip_cntx_p->call_setting_info.saved_setting for Auto Answer.
- * PARAMETERS
- * void
- * RETURNS
- * TRUE means the data is different from the original;
- * FALSE means the data is the same as the original.
- *****************************************************************************/
- BOOL mmi_voip_update_setting_answer_disp_to_cache(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_voip_cntx_p->call_setting_info.saved_setting.autoAnswer != g_voip_cntx_p->call_setting_info.currIndex)
- {
- g_voip_cntx_p->call_setting_info.saved_setting.autoAnswer = g_voip_cntx_p->call_setting_info.currIndex;
- return TRUE;
- }
- return FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_update_setting_reject_disp_to_cache
- * DESCRIPTION
- * Copy g_voip_cntx_p->call_setting_info.currIndex to
- * g_voip_cntx_p->call_setting_info.saved_setting for Auto Reject.
- * PARAMETERS
- * void
- * RETURNS
- * TRUE means the data is different from the original;
- * FALSE means the data is the same as the original.
- *****************************************************************************/
- BOOL mmi_voip_update_setting_reject_disp_to_cache(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_voip_cntx_p->call_setting_info.saved_setting.autoReject != g_voip_cntx_p->call_setting_info.currIndex)
- {
- g_voip_cntx_p->call_setting_info.saved_setting.autoReject = g_voip_cntx_p->call_setting_info.currIndex;
- return TRUE;
- }
- return FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_update_setting_redial_disp_to_cache
- * DESCRIPTION
- * Copy g_voip_cntx_p->call_setting_info.currIndex to
- * g_voip_cntx_p->call_setting_info.saved_setting for Auto Redial.
- * PARAMETERS
- * void
- * RETURNS
- * TRUE means the data is different from the original;
- * FALSE means the data is the same as the original.
- *****************************************************************************/
- BOOL mmi_voip_update_setting_redial_disp_to_cache(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_voip_cntx_p->call_setting_info.saved_setting.autoRedial != g_voip_cntx_p->call_setting_info.currIndex)
- {
- g_voip_cntx_p->call_setting_info.saved_setting.autoRedial = g_voip_cntx_p->call_setting_info.currIndex;
- return TRUE;
- }
- return FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_update_setting_hide_disp_to_cache
- * DESCRIPTION
- * Copy g_voip_cntx_p->call_setting_info.currIndex to
- * g_voip_cntx_p->call_setting_info.saved_setting for Hide Caller ID.
- * PARAMETERS
- * void
- * RETURNS
- * TRUE means the data is different from the original;
- * FALSE means the data is the same as the original.
- *****************************************************************************/
- BOOL mmi_voip_update_setting_hide_disp_to_cache(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_voip_cntx_p->call_setting_info.saved_setting.hidecallerId != g_voip_cntx_p->call_setting_info.currIndex)
- {
- g_voip_cntx_p->call_setting_info.saved_setting.hidecallerId = g_voip_cntx_p->call_setting_info.currIndex;
- return TRUE;
- }
- return FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_update_setting_dtmf_disp_to_cache
- * DESCRIPTION
- * Copy g_voip_cntx_p->call_setting_info.currIndex to
- * g_voip_cntx_p->call_setting_info.saved_setting for DTMF.
- * PARAMETERS
- * void
- * RETURNS
- * TRUE means the data is different from the original;
- * FALSE means the data is the same as the original.
- *****************************************************************************/
- BOOL mmi_voip_update_setting_dtmf_disp_to_cache(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_voip_cntx_p->call_setting_info.saved_setting.dtmf != g_voip_cntx_p->call_setting_info.currIndex)
- {
- g_voip_cntx_p->call_setting_info.saved_setting.dtmf = g_voip_cntx_p->call_setting_info.currIndex;
- return TRUE;
- }
- return FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_update_setting_noise_disp_to_cache
- * DESCRIPTION
- * Copy g_voip_cntx_p->call_setting_info.currIndex to
- * g_voip_cntx_p->call_setting_info.saved_setting for Comfort Noise.
- * PARAMETERS
- * void
- * RETURNS
- * TRUE means the data is different from the original;
- * FALSE means the data is the same as the original.
- *****************************************************************************/
- BOOL mmi_voip_update_setting_noise_disp_to_cache(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_voip_cntx_p->call_setting_info.saved_setting.comfortNoise != g_voip_cntx_p->call_setting_info.currIndex)
- {
- g_voip_cntx_p->call_setting_info.saved_setting.comfortNoise = g_voip_cntx_p->call_setting_info.currIndex;
- return TRUE;
- }
- return FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_update_setting_codec_disp_to_cache
- * DESCRIPTION
- * Copy g_voip_cntx_p->call_setting_info.dispCodec to
- * g_voip_cntx_p->call_setting_info.saved_setting for Set Codec Order.
- * PARAMETERS
- * void
- * RETURNS
- * TRUE means the data is different from the original;
- * FALSE means the data is the same as the original.
- *****************************************************************************/
- BOOL mmi_voip_update_setting_codec_disp_to_cache(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i = 0, j = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < g_voip_cntx_p->call_setting_info.numCodec; i++)
- {
- memset(g_voip_cntx_p->call_setting_info.saved_setting.codecOrder[i], 0, MMI_VOIP_MAX_CODEC_NAME_LEN);
- UnicodeNToAnsii(
- (S8*) g_voip_cntx_p->call_setting_info.saved_setting.codecOrder[i],
- (S8*) g_voip_cntx_p->call_setting_info.dispCodec[i],
- (MMI_VOIP_MAX_CODEC_NAME_LEN * ENCODING_LENGTH));
- for (j = 0; j < MMI_VOIP_MAX_CODEC_NUM; j++)
- {
- if (!pfnUnicodeStrcmp((S8*)g_voip_cntx_p->call_setting_info.dispCodec[i], (S8*)GetString(STR_ID_VOIP_SETTING_CODEC2 + j)))
- {
- g_voip_cntx_p->call_setting_info.codecEnum[i] = g_voip_codec_table[j + 1]; /* AMR should not appear in the menu */
- break;
- }
- }
- }
- return TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_entry_setting_general_confirm
- * DESCRIPTION
- * Confirmation screen before saving the setting.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_entry_setting_general_confirm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_GLOBAL_SAVE),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetLeftSoftkeyFunction(mmi_voip_entry_setting_general_save, KEY_EVENT_UP);
- SetRightSoftkeyFunction(mmi_voip_go_back_to_call_setting, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_entry_setting_general_save
- * DESCRIPTION
- * Save the setting.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_entry_setting_general_save(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 currScreen = g_voip_cntx_p->call_setting_info.currScr;
- BOOL isChange = FALSE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (currScreen)
- {
- case SCR_ID_VOIP_SETTING_AUTO_ANSWER:
- isChange = mmi_voip_update_setting_answer_disp_to_cache();
- break;
- case SCR_ID_VOIP_SETTING_AUTO_REJECT:
- isChange = mmi_voip_update_setting_reject_disp_to_cache();
- break;
- case SCR_ID_VOIP_SETTING_AUTO_REDIAL:
- isChange = mmi_voip_update_setting_redial_disp_to_cache();
- break;
- case SCR_ID_VOIP_SETTING_HIDE_CALLER_ID:
- isChange = mmi_voip_update_setting_hide_disp_to_cache();
- break;
- case SCR_ID_VOIP_SETTING_DTMF:
- isChange = mmi_voip_update_setting_dtmf_disp_to_cache();
- break;
- case SCR_ID_VOIP_SETTING_COMFORT_NOISE:
- isChange = mmi_voip_update_setting_noise_disp_to_cache();
- break;
- case SCR_ID_VOIP_SETTING_SET_CODEC_ORDER:
- default:
- MMI_ASSERT(0);
- }
- if (mmi_voip_save_setting())
- {
- if (isChange)
- {
- mmi_voip_setting_req();
- }
- else
- {
- DisplayPopup(
- (U8*)GetString(STR_GLOBAL_SAVED),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_ID_VOIP_SETTING_GENERAL);
- }
- }
- else
- {
- DisplayPopup(
- (U8*)GetString(STR_GLOBAL_NOT_DONE),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- ERROR_TONE);
- DeleteScreenIfPresent(SCR_ID_VOIP_SETTING_GENERAL);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_go_back_to_call_setting
- * DESCRIPTION
- * Go back to call setting screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_go_back_to_call_setting(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DeleteScreenIfPresent(SCR_ID_VOIP_SETTING_GENERAL);
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_entry_set_codec_order
- * DESCRIPTION
- * Entry function of VoIPCall SettingSet Codec Order
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_entry_set_codec_order(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- U16 numItems = 0;
- U8 *nStrItemList[MAX_SUB_MENUS];
- S32 i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_VOIP_SETTING_SET_CODEC_ORDER, NULL, mmi_voip_entry_set_codec_order, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_SETTING_SET_CODEC_ORDER);
- mmi_voip_update_setting_codec_cache_to_disp();
- numItems = g_voip_cntx_p->call_setting_info.numCodec;
- for (i = 0; i < numItems; i++)
- {
- nStrItemList[i] = g_voip_cntx_p->call_setting_info.dispCodec[i];
- }
- RegisterHighlightHandler(mmi_voip_highlight_set_codec_order_item);
- ShowCategory6Screen(
- STR_ID_VOIP_SETTING_SET_CODEC_ORDER,
- GetRootTitleIcon(MENU_ID_VOIP_MAIN),
- STR_GLOBAL_OPTIONS,
- IMG_GLOBAL_OPTIONS,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- nStrItemList,
- NULL,
- g_voip_cntx_p->call_setting_info.currIndex,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_voip_entry_set_codec_order_option, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(mmi_voip_entry_set_codec_order_option, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_highlight_set_codec_order_item
- * DESCRIPTION
- * Highlight item of selecting a selection in VoIPCall SettingSet Codec Order
- * PARAMETERS
- * index [IN] Current highlight index.
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_highlight_set_codec_order_item(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_voip_cntx_p->call_setting_info.currIndex = index;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_entry_set_codec_order_option
- * DESCRIPTION
- * Entry function of VoIPCall SettingSet Codec OrderOption
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_entry_set_codec_order_option(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_VOIP_SETTING_SET_CODEC_ORDER_OPTION, NULL, mmi_voip_entry_set_codec_order_option, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_SETTING_SET_CODEC_ORDER_OPTION);
- g_voip_cntx_p->call_setting_info.currPriority = g_voip_cntx_p->call_setting_info.currIndex + 1;
- ShowCategory87Screen(
- STR_ID_VOIP_SETTING_PRIORITY,
- GetRootTitleIcon(MENU_ID_VOIP_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- 1,
- g_voip_cntx_p->call_setting_info.numCodec,
- &g_voip_cntx_p->call_setting_info.currPriority,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_voip_entry_setting_codec_confirm, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_entry_setting_codec_confirm
- * DESCRIPTION
- * Confirmation screen before saving the codec order.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_entry_setting_codec_confirm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_GLOBAL_SAVE),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetLeftSoftkeyFunction(mmi_voip_entry_setting_codec_save, KEY_EVENT_UP);
- SetRightSoftkeyFunction(mmi_voip_go_back_to_codec_order, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_entry_setting_codec_save
- * DESCRIPTION
- * Save the codec order.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_entry_setting_codec_save(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 srcIndex = g_voip_cntx_p->call_setting_info.currIndex;
- S32 destIndex = g_voip_cntx_p->call_setting_info.currPriority - 1;
- S32 i = 0;
- BOOL isChange = FALSE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (srcIndex < destIndex)
- {
- memset(
- g_voip_cntx_p->call_setting_info.dispCodec[destIndex],
- 0,
- (MMI_VOIP_MAX_CODEC_NAME_LEN * ENCODING_LENGTH));
- AnsiiNToUnicodeString(
- (S8*) g_voip_cntx_p->call_setting_info.dispCodec[destIndex],
- (S8*) g_voip_cntx_p->call_setting_info.saved_setting.codecOrder[srcIndex],
- MMI_VOIP_MAX_CODEC_NAME_LEN);
- for (i = srcIndex; i < destIndex; i++)
- {
- memset(g_voip_cntx_p->call_setting_info.dispCodec[i], 0, (MMI_VOIP_MAX_CODEC_NAME_LEN * ENCODING_LENGTH));
- AnsiiNToUnicodeString(
- (S8*) g_voip_cntx_p->call_setting_info.dispCodec[i],
- (S8*) g_voip_cntx_p->call_setting_info.saved_setting.codecOrder[i + 1],
- MMI_VOIP_MAX_CODEC_NAME_LEN);
- }
- g_voip_cntx_p->call_setting_info.currIndex = destIndex;
- }
- else if (srcIndex > destIndex)
- {
- memset(
- g_voip_cntx_p->call_setting_info.dispCodec[destIndex],
- 0,
- (MMI_VOIP_MAX_CODEC_NAME_LEN * ENCODING_LENGTH));
- AnsiiNToUnicodeString(
- (S8*) g_voip_cntx_p->call_setting_info.dispCodec[destIndex],
- (S8*) g_voip_cntx_p->call_setting_info.saved_setting.codecOrder[srcIndex],
- MMI_VOIP_MAX_CODEC_NAME_LEN);
- for (i = srcIndex; i > destIndex; i--)
- {
- memset(g_voip_cntx_p->call_setting_info.dispCodec[i], 0, (MMI_VOIP_MAX_CODEC_NAME_LEN * ENCODING_LENGTH));
- AnsiiNToUnicodeString(
- (S8*) g_voip_cntx_p->call_setting_info.dispCodec[i],
- (S8*) g_voip_cntx_p->call_setting_info.saved_setting.codecOrder[i - 1],
- MMI_VOIP_MAX_CODEC_NAME_LEN);
- }
- g_voip_cntx_p->call_setting_info.currIndex = destIndex;
- }
- else /* srcIndex == destIndex */
- {
- /* do nothing */
- }
- isChange = mmi_voip_update_setting_codec_disp_to_cache();
- if (mmi_voip_save_setting())
- {
- if (isChange)
- {
- mmi_voip_setting_req();
- }
- else
- {
- DisplayPopup(
- (U8*)GetString(STR_GLOBAL_SAVED),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_ID_VOIP_SETTING_SET_CODEC_ORDER_OPTION);
- }
- }
- else
- {
- DisplayPopup(
- (U8*)GetString(STR_GLOBAL_NOT_DONE),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- ERROR_TONE);
- DeleteScreenIfPresent(SCR_ID_VOIP_SETTING_SET_CODEC_ORDER_OPTION);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_go_back_to_codec_order
- * DESCRIPTION
- * Go back to set codec order screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_go_back_to_codec_order(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DeleteScreenIfPresent(SCR_ID_VOIP_SETTING_SET_CODEC_ORDER_OPTION);
- GoBackHistory();
- }
- #ifdef SIP_CONFORMANCE_TEST
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_entry_option_query
- * DESCRIPTION
- * Entry function of VoIPOption Query
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_entry_option_query(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_VOIP_OPTION_QUERY_EDITOR, NULL, mmi_voip_entry_option_query, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_OPTION_QUERY_EDITOR);
- ShowCategory5Screen(
- STR_ID_VOIP_MAIN,
- GetRootTitleIcon(MENU_ID_VOIP_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
- g_voip_cntx_p->call_misc_info.dispUri,
- VOIP_URI_LEN,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_voip_entry_option_query_check, KEY_EVENT_UP);
- SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_entry_option_query_result
- * DESCRIPTION
- * Display option query result.
- * PARAMETERS
- * asciiData [IN] Option query result in ascii
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_entry_option_query_result(U8 *asciiData)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- AnsiiNToUnicodeString((S8*)subMenuData, (S8*)asciiData, VOIP_SIP_OPTION_LEN);
- EntryNewScreen(SCR_ID_VOIP_OPTION_QUERY_RESULT, NULL, NULL, NULL);
- ShowCategory74Screen(
- STR_ID_VOIP_OPTION_QUERY,
- GetRootTitleIcon(MENU_ID_VOIP_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- 0,
- IMG_GLOBAL_BACK,
- (U8*)subMenuData,
- (MAX_SUB_MENUS * MAX_SUB_MENU_SIZE),
- NULL);
- SetLeftSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- #endif /* SIP_CONFORMANCE_TEST */
- /*****************************************************************************
- * FUNCTION
- * mmi_voip_go_back_2_history
- * DESCRIPTION
- * Delete one history and go back history.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_voip_go_back_2_history(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GoBacknHistory(1);
- }
- #endif /* __MMI_VOIP__ */