VoIPSetting.c
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:180k
源码类别:

MTK

开发平台:

C/C++

  1. /*****************************************************************************
  2. *  Copyright Statement:
  3. *  --------------------
  4. *  This software is protected by Copyright and the information contained
  5. *  herein is confidential. The software may not be copied and the information
  6. *  contained herein may not be used or disclosed except with the written
  7. *  permission of MediaTek Inc. (C) 2005
  8. *
  9. *  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  10. *  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  11. *  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
  12. *  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  13. *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  14. *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  15. *  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  16. *  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  17. *  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
  18. *  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
  19. *  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
  20. *  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
  21. *
  22. *  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
  23. *  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  24. *  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  25. *  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
  26. *  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
  27. *
  28. *  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
  29. *  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
  30. *  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
  31. *  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
  32. *  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
  33. *
  34. *****************************************************************************/
  35. /*****************************************************************************
  36.  *
  37.  * Filename:
  38.  * ---------
  39.  *  VoIPSetting.c
  40.  *
  41.  * Project:
  42.  * --------
  43.  *  MAUI
  44.  *
  45.  * Description:
  46.  * ------------
  47.  *  Coding Template header file
  48.  *
  49.  * Author:
  50.  * -------
  51.  * -------
  52.  *
  53.  *============================================================================
  54.  *             HISTORY
  55.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  56.  *------------------------------------------------------------------------------
  57.  * removed!
  58.  *
  59.  * removed!
  60.  * removed!
  61.  * removed!
  62.  *
  63.  * removed!
  64.  * removed!
  65.  * removed!
  66.  *
  67.  * removed!
  68.  * removed!
  69.  * removed!
  70.  *
  71.  * removed!
  72.  * removed!
  73.  * removed!
  74.  *
  75.  * removed!
  76.  * removed!
  77.  * removed!
  78.  *
  79.  * removed!
  80.  * removed!
  81.  * removed!
  82.  *
  83.  * removed!
  84.  * removed!
  85.  * removed!
  86.  *
  87.  * removed!
  88.  * removed!
  89.  * removed!
  90.  *
  91.  * removed!
  92.  * removed!
  93.  * removed!
  94.  *
  95.  * removed!
  96.  * removed!
  97.  * removed!
  98.  *
  99.  * removed!
  100.  * removed!
  101.  * removed!
  102.  *
  103.  * removed!
  104.  * removed!
  105.  * removed!
  106.  *
  107.  * removed!
  108.  * removed!
  109.  * removed!
  110.  *
  111.  * removed!
  112.  * removed!
  113.  * removed!
  114.  *
  115.  * removed!
  116.  * removed!
  117.  * removed!
  118.  *
  119.  * removed!
  120.  * removed!
  121.  * removed!
  122.  *
  123.  *------------------------------------------------------------------------------
  124.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  125.  *============================================================================
  126.  ****************************************************************************/
  127. #include "MMI_features.h"
  128. #ifdef __MMI_VOIP__
  129. #include "stdC.h"
  130. #include "L4Dr1.h"
  131. #include "DebugInitDef.h"
  132. #include "mmi_trc.h"    /* debug info */
  133. #include "GlobalMenuItems.h"
  134. #include "GlobalScrEnum.h"
  135. #include "CustMenuRes.h"
  136. #include "CustDataRes.h"
  137. #include "ProtocolEvents.h"
  138. #include "CommonScreens.h"
  139. #include "SettingProfile.h"
  140. #include "EventsGprot.h"
  141. #include "wgui_categories_popup.h"
  142. #include "wgui_categories_inputs.h"
  143. #include "wgui_categories_util.h"
  144. #include "NVRAMEnum.h"
  145. #include "NVRAMProt.h"
  146. #include "NVRAMType.h"
  147. #include "custom_nvram_editor_data_item.h"
  148. #include "custom_data_account.h"
  149. #include "CallManagementGprot.h"
  150. #include "DataAccountGProt.h"
  151. #ifdef __MMI_TOUCH_SCREEN__
  152. #include "gui_virtual_keyboard.h"
  153. #include "EditorPen.h"
  154. #endif
  155. #include "VoIPDef.h"
  156. #include "VoIPGProt.h"
  157. #include "VoIPProt.h"
  158. extern BOOL voip_custom_get_p2p_call_state(void);
  159. #ifdef __MMI_TOUCH_SCREEN__
  160. gui_virtual_keyboard_pen_enum g_voip_disable_new_line[] = {GUI_VKBD_PEN_NEWLINE, GUI_VKBD_PEN_NONE};
  161. #endif
  162. const voip_codec_enum g_voip_codec_table[] = 
  163. {
  164.     VOIP_CODEC_AMR,
  165.     VOIP_CODEC_G729,
  166.     VOIP_CODEC_G7231,
  167.     VOIP_CODEC_G726_16,
  168.     VOIP_CODEC_G726_24,
  169.     VOIP_CODEC_G726_32,
  170.     VOIP_CODEC_G726_40,
  171.     VOIP_CODEC_PCMA,
  172.     VOIP_CODEC_PCMU,
  173.     VOIP_CODEC_CN
  174. };
  175. /*****************************************************************************
  176.  * FUNCTION
  177.  *  mmi_voip_highlight_main_menu
  178.  * DESCRIPTION
  179.  *  Highlight handler of ServicesVoIP
  180.  * PARAMETERS
  181.  *  void
  182.  * RETURNS
  183.  *  void
  184.  *****************************************************************************/
  185. void mmi_voip_highlight_main_menu(void)
  186. {
  187.     /*----------------------------------------------------------------*/
  188.     /* Local Variables                                                */
  189.     /*----------------------------------------------------------------*/
  190.     /*----------------------------------------------------------------*/
  191.     /* Code Body                                                      */
  192.     /*----------------------------------------------------------------*/
  193.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  194.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  195.     SetLeftSoftkeyFunction(mmi_voip_pre_entry_main_menu, KEY_EVENT_UP);
  196.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  197.     SetKeyHandler(mmi_voip_pre_entry_main_menu, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  198.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  199. }
  200. /*****************************************************************************
  201.  * FUNCTION
  202.  *  mmi_voip_highlight_status
  203.  * DESCRIPTION
  204.  *  Highlight handler of VoIPLogin(Logout)
  205.  * PARAMETERS
  206.  *  void
  207.  * RETURNS
  208.  *  void
  209.  *****************************************************************************/
  210. void mmi_voip_highlight_status(void)
  211. {
  212.     /*----------------------------------------------------------------*/
  213.     /* Local Variables                                                */
  214.     /*----------------------------------------------------------------*/
  215.     /*----------------------------------------------------------------*/
  216.     /* Code Body                                                      */
  217.     /*----------------------------------------------------------------*/
  218.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  219.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  220.     SetLeftSoftkeyFunction(mmi_voip_entry_status, KEY_EVENT_UP);
  221.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  222.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  223. }
  224. /*****************************************************************************
  225.  * FUNCTION
  226.  *  mmi_voip_highlight_summary
  227.  * DESCRIPTION
  228.  *  Highlight handler of VoIPCurrent Status
  229.  * PARAMETERS
  230.  *  void
  231.  * RETURNS
  232.  *  void
  233.  *****************************************************************************/
  234. void mmi_voip_highlight_summary(void)
  235. {
  236.     /*----------------------------------------------------------------*/
  237.     /* Local Variables                                                */
  238.     /*----------------------------------------------------------------*/
  239.     /*----------------------------------------------------------------*/
  240.     /* Code Body                                                      */
  241.     /*----------------------------------------------------------------*/
  242.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  243.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  244.     SetLeftSoftkeyFunction(mmi_voip_entry_summary, KEY_EVENT_UP);
  245.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  246.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  247. }
  248. /*****************************************************************************
  249.  * FUNCTION
  250.  *  mmi_voip_highlight_prof_setting
  251.  * DESCRIPTION
  252.  *  Highlight handler of VoIPProfile Setting
  253.  * PARAMETERS
  254.  *  void
  255.  * RETURNS
  256.  *  void
  257.  *****************************************************************************/
  258. void mmi_voip_highlight_prof_setting(void)
  259. {
  260.     /*----------------------------------------------------------------*/
  261.     /* Local Variables                                                */
  262.     /*----------------------------------------------------------------*/
  263.     /*----------------------------------------------------------------*/
  264.     /* Code Body                                                      */
  265.     /*----------------------------------------------------------------*/
  266.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  267.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  268.     SetLeftSoftkeyFunction(mmi_voip_entry_prof_setting, KEY_EVENT_UP);
  269.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  270.     SetKeyHandler(mmi_voip_entry_prof_setting, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  271.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  272. }
  273. /*****************************************************************************
  274.  * FUNCTION
  275.  *  mmi_voip_highlight_prof_setting_option_activate
  276.  * DESCRIPTION
  277.  *  Highlight handler of VoIPProfile SettingProfile XActive
  278.  * PARAMETERS
  279.  *  void
  280.  * RETURNS
  281.  *  void
  282.  *****************************************************************************/
  283. void mmi_voip_highlight_prof_setting_option_activate(void)
  284. {
  285.     /*----------------------------------------------------------------*/
  286.     /* Local Variables                                                */
  287.     /*----------------------------------------------------------------*/
  288.     /*----------------------------------------------------------------*/
  289.     /* Code Body                                                      */
  290.     /*----------------------------------------------------------------*/
  291.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  292.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  293.     SetLeftSoftkeyFunction(mmi_voip_entry_prof_activate, KEY_EVENT_UP);
  294.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  295.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  296. }
  297. /*****************************************************************************
  298.  * FUNCTION
  299.  *  mmi_voip_highlight_prof_setting_option_edit
  300.  * DESCRIPTION
  301.  *  Highlight handler of VoIPProfile SettingProfile XEdit
  302.  * PARAMETERS
  303.  *  void
  304.  * RETURNS
  305.  *  void
  306.  *****************************************************************************/
  307. void mmi_voip_highlight_prof_setting_option_edit(void)
  308. {
  309.     /*----------------------------------------------------------------*/
  310.     /* Local Variables                                                */
  311.     /*----------------------------------------------------------------*/
  312.     /*----------------------------------------------------------------*/
  313.     /* Code Body                                                      */
  314.     /*----------------------------------------------------------------*/
  315.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  316.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  317.     SetLeftSoftkeyFunction(mmi_voip_entry_prof_edit, KEY_EVENT_UP);
  318.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  319.     SetKeyHandler(mmi_voip_entry_prof_edit, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  320.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  321. }
  322. /*****************************************************************************
  323.  * FUNCTION
  324.  *  mmi_voip_highlight_prof_edit_common
  325.  * DESCRIPTION
  326.  *  Highlight handler of VoIPProfile SettingProfile XEditCommon Setting
  327.  * PARAMETERS
  328.  *  void
  329.  * RETURNS
  330.  *  void
  331.  *****************************************************************************/
  332. void mmi_voip_highlight_prof_edit_common(void)
  333. {
  334.     /*----------------------------------------------------------------*/
  335.     /* Local Variables                                                */
  336.     /*----------------------------------------------------------------*/
  337.     /*----------------------------------------------------------------*/
  338.     /* Code Body                                                      */
  339.     /*----------------------------------------------------------------*/
  340.     g_voip_cntx_p->prof_setting_info.currScr = SCR_ID_VOIP_PROF_COMMON;
  341.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  342.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  343.     SetLeftSoftkeyFunction(mmi_voip_pre_entry_prof_edit_inlineitems, KEY_EVENT_UP);
  344.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  345.     SetKeyHandler(mmi_voip_pre_entry_prof_edit_inlineitems, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  346.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  347. }
  348. /*****************************************************************************
  349.  * FUNCTION
  350.  *  mmi_voip_highlight_prof_edit_account
  351.  * DESCRIPTION
  352.  *  Highlight handler of VoIPProfile SettingProfile XEditAccount Setting
  353.  * PARAMETERS
  354.  *  void
  355.  * RETURNS
  356.  *  void
  357.  *****************************************************************************/
  358. void mmi_voip_highlight_prof_edit_account(void)
  359. {
  360.     /*----------------------------------------------------------------*/
  361.     /* Local Variables                                                */
  362.     /*----------------------------------------------------------------*/
  363.     /*----------------------------------------------------------------*/
  364.     /* Code Body                                                      */
  365.     /*----------------------------------------------------------------*/
  366.     g_voip_cntx_p->prof_setting_info.currScr = SCR_ID_VOIP_PROF_ACCOUNT;
  367.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  368.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  369.     SetLeftSoftkeyFunction(mmi_voip_entry_prof_edit_inlineitems, KEY_EVENT_UP);
  370.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  371.     SetKeyHandler(mmi_voip_pre_entry_prof_edit_inlineitems, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  372.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  373. }
  374. /*****************************************************************************
  375.  * FUNCTION
  376.  *  mmi_voip_highlight_prof_edit_outbound
  377.  * DESCRIPTION
  378.  *  Highlight handler of VoIPProfile SettingProfile XEditOutbound Server
  379.  * PARAMETERS
  380.  *  void
  381.  * RETURNS
  382.  *  void
  383.  *****************************************************************************/
  384. void mmi_voip_highlight_prof_edit_outbound(void)
  385. {
  386.     /*----------------------------------------------------------------*/
  387.     /* Local Variables                                                */
  388.     /*----------------------------------------------------------------*/
  389.     /*----------------------------------------------------------------*/
  390.     /* Code Body                                                      */
  391.     /*----------------------------------------------------------------*/
  392.     g_voip_cntx_p->prof_setting_info.currScr = SCR_ID_VOIP_PROF_OUTBOUND;
  393.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  394.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  395.     SetLeftSoftkeyFunction(mmi_voip_entry_prof_edit_inlineitems, KEY_EVENT_UP);
  396.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  397.     SetKeyHandler(mmi_voip_pre_entry_prof_edit_inlineitems, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  398.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  399. }
  400. /*****************************************************************************
  401.  * FUNCTION
  402.  *  mmi_voip_highlight_prof_edit_register
  403.  * DESCRIPTION
  404.  *  Highlight handler of VoIPProfile SettingProfile XEditRegister Server
  405.  * PARAMETERS
  406.  *  void
  407.  * RETURNS
  408.  *  void
  409.  *****************************************************************************/
  410. void mmi_voip_highlight_prof_edit_register(void)
  411. {
  412.     /*----------------------------------------------------------------*/
  413.     /* Local Variables                                                */
  414.     /*----------------------------------------------------------------*/
  415.     /*----------------------------------------------------------------*/
  416.     /* Code Body                                                      */
  417.     /*----------------------------------------------------------------*/
  418.     g_voip_cntx_p->prof_setting_info.currScr = SCR_ID_VOIP_PROF_REGISTER;
  419.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  420.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  421.     SetLeftSoftkeyFunction(mmi_voip_entry_prof_edit_inlineitems, KEY_EVENT_UP);
  422.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  423.     SetKeyHandler(mmi_voip_pre_entry_prof_edit_inlineitems, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  424.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  425. }
  426. /*****************************************************************************
  427.  * FUNCTION
  428.  *  mmi_voip_highlight_prof_edit_nat
  429.  * DESCRIPTION
  430.  *  Highlight handler of VoIPProfile SettingProfile XEditNAT Setting
  431.  * PARAMETERS
  432.  *  void
  433.  * RETURNS
  434.  *  void
  435.  *****************************************************************************/
  436. void mmi_voip_highlight_prof_edit_nat(void)
  437. {
  438.     /*----------------------------------------------------------------*/
  439.     /* Local Variables                                                */
  440.     /*----------------------------------------------------------------*/
  441.     /*----------------------------------------------------------------*/
  442.     /* Code Body                                                      */
  443.     /*----------------------------------------------------------------*/
  444.     g_voip_cntx_p->prof_setting_info.currScr = SCR_ID_VOIP_PROF_NAT;
  445.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  446.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  447.     SetLeftSoftkeyFunction(mmi_voip_entry_prof_edit_inlineitems, KEY_EVENT_UP);
  448.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  449.     SetKeyHandler(mmi_voip_pre_entry_prof_edit_inlineitems, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  450.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  451. }
  452. /*****************************************************************************
  453.  * FUNCTION
  454.  *  mmi_voip_highlight_full_screen_editor
  455.  * DESCRIPTION
  456.  *  Highlight handler of full screen editor
  457.  * PARAMETERS
  458.  *  void
  459.  * RETURNS
  460.  *  void
  461.  *****************************************************************************/
  462. void mmi_voip_highlight_full_screen_editor(void)
  463. {
  464.     /*----------------------------------------------------------------*/
  465.     /* Local Variables                                                */
  466.     /*----------------------------------------------------------------*/
  467.     /*----------------------------------------------------------------*/
  468.     /* Code Body                                                      */
  469.     /*----------------------------------------------------------------*/
  470.     ChangeLeftSoftkey(STR_GLOBAL_OPTIONS, IMG_GLOBAL_OPTIONS);
  471.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  472.     SetLeftSoftkeyFunction(mmi_voip_entry_full_screen_editor_option, KEY_EVENT_UP);
  473.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  474. #ifdef __MMI_TOUCH_SCREEN__
  475.     mmi_pen_editor_set_vk_keys(MMI_FALSE, NULL, g_voip_disable_new_line);
  476. #endif
  477. }
  478. /*****************************************************************************
  479.  * FUNCTION
  480.  *  mmi_voip_highlight_done
  481.  * DESCRIPTION
  482.  *  Highlight handler of full screen editorOptionDone
  483.  * PARAMETERS
  484.  *  void
  485.  * RETURNS
  486.  *  void
  487.  *****************************************************************************/
  488. void mmi_voip_highlight_done(void)
  489. {
  490.     /*----------------------------------------------------------------*/
  491.     /* Local Variables                                                */
  492.     /*----------------------------------------------------------------*/
  493.     /*----------------------------------------------------------------*/
  494.     /* Code Body                                                      */
  495.     /*----------------------------------------------------------------*/
  496.     SetLeftSoftkeyFunction(ConfirmInlineFullScreenEdit, KEY_EVENT_UP);
  497. }
  498. /*****************************************************************************
  499.  * FUNCTION
  500.  *  mmi_voip_highlight_input_method_in_menu
  501.  * DESCRIPTION
  502.  *  Highlight handler of full screen editorOptionInput Method
  503.  * PARAMETERS
  504.  *  void
  505.  * RETURNS
  506.  *  void
  507.  *****************************************************************************/
  508. void mmi_voip_highlight_input_method_in_menu(void)
  509. {
  510.     /*----------------------------------------------------------------*/
  511.     /* Local Variables                                                */
  512.     /*----------------------------------------------------------------*/
  513.     /*----------------------------------------------------------------*/
  514.     /* Code Body                                                      */
  515.     /*----------------------------------------------------------------*/
  516.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  517.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  518.     SetLeftSoftkeyFunction(EntryInputMethodScreen, KEY_EVENT_UP);
  519.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  520.     RegisterInputMethodScreenCloseFunction(mmi_voip_go_back_2_history);
  521. }
  522. /*****************************************************************************
  523.  * FUNCTION
  524.  *  mmi_voip_highlight_call_setting
  525.  * DESCRIPTION
  526.  *  Highlight handler of VoIPCall Setting
  527.  * PARAMETERS
  528.  *  void
  529.  * RETURNS
  530.  *  void
  531.  *****************************************************************************/
  532. void mmi_voip_highlight_call_setting(void)
  533. {
  534.     /*----------------------------------------------------------------*/
  535.     /* Local Variables                                                */
  536.     /*----------------------------------------------------------------*/
  537.     /*----------------------------------------------------------------*/
  538.     /* Code Body                                                      */
  539.     /*----------------------------------------------------------------*/
  540.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  541.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  542.     SetLeftSoftkeyFunction(mmi_voip_entry_call_setting, KEY_EVENT_UP);
  543.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  544.     SetKeyHandler(mmi_voip_entry_call_setting, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  545.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  546. }
  547. /*****************************************************************************
  548.  * FUNCTION
  549.  *  mmi_voip_highlight_auto_answer
  550.  * DESCRIPTION
  551.  *  Highlight handler of VoIPCall SettingAuto Answer
  552.  * PARAMETERS
  553.  *  void
  554.  * RETURNS
  555.  *  void
  556.  *****************************************************************************/
  557. void mmi_voip_highlight_auto_answer(void)
  558. {
  559.     /*----------------------------------------------------------------*/
  560.     /* Local Variables                                                */
  561.     /*----------------------------------------------------------------*/
  562.     /*----------------------------------------------------------------*/
  563.     /* Code Body                                                      */
  564.     /*----------------------------------------------------------------*/
  565.     g_voip_cntx_p->call_setting_info.currScr = SCR_ID_VOIP_SETTING_AUTO_ANSWER;
  566.     g_voip_cntx_p->call_setting_info.currIndex = 0;
  567.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  568.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  569.     SetLeftSoftkeyFunction(mmi_voip_entry_setting_general, KEY_EVENT_UP);
  570.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  571.     SetKeyHandler(mmi_voip_entry_setting_general, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  572.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  573. }
  574. /*****************************************************************************
  575.  * FUNCTION
  576.  *  mmi_voip_highlight_auto_reject
  577.  * DESCRIPTION
  578.  *  Highlight handler of VoIPCall SettingAuto Reject
  579.  * PARAMETERS
  580.  *  void
  581.  * RETURNS
  582.  *  void
  583.  *****************************************************************************/
  584. void mmi_voip_highlight_auto_reject(void)
  585. {
  586.     /*----------------------------------------------------------------*/
  587.     /* Local Variables                                                */
  588.     /*----------------------------------------------------------------*/
  589.     /*----------------------------------------------------------------*/
  590.     /* Code Body                                                      */
  591.     /*----------------------------------------------------------------*/
  592.     g_voip_cntx_p->call_setting_info.currScr = SCR_ID_VOIP_SETTING_AUTO_REJECT;
  593.     g_voip_cntx_p->call_setting_info.currIndex = 0;
  594.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  595.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  596.     SetLeftSoftkeyFunction(mmi_voip_entry_setting_general, KEY_EVENT_UP);
  597.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  598.     SetKeyHandler(mmi_voip_entry_setting_general, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  599.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  600. }
  601. /*****************************************************************************
  602.  * FUNCTION
  603.  *  mmi_voip_highlight_auto_redial
  604.  * DESCRIPTION
  605.  *  Highlight handler of VoIPCall SettingAuto Redial
  606.  * PARAMETERS
  607.  *  void
  608.  * RETURNS
  609.  *  void
  610.  *****************************************************************************/
  611. void mmi_voip_highlight_auto_redial(void)
  612. {
  613.     /*----------------------------------------------------------------*/
  614.     /* Local Variables                                                */
  615.     /*----------------------------------------------------------------*/
  616.     /*----------------------------------------------------------------*/
  617.     /* Code Body                                                      */
  618.     /*----------------------------------------------------------------*/
  619.     g_voip_cntx_p->call_setting_info.currScr = SCR_ID_VOIP_SETTING_AUTO_REDIAL;
  620.     g_voip_cntx_p->call_setting_info.currIndex = 0;
  621.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  622.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  623.     SetLeftSoftkeyFunction(mmi_voip_entry_setting_general, KEY_EVENT_UP);
  624.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  625.     SetKeyHandler(mmi_voip_entry_setting_general, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  626.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  627. }
  628. /*****************************************************************************
  629.  * FUNCTION
  630.  *  mmi_voip_highlight_hide_caller_id
  631.  * DESCRIPTION
  632.  *  Highlight handler of VoIPCall SettingHide Caller ID
  633.  * PARAMETERS
  634.  *  void
  635.  * RETURNS
  636.  *  void
  637.  *****************************************************************************/
  638. void mmi_voip_highlight_hide_caller_id(void)
  639. {
  640.     /*----------------------------------------------------------------*/
  641.     /* Local Variables                                                */
  642.     /*----------------------------------------------------------------*/
  643.     /*----------------------------------------------------------------*/
  644.     /* Code Body                                                      */
  645.     /*----------------------------------------------------------------*/
  646.     g_voip_cntx_p->call_setting_info.currScr = SCR_ID_VOIP_SETTING_HIDE_CALLER_ID;
  647.     g_voip_cntx_p->call_setting_info.currIndex = 0;
  648.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  649.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  650.     SetLeftSoftkeyFunction(mmi_voip_entry_setting_general, KEY_EVENT_UP);
  651.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  652.     SetKeyHandler(mmi_voip_entry_setting_general, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  653.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  654. }
  655. /*****************************************************************************
  656.  * FUNCTION
  657.  *  mmi_voip_highlight_dtmf_in_menu
  658.  * DESCRIPTION
  659.  *  Highlight handler of VoIPCall SettingDTMF
  660.  * PARAMETERS
  661.  *  void
  662.  * RETURNS
  663.  *  void
  664.  *****************************************************************************/
  665. void mmi_voip_highlight_dtmf_in_menu(void)
  666. {
  667.     /*----------------------------------------------------------------*/
  668.     /* Local Variables                                                */
  669.     /*----------------------------------------------------------------*/
  670.     /*----------------------------------------------------------------*/
  671.     /* Code Body                                                      */
  672.     /*----------------------------------------------------------------*/
  673.     g_voip_cntx_p->call_setting_info.currScr = SCR_ID_VOIP_SETTING_DTMF;
  674.     g_voip_cntx_p->call_setting_info.currIndex = 0;
  675.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  676.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  677.     SetLeftSoftkeyFunction(mmi_voip_entry_setting_general, KEY_EVENT_UP);
  678.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  679.     SetKeyHandler(mmi_voip_entry_setting_general, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  680.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  681. }
  682. /*****************************************************************************
  683.  * FUNCTION
  684.  *  mmi_voip_highlight_comfort_noise
  685.  * DESCRIPTION
  686.  *  Highlight handler of VoIPCall SettingComfort Noise
  687.  * PARAMETERS
  688.  *  void
  689.  * RETURNS
  690.  *  void
  691.  *****************************************************************************/
  692. void mmi_voip_highlight_comfort_noise(void)
  693. {
  694.     /*----------------------------------------------------------------*/
  695.     /* Local Variables                                                */
  696.     /*----------------------------------------------------------------*/
  697.     /*----------------------------------------------------------------*/
  698.     /* Code Body                                                      */
  699.     /*----------------------------------------------------------------*/
  700.     g_voip_cntx_p->call_setting_info.currScr = SCR_ID_VOIP_SETTING_COMFORT_NOISE;
  701.     g_voip_cntx_p->call_setting_info.currIndex = 0;
  702.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  703.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  704.     SetLeftSoftkeyFunction(mmi_voip_entry_setting_general, KEY_EVENT_UP);
  705.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  706.     SetKeyHandler(mmi_voip_entry_setting_general, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  707.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  708. }
  709. /*****************************************************************************
  710.  * FUNCTION
  711.  *  mmi_voip_highlight_set_codec_order
  712.  * DESCRIPTION
  713.  *  Highlight handler of VoIPCall SettingSet Codec Order
  714.  * PARAMETERS
  715.  *  void
  716.  * RETURNS
  717.  *  void
  718.  *****************************************************************************/
  719. void mmi_voip_highlight_set_codec_order(void)
  720. {
  721.     /*----------------------------------------------------------------*/
  722.     /* Local Variables                                                */
  723.     /*----------------------------------------------------------------*/
  724.     /*----------------------------------------------------------------*/
  725.     /* Code Body                                                      */
  726.     /*----------------------------------------------------------------*/
  727.     g_voip_cntx_p->call_setting_info.currScr = SCR_ID_VOIP_SETTING_SET_CODEC_ORDER;
  728.     g_voip_cntx_p->call_setting_info.currIndex = 0;
  729.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  730.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  731.     SetLeftSoftkeyFunction(mmi_voip_entry_set_codec_order, KEY_EVENT_UP);
  732.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  733.     SetKeyHandler(mmi_voip_entry_set_codec_order, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  734.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  735. }
  736. /*****************************************************************************
  737.  * FUNCTION
  738.  *  mmi_voip_hint_auto_answer
  739.  * DESCRIPTION
  740.  *  Hint handler of VoIPCall SettingAuto Answer
  741.  * PARAMETERS
  742.  *  index       [IN]        Current selected index
  743.  * RETURNS
  744.  *  void
  745.  *****************************************************************************/
  746. void mmi_voip_hint_auto_answer(U16 index)
  747. {
  748.     /*----------------------------------------------------------------*/
  749.     /* Local Variables                                                */
  750.     /*----------------------------------------------------------------*/
  751.     /*----------------------------------------------------------------*/
  752.     /* Code Body                                                      */
  753.     /*----------------------------------------------------------------*/
  754.     memset(hintData[index], 0, MAX_SUB_MENU_SIZE);
  755.     if (g_voip_cntx_p->call_setting_info.saved_setting.autoAnswer == 0)
  756.     {
  757.         pfnUnicodeStrcpy((S8*)hintData[index], (S8*)GetString(STR_GLOBAL_OFF));
  758.     }
  759.     else if (g_voip_cntx_p->call_setting_info.saved_setting.autoAnswer == 1)
  760.     {
  761.         pfnUnicodeStrcpy((S8*)hintData[index], (S8*)GetString(STR_ID_VOIP_SETTING_ANYKEY));
  762.     }
  763.     else
  764.     {
  765.         pfnUnicodeStrcpy((S8*)hintData[index], (S8*)GetString(STR_ID_VOIP_SETTING_AUTO));
  766.     }
  767. }
  768. /*****************************************************************************
  769.  * FUNCTION
  770.  *  mmi_voip_hint_auto_reject
  771.  * DESCRIPTION
  772.  *  Hint handler of VoIPCall SettingAuto Reject
  773.  * PARAMETERS
  774.  *  index       [IN]        Current selected index
  775.  * RETURNS
  776.  *  void
  777.  *****************************************************************************/
  778. void mmi_voip_hint_auto_reject(U16 index)
  779. {
  780.     /*----------------------------------------------------------------*/
  781.     /* Local Variables                                                */
  782.     /*----------------------------------------------------------------*/
  783.     /*----------------------------------------------------------------*/
  784.     /* Code Body                                                      */
  785.     /*----------------------------------------------------------------*/
  786.     memset(hintData[index], 0, MAX_SUB_MENU_SIZE);
  787.     if (g_voip_cntx_p->call_setting_info.saved_setting.autoReject == 0)
  788.     {
  789.         pfnUnicodeStrcpy((S8*) hintData[index], (S8*) GetString(STR_GLOBAL_OFF));
  790.     }
  791.     else if (g_voip_cntx_p->call_setting_info.saved_setting.autoReject == 1)
  792.     {
  793.         pfnUnicodeStrcpy((S8*) hintData[index], (S8*) GetString(STR_ID_VOIP_SETTING_REJECT_UNKNOWN));
  794.     }
  795.     else
  796.     {
  797.         pfnUnicodeStrcpy((S8*) hintData[index], (S8*) GetString(STR_ID_VOIP_SETTING_REJECT_ALL));
  798.     }
  799. }
  800. /*****************************************************************************
  801.  * FUNCTION
  802.  *  mmi_voip_hint_auto_redial
  803.  * DESCRIPTION
  804.  *  Hint handler of VoIPCall SettingAuto Redial
  805.  * PARAMETERS
  806.  *  index       [IN]        Current selected index
  807.  * RETURNS
  808.  *  void
  809.  *****************************************************************************/
  810. void mmi_voip_hint_auto_redial(U16 index)
  811. {
  812.     /*----------------------------------------------------------------*/
  813.     /* Local Variables                                                */
  814.     /*----------------------------------------------------------------*/
  815.     /*----------------------------------------------------------------*/
  816.     /* Code Body                                                      */
  817.     /*----------------------------------------------------------------*/
  818.     memset(hintData[index], 0, MAX_SUB_MENU_SIZE);
  819.     if (g_voip_cntx_p->call_setting_info.saved_setting.autoRedial == 0)
  820.     {
  821.         pfnUnicodeStrcpy((S8*) hintData[index], (S8*) GetString(STR_GLOBAL_OFF));
  822.     }
  823.     else
  824.     {
  825.         pfnUnicodeStrcpy((S8*) hintData[index], (S8*) GetString(STR_GLOBAL_ON));
  826.     }
  827. }
  828. /*****************************************************************************
  829.  * FUNCTION
  830.  *  mmi_voip_hint_hide_caller_id
  831.  * DESCRIPTION
  832.  *  Hint handler of VoIPCall SettingHide Caller ID
  833.  * PARAMETERS
  834.  *  index       [IN]        Current selected index
  835.  * RETURNS
  836.  *  void
  837.  *****************************************************************************/
  838. void mmi_voip_hint_hide_caller_id(U16 index)
  839. {
  840.     /*----------------------------------------------------------------*/
  841.     /* Local Variables                                                */
  842.     /*----------------------------------------------------------------*/
  843.     /*----------------------------------------------------------------*/
  844.     /* Code Body                                                      */
  845.     /*----------------------------------------------------------------*/
  846.     memset(hintData[index], 0, MAX_SUB_MENU_SIZE);
  847.     if (g_voip_cntx_p->call_setting_info.saved_setting.hidecallerId == 0)
  848.     {
  849.         pfnUnicodeStrcpy((S8*) hintData[index], (S8*) GetString(STR_GLOBAL_OFF));
  850.     }
  851.     else
  852.     {
  853.         pfnUnicodeStrcpy((S8*) hintData[index], (S8*) GetString(STR_GLOBAL_ON));
  854.     }
  855. }
  856. /*****************************************************************************
  857.  * FUNCTION
  858.  *  mmi_voip_hint_dtmf_in_menu
  859.  * DESCRIPTION
  860.  *  Hint handler of VoIPCall SettingDTMF
  861.  * PARAMETERS
  862.  *  index       [IN]        Current selected index
  863.  * RETURNS
  864.  *  void
  865.  *****************************************************************************/
  866. void mmi_voip_hint_dtmf_in_menu(U16 index)
  867. {
  868.     /*----------------------------------------------------------------*/
  869.     /* Local Variables                                                */
  870.     /*----------------------------------------------------------------*/
  871.     /*----------------------------------------------------------------*/
  872.     /* Code Body                                                      */
  873.     /*----------------------------------------------------------------*/
  874.     memset(hintData[index], 0, MAX_SUB_MENU_SIZE);
  875.     if (g_voip_cntx_p->call_setting_info.saved_setting.dtmf == VOIP_DTMF_IN_BAND)
  876.     {
  877.         pfnUnicodeStrcpy((S8*) hintData[index], (S8*) GetString(STR_ID_VOIP_SETTING_INBAND));
  878.     }
  879.     else if (g_voip_cntx_p->call_setting_info.saved_setting.dtmf == VOIP_DTMF_OUT_OF_BAND)
  880.     {
  881.         pfnUnicodeStrcpy((S8*) hintData[index], (S8*) GetString(STR_ID_VOIP_SETTING_OUTBAND));
  882.     }
  883.     else
  884.     {
  885.         pfnUnicodeStrcpy((S8*) hintData[index], (S8*) GetString(STR_GLOBAL_OFF));
  886.     }
  887. }
  888. /*****************************************************************************
  889.  * FUNCTION
  890.  *  mmi_voip_hint_comfort_noise
  891.  * DESCRIPTION
  892.  *  Hint handler of VoIPCall SettingComfort Noise
  893.  * PARAMETERS
  894.  *  index       [IN]        Current selected index
  895.  * RETURNS
  896.  *  void
  897.  *****************************************************************************/
  898. void mmi_voip_hint_comfort_noise(U16 index)
  899. {
  900.     /*----------------------------------------------------------------*/
  901.     /* Local Variables                                                */
  902.     /*----------------------------------------------------------------*/
  903.     /*----------------------------------------------------------------*/
  904.     /* Code Body                                                      */
  905.     /*----------------------------------------------------------------*/
  906.     memset(hintData[index], 0, MAX_SUB_MENU_SIZE);
  907.     if (g_voip_cntx_p->call_setting_info.saved_setting.comfortNoise == 0)
  908.     {
  909.         pfnUnicodeStrcpy((S8*) hintData[index], (S8*) GetString(STR_GLOBAL_ON));
  910.     }
  911.     else
  912.     {
  913.         pfnUnicodeStrcpy((S8*) hintData[index], (S8*) GetString(STR_GLOBAL_OFF));
  914.     }
  915. }
  916. #ifdef SIP_CONFORMANCE_TEST
  917. /*****************************************************************************
  918.  * FUNCTION
  919.  *  mmi_voip_highlight_option_query
  920.  * DESCRIPTION
  921.  *  Highlight handler of VoIPOption Query
  922.  * PARAMETERS
  923.  *  void
  924.  * RETURNS
  925.  *  void
  926.  *****************************************************************************/
  927. void mmi_voip_highlight_option_query(void)
  928. {
  929.     /*----------------------------------------------------------------*/
  930.     /* Local Variables                                                */
  931.     /*----------------------------------------------------------------*/
  932.     /*----------------------------------------------------------------*/
  933.     /* Code Body                                                      */
  934.     /*----------------------------------------------------------------*/
  935.     memset(g_voip_cntx_p->call_misc_info.dispUri, 0, (VOIP_URI_LEN * ENCODING_LENGTH));
  936.     memset(g_voip_cntx_p->call_misc_info.inputUri, 0, VOIP_URI_LEN);
  937.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  938.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  939.     SetLeftSoftkeyFunction(mmi_voip_entry_option_query, KEY_EVENT_UP);
  940.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  941. }
  942. #endif /* SIP_CONFORMANCE_TEST */
  943. /*****************************************************************************
  944.  * FUNCTION
  945.  *  mmi_voip_pre_entry_main_menu
  946.  * DESCRIPTION
  947.  *  Determine to go to VoIP main menu or not based on current state.
  948.  * PARAMETERS
  949.  *  void
  950.  * RETURNS
  951.  *  void
  952.  *****************************************************************************/
  953. void mmi_voip_pre_entry_main_menu(void)
  954. {
  955.     /*----------------------------------------------------------------*/
  956.     /* Local Variables                                                */
  957.     /*----------------------------------------------------------------*/
  958.     /*----------------------------------------------------------------*/
  959.     /* Code Body                                                      */
  960.     /*----------------------------------------------------------------*/
  961.     switch (g_voip_cntx_p->reg_state_info)
  962.     {
  963.         case MMI_VOIP_DEREG_STATE:
  964.         case MMI_VOIP_REG_STATE:
  965.             mmi_voip_entry_main_menu();
  966.             break;
  967.         case MMI_VOIP_PROCESS_STATE:
  968.             mmi_voip_set_processing_parameter(
  969.                 STR_ID_VOIP_MAIN,
  970.                 STR_ID_VOIP_PROCESSING,
  971.                 IMG_GLOBAL_PROGRESS,
  972.                 0,
  973.                 0,
  974.                 STR_GLOBAL_BACK,
  975.                 GoBackHistory,
  976.                 0,
  977.                 0);
  978.             mmi_voip_entry_processing_screen();
  979.             break;
  980.         default:
  981.             MMI_ASSERT(0);  /* unexpectedly go to MMI_VOIP_REG_STATE_TOTAL */
  982.             break;
  983.     }
  984. }
  985. /*****************************************************************************
  986.  * FUNCTION
  987.  *  mmi_voip_entry_main_menu
  988.  * DESCRIPTION
  989.  *  Entry function of ServicesVoIP
  990.  * PARAMETERS
  991.  *  void
  992.  * RETURNS
  993.  *  void
  994.  *****************************************************************************/
  995. void mmi_voip_entry_main_menu(void)
  996. {
  997.     /*----------------------------------------------------------------*/
  998.     /* Local Variables                                                */
  999.     /*----------------------------------------------------------------*/
  1000.     U8 *guiBuffer = NULL;
  1001.     U16 numItems = 0, i = 0;
  1002.     U16 nStrItemList[MAX_SUB_MENUS];    /* Login(Logout), Profile Setting, Call Setting, New Call */
  1003.     /*----------------------------------------------------------------*/
  1004.     /* Code Body                                                      */
  1005.     /*----------------------------------------------------------------*/
  1006.     if (IsScreenPresent(SCR_ID_VOIP_PROCESSING))
  1007.     {
  1008.         HistoryReplace(SCR_ID_VOIP_PROCESSING, SCR_ID_VOIP_MAIN, mmi_voip_entry_main_menu);
  1009.         return;
  1010.     }
  1011.     EntryNewScreen(SCR_ID_VOIP_MAIN, NULL, mmi_voip_entry_main_menu, NULL);
  1012.     guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_MAIN);
  1013.     SetParentHandler(MENU_ID_VOIP_MAIN);
  1014.     if (g_voip_cntx_p->reg_state_info == MMI_VOIP_REG_STATE)
  1015.     {
  1016.         mmi_frm_hide_menu_item(MENU_ID_VOIP_PROF_SETTING);  /* hide profile setting menu if VoIP is login */
  1017.     }
  1018.     else
  1019.     {
  1020.         mmi_frm_unhide_menu_item(MENU_ID_VOIP_PROF_SETTING);
  1021.     }
  1022.     numItems = GetNumOfChild_Ext(MENU_ID_VOIP_MAIN);
  1023.     GetSequenceStringIds_Ext(MENU_ID_VOIP_MAIN, nStrItemList);
  1024.     if (g_voip_cntx_p->reg_state_info == MMI_VOIP_REG_STATE)
  1025.     {
  1026.         for (i = 0; i < MAX_SUB_MENUS; i++)
  1027.         {
  1028.             if (nStrItemList[i] == STR_ID_VOIP_LOGIN)
  1029.             {
  1030.                 nStrItemList[i] = STR_ID_VOIP_LOGOUT;   /* change login string to logout if VoIP is login */
  1031.             }
  1032.         }
  1033.     }
  1034.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1035.     ShowCategory52Screen(
  1036.         STR_ID_VOIP_MAIN,
  1037.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  1038.         STR_GLOBAL_OK,
  1039.         IMG_GLOBAL_OK,
  1040.         STR_GLOBAL_BACK,
  1041.         IMG_GLOBAL_BACK,
  1042.         numItems,
  1043.         nStrItemList,
  1044.         (U16*) gIndexIconsImageList,
  1045.         NULL,
  1046.         0,
  1047.         0,
  1048.         guiBuffer);
  1049.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1050. }
  1051. /*****************************************************************************
  1052.  * FUNCTION
  1053.  *  mmi_voip_entry_status
  1054.  * DESCRIPTION
  1055.  *  Entry function of VoIPLogin(Logout)
  1056.  * PARAMETERS
  1057.  *  void
  1058.  * RETURNS
  1059.  *  void
  1060.  *****************************************************************************/
  1061. void mmi_voip_entry_status(void)
  1062. {
  1063.     /*----------------------------------------------------------------*/
  1064.     /* Local Variables                                                */
  1065.     /*----------------------------------------------------------------*/
  1066.     /*----------------------------------------------------------------*/
  1067.     /* Code Body                                                      */
  1068.     /*----------------------------------------------------------------*/
  1069.     if (g_voip_cntx_p->prof_setting_info.actprofIndex == -1)
  1070.     {
  1071.         DisplayPopup(
  1072.             (U8*)GetString(STR_ID_VOIP_NO_ACTIVATED_PROFILE),
  1073.             IMG_GLOBAL_UNFINISHED,
  1074.             1,
  1075.             UI_POPUP_NOTIFYDURATION_TIME,
  1076.             ERROR_TONE);
  1077.         DeleteScreenIfPresent(SCR_ID_VOIP_CALL_EDITOR_OPTION);  /* go back to call editor screen */
  1078.         return;
  1079.     }
  1080.     switch (g_voip_cntx_p->reg_state_info)
  1081.     {
  1082.         case MMI_VOIP_DEREG_STATE:
  1083.             mmi_voip_set_processing_parameter(
  1084.                 STR_ID_VOIP_LOGIN,
  1085.                 STR_ID_VOIP_CONNECT_TO_SERVER,
  1086.                 IMG_GLOBAL_PROGRESS,
  1087.                 0,
  1088.                 0,
  1089.                 STR_GLOBAL_ABORT,
  1090.                 mmi_voip_entry_abort_login,
  1091.                 0,
  1092.                 mmi_voip_entry_abort_login_endkey);
  1093.             mmi_voip_entry_processing_screen();
  1094.             mmi_voip_register_req();
  1095.             break;
  1096.         case MMI_VOIP_REG_STATE:
  1097.             mmi_voip_set_processing_parameter(
  1098.                 STR_ID_VOIP_LOGOUT,
  1099.                 STR_ID_VOIP_DISCONNECT_FROM_SERVER,
  1100.                 IMG_GLOBAL_PROGRESS,
  1101.                 0,
  1102.                 0,
  1103.                 STR_GLOBAL_BACK,
  1104.                 mmi_voip_go_back_2_history,
  1105.                 0,
  1106.                 0);
  1107.             mmi_voip_entry_processing_screen();
  1108.             mmi_voip_deregister_req();
  1109.             break;
  1110.         case MMI_VOIP_PROCESS_STATE:
  1111.         default:
  1112.             break;
  1113.     }
  1114. }
  1115. /*****************************************************************************
  1116.  * FUNCTION
  1117.  *  mmi_voip_entry_abort_login
  1118.  * DESCRIPTION
  1119.  *  Entry function to abort login by RSK.
  1120.  * PARAMETERS
  1121.  *  void
  1122.  * RETURNS
  1123.  *  void
  1124.  *****************************************************************************/
  1125. void mmi_voip_entry_abort_login(void)
  1126. {
  1127.     /*----------------------------------------------------------------*/
  1128.     /* Local Variables                                                */
  1129.     /*----------------------------------------------------------------*/
  1130.     /*----------------------------------------------------------------*/
  1131.     /* Code Body                                                      */
  1132.     /*----------------------------------------------------------------*/
  1133.     mmi_voip_set_processing_parameter(
  1134.         STR_GLOBAL_ABORT,
  1135.         STR_GLOBAL_ABORTING,
  1136.         IMG_GLOBAL_PROGRESS,
  1137.         0,
  1138.         0,
  1139.         STR_GLOBAL_BACK,
  1140.         mmi_voip_go_back_2_history,
  1141.         0,
  1142.         0);
  1143.     mmi_voip_entry_processing_screen();
  1144.     DeleteScreenIfPresent(SCR_ID_VOIP_PROCESSING);
  1145.     mmi_voip_deregister_req();
  1146. }
  1147. /*****************************************************************************
  1148.  * FUNCTION
  1149.  *  mmi_voip_entry_abort_login_endkey
  1150.  * DESCRIPTION
  1151.  *  Entry function to abort login by END key.
  1152.  * PARAMETERS
  1153.  *  void
  1154.  * RETURNS
  1155.  *  void
  1156.  *****************************************************************************/
  1157. void mmi_voip_entry_abort_login_endkey(void)
  1158. {
  1159.     /*----------------------------------------------------------------*/
  1160.     /* Local Variables                                                */
  1161.     /*----------------------------------------------------------------*/
  1162.     /*----------------------------------------------------------------*/
  1163.     /* Code Body                                                      */
  1164.     /*----------------------------------------------------------------*/
  1165.     DisplayIdleScreen();
  1166.     mmi_voip_deregister_req();
  1167. }
  1168. /*****************************************************************************
  1169.  * FUNCTION
  1170.  *  mmi_voip_entry_summary
  1171.  * DESCRIPTION
  1172.  *  Entry function of VoIPCurrent Status
  1173.  * PARAMETERS
  1174.  *  void
  1175.  * RETURNS
  1176.  *  void
  1177.  *****************************************************************************/
  1178. void mmi_voip_entry_summary(void)
  1179. {
  1180.     /*----------------------------------------------------------------*/
  1181.     /* Local Variables                                                */
  1182.     /*----------------------------------------------------------------*/
  1183.     U8 *guiBuffer = NULL;
  1184.     
  1185.     /*----------------------------------------------------------------*/
  1186.     /* Code Body                                                      */
  1187.     /*----------------------------------------------------------------*/
  1188.     EntryNewScreen(SCR_ID_VOIP_SUMMARY, NULL, NULL, NULL);
  1189.     guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_SUMMARY);
  1190.     memset(subMenuData, 0, (MAX_SUB_MENUS * MAX_SUB_MENU_SIZE));
  1191.     mmi_voip_get_summary_string((U8*)subMenuData);
  1192.     ShowCategory74Screen(
  1193.         STR_ID_VOIP_SUMMARY,
  1194.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  1195.         0,
  1196.         IMG_GLOBAL_OK,
  1197.         STR_GLOBAL_BACK,
  1198.         IMG_GLOBAL_BACK,
  1199.         (U8*)subMenuData,
  1200.         MAX_SUB_MENUS * MAX_SUB_MENU_SIZE,
  1201.         guiBuffer);
  1202.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1203.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1204. }
  1205. /*****************************************************************************
  1206.  * FUNCTION
  1207.  *  mmi_voip_entry_prof_setting
  1208.  * DESCRIPTION
  1209.  *  Entry function of VoIPProfile Setting
  1210.  * PARAMETERS
  1211.  *  void
  1212.  * RETURNS
  1213.  *  void
  1214.  *****************************************************************************/
  1215. void mmi_voip_entry_prof_setting(void)
  1216. {
  1217.     /*----------------------------------------------------------------*/
  1218.     /* Local Variables                                                */
  1219.     /*----------------------------------------------------------------*/
  1220.     U8 *guiBuffer = NULL;
  1221.     S32 i = 0;
  1222.     U8 *profileNames[MMI_VOIP_MAX_PROFILE_NUM];
  1223.     U16 iconList1[MMI_VOIP_MAX_PROFILE_NUM], iconList2[MMI_VOIP_MAX_PROFILE_NUM];
  1224.     /*----------------------------------------------------------------*/
  1225.     /* Code Body                                                      */
  1226.     /*----------------------------------------------------------------*/
  1227.     EntryNewScreen(SCR_ID_VOIP_PROF_SETTING, NULL, mmi_voip_entry_prof_setting, NULL);
  1228.     guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_PROF_SETTING);
  1229.     for (i = 0; i < MMI_VOIP_MAX_PROFILE_NUM; i++)
  1230.     {
  1231.         profileNames[i] = (U8*)g_voip_cntx_p->prof_setting_info.saved_prof[i].comm_info.profName;
  1232.         if (!pfnUnicodeStrlen((S8*)profileNames[i]))
  1233.         {            
  1234.             profileNames[i] = (U8*)GetString(STR_ID_VOIP_PROF_COMMON_PROF1 + i);
  1235.         }
  1236.         iconList1[i] = 0; /* initialize profile activation icon */
  1237.         if (i == g_voip_cntx_p->prof_setting_info.actprofIndex)
  1238.         {
  1239.             iconList1[i] = IMG_VICON;
  1240.         }
  1241.         iconList2[i] = IMG_GLOBAL_L1 + i;
  1242.     }
  1243.     RegisterHighlightHandler(mmi_voip_highlight_prof_setting_item);
  1244.     ShowCategory73Screen(
  1245.         STR_ID_VOIP_PROF_SETTING,
  1246.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  1247.         STR_GLOBAL_OPTIONS,
  1248.         IMG_GLOBAL_OPTIONS,
  1249.         STR_GLOBAL_BACK,
  1250.         IMG_GLOBAL_BACK,
  1251.         MMI_VOIP_MAX_PROFILE_NUM,
  1252.         profileNames,
  1253.         iconList1,
  1254.         iconList2,
  1255.         0,
  1256.         guiBuffer,
  1257.         ICON_ICON_TEXT);
  1258.     SetLeftSoftkeyFunction(mmi_voip_entry_prof_setting_option, KEY_EVENT_UP);
  1259.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1260.     SetKeyHandler(mmi_voip_entry_prof_setting_option, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1261.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1262. }
  1263. /*****************************************************************************
  1264.  * FUNCTION
  1265.  *  mmi_voip_highlight_prof_setting_item
  1266.  * DESCRIPTION
  1267.  *  Highlight index of selecting a profile in VoIPProfile Setting
  1268.  * PARAMETERS
  1269.  *  index       [IN]        Current highlight index.
  1270.  * RETURNS
  1271.  *  void
  1272.  *****************************************************************************/
  1273. void mmi_voip_highlight_prof_setting_item(S32 index)
  1274. {
  1275.     /*----------------------------------------------------------------*/
  1276.     /* Local Variables                                                */
  1277.     /*----------------------------------------------------------------*/
  1278.     /*----------------------------------------------------------------*/
  1279.     /* Code Body                                                      */
  1280.     /*----------------------------------------------------------------*/
  1281.     g_voip_cntx_p->prof_setting_info.currprofIndex = index;
  1282. }
  1283. /*****************************************************************************
  1284.  * FUNCTION
  1285.  *  mmi_voip_entry_prof_setting_option
  1286.  * DESCRIPTION
  1287.  *  Entry function of VoIPProfile SettingOption
  1288.  * PARAMETERS
  1289.  *  void
  1290.  * RETURNS
  1291.  *  void
  1292.  *****************************************************************************/
  1293. void mmi_voip_entry_prof_setting_option(void)
  1294. {
  1295.     /*----------------------------------------------------------------*/
  1296.     /* Local Variables                                                */
  1297.     /*----------------------------------------------------------------*/
  1298.     U8 *guiBuffer = NULL;
  1299.     U16 numItems = 0;
  1300.     U16 nStrItemList[MAX_SUB_MENUS];
  1301.     /*----------------------------------------------------------------*/
  1302.     /* Code Body                                                      */
  1303.     /*----------------------------------------------------------------*/
  1304.     EntryNewScreen(SCR_ID_VOIP_PROF_SETTING_OPTION, NULL, mmi_voip_entry_prof_setting_option, NULL);
  1305.     guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_PROF_SETTING_OPTION);
  1306.     SetParentHandler(MENU_ID_VOIP_PROF_SETTING_OPTION);
  1307.     numItems = GetNumOfChild(MENU_ID_VOIP_PROF_SETTING_OPTION);
  1308.     GetSequenceStringIds(MENU_ID_VOIP_PROF_SETTING_OPTION, nStrItemList);
  1309.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1310.     ShowCategory52Screen(
  1311.         STR_GLOBAL_OPTIONS,
  1312.         GetRootTitleIcon(MENU_ID_VOIP_MAIN),
  1313.         STR_GLOBAL_OK,
  1314.         IMG_GLOBAL_OK,
  1315.         STR_GLOBAL_BACK,
  1316.         IMG_GLOBAL_BACK,
  1317.         numItems,
  1318.         nStrItemList,
  1319.         (U16*) gIndexIconsImageList,
  1320.         NULL,
  1321.         0,
  1322.         0,
  1323.         guiBuffer);
  1324.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1325.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1326. }
  1327. /*****************************************************************************
  1328.  * FUNCTION
  1329.  *  mmi_voip_entry_prof_activate
  1330.  * DESCRIPTION
  1331.  *  Entry function of VoIPProfile SettingProfile XActivate
  1332.  * PARAMETERS
  1333.  *  void
  1334.  * RETURNS
  1335.  *  void
  1336.  *****************************************************************************/
  1337. void mmi_voip_entry_prof_activate(void)
  1338. {
  1339.     /*----------------------------------------------------------------*/
  1340.     /* Local Variables                                                */
  1341.     /*----------------------------------------------------------------*/
  1342.     S32 profIndex = g_voip_cntx_p->prof_setting_info.currprofIndex;
  1343.     U16 errorstrId = 0;
  1344.     /*----------------------------------------------------------------*/
  1345.     /* Code Body                                                      */
  1346.     /*----------------------------------------------------------------*/
  1347.     errorstrId = mmi_voip_prof_validate_activation(profIndex);
  1348.     if (errorstrId != 0)
  1349.     {
  1350.         DisplayPopup(
  1351.             (U8*)GetString(errorstrId), 
  1352.             IMG_GLOBAL_UNFINISHED, 
  1353.             1, 
  1354.             UI_POPUP_NOTIFYDURATION_TIME, 
  1355.             ERROR_TONE);
  1356.         return;
  1357.     }
  1358.     g_voip_cntx_p->prof_setting_info.actprofIndex = profIndex;
  1359.     mmi_voip_save_profile_active_index();
  1360.     DisplayPopup(
  1361.         (U8*)GetString(STR_GLOBAL_ACTIVATE),
  1362.         IMG_GLOBAL_ACTIVATED,
  1363.         1,
  1364.         UI_POPUP_NOTIFYDURATION_TIME,
  1365.         SUCCESS_TONE);
  1366.     DeleteScreenIfPresent(SCR_ID_VOIP_PROF_EDIT_INLINEITEMS);
  1367.     DeleteScreenIfPresent(SCR_ID_VOIP_PROF_EDIT);
  1368.     DeleteScreenIfPresent(SCR_ID_VOIP_PROF_SETTING_OPTION);
  1369. }
  1370. /*****************************************************************************
  1371.  * FUNCTION
  1372.  *  mmi_voip_entry_prof_edit
  1373.  * DESCRIPTION
  1374.  *  Entry function of VoIPProfile SettingProfile XEdit
  1375.  * PARAMETERS
  1376.  *  void
  1377.  * RETURNS
  1378.  *  void
  1379.  *****************************************************************************/
  1380. void mmi_voip_entry_prof_edit(void)
  1381. {
  1382.     /*----------------------------------------------------------------*/
  1383.     /* Local Variables                                                */
  1384.     /*----------------------------------------------------------------*/
  1385.     U8 *guiBuffer = NULL;
  1386.     U16 numItems = 0;
  1387.     U16 nStrItemList[MAX_SUB_MENUS];
  1388.     /* Common Setting, Account Setting, Outbound Server, Register Server, NAT Setting */
  1389.     /*----------------------------------------------------------------*/
  1390.     /* Code Body                                                      */
  1391.     /*----------------------------------------------------------------*/
  1392.     EntryNewScreen(SCR_ID_VOIP_PROF_EDIT, NULL, mmi_voip_entry_prof_edit, NULL);
  1393.     guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_PROF_EDIT);
  1394.     SetParentHandler(MENU_ID_VOIP_PROF_SETTING_OPTION_EDIT);
  1395.     numItems = GetNumOfChild(MENU_ID_VOIP_PROF_SETTING_OPTION_EDIT);
  1396.     GetSequenceStringIds(MENU_ID_VOIP_PROF_SETTING_OPTION_EDIT, nStrItemList);
  1397.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1398.     ShowCategory52Screen(
  1399.         STR_GLOBAL_EDIT,
  1400.         GetRootTitleIcon(MENU_ID_VOIP_PROF_SETTING),
  1401.         STR_GLOBAL_OK,
  1402.         IMG_GLOBAL_OK,
  1403.         STR_GLOBAL_BACK,
  1404.         IMG_GLOBAL_BACK,
  1405.         numItems,
  1406.         nStrItemList,
  1407.         (U16*) gIndexIconsImageList,
  1408.         NULL,
  1409.         0,
  1410.         0,
  1411.         guiBuffer);
  1412.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1413.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1414. }
  1415. /*****************************************************************************
  1416.  * FUNCTION
  1417.  *  mmi_voip_pre_entry_prof_edit_inlineitems
  1418.  * DESCRIPTION
  1419.  *  Pre-entry function of VoIPProfile SettingProfile XEditInline Editor
  1420.  * PARAMETERS
  1421.  *  void
  1422.  * RETURNS
  1423.  *  void
  1424.  *****************************************************************************/
  1425. void mmi_voip_pre_entry_prof_edit_inlineitems(void)
  1426. {
  1427.     /*----------------------------------------------------------------*/
  1428.     /* Local Variables                                                */
  1429.     /*----------------------------------------------------------------*/
  1430.     /*----------------------------------------------------------------*/
  1431.     /* Code Body                                                      */
  1432.     /*----------------------------------------------------------------*/
  1433.     DataAccountReadyCheck(mmi_voip_entry_prof_edit_inlineitems);
  1434. }
  1435. /*****************************************************************************
  1436.  * FUNCTION
  1437.  *  mmi_voip_entry_prof_edit_inlineitems
  1438.  * DESCRIPTION
  1439.  *  Entry function of VoIPProfile SettingProfile XEditInline Editor
  1440.  * PARAMETERS
  1441.  *  void
  1442.  * RETURNS
  1443.  *  void
  1444.  *****************************************************************************/
  1445. void mmi_voip_entry_prof_edit_inlineitems(void)
  1446. {
  1447.     /*----------------------------------------------------------------*/
  1448.     /* Local Variables                                                */
  1449.     /*----------------------------------------------------------------*/
  1450.     U16 currScreen = g_voip_cntx_p->prof_setting_info.currScr;
  1451.     S32 profIndex = g_voip_cntx_p->prof_setting_info.currprofIndex;
  1452.     U8 *guiBuffer = NULL, *inputBuffer = NULL;
  1453.     U16 inputBufferSize = 0, titleId = 0, imgId = 0, numItems = 0;
  1454.     S32 i = 0;
  1455.     U16 iconList[MAX_SUB_MENUS];
  1456.     /*----------------------------------------------------------------*/
  1457.     /* Code Body                                                      */
  1458.     /*----------------------------------------------------------------*/
  1459.     EntryNewScreen(SCR_ID_VOIP_PROF_EDIT_INLINEITEMS, mmi_voip_exit_prof_edit_inlineitems, NULL, NULL);
  1460.     InitializeCategory57Screen();
  1461.     guiBuffer = GetCurrGuiBuffer(SCR_ID_VOIP_PROF_EDIT_INLINEITEMS);
  1462.     inputBuffer = GetCurrNInputBuffer(SCR_ID_VOIP_PROF_EDIT_INLINEITEMS, &inputBufferSize);
  1463.     switch (currScreen)
  1464.     {
  1465.         case SCR_ID_VOIP_PROF_COMMON:
  1466.             if (inputBuffer == NULL)
  1467.             {
  1468.                 mmi_voip_update_prof_common_cache_to_disp(profIndex);
  1469.             }
  1470.             titleId = STR_ID_VOIP_PROF_EDIT_COMMON;
  1471.             imgId = IMG_ID_VOIP_PROF_COMMON_PROF_NAME;
  1472.             numItems = mmi_voip_setup_prof_common_inlineitems();
  1473.             break;
  1474.         case SCR_ID_VOIP_PROF_ACCOUNT:
  1475.             if (inputBuffer == NULL)
  1476.             {
  1477.                 mmi_voip_update_prof_acct_cache_to_disp(profIndex);
  1478.             }
  1479.             titleId = STR_ID_VOIP_PROF_EDIT_ACCOUNT;
  1480.             imgId = IMG_ID_VOIP_PROF_ACCOUNT_SIP_SERVER;
  1481.             numItems = mmi_voip_setup_prof_acct_inlineitems();
  1482.             break;
  1483.         case SCR_ID_VOIP_PROF_OUTBOUND:
  1484.             if (inputBuffer == NULL)
  1485.             {
  1486.                 mmi_voip_update_prof_outbound_cache_to_disp(profIndex);
  1487.             }
  1488.             titleId = STR_ID_VOIP_PROF_EDIT_OUTBOUND;
  1489.             imgId = IMG_ID_VOIP_PROF_OUTBOUND_STATUS;
  1490.             numItems = mmi_voip_setup_prof_outbound_inlineitems();
  1491.             break;
  1492.         case SCR_ID_VOIP_PROF_REGISTER:
  1493.             if (inputBuffer == NULL)
  1494.             {
  1495.                 mmi_voip_update_prof_register_cache_to_disp(profIndex);
  1496.             }
  1497.             titleId = STR_ID_VOIP_PROF_EDIT_REGISTER;
  1498.             imgId = IMG_ID_VOIP_PROF_REGISTER_STATUS;
  1499.             numItems = mmi_voip_setup_prof_register_inlineitems();
  1500.             break;
  1501.         case SCR_ID_VOIP_PROF_NAT:
  1502.             if (inputBuffer == NULL)
  1503.             {
  1504.                 mmi_voip_update_prof_nat_cache_to_disp(profIndex);
  1505.             }
  1506.             titleId = STR_ID_VOIP_PROF_EDIT_NAT;
  1507.             imgId = IMG_ID_VOIP_PROF_NAT_STATUS;
  1508.             numItems = mmi_voip_setup_prof_nat_inlineitems();
  1509.             break;
  1510.         default:
  1511.             MMI_ASSERT(0);
  1512.     }
  1513.     for (i = 0; i < numItems; i++)
  1514.     {
  1515.         if (i % 2)
  1516.         {
  1517.             iconList[i] = 0;
  1518.         }
  1519.         else
  1520.         {
  1521.             iconList[i] = imgId + (i / 2);
  1522.         }
  1523.     }
  1524.     if (inputBuffer != NULL)
  1525.     {
  1526.         SetCategory57Data(wgui_inline_items, numItems, inputBuffer);
  1527.     }
  1528.     ShowCategory57Screen(
  1529.         titleId,
  1530.         GetRootTitleIcon(MENU_ID_VOIP_PROF_SETTING),
  1531.         STR_GLOBAL_EDIT,
  1532.         0,
  1533.         STR_GLOBAL_BACK,
  1534.         IMG_GLOBAL_BACK,
  1535.         numItems,
  1536.         iconList,
  1537.         wgui_inline_items,
  1538.         0,
  1539.         guiBuffer);
  1540.     SetCategory57RightSoftkeyFunctions(mmi_voip_entry_prof_confirm, GoBackHistory);
  1541. }
  1542. /*****************************************************************************
  1543.  * FUNCTION
  1544.  *  mmi_voip_exit_prof_edit_inlineitems
  1545.  * DESCRIPTION
  1546.  *  Exit function of VoIPProfile SettingProfile XEditInline Editor
  1547.  * PARAMETERS
  1548.  *  void
  1549.  * RETURNS
  1550.  *  void
  1551.  *****************************************************************************/
  1552. void mmi_voip_exit_prof_edit_inlineitems(void)
  1553. {
  1554.     /*----------------------------------------------------------------*/
  1555.     /* Local Variables                                                */
  1556.     /*----------------------------------------------------------------*/
  1557.     history h;
  1558.     U16 inputBuffSize = 0;
  1559.     /*----------------------------------------------------------------*/
  1560.     /* Code Body                                                      */
  1561.     /*----------------------------------------------------------------*/
  1562.     CloseCategory57Screen();
  1563.     h.scrnID = SCR_ID_VOIP_PROF_EDIT_INLINEITEMS;
  1564.     h.entryFuncPtr = mmi_voip_entry_prof_edit_inlineitems;
  1565.     GetCategoryHistory(h.guiBuffer);
  1566.     GetCategory57Data(h.inputBuffer);
  1567.     inputBuffSize = (U16) GetCategory57DataSize();
  1568.     AddNHistory(h, inputBuffSize);
  1569. }
  1570. /*****************************************************************************
  1571.  * FUNCTION
  1572.  *  mmi_voip_update_prof_common_cache_to_disp
  1573.  * DESCRIPTION
  1574.  *  Copy g_voip_cntx_p->prof_setting_info.saved_prof[index] to
  1575.  *  g_voip_cntx_p->prof_setting_info.disp_prof for Common Setting.
  1576.  * PARAMETERS
  1577.  *  profIndex           [IN]            Index of intended to update profile
  1578.  * RETURNS
  1579.  *  void
  1580.  *****************************************************************************/
  1581. void mmi_voip_update_prof_common_cache_to_disp(S32 profIndex)
  1582. {
  1583.     /*----------------------------------------------------------------*/
  1584.     /* Local Variables                                                */
  1585.     /*----------------------------------------------------------------*/
  1586.     /*----------------------------------------------------------------*/
  1587.     /* Code Body                                                      */
  1588.     /*----------------------------------------------------------------*/
  1589.     /* Profile Name */
  1590.     memset(g_voip_cntx_p->prof_setting_info.disp_prof.profileName, 0, (MMI_VOIP_MAX_PROFILE_NAME_LEN * sizeof(U16)));
  1591.     pfnUnicodeStrncpy(
  1592.         (S8*)g_voip_cntx_p->prof_setting_info.disp_prof.profileName,
  1593.         (S8*)g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].comm_info.profName,
  1594.         MMI_VOIP_MAX_PROFILE_NAME_LEN);
  1595.     if (!pfnUnicodeStrlen((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.profileName))
  1596.     {
  1597.         pfnUnicodeStrcpy(
  1598.             (S8*)g_voip_cntx_p->prof_setting_info.disp_prof.profileName,
  1599.             (S8*)GetString(STR_ID_VOIP_PROF_COMMON_PROF1 + profIndex));
  1600.         MMI_ASSERT(g_voip_cntx_p->prof_setting_info.disp_prof.profileName[MMI_VOIP_MAX_PROFILE_NAME_LEN - 1] == '');
  1601.     }
  1602.     
  1603.     /* Data Account */
  1604.     g_voip_cntx_p->prof_setting_info.disp_prof.dataacctIndex =
  1605.         g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].comm_info.dataAcct;
  1606.     /* Auto Login */
  1607.     g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex =
  1608.         g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].comm_info.autoLogin;
  1609.     /* Voice Mail Server */
  1610.     memset(g_voip_cntx_p->prof_setting_info.disp_prof.serverName, 0, (VOIP_URI_LEN * ENCODING_LENGTH));
  1611.     AnsiiNToUnicodeString(
  1612.         (S8*)g_voip_cntx_p->prof_setting_info.disp_prof.serverName,
  1613.         (S8*)g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].comm_info.vmServer,
  1614.         VOIP_URI_LEN);
  1615. }
  1616. /*****************************************************************************
  1617.  * FUNCTION
  1618.  *  mmi_voip_update_prof_acct_cache_to_disp
  1619.  * DESCRIPTION
  1620.  *  Copy g_voip_cntx_p->prof_setting_info.saved_prof[index] to
  1621.  *  g_voip_cntx_p->prof_setting_info.disp_prof for Account Setting.
  1622.  * PARAMETERS
  1623.  *  profIndex           [IN]            Index of intended to update profile
  1624.  * RETURNS
  1625.  *  void
  1626.  *****************************************************************************/
  1627. void mmi_voip_update_prof_acct_cache_to_disp(S32 profIndex)
  1628. {
  1629.     /*----------------------------------------------------------------*/
  1630.     /* Local Variables                                                */
  1631.     /*----------------------------------------------------------------*/
  1632.     /*----------------------------------------------------------------*/
  1633.     /* Code Body                                                      */
  1634.     /*----------------------------------------------------------------*/
  1635.     /* SIP Server */
  1636.     memset(g_voip_cntx_p->prof_setting_info.disp_prof.serverName, 0, (VOIP_URI_LEN * ENCODING_LENGTH));
  1637.     AnsiiNToUnicodeString(
  1638.         (S8*)g_voip_cntx_p->prof_setting_info.disp_prof.serverName,
  1639.         (S8*)g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].acct_info.sipServer,
  1640.         VOIP_URI_LEN);
  1641.     /* SIP Port */
  1642.     memset(g_voip_cntx_p->prof_setting_info.disp_prof.portNumber, 0, (MMI_VOIP_MAX_PORT_LEN * ENCODING_LENGTH));
  1643.     gui_itoa(
  1644.         g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].acct_info.sipPort,
  1645.         (UI_string_type)g_voip_cntx_p->prof_setting_info.disp_prof.portNumber,
  1646.         10);
  1647.     /* Display Name */
  1648.     memset(g_voip_cntx_p->prof_setting_info.disp_prof.displayName, 0, (VOIP_DISP_NAME_LEN * sizeof(U16)));
  1649.     pfnUnicodeStrncpy(
  1650.         (S8*)g_voip_cntx_p->prof_setting_info.disp_prof.displayName,
  1651.         (S8*)g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].acct_info.dispName,
  1652.         VOIP_DISP_NAME_LEN);
  1653.     /* Username */
  1654.     memset(g_voip_cntx_p->prof_setting_info.disp_prof.username, 0, (VOIP_USERNAME_LEN * ENCODING_LENGTH));
  1655.     AnsiiNToUnicodeString(
  1656.         (S8*)g_voip_cntx_p->prof_setting_info.disp_prof.username,
  1657.         (S8*)g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].acct_info.username,
  1658.         VOIP_USERNAME_LEN);
  1659.     /* Password */
  1660.     memset(g_voip_cntx_p->prof_setting_info.disp_prof.password, 0, (VOIP_PASSWORD_LEN * ENCODING_LENGTH));
  1661.     AnsiiNToUnicodeString(
  1662.         (S8*)g_voip_cntx_p->prof_setting_info.disp_prof.password,
  1663.         (S8*)g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].acct_info.password,
  1664.         VOIP_PASSWORD_LEN);
  1665.     /* Authorization Name */
  1666.     memset(g_voip_cntx_p->prof_setting_info.disp_prof.authName, 0, (VOIP_USERNAME_LEN * ENCODING_LENGTH));
  1667.     AnsiiNToUnicodeString(
  1668.         (S8*)g_voip_cntx_p->prof_setting_info.disp_prof.authName,
  1669.         (S8*)g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].acct_info.authName,
  1670.         VOIP_USERNAME_LEN);
  1671. }
  1672. /*****************************************************************************
  1673.  * FUNCTION
  1674.  *  mmi_voip_update_prof_outbound_cache_to_disp
  1675.  * DESCRIPTION
  1676.  *  Copy g_voip_cntx_p->prof_setting_info.saved_prof[index] to
  1677.  *  g_voip_cntx_p->prof_setting_info.disp_prof for Outbound Server.
  1678.  * PARAMETERS
  1679.  *  profIndex           [IN]            Index of intended to update profile
  1680.  * RETURNS
  1681.  *  void
  1682.  *****************************************************************************/
  1683. void mmi_voip_update_prof_outbound_cache_to_disp(S32 profIndex)
  1684. {
  1685.     /*----------------------------------------------------------------*/
  1686.     /* Local Variables                                                */
  1687.     /*----------------------------------------------------------------*/
  1688.     /*----------------------------------------------------------------*/
  1689.     /* Code Body                                                      */
  1690.     /*----------------------------------------------------------------*/
  1691.     /* Status */
  1692.     g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex =
  1693.         g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].out_server_info.status;
  1694.     /* Outbound Server */
  1695.     memset(g_voip_cntx_p->prof_setting_info.disp_prof.serverName, 0, (VOIP_URI_LEN * ENCODING_LENGTH));
  1696.     AnsiiNToUnicodeString(
  1697.         (S8*)g_voip_cntx_p->prof_setting_info.disp_prof.serverName,
  1698.         (S8*)g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].out_server_info.server,
  1699.         VOIP_URI_LEN);
  1700.     /* Outbound Port */
  1701.     memset(g_voip_cntx_p->prof_setting_info.disp_prof.portNumber, 0, (MMI_VOIP_MAX_PORT_LEN * ENCODING_LENGTH));
  1702.     gui_itoa(
  1703.         g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].out_server_info.port,
  1704.         (UI_string_type)g_voip_cntx_p->prof_setting_info.disp_prof.portNumber,
  1705.         10);
  1706.     /* Username */
  1707.     memset(g_voip_cntx_p->prof_setting_info.disp_prof.username, 0, (VOIP_USERNAME_LEN * ENCODING_LENGTH));
  1708.     AnsiiNToUnicodeString(
  1709.         (S8*)g_voip_cntx_p->prof_setting_info.disp_prof.username,
  1710.         (S8*)g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].out_server_info.username,
  1711.         VOIP_USERNAME_LEN);
  1712.     /* Password */
  1713.     memset(g_voip_cntx_p->prof_setting_info.disp_prof.password, 0, (VOIP_PASSWORD_LEN * ENCODING_LENGTH));
  1714.     AnsiiNToUnicodeString(
  1715.         (S8*)g_voip_cntx_p->prof_setting_info.disp_prof.password,
  1716.         (S8*)g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].out_server_info.password,
  1717.         VOIP_PASSWORD_LEN);
  1718. }
  1719. /*****************************************************************************
  1720.  * FUNCTION
  1721.  *  mmi_voip_update_prof_register_cache_to_disp
  1722.  * DESCRIPTION
  1723.  *  Copy g_voip_cntx_p->prof_setting_info.saved_prof[index] to
  1724.  *  g_voip_cntx_p->prof_setting_info.disp_prof for Register Server.
  1725.  * PARAMETERS
  1726.  *  profIndex           [IN]            Index of intended to update profile
  1727.  * RETURNS
  1728.  *  void
  1729.  *****************************************************************************/
  1730. void mmi_voip_update_prof_register_cache_to_disp(S32 profIndex)
  1731. {
  1732.     /*----------------------------------------------------------------*/
  1733.     /* Local Variables                                                */
  1734.     /*----------------------------------------------------------------*/
  1735.     /*----------------------------------------------------------------*/
  1736.     /* Code Body                                                      */
  1737.     /*----------------------------------------------------------------*/
  1738.     /* Status */
  1739.     g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex =
  1740.         g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].reg_server_info.status;
  1741.     /* Register Server */
  1742.     memset(g_voip_cntx_p->prof_setting_info.disp_prof.serverName, 0, (VOIP_URI_LEN * ENCODING_LENGTH));
  1743.     AnsiiNToUnicodeString(
  1744.         (S8*)g_voip_cntx_p->prof_setting_info.disp_prof.serverName,
  1745.         (S8*)g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].reg_server_info.server,
  1746.         VOIP_URI_LEN);
  1747.     /* Register Port */
  1748.     memset(g_voip_cntx_p->prof_setting_info.disp_prof.portNumber, 0, (MMI_VOIP_MAX_PORT_LEN * ENCODING_LENGTH));
  1749.     gui_itoa(
  1750.         g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].reg_server_info.port,
  1751.         (UI_string_type)g_voip_cntx_p->prof_setting_info.disp_prof.portNumber,
  1752.         10);
  1753.     /* Username */
  1754.     memset(g_voip_cntx_p->prof_setting_info.disp_prof.username, 0, (VOIP_USERNAME_LEN * ENCODING_LENGTH));
  1755.     AnsiiNToUnicodeString(
  1756.         (S8*)g_voip_cntx_p->prof_setting_info.disp_prof.username,
  1757.         (S8*)g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].reg_server_info.username,
  1758.         VOIP_USERNAME_LEN);
  1759.     /* Password */
  1760.     memset(g_voip_cntx_p->prof_setting_info.disp_prof.password, 0, (VOIP_PASSWORD_LEN * ENCODING_LENGTH));
  1761.     AnsiiNToUnicodeString(
  1762.         (S8*)g_voip_cntx_p->prof_setting_info.disp_prof.password,
  1763.         (S8*)g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].reg_server_info.password,
  1764.         VOIP_PASSWORD_LEN);
  1765. }
  1766. /*****************************************************************************
  1767.  * FUNCTION
  1768.  *  mmi_voip_update_prof_nat_cache_to_disp
  1769.  * DESCRIPTION
  1770.  *  Copy g_voip_cntx_p->prof_setting_info.saved_prof[index] to
  1771.  *  g_voip_cntx_p->prof_setting_info.disp_prof for NAT Setting.
  1772.  * PARAMETERS
  1773.  *  profIndex           [IN]            Index of intended to update profile
  1774.  * RETURNS
  1775.  *  void
  1776.  *****************************************************************************/
  1777. void mmi_voip_update_prof_nat_cache_to_disp(S32 profIndex)
  1778. {
  1779.     /*----------------------------------------------------------------*/
  1780.     /* Local Variables                                                */
  1781.     /*----------------------------------------------------------------*/
  1782.     /*----------------------------------------------------------------*/
  1783.     /* Code Body                                                      */
  1784.     /*----------------------------------------------------------------*/
  1785.     /* Status */
  1786.     g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex =
  1787.         g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.natStatus;
  1788.     /* Firewall IP */
  1789.     memset(g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[0], 0, (MMI_VOIP_MAX_IP_SEG * ENCODING_LENGTH));
  1790.     memset(g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[1], 0, (MMI_VOIP_MAX_IP_SEG * ENCODING_LENGTH));
  1791.     memset(g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[2], 0, (MMI_VOIP_MAX_IP_SEG * ENCODING_LENGTH));
  1792.     memset(g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[3], 0, (MMI_VOIP_MAX_IP_SEG * ENCODING_LENGTH));
  1793.     
  1794.     if (g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.natFirewall[0] == 0)
  1795.     {
  1796.         pfnUnicodeStrcpy((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[0], (S8*)zeroIp);
  1797.         pfnUnicodeStrcpy((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[1], (S8*)zeroIp);
  1798.         pfnUnicodeStrcpy((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[2], (S8*)zeroIp);
  1799.         pfnUnicodeStrcpy((S8*)g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[3], (S8*)zeroIp);
  1800.     }
  1801.     else
  1802.     {
  1803.         gui_itoa(
  1804.             g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.natFirewall[0],
  1805.             (UI_string_type)g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[0],
  1806.             10);
  1807.         gui_itoa(
  1808.             g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.natFirewall[1],
  1809.             (UI_string_type)g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[1],
  1810.             10);
  1811.         gui_itoa(
  1812.             g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.natFirewall[2],
  1813.             (UI_string_type)g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[2],
  1814.             10);
  1815.         gui_itoa(
  1816.             g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.natFirewall[3],
  1817.             (UI_string_type)g_voip_cntx_p->prof_setting_info.disp_prof.ipAddr[3],
  1818.             10);
  1819.     }
  1820.     /* STUN Server */
  1821.     memset(g_voip_cntx_p->prof_setting_info.disp_prof.serverName, 0, (VOIP_URI_LEN * ENCODING_LENGTH));
  1822.     AnsiiNToUnicodeString(
  1823.         (S8*)g_voip_cntx_p->prof_setting_info.disp_prof.serverName,
  1824.         (S8*)g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.stunServer,
  1825.         VOIP_URI_LEN);
  1826.     /* STUN Port */
  1827.     memset(g_voip_cntx_p->prof_setting_info.disp_prof.portNumber, 0, (MMI_VOIP_MAX_PORT_LEN * ENCODING_LENGTH));
  1828.     gui_itoa(
  1829.         g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.stunPort,
  1830.         (UI_string_type)g_voip_cntx_p->prof_setting_info.disp_prof.portNumber,
  1831.         10);
  1832.     /* Refresh Interval */
  1833.     g_voip_cntx_p->prof_setting_info.disp_prof.intervalIndex =
  1834.         g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].nat_info.refInterval;
  1835. }
  1836. /*****************************************************************************
  1837.  * FUNCTION
  1838.  *  mmi_voip_update_prof_common_disp_to_cache
  1839.  * DESCRIPTION
  1840.  *  Copy g_voip_cntx_p->prof_setting_info.disp_prof to
  1841.  *  g_voip_cntx_p->prof_setting_info.saved_prof[index] for Common Setting.
  1842.  * PARAMETERS
  1843.  *  profIndex           [IN]            Index of intended to update profile
  1844.  * RETURNS
  1845.  *  void
  1846.  *****************************************************************************/
  1847. void mmi_voip_update_prof_common_disp_to_cache(S32 profIndex)
  1848. {
  1849.     /*----------------------------------------------------------------*/
  1850.     /* Local Variables                                                */
  1851.     /*----------------------------------------------------------------*/
  1852.     /*----------------------------------------------------------------*/
  1853.     /* Code Body                                                      */
  1854.     /*----------------------------------------------------------------*/
  1855.     /* Profile Name */
  1856.     memset(
  1857.         g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].comm_info.profName,
  1858.         0,
  1859.         (MMI_VOIP_MAX_PROFILE_NAME_LEN * sizeof(U16)));
  1860.     pfnUnicodeStrncpy(
  1861.         (S8*) g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].comm_info.profName,
  1862.         (S8*) g_voip_cntx_p->prof_setting_info.disp_prof.profileName,
  1863.         MMI_VOIP_MAX_PROFILE_NAME_LEN);
  1864.     /* Data Account */
  1865.     g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].comm_info.dataAcct =
  1866.         g_voip_cntx_p->prof_setting_info.disp_prof.dataacctIndex;
  1867.     /* Auto Login */
  1868.     g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].comm_info.autoLogin =
  1869.         g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex;
  1870.     /* Voice Mail Server */
  1871.     memset(g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].comm_info.vmServer, 0, VOIP_URI_LEN);
  1872.     UnicodeNToAnsii(
  1873.         (S8*) g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].comm_info.vmServer,
  1874.         (S8*) g_voip_cntx_p->prof_setting_info.disp_prof.serverName,
  1875.         (VOIP_URI_LEN * ENCODING_LENGTH));
  1876. }
  1877. /*****************************************************************************
  1878.  * FUNCTION
  1879.  *  mmi_voip_update_prof_acct_disp_to_cache
  1880.  * DESCRIPTION
  1881.  *  Copy g_voip_cntx_p->prof_setting_info.disp_prof to
  1882.  *  g_voip_cntx_p->prof_setting_info.saved_prof[index] for Account Setting.
  1883.  * PARAMETERS
  1884.  *  profIndex           [IN]            Index of intended to update profile
  1885.  * RETURNS
  1886.  *  void
  1887.  *****************************************************************************/
  1888. void mmi_voip_update_prof_acct_disp_to_cache(S32 profIndex)
  1889. {
  1890.     /*----------------------------------------------------------------*/
  1891.     /* Local Variables                                                */
  1892.     /*----------------------------------------------------------------*/
  1893.     /*----------------------------------------------------------------*/
  1894.     /* Code Body                                                      */
  1895.     /*----------------------------------------------------------------*/
  1896.     /* SIP Server */
  1897.     memset(g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].acct_info.sipServer, 0, VOIP_URI_LEN);
  1898.     UnicodeNToAnsii(
  1899.         (S8*) g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].acct_info.sipServer,
  1900.         (S8*) g_voip_cntx_p->prof_setting_info.disp_prof.serverName,
  1901.         (VOIP_URI_LEN * ENCODING_LENGTH));
  1902.     /* SIP Port */
  1903.     g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].acct_info.sipPort = gui_atoi((UI_string_type) g_voip_cntx_p->prof_setting_info.disp_prof.portNumber);
  1904.     /* Display Name */
  1905.     memset(
  1906.         g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].acct_info.dispName,
  1907.         0,
  1908.         (VOIP_DISP_NAME_LEN * sizeof(U16)));
  1909.     pfnUnicodeStrncpy(
  1910.         (S8*) g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].acct_info.dispName,
  1911.         (S8*) g_voip_cntx_p->prof_setting_info.disp_prof.displayName,
  1912.         VOIP_DISP_NAME_LEN);
  1913.     /* Username */
  1914.     memset(g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].acct_info.username, 0, VOIP_USERNAME_LEN);
  1915.     UnicodeNToAnsii(
  1916.         (S8*) g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].acct_info.username,
  1917.         (S8*) g_voip_cntx_p->prof_setting_info.disp_prof.username,
  1918.         (VOIP_USERNAME_LEN * ENCODING_LENGTH));
  1919.     /* Password */
  1920.     memset(g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].acct_info.password, 0, VOIP_PASSWORD_LEN);
  1921.     UnicodeNToAnsii(
  1922.         (S8*) g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].acct_info.password,
  1923.         (S8*) g_voip_cntx_p->prof_setting_info.disp_prof.password,
  1924.         (VOIP_PASSWORD_LEN * ENCODING_LENGTH));
  1925.     /* Authorization Name */
  1926.     memset(g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].acct_info.authName, 0, VOIP_USERNAME_LEN);
  1927.     UnicodeNToAnsii(
  1928.         (S8*) g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].acct_info.authName,
  1929.         (S8*) g_voip_cntx_p->prof_setting_info.disp_prof.authName,
  1930.         (VOIP_USERNAME_LEN * ENCODING_LENGTH));
  1931. }
  1932. /*****************************************************************************
  1933.  * FUNCTION
  1934.  *  mmi_voip_update_prof_outbound_disp_to_cache
  1935.  * DESCRIPTION
  1936.  *  Copy g_voip_cntx_p->prof_setting_info.disp_prof to
  1937.  *  g_voip_cntx_p->prof_setting_info.saved_prof[index] for Outbound Server.
  1938.  * PARAMETERS
  1939.  *  profIndex           [IN]            Index of intended to update profile
  1940.  * RETURNS
  1941.  *  void
  1942.  *****************************************************************************/
  1943. void mmi_voip_update_prof_outbound_disp_to_cache(S32 profIndex)
  1944. {
  1945.     /*----------------------------------------------------------------*/
  1946.     /* Local Variables                                                */
  1947.     /*----------------------------------------------------------------*/
  1948.     /*----------------------------------------------------------------*/
  1949.     /* Code Body                                                      */
  1950.     /*----------------------------------------------------------------*/
  1951.     /* Status */
  1952.     g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].out_server_info.status =
  1953.         g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex;
  1954.     /* Outbound Server */
  1955.     memset(g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].out_server_info.server, 0, VOIP_URI_LEN);
  1956.     UnicodeNToAnsii(
  1957.         (S8*) g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].out_server_info.server,
  1958.         (S8*) g_voip_cntx_p->prof_setting_info.disp_prof.serverName,
  1959.         (VOIP_URI_LEN * ENCODING_LENGTH));
  1960.     /* Outbound Port */
  1961.     g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].out_server_info.port = gui_atoi((UI_string_type) g_voip_cntx_p->prof_setting_info.disp_prof.portNumber);
  1962.     /* Username */
  1963.     memset(g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].out_server_info.username, 0, VOIP_USERNAME_LEN);
  1964.     UnicodeNToAnsii(
  1965.         (S8*) g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].out_server_info.username,
  1966.         (S8*) g_voip_cntx_p->prof_setting_info.disp_prof.username,
  1967.         (VOIP_USERNAME_LEN * ENCODING_LENGTH));
  1968.     /* Password */
  1969.     memset(g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].out_server_info.password, 0, VOIP_PASSWORD_LEN);
  1970.     UnicodeNToAnsii(
  1971.         (S8*) g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].out_server_info.password,
  1972.         (S8*) g_voip_cntx_p->prof_setting_info.disp_prof.password,
  1973.         (VOIP_PASSWORD_LEN * ENCODING_LENGTH));
  1974. }
  1975. /*****************************************************************************
  1976.  * FUNCTION
  1977.  *  mmi_voip_update_prof_register_disp_to_cache
  1978.  * DESCRIPTION
  1979.  *  Copy g_voip_cntx_p->prof_setting_info.disp_prof to
  1980.  *  g_voip_cntx_p->prof_setting_info.saved_prof[index] for Register Server.
  1981.  * PARAMETERS
  1982.  *  profIndex           [IN]            Index of intended to update profile
  1983.  * RETURNS
  1984.  *  void
  1985.  *****************************************************************************/
  1986. void mmi_voip_update_prof_register_disp_to_cache(S32 profIndex)
  1987. {
  1988.     /*----------------------------------------------------------------*/
  1989.     /* Local Variables                                                */
  1990.     /*----------------------------------------------------------------*/
  1991.     /*----------------------------------------------------------------*/
  1992.     /* Code Body                                                      */
  1993.     /*----------------------------------------------------------------*/
  1994.     /* Status */
  1995.     g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].reg_server_info.status =
  1996.         g_voip_cntx_p->prof_setting_info.disp_prof.selectionIndex;
  1997.     /* Register Server */
  1998.     memset(g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].reg_server_info.server, 0, VOIP_URI_LEN);
  1999.     UnicodeNToAnsii(
  2000.         (S8*) g_voip_cntx_p->prof_setting_info.saved_prof[profIndex].reg_server_info.server,
  2001.         (S8*) g_voip_cntx_p->prof_setting_info.disp_prof.serverName,